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.Threading.Tasks;
namespace Baldr.Modules.Account.V1.ApiModels
{
public class AccountParameter
{
}
}
| 16.166667 | 44 | 0.752577 | [
"Apache-2.0"
] | CodyALohse/Baldr | Baldr/Baldr/Modules/Account/V1/ApiModels/AccountParameter.cs | 196 | 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 cloudfront-2016-11-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.CloudFront.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
namespace Amazon.CloudFront.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateStreamingDistribution operation
/// </summary>
public class CreateStreamingDistributionResponseUnmarshaller : XmlResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
CreateStreamingDistributionResponse response = new CreateStreamingDistributionResponse();
UnmarshallResult(context,response);
if (context.ResponseData.IsHeaderPresent("ETag"))
response.ETag = context.ResponseData.GetHeaderValue("ETag");
if (context.ResponseData.IsHeaderPresent("Location"))
response.Location = context.ResponseData.GetHeaderValue("Location");
return response;
}
private static void UnmarshallResult(XmlUnmarshallerContext context, CreateStreamingDistributionResponse response)
{
int originalDepth = context.CurrentDepth;
int targetDepth = originalDepth + 1;
while (context.Read())
{
if (context.IsStartElement || context.IsAttribute)
{
if (context.TestExpression("StreamingDistribution", targetDepth))
{
var unmarshaller = StreamingDistributionUnmarshaller.Instance;
response.StreamingDistribution = unmarshaller.Unmarshall(context);
continue;
}
}
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
{
return;
}
}
return;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDenied"))
{
return new AccessDeniedException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("CNAMEAlreadyExists"))
{
return new CNAMEAlreadyExistsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InconsistentQuantities"))
{
return new InconsistentQuantitiesException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidArgument"))
{
return new InvalidArgumentException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidOriginAccessIdentity"))
{
return new InvalidOriginAccessIdentityException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidOrigin"))
{
return new InvalidOriginException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("MissingBody"))
{
return new MissingBodyException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("StreamingDistributionAlreadyExists"))
{
return new StreamingDistributionAlreadyExistsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyStreamingDistributionCNAMEs"))
{
return new TooManyStreamingDistributionCNAMEsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyStreamingDistributions"))
{
return new TooManyStreamingDistributionsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyTrustedSigners"))
{
return new TooManyTrustedSignersException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("TrustedSignerDoesNotExist"))
{
return new TrustedSignerDoesNotExistException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
return new AmazonCloudFrontException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
private static CreateStreamingDistributionResponseUnmarshaller _instance = new CreateStreamingDistributionResponseUnmarshaller();
internal static CreateStreamingDistributionResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateStreamingDistributionResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 48.730061 | 187 | 0.661841 | [
"Apache-2.0"
] | miltador-forks/aws-sdk-net | sdk/src/Services/CloudFront/Generated/Model/Internal/MarshallTransformations/CreateStreamingDistributionResponseUnmarshaller.cs | 7,943 | C# |
using System;
using LanguageExt;
using static LanguageExt.Prelude;
using Xunit;
namespace LanguageExt.Tests
{
public class NonNullTests
{
[Fact]
public void ValueCastTest1()
{
Assert.Throws<ValueIsNullException>(
() =>
{
Foo(null);
}
);
Assert.Throws<ValueIsNullException>(
() =>
{
string isnull = null;
Foo(isnull);
}
);
}
[Fact]
public void ValueCastTest2()
{
// These should pass
Foo("Hello");
string world = "World";
Foo(world);
}
[Fact]
public void NotNullReferenceTypeTest()
{
Assert.Throws<ValueIsNullException>(
() =>
{
SomeValue<string> str = null;
});
}
[Fact]
public void SomeCastsToOptionTest()
{
SomeValue<string> some = "Hello";
Option<string> opt = some;
Assert.True(opt.IsSome && opt.IfNone("") == "Hello");
}
private Option<string> GetValue(bool select) =>
select
? Some("Hello")
: None;
void Foo(SomeValue<string> value )
{
if (value.Value == null)
{
failwith<Unit>("Value should never be null");
}
string doesItImplicitlyCastBackToAString = value;
}
void Greet(SomeValue<string> arg)
{
Console.WriteLine(arg);
}
[Fact]
public void AssignToSomeAfterDeclaration()
{
SomeValue<string> val;
val = "Hello";
Assert.True(val.Value != null);
Greet(val);
}
[Fact]
public void AssignToSomeMemberAfterDeclaration()
{
var obj = new SomeClass();
obj.SomeOtherValue = "123";
Console.WriteLine(obj.SomeOtherValue);
Assert.True(obj.SomeValue == "Hello");
Assert.True(obj.SomeOtherValue.IsSome);
Greet(obj.SomeOtherValue);
}
[Fact]
public void AccessUninitialisedEitherMember()
{
var obj = new EitherClass();
match(obj.EitherValue,
Right: r => Console.WriteLine(r),
Left: l => Console.WriteLine(l)
);
Assert.Throws<BottomException>(
() => {
match(obj.EitherOtherValue,
Right: r => Console.WriteLine(r),
Left: l => Console.WriteLine(l)
);
}
);
}
[Fact]
public void AccessUninitialisedSomeMember()
{
var obj = new SomeClass();
Assert.Throws<SomeNotInitialisedException>(
() => {
Greet(obj.SomeOtherValue);
}
);
}
}
class SomeClass
{
public SomeValue<string> SomeValue = "Hello";
public SomeValue<string> SomeOtherValue;
}
#pragma warning disable CS0649
class EitherClass
{
public Either<string, int> EitherValue = "Hello";
public Either<string, int> EitherOtherValue;
}
}
| 23.727891 | 65 | 0.454415 | [
"MIT"
] | 1iveowl/language-ext | LanguageExt.Tests/NonNullTests.cs | 3,490 | C# |
// Copyright 2021 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.
using Google.Cloud.Tools.Common;
using Google.Cloud.Tools.ReleaseManager.History;
using LibGit2Sharp;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace Google.Cloud.Tools.ReleaseManager.BatchRelease
{
/// <summary>
/// The details of what might be released.
/// </summary>
internal class ReleaseProposal
{
public string Id { get; }
public StructuredVersion OldVersion { get; }
public StructuredVersion NewVersion { get; }
private HistoryFile ModifiedHistoryFile { get; }
/// <summary>
/// The history file section being added, or null if this API does not have a version history.
/// </summary>
public HistoryFile.Section NewHistorySection
{
get => ModifiedHistoryFile.Sections.Count > 1 ? ModifiedHistoryFile.Sections[1] : null;
set
{
if (ModifiedHistoryFile.Sections.Count > 1)
{
ModifiedHistoryFile.Sections[1] = value;
}
else
{
throw new InvalidOperationException("Proposal has no new history section to replace");
}
}
}
// Handy for debugging
public override string ToString() => $"Update {Id} from {OldVersion} to {NewVersion}";
private ReleaseProposal(string id, StructuredVersion oldVersion, StructuredVersion newVersion, HistoryFile historyFile) =>
(Id, OldVersion, NewVersion, ModifiedHistoryFile) = (id, oldVersion, newVersion, historyFile);
public static ReleaseProposal CreateFromHistory(Repository repo, string id, StructuredVersion newVersion)
{
var catalog = ApiCatalog.Load();
var api = catalog[id];
var oldVersion = api.StructuredVersion;
api.Version = newVersion.ToString();
var releases = Release.LoadReleases(repo, catalog, api).ToList();
string historyFilePath = HistoryFile.GetPathForPackage(api.Id);
var historyFile = HistoryFile.Load(historyFilePath);
if (!api.NoVersionHistory)
{
var sectionsInserted = historyFile.MergeReleases(releases);
if (sectionsInserted.Count != 1)
{
throw new UserErrorException($"API {api.Id} would have {sectionsInserted.Count} new history sections");
}
}
return new ReleaseProposal(api.Id, oldVersion, newVersion, historyFile);
}
public void Execute(BatchReleaseConfig config)
{
Console.WriteLine(this);
if (config.ShowHistory)
{
if (NewHistorySection is HistoryFile.Section section)
{
Console.WriteLine("New history text:");
foreach (var line in section.Lines)
{
Console.WriteLine($" {line}");
}
}
else
{
Console.WriteLine("(No history text)");
}
}
if (config.DryRun)
{
return;
}
if (config.ConfirmRelease)
{
if (!ConfirmRelease())
{
Console.WriteLine();
return;
}
}
var root = DirectoryLayout.DetermineRootDirectory();
using var repo = new Repository(root);
var original = repo.Head;
// Create a new branch with the desired changes, targeting the primary branch (to make testing changes to batch releasing simpler).
var branchName = $"release-{Id}-{NewVersion}";
var releaseBranch = repo.CreateBranch(branchName, CommandBase.PrimaryBranch);
Commands.Checkout(repo, releaseBranch);
new SetVersionCommand().InternalExecute(Id, NewVersion.ToString(), quiet: true);
ModifiedHistoryFile.Save(HistoryFile.GetPathForPackage(Id));
new CommitCommand().InternalExecute();
new PushCommand().InternalExecute();
// Go back to our current branch
Commands.Checkout(repo, original);
Console.WriteLine();
}
/// <summary>
/// Asks for confirmation, with optional editing.
/// </summary>
/// <returns>true if the release should go ahead; false to skip this release.</returns>
private bool ConfirmRelease()
{
while (true)
{
Console.Write("Proceed with release? (y/n/edit) ");
string response = Console.ReadLine();
switch (response)
{
case "y":
return true;
case "n":
return false;
case "edit":
EditNewHistory();
break;
default:
Console.WriteLine($"Unexpected response '{response}'.");
continue;
}
}
}
/// <summary>
/// Saves the new history section as a temporary file and invokes the editor stored in
/// the VISUAL environment variable. Once the process has exited, the file is re-read
/// and the changes are stored in both NewHistoryText and the first section of the history file.
/// </summary>
private void EditNewHistory()
{
if (NewHistorySection is null)
{
Console.WriteLine("No history to edit.");
return;
}
var editor = Environment.GetEnvironmentVariable("VISUAL");
if (string.IsNullOrEmpty(editor))
{
throw new UserErrorException("Unable to determine text editor. Please set the VISUAL environment variable");
}
string tempFile = Path.GetTempFileName();
File.WriteAllLines(tempFile, NewHistorySection.Lines);
var process = Process.Start(editor, tempFile);
process.WaitForExit();
if (process.ExitCode != 0)
{
Console.WriteLine($"Process exited with code {process.ExitCode}. Ignoring changes.");
}
var lines = File.ReadAllLines(tempFile).ToList();
NewHistorySection = new HistoryFile.Section(NewVersion, lines);
Console.WriteLine("New history text:");
foreach (var line in lines)
{
Console.WriteLine($" {line}");
}
}
}
}
| 37.897436 | 143 | 0.556292 | [
"Apache-2.0"
] | olavloite/google-cloud-dotnet | tools/Google.Cloud.Tools.ReleaseManager/BatchRelease/ReleaseProposal.cs | 7,392 | C# |
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AmplifyBackend.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AmplifyBackend";
}
}
} | 27.64 | 91 | 0.752533 | [
"Apache-2.0"
] | philasmar/aws-sdk-net | sdk/code-analysis/ServiceAnalysis/AmplifyBackend/Generated/PropertyValueAssignmentAnalyzer.cs | 691 | C# |
using UnityEngine;
using Mirror;
[RequireComponent(typeof(Rigidbody))]
public class PlayerMotor : NetworkBehaviour
{
public Camera cam;
[SerializeField]
private GameObject projectile;
private Vector3 velocity;
private Vector3 rotation;
private Vector3 cameraRotation;
private Vector3 jumpVelocity;
private Rigidbody rb;
private void Start()
{
rb = GetComponent<Rigidbody>();
}
public void Move(Vector3 _velocity)
{
velocity = _velocity;
}
public void Rotate(Vector3 _rotation)
{
rotation = _rotation;
}
public void RotateCamera(Vector3 _cameraRotation)
{
cameraRotation = _cameraRotation;
}
public void ApplyJump(Vector3 _jumpVelocity)
{
jumpVelocity = _jumpVelocity;
}
private void FixedUpdate()
{
PerformMovement();
PerformRotation();
}
private void PerformMovement()
{
if(velocity != Vector3.zero)
{
rb.MovePosition(rb.position + velocity * Time.fixedDeltaTime);
//rb.velocity = new Vector3(velocity.x, rb.velocity.y, velocity.z);
}
if (jumpVelocity != Vector3.zero)
{
rb.AddForce(jumpVelocity * Time.fixedDeltaTime, ForceMode.Acceleration);
}
}
private void PerformRotation()
{
rb.MoveRotation(rb.rotation * Quaternion.Euler(rotation));
cam.transform.Rotate(-cameraRotation);
}
}
| 21.171429 | 84 | 0.626856 | [
"MIT"
] | lolomist/unity | Assets/Scripts/PlayerMotor.cs | 1,484 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Linq;
using Xunit;
namespace Microsoft.Win32.RegistryTests
{
public class RegistryKey_CreateSubKey_str_rkpc : RegistryKeyCreateSubKeyTestsBase
{
[Fact]
public void CreateWriteableSubkeyAndWrite()
{
// [] Vanilla; create a new subkey in read/write mode and write to it
const string testValueName = "TestValue";
const string testStringValueName = "TestString";
const string testStringValue = "Hello World!†þ";
const int testValue = 42;
using (var rk = TestRegistryKey.CreateSubKey(TestRegistryKeyName, writable: true))
{
Assert.NotNull(rk);
rk.SetValue(testValueName, testValue);
Assert.Equal(1, rk.ValueCount);
rk.SetValue(testStringValueName, testStringValue);
Assert.Equal(2, rk.ValueCount);
Assert.Equal(testValue, rk.GetValue(testValueName));
Assert.Equal(testStringValue, rk.GetValue(testStringValueName).ToString());
}
}
[Fact]
public void NegativeTests()
{
// Should throw if passed subkey name is null
Assert.Throws<ArgumentNullException>(() => TestRegistryKey.CreateSubKey(null, true));
// Should throw if passed option is invalid
Assert.Throws<ArgumentException>(() => TestRegistryKey.CreateSubKey(TestRegistryKeyName, true, options: (RegistryOptions)(-1)));
Assert.Throws<ArgumentException>(() => TestRegistryKey.CreateSubKey(TestRegistryKeyName, true, options: (RegistryOptions)3));
// Should throw if key length above 255 characters
const int maxValueNameLength = 255;
Assert.Throws<ArgumentException>(() => TestRegistryKey.CreateSubKey(new string('a', maxValueNameLength + 1)));
// Should throw if RegistryKey is readonly
const string name = "FooBar";
TestRegistryKey.SetValue(name, 42);
using (var rk = Registry.CurrentUser.CreateSubKey(TestRegistryKeyName, writable: false, options: RegistryOptions.None))
{
Assert.Throws<UnauthorizedAccessException>(() => rk.CreateSubKey(name));
Assert.Throws<UnauthorizedAccessException>(() => rk.SetValue(name, "String"));
Assert.Throws<UnauthorizedAccessException>(() => rk.DeleteValue(name));
Assert.Throws<UnauthorizedAccessException>(() => rk.DeleteSubKey(name));
Assert.Throws<UnauthorizedAccessException>(() => rk.DeleteSubKeyTree(name));
}
// Should throw if RegistryKey closed
Assert.Throws<ObjectDisposedException>(() =>
{
TestRegistryKey.Dispose();
TestRegistryKey.CreateSubKey(TestRegistryKeyName, true);
});
}
[ActiveIssue(10546)]
[Fact]
public void NegativeTest_DeeplyNestedKey()
{
//According to msdn documentation max nesting level exceeds is 510 but actual is 508
const int maxNestedLevel = 508;
string exceedsNestedSubkeyName = string.Join(@"\", Enumerable.Repeat("a", maxNestedLevel));
Assert.Throws<IOException>(() => TestRegistryKey.CreateSubKey(exceedsNestedSubkeyName, true));
}
[Fact]
public void CreateSubkeyWithEmptyName()
{
// [] Let the name of the created subkey be empty
string expectedName = TestRegistryKey.Name + @"\";
var rk = TestRegistryKey.CreateSubKey(string.Empty, true);
Assert.NotNull(rk);
Assert.Equal(expectedName, rk.Name);
}
[Theory]
[InlineData(false, RegistryOptions.Volatile)]
[InlineData(true, RegistryOptions.Volatile)]
[InlineData(false, RegistryOptions.None)]
[InlineData(true, RegistryOptions.None)]
public void RegistryOptionsTestsValid(bool alreadyExists, RegistryOptions options)
{
string subkey = "TEST_" + options.ToString();
if (alreadyExists)
{
TestRegistryKey.CreateSubKey(subkey);
}
Assert.NotNull(TestRegistryKey.CreateSubKey(subkey));
}
[Theory]
[MemberData(nameof(TestRegistrySubKeyNames))]
public void CreateSubKey_Writable_KeyExists_OpensKeyWithFixedUpName(string expected, string subKeyName) =>
Verify_CreateSubKey_KeyExists_OpensKeyWithFixedUpName(expected, () => TestRegistryKey.CreateSubKey(subKeyName, writable: true));
[Theory]
[MemberData(nameof(TestRegistrySubKeyNames))]
public void CreateSubKey_NonWritable_KeyExists_OpensKeyWithFixedUpName(string expected, string subKeyName) =>
Verify_CreateSubKey_KeyExists_OpensKeyWithFixedUpName(expected, () => TestRegistryKey.CreateSubKey(subKeyName, writable: false));
[Theory]
[MemberData(nameof(TestRegistrySubKeyNames))]
public void CreateSubKey_Writable_KeyDoesNotExist_CreatesKeyWithFixedUpName(string expected, string subKeyName) =>
Verify_CreateSubKey_KeyDoesNotExist_CreatesKeyWithFixedUpName(expected, () => TestRegistryKey.CreateSubKey(subKeyName, writable: true));
[Theory]
[MemberData(nameof(TestRegistrySubKeyNames))]
public void CreateSubKey_NonWritable_KeyDoesNotExist_CreatesKeyWithFixedUpName(string expected, string subKeyName) =>
Verify_CreateSubKey_KeyDoesNotExist_CreatesKeyWithFixedUpName(expected, () => TestRegistryKey.CreateSubKey(subKeyName, writable: false));
}
}
| 45.530769 | 149 | 0.654334 | [
"MIT"
] | FrancisFYK/corefx | src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_CreateSubKey_str_rkpc.cs | 5,922 | C# |
// leveldb-sharp
//
// Copyright (c) 2011 The LevelDB Authors
// Copyright (c) 2013, Mirco Bauer <meebey@meebey.net>
// 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 Google Inc. 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
// OWNER 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 System;
namespace LevelDB
{
/// <summary>
/// Note that if the process dies after the Put of key2 but before the
/// delete of key1, the same value may be left stored under multiple keys.
/// Such problems can be avoided by using the WriteBatch class to
/// atomically apply a set of updates.
/// The WriteBatch holds a sequence of edits to be made to the database,
/// and these edits within the batch are applied in order. Note that we
/// called Delete before Put so that if key1 is identical to key2, we do
/// not end up erroneously dropping the value entirely.
/// Apart from its atomicity benefits, WriteBatch may also be used to speed
/// up bulk updates by placing lots of individual mutations into the same
/// batch.
/// </summary>
/// <remarks>
/// This type is not thread safe.
///
/// If two threads share this object, they must protect access to it using
/// their own locking protocol.
/// </remarks>
public class WriteBatch
{
/// <summary>
/// Native handle
/// </summary>
public IntPtr Handle { get; private set; }
public WriteBatch()
{
Handle = Native.leveldb_writebatch_create();
}
~WriteBatch()
{
Native.leveldb_writebatch_destroy(Handle);
}
public WriteBatch Put(string key, string value)
{
Native.leveldb_writebatch_put(Handle, key, value);
return this;
}
public WriteBatch Delete(string key)
{
Native.leveldb_writebatch_delete(Handle, key);
return this;
}
public void Clear()
{
Native.leveldb_writebatch_clear(Handle);
}
}
}
| 38.263736 | 79 | 0.66973 | [
"Apache-2.0"
] | NukkitReborn/DBViewer | DBViewer/leveldb-sharp/WriteBatch.cs | 3,482 | C# |
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using XMachine.Reflection;
namespace XMachine.Components.Identifiers
{
/// <summary>
/// The <see cref="XIdentifierReader"/> component uses a set of <see cref="XIdentifier{TType, TId}"/> objects to
/// allow an <see cref="XReader"/> to deserialize objects that were serialized by reference.
/// </summary>
public sealed class XIdentifierReader : XReaderComponent
{
private readonly IDictionary<object, object> referenceObjects;
internal XIdentifierReader()
{
Identifier = new XCompositeIdentifier();
referenceObjects = new Dictionary<object, object>(Identifier.KeyComparer);
}
internal XIdentifierReader(XCompositeIdentifier identifiers)
{
Identifier = new XCompositeIdentifier(identifiers);
referenceObjects = new Dictionary<object, object>(Identifier.KeyComparer);
}
/// <summary>
/// The <see cref="XCompositeIdentifier"/> object used to store the <see cref="XIdentifier{TType, TId}"/>
/// objects affecting this read operation.
/// </summary>
public XCompositeIdentifier Identifier { get; }
protected override bool OnRead<T>(IXReadOperation reader, XType<T> xType, XElement element, Func<object, bool> assign,
XObjectArgs args)
{
Type type = typeof(T);
// A serialized reference has no attributes, no elements, some text, is of a type that can be ID'd,
// and not of a type that has a registered XTexter
string value = element.Value;
if (!element.HasAttributes &&
!element.HasElements &&
!string.IsNullOrEmpty(value) &&
xType.Component<XTexter<T>>() == null &&
Identifier.CanId(type, out Type idType))
{
bool idFound = false;
object id = null;
reader.Read(element, idType, x =>
{
idFound = true;
if (!Identifier.KeyComparer.Equals(x, ReflectionTools.GetDefaultValue(idType)))
{
id = x;
}
return true;
},
XObjectArgs.DefaultIgnoreElementName);
// Schedule a task to assign the object if it shows up in the dictionary
reader.AddTask(this, () =>
{
if (!idFound)
{
return false;
}
if (id == null)
{
return true;
}
if (referenceObjects.TryGetValue(id, out object refObject))
{
if (refObject == null || type == refObject.GetType())
{
return assign(refObject);
}
else
{
throw new InvalidOperationException(
$"Possible collision: the reference object with ID {id} was of expected type {type.Name}, " +
$"but that ID resolved to an object of type {refObject.GetType().Name}.");
}
}
return false;
});
return true;
}
return false;
}
protected override bool OnRead<T>(IXReadOperation reader, XType<T> xType, XAttribute attribute, Func<object, bool> assign,
XObjectArgs args)
{
Type type = typeof(T);
if (Identifier.CanId(type))
{
string text = attribute.Value;
if (!string.IsNullOrWhiteSpace(text) && text.Length > 0)
{
reader.AddTask(this, () =>
{
if (referenceObjects.TryGetValue(text, out object refObject))
{
if (refObject == null || refObject.GetType() == type)
{
return assign(refObject);
}
else
{
throw new InvalidOperationException(
$"Possible collision: the reference object with ID {text} was of expected type {type.Name}, " +
$"but that ID resolved to an object of type {refObject.GetType().Name}.");
}
}
return false;
});
return true;
}
}
return false;
}
protected override void OnSubmit(IXReadOperation reader, object obj)
{
if (obj != null && Identifier.CanId(obj.GetType()))
{
object id = Identifier.GetId(obj);
if (id != null)
{
Submit(id, obj);
}
else
{
reader.AddTask(this, () =>
{
object id2 = Identifier.GetId(obj);
if (id2 != null)
{
Submit(id2, obj);
return true;
}
return false;
});
}
}
}
private void Submit(object id, object obj)
{
if (!referenceObjects.TryGetValue(id, out object existing))
{
referenceObjects.Add(id, obj);
}
else if (Equals(obj, existing))
{
throw new InvalidOperationException($"Reference-type object read more than once on ID '{id}'.");
}
else
{
throw new InvalidOperationException($"Reference collision on ID '{id}'.");
}
}
}
}
| 26.375 | 125 | 0.607497 | [
"MIT"
] | Adam-Miettinen/XMachine | Components/Identifiers/XIdentifierReader.cs | 4,644 | C# |
using UnityEngine;
namespace clinvest.migraine
{
public static class ApplicationContext
{
private static string userName;
private static string userId;
private static string authToken;
private static GameObject activePanel;
public static string UserName
{
get
{
return userName;
}
set
{
userName = value;
}
}
public static string UserId
{
get
{
return userId;
}
set
{
userId = value;
}
}
public static string AuthToken
{
get
{
return authToken;
}
set
{
authToken = value;
}
}
public static GameObject ActivePanel
{
get
{
return activePanel;
}
set
{
activePanel = value;
}
}
}
} | 19.966667 | 47 | 0.36394 | [
"MIT"
] | doomlab/Migraine-App | Migraine-App/Assets/Scripts/ApplicationContext.cs | 1,200 | C# |
using System;
namespace LinqAF.Impl
{
static partial class CommonImplementation
{
// single
public static TItem Single<TItem, TEnumerable, TEnumerator>(ref TEnumerable source)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
if (source.IsDefaultValue()) throw CommonImplementation.Uninitialized(nameof(source));
return SingleImpl<TItem, TEnumerable, TEnumerator>(ref source);
}
internal static TItem SingleImpl<TItem, TEnumerable, TEnumerator>(ref TEnumerable source)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
using (var i = source.GetEnumerator())
{
if (!i.MoveNext()) throw CommonImplementation.SequenceEmpty();
var ret = i.Current;
if (i.MoveNext()) throw CommonImplementation.MultipleElements();
return ret;
}
}
// predicate
public static TItem Single<TItem, TEnumerable, TEnumerator>(ref TEnumerable source, Func<TItem, bool> predicate)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
if (source.IsDefaultValue()) throw CommonImplementation.Uninitialized(nameof(source));
if (predicate == null) throw CommonImplementation.ArgumentNull(nameof(predicate));
return SingleImpl<TItem, TEnumerable, TEnumerator>(ref source, predicate);
}
internal static TItem SingleImpl<TItem, TEnumerable, TEnumerator>(ref TEnumerable source, Func<TItem, bool> predicate)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
var ret = default(TItem);
var found = false;
foreach (var item in source)
{
if (predicate(item))
{
if (found) throw CommonImplementation.MultipleMatchingElements();
ret = item;
found = true;
}
}
if (!found)
{
throw CommonImplementation.NoItemsMatched(nameof(predicate));
}
return ret;
}
// default
public static TItem SingleOrDefault<TItem, TEnumerable, TEnumerator>(ref TEnumerable source)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
if (source.IsDefaultValue()) throw CommonImplementation.Uninitialized(nameof(source));
return SingleOrDefaultImpl<TItem, TEnumerable, TEnumerator>(ref source);
}
internal static TItem SingleOrDefaultImpl<TItem, TEnumerable, TEnumerator>(ref TEnumerable source)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
using (var i = source.GetEnumerator())
{
if (!i.MoveNext()) return default(TItem);
var ret = i.Current;
if (i.MoveNext()) throw CommonImplementation.MultipleElements();
return ret;
}
}
// default, predicate
public static TItem SingleOrDefault<TItem, TEnumerable, TEnumerator>(ref TEnumerable source, Func<TItem, bool> predicate)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
if (source.IsDefaultValue()) throw CommonImplementation.Uninitialized(nameof(source));
if (predicate == null) throw CommonImplementation.ArgumentNull(nameof(predicate));
return SingleOrDefaultImpl<TItem, TEnumerable, TEnumerator>(ref source, predicate);
}
internal static TItem SingleOrDefaultImpl<TItem, TEnumerable, TEnumerator>(ref TEnumerable source, Func<TItem, bool> predicate)
where TEnumerable : struct, IStructEnumerable<TItem, TEnumerator>
where TEnumerator : struct, IStructEnumerator<TItem>
{
var ret = default(TItem);
var found = false;
foreach (var item in source)
{
if (predicate(item))
{
if (found) throw CommonImplementation.MultipleMatchingElements();
ret = item;
found = true;
}
}
return ret;
}
}
}
| 37.589147 | 135 | 0.601155 | [
"Apache-2.0"
] | kevin-montrose/LinqAF | LinqAF/Impl/CommonImplementation.Single.cs | 4,851 | C# |
namespace InnerCore.Api.DeConz.Models.Sensors.CLIP
{
public interface CLIPGenericStatus : IGeneralSensor
{
}
}
| 16.428571 | 52 | 0.782609 | [
"MIT"
] | Denifia/InnerCore.Api.DeConz | InnerCore.Api.DeConz/Models/Sensors/CLIP/CLIPGenericStatus.cs | 117 | C# |
using System.Data.Common;
using EntityFrameworkCore.Jet;
using Microsoft.EntityFrameworkCore;
namespace EFCore.Jet.Integration.Test.Model12_ComplexType
{
public class TestContext : DbContext
{
public TestContext(DbContextOptions options) : base(options) { }
public DbSet<Friend> Friends { get; set; }
public DbSet<LessThanFriend> LessThanFriends { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Friend>()
.OwnsOne(_ => _.Address);
modelBuilder.Entity<LessThanFriend>()
.OwnsOne(_ => _.Address);
}
}
}
| 28.96 | 74 | 0.649171 | [
"Apache-2.0"
] | ckosti/EntityFrameworkCore.Jet | test/EFCore.Jet.Integration.Test/Model12_ComplexType/Context.cs | 726 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace eShop.Location.User.Models
{
public class Record
{
public Guid Id { get; set; }
public Guid LocationId { get; set; }
public string Code { get; set; }
public string UserName { get; set; }
public string Name { get; set; }
}
}
| 19.833333 | 44 | 0.610644 | [
"MIT"
] | charlessolar/eShopOnContainersDDD | src/Contexts/Location/Language/User/Models/Record.cs | 359 | 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;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.FindUsages;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Text.Adornments;
namespace Microsoft.CodeAnalysis.LanguageServer
{
internal static class Extensions
{
public static Uri GetURI(this Document document)
{
return new Uri(document.FilePath);
}
public static Document GetDocumentFromURI(this Solution solution, Uri fileName)
{
// TODO: we need to normalize this. but for now, we check both absolute and local path
// right now, based on who calls this, solution might has "/" or "\\" as directory
// separator
var documentId = solution.GetDocumentIdsWithFilePath(fileName.AbsolutePath).FirstOrDefault() ??
solution.GetDocumentIdsWithFilePath(fileName.LocalPath).FirstOrDefault();
return solution.GetDocument(documentId);
}
public static async Task<int> GetPositionFromLinePositionAsync(this Document document, LinePosition linePosition, CancellationToken cancellationToken)
{
var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
return text.Lines.GetPosition(linePosition);
}
public static bool HasVisualStudioLspCapability(this ClientCapabilities clientCapabilities)
{
if (clientCapabilities is VSClientCapabilities vsClientCapabilities)
{
return vsClientCapabilities.SupportsVisualStudioExtensions;
}
return false;
}
public static string GetMarkdownLanguageName(this Document document)
{
switch (document.Project.Language)
{
case LanguageNames.CSharp:
return "csharp";
case LanguageNames.VisualBasic:
return "vb";
case LanguageNames.FSharp:
return "fsharp";
case "TypeScript":
return "typescript";
default:
throw new ArgumentException(string.Format("Document project language {0} is not valid", document.Project.Language));
}
}
public static ClassifiedTextElement GetClassifiedText(this DefinitionItem definition)
{
return new ClassifiedTextElement(definition.DisplayParts.Select(part => new ClassifiedTextRun(part.Tag.ToClassificationTypeName(), part.Text)));
}
}
}
| 40.056338 | 161 | 0.650492 | [
"Apache-2.0"
] | 20chan/roslyn | src/Features/LanguageServer/Protocol/Extensions/Extensions.cs | 2,846 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjetoSecaoModel;
namespace ProjetoSecaoDao
{
public class ConferenciaDao
{
public List<Conferencia> GetConferencias()
{
List<Conferencia> conferencias;
try
{
conferencias = (new PetaPoco.Database("stringConexao")).Query<Conferencia>("SELECT * FROM Conferencia ORDER BY Data desc").ToList();
}
catch (Exception ex)
{
throw new Exception("Erro ao buscar os dados das Conferências no Banco de Dados.");
}
return conferencias;
}
public Conferencia GetConferencias(int conferenciaId)
{
try
{
return (new PetaPoco.Database("stringConexao")).SingleOrDefault<Conferencia>("SELECT * FROM Conferencia WHERE conferencia_id = " + conferenciaId);
}
catch (Exception)
{
throw new Exception("Houve um erro ao buscar esta Conferência no banco de dados, informe ao administrador do sistema!");
}
}
public object InsereConferencia(Conferencia conferencia)
{
try
{
//return (new PetaPoco.Database("stringConexao")).Insert("Movdb", "NumDoc", true, pedido);
return (new PetaPoco.Database("stringConexao")).Insert(conferencia);
}
catch (Exception ex)
{
throw new Exception("Erro ao iniciar a conferência.");
}
}
public bool DeletaConferencia(Conferencia conferencia)
{
try
{
//return (new PetaPoco.Database("stringConexao")).Insert("Movdb", "NumDoc", true, pedido);
(new PetaPoco.Database("stringConexao")).Delete(conferencia);
}
catch (Exception ex)
{
return false;
}
return true;
}
public ConferenciaDao() { }
}
}
| 28.783784 | 162 | 0.547418 | [
"MIT"
] | RodolphoChagas/Conferencia | ProjetoSecaoDao/ConferenciaDao.cs | 2,135 | C# |
//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
namespace Revit.SDK.Samples.ValidateParameters.CS
{
/// <summary>
/// The form is used to show the result
/// </summary>
public partial class MessageForm : System.Windows.Forms.Form
{
/// <summary>
/// store the log file name
/// </summary>
string m_logFileName;
/// <summary>
/// construction of form
/// </summary>
public MessageForm()
{
InitializeComponent();
}
/// <summary>
/// construction method with parameter
/// </summary>
/// <param name="messages">messages</param>
public MessageForm(string[] messages)
: this()
{
string msgText = "";
//If the size of error messages is 0, means the validate parameters is successful
this.Text = "Validate Parameters Message Form";
//create regeneration log file
string assemblyPath;
assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
m_logFileName = assemblyPath + "\\ValidateParametersLog.txt";
StreamWriter writer = File.CreateText(m_logFileName);
writer.Close();
if (messages.Length == 0)
{
msgText = "All types and parameters passed the validation for API";
WriteLog(msgText);
messageRichTextBox.Text = msgText;
}
else
{
foreach (string row in messages)
{
if (row == null) continue;
else
{
WriteLog(row);
msgText += row + "\n";
}
}
}
msgText += "\n\nIf you want to know the validating parameters result, please get the log file at \n"+m_logFileName;
messageRichTextBox.Text = msgText;
this.StartPosition = FormStartPosition.CenterParent;
CheckForIllegalCrossThreadCalls = false;
}
/// <summary>
/// The method is used to write line to log file
/// </summary>
/// <param name="logStr">the log string</param>
private void WriteLog(string logStr)
{
StreamWriter writer = null;
writer = File.AppendText(m_logFileName);
writer.WriteLine(logStr);
writer.Close();
}
}
}
| 36.314286 | 128 | 0.576449 | [
"MIT"
] | xin1627/RevitSdkSamples | SDK/Samples/FamilyCreation/ValidateParameters/CS/MessageForm.cs | 3,813 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using System.Diagnostics;
namespace DiskSpace_Examiner
{
public class ScanResultFile
{
/// <summary>
/// Roots contains a hierarchal listing of all previous results that are retained (smaller folders are reduced to a
/// summary). There can be more than one entry at the top level of Roots as there can be more than one top-level
/// scan conducted (i.e. multiple hard drives).
/// </summary>
public List<DirectorySummary> Roots = new List<DirectorySummary>();
private static XmlSerializer Serializer = new XmlSerializer(typeof(ScanResultFile));
void SerializeTo(Stream str) { Serializer.Serialize(str, this); }
void SerializeTo(TextWriter tw) { Serializer.Serialize(tw, this); }
static ScanResultFile Deserialize(Stream str) { return Serializer.Deserialize(str) as ScanResultFile; }
static ScanResultFile Deserialize(TextReader tr) { return Serializer.Deserialize(tr) as ScanResultFile; }
public static ScanResultFile OpenFile;
public static void Load()
{
try
{
string ScanResultPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "DiskSpace_Examiner_2016_Database.xml");
using (FileStream fs = new FileStream(ScanResultPath, FileMode.Open)) OpenFile = Deserialize(fs);
}
catch (Exception) { OpenFile = new ScanResultFile(); }
}
public static void Save()
{
string ScanResultPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "DiskSpace_Examiner_2016_Database.xml");
using (FileStream fs = new FileStream(ScanResultPath, FileMode.Create)) OpenFile.SerializeTo(fs);
#if DEBUG
// Serialize to a MemoryStream, Deserialize it, and Reserialize it again - then make sure it is identical to the original.
// This validation ensures that our IXmlSerializable custom ReadXml() and WriteXml() are consistent and repeatable.
try
{
using (MemoryStream s1 = new MemoryStream())
{
OpenFile.SerializeTo(s1);
s1.Seek(0, SeekOrigin.Begin);
ScanResultFile FromS1 = Deserialize(s1);
using (MemoryStream s2 = new MemoryStream())
{
FromS1.SerializeTo(s2);
s1.Seek(0, SeekOrigin.Begin);
s2.Seek(0, SeekOrigin.Begin);
byte[] buf1 = new byte[4096];
byte[] buf2 = new byte[4096];
for (; ; )
{
int Count1 = s1.Read(buf1, 0, buf1.Length);
int Count2 = s2.Read(buf2, 0, buf2.Length);
if (Count1 != Count2) throw new Exception("Verification of serialization-deserialization failed due to different lengths.");
for (int ii = 0; ii < Count1; ii++)
{
if (buf1[ii] != buf2[ii]) throw new Exception("Verification of serialization-deserialization failed due to mismatch.");
}
if (Count1 < buf1.Length) break; // EOF reached.
}
}
}
}
catch (Exception ex)
{
string VerifyPath;
try
{
Load();
VerifyPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "DiskSpace_Examiner_2016_Database.verify.xml");
using (FileStream fs = new FileStream(VerifyPath, FileMode.Create)) OpenFile.SerializeTo(fs);
}
catch (Exception)
{
throw ex;
}
throw new Exception(ex.Message + "\n\nTo compare the original serialization to the deserialize-serialize, compare the database file (" + ScanResultPath + ") to the verification file (" + VerifyPath + ").", ex);
}
#endif
}
/// <summary>
/// Find(FullName) locates the object in the hierarchy that corresponds to the requested path. The search
/// is not case sensitive. Null is returned if the object is not found in the existing hierarchy.
/// </summary>
/// <param name="FullName"></param>
/// <returns>The DirectorySummary corresponding to the requested path name.</returns>
public DirectorySummary Find(string FullName)
{
string ParentFullName = Path.GetDirectoryName(FullName);
if (ParentFullName == null)
{
// We have found a root (or an error).
foreach (DirectorySummary Root in Roots)
{
if (Root.FullName.Equals(FullName, StringComparison.OrdinalIgnoreCase)) return Root;
}
return null; // The requested entry does not exist in the tree.
}
else
{
DirectorySummary dsParent = Find(ParentFullName);
if (dsParent == null) return null;
foreach (DirectorySummary Child in dsParent.Subfolders)
{
if (Child.FullName.Equals(FullName, StringComparison.OrdinalIgnoreCase)) return Child;
}
return null; // The requested entry does not exist in the tree.
}
}
/// <summary>
/// MergeResults replaces or adds NewResults to the existing hierarchy. Placeholder DirectorySummary entries
/// will be created as necessary in order to attach the new entry to a root entry. If the directory already
/// exists in the hierarchy, it is replaced by NewResults. NewResults.Parent may be updated.
/// </summary>
/// <param name="NewResults">The directory to add/update to the scan result file hierarchy.</param>
public void MergeResults(DirectorySummary NewResults)
{
if (NewResults.IsRoot)
{
for (int ii = 0; ii < Roots.Count; )
{
if (Object.ReferenceEquals(Roots[ii], NewResults)) return; // Already merged.
if (Roots[ii].FullName.Equals(NewResults.FullName, StringComparison.OrdinalIgnoreCase))
{
// We have found an existing entry for this path. Replace it with our new results.
Roots.RemoveAt(ii);
}
else ii++;
}
// The NewResults for the new results is not in the hierarchy.
Roots.Add(NewResults);
return;
}
else
{
// So NewResults is not a root. We may need to construct DirectorySummary objects (with LastScanUtc marked as MinValue, never scanned) until
// we can attach this directory to an existing tree or root. For each level, we have to check whether the directory exists or a placeholder
// is needed, then we can work up.
string ParentPath = Path.GetDirectoryName(NewResults.FullName);
DirectorySummary ExistingParent = Find(ParentPath);
if (ExistingParent != null)
{
for (int ii = 0; ii < ExistingParent.Subfolders.Count; )
{
if (Object.ReferenceEquals(ExistingParent.Subfolders[ii], NewResults)) return; // Already merged.
if (ExistingParent.Subfolders[ii].FullName.Equals(NewResults.FullName, StringComparison.OrdinalIgnoreCase))
{
// Remove it. Even if it happens to be pointing to the object we're trying to add, we'll re-add it in a moment.
ExistingParent.Subfolders.RemoveAt(ii);
}
else ii++;
}
ExistingParent.Subfolders.Add(NewResults);
return;
}
// The parent is not present in the hierarchy. We'll need to add at least one layer of unscanned directory in order to advance up a level and repeat.
DirectorySummary Unscanned = new DirectorySummary(null, new DirectoryInfo(ParentPath));
Unscanned.Subfolders.Add(NewResults);
// Note: we don't bother merging counts (i.e. calling Unscanned.MergeChild()) into the unscanned because it is incomplete anyway. It's just a
// hierarchy placeholder.
MergeResults(Unscanned);
}
}
}
}
| 50.206349 | 227 | 0.546844 | [
"MIT"
] | WileEMan/DiskSpace-Examiner | Source/DiskSpace-Examiner/ScanResultFile.cs | 9,491 | C# |
/*
* 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.
*/
using System;
using System.IO;
using System.Windows;
using System.Windows.Input;
namespace ThinkGeo.MapSuite.GisEditor.Plugins
{
internal static class Cursors
{
private static readonly string uriFormat = "/GisEditorPluginCore;component/Images/{0}";
private static Cursor pointCur;
private static Cursor lineCur;
private static Cursor polygonCur;
private static Cursor circleCur;
private static Cursor squareCur;
private static Cursor rectCur;
private static Cursor ellipseCur;
private static Cursor textCur;
internal static Cursor DrawPoint
{
get
{
if (pointCur == null)
{
pointCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawPoint.cur")));
}
return pointCur;
}
}
internal static Cursor DrawLine
{
get
{
if (lineCur == null)
{
lineCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawLine.cur")));
}
return lineCur;
}
}
internal static Cursor DrawPolygon
{
get
{
if (polygonCur == null)
{
polygonCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawPolygon.cur")));
}
return polygonCur;
}
}
internal static Cursor DrawCircle
{
get
{
if (circleCur == null)
{
circleCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawCircle.cur")));
}
return circleCur;
}
}
internal static Cursor DrawSquare
{
get
{
if (squareCur == null)
{
squareCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawSquare.cur")));
}
return squareCur;
}
}
internal static Cursor DrawRectangle
{
get
{
if (rectCur == null)
{
rectCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawRectangle.cur")));
}
return rectCur;
}
}
internal static Cursor DrawEllipse
{
get
{
if (ellipseCur == null)
{
ellipseCur = new Cursor(GetCurStream(string.Format(uriFormat, "drawEllipse.cur")));
}
return ellipseCur;
}
}
internal static Cursor DrawText
{
get
{
if (textCur == null)
{
textCur = new Cursor(GetCurStream(string.Format(uriFormat, "Text Annotation Tool.cur")));
}
return textCur;
}
}
internal static Cursor Select
{
get
{
return System.Windows.Input.Cursors.Arrow;
}
}
private static Stream GetCurStream(string uri)
{
var streamInfo = Application.GetResourceStream(new Uri(uri, UriKind.RelativeOrAbsolute));
return streamInfo.Stream;
}
}
} | 27.458599 | 109 | 0.520065 | [
"Apache-2.0"
] | ThinkGeo/GIS-Editor | MapSuiteGisEditor/GisEditorPluginCore/Plugins/AnnotationPlugin/Shares/Cursors.cs | 4,311 | C# |
namespace Dataflow.Pipeline.Core
{
using System;
using System.Linq;
using System.Reflection;
using Dataflow.Pipeline.DI;
using Microsoft.Extensions.DependencyInjection;
public static class PipepelineServiceCollectionExtensions
{
public static void RegisterPipeline<T>(this IServiceCollection serviceCollection,
bool stepAutoregistration,
Func<StepBuilder<T>, StepBuilder<T>> stepFactory)
{
if(stepAutoregistration)
RegisterSteps(serviceCollection);
serviceCollection.AddSingleton<IPipeline<T, T>>(provider =>
{
var serviceScopeFactory = provider.GetRequiredService<IServiceScopeFactory>();
var stepBuilder
= stepFactory(new StepBuilder<T>());
return stepBuilder
.Builder
.Build(new ScopedServicesDependencyResolver(serviceScopeFactory));
});
}
public static void RegisterSteps(this IServiceCollection serviceCollection)
{
var assembly = Assembly.GetEntryAssembly();
var types = assembly.GetTypes()
.Where(x =>
(x.IsInterface || x.IsClass)
&& x.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IPipelineStep<>)))
.ToList();
types.ForEach(t =>serviceCollection.AddScoped(t));
}
}
} | 33.680851 | 127 | 0.566646 | [
"MIT"
] | goOrn/Dataflow.Pipeline | src/Dataflow.Pipeline/Core/PipepelineServiceCollectionExtensions.cs | 1,585 | C# |
/* _BEGIN_TEMPLATE_
{
"id": "BRMA09_4H",
"name": [
"黑翼",
"Blackwing"
],
"text": [
"<b>英雄技能</b>\n召唤一个5/4的龙人。获得另一个英雄技能。",
"<b>Hero Power</b>\nSummon a 5/4 Dragonkin. Get a new Hero Power."
],
"CardClass": "NEUTRAL",
"type": "HERO_POWER",
"cost": 1,
"rarity": null,
"set": "BRM",
"collectible": null,
"dbfId": 2523
}
_END_TEMPLATE_ */
namespace HREngine.Bots
{
class Sim_BRMA09_4H : SimTemplate
{
}
} | 16.107143 | 70 | 0.567627 | [
"MIT"
] | chi-rei-den/Silverfish | cards/BRM/BRMA09/Sim_BRMA09_4H.cs | 499 | C# |
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
namespace danielCherrin_ProbCalc
{
public partial class App : Application
{
public App ()
{
InitializeComponent();
MainPage = new MainPage();
}
protected override void OnStart ()
{
// Handle when your app starts
}
protected override void OnSleep ()
{
// Handle when your app sleeps
}
protected override void OnResume ()
{
// Handle when your app resumes
}
}
}
| 16.030303 | 60 | 0.691871 | [
"MIT"
] | ChannelPixel/danielCherrin_ProbCalc | danielCherrin_ProbCalc/danielCherrin_ProbCalc/App.xaml.cs | 529 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace AlwaysMoveForward.PointChart.Web
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapMvcAttributeRoutes();
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute("PointEarnerObject", // Route name
"{controller}/{action}/{pointEarnerId}/{id}", // URL with parameters
new
{
controller = "Home",
action = "Index",
pointEarnerId = UrlParameter.Optional,
id = UrlParameter.Optional
} // Parameter defaults
);
}
}
}
| 32.72973 | 111 | 0.49711 | [
"MIT"
] | artieac/PointChart | src/Web/App_Start/RouteConfig.cs | 1,213 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace Geopoiesis.Interfaces
{
public interface IInputStateHandler : IInputStateManager
{
IKeyboardStateManager KeyboardManager { get; set; }
IGamePadManager GamePadManager { get; set; }
IMouseStateManager MouseManager { get; set; }
}
}
| 25.571429 | 61 | 0.692737 | [
"MIT"
] | NemoKradXNA/GameJams | GeopoiesisLib/Interfaces/IInputStateHandler.cs | 360 | C# |
// <auto-generated />
using System;
using ComputerStore.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ComputerStore.Migrations.AppIdentityDb
{
[DbContext(typeof(AppIdentityDbContext))]
[Migration("20190710154506_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}
| 34.914163 | 125 | 0.491211 | [
"MIT"
] | RomanGL/ComputerStore | ComputerStore/Migrations/AppIdentityDb/20190710154506_Initial.Designer.cs | 8,137 | C# |
//------------------------------------------------------------------------------
// This code was generated by TemplateProcessor Version: 1.1.0.0
// using the template file: TemplateExtensions.txt.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using FpML.V5r11.Codelist;
using Orion.Util.NamedValues;
namespace FpML.V5r11.Codes
{
public interface IFpMLCodeValue
{
string GetPrimaryKey();
}
public interface IFpMLCodeScheme
{
string GetItemName(string suffix);
NamedValueSet GetItemProps();
IFpMLCodeValue CreateCodeValue(Row dataRow);
string GetFpMLSource();
void AddCodeValue(IFpMLCodeValue codeValue);
}
public enum FpMLCodeSchemeEnum
{
AssetClass,
AssetMeasure,
BrokerConfirmationType,
BusinessCenter,
CashflowType,
IndexAnnexSource,
ClearanceSystem,
CompoundingFrequency,
ContractualDefinitions,
ContractualSupplement,
CouponType,
MatrixTerm,
CreditSeniority,
CreditSeniorityTrading,
CreditSupportAgreementType,
CutName,
DayCountFraction,
DerivativeCalculationMethod,
DesignatedPriority,
EntityType,
LoanType,
FloatingRateIndex,
GoverningLaw,
InflationIndexDescription,
InflationIndexSource,
InflationMainPublication,
InformationProvider,
InterpolationMethod,
LocalJurisdiction,
MarketDisruption,
MasterAgreementType,
MasterConfirmationType,
MatrixType,
MortgageSector,
PerturbationType,
PositionStatus,
PriceQuoteUnits,
PricingInputType,
ProductTaxonomy,
ProductTypeSimple,
QueryParameterOperator,
QuoteTiming,
ReasonCode,
Restructuring,
ScheduledDateType,
SettledEntityMatrixSource,
SettlementMethod,
SettlementPriceSource,
SettlementRateOption,
SpreadScheduleType,
TradeCashflowsStatus,
}
public class FpMLCodeSchemeFactory
{
public static IFpMLCodeScheme CreateCodeScheme(string classDefName)
{
switch (classDefName)
{
case "AssetClass": return new AssetMeasureScheme(); //AssetClassScheme();
case "AssetMeasure": return new AssetMeasureScheme();
case "BrokerConfirmationType": return new BrokerConfirmationTypeScheme();
//case "BullionDeliveryLocation": return new BrokerConfirmationTypeScheme(); //BullionDeliveryLocationScheme();
case "BusinessCenter": return new BusinessCenterScheme();
//case "BusinessProcess": return new BusinessCenterScheme();//TODO
case "CashflowType": return new CashflowTypeScheme();
case "IndexAnnexSource": return new IndexAnnexSourceScheme();
case "ClearanceSystem": return new ClearanceSystemScheme();
//case "ClearingStatus": return new ClearanceSystemScheme();//TODO
//case "CollateralDisputeResolutionMethodReason": return new ClearanceSystemScheme();//TODO
//case "CollateralInterestResponseReason": return new ClearanceSystemScheme();//TODO
//case "CollateralMarginCallResponseReason": return new ClearanceSystemScheme();//TODO
//case "CollateralResponseReason": return new ClearanceSystemScheme();//TODO
//case "CollateralReactionReason": return new ClearanceSystemScheme();//TODO
//case "CollateralSubstitutionResponseReason": return new ClearanceSystemScheme();//TODO
//case "CollateralType": return new ClearanceSystemScheme();//TODO
//case "CommodityBusinessCalendar": return new ClearanceSystemScheme();//TODO
//case "CommodityCoalProductSource": return new ClearanceSystemScheme();//TODO
//case "CommodityCoalProductType": return new ClearanceSystemScheme();//TODO
//case "CommodityCoalQualityAdjustments": return new ClearanceSystemScheme();//TODO
//case "CommodityCoalTransportationEquipment": return new ClearanceSystemScheme();//TODO
//case "CommodityCode": return new ClearanceSystemScheme();//TODO
//case "CommodityExpireRelativeToEvent": return new ClearanceSystemScheme();//TODO
//case "CommodityFrequencyType": return new ClearanceSystemScheme();//TODO
//case "CommodityFxType": return new ClearanceSystemScheme();//TODO
//case "CommodityMarketDisruption": return new ClearanceSystemScheme();//TODO
//case "CommodityMarketDisruptionFallback": return new ClearanceSystemScheme();//TODO
//case "CommodityPayRelativeToEvent": return new ClearanceSystemScheme();//TODO
//case "CommodityQuantityFrequency": return new ClearanceSystemScheme();//TODO
//case "CommodityReferencePrice": return new ClearanceSystemScheme();//TODO
case "CompoundingFrequency": return new CompoundingFrequencyScheme();
case "ContractualDefinitions": return new ContractualDefinitionsScheme();
case "ContractualSupplement": return new ContractualSupplementScheme();
case "CouponType": return new CouponTypeScheme();
case "CreditSeniority": return new CreditSeniorityScheme();
case "CreditSeniorityTrading": return new CreditSeniorityTradingScheme();
case "CreditSupportAgreementType": return new CreditSupportAgreementTypeScheme();
case "CutName": return new CutNameScheme();
case "DayCountFraction": return new DayCountFractionScheme();
case "DerivativeCalculationMethod": return new DerivativeCalculationMethodScheme();
case "DesignatedPriority": return new DesignatedPriorityScheme();
case "EntityType": return new EntityTypeScheme();
case "FloatingRateIndex": return new FloatingRateIndexScheme();
case "GoverningLaw": return new GoverningLawScheme();
case "InflationIndexDescription": return new InflationIndexDescriptionScheme();
case "InflationIndexSource": return new InflationIndexSourceScheme();
case "InflationMainPublication": return new InflationMainPublicationScheme();
case "InformationProvider": return new InformationProviderScheme();
case "InterpolationMethod": return new InterpolationMethodScheme();
case "LoanType": return new LoanTypeScheme();
case "LocalJurisdiction": return new LocalJurisdictionScheme();
case "MarketDisruption": return new MarketDisruptionScheme();
case "MasterAgreementType": return new MasterAgreementTypeScheme();
case "MasterConfirmationType": return new MasterConfirmationTypeScheme();
case "MatrixTerm": return new MatrixTermScheme();
case "MatrixType": return new MatrixTypeScheme();
case "MortgageSector": return new MortgageSectorScheme();
case "PerturbationType": return new PerturbationTypeScheme();
case "PositionStatus": return new PositionStatusScheme();
case "PriceQuoteUnits": return new PriceQuoteUnitsScheme();
case "PricingInputType": return new PricingInputTypeScheme();
case "ProductTaxonomy": return new ProductTaxonomyScheme();
case "ProductTypeSimple": return new ProductTypeSimpleScheme();
case "QueryParameterOperator": return new QueryParameterOperatorScheme();
case "QuoteTiming": return new QuoteTimingScheme();
case "ReasonCode": return new ReasonCodeScheme();
case "Restructuring": return new RestructuringScheme();
case "ScheduledDateType": return new ScheduledDateTypeScheme();
case "SettledEntityMatrixSource": return new SettledEntityMatrixSourceScheme();
case "SettlementMethod": return new SettlementMethodScheme();
case "SettlementPriceSource": return new SettlementPriceSourceScheme();
case "SettlementRateOption": return new SettlementRateOptionScheme();
case "SpreadScheduleType": return new SpreadScheduleTypeScheme();
case "TradeCashflowsStatus": return new TradeCashflowsStatusScheme();
default:
throw new ArgumentException("Unknown classDefName: " + classDefName);
}
}
}
// ---------------------------------------- AssetMeasure ----------------------------------------
public enum AssetMeasureEnum
{
Undefined,
NPV, // (1) "NPV"
NPVLocalCurrency, // (2) "NPVLocalCurrency"
Cash, // (3) "Cash"
PayNPV, // (4) "PayNPV"
ReceiveNPV, // (5) "ReceiveNPV"
MarketQuote, // (6) "MarketQuote"
ConvexityAdjustment, // (7) "ConvexityAdjustment"
AccruedInterest, // (8) "AccruedInterest"
Volatility, // (9) "Volatility"
DividendYield, // (10) "DividendYield"
CleanNetCurrentMarketPrice, // (11) "CleanNetCurrentMarketPrice"
CleanGrossCurrentMarketPrice, // (12) "CleanGrossCurrentMarketPrice"
DirtyNetCurrentMarketPrice, // (13) "DirtyNetCurrentMarketPrice"
DirtyGrossCurrentMarketPrice, // (14) "DirtyGrossCurrentMarketPrice"
CleanNetResetPrice, // (15) "CleanNetResetPrice"
CleanGrossResetPrice, // (16) "CleanGrossResetPrice"
DirtyNetResetPrice, // (17) "DirtyNetResetPrice"
DirtyGrossResetPrice, // (18) "DirtyGrossResetPrice"
AccruedInterestResetPrice, // (19) "AccruedInterestResetPrice"
NumberOfUnderlyingSecurities, // (20) "NumberOfUnderlyingSecurities"
ParallelShiftInterestRateSensitivity, // (21) "ParallelShiftInterestRateSensitivity"
BucketedInterestRateSensitivity, // (22) "BucketedInterestRateSensitivity"
BucketedInterestRateConvexity, // (23) "BucketedInterestRateConvexity"
FXSpotSensitivity, // (24) "FXSpotSensitivity"
ValuationDateChangeSensitivity, // (25) "ValuationDateChangeSensitivity"
ParallelShiftInterestRateVolatilitySensitivity, // (26) "ParallelShiftInterestRateVolatilitySensitivity"
BucketedInterestRateVolatilitySensitivity, // (27) "BucketedInterestRateVolatilitySensitivity"
ParallelShiftCreditSpreadSensitivity, // (28) "ParallelShiftCreditSpreadSensitivity"
ParallelShiftDefaultProbabilitySensitivity, // (29) "ParallelShiftDefaultProbabilitySensitivity"
ParallelShiftRecoveryRateSensitivity, // (30) "ParallelShiftRecoveryRateSensitivity"
BucketedCreditSpreadSensitivity, // (31) "BucketedCreditSpreadSensitivity"
BucketedDefaultProbabilitySensitivity, // (32) "BucketedDefaultProbabilitySensitivity"
BucketedRecoveryRateSensitivity, // (33) "BucketedRecoveryRateSensitivity"
VAR, // (34) "VAR"
DE_R, // (35) "DE@R"
EconomicCapital, // (36) "EconomicCapital"
RegulatoryCapital, // (37) "RegulatoryCapital"
ReturnOnEconomicCapital, // (38) "ReturnOnEconomicCapital"
ReturnOnRegulatoryCapital, // (39) "ReturnOnRegulatoryCapital"
RiskConcentration, // (40) "RiskConcentration"
EVA, // (41) "EVA"
MarginalRisk, // (42) "MarginalRisk"
SharpeRatio, // (43) "SharpeRatio"
ModifiedSharpeRatio, // (44) "ModifiedSharpeRatio"
SortinoRatio, // (45) "SortinoRatio"
TreynorRatio, // (46) "TreynorRatio"
CAPMBeta, // (47) "CAPMBeta"
JensensAlpha, // (48) "JensensAlpha"
RAROC, // (49) "RAROC"
ROA, // (50) "ROA"
RORAC, // (51) "RORAC"
PeakExposure, // (52) "PeakExposure"
AverageExposure, // (53) "AverageExposure"
LoanEquivalent, // (54) "LoanEquivalent"
AccruedCoupon, // (55) "AccruedCoupon"
CurrentNotional, // (56) "CurrentNotional"
RecoveryRate, // (57) "RecoveryRate"
CreditSpread, // (58) "CreditSpread"
EquityAccrual, // (59) "EquityAccrual"
RealizedTradingGains, // (60) "RealizedTradingGains"
FundingOnRealizedGains, // (61) "FundingOnRealizedGains"
InterestOnRealizedGains, // (62) "InterestOnRealizedGains"
SettlementFxRate, // (63) "SettlementFxRate"
ImpliedVolatility, // (64) "ImpliedVolatility"
CalculatedStrike, // (65) "CalculatedStrike"
RealizedVariance, // (66) "RealizedVariance"
CashEquivalentLocalCurrency, // (67) "CashEquivalentLocalCurrency"
CashEquivalent, // (68) "CashEquivalent"
TreatedRate, // (69) "TreatedRate"
TransactedNetPrice, // (70) "TransactedNetPrice"
TransactedGrossPrice, // (71) "TransactedGrossPrice"
_LAST_
}
public partial class AssetMeasureValue : IFpMLCodeValue
{
public AssetMeasureValue()
{ }
public AssetMeasureValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class AssetMeasureScheme : IFpMLCodeScheme
{
private static readonly string[] EnumStrings =
{
null, // (0) Undefined
"NPV", // (1) NPV
"NPVLocalCurrency", // (2) NPVLocalCurrency
"Cash", // (3) Cash
"PayNPV", // (4) PayNPV
"ReceiveNPV", // (5) ReceiveNPV
"MarketQuote", // (6) MarketQuote
"ConvexityAdjustment", // (7) ConvexityAdjustment
"AccruedInterest", // (8) AccruedInterest
"Volatility", // (9) Volatility
"DividendYield", // (10) DividendYield
"CleanNetCurrentMarketPrice", // (11) CleanNetCurrentMarketPrice
"CleanGrossCurrentMarketPrice", // (12) CleanGrossCurrentMarketPrice
"DirtyNetCurrentMarketPrice", // (13) DirtyNetCurrentMarketPrice
"DirtyGrossCurrentMarketPrice", // (14) DirtyGrossCurrentMarketPrice
"CleanNetResetPrice", // (15) CleanNetResetPrice
"CleanGrossResetPrice", // (16) CleanGrossResetPrice
"DirtyNetResetPrice", // (17) DirtyNetResetPrice
"DirtyGrossResetPrice", // (18) DirtyGrossResetPrice
"AccruedInterestResetPrice", // (19) AccruedInterestResetPrice
"NumberOfUnderlyingSecurities", // (20) NumberOfUnderlyingSecurities
"ParallelShiftInterestRateSensitivity", // (21) ParallelShiftInterestRateSensitivity
"BucketedInterestRateSensitivity", // (22) BucketedInterestRateSensitivity
"BucketedInterestRateConvexity", // (23) BucketedInterestRateConvexity
"FXSpotSensitivity", // (24) FXSpotSensitivity
"ValuationDateChangeSensitivity", // (25) ValuationDateChangeSensitivity
"ParallelShiftInterestRateVolatilitySensitivity", // (26) ParallelShiftInterestRateVolatilitySensitivity
"BucketedInterestRateVolatilitySensitivity", // (27) BucketedInterestRateVolatilitySensitivity
"ParallelShiftCreditSpreadSensitivity", // (28) ParallelShiftCreditSpreadSensitivity
"ParallelShiftDefaultProbabilitySensitivity", // (29) ParallelShiftDefaultProbabilitySensitivity
"ParallelShiftRecoveryRateSensitivity", // (30) ParallelShiftRecoveryRateSensitivity
"BucketedCreditSpreadSensitivity", // (31) BucketedCreditSpreadSensitivity
"BucketedDefaultProbabilitySensitivity", // (32) BucketedDefaultProbabilitySensitivity
"BucketedRecoveryRateSensitivity", // (33) BucketedRecoveryRateSensitivity
"VAR", // (34) VAR
"DE@R", // (35) DE_R
"EconomicCapital", // (36) EconomicCapital
"RegulatoryCapital", // (37) RegulatoryCapital
"ReturnOnEconomicCapital", // (38) ReturnOnEconomicCapital
"ReturnOnRegulatoryCapital", // (39) ReturnOnRegulatoryCapital
"RiskConcentration", // (40) RiskConcentration
"EVA", // (41) EVA
"MarginalRisk", // (42) MarginalRisk
"SharpeRatio", // (43) SharpeRatio
"ModifiedSharpeRatio", // (44) ModifiedSharpeRatio
"SortinoRatio", // (45) SortinoRatio
"TreynorRatio", // (46) TreynorRatio
"CAPMBeta", // (47) CAPMBeta
"JensensAlpha", // (48) JensensAlpha
"RAROC", // (49) RAROC
"ROA", // (50) ROA
"RORAC", // (51) RORAC
"PeakExposure", // (52) PeakExposure
"AverageExposure", // (53) AverageExposure
"LoanEquivalent", // (54) LoanEquivalent
"AccruedCoupon", // (55) AccruedCoupon
"CurrentNotional", // (56) CurrentNotional
"RecoveryRate", // (57) RecoveryRate
"CreditSpread", // (58) CreditSpread
"EquityAccrual", // (59) EquityAccrual
"RealizedTradingGains", // (60) RealizedTradingGains
"FundingOnRealizedGains", // (61) FundingOnRealizedGains
"InterestOnRealizedGains", // (62) InterestOnRealizedGains
"SettlementFxRate", // (63) SettlementFxRate
"ImpliedVolatility", // (64) ImpliedVolatility
"CalculatedStrike", // (65) CalculatedStrike
"RealizedVariance", // (66) RealizedVariance
"CashEquivalentLocalCurrency", // (67) CashEquivalentLocalCurrency
"CashEquivalent", // (68) CashEquivalent
"TreatedRate", // (69) TreatedRate
"TransactedNetPrice", // (70) TransactedNetPrice
"TransactedGrossPrice", // (71) TransactedGrossPrice
null // (nn) _LAST_
};
public static string GetEnumString(AssetMeasureEnum id) { return EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out AssetMeasureEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (AssetMeasureEnum tempId in Enum.GetValues(typeof(AssetMeasureEnum)))
{
if (String.Compare(idString, EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = AssetMeasureEnum.Undefined;
return false;
}
public static AssetMeasureEnum ParseEnumString(string idString)
{
var result = AssetMeasureEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to AssetMeasureEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "AssetMeasure"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "AssetMeasure");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new AssetMeasureValue(dataRow); }
public string GetFpMLSource() { return "asset-measure-5-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(AssetMeasureValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(AssetMeasureValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
AssetMeasureValue[] newValues = new AssetMeasureValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (AssetMeasureValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("AssetMeasureScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- BrokerConfirmationType ----------------------------------------
public enum BrokerConfirmationTypeEnum
{
Undefined,
AsiaCorporate, // (1) "AsiaCorporate"
AsiaSovereign, // (2) "AsiaSovereign"
AustraliaCorporate, // (3) "AustraliaCorporate"
AustraliaSovereign, // (4) "AustraliaSovereign"
EmergingEuropeanAndMiddleEasternSovereign, // (5) "EmergingEuropeanAndMiddleEasternSovereign"
EuropeanCorporate, // (6) "EuropeanCorporate"
JapanCorporate, // (7) "JapanCorporate"
JapanSovereign, // (8) "JapanSovereign"
LatinAmericaCorporate, // (9) "LatinAmericaCorporate"
LatinAmericaSovereign, // (10) "LatinAmericaSovereign"
NewZealandCorporate, // (11) "NewZealandCorporate"
NewZealandSovereign, // (12) "NewZealandSovereign"
NorthAmericanCorporate, // (13) "NorthAmericanCorporate"
SingaporeCorporate, // (14) "SingaporeCorporate"
SingaporeSovereign, // (15) "SingaporeSovereign"
SubordinatedEuropeanInsuranceCorporate, // (16) "SubordinatedEuropeanInsuranceCorporate"
WesternEuropeanSovereign, // (17) "WesternEuropeanSovereign"
DJ_CDX_NA, // (18) "DJ.CDX.NA"
DJ_CDX_EM_, // (19) "DJ.CDX.EM "
CDXEmergingMarketsDiversifiedTranche, // (20) "CDXEmergingMarketsDiversifiedTranche"
CDXTranche, // (21) "CDXTranche"
iTraxxEurope, // (22) "iTraxxEurope"
iTraxxEuropeTranche, // (23) "iTraxxEuropeTranche"
iTraxxCJ, // (24) "iTraxxCJ"
iTraxxCJTranche, // (25) "iTraxxCJTranche"
iTraxxAsiaExJapan, // (26) "iTraxxAsiaExJapan"
iTraxxAsiaExJapanTranche, // (27) "iTraxxAsiaExJapanTranche"
iTraxxAustralia, // (28) "iTraxxAustralia"
iTraxxAustraliaTranche, // (29) "iTraxxAustraliaTranche"
iTraxxSDI75, // (30) "iTraxxSDI75"
ABX_HH, // (31) "ABX.HH"
CMBX, // (32) "CMBX"
iTraxxLevX, // (33) "iTraxxLevX"
EmergingEuropeanCorporate, // (34) "EmergingEuropeanCorporate"
LatinAmericaCorporateBond, // (35) "LatinAmericaCorporateBond"
LatinAmericaCorporateBondOrLoan, // (36) "LatinAmericaCorporateBondOrLoan"
_LAST_
}
public partial class BrokerConfirmationTypeValue : IFpMLCodeValue
{
public BrokerConfirmationTypeValue()
{ }
public BrokerConfirmationTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class BrokerConfirmationTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"AsiaCorporate", // (1) AsiaCorporate
"AsiaSovereign", // (2) AsiaSovereign
"AustraliaCorporate", // (3) AustraliaCorporate
"AustraliaSovereign", // (4) AustraliaSovereign
"EmergingEuropeanAndMiddleEasternSovereign", // (5) EmergingEuropeanAndMiddleEasternSovereign
"EuropeanCorporate", // (6) EuropeanCorporate
"JapanCorporate", // (7) JapanCorporate
"JapanSovereign", // (8) JapanSovereign
"LatinAmericaCorporate", // (9) LatinAmericaCorporate
"LatinAmericaSovereign", // (10) LatinAmericaSovereign
"NewZealandCorporate", // (11) NewZealandCorporate
"NewZealandSovereign", // (12) NewZealandSovereign
"NorthAmericanCorporate", // (13) NorthAmericanCorporate
"SingaporeCorporate", // (14) SingaporeCorporate
"SingaporeSovereign", // (15) SingaporeSovereign
"SubordinatedEuropeanInsuranceCorporate", // (16) SubordinatedEuropeanInsuranceCorporate
"WesternEuropeanSovereign", // (17) WesternEuropeanSovereign
"DJ.CDX.NA", // (18) DJ_CDX_NA
"DJ.CDX.EM ", // (19) DJ_CDX_EM_
"CDXEmergingMarketsDiversifiedTranche", // (20) CDXEmergingMarketsDiversifiedTranche
"CDXTranche", // (21) CDXTranche
"iTraxxEurope", // (22) iTraxxEurope
"iTraxxEuropeTranche", // (23) iTraxxEuropeTranche
"iTraxxCJ", // (24) iTraxxCJ
"iTraxxCJTranche", // (25) iTraxxCJTranche
"iTraxxAsiaExJapan", // (26) iTraxxAsiaExJapan
"iTraxxAsiaExJapanTranche", // (27) iTraxxAsiaExJapanTranche
"iTraxxAustralia", // (28) iTraxxAustralia
"iTraxxAustraliaTranche", // (29) iTraxxAustraliaTranche
"iTraxxSDI75", // (30) iTraxxSDI75
"ABX.HH", // (31) ABX_HH
"CMBX", // (32) CMBX
"iTraxxLevX", // (33) iTraxxLevX
"EmergingEuropeanCorporate", // (34) EmergingEuropeanCorporate
"LatinAmericaCorporateBond", // (35) LatinAmericaCorporateBond
"LatinAmericaCorporateBondOrLoan", // (36) LatinAmericaCorporateBondOrLoan
null // (nn) _LAST_
};
public static string GetEnumString(BrokerConfirmationTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out BrokerConfirmationTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (BrokerConfirmationTypeEnum tempId in Enum.GetValues(typeof(BrokerConfirmationTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = BrokerConfirmationTypeEnum.Undefined;
return false;
}
public static BrokerConfirmationTypeEnum ParseEnumString(string idString)
{
BrokerConfirmationTypeEnum result = BrokerConfirmationTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to BrokerConfirmationTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "BrokerConfirmationType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "BrokerConfirmationType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new BrokerConfirmationTypeValue(dataRow); }
public string GetFpMLSource() { return "broker-confirmation-type-3-2"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(BrokerConfirmationTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(BrokerConfirmationTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
BrokerConfirmationTypeValue[] newValues = new BrokerConfirmationTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (BrokerConfirmationTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("BrokerConfirmationTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- BusinessCenter ----------------------------------------
public enum BusinessCenterEnum
{
Undefined,
AEAD, // (1) "AEAD"
AEDU, // (2) "AEDU"
ARBA, // (3) "ARBA"
ATVI, // (4) "ATVI"
AUME, // (5) "AUME"
AUSY, // (6) "AUSY"
AUAD, // (7) "AUAD"
AUBR, // (8) "AUBR"
AUPE, // (9) "AUPE"
AUHO, // (10) "AUHO"
BEBR, // (11) "BEBR"
BMHA, // (12) "BMHA"
BRSP, // (13) "BRSP"
CAMO, // (14) "CAMO"
CATO, // (15) "CATO"
CAVA, // (16) "CAVA"
CHGE, // (17) "CHGE"
CHZU, // (18) "CHZU"
CLSA, // (19) "CLSA"
CNBE, // (20) "CNBE"
CZPR, // (21) "CZPR"
DEDU, // (22) "DEDU"
DEFR, // (23) "DEFR"
DEST, // (24) "DEST"
DKCO, // (25) "DKCO"
EETA, // (26) "EETA"
ESAS, // (27) "ESAS"
ESBA, // (28) "ESBA"
ESMA, // (29) "ESMA"
EUTA, // (30) "EUTA"
FIHE, // (31) "FIHE"
FRPA, // (32) "FRPA"
GBLO, // (33) "GBLO"
GRAT, // (34) "GRAT"
HKHK, // (35) "HKHK"
HUBU, // (36) "HUBU"
IDJA, // (37) "IDJA"
IEDU, // (38) "IEDU"
ILTA, // (39) "ILTA"
INMU, // (40) "INMU"
ISRE, // (41) "ISRE"
ITMI, // (42) "ITMI"
ITRO, // (43) "ITRO"
JPTO, // (44) "JPTO"
KRSE, // (45) "KRSE"
KYGE, // (46) "KYGE"
LBBE, // (47) "LBBE"
LULU, // (48) "LULU"
MOMA, // (49) "MOMA"
MXMC, // (50) "MXMC"
MYKL, // (51) "MYKL"
NLAM, // (52) "NLAM"
NOOS, // (53) "NOOS"
NYFD, // (54) "NYFD"
NYSE, // (55) "NYSE"
NZAU, // (56) "NZAU"
NZWE, // (57) "NZWE"
PAPC, // (58) "PAPC"
PHMA, // (59) "PHMA"
PLWA, // (60) "PLWA"
PTLI, // (61) "PTLI"
RUMO, // (62) "RUMO"
SARI, // (63) "SARI"
SEST, // (64) "SEST"
SGSI, // (65) "SGSI"
SKBR, // (66) "SKBR"
THBA, // (67) "THBA"
TRAN, // (68) "TRAN"
TWTA, // (69) "TWTA"
USCH, // (70) "USCH"
USGS, // (71) "USGS"
USLA, // (72) "USLA"
USNY, // (73) "USNY"
USSE, // (74) "USSE"
VECA, // (75) "VECA"
ZAJO, // (76) "ZAJO"
_LAST_
}
public partial class BusinessCenterValue : IFpMLCodeValue
{
public BusinessCenterValue()
{ }
public BusinessCenterValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class BusinessCenterScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"AEAD", // (1) AEAD
"AEDU", // (2) AEDU
"ARBA", // (3) ARBA
"ATVI", // (4) ATVI
"AUME", // (5) AUME
"AUSY", // (6) AUSY
"AUAD", // (7) AUAD
"AUBR", // (8) AUBR
"AUPE", // (9) AUPE
"AUHO", // (10) AUHO
"BEBR", // (11) BEBR
"BMHA", // (12) BMHA
"BRSP", // (13) BRSP
"CAMO", // (14) CAMO
"CATO", // (15) CATO
"CAVA", // (16) CAVA
"CHGE", // (17) CHGE
"CHZU", // (18) CHZU
"CLSA", // (19) CLSA
"CNBE", // (20) CNBE
"CZPR", // (21) CZPR
"DEDU", // (22) DEDU
"DEFR", // (23) DEFR
"DEST", // (24) DEST
"DKCO", // (25) DKCO
"EETA", // (26) EETA
"ESAS", // (27) ESAS
"ESBA", // (28) ESBA
"ESMA", // (29) ESMA
"EUTA", // (30) EUTA
"FIHE", // (31) FIHE
"FRPA", // (32) FRPA
"GBLO", // (33) GBLO
"GRAT", // (34) GRAT
"HKHK", // (35) HKHK
"HUBU", // (36) HUBU
"IDJA", // (37) IDJA
"IEDU", // (38) IEDU
"ILTA", // (39) ILTA
"INMU", // (40) INMU
"ISRE", // (41) ISRE
"ITMI", // (42) ITMI
"ITRO", // (43) ITRO
"JPTO", // (44) JPTO
"KRSE", // (45) KRSE
"KYGE", // (46) KYGE
"LBBE", // (47) LBBE
"LULU", // (48) LULU
"MOMA", // (49) MOMA
"MXMC", // (50) MXMC
"MYKL", // (51) MYKL
"NLAM", // (52) NLAM
"NOOS", // (53) NOOS
"NYFD", // (54) NYFD
"NYSE", // (55) NYSE
"NZAU", // (56) NZAU
"NZWE", // (57) NZWE
"PAPC", // (58) PAPC
"PHMA", // (59) PHMA
"PLWA", // (60) PLWA
"PTLI", // (61) PTLI
"RUMO", // (62) RUMO
"SARI", // (63) SARI
"SEST", // (64) SEST
"SGSI", // (65) SGSI
"SKBR", // (66) SKBR
"THBA", // (67) THBA
"TRAN", // (68) TRAN
"TWTA", // (69) TWTA
"USCH", // (70) USCH
"USGS", // (71) USGS
"USLA", // (72) USLA
"USNY", // (73) USNY
"USSE", // (74) USSE
"VECA", // (75) VECA
"ZAJO", // (76) ZAJO
null // (nn) _LAST_
};
public static string GetEnumString(BusinessCenterEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out BusinessCenterEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (BusinessCenterEnum tempId in Enum.GetValues(typeof(BusinessCenterEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = BusinessCenterEnum.Undefined;
return false;
}
public static BusinessCenterEnum ParseEnumString(string idString)
{
var result = BusinessCenterEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to BusinessCenterEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "BusinessCenter"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "BusinessCenter");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new BusinessCenterValue(dataRow); }
public string GetFpMLSource() { return "business-center-6-2"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(BusinessCenterValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(BusinessCenterValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new BusinessCenterValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (BusinessCenterValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("BusinessCenterScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CashflowType ----------------------------------------
public enum CashflowTypeEnum
{
Undefined,
Premium, // (1) "Premium"
PrincipalExchange, // (2) "PrincipalExchange"
TerminationFee, // (3) "TerminationFee"
PartialTerminationFee, // (4) "PartialTerminationFee"
AssignmentFee, // (5) "AssignmentFee"
Fee, // (6) "Fee"
Coupon, // (7) "Coupon"
InterestReturn, // (8) "InterestReturn"
PriceReturn, // (9) "PriceReturn"
DividendReturn, // (10) "DividendReturn"
CreditEvent, // (11) "CreditEvent"
IncreaseFee, // (12) "IncreaseFee"
AmendmentFee, // (13) "AmendmentFee"
ExerciseFee, // (14) "ExerciseFee"
_LAST_
}
public partial class CashflowTypeValue : IFpMLCodeValue
{
public CashflowTypeValue()
{ }
public CashflowTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CashflowTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Premium", // (1) Premium
"PrincipalExchange", // (2) PrincipalExchange
"TerminationFee", // (3) TerminationFee
"PartialTerminationFee", // (4) PartialTerminationFee
"AssignmentFee", // (5) AssignmentFee
"Fee", // (6) Fee
"Coupon", // (7) Coupon
"InterestReturn", // (8) InterestReturn
"PriceReturn", // (9) PriceReturn
"DividendReturn", // (10) DividendReturn
"CreditEvent", // (11) CreditEvent
"IncreaseFee", // (12) IncreaseFee
"AmendmentFee", // (13) AmendmentFee
"ExerciseFee", // (14) ExerciseFee
null // (nn) _LAST_
};
public static string GetEnumString(CashflowTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CashflowTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CashflowTypeEnum tempId in Enum.GetValues(typeof(CashflowTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CashflowTypeEnum.Undefined;
return false;
}
public static CashflowTypeEnum ParseEnumString(string idString)
{
var result = CashflowTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CashflowTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CashflowType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CashflowType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CashflowTypeValue(dataRow); }
public string GetFpMLSource() { return "cashflow-type-2-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CashflowTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CashflowTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new CashflowTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CashflowTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CashflowTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- IndexAnnexSource ----------------------------------------
public enum IndexAnnexSourceEnum
{
Undefined,
Publisher, // (1) "Publisher"
MasterConfirmation, // (2) "MasterConfirmation"
_LAST_
}
public partial class IndexAnnexSourceValue : IFpMLCodeValue
{
public IndexAnnexSourceValue()
{ }
public IndexAnnexSourceValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class IndexAnnexSourceScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Publisher", // (1) Publisher
"MasterConfirmation", // (2) MasterConfirmation
null // (nn) _LAST_
};
public static string GetEnumString(IndexAnnexSourceEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out IndexAnnexSourceEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (IndexAnnexSourceEnum tempId in Enum.GetValues(typeof(IndexAnnexSourceEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = IndexAnnexSourceEnum.Undefined;
return false;
}
public static IndexAnnexSourceEnum ParseEnumString(string idString)
{
IndexAnnexSourceEnum result = IndexAnnexSourceEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to IndexAnnexSourceEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "IndexAnnexSource"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "IndexAnnexSource");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new IndexAnnexSourceValue(dataRow); }
public string GetFpMLSource() { return "cdx-index-annex-source-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(IndexAnnexSourceValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(IndexAnnexSourceValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
IndexAnnexSourceValue[] newValues = new IndexAnnexSourceValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (IndexAnnexSourceValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("IndexAnnexSourceScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ClearanceSystem ----------------------------------------
public enum ClearanceSystemEnum
{
Undefined,
Clearstream, // (1) "Clearstream"
CREST, // (2) "CREST"
DTCC, // (3) "DTCC"
Euroclear, // (4) "Euroclear"
MonteTitoli, // (5) "MonteTitoli"
_LAST_
}
public partial class ClearanceSystemValue : IFpMLCodeValue
{
public ClearanceSystemValue()
{ }
public ClearanceSystemValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ClearanceSystemScheme : IFpMLCodeScheme
{
private static readonly string[] EnumStrings =
{
null, // (0) Undefined
"Clearstream", // (1) Clearstream
"CREST", // (2) CREST
"DTCC", // (3) DTCC
"Euroclear", // (4) Euroclear
"MonteTitoli", // (5) MonteTitoli
null // (nn) _LAST_
};
public static string GetEnumString(ClearanceSystemEnum id) { return EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ClearanceSystemEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ClearanceSystemEnum tempId in Enum.GetValues(typeof(ClearanceSystemEnum)))
{
if (String.Compare(idString, EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = ClearanceSystemEnum.Undefined;
return false;
}
public static ClearanceSystemEnum ParseEnumString(string idString)
{
ClearanceSystemEnum result = ClearanceSystemEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ClearanceSystemEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ClearanceSystem"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ClearanceSystem");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ClearanceSystemValue(dataRow); }
public string GetFpMLSource() { return "clearance-system-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ClearanceSystemValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ClearanceSystemValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
ClearanceSystemValue[] newValues = new ClearanceSystemValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ClearanceSystemValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ClearanceSystemScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CompoundingFrequency ----------------------------------------
public enum CompoundingFrequencyEnum
{
Undefined,
Continuous, // (1) "Continuous"
Daily, // (2) "Daily"
Weekly, // (3) "Weekly"
Monthly, // (4) "Monthly"
Quarterly, // (5) "Quarterly"
SemiAnnual, // (6) "SemiAnnual"
Annual, // (7) "Annual"
_LAST_
}
public partial class CompoundingFrequencyValue : IFpMLCodeValue
{
public CompoundingFrequencyValue()
{ }
public CompoundingFrequencyValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CompoundingFrequencyScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Continuous", // (1) Continuous
"Daily", // (2) Daily
"Weekly", // (3) Weekly
"Monthly", // (4) Monthly
"Quarterly", // (5) Quarterly
"SemiAnnual", // (6) SemiAnnual
"Annual", // (7) Annual
null // (nn) _LAST_
};
public static string GetEnumString(CompoundingFrequencyEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CompoundingFrequencyEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CompoundingFrequencyEnum tempId in Enum.GetValues(typeof(CompoundingFrequencyEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CompoundingFrequencyEnum.Undefined;
return false;
}
public static CompoundingFrequencyEnum ParseEnumString(string idString)
{
CompoundingFrequencyEnum result = CompoundingFrequencyEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CompoundingFrequencyEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CompoundingFrequency"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CompoundingFrequency");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CompoundingFrequencyValue(dataRow); }
public string GetFpMLSource() { return "compounding-frequency-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CompoundingFrequencyValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CompoundingFrequencyValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
CompoundingFrequencyValue[] newValues = new CompoundingFrequencyValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CompoundingFrequencyValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CompoundingFrequencyScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ContractualDefinitions ----------------------------------------
public enum ContractualDefinitionsEnum
{
Undefined,
ISDA1991, // (1) "ISDA1991"
ISDA1996Equity, // (2) "ISDA1996Equity"
ISDA1997GovernmentBond, // (3) "ISDA1997GovernmentBond"
ISDA1998FX, // (4) "ISDA1998FX"
ISDA2000, // (5) "ISDA2000"
ISDA2002Equity, // (6) "ISDA2002Equity"
ISDA1999Credit, // (7) "ISDA1999Credit"
ISDA2003Credit, // (8) "ISDA2003Credit"
ISDA2004Novation, // (9) "ISDA2004Novation"
ISDA2006, // (10) "ISDA2006"
ISDA2006Inflation, // (11) "ISDA2006Inflation"
_LAST_
}
public partial class ContractualDefinitionsValue : IFpMLCodeValue
{
public ContractualDefinitionsValue()
{ }
public ContractualDefinitionsValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ContractualDefinitionsScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"ISDA1991", // (1) ISDA1991
"ISDA1996Equity", // (2) ISDA1996Equity
"ISDA1997GovernmentBond", // (3) ISDA1997GovernmentBond
"ISDA1998FX", // (4) ISDA1998FX
"ISDA2000", // (5) ISDA2000
"ISDA2002Equity", // (6) ISDA2002Equity
"ISDA1999Credit", // (7) ISDA1999Credit
"ISDA2003Credit", // (8) ISDA2003Credit
"ISDA2004Novation", // (9) ISDA2004Novation
"ISDA2006", // (10) ISDA2006
"ISDA2006Inflation", // (11) ISDA2006Inflation
null // (nn) _LAST_
};
public static string GetEnumString(ContractualDefinitionsEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ContractualDefinitionsEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ContractualDefinitionsEnum tempId in Enum.GetValues(typeof(ContractualDefinitionsEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = ContractualDefinitionsEnum.Undefined;
return false;
}
public static ContractualDefinitionsEnum ParseEnumString(string idString)
{
ContractualDefinitionsEnum result = ContractualDefinitionsEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ContractualDefinitionsEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ContractualDefinitions"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ContractualDefinitions");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ContractualDefinitionsValue(dataRow); }
public string GetFpMLSource() { return "contractual-definitions-3-2"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ContractualDefinitionsValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ContractualDefinitionsValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
ContractualDefinitionsValue[] newValues = new ContractualDefinitionsValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ContractualDefinitionsValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ContractualDefinitionsScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ContractualSupplement ----------------------------------------
public enum ContractualSupplementEnum
{
Undefined,
ISDA1999CreditRestructuring, // (1) "ISDA1999CreditRestructuring"
ISDA1999CreditConvertibleExchangeableAccretingObligations, // (2) "ISDA1999CreditConvertibleExchangeableAccretingObligations"
ISDA1999CreditSuccessorAndCreditEvents, // (3) "ISDA1999CreditSuccessorAndCreditEvents"
ISDA2003CreditMay2003, // (4) "ISDA2003CreditMay2003"
ISDA2003CreditMonolineInsurers, // (5) "ISDA2003CreditMonolineInsurers"
ISDA2003CreditUSMunicipals, // (6) "ISDA2003CreditUSMunicipals"
ISDA2003CreditRussianFederation, // (7) "ISDA2003CreditRussianFederation"
ISDA2003CreditRepublicOfHungary, // (8) "ISDA2003CreditRepublicOfHungary"
ISDA2003CreditRepublicOfHungary2005, // (9) "ISDA2003CreditRepublicOfHungary2005"
ISDA2003CreditMonolineInsurers2005, // (10) "ISDA2003CreditMonolineInsurers2005"
ISDA2003Credit2005MatrixSupplement, // (11) "ISDA2003Credit2005MatrixSupplement"
iTraxxEuropeDealer, // (12) "iTraxxEuropeDealer"
iTraxxEuropeNonDealer, // (13) "iTraxxEuropeNonDealer"
iTraxxEuropeTranche, // (14) "iTraxxEuropeTranche"
iTraxxCJ, // (15) "iTraxxCJ"
iTraxxCJTranche, // (16) "iTraxxCJTranche"
iTraxxAsiaExJapan, // (17) "iTraxxAsiaExJapan"
iTraxxAsiaExJapanTranche, // (18) "iTraxxAsiaExJapanTranche"
iTraxxAustralia, // (19) "iTraxxAustralia"
iTraxxAustraliaTranche, // (20) "iTraxxAustraliaTranche"
CDXTranche, // (21) "CDXTranche"
CDXEmergingMarketsDiversifiedTranche, // (22) "CDXEmergingMarketsDiversifiedTranche"
iTraxxSDI75Dealer, // (23) "iTraxxSDI75Dealer"
iTraxxSDI75NonDealer, // (24) "iTraxxSDI75NonDealer"
ISDA2003CreditArgentineRepublic, // (25) "ISDA2003CreditArgentineRepublic"
ISDA2003LPNReferenceEntities, // (26) "ISDA2003LPNReferenceEntities"
ISDA2003SecuredDeliverableObligationCharacteristic, // (27) "ISDA2003SecuredDeliverableObligationCharacteristic"
iTraxxLevX, // (28) "iTraxxLevX"
ISDA2003DeliveryRestrictions, // (29) "ISDA2003DeliveryRestrictions"
ISDAMarch2004EquityCanadianSupplement, // (30) "ISDAMarch2004EquityCanadianSupplement"
ABXTranche, // (31) "ABXTranche"
ABX, // (32) "ABX"
LCDX, // (33) "LCDX"
LCDXTranche, // (34) "LCDXTranche"
CMBX, // (35) "CMBX"
ISDA2003AdditionalProvisionsLPN, // (36) "ISDA2003AdditionalProvisionsLPN"
ISDA2003STMicroelectronicsNV, // (37) "ISDA2003STMicroelectronicsNV"
ISDA2007FullLookthroughDepositoryReceiptSupplement, // (38) "ISDA2007FullLookthroughDepositoryReceiptSupplement"
ISDA2007PartialLookthroughDepositoryReceiptSupplement, // (39) "ISDA2007PartialLookthroughDepositoryReceiptSupplement"
CDX, // (40) "CDX"
CDXEmergingMarkets, // (41) "CDXEmergingMarkets"
CDXEmergingMarketsDiversified, // (42) "CDXEmergingMarketsDiversified"
MCDX, // (43) "MCDX"
CDSonLeveragedLoans, // (44) "CDSonLeveragedLoans"
CDSonMBS, // (45) "CDSonMBS"
iTraxxJapan, // (46) "iTraxxJapan"
iTraxxJapanTranche, // (47) "iTraxxJapanTranche"
SyndicatedSecuredLoanCDS, // (48) "SyndicatedSecuredLoanCDS"
ISDA2003ContingentCreditSpreadTransaction, // (49) "ISDA2003ContingentCreditSpreadTransaction"
_LAST_
}
public partial class ContractualSupplementValue : IFpMLCodeValue
{
public ContractualSupplementValue()
{ }
public ContractualSupplementValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ContractualSupplementScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"ISDA1999CreditRestructuring", // (1) ISDA1999CreditRestructuring
"ISDA1999CreditConvertibleExchangeableAccretingObligations", // (2) ISDA1999CreditConvertibleExchangeableAccretingObligations
"ISDA1999CreditSuccessorAndCreditEvents", // (3) ISDA1999CreditSuccessorAndCreditEvents
"ISDA2003CreditMay2003", // (4) ISDA2003CreditMay2003
"ISDA2003CreditMonolineInsurers", // (5) ISDA2003CreditMonolineInsurers
"ISDA2003CreditUSMunicipals", // (6) ISDA2003CreditUSMunicipals
"ISDA2003CreditRussianFederation", // (7) ISDA2003CreditRussianFederation
"ISDA2003CreditRepublicOfHungary", // (8) ISDA2003CreditRepublicOfHungary
"ISDA2003CreditRepublicOfHungary2005", // (9) ISDA2003CreditRepublicOfHungary2005
"ISDA2003CreditMonolineInsurers2005", // (10) ISDA2003CreditMonolineInsurers2005
"ISDA2003Credit2005MatrixSupplement", // (11) ISDA2003Credit2005MatrixSupplement
"iTraxxEuropeDealer", // (12) iTraxxEuropeDealer
"iTraxxEuropeNonDealer", // (13) iTraxxEuropeNonDealer
"iTraxxEuropeTranche", // (14) iTraxxEuropeTranche
"iTraxxCJ", // (15) iTraxxCJ
"iTraxxCJTranche", // (16) iTraxxCJTranche
"iTraxxAsiaExJapan", // (17) iTraxxAsiaExJapan
"iTraxxAsiaExJapanTranche", // (18) iTraxxAsiaExJapanTranche
"iTraxxAustralia", // (19) iTraxxAustralia
"iTraxxAustraliaTranche", // (20) iTraxxAustraliaTranche
"CDXTranche", // (21) CDXTranche
"CDXEmergingMarketsDiversifiedTranche", // (22) CDXEmergingMarketsDiversifiedTranche
"iTraxxSDI75Dealer", // (23) iTraxxSDI75Dealer
"iTraxxSDI75NonDealer", // (24) iTraxxSDI75NonDealer
"ISDA2003CreditArgentineRepublic", // (25) ISDA2003CreditArgentineRepublic
"ISDA2003LPNReferenceEntities", // (26) ISDA2003LPNReferenceEntities
"ISDA2003SecuredDeliverableObligationCharacteristic", // (27) ISDA2003SecuredDeliverableObligationCharacteristic
"iTraxxLevX", // (28) iTraxxLevX
"ISDA2003DeliveryRestrictions", // (29) ISDA2003DeliveryRestrictions
"ISDAMarch2004EquityCanadianSupplement", // (30) ISDAMarch2004EquityCanadianSupplement
"ABXTranche", // (31) ABXTranche
"ABX", // (32) ABX
"LCDX", // (33) LCDX
"LCDXTranche", // (34) LCDXTranche
"CMBX", // (35) CMBX
"ISDA2003AdditionalProvisionsLPN", // (36) ISDA2003AdditionalProvisionsLPN
"ISDA2003STMicroelectronicsNV", // (37) ISDA2003STMicroelectronicsNV
"ISDA2007FullLookthroughDepositoryReceiptSupplement", // (38) ISDA2007FullLookthroughDepositoryReceiptSupplement
"ISDA2007PartialLookthroughDepositoryReceiptSupplement", // (39) ISDA2007PartialLookthroughDepositoryReceiptSupplement
"CDX", // (40) CDX
"CDXEmergingMarkets", // (41) CDXEmergingMarkets
"CDXEmergingMarketsDiversified", // (42) CDXEmergingMarketsDiversified
"MCDX", // (43) MCDX
"CDSonLeveragedLoans", // (44) CDSonLeveragedLoans
"CDSonMBS", // (45) CDSonMBS
"iTraxxJapan", // (46) iTraxxJapan
"iTraxxJapanTranche", // (47) iTraxxJapanTranche
"SyndicatedSecuredLoanCDS", // (48) SyndicatedSecuredLoanCDS
"ISDA2003ContingentCreditSpreadTransaction", // (49) ISDA2003ContingentCreditSpreadTransaction
null // (nn) _LAST_
};
public static string GetEnumString(ContractualSupplementEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ContractualSupplementEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ContractualSupplementEnum tempId in Enum.GetValues(typeof(ContractualSupplementEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = ContractualSupplementEnum.Undefined;
return false;
}
public static ContractualSupplementEnum ParseEnumString(string idString)
{
ContractualSupplementEnum result = ContractualSupplementEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ContractualSupplementEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ContractualSupplement"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ContractualSupplement");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ContractualSupplementValue(dataRow); }
public string GetFpMLSource() { return "contractual-supplement-6-8"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ContractualSupplementValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ContractualSupplementValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
ContractualSupplementValue[] newValues = new ContractualSupplementValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ContractualSupplementValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ContractualSupplementScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CouponType ----------------------------------------
public enum CouponTypeEnum
{
Undefined,
Fixed, // (1) "Fixed"
Float, // (2) "Float"
Struct, // (3) "Struct"
_LAST_
}
public partial class CouponTypeValue : IFpMLCodeValue
{
public CouponTypeValue()
{ }
public CouponTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CouponTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Fixed", // (1) Fixed
"Float", // (2) Float
"Struct", // (3) Struct
null // (nn) _LAST_
};
public static string GetEnumString(CouponTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CouponTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CouponTypeEnum tempId in Enum.GetValues(typeof(CouponTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CouponTypeEnum.Undefined;
return false;
}
public static CouponTypeEnum ParseEnumString(string idString)
{
CouponTypeEnum result = CouponTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CouponTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CouponType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CouponType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CouponTypeValue(dataRow); }
public string GetFpMLSource() { return "coupon-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CouponTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CouponTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
CouponTypeValue[] newValues = new CouponTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CouponTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CouponTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- MatrixTerm ----------------------------------------
public enum MatrixTermEnum
{
Undefined,
NorthAmericanCorporate, // (1) "NorthAmericanCorporate"
EuropeanCorporate, // (2) "EuropeanCorporate"
AustraliaCorporate, // (3) "AustraliaCorporate"
NewZealandCorporate, // (4) "NewZealandCorporate"
JapanCorporate, // (5) "JapanCorporate"
SingaporeCorporate, // (6) "SingaporeCorporate"
AsiaCorporate, // (7) "AsiaCorporate"
AsiaSovereign, // (8) "AsiaSovereign"
EmergingEuropeanAndMiddleEasternSovereign, // (9) "EmergingEuropeanAndMiddleEasternSovereign"
JapanSovereign, // (10) "JapanSovereign"
AustraliaSovereign, // (11) "AustraliaSovereign"
NewZealandSovereign, // (12) "NewZealandSovereign"
SingaporeSovereign, // (13) "SingaporeSovereign"
LatinAmericaSovereign, // (14) "LatinAmericaSovereign"
WesternEuropeanSovereign, // (15) "WesternEuropeanSovereign"
SubordinatedEuropeanInsuranceCorporate, // (16) "SubordinatedEuropeanInsuranceCorporate"
LatinAmericaCorporate, // (17) "LatinAmericaCorporate"
EmergingEuropeanCorporate, // (18) "EmergingEuropeanCorporate"
LatinAmericaCorporateBond, // (19) "LatinAmericaCorporateBond"
LatinAmericaCorporateBondOrLoan, // (20) "LatinAmericaCorporateBondOrLoan"
EmergingEuropeanCorporateLPN, // (21) "EmergingEuropeanCorporateLPN"
USMunicipalFullFaithAndCredit, // (22) "USMunicipalFullFaithAndCredit"
USMunicipalGeneralFund, // (23) "USMunicipalGeneralFund"
USMunicipalRevenue, // (24) "USMunicipalRevenue"
_LAST_
}
public partial class MatrixTermValue : IFpMLCodeValue
{
public MatrixTermValue()
{ }
public MatrixTermValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class MatrixTermScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"NorthAmericanCorporate", // (1) NorthAmericanCorporate
"EuropeanCorporate", // (2) EuropeanCorporate
"AustraliaCorporate", // (3) AustraliaCorporate
"NewZealandCorporate", // (4) NewZealandCorporate
"JapanCorporate", // (5) JapanCorporate
"SingaporeCorporate", // (6) SingaporeCorporate
"AsiaCorporate", // (7) AsiaCorporate
"AsiaSovereign", // (8) AsiaSovereign
"EmergingEuropeanAndMiddleEasternSovereign", // (9) EmergingEuropeanAndMiddleEasternSovereign
"JapanSovereign", // (10) JapanSovereign
"AustraliaSovereign", // (11) AustraliaSovereign
"NewZealandSovereign", // (12) NewZealandSovereign
"SingaporeSovereign", // (13) SingaporeSovereign
"LatinAmericaSovereign", // (14) LatinAmericaSovereign
"WesternEuropeanSovereign", // (15) WesternEuropeanSovereign
"SubordinatedEuropeanInsuranceCorporate", // (16) SubordinatedEuropeanInsuranceCorporate
"LatinAmericaCorporate", // (17) LatinAmericaCorporate
"EmergingEuropeanCorporate", // (18) EmergingEuropeanCorporate
"LatinAmericaCorporateBond", // (19) LatinAmericaCorporateBond
"LatinAmericaCorporateBondOrLoan", // (20) LatinAmericaCorporateBondOrLoan
"EmergingEuropeanCorporateLPN", // (21) EmergingEuropeanCorporateLPN
"USMunicipalFullFaithAndCredit", // (22) USMunicipalFullFaithAndCredit
"USMunicipalGeneralFund", // (23) USMunicipalGeneralFund
"USMunicipalRevenue", // (24) USMunicipalRevenue
null // (nn) _LAST_
};
public static string GetEnumString(MatrixTermEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out MatrixTermEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (MatrixTermEnum tempId in Enum.GetValues(typeof(MatrixTermEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = MatrixTermEnum.Undefined;
return false;
}
public static MatrixTermEnum ParseEnumString(string idString)
{
MatrixTermEnum result = MatrixTermEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to MatrixTermEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "MatrixTerm"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "MatrixTerm");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new MatrixTermValue(dataRow); }
public string GetFpMLSource() { return "credit-matrix-transaction-type-3-1"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(MatrixTermValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(MatrixTermValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
MatrixTermValue[] newValues = new MatrixTermValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (MatrixTermValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("MatrixTermScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CreditSeniority ----------------------------------------
public enum CreditSeniorityEnum
{
Undefined,
Senior, // (1) "Senior"
SubTier1, // (2) "SubTier1"
SubUpperTier2, // (3) "SubUpperTier2"
SubLowerTier2, // (4) "SubLowerTier2"
SubTier3, // (5) "SubTier3"
_LAST_
}
public partial class CreditSeniorityValue : IFpMLCodeValue
{
public CreditSeniorityValue()
{ }
public CreditSeniorityValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CreditSeniorityScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Senior", // (1) Senior
"SubTier1", // (2) SubTier1
"SubUpperTier2", // (3) SubUpperTier2
"SubLowerTier2", // (4) SubLowerTier2
"SubTier3", // (5) SubTier3
null // (nn) _LAST_
};
public static string GetEnumString(CreditSeniorityEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CreditSeniorityEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CreditSeniorityEnum tempId in Enum.GetValues(typeof(CreditSeniorityEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CreditSeniorityEnum.Undefined;
return false;
}
public static CreditSeniorityEnum ParseEnumString(string idString)
{
CreditSeniorityEnum result = CreditSeniorityEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CreditSeniorityEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CreditSeniority"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CreditSeniority");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CreditSeniorityValue(dataRow); }
public string GetFpMLSource() { return "credit-seniority-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CreditSeniorityValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CreditSeniorityValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
CreditSeniorityValue[] newValues = new CreditSeniorityValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CreditSeniorityValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CreditSeniorityScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CreditSeniorityTrading ----------------------------------------
public enum CreditSeniorityTradingEnum
{
Undefined,
Senior, // (1) "Senior"
Subordinate, // (2) "Subordinate"
_LAST_
}
public partial class CreditSeniorityTradingValue : IFpMLCodeValue
{
public CreditSeniorityTradingValue()
{ }
public CreditSeniorityTradingValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CreditSeniorityTradingScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Senior", // (1) Senior
"Subordinate", // (2) Subordinate
null // (nn) _LAST_
};
public static string GetEnumString(CreditSeniorityTradingEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CreditSeniorityTradingEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CreditSeniorityTradingEnum tempId in Enum.GetValues(typeof(CreditSeniorityTradingEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CreditSeniorityTradingEnum.Undefined;
return false;
}
public static CreditSeniorityTradingEnum ParseEnumString(string idString)
{
CreditSeniorityTradingEnum result = CreditSeniorityTradingEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CreditSeniorityTradingEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CreditSeniorityTrading"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CreditSeniorityTrading");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CreditSeniorityTradingValue(dataRow); }
public string GetFpMLSource() { return "credit-seniority-trading-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CreditSeniorityTradingValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CreditSeniorityTradingValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
CreditSeniorityTradingValue[] newValues = new CreditSeniorityTradingValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CreditSeniorityTradingValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CreditSeniorityTradingScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CreditSupportAgreementType ----------------------------------------
public enum CreditSupportAgreementTypeEnum
{
Undefined,
ISDA1994CreditSupportAnnexNewYorkLaw, // (1) "ISDA1994CreditSupportAnnexNewYorkLaw"
ISDA1995CreditSupportAnnexEnglishLaw, // (2) "ISDA1995CreditSupportAnnexEnglishLaw"
ISDA1995CreditSupportDeedEnglishLaw, // (3) "ISDA1995CreditSupportDeedEnglishLaw"
ISDA1995CreditSupportAnnexJapaneseLaw, // (4) "ISDA1995CreditSupportAnnexJapaneseLaw"
ISDA2001MarginProvisions, // (5) "ISDA2001MarginProvisions"
_LAST_
}
public partial class CreditSupportAgreementTypeValue : IFpMLCodeValue
{
public CreditSupportAgreementTypeValue()
{ }
public CreditSupportAgreementTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CreditSupportAgreementTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"ISDA1994CreditSupportAnnexNewYorkLaw", // (1) ISDA1994CreditSupportAnnexNewYorkLaw
"ISDA1995CreditSupportAnnexEnglishLaw", // (2) ISDA1995CreditSupportAnnexEnglishLaw
"ISDA1995CreditSupportDeedEnglishLaw", // (3) ISDA1995CreditSupportDeedEnglishLaw
"ISDA1995CreditSupportAnnexJapaneseLaw", // (4) ISDA1995CreditSupportAnnexJapaneseLaw
"ISDA2001MarginProvisions", // (5) ISDA2001MarginProvisions
null // (nn) _LAST_
};
public static string GetEnumString(CreditSupportAgreementTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CreditSupportAgreementTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CreditSupportAgreementTypeEnum tempId in Enum.GetValues(typeof(CreditSupportAgreementTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CreditSupportAgreementTypeEnum.Undefined;
return false;
}
public static CreditSupportAgreementTypeEnum ParseEnumString(string idString)
{
CreditSupportAgreementTypeEnum result = CreditSupportAgreementTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CreditSupportAgreementTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CreditSupportAgreementType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CreditSupportAgreementType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CreditSupportAgreementTypeValue(dataRow); }
public string GetFpMLSource() { return "credit-support-agreement-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CreditSupportAgreementTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CreditSupportAgreementTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
CreditSupportAgreementTypeValue[] newValues = new CreditSupportAgreementTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CreditSupportAgreementTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CreditSupportAgreementTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- CutName ----------------------------------------
public enum CutNameEnum
{
Undefined,
Comex, // (1) "Comex"
ECB, // (2) "ECB"
LondonMorningGold, // (3) "LondonMorningGold"
LondonEveningPgm, // (4) "LondonEveningPgm"
LondonMorningPgm, // (5) "LondonMorningPgm"
LondonEveningGold, // (6) "LondonEveningGold"
Mexico, // (7) "Mexico"
NewYork, // (8) "NewYork"
NewYorkPgm, // (9) "NewYorkPgm"
SilverLondon, // (10) "SilverLondon"
_LAST_
}
public partial class CutNameValue : IFpMLCodeValue
{
public CutNameValue()
{ }
public CutNameValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class CutNameScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Comex", // (1) Comex
"ECB", // (2) ECB
"LondonMorningGold", // (3) LondonMorningGold
"LondonEveningPgm", // (4) LondonEveningPgm
"LondonMorningPgm", // (5) LondonMorningPgm
"LondonEveningGold", // (6) LondonEveningGold
"Mexico", // (7) Mexico
"NewYork", // (8) NewYork
"NewYorkPgm", // (9) NewYorkPgm
"SilverLondon", // (10) SilverLondon
null // (nn) _LAST_
};
public static string GetEnumString(CutNameEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out CutNameEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (CutNameEnum tempId in Enum.GetValues(typeof(CutNameEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = CutNameEnum.Undefined;
return false;
}
public static CutNameEnum ParseEnumString(string idString)
{
CutNameEnum result = CutNameEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to CutNameEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "CutName"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "CutName");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new CutNameValue(dataRow); }
public string GetFpMLSource() { return "cut-name-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(CutNameValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(CutNameValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
CutNameValue[] newValues = new CutNameValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (CutNameValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("CutNameScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- DayCountFraction ----------------------------------------
public enum DayCountFractionEnum
{
Undefined,
_1_1, // (1) "1/1"
ACT_ACT_ISDA, // (2) "ACT/ACT.ISDA"
ACT_ACT_ICMA, // (3) "ACT/ACT.ICMA"
ACT_ACT_ISMA, // (4) "ACT/ACT.ISMA"
ACT_ACT_AFB, // (5) "ACT/ACT.AFB"
ACT_365_FIXED, // (6) "ACT/365.FIXED"
ACT_360, // (7) "ACT/360"
_30_360, // (8) "30/360"
_30E_360, // (9) "30E/360"
_30E_360_ISDA, // (10) "30E/360.ISDA"
BUS_252, // (11) "BUS/252"
_LAST_
}
public partial class DayCountFractionValue : IFpMLCodeValue
{
public DayCountFractionValue()
{ }
public DayCountFractionValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
if ((dataRow.Value.Length > 3) && (dataRow.Value[3] != null))
HLClassName = dataRow.Value[3].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class DayCountFractionScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"1/1", // (1) _1_1
"ACT/ACT.ISDA", // (2) ACT_ACT_ISDA
"ACT/ACT.ICMA", // (3) ACT_ACT_ICMA
"ACT/ACT.ISMA", // (4) ACT_ACT_ISMA
"ACT/ACT.AFB", // (5) ACT_ACT_AFB
"ACT/365.FIXED", // (6) ACT_365_FIXED
"ACT/360", // (7) ACT_360
"30/360", // (8) _30_360
"30E/360", // (9) _30E_360
"30E/360.ISDA", // (10) _30E_360_ISDA
"BUS/252", // (11) BUS_252
null // (nn) _LAST_
};
public static string GetEnumString(DayCountFractionEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out DayCountFractionEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (DayCountFractionEnum tempId in Enum.GetValues(typeof(DayCountFractionEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = DayCountFractionEnum.Undefined;
return false;
}
public static DayCountFractionEnum ParseEnumString(string idString)
{
DayCountFractionEnum result = DayCountFractionEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to DayCountFractionEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "DayCountFraction"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "DayCountFraction");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new DayCountFractionValue(dataRow); }
public string GetFpMLSource() { return "day-count-fraction-2-1"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(DayCountFractionValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(DayCountFractionValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
DayCountFractionValue[] newValues = new DayCountFractionValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (DayCountFractionValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("DayCountFractionScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- DerivativeCalculationMethod ----------------------------------------
public enum DerivativeCalculationMethodEnum
{
Undefined,
Analytic, // (1) "Analytic"
Perturbation, // (2) "Perturbation"
Substitution, // (3) "Substitution"
Numerical, // (4) "Numerical"
_LAST_
}
public partial class DerivativeCalculationMethodValue : IFpMLCodeValue
{
public DerivativeCalculationMethodValue()
{ }
public DerivativeCalculationMethodValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class DerivativeCalculationMethodScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Analytic", // (1) Analytic
"Perturbation", // (2) Perturbation
"Substitution", // (3) Substitution
"Numerical", // (4) Numerical
null // (nn) _LAST_
};
public static string GetEnumString(DerivativeCalculationMethodEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out DerivativeCalculationMethodEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (DerivativeCalculationMethodEnum tempId in Enum.GetValues(typeof(DerivativeCalculationMethodEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = DerivativeCalculationMethodEnum.Undefined;
return false;
}
public static DerivativeCalculationMethodEnum ParseEnumString(string idString)
{
DerivativeCalculationMethodEnum result = DerivativeCalculationMethodEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to DerivativeCalculationMethodEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "DerivativeCalculationMethod"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "DerivativeCalculationMethod");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new DerivativeCalculationMethodValue(dataRow); }
public string GetFpMLSource() { return "derivative-calculation-method-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(DerivativeCalculationMethodValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(DerivativeCalculationMethodValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
DerivativeCalculationMethodValue[] newValues = new DerivativeCalculationMethodValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (DerivativeCalculationMethodValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("DerivativeCalculationMethodScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- DesignatedPriority ----------------------------------------
public enum DesignatedPriorityEnum
{
Undefined,
FirstLienLoan, // (1) "FirstLienLoan"
SecondLienLoan, // (2) "SecondLienLoan"
ThirdLienLoan, // (3) "ThirdLienLoan"
Unknown, // (4) "Unknown"
_LAST_
}
public partial class DesignatedPriorityValue : IFpMLCodeValue
{
public DesignatedPriorityValue()
{ }
public DesignatedPriorityValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class DesignatedPriorityScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"FirstLienLoan", // (1) FirstLienLoan
"SecondLienLoan", // (2) SecondLienLoan
"ThirdLienLoan", // (3) ThirdLienLoan
"Unknown", // (4) Unknown
null // (nn) _LAST_
};
public static string GetEnumString(DesignatedPriorityEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out DesignatedPriorityEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (DesignatedPriorityEnum tempId in Enum.GetValues(typeof(DesignatedPriorityEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = DesignatedPriorityEnum.Undefined;
return false;
}
public static DesignatedPriorityEnum ParseEnumString(string idString)
{
DesignatedPriorityEnum result = DesignatedPriorityEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to DesignatedPriorityEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "DesignatedPriority"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "DesignatedPriority");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new DesignatedPriorityValue(dataRow); }
public string GetFpMLSource() { return "designated-priority-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(DesignatedPriorityValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(DesignatedPriorityValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
DesignatedPriorityValue[] newValues = new DesignatedPriorityValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (DesignatedPriorityValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("DesignatedPriorityScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- EntityType ----------------------------------------
public enum EntityTypeEnum
{
Undefined,
WesternEuropean, // (1) "WesternEuropean"
WesternEuropeanInsurance, // (2) "WesternEuropeanInsurance"
EuropeanEmergingMarkets, // (3) "EuropeanEmergingMarkets"
AustralianAndNewZealand, // (4) "AustralianAndNewZealand"
Japanese, // (5) "Japanese"
Singaporean, // (6) "Singaporean"
Asian, // (7) "Asian"
NorthAmericanInvestmentGrade, // (8) "NorthAmericanInvestmentGrade"
NorthAmericanInsurance, // (9) "NorthAmericanInsurance"
NorthAmericanHighYield, // (10) "NorthAmericanHighYield"
_LAST_
}
public partial class EntityTypeValue : IFpMLCodeValue
{
public EntityTypeValue()
{ }
public EntityTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class EntityTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"WesternEuropean", // (1) WesternEuropean
"WesternEuropeanInsurance", // (2) WesternEuropeanInsurance
"EuropeanEmergingMarkets", // (3) EuropeanEmergingMarkets
"AustralianAndNewZealand", // (4) AustralianAndNewZealand
"Japanese", // (5) Japanese
"Singaporean", // (6) Singaporean
"Asian", // (7) Asian
"NorthAmericanInvestmentGrade", // (8) NorthAmericanInvestmentGrade
"NorthAmericanInsurance", // (9) NorthAmericanInsurance
"NorthAmericanHighYield", // (10) NorthAmericanHighYield
null // (nn) _LAST_
};
public static string GetEnumString(EntityTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out EntityTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (EntityTypeEnum tempId in Enum.GetValues(typeof(EntityTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = EntityTypeEnum.Undefined;
return false;
}
public static EntityTypeEnum ParseEnumString(string idString)
{
EntityTypeEnum result = EntityTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to EntityTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "EntityType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "EntityType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new EntityTypeValue(dataRow); }
public string GetFpMLSource() { return "entity-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(EntityTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(EntityTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
EntityTypeValue[] newValues = new EntityTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (EntityTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("EntityTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- LoanType ----------------------------------------
public enum LoanTypeEnum
{
Undefined,
BridgeLoan, // (1) "BridgeLoan"
LetterOfCredit, // (2) "LetterOfCredit"
RevolvingLoan, // (3) "RevolvingLoan"
SwinglineFunding, // (4) "SwinglineFunding"
TermLoan, // (5) "TermLoan"
TradeClaim, // (6) "TradeClaim"
_LAST_
}
public partial class LoanTypeValue : IFpMLCodeValue
{
public LoanTypeValue()
{ }
public LoanTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class LoanTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"BridgeLoan", // (1) BridgeLoan
"LetterOfCredit", // (2) LetterOfCredit
"RevolvingLoan", // (3) RevolvingLoan
"SwinglineFunding", // (4) SwinglineFunding
"TermLoan", // (5) TermLoan
"TradeClaim", // (6) TradeClaim
null // (nn) _LAST_
};
public static string GetEnumString(LoanTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out LoanTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (LoanTypeEnum tempId in Enum.GetValues(typeof(LoanTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = LoanTypeEnum.Undefined;
return false;
}
public static LoanTypeEnum ParseEnumString(string idString)
{
LoanTypeEnum result = LoanTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to LoanTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "LoanType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "LoanType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new LoanTypeValue(dataRow); }
public string GetFpMLSource() { return "facility-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(LoanTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(LoanTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
LoanTypeValue[] newValues = new LoanTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (LoanTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("LoanTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- FloatingRateIndex ----------------------------------------
public enum FloatingRateIndexEnum
{
Undefined,
AUD_AONIA_OIS_COMPOUND, // (1) "AUD-AONIA-OIS-COMPOUND"
AUD_AONIA_OIS_COMPOUND_SwapMarker, // (2) "AUD-AONIA-OIS-COMPOUND-SwapMarker"
AUD_BBR_AUBBSW, // (3) "AUD-BBR-AUBBSW"
AUD_BBR_BBSW, // (4) "AUD-BBR-BBSW"
AUD_BBR_BBSW_Bloomberg, // (5) "AUD-BBR-BBSW-Bloomberg"
AUD_BBR_BBSY_BID, // (6) "AUD-BBR-BBSY-BID"
AUD_BBR_ISDC, // (7) "AUD-BBR-ISDC"
AUD_LIBOR_BBA, // (8) "AUD-LIBOR-BBA"
AUD_LIBOR_BBA_Bloomberg, // (9) "AUD-LIBOR-BBA-Bloomberg"
AUD_LIBOR_Reference_Banks, // (10) "AUD-LIBOR-Reference Banks"
AUD_Swap_Rate_Reuters, // (11) "AUD-Swap Rate-Reuters"
CAD_BA_ISDD, // (12) "CAD-BA-ISDD"
CAD_BA_CDOR, // (13) "CAD-BA-CDOR"
CAD_BA_CDOR_Bloomberg, // (14) "CAD-BA-CDOR-Bloomberg"
CAD_BA_Reuters, // (15) "CAD-BA-Reuters"
CAD_BA_Telerate, // (16) "CAD-BA-Telerate"
CAD_BA_Reference_Banks, // (17) "CAD-BA-Reference Banks"
CAD_TBILL_ISDD, // (18) "CAD-TBILL-ISDD"
CAD_TBILL_Reuters, // (19) "CAD-TBILL-Reuters"
CAD_TBILL_Telerate, // (20) "CAD-TBILL-Telerate"
CAD_TBILL_Reference_Banks, // (21) "CAD-TBILL-Reference Banks"
CAD_LIBOR_BBA, // (22) "CAD-LIBOR-BBA"
CAD_LIBOR_BBA_Bloomberg, // (23) "CAD-LIBOR-BBA-Bloomberg"
CAD_LIBOR_BBA_SwapMarker, // (24) "CAD-LIBOR-BBA-SwapMarker"
CAD_LIBOR_Reference_Banks, // (25) "CAD-LIBOR-Reference Banks"
CAD_REPO_CORRA, // (26) "CAD-REPO-CORRA"
CAD_CORRA_OIS_COMPOUND, // (27) "CAD-CORRA-OIS-COMPOUND"
CAD_ISDA_Swap_Rate, // (28) "CAD-ISDA-Swap Rate"
CL_CLICP_Bloomberg, // (29) "CL-CLICP-Bloomberg"
CZK_PRIBOR_PRBO, // (30) "CZK-PRIBOR-PRBO"
CZK_PRIBOR_Reference_Banks, // (31) "CZK-PRIBOR-Reference Banks"
DKK_CIBOR_DKNA13, // (32) "DKK-CIBOR-DKNA13"
DKK_CIBOR_DKNA13_Bloomberg, // (33) "DKK-CIBOR-DKNA13-Bloomberg"
DKK_CIBOR2_DKNA13, // (34) "DKK-CIBOR2-DKNA13"
DKK_CITA_DKNA14_COMPOUND, // (35) "DKK-CITA-DKNA14-COMPOUND"
DKK_CIBOR_Reference_Banks, // (36) "DKK-CIBOR-Reference Banks"
DKK_DKKOIS_OIS_COMPOUND, // (37) "DKK-DKKOIS-OIS-COMPOUND"
EUR_EURIBOR_Reuters, // (38) "EUR-EURIBOR-Reuters"
EUR_EURIBOR_Telerate, // (39) "EUR-EURIBOR-Telerate"
EUR_EURIBOR_Act_365, // (40) "EUR-EURIBOR-Act/365"
EUR_EURIBOR_Act_365_Bloomberg, // (41) "EUR-EURIBOR-Act/365-Bloomberg"
EUR_EURIBOR_Reference_Banks, // (42) "EUR-EURIBOR-Reference Banks"
EUR_LIBOR_BBA, // (43) "EUR-LIBOR-BBA"
EUR_LIBOR_BBA_Bloomberg, // (44) "EUR-LIBOR-BBA-Bloomberg"
EUR_LIBOR_Reference_Banks, // (45) "EUR-LIBOR-Reference Banks"
EUR_EONIA_OIS_COMPOUND, // (46) "EUR-EONIA-OIS-COMPOUND"
EUR_EONIA_OIS_COMPOUND_Bloomberg, // (47) "EUR-EONIA-OIS-COMPOUND-Bloomberg"
EUR_EURONIA_OIS_COMPOUND, // (48) "EUR-EURONIA-OIS-COMPOUND"
EUR_TAM_CDC, // (49) "EUR-TAM-CDC"
EUR_TMM_CDC_COMPOUND, // (50) "EUR-TMM-CDC-COMPOUND"
EUR_EONIA_AVERAGE, // (51) "EUR-EONIA-AVERAGE"
EUR_TEC10_CNO, // (52) "EUR-TEC10-CNO"
EUR_TEC10_CNO_SwapMarker, // (53) "EUR-TEC10-CNO-SwapMarker"
EUR_TEC10_Reference_Banks, // (54) "EUR-TEC10-Reference Banks"
EUR_TEC5_CNO, // (55) "EUR-TEC5-CNO"
EUR_TEC5_CNO_SwapMarker, // (56) "EUR-TEC5-CNO-SwapMarker"
EUR_TEC5_Reference_Banks, // (57) "EUR-TEC5-Reference Banks"
EUR_Annual_Swap_Rate_10_00, // (58) "EUR-Annual Swap Rate-10:00"
EUR_Annual_Swap_Rate_10_00_Bloomberg, // (59) "EUR-Annual Swap Rate-10:00-Bloomberg"
EUR_Annual_Swap_Rate_10_00_SwapMarker, // (60) "EUR-Annual Swap Rate-10:00-SwapMarker"
EUR_Annual_Swap_Rate_11_00, // (61) "EUR-Annual Swap Rate-11:00"
EUR_Annual_Swap_Rate_11_00_Bloomberg, // (62) "EUR-Annual Swap Rate-11:00-Bloomberg"
EUR_Annual_Swap_Rate_11_00_SwapMarker, // (63) "EUR-Annual Swap Rate-11:00-SwapMarker"
EUR_Annual_Swap_Rate_3_Month, // (64) "EUR-Annual Swap Rate-3 Month"
EUR_Annual_Swap_Rate_3_Month_SwapMarker, // (65) "EUR-Annual Swap Rate-3 Month-SwapMarker"
EUR_ISDA_EURIBOR_Swap_Rate_11_00, // (66) "EUR-ISDA-EURIBOR Swap Rate-11:00"
EUR_ISDA_EURIBOR_Swap_Rate_12_00, // (67) "EUR-ISDA-EURIBOR Swap Rate-12:00"
EUR_ISDA_LIBOR_Swap_Rate_10_00, // (68) "EUR-ISDA-LIBOR Swap Rate-10:00"
EUR_ISDA_LIBOR_Swap_Rate_11_00, // (69) "EUR-ISDA-LIBOR Swap Rate-11:00"
EUR_EONIA_Swap_Index, // (70) "EUR-EONIA-Swap-Index"
EUR_Annual_Swap_Rate_Reference_Banks, // (71) "EUR-Annual Swap Rate-Reference Banks"
GRD_ATHIBOR_ATHIBOR, // (72) "GRD-ATHIBOR-ATHIBOR"
GRD_ATHIBOR_Telerate, // (73) "GRD-ATHIBOR-Telerate"
GRD_ATHIBOR_Reference_Banks, // (74) "GRD-ATHIBOR-Reference Banks"
GRD_ATHIMID_Reuters, // (75) "GRD-ATHIMID-Reuters"
GRD_ATHIMID_Reference_Banks, // (76) "GRD-ATHIMID-Reference Banks"
HKD_HIBOR_ISDC, // (77) "HKD-HIBOR-ISDC"
HKD_HIBOR_HIBOR_, // (78) "HKD-HIBOR-HIBOR="
HKD_HIBOR_HIBOR_Bloomberg, // (79) "HKD-HIBOR-HIBOR-Bloomberg"
HKD_HIBOR_HKAB, // (80) "HKD-HIBOR-HKAB"
HKD_HIBOR_HKAB_Bloomberg, // (81) "HKD-HIBOR-HKAB-Bloomberg"
HKD_HIBOR_Reference_Banks, // (82) "HKD-HIBOR-Reference Banks"
HKD_HONIX_OIS_COMPOUND, // (83) "HKD-HONIX-OIS-COMPOUND"
HKD_ISDA_Swap_Rate_11_00, // (84) "HKD-ISDA-Swap Rate-11:00"
HKD_ISDA_Swap_Rate_4_00, // (85) "HKD-ISDA-Swap Rate-4:00"
HUF_BUBOR_Reuters, // (86) "HUF-BUBOR-Reuters"
HUF_BUBOR_Reference_Banks, // (87) "HUF-BUBOR-Reference Banks"
INR_MIBOR_OIS_COMPOUND, // (88) "INR-MIBOR-OIS-COMPOUND"
INR_MITOR_OIS_COMPOUND, // (89) "INR-MITOR-OIS-COMPOUND"
INR_MIFOR, // (90) "INR-MIFOR"
INR_MIOIS, // (91) "INR-MIOIS"
INR_BMK, // (92) "INR-BMK"
INR_INBMK_REUTERS, // (93) "INR-INBMK-REUTERS"
INR_CMT, // (94) "INR-CMT"
INR_Reference_Banks, // (95) "INR-Reference Banks"
IDR_IDRFIX, // (96) "IDR-IDRFIX"
IDR_IDMA_Bloomberg, // (97) "IDR-IDMA-Bloomberg"
IDR_SBI_Reuters, // (98) "IDR-SBI-Reuters"
IDR_SOR_Reuters, // (99) "IDR-SOR-Reuters"
IDR_SOR_Telerate, // (100) "IDR-SOR-Telerate"
IDR_SOR_Reference_Banks, // (101) "IDR-SOR-Reference Banks"
ILS_TELBOR01_Reuters, // (102) "ILS-TELBOR01-Reuters"
ILS_TELBOR_Reference_Banks, // (103) "ILS-TELBOR-Reference Banks"
JPY_BBSF_Bloomberg_10_00, // (104) "JPY-BBSF-Bloomberg-10:00"
JPY_BBSF_Bloomberg_15_00, // (105) "JPY-BBSF-Bloomberg-15:00"
JPY_LIBOR_FRASETT, // (106) "JPY-LIBOR-FRASETT"
JPY_LIBOR_ISDA, // (107) "JPY-LIBOR-ISDA"
JPY_LIBOR_BBA, // (108) "JPY-LIBOR-BBA"
JPY_LIBOR_BBA_Bloomberg, // (109) "JPY-LIBOR-BBA-Bloomberg"
JPY_LIBOR_Reference_Banks, // (110) "JPY-LIBOR-Reference Banks"
JPY_MUTANCALL_TONAR, // (111) "JPY-MUTANCALL-TONAR"
JPY_TIBOR_TIBM__10_Banks_, // (112) "JPY-TIBOR-TIBM (10 Banks)"
JPY_TIBOR_TIBM__5_Banks_, // (113) "JPY-TIBOR-TIBM (5 Banks)"
JPY_TIBOR_TIBM__All_Banks_, // (114) "JPY-TIBOR-TIBM (All Banks)"
JPY_TIBOR_TIBM__All_Banks__Bloomberg, // (115) "JPY-TIBOR-TIBM (All Banks)-Bloomberg"
JPY_TIBOR_ZTIBOR, // (116) "JPY-TIBOR-ZTIBOR"
JPY_TIBOR_TIBM_Reference_Banks, // (117) "JPY-TIBOR-TIBM-Reference Banks"
JPY_TSR_Reuters_10_00, // (118) "JPY-TSR-Reuters-10:00"
JPY_TSR_Telerate_10_00, // (119) "JPY-TSR-Telerate-10:00"
JPY_ISDA_Swap_Rate_10_00, // (120) "JPY-ISDA-Swap Rate-10:00"
JPY_TSR_Reuters_15_00, // (121) "JPY-TSR-Reuters-15:00"
JPY_TSR_Telerate_15_00, // (122) "JPY-TSR-Telerate-15:00"
JPY_ISDA_Swap_Rate_15_00, // (123) "JPY-ISDA-Swap Rate-15:00"
JPY_TSR_Reference_Banks, // (124) "JPY-TSR-Reference Banks"
JPY_TONA_OIS_COMPOUND, // (125) "JPY-TONA-OIS-COMPOUND"
JPY_TIBOR_17096, // (126) "JPY-TIBOR-17096"
JPY_TIBOR_17097, // (127) "JPY-TIBOR-17097"
KRW_CD_KSDA_Bloomberg, // (128) "KRW-CD-KSDA-Bloomberg"
KRW_CD_3220, // (129) "KRW-CD-3220"
MYR_KLIBOR_BNM, // (130) "MYR-KLIBOR-BNM"
MYR_KLIBOR_Reference_Banks, // (131) "MYR-KLIBOR-Reference Banks"
MXN_TIIE_Banxico, // (132) "MXN-TIIE-Banxico"
MXN_TIIE_Banxico_Bloomberg, // (133) "MXN-TIIE-Banxico-Bloomberg"
MXN_TIIE_Banxico_Reference_Banks, // (134) "MXN-TIIE-Banxico-Reference Banks"
NZD_BBR_BID, // (135) "NZD-BBR-BID"
NZD_BBR_ISDC, // (136) "NZD-BBR-ISDC"
NZD_BBR_FRA, // (137) "NZD-BBR-FRA"
NZD_BBR_Telerate, // (138) "NZD-BBR-Telerate"
NZD_BBR_Reference_Banks, // (139) "NZD-BBR-Reference Banks"
NZD_NZIONA_OIS_COMPOUND, // (140) "NZD-NZIONA-OIS-COMPOUND"
NOK_NIBOR_NIBR, // (141) "NOK-NIBOR-NIBR"
NOK_NIBOR_NIBR_Reference_Banks, // (142) "NOK-NIBOR-NIBR-Reference Banks"
NOK_NIBOR_Reference_Banks, // (143) "NOK-NIBOR-Reference Banks"
PLN_WIBOR_WIBO, // (144) "PLN-WIBOR-WIBO"
PLN_WIBOR_Reference_Banks, // (145) "PLN-WIBOR-Reference Banks"
PLZ_WIBOR_WIBO, // (146) "PLZ-WIBOR-WIBO"
PLZ_WIBOR_Reference_Banks, // (147) "PLZ-WIBOR-Reference Banks"
SAR_SRIOR_SUAA, // (148) "SAR-SRIOR-SUAA"
SAR_SRIOR_Reference_Banks, // (149) "SAR-SRIOR-Reference Banks"
SGD_SIBOR_Reuters, // (150) "SGD-SIBOR-Reuters"
SGD_SIBOR_Telerate, // (151) "SGD-SIBOR-Telerate"
SGD_SIBOR_Reference_Banks, // (152) "SGD-SIBOR-Reference Banks"
SGD_SOR_Reuters, // (153) "SGD-SOR-Reuters"
SGD_SOR_Telerate, // (154) "SGD-SOR-Telerate"
SGD_SOR_Reference_Banks, // (155) "SGD-SOR-Reference Banks"
SGD_SONAR_OIS_COMPOUND, // (156) "SGD-SONAR-OIS-COMPOUND"
SKK_BRIBOR_NBSK07, // (157) "SKK-BRIBOR-NBSK07"
SKK_BRIBOR_BRBO, // (158) "SKK-BRIBOR-BRBO"
SKK_BRIBOR_Bloomberg, // (159) "SKK-BRIBOR-Bloomberg"
SKK_BRIBOR_Reference_Banks, // (160) "SKK-BRIBOR-Reference Banks"
ZAR_JIBAR_SAFEX, // (161) "ZAR-JIBAR-SAFEX"
ZAR_JIBAR_Reference_Banks, // (162) "ZAR-JIBAR-Reference Banks"
ZAR_PRIME_AVERAGE, // (163) "ZAR-PRIME-AVERAGE"
ZAR_PRIME_AVERAGE_Reference_Banks, // (164) "ZAR-PRIME-AVERAGE-Reference Banks"
ZAR_DEPOSIT_SAFEX, // (165) "ZAR-DEPOSIT-SAFEX"
ZAR_DEPOSIT_Reference_Banks, // (166) "ZAR-DEPOSIT-Reference Banks"
GBP_LIBOR_ISDA, // (167) "GBP-LIBOR-ISDA"
GBP_LIBOR_BBA, // (168) "GBP-LIBOR-BBA"
GBP_LIBOR_BBA_Bloomberg, // (169) "GBP-LIBOR-BBA-Bloomberg"
GBP_LIBOR_Reference_Banks, // (170) "GBP-LIBOR-Reference Banks"
GBP_ISDA_Swap_Rate, // (171) "GBP-ISDA-Swap Rate"
GBP_Semi_Annual_Swap_Rate, // (172) "GBP-Semi-Annual Swap Rate"
GBP_Semi_Annual_Swap_Rate_Reference_Banks, // (173) "GBP-Semi-Annual Swap Rate-Reference Banks"
GBP_WMBA_SONIA_COMPOUND, // (174) "GBP-WMBA-SONIA-COMPOUND"
SEK_Annual_Swap_Rate, // (175) "SEK-Annual Swap Rate"
SEK_STIBOR_SIDE, // (176) "SEK-STIBOR-SIDE"
SEK_STIBOR_Bloomberg, // (177) "SEK-STIBOR-Bloomberg"
SEK_STIBOR_Reference_Banks, // (178) "SEK-STIBOR-Reference Banks"
SEK_SIOR_OIS_COMPOUND, // (179) "SEK-SIOR-OIS-COMPOUND"
CHF_LIBOR_ISDA, // (180) "CHF-LIBOR-ISDA"
CHF_LIBOR_BBA, // (181) "CHF-LIBOR-BBA"
CHF_LIBOR_BBA_Bloomberg, // (182) "CHF-LIBOR-BBA-Bloomberg"
CHF_LIBOR_Reference_Banks, // (183) "CHF-LIBOR-Reference Banks"
CHF_TOIS_OIS_COMPOUND, // (184) "CHF-TOIS-OIS-COMPOUND"
CHF_Annual_Swap_Rate, // (185) "CHF-Annual Swap Rate"
CHF_ISDAFIX_Swap_Rate, // (186) "CHF-ISDAFIX-Swap Rate"
CHF_Annual_Swap_Rate_Reference_Banks, // (187) "CHF-Annual Swap Rate-Reference Banks"
TWD_Reuters_6165, // (188) "TWD-Reuters-6165"
TWD_Telerate_6165, // (189) "TWD-Telerate-6165"
TWD_TWCPBA, // (190) "TWD-TWCPBA"
TWD_Reference_Dealers, // (191) "TWD-Reference Dealers"
THB_SOR_Reuters, // (192) "THB-SOR-Reuters"
THB_SOR_Telerate, // (193) "THB-SOR-Telerate"
THB_SOR_Reference_Banks, // (194) "THB-SOR-Reference Banks"
THB_THBFIX_Reuters, // (195) "THB-THBFIX-Reuters"
USD_BA_H_15, // (196) "USD-BA-H.15"
USD_BA_Reference_Dealers, // (197) "USD-BA-Reference Dealers"
USD_CD_H_15, // (198) "USD-CD-H.15"
USD_CD_Reference_Dealers, // (199) "USD-CD-Reference Dealers"
USD_CMS_Reuters, // (200) "USD-CMS-Reuters"
USD_CMS_Telerate, // (201) "USD-CMS-Telerate"
USD_ISDA_Swap_Rate, // (202) "USD-ISDA-Swap Rate"
USD_ISDA_Swap_Rate_3_00, // (203) "USD-ISDA-Swap Rate-3:00"
USD_ISDAFIX3_Swap_Rate, // (204) "USD-ISDAFIX3-Swap Rate"
USD_ISDAFIX3_Swap_Rate_3_00, // (205) "USD-ISDAFIX3-Swap Rate-3:00"
USD_CMS_Reference_Banks, // (206) "USD-CMS-Reference Banks"
USD_CMS_Reference_Banks_ICAP_SwapPX, // (207) "USD-CMS-Reference Banks-ICAP SwapPX"
USD_CMT_T7051, // (208) "USD-CMT-T7051"
USD_CMT_T7052, // (209) "USD-CMT-T7052"
USD_COF11_Reuters, // (210) "USD-COF11-Reuters"
USD_COF11_Telerate, // (211) "USD-COF11-Telerate"
USD_COF11_FHLBSF, // (212) "USD-COF11-FHLBSF"
USD_CP_H_15, // (213) "USD-CP-H.15"
USD_CP_Reference_Dealers, // (214) "USD-CP-Reference Dealers"
USD_Federal_Funds_H_15, // (215) "USD-Federal Funds-H.15"
USD_Federal_Funds_H_15_Bloomberg, // (216) "USD-Federal Funds-H.15-Bloomberg"
USD_Federal_Funds_Reference_Dealers, // (217) "USD-Federal Funds-Reference Dealers"
USD_FFCB_DISCO, // (218) "USD-FFCB-DISCO"
USD_LIBOR_BBA, // (219) "USD-LIBOR-BBA"
USD_LIBOR_BBA_Bloomberg, // (220) "USD-LIBOR-BBA-Bloomberg"
USD_LIBOR_ISDA, // (221) "USD-LIBOR-ISDA"
USD_LIBOR_LIBO, // (222) "USD-LIBOR-LIBO"
USD_LIBOR_Reference_Banks, // (223) "USD-LIBOR-Reference Banks"
USD_Prime_H_15, // (224) "USD-Prime-H.15"
USD_Prime_Reference_Banks, // (225) "USD-Prime-Reference Banks"
USD_SIBOR_SIBO, // (226) "USD-SIBOR-SIBO"
USD_SIBOR_Reference_Banks, // (227) "USD-SIBOR-Reference Banks"
USD_TBILL_H_15, // (228) "USD-TBILL-H.15"
USD_TBILL_H_15_Bloomberg, // (229) "USD-TBILL-H.15-Bloomberg"
USD_TBILL_Secondary_Market, // (230) "USD-TBILL-Secondary Market"
USD_TIBOR_ISDC, // (231) "USD-TIBOR-ISDC"
USD_TIBOR_Reference_Banks, // (232) "USD-TIBOR-Reference Banks"
USD_Treasury_Rate_T500, // (233) "USD-Treasury Rate-T500"
USD_Treasury_Rate_ICAP_BrokerTec, // (234) "USD-Treasury Rate-ICAP BrokerTec"
USD_Treasury_Rate_SwapMarker99, // (235) "USD-Treasury Rate-SwapMarker99"
USD_Treasury_Rate_T19901, // (236) "USD-Treasury Rate-T19901"
USD_Treasury_Rate_SwapMarker100, // (237) "USD-Treasury Rate-SwapMarker100"
USD_Federal_Funds_H_15_OIS_COMPOUND, // (238) "USD-Federal Funds-H.15-OIS-COMPOUND"
USD_SIFMA_Municipal_Swap_Index, // (239) "USD-SIFMA Municipal Swap Index"
USD_BMA_Municipal_Swap_Index, // (240) "USD-BMA Municipal Swap Index"
USD_S_P_Index_High_Grade, // (241) "USD-S&P Index-High Grade"
_LAST_
}
public partial class FloatingRateIndexValue : IFpMLCodeValue
{
public FloatingRateIndexValue()
{ }
public FloatingRateIndexValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class FloatingRateIndexScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"AUD-AONIA-OIS-COMPOUND", // (1) AUD_AONIA_OIS_COMPOUND
"AUD-AONIA-OIS-COMPOUND-SwapMarker", // (2) AUD_AONIA_OIS_COMPOUND_SwapMarker
"AUD-BBR-AUBBSW", // (3) AUD_BBR_AUBBSW
"AUD-BBR-BBSW", // (4) AUD_BBR_BBSW
"AUD-BBR-BBSW-Bloomberg", // (5) AUD_BBR_BBSW_Bloomberg
"AUD-BBR-BBSY-BID", // (6) AUD_BBR_BBSY_BID
"AUD-BBR-ISDC", // (7) AUD_BBR_ISDC
"AUD-LIBOR-BBA", // (8) AUD_LIBOR_BBA
"AUD-LIBOR-BBA-Bloomberg", // (9) AUD_LIBOR_BBA_Bloomberg
"AUD-LIBOR-Reference Banks", // (10) AUD_LIBOR_Reference_Banks
"AUD-Swap Rate-Reuters", // (11) AUD_Swap_Rate_Reuters
"CAD-BA-ISDD", // (12) CAD_BA_ISDD
"CAD-BA-CDOR", // (13) CAD_BA_CDOR
"CAD-BA-CDOR-Bloomberg", // (14) CAD_BA_CDOR_Bloomberg
"CAD-BA-Reuters", // (15) CAD_BA_Reuters
"CAD-BA-Telerate", // (16) CAD_BA_Telerate
"CAD-BA-Reference Banks", // (17) CAD_BA_Reference_Banks
"CAD-TBILL-ISDD", // (18) CAD_TBILL_ISDD
"CAD-TBILL-Reuters", // (19) CAD_TBILL_Reuters
"CAD-TBILL-Telerate", // (20) CAD_TBILL_Telerate
"CAD-TBILL-Reference Banks", // (21) CAD_TBILL_Reference_Banks
"CAD-LIBOR-BBA", // (22) CAD_LIBOR_BBA
"CAD-LIBOR-BBA-Bloomberg", // (23) CAD_LIBOR_BBA_Bloomberg
"CAD-LIBOR-BBA-SwapMarker", // (24) CAD_LIBOR_BBA_SwapMarker
"CAD-LIBOR-Reference Banks", // (25) CAD_LIBOR_Reference_Banks
"CAD-REPO-CORRA", // (26) CAD_REPO_CORRA
"CAD-CORRA-OIS-COMPOUND", // (27) CAD_CORRA_OIS_COMPOUND
"CAD-ISDA-Swap Rate", // (28) CAD_ISDA_Swap_Rate
"CL-CLICP-Bloomberg", // (29) CL_CLICP_Bloomberg
"CZK-PRIBOR-PRBO", // (30) CZK_PRIBOR_PRBO
"CZK-PRIBOR-Reference Banks", // (31) CZK_PRIBOR_Reference_Banks
"DKK-CIBOR-DKNA13", // (32) DKK_CIBOR_DKNA13
"DKK-CIBOR-DKNA13-Bloomberg", // (33) DKK_CIBOR_DKNA13_Bloomberg
"DKK-CIBOR2-DKNA13", // (34) DKK_CIBOR2_DKNA13
"DKK-CITA-DKNA14-COMPOUND", // (35) DKK_CITA_DKNA14_COMPOUND
"DKK-CIBOR-Reference Banks", // (36) DKK_CIBOR_Reference_Banks
"DKK-DKKOIS-OIS-COMPOUND", // (37) DKK_DKKOIS_OIS_COMPOUND
"EUR-EURIBOR-Reuters", // (38) EUR_EURIBOR_Reuters
"EUR-EURIBOR-Telerate", // (39) EUR_EURIBOR_Telerate
"EUR-EURIBOR-Act/365", // (40) EUR_EURIBOR_Act_365
"EUR-EURIBOR-Act/365-Bloomberg", // (41) EUR_EURIBOR_Act_365_Bloomberg
"EUR-EURIBOR-Reference Banks", // (42) EUR_EURIBOR_Reference_Banks
"EUR-LIBOR-BBA", // (43) EUR_LIBOR_BBA
"EUR-LIBOR-BBA-Bloomberg", // (44) EUR_LIBOR_BBA_Bloomberg
"EUR-LIBOR-Reference Banks", // (45) EUR_LIBOR_Reference_Banks
"EUR-EONIA-OIS-COMPOUND", // (46) EUR_EONIA_OIS_COMPOUND
"EUR-EONIA-OIS-COMPOUND-Bloomberg", // (47) EUR_EONIA_OIS_COMPOUND_Bloomberg
"EUR-EURONIA-OIS-COMPOUND", // (48) EUR_EURONIA_OIS_COMPOUND
"EUR-TAM-CDC", // (49) EUR_TAM_CDC
"EUR-TMM-CDC-COMPOUND", // (50) EUR_TMM_CDC_COMPOUND
"EUR-EONIA-AVERAGE", // (51) EUR_EONIA_AVERAGE
"EUR-TEC10-CNO", // (52) EUR_TEC10_CNO
"EUR-TEC10-CNO-SwapMarker", // (53) EUR_TEC10_CNO_SwapMarker
"EUR-TEC10-Reference Banks", // (54) EUR_TEC10_Reference_Banks
"EUR-TEC5-CNO", // (55) EUR_TEC5_CNO
"EUR-TEC5-CNO-SwapMarker", // (56) EUR_TEC5_CNO_SwapMarker
"EUR-TEC5-Reference Banks", // (57) EUR_TEC5_Reference_Banks
"EUR-Annual Swap Rate-10:00", // (58) EUR_Annual_Swap_Rate_10_00
"EUR-Annual Swap Rate-10:00-Bloomberg", // (59) EUR_Annual_Swap_Rate_10_00_Bloomberg
"EUR-Annual Swap Rate-10:00-SwapMarker", // (60) EUR_Annual_Swap_Rate_10_00_SwapMarker
"EUR-Annual Swap Rate-11:00", // (61) EUR_Annual_Swap_Rate_11_00
"EUR-Annual Swap Rate-11:00-Bloomberg", // (62) EUR_Annual_Swap_Rate_11_00_Bloomberg
"EUR-Annual Swap Rate-11:00-SwapMarker", // (63) EUR_Annual_Swap_Rate_11_00_SwapMarker
"EUR-Annual Swap Rate-3 Month", // (64) EUR_Annual_Swap_Rate_3_Month
"EUR-Annual Swap Rate-3 Month-SwapMarker", // (65) EUR_Annual_Swap_Rate_3_Month_SwapMarker
"EUR-ISDA-EURIBOR Swap Rate-11:00", // (66) EUR_ISDA_EURIBOR_Swap_Rate_11_00
"EUR-ISDA-EURIBOR Swap Rate-12:00", // (67) EUR_ISDA_EURIBOR_Swap_Rate_12_00
"EUR-ISDA-LIBOR Swap Rate-10:00", // (68) EUR_ISDA_LIBOR_Swap_Rate_10_00
"EUR-ISDA-LIBOR Swap Rate-11:00", // (69) EUR_ISDA_LIBOR_Swap_Rate_11_00
"EUR-EONIA-Swap-Index", // (70) EUR_EONIA_Swap_Index
"EUR-Annual Swap Rate-Reference Banks", // (71) EUR_Annual_Swap_Rate_Reference_Banks
"GRD-ATHIBOR-ATHIBOR", // (72) GRD_ATHIBOR_ATHIBOR
"GRD-ATHIBOR-Telerate", // (73) GRD_ATHIBOR_Telerate
"GRD-ATHIBOR-Reference Banks", // (74) GRD_ATHIBOR_Reference_Banks
"GRD-ATHIMID-Reuters", // (75) GRD_ATHIMID_Reuters
"GRD-ATHIMID-Reference Banks", // (76) GRD_ATHIMID_Reference_Banks
"HKD-HIBOR-ISDC", // (77) HKD_HIBOR_ISDC
"HKD-HIBOR-HIBOR=", // (78) HKD_HIBOR_HIBOR_
"HKD-HIBOR-HIBOR-Bloomberg", // (79) HKD_HIBOR_HIBOR_Bloomberg
"HKD-HIBOR-HKAB", // (80) HKD_HIBOR_HKAB
"HKD-HIBOR-HKAB-Bloomberg", // (81) HKD_HIBOR_HKAB_Bloomberg
"HKD-HIBOR-Reference Banks", // (82) HKD_HIBOR_Reference_Banks
"HKD-HONIX-OIS-COMPOUND", // (83) HKD_HONIX_OIS_COMPOUND
"HKD-ISDA-Swap Rate-11:00", // (84) HKD_ISDA_Swap_Rate_11_00
"HKD-ISDA-Swap Rate-4:00", // (85) HKD_ISDA_Swap_Rate_4_00
"HUF-BUBOR-Reuters", // (86) HUF_BUBOR_Reuters
"HUF-BUBOR-Reference Banks", // (87) HUF_BUBOR_Reference_Banks
"INR-MIBOR-OIS-COMPOUND", // (88) INR_MIBOR_OIS_COMPOUND
"INR-MITOR-OIS-COMPOUND", // (89) INR_MITOR_OIS_COMPOUND
"INR-MIFOR", // (90) INR_MIFOR
"INR-MIOIS", // (91) INR_MIOIS
"INR-BMK", // (92) INR_BMK
"INR-INBMK-REUTERS", // (93) INR_INBMK_REUTERS
"INR-CMT", // (94) INR_CMT
"INR-Reference Banks", // (95) INR_Reference_Banks
"IDR-IDRFIX", // (96) IDR_IDRFIX
"IDR-IDMA-Bloomberg", // (97) IDR_IDMA_Bloomberg
"IDR-SBI-Reuters", // (98) IDR_SBI_Reuters
"IDR-SOR-Reuters", // (99) IDR_SOR_Reuters
"IDR-SOR-Telerate", // (100) IDR_SOR_Telerate
"IDR-SOR-Reference Banks", // (101) IDR_SOR_Reference_Banks
"ILS-TELBOR01-Reuters", // (102) ILS_TELBOR01_Reuters
"ILS-TELBOR-Reference Banks", // (103) ILS_TELBOR_Reference_Banks
"JPY-BBSF-Bloomberg-10:00", // (104) JPY_BBSF_Bloomberg_10_00
"JPY-BBSF-Bloomberg-15:00", // (105) JPY_BBSF_Bloomberg_15_00
"JPY-LIBOR-FRASETT", // (106) JPY_LIBOR_FRASETT
"JPY-LIBOR-ISDA", // (107) JPY_LIBOR_ISDA
"JPY-LIBOR-BBA", // (108) JPY_LIBOR_BBA
"JPY-LIBOR-BBA-Bloomberg", // (109) JPY_LIBOR_BBA_Bloomberg
"JPY-LIBOR-Reference Banks", // (110) JPY_LIBOR_Reference_Banks
"JPY-MUTANCALL-TONAR", // (111) JPY_MUTANCALL_TONAR
"JPY-TIBOR-TIBM (10 Banks)", // (112) JPY_TIBOR_TIBM__10_Banks_
"JPY-TIBOR-TIBM (5 Banks)", // (113) JPY_TIBOR_TIBM__5_Banks_
"JPY-TIBOR-TIBM (All Banks)", // (114) JPY_TIBOR_TIBM__All_Banks_
"JPY-TIBOR-TIBM (All Banks)-Bloomberg", // (115) JPY_TIBOR_TIBM__All_Banks__Bloomberg
"JPY-TIBOR-ZTIBOR", // (116) JPY_TIBOR_ZTIBOR
"JPY-TIBOR-TIBM-Reference Banks", // (117) JPY_TIBOR_TIBM_Reference_Banks
"JPY-TSR-Reuters-10:00", // (118) JPY_TSR_Reuters_10_00
"JPY-TSR-Telerate-10:00", // (119) JPY_TSR_Telerate_10_00
"JPY-ISDA-Swap Rate-10:00", // (120) JPY_ISDA_Swap_Rate_10_00
"JPY-TSR-Reuters-15:00", // (121) JPY_TSR_Reuters_15_00
"JPY-TSR-Telerate-15:00", // (122) JPY_TSR_Telerate_15_00
"JPY-ISDA-Swap Rate-15:00", // (123) JPY_ISDA_Swap_Rate_15_00
"JPY-TSR-Reference Banks", // (124) JPY_TSR_Reference_Banks
"JPY-TONA-OIS-COMPOUND", // (125) JPY_TONA_OIS_COMPOUND
"JPY-TIBOR-17096", // (126) JPY_TIBOR_17096
"JPY-TIBOR-17097", // (127) JPY_TIBOR_17097
"KRW-CD-KSDA-Bloomberg", // (128) KRW_CD_KSDA_Bloomberg
"KRW-CD-3220", // (129) KRW_CD_3220
"MYR-KLIBOR-BNM", // (130) MYR_KLIBOR_BNM
"MYR-KLIBOR-Reference Banks", // (131) MYR_KLIBOR_Reference_Banks
"MXN-TIIE-Banxico", // (132) MXN_TIIE_Banxico
"MXN-TIIE-Banxico-Bloomberg", // (133) MXN_TIIE_Banxico_Bloomberg
"MXN-TIIE-Banxico-Reference Banks", // (134) MXN_TIIE_Banxico_Reference_Banks
"NZD-BBR-BID", // (135) NZD_BBR_BID
"NZD-BBR-ISDC", // (136) NZD_BBR_ISDC
"NZD-BBR-FRA", // (137) NZD_BBR_FRA
"NZD-BBR-Telerate", // (138) NZD_BBR_Telerate
"NZD-BBR-Reference Banks", // (139) NZD_BBR_Reference_Banks
"NZD-NZIONA-OIS-COMPOUND", // (140) NZD_NZIONA_OIS_COMPOUND
"NOK-NIBOR-NIBR", // (141) NOK_NIBOR_NIBR
"NOK-NIBOR-NIBR-Reference Banks", // (142) NOK_NIBOR_NIBR_Reference_Banks
"NOK-NIBOR-Reference Banks", // (143) NOK_NIBOR_Reference_Banks
"PLN-WIBOR-WIBO", // (144) PLN_WIBOR_WIBO
"PLN-WIBOR-Reference Banks", // (145) PLN_WIBOR_Reference_Banks
"PLZ-WIBOR-WIBO", // (146) PLZ_WIBOR_WIBO
"PLZ-WIBOR-Reference Banks", // (147) PLZ_WIBOR_Reference_Banks
"SAR-SRIOR-SUAA", // (148) SAR_SRIOR_SUAA
"SAR-SRIOR-Reference Banks", // (149) SAR_SRIOR_Reference_Banks
"SGD-SIBOR-Reuters", // (150) SGD_SIBOR_Reuters
"SGD-SIBOR-Telerate", // (151) SGD_SIBOR_Telerate
"SGD-SIBOR-Reference Banks", // (152) SGD_SIBOR_Reference_Banks
"SGD-SOR-Reuters", // (153) SGD_SOR_Reuters
"SGD-SOR-Telerate", // (154) SGD_SOR_Telerate
"SGD-SOR-Reference Banks", // (155) SGD_SOR_Reference_Banks
"SGD-SONAR-OIS-COMPOUND", // (156) SGD_SONAR_OIS_COMPOUND
"SKK-BRIBOR-NBSK07", // (157) SKK_BRIBOR_NBSK07
"SKK-BRIBOR-BRBO", // (158) SKK_BRIBOR_BRBO
"SKK-BRIBOR-Bloomberg", // (159) SKK_BRIBOR_Bloomberg
"SKK-BRIBOR-Reference Banks", // (160) SKK_BRIBOR_Reference_Banks
"ZAR-JIBAR-SAFEX", // (161) ZAR_JIBAR_SAFEX
"ZAR-JIBAR-Reference Banks", // (162) ZAR_JIBAR_Reference_Banks
"ZAR-PRIME-AVERAGE", // (163) ZAR_PRIME_AVERAGE
"ZAR-PRIME-AVERAGE-Reference Banks", // (164) ZAR_PRIME_AVERAGE_Reference_Banks
"ZAR-DEPOSIT-SAFEX", // (165) ZAR_DEPOSIT_SAFEX
"ZAR-DEPOSIT-Reference Banks", // (166) ZAR_DEPOSIT_Reference_Banks
"GBP-LIBOR-ISDA", // (167) GBP_LIBOR_ISDA
"GBP-LIBOR-BBA", // (168) GBP_LIBOR_BBA
"GBP-LIBOR-BBA-Bloomberg", // (169) GBP_LIBOR_BBA_Bloomberg
"GBP-LIBOR-Reference Banks", // (170) GBP_LIBOR_Reference_Banks
"GBP-ISDA-Swap Rate", // (171) GBP_ISDA_Swap_Rate
"GBP-Semi-Annual Swap Rate", // (172) GBP_Semi_Annual_Swap_Rate
"GBP-Semi-Annual Swap Rate-Reference Banks", // (173) GBP_Semi_Annual_Swap_Rate_Reference_Banks
"GBP-WMBA-SONIA-COMPOUND", // (174) GBP_WMBA_SONIA_COMPOUND
"SEK-Annual Swap Rate", // (175) SEK_Annual_Swap_Rate
"SEK-STIBOR-SIDE", // (176) SEK_STIBOR_SIDE
"SEK-STIBOR-Bloomberg", // (177) SEK_STIBOR_Bloomberg
"SEK-STIBOR-Reference Banks", // (178) SEK_STIBOR_Reference_Banks
"SEK-SIOR-OIS-COMPOUND", // (179) SEK_SIOR_OIS_COMPOUND
"CHF-LIBOR-ISDA", // (180) CHF_LIBOR_ISDA
"CHF-LIBOR-BBA", // (181) CHF_LIBOR_BBA
"CHF-LIBOR-BBA-Bloomberg", // (182) CHF_LIBOR_BBA_Bloomberg
"CHF-LIBOR-Reference Banks", // (183) CHF_LIBOR_Reference_Banks
"CHF-TOIS-OIS-COMPOUND", // (184) CHF_TOIS_OIS_COMPOUND
"CHF-Annual Swap Rate", // (185) CHF_Annual_Swap_Rate
"CHF-ISDAFIX-Swap Rate", // (186) CHF_ISDAFIX_Swap_Rate
"CHF-Annual Swap Rate-Reference Banks", // (187) CHF_Annual_Swap_Rate_Reference_Banks
"TWD-Reuters-6165", // (188) TWD_Reuters_6165
"TWD-Telerate-6165", // (189) TWD_Telerate_6165
"TWD-TWCPBA", // (190) TWD_TWCPBA
"TWD-Reference Dealers", // (191) TWD_Reference_Dealers
"THB-SOR-Reuters", // (192) THB_SOR_Reuters
"THB-SOR-Telerate", // (193) THB_SOR_Telerate
"THB-SOR-Reference Banks", // (194) THB_SOR_Reference_Banks
"THB-THBFIX-Reuters", // (195) THB_THBFIX_Reuters
"USD-BA-H.15", // (196) USD_BA_H_15
"USD-BA-Reference Dealers", // (197) USD_BA_Reference_Dealers
"USD-CD-H.15", // (198) USD_CD_H_15
"USD-CD-Reference Dealers", // (199) USD_CD_Reference_Dealers
"USD-CMS-Reuters", // (200) USD_CMS_Reuters
"USD-CMS-Telerate", // (201) USD_CMS_Telerate
"USD-ISDA-Swap Rate", // (202) USD_ISDA_Swap_Rate
"USD-ISDA-Swap Rate-3:00", // (203) USD_ISDA_Swap_Rate_3_00
"USD-ISDAFIX3-Swap Rate", // (204) USD_ISDAFIX3_Swap_Rate
"USD-ISDAFIX3-Swap Rate-3:00", // (205) USD_ISDAFIX3_Swap_Rate_3_00
"USD-CMS-Reference Banks", // (206) USD_CMS_Reference_Banks
"USD-CMS-Reference Banks-ICAP SwapPX", // (207) USD_CMS_Reference_Banks_ICAP_SwapPX
"USD-CMT-T7051", // (208) USD_CMT_T7051
"USD-CMT-T7052", // (209) USD_CMT_T7052
"USD-COF11-Reuters", // (210) USD_COF11_Reuters
"USD-COF11-Telerate", // (211) USD_COF11_Telerate
"USD-COF11-FHLBSF", // (212) USD_COF11_FHLBSF
"USD-CP-H.15", // (213) USD_CP_H_15
"USD-CP-Reference Dealers", // (214) USD_CP_Reference_Dealers
"USD-Federal Funds-H.15", // (215) USD_Federal_Funds_H_15
"USD-Federal Funds-H.15-Bloomberg", // (216) USD_Federal_Funds_H_15_Bloomberg
"USD-Federal Funds-Reference Dealers", // (217) USD_Federal_Funds_Reference_Dealers
"USD-FFCB-DISCO", // (218) USD_FFCB_DISCO
"USD-LIBOR-BBA", // (219) USD_LIBOR_BBA
"USD-LIBOR-BBA-Bloomberg", // (220) USD_LIBOR_BBA_Bloomberg
"USD-LIBOR-ISDA", // (221) USD_LIBOR_ISDA
"USD-LIBOR-LIBO", // (222) USD_LIBOR_LIBO
"USD-LIBOR-Reference Banks", // (223) USD_LIBOR_Reference_Banks
"USD-Prime-H.15", // (224) USD_Prime_H_15
"USD-Prime-Reference Banks", // (225) USD_Prime_Reference_Banks
"USD-SIBOR-SIBO", // (226) USD_SIBOR_SIBO
"USD-SIBOR-Reference Banks", // (227) USD_SIBOR_Reference_Banks
"USD-TBILL-H.15", // (228) USD_TBILL_H_15
"USD-TBILL-H.15-Bloomberg", // (229) USD_TBILL_H_15_Bloomberg
"USD-TBILL-Secondary Market", // (230) USD_TBILL_Secondary_Market
"USD-TIBOR-ISDC", // (231) USD_TIBOR_ISDC
"USD-TIBOR-Reference Banks", // (232) USD_TIBOR_Reference_Banks
"USD-Treasury Rate-T500", // (233) USD_Treasury_Rate_T500
"USD-Treasury Rate-ICAP BrokerTec", // (234) USD_Treasury_Rate_ICAP_BrokerTec
"USD-Treasury Rate-SwapMarker99", // (235) USD_Treasury_Rate_SwapMarker99
"USD-Treasury Rate-T19901", // (236) USD_Treasury_Rate_T19901
"USD-Treasury Rate-SwapMarker100", // (237) USD_Treasury_Rate_SwapMarker100
"USD-Federal Funds-H.15-OIS-COMPOUND", // (238) USD_Federal_Funds_H_15_OIS_COMPOUND
"USD-SIFMA Municipal Swap Index", // (239) USD_SIFMA_Municipal_Swap_Index
"USD-BMA Municipal Swap Index", // (240) USD_BMA_Municipal_Swap_Index
"USD-S&P Index-High Grade", // (241) USD_S_P_Index_High_Grade
null // (nn) _LAST_
};
public static string GetEnumString(FloatingRateIndexEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out FloatingRateIndexEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (FloatingRateIndexEnum tempId in Enum.GetValues(typeof(FloatingRateIndexEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = FloatingRateIndexEnum.Undefined;
return false;
}
public static FloatingRateIndexEnum ParseEnumString(string idString)
{
FloatingRateIndexEnum result = FloatingRateIndexEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to FloatingRateIndexEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "FloatingRateIndex"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "FloatingRateIndex");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new FloatingRateIndexValue(dataRow); }
public string GetFpMLSource() { return "floating-rate-index-2-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(FloatingRateIndexValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(FloatingRateIndexValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
FloatingRateIndexValue[] newValues = new FloatingRateIndexValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (FloatingRateIndexValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("FloatingRateIndexScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- GoverningLaw ----------------------------------------
public enum GoverningLawEnum
{
Undefined,
CAAB, // (1) "CAAB"
CABC, // (2) "CABC"
CAMN, // (3) "CAMN"
CAON, // (4) "CAON"
CAQC, // (5) "CAQC"
DE, // (6) "DE"
FR, // (7) "FR"
GBEN, // (8) "GBEN"
GBGY, // (9) "GBGY"
GBIM, // (10) "GBIM"
GBJY, // (11) "GBJY"
GBSC, // (12) "GBSC"
JP, // (13) "JP"
USCA, // (14) "USCA"
USIL, // (15) "USIL"
USNY, // (16) "USNY"
_LAST_
}
public partial class GoverningLawValue : IFpMLCodeValue
{
public GoverningLawValue()
{ }
public GoverningLawValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class GoverningLawScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"CAAB", // (1) CAAB
"CABC", // (2) CABC
"CAMN", // (3) CAMN
"CAON", // (4) CAON
"CAQC", // (5) CAQC
"DE", // (6) DE
"FR", // (7) FR
"GBEN", // (8) GBEN
"GBGY", // (9) GBGY
"GBIM", // (10) GBIM
"GBJY", // (11) GBJY
"GBSC", // (12) GBSC
"JP", // (13) JP
"USCA", // (14) USCA
"USIL", // (15) USIL
"USNY", // (16) USNY
null // (nn) _LAST_
};
public static string GetEnumString(GoverningLawEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out GoverningLawEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (GoverningLawEnum tempId in Enum.GetValues(typeof(GoverningLawEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = GoverningLawEnum.Undefined;
return false;
}
public static GoverningLawEnum ParseEnumString(string idString)
{
GoverningLawEnum result = GoverningLawEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to GoverningLawEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "GoverningLaw"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "GoverningLaw");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new GoverningLawValue(dataRow); }
public string GetFpMLSource() { return "governing-law-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(GoverningLawValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(GoverningLawValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
GoverningLawValue[] newValues = new GoverningLawValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (GoverningLawValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("GoverningLawScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- InflationIndexDescription ----------------------------------------
public enum InflationIndexDescriptionEnum
{
Undefined,
AUD_CPI, // (1) "AUD-CPI"
BLG_HICP, // (2) "BLG-HICP"
BRL_IPCA, // (3) "BRL-IPCA"
BRL_IGPM, // (4) "BRL-IGPM"
CAD_CPI, // (5) "CAD-CPI"
DEK_CPI, // (6) "DEK-CPI"
EUR_EXT_CPI, // (7) "EUR-EXT-CPI"
EUR_AI_CPI, // (8) "EUR-AI-CPI"
EUR_AI_R_CPI, // (9) "EUR-AI-R-CPI"
FRC_EXT_CPI, // (10) "FRC-EXT-CPI"
DEM_CPI, // (11) "DEM-CPI"
GRD_HICP, // (12) "GRD-HICP"
GRD_CPI, // (13) "GRD-CPI"
IRL_CPI, // (14) "IRL-CPI"
ISK_CPI, // (15) "ISK-CPI"
ISK_HICP, // (16) "ISK-HICP"
ITL_WC_EXT_CPI, // (17) "ITL-WC-EXT-CPI"
ITL_WC_INT_CPI, // (18) "ITL-WC-INT-CPI"
ITL_BC_EXT_CPI, // (19) "ITL-BC-EXT-CPI"
ITL_BC_INT_CPI, // (20) "ITL-BC-INT-CPI"
JPY_CPI_EXF, // (21) "JPY-CPI-EXF"
MXN_CPI, // (22) "MXN-CPI"
MXN_UDI, // (23) "MXN-UDI"
NLG_HICP, // (24) "NLG-HICP"
NZD_CPI, // (25) "NZD-CPI"
PLN_CPI, // (26) "PLN-CPI"
KRW_CPI, // (27) "KRW-CPI"
ESP_R_CPI, // (28) "ESP-R-CPI"
ESP_CPI, // (29) "ESP-CPI"
ESP_R_HICP, // (30) "ESP-R-HICP"
ESP_HICP, // (31) "ESP-HICP"
ZAR_CPIX, // (32) "ZAR-CPIX"
ZAR_CPI, // (33) "ZAR-CPI"
SEK_CPI, // (34) "SEK-CPI"
UK_RPI, // (35) "UK-RPI"
USA_CPI_U, // (36) "USA-CPI-U"
_LAST_
}
public partial class InflationIndexDescriptionValue : IFpMLCodeValue
{
public InflationIndexDescriptionValue()
{ }
public InflationIndexDescriptionValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class InflationIndexDescriptionScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"AUD-CPI", // (1) AUD_CPI
"BLG-HICP", // (2) BLG_HICP
"BRL-IPCA", // (3) BRL_IPCA
"BRL-IGPM", // (4) BRL_IGPM
"CAD-CPI", // (5) CAD_CPI
"DEK-CPI", // (6) DEK_CPI
"EUR-EXT-CPI", // (7) EUR_EXT_CPI
"EUR-AI-CPI", // (8) EUR_AI_CPI
"EUR-AI-R-CPI", // (9) EUR_AI_R_CPI
"FRC-EXT-CPI", // (10) FRC_EXT_CPI
"DEM-CPI", // (11) DEM_CPI
"GRD-HICP", // (12) GRD_HICP
"GRD-CPI", // (13) GRD_CPI
"IRL-CPI", // (14) IRL_CPI
"ISK-CPI", // (15) ISK_CPI
"ISK-HICP", // (16) ISK_HICP
"ITL-WC-EXT-CPI", // (17) ITL_WC_EXT_CPI
"ITL-WC-INT-CPI", // (18) ITL_WC_INT_CPI
"ITL-BC-EXT-CPI", // (19) ITL_BC_EXT_CPI
"ITL-BC-INT-CPI", // (20) ITL_BC_INT_CPI
"JPY-CPI-EXF", // (21) JPY_CPI_EXF
"MXN-CPI", // (22) MXN_CPI
"MXN-UDI", // (23) MXN_UDI
"NLG-HICP", // (24) NLG_HICP
"NZD-CPI", // (25) NZD_CPI
"PLN-CPI", // (26) PLN_CPI
"KRW-CPI", // (27) KRW_CPI
"ESP-R-CPI", // (28) ESP_R_CPI
"ESP-CPI", // (29) ESP_CPI
"ESP-R-HICP", // (30) ESP_R_HICP
"ESP-HICP", // (31) ESP_HICP
"ZAR-CPIX", // (32) ZAR_CPIX
"ZAR-CPI", // (33) ZAR_CPI
"SEK-CPI", // (34) SEK_CPI
"UK-RPI", // (35) UK_RPI
"USA-CPI-U", // (36) USA_CPI_U
null // (nn) _LAST_
};
public static string GetEnumString(InflationIndexDescriptionEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out InflationIndexDescriptionEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (InflationIndexDescriptionEnum tempId in Enum.GetValues(typeof(InflationIndexDescriptionEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = InflationIndexDescriptionEnum.Undefined;
return false;
}
public static InflationIndexDescriptionEnum ParseEnumString(string idString)
{
InflationIndexDescriptionEnum result = InflationIndexDescriptionEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to InflationIndexDescriptionEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "InflationIndexDescription"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "InflationIndexDescription");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new InflationIndexDescriptionValue(dataRow); }
public string GetFpMLSource() { return "inflation-index-description-2-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(InflationIndexDescriptionValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(InflationIndexDescriptionValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
InflationIndexDescriptionValue[] newValues = new InflationIndexDescriptionValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (InflationIndexDescriptionValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("InflationIndexDescriptionScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- InflationIndexSource ----------------------------------------
public enum InflationIndexSourceEnum
{
Undefined,
AUCPI, // (1) "AUCPI"
CPALBE, // (2) "CPALBE"
CACPI, // (3) "CACPI"
DNCPINEW, // (4) "DNCPINEW"
CPTFEMU, // (5) "CPTFEMU"
HICPFIX, // (6) "HICPFIX"
CPALEMU, // (7) "CPALEMU"
OATINFLATION01, // (8) "OATINFLATION01"
FRCPXTOB, // (9) "FRCPXTOB"
GRCP2000, // (10) "GRCP2000"
ITCPI, // (11) "ITCPI"
ITCPNICT, // (12) "ITCPNICT"
ITCPNIC, // (13) "ITCPNIC"
ITCPFOI, // (14) "ITCPFOI"
JCPNGENF, // (15) "JCPNGENF"
SPIPC, // (16) "SPIPC"
SPCPEU, // (17) "SPCPEU"
SWCPI, // (18) "SWCPI"
UKRPI, // (19) "UKRPI"
CPURNSA, // (20) "CPURNSA"
CPTFIEU, // (21) "CPTFIEU"
_LAST_
}
public partial class InflationIndexSourceValue : IFpMLCodeValue
{
public InflationIndexSourceValue()
{ }
public InflationIndexSourceValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class InflationIndexSourceScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"AUCPI", // (1) AUCPI
"CPALBE", // (2) CPALBE
"CACPI", // (3) CACPI
"DNCPINEW", // (4) DNCPINEW
"CPTFEMU", // (5) CPTFEMU
"HICPFIX", // (6) HICPFIX
"CPALEMU", // (7) CPALEMU
"OATINFLATION01", // (8) OATINFLATION01
"FRCPXTOB", // (9) FRCPXTOB
"GRCP2000", // (10) GRCP2000
"ITCPI", // (11) ITCPI
"ITCPNICT", // (12) ITCPNICT
"ITCPNIC", // (13) ITCPNIC
"ITCPFOI", // (14) ITCPFOI
"JCPNGENF", // (15) JCPNGENF
"SPIPC", // (16) SPIPC
"SPCPEU", // (17) SPCPEU
"SWCPI", // (18) SWCPI
"UKRPI", // (19) UKRPI
"CPURNSA", // (20) CPURNSA
"CPTFIEU", // (21) CPTFIEU
null // (nn) _LAST_
};
public static string GetEnumString(InflationIndexSourceEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out InflationIndexSourceEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (InflationIndexSourceEnum tempId in Enum.GetValues(typeof(InflationIndexSourceEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = InflationIndexSourceEnum.Undefined;
return false;
}
public static InflationIndexSourceEnum ParseEnumString(string idString)
{
InflationIndexSourceEnum result = InflationIndexSourceEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to InflationIndexSourceEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "InflationIndexSource"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "InflationIndexSource");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new InflationIndexSourceValue(dataRow); }
public string GetFpMLSource() { return "inflation-index-source-2-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(InflationIndexSourceValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(InflationIndexSourceValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
InflationIndexSourceValue[] newValues = new InflationIndexSourceValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (InflationIndexSourceValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("InflationIndexSourceScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- InflationMainPublication ----------------------------------------
public enum InflationMainPublicationEnum
{
Undefined,
ABS, // (1) "ABS"
Eurostat, // (2) "Eurostat"
STCA, // (3) "STCA"
DS, // (4) "DS"
ECBMB, // (5) "ECBMB"
INSEEOJ, // (6) "INSEEOJ"
SB, // (7) "SB"
ISTAT, // (8) "ISTAT"
MIA, // (9) "MIA"
INE, // (10) "INE"
SS, // (11) "SS"
ONS, // (12) "ONS"
BLS, // (13) "BLS"
_LAST_
}
public partial class InflationMainPublicationValue : IFpMLCodeValue
{
public InflationMainPublicationValue()
{ }
public InflationMainPublicationValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class InflationMainPublicationScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"ABS", // (1) ABS
"Eurostat", // (2) Eurostat
"STCA", // (3) STCA
"DS", // (4) DS
"ECBMB", // (5) ECBMB
"INSEEOJ", // (6) INSEEOJ
"SB", // (7) SB
"ISTAT", // (8) ISTAT
"MIA", // (9) MIA
"INE", // (10) INE
"SS", // (11) SS
"ONS", // (12) ONS
"BLS", // (13) BLS
null // (nn) _LAST_
};
public static string GetEnumString(InflationMainPublicationEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out InflationMainPublicationEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (InflationMainPublicationEnum tempId in Enum.GetValues(typeof(InflationMainPublicationEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = InflationMainPublicationEnum.Undefined;
return false;
}
public static InflationMainPublicationEnum ParseEnumString(string idString)
{
InflationMainPublicationEnum result = InflationMainPublicationEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to InflationMainPublicationEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "InflationMainPublication"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "InflationMainPublication");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new InflationMainPublicationValue(dataRow); }
public string GetFpMLSource() { return "inflation-main-publication-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(InflationMainPublicationValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(InflationMainPublicationValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
InflationMainPublicationValue[] newValues = new InflationMainPublicationValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (InflationMainPublicationValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("InflationMainPublicationScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- InformationProvider ----------------------------------------
public enum InformationProviderEnum
{
Undefined,
BankOfCanada, // (1) "BankOfCanada"
BankOfJapan, // (2) "BankOfJapan"
Bloomberg, // (3) "Bloomberg"
FederalReserve, // (4) "FederalReserve"
FHLBSF, // (5) "FHLBSF"
ISDA, // (6) "ISDA"
Reuters, // (7) "Reuters"
SAFEX, // (8) "SAFEX"
Telerate, // (9) "Telerate"
_LAST_
}
public partial class InformationProviderValue : IFpMLCodeValue
{
public InformationProviderValue()
{ }
public InformationProviderValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class InformationProviderScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"BankOfCanada", // (1) BankOfCanada
"BankOfJapan", // (2) BankOfJapan
"Bloomberg", // (3) Bloomberg
"FederalReserve", // (4) FederalReserve
"FHLBSF", // (5) FHLBSF
"ISDA", // (6) ISDA
"Reuters", // (7) Reuters
"SAFEX", // (8) SAFEX
"Telerate", // (9) Telerate
null // (nn) _LAST_
};
public static string GetEnumString(InformationProviderEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out InformationProviderEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (InformationProviderEnum tempId in Enum.GetValues(typeof(InformationProviderEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = InformationProviderEnum.Undefined;
return false;
}
public static InformationProviderEnum ParseEnumString(string idString)
{
InformationProviderEnum result = InformationProviderEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to InformationProviderEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "InformationProvider"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "InformationProvider");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new InformationProviderValue(dataRow); }
public string GetFpMLSource() { return "information-provider-2-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(InformationProviderValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(InformationProviderValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
InformationProviderValue[] newValues = new InformationProviderValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (InformationProviderValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("InformationProviderScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- InterpolationMethod ----------------------------------------
public enum InterpolationMethodEnum
{
Undefined,
LinearZeroYield, // (1) "LinearZeroYield"
None, // (2) "None"
_LAST_
}
public partial class InterpolationMethodValue : IFpMLCodeValue
{
public InterpolationMethodValue()
{ }
public InterpolationMethodValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class InterpolationMethodScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"LinearZeroYield", // (1) LinearZeroYield
"None", // (2) None
null // (nn) _LAST_
};
public static string GetEnumString(InterpolationMethodEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out InterpolationMethodEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (InterpolationMethodEnum tempId in Enum.GetValues(typeof(InterpolationMethodEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = InterpolationMethodEnum.Undefined;
return false;
}
public static InterpolationMethodEnum ParseEnumString(string idString)
{
InterpolationMethodEnum result = InterpolationMethodEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to InterpolationMethodEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "InterpolationMethod"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "InterpolationMethod");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new InterpolationMethodValue(dataRow); }
public string GetFpMLSource() { return "interpolation-method-1-1"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(InterpolationMethodValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(InterpolationMethodValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
InterpolationMethodValue[] newValues = new InterpolationMethodValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (InterpolationMethodValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("InterpolationMethodScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- LocalJurisdiction ----------------------------------------
public enum LocalJurisdictionEnum
{
Undefined,
NotApplicable, // (1) "NotApplicable"
India, // (2) "India"
Indonesia, // (3) "Indonesia"
Korea, // (4) "Korea"
Malaysia, // (5) "Malaysia"
Taiwan, // (6) "Taiwan"
_LAST_
}
public partial class LocalJurisdictionValue : IFpMLCodeValue
{
public LocalJurisdictionValue()
{ }
public LocalJurisdictionValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class LocalJurisdictionScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"NotApplicable", // (1) NotApplicable
"India", // (2) India
"Indonesia", // (3) Indonesia
"Korea", // (4) Korea
"Malaysia", // (5) Malaysia
"Taiwan", // (6) Taiwan
null // (nn) _LAST_
};
public static string GetEnumString(LocalJurisdictionEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out LocalJurisdictionEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (LocalJurisdictionEnum tempId in Enum.GetValues(typeof(LocalJurisdictionEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = LocalJurisdictionEnum.Undefined;
return false;
}
public static LocalJurisdictionEnum ParseEnumString(string idString)
{
LocalJurisdictionEnum result = LocalJurisdictionEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to LocalJurisdictionEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "LocalJurisdiction"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "LocalJurisdiction");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new LocalJurisdictionValue(dataRow); }
public string GetFpMLSource() { return "local-jurisdiction-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(LocalJurisdictionValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(LocalJurisdictionValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
LocalJurisdictionValue[] newValues = new LocalJurisdictionValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (LocalJurisdictionValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("LocalJurisdictionScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- MarketDisruption ----------------------------------------
public enum MarketDisruptionEnum
{
Undefined,
Omission, // (1) "Omission"
Postponement, // (2) "Postponement"
ModifiedPostponement, // (3) "ModifiedPostponement"
_LAST_
}
public partial class MarketDisruptionValue : IFpMLCodeValue
{
public MarketDisruptionValue()
{ }
public MarketDisruptionValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class MarketDisruptionScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Omission", // (1) Omission
"Postponement", // (2) Postponement
"ModifiedPostponement", // (3) ModifiedPostponement
null // (nn) _LAST_
};
public static string GetEnumString(MarketDisruptionEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out MarketDisruptionEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (MarketDisruptionEnum tempId in Enum.GetValues(typeof(MarketDisruptionEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = MarketDisruptionEnum.Undefined;
return false;
}
public static MarketDisruptionEnum ParseEnumString(string idString)
{
MarketDisruptionEnum result = MarketDisruptionEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to MarketDisruptionEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "MarketDisruption"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "MarketDisruption");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new MarketDisruptionValue(dataRow); }
public string GetFpMLSource() { return "market-disruption-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(MarketDisruptionValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(MarketDisruptionValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
MarketDisruptionValue[] newValues = new MarketDisruptionValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (MarketDisruptionValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("MarketDisruptionScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- MasterAgreementType ----------------------------------------
public enum MasterAgreementTypeEnum
{
Undefined,
AFB, // (1) "AFB"
German, // (2) "German"
ISDA1987, // (3) "ISDA1987"
ISDA1992, // (4) "ISDA1992"
ISDA2002, // (5) "ISDA2002"
Swiss, // (6) "Swiss"
_LAST_
}
public partial class MasterAgreementTypeValue : IFpMLCodeValue
{
public MasterAgreementTypeValue()
{ }
public MasterAgreementTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class MasterAgreementTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"AFB", // (1) AFB
"German", // (2) German
"ISDA1987", // (3) ISDA1987
"ISDA1992", // (4) ISDA1992
"ISDA2002", // (5) ISDA2002
"Swiss", // (6) Swiss
null // (nn) _LAST_
};
public static string GetEnumString(MasterAgreementTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out MasterAgreementTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (MasterAgreementTypeEnum tempId in Enum.GetValues(typeof(MasterAgreementTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = MasterAgreementTypeEnum.Undefined;
return false;
}
public static MasterAgreementTypeEnum ParseEnumString(string idString)
{
MasterAgreementTypeEnum result = MasterAgreementTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to MasterAgreementTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "MasterAgreementType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "MasterAgreementType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new MasterAgreementTypeValue(dataRow); }
public string GetFpMLSource() { return "master-agreement-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(MasterAgreementTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(MasterAgreementTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
MasterAgreementTypeValue[] newValues = new MasterAgreementTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (MasterAgreementTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("MasterAgreementTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- MasterConfirmationType ----------------------------------------
public enum MasterConfirmationTypeEnum
{
Undefined,
_2003CreditIndex, // (1) "2003CreditIndex"
_2004EquityEuropeanInterdealer, // (2) "2004EquityEuropeanInterdealer"
DJ_CDX_NA, // (3) "DJ.CDX.NA"
DJ_iTraxx_Europe, // (4) "DJ.iTraxx.Europe"
ISDA1999Credit, // (5) "ISDA1999Credit"
ISDA2003CreditAsia, // (6) "ISDA2003CreditAsia"
ISDA2003CreditAustraliaNewZealand, // (7) "ISDA2003CreditAustraliaNewZealand"
ISDA2003CreditEuropean, // (8) "ISDA2003CreditEuropean"
ISDA2003CreditJapan, // (9) "ISDA2003CreditJapan"
ISDA2003CreditNorthAmerican, // (10) "ISDA2003CreditNorthAmerican"
ISDA2003CreditSingapore, // (11) "ISDA2003CreditSingapore"
ISDA2003CreditSovereignAsia, // (12) "ISDA2003CreditSovereignAsia"
ISDA2003CreditSovereignCentralAndEasternEurope, // (13) "ISDA2003CreditSovereignCentralAndEasternEurope"
ISDA2003CreditSovereignJapan, // (14) "ISDA2003CreditSovereignJapan"
ISDA2003CreditSovereignLatinAmerica, // (15) "ISDA2003CreditSovereignLatinAmerica"
ISDA2003CreditSovereignMiddleEast, // (16) "ISDA2003CreditSovereignMiddleEast"
ISDA2003CreditSovereignWesternEurope, // (17) "ISDA2003CreditSovereignWesternEurope"
ISDA2004CreditSovereignAsia, // (18) "ISDA2004CreditSovereignAsia"
ISDA2004CreditSovereignEmergingEuropeanAndMiddleEastern, // (19) "ISDA2004CreditSovereignEmergingEuropeanAndMiddleEastern"
ISDA2004CreditSovereignJapan, // (20) "ISDA2004CreditSovereignJapan"
ISDA2004CreditSovereignLatinAmerican, // (21) "ISDA2004CreditSovereignLatinAmerican"
ISDA2004CreditSovereignWesternEuropean, // (22) "ISDA2004CreditSovereignWesternEuropean"
ISDA2004EquityAmericasInterdealer, // (23) "ISDA2004EquityAmericasInterdealer"
ISDA2005EquityJapaneseInterdealer, // (24) "ISDA2005EquityJapaneseInterdealer"
EquityAmericas, // (25) "EquityAmericas"
EquityEuropean, // (26) "EquityEuropean"
ISDA2005EquityAsiaExcludingJapanInterdealer, // (27) "ISDA2005EquityAsiaExcludingJapanInterdealer"
_2005VarianceSwapEuropeanInterdealer, // (28) "2005VarianceSwapEuropeanInterdealer"
ISDA2006VarianceSwapJapaneseInterdealer, // (29) "ISDA2006VarianceSwapJapaneseInterdealer"
DJ_CDX_EM, // (30) "DJ.CDX.EM"
DJ_CDX_EM_DIV, // (31) "DJ.CDX.EM.DIV"
ISDA2007VarianceSwapAmericas, // (32) "ISDA2007VarianceSwapAmericas"
ISDA2007VarianceSwapAsiaExcludingJapan, // (33) "ISDA2007VarianceSwapAsiaExcludingJapan"
ISDA2007VarianceSwapEuropean, // (34) "ISDA2007VarianceSwapEuropean"
EquityAsia, // (35) "EquityAsia"
ISDA2007EquityEuropean, // (36) "ISDA2007EquityEuropean"
_2006DividendSwapEuropean, // (37) "2006DividendSwapEuropean"
_2006DividendSwapEuropeanInterdealer, // (38) "2006DividendSwapEuropeanInterdealer"
ISDA2007EquityFinanceSwapEuropean, // (39) "ISDA2007EquityFinanceSwapEuropean"
ISDA2004VarianceSwapAmericasInterdealer, // (40) "ISDA2004VarianceSwapAmericasInterdealer"
ISDA2006VarianceSwapJapanese, // (41) "ISDA2006VarianceSwapJapanese"
ISDA2008DividendSwapJapan, // (42) "ISDA2008DividendSwapJapan"
ISDA2008EquityAmericas, // (43) "ISDA2008EquityAmericas"
ISDA2008EquityFinanceSwapAsiaExcludingJapan, // (44) "ISDA2008EquityFinanceSwapAsiaExcludingJapan"
ISDA2008EquityOptionAsiaExcludingJapan, // (45) "ISDA2008EquityOptionAsiaExcludingJapan"
ISDA2008EquityOptionJapan, // (46) "ISDA2008EquityOptionJapan"
_LAST_
}
public partial class MasterConfirmationTypeValue : IFpMLCodeValue
{
public MasterConfirmationTypeValue()
{ }
public MasterConfirmationTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class MasterConfirmationTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"2003CreditIndex", // (1) _2003CreditIndex
"2004EquityEuropeanInterdealer", // (2) _2004EquityEuropeanInterdealer
"DJ.CDX.NA", // (3) DJ_CDX_NA
"DJ.iTraxx.Europe", // (4) DJ_iTraxx_Europe
"ISDA1999Credit", // (5) ISDA1999Credit
"ISDA2003CreditAsia", // (6) ISDA2003CreditAsia
"ISDA2003CreditAustraliaNewZealand", // (7) ISDA2003CreditAustraliaNewZealand
"ISDA2003CreditEuropean", // (8) ISDA2003CreditEuropean
"ISDA2003CreditJapan", // (9) ISDA2003CreditJapan
"ISDA2003CreditNorthAmerican", // (10) ISDA2003CreditNorthAmerican
"ISDA2003CreditSingapore", // (11) ISDA2003CreditSingapore
"ISDA2003CreditSovereignAsia", // (12) ISDA2003CreditSovereignAsia
"ISDA2003CreditSovereignCentralAndEasternEurope", // (13) ISDA2003CreditSovereignCentralAndEasternEurope
"ISDA2003CreditSovereignJapan", // (14) ISDA2003CreditSovereignJapan
"ISDA2003CreditSovereignLatinAmerica", // (15) ISDA2003CreditSovereignLatinAmerica
"ISDA2003CreditSovereignMiddleEast", // (16) ISDA2003CreditSovereignMiddleEast
"ISDA2003CreditSovereignWesternEurope", // (17) ISDA2003CreditSovereignWesternEurope
"ISDA2004CreditSovereignAsia", // (18) ISDA2004CreditSovereignAsia
"ISDA2004CreditSovereignEmergingEuropeanAndMiddleEastern", // (19) ISDA2004CreditSovereignEmergingEuropeanAndMiddleEastern
"ISDA2004CreditSovereignJapan", // (20) ISDA2004CreditSovereignJapan
"ISDA2004CreditSovereignLatinAmerican", // (21) ISDA2004CreditSovereignLatinAmerican
"ISDA2004CreditSovereignWesternEuropean", // (22) ISDA2004CreditSovereignWesternEuropean
"ISDA2004EquityAmericasInterdealer", // (23) ISDA2004EquityAmericasInterdealer
"ISDA2005EquityJapaneseInterdealer", // (24) ISDA2005EquityJapaneseInterdealer
"EquityAmericas", // (25) EquityAmericas
"EquityEuropean", // (26) EquityEuropean
"ISDA2005EquityAsiaExcludingJapanInterdealer", // (27) ISDA2005EquityAsiaExcludingJapanInterdealer
"2005VarianceSwapEuropeanInterdealer", // (28) _2005VarianceSwapEuropeanInterdealer
"ISDA2006VarianceSwapJapaneseInterdealer", // (29) ISDA2006VarianceSwapJapaneseInterdealer
"DJ.CDX.EM", // (30) DJ_CDX_EM
"DJ.CDX.EM.DIV", // (31) DJ_CDX_EM_DIV
"ISDA2007VarianceSwapAmericas", // (32) ISDA2007VarianceSwapAmericas
"ISDA2007VarianceSwapAsiaExcludingJapan", // (33) ISDA2007VarianceSwapAsiaExcludingJapan
"ISDA2007VarianceSwapEuropean", // (34) ISDA2007VarianceSwapEuropean
"EquityAsia", // (35) EquityAsia
"ISDA2007EquityEuropean", // (36) ISDA2007EquityEuropean
"2006DividendSwapEuropean", // (37) _2006DividendSwapEuropean
"2006DividendSwapEuropeanInterdealer", // (38) _2006DividendSwapEuropeanInterdealer
"ISDA2007EquityFinanceSwapEuropean", // (39) ISDA2007EquityFinanceSwapEuropean
"ISDA2004VarianceSwapAmericasInterdealer", // (40) ISDA2004VarianceSwapAmericasInterdealer
"ISDA2006VarianceSwapJapanese", // (41) ISDA2006VarianceSwapJapanese
"ISDA2008DividendSwapJapan", // (42) ISDA2008DividendSwapJapan
"ISDA2008EquityAmericas", // (43) ISDA2008EquityAmericas
"ISDA2008EquityFinanceSwapAsiaExcludingJapan", // (44) ISDA2008EquityFinanceSwapAsiaExcludingJapan
"ISDA2008EquityOptionAsiaExcludingJapan", // (45) ISDA2008EquityOptionAsiaExcludingJapan
"ISDA2008EquityOptionJapan", // (46) ISDA2008EquityOptionJapan
null // (nn) _LAST_
};
public static string GetEnumString(MasterConfirmationTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out MasterConfirmationTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (MasterConfirmationTypeEnum tempId in Enum.GetValues(typeof(MasterConfirmationTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = MasterConfirmationTypeEnum.Undefined;
return false;
}
public static MasterConfirmationTypeEnum ParseEnumString(string idString)
{
MasterConfirmationTypeEnum result = MasterConfirmationTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to MasterConfirmationTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "MasterConfirmationType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "MasterConfirmationType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new MasterConfirmationTypeValue(dataRow); }
public string GetFpMLSource() { return "master-confirmation-type-5-8"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(MasterConfirmationTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(MasterConfirmationTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
MasterConfirmationTypeValue[] newValues = new MasterConfirmationTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (MasterConfirmationTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("MasterConfirmationTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- MatrixType ----------------------------------------
public enum MatrixTypeEnum
{
Undefined,
SettlementMatrix, // (1) "SettlementMatrix"
CreditDerivativesPhysicalSettlementMatrix, // (2) "CreditDerivativesPhysicalSettlementMatrix"
_LAST_
}
public partial class MatrixTypeValue : IFpMLCodeValue
{
public MatrixTypeValue()
{ }
public MatrixTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class MatrixTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"SettlementMatrix", // (1) SettlementMatrix
"CreditDerivativesPhysicalSettlementMatrix", // (2) CreditDerivativesPhysicalSettlementMatrix
null // (nn) _LAST_
};
public static string GetEnumString(MatrixTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out MatrixTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (MatrixTypeEnum tempId in Enum.GetValues(typeof(MatrixTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = MatrixTypeEnum.Undefined;
return false;
}
public static MatrixTypeEnum ParseEnumString(string idString)
{
MatrixTypeEnum result = MatrixTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to MatrixTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "MatrixType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "MatrixType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new MatrixTypeValue(dataRow); }
public string GetFpMLSource() { return "matrix-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(MatrixTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(MatrixTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
MatrixTypeValue[] newValues = new MatrixTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (MatrixTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("MatrixTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- MortgageSector ----------------------------------------
public enum MortgageSectorEnum
{
Undefined,
ABS, // (1) "ABS"
CDO, // (2) "CDO"
CMBS, // (3) "CMBS"
RMBS, // (4) "RMBS"
_LAST_
}
public partial class MortgageSectorValue : IFpMLCodeValue
{
public MortgageSectorValue()
{ }
public MortgageSectorValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class MortgageSectorScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"ABS", // (1) ABS
"CDO", // (2) CDO
"CMBS", // (3) CMBS
"RMBS", // (4) RMBS
null // (nn) _LAST_
};
public static string GetEnumString(MortgageSectorEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out MortgageSectorEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (MortgageSectorEnum tempId in Enum.GetValues(typeof(MortgageSectorEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = MortgageSectorEnum.Undefined;
return false;
}
public static MortgageSectorEnum ParseEnumString(string idString)
{
MortgageSectorEnum result = MortgageSectorEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to MortgageSectorEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "MortgageSector"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "MortgageSector");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new MortgageSectorValue(dataRow); }
public string GetFpMLSource() { return "mortgage-sector-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(MortgageSectorValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(MortgageSectorValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
MortgageSectorValue[] newValues = new MortgageSectorValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (MortgageSectorValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("MortgageSectorScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- PerturbationType ----------------------------------------
public enum PerturbationTypeEnum
{
Undefined,
Absolute, // (1) "Absolute"
Relative, // (2) "Relative"
_LAST_
}
public partial class PerturbationTypeValue : IFpMLCodeValue
{
public PerturbationTypeValue()
{ }
public PerturbationTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class PerturbationTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Absolute", // (1) Absolute
"Relative", // (2) Relative
null // (nn) _LAST_
};
public static string GetEnumString(PerturbationTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out PerturbationTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (PerturbationTypeEnum tempId in Enum.GetValues(typeof(PerturbationTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = PerturbationTypeEnum.Undefined;
return false;
}
public static PerturbationTypeEnum ParseEnumString(string idString)
{
PerturbationTypeEnum result = PerturbationTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to PerturbationTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "PerturbationType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "PerturbationType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new PerturbationTypeValue(dataRow); }
public string GetFpMLSource() { return "perturbation-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(PerturbationTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(PerturbationTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
PerturbationTypeValue[] newValues = new PerturbationTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (PerturbationTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("PerturbationTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- PositionStatus ----------------------------------------
public enum PositionStatusEnum
{
Undefined,
Matched, // (1) "Matched"
Mismatched, // (2) "Mismatched"
Unmatched, // (3) "Unmatched"
Alleged, // (4) "Alleged"
_LAST_
}
public partial class PositionStatusValue : IFpMLCodeValue
{
public PositionStatusValue()
{ }
public PositionStatusValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class PositionStatusScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Matched", // (1) Matched
"Mismatched", // (2) Mismatched
"Unmatched", // (3) Unmatched
"Alleged", // (4) Alleged
null // (nn) _LAST_
};
public static string GetEnumString(PositionStatusEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out PositionStatusEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (PositionStatusEnum tempId in Enum.GetValues(typeof(PositionStatusEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = PositionStatusEnum.Undefined;
return false;
}
public static PositionStatusEnum ParseEnumString(string idString)
{
PositionStatusEnum result = PositionStatusEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to PositionStatusEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "PositionStatus"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "PositionStatus");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new PositionStatusValue(dataRow); }
public string GetFpMLSource() { return "position-status-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(PositionStatusValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(PositionStatusValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
PositionStatusValue[] newValues = new PositionStatusValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (PositionStatusValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("PositionStatusScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- PriceQuoteUnits ----------------------------------------
public enum PriceQuoteUnitsEnum
{
Undefined,
Price, // (1) "Price"
ParValueDecimal, // (2) "ParValueDecimal"
ParValueFraction, // (3) "ParValueFraction"
Rate, // (4) "Rate"
DecimalRate, // (5) "DecimalRate"
InverseDecimalRate, // (6) "InverseDecimalRate"
Discount, // (7) "Discount"
IRFuturesPrice, // (8) "IRFuturesPrice"
ExchangeRate, // (9) "ExchangeRate"
LogNormalVolatility, // (10) "LogNormalVolatility"
BasisPointValue, // (11) "BasisPointValue"
RateSpread, // (12) "RateSpread"
DecimalSpread, // (13) "DecimalSpread"
BasisPointValuePerBasisPoint, // (14) "BasisPointValuePerBasisPoint"
ValuePerPercent, // (15) "ValuePerPercent"
ValuePerDay, // (16) "ValuePerDay"
Shares, // (17) "Shares"
MMBTU, // (18) "MMBTU"
BBL, // (19) "BBL"
GJ, // (20) "GJ"
KL, // (21) "KL"
KWH, // (22) "KWH"
MWH, // (23) "MWH"
t, // (24) "t"
gal, // (25) "gal"
_LAST_
}
public partial class PriceQuoteUnitsValue : IFpMLCodeValue
{
public PriceQuoteUnitsValue()
{ }
public PriceQuoteUnitsValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class PriceQuoteUnitsScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Price", // (1) Price
"ParValueDecimal", // (2) ParValueDecimal
"ParValueFraction", // (3) ParValueFraction
"Rate", // (4) Rate
"DecimalRate", // (5) DecimalRate
"InverseDecimalRate", // (6) InverseDecimalRate
"Discount", // (7) Discount
"IRFuturesPrice", // (8) IRFuturesPrice
"ExchangeRate", // (9) ExchangeRate
"LogNormalVolatility", // (10) LogNormalVolatility
"BasisPointValue", // (11) BasisPointValue
"RateSpread", // (12) RateSpread
"DecimalSpread", // (13) DecimalSpread
"BasisPointValuePerBasisPoint", // (14) BasisPointValuePerBasisPoint
"ValuePerPercent", // (15) ValuePerPercent
"ValuePerDay", // (16) ValuePerDay
"Shares", // (17) Shares
"MMBTU", // (18) MMBTU
"BBL", // (19) BBL
"GJ", // (20) GJ
"KL", // (21) KL
"KWH", // (22) KWH
"MWH", // (23) MWH
"t", // (24) t
"gal", // (25) gal
null // (nn) _LAST_
};
public static string GetEnumString(PriceQuoteUnitsEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out PriceQuoteUnitsEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (PriceQuoteUnitsEnum tempId in Enum.GetValues(typeof(PriceQuoteUnitsEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = PriceQuoteUnitsEnum.Undefined;
return false;
}
public static PriceQuoteUnitsEnum ParseEnumString(string idString)
{
PriceQuoteUnitsEnum result = PriceQuoteUnitsEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to PriceQuoteUnitsEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "PriceQuoteUnits"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "PriceQuoteUnits");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new PriceQuoteUnitsValue(dataRow); }
public string GetFpMLSource() { return "price-quote-units-1-1"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(PriceQuoteUnitsValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(PriceQuoteUnitsValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new PriceQuoteUnitsValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (PriceQuoteUnitsValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("PriceQuoteUnitsScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- PricingInputType ----------------------------------------
public enum PricingInputTypeEnum
{
Undefined,
YieldCurve, // (1) "YieldCurve"
CreditCurve, // (2) "CreditCurve"
FXForecastCurve, // (3) "FXForecastCurve"
VolatilityMatrix, // (4) "VolatilityMatrix"
AssetPrices, // (5) "AssetPrices"
Time, // (6) "Time"
_LAST_
}
public partial class PricingInputTypeValue : IFpMLCodeValue
{
public PricingInputTypeValue()
{ }
public PricingInputTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class PricingInputTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"YieldCurve", // (1) YieldCurve
"CreditCurve", // (2) CreditCurve
"FXForecastCurve", // (3) FXForecastCurve
"VolatilityMatrix", // (4) VolatilityMatrix
"AssetPrices", // (5) AssetPrices
"Time", // (6) Time
null // (nn) _LAST_
};
public static string GetEnumString(PricingInputTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out PricingInputTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (PricingInputTypeEnum tempId in Enum.GetValues(typeof(PricingInputTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = PricingInputTypeEnum.Undefined;
return false;
}
public static PricingInputTypeEnum ParseEnumString(string idString)
{
PricingInputTypeEnum result = PricingInputTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to PricingInputTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "PricingInputType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "PricingInputType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new PricingInputTypeValue(dataRow); }
public string GetFpMLSource() { return "pricing-input-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(PricingInputTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(PricingInputTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new PricingInputTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (PricingInputTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("PricingInputTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ProductTypeSimple ----------------------------------------Added as not included yet
public enum ProductTaxonomyEnum
{
Undefined,
Commodity_Agricultural_Dairy_Exotic,
Commodity_Agricultural_Dairy_LoanLease_Cash,
Commodity_Agricultural_Dairy_LoanLease_Physical,
Commodity_Agricultural_Dairy_Option_Cash,
Commodity_Agricultural_Dairy_Option_Physical,
Commodity_Agricultural_Dairy_SpotFwd_Physical,
Commodity_Agricultural_Dairy_Swap_Cash,
Commodity_Agricultural_Forestry_Exotic,
Commodity_Agricultural_Forestry_LoanLease_Cash,
Commodity_Agricultural_Forestry_LoanLease_Physical,
Commodity_Agricultural_Forestry_Option_Cash,
Commodity_Agricultural_Forestry_Option_Physical,
Commodity_Agricultural_Forestry_SpotFwd_Physical,
Commodity_Agricultural_Forestry_Swap_Cash,
Commodity_Agricultural_GrainsOilSeeds_Exotic,
Commodity_Agricultural_GrainsOilSeeds_LoanLease_Cash,
Commodity_Agricultural_GrainsOilSeeds_LoanLease_Physical,
Commodity_Agricultural_GrainsOilSeeds_Option_Cash,
Commodity_Agricultural_GrainsOilSeeds_Option_Physical,
Commodity_Agricultural_GrainsOilSeeds_SpotFwd_Physical,
Commodity_Agricultural_GrainsOilSeeds_Swap_Cash,
Commodity_Agricultural_Livestock_Exotic,
Commodity_Agricultural_Livestock_LoanLease_Cash,
Commodity_Agricultural_Livestock_LoanLease_Physical,
Commodity_Agricultural_Livestock_Option_Cash,
Commodity_Agricultural_Livestock_Option_Physical,
Commodity_Agricultural_Livestock_SpotFwd_Physical,
Commodity_Agricultural_Livestock_Swap_Cash,
Commodity_Agricultural_Softs_Exotic,
Commodity_Agricultural_Softs_LoanLease_Cash,
Commodity_Agricultural_Softs_LoanLease_Physical,
Commodity_Agricultural_Softs_Option_Cash,
Commodity_Agricultural_Softs_Option_Physical,
Commodity_Agricultural_Softs_SpotFwd_Physical,
Commodity_Agricultural_Softs_Swap_Cash,
Commodity_Energy_Coal_Exotic,
Commodity_Energy_Coal_LoanLease_Cash,
Commodity_Energy_Coal_LoanLease_Physical,
Commodity_Energy_Coal_Option_Cash,
Commodity_Energy_Coal_Option_Physical,
Commodity_Energy_Coal_SpotFwd_Physical,
Commodity_Energy_Coal_Swap_Cash,
Commodity_Energy_Elec_Exotic,
Commodity_Energy_Elec_LoanLease_Cash,
Commodity_Energy_Elec_LoanLease_Physical,
Commodity_Energy_Elec_Option_Cash,
Commodity_Energy_Elec_Option_Physical,
Commodity_Energy_Elec_SpotFwd_Physical,
Commodity_Energy_Elec_Swap_Cash,
Commodity_Energy_Elec_Transmission,
Commodity_Energy_InterEnergy_Exotic,
Commodity_Energy_InterEnergy_LoanLease_Cash,
Commodity_Energy_InterEnergy_LoanLease_Physical,
Commodity_Energy_InterEnergy_Option_Cash,
Commodity_Energy_InterEnergy_Option_Physical,
Commodity_Energy_InterEnergy_SpotFwd_Physical,
Commodity_Energy_InterEnergy_Swap_Cash,
Commodity_Energy_NatGas_Exotic,
Commodity_Energy_NatGas_LoanLease_Cash,
Commodity_Energy_NatGas_LoanLease_Physical,
Commodity_Energy_NatGas_Option_Cash,
Commodity_Energy_NatGas_Option_Physical,
Commodity_Energy_NatGas_SpotFwd_Physical,
Commodity_Energy_NatGas_Swap_Cash,
Commodity_Energy_NatGas_Transport,
Commodity_Energy_Oil_Exotic,
Commodity_Energy_Oil_LoanLease_Cash,
Commodity_Energy_Oil_LoanLease_Physical,
Commodity_Energy_Oil_Option_Cash,
Commodity_Energy_Oil_Option_Physical,
Commodity_Energy_Oil_SpotFwd_Physical,
Commodity_Energy_Oil_Swap_Cash,
Commodity_Environmental_Emissions_Exotic,
Commodity_Environmental_Emissions_LoanLease_Cash,
Commodity_Environmental_Emissions_LoanLease_Physical,
Commodity_Environmental_Emissions_Option_Cash,
Commodity_Environmental_Emissions_Option_Physical,
Commodity_Environmental_Emissions_SpotFwd_Physical,
Commodity_Environmental_Emissions_Swap_Cash,
Commodity_Environmental_Weather_Exotic,
Commodity_Environmental_Weather_LoanLease_Cash,
Commodity_Environmental_Weather_Option_Cash,
Commodity_Environmental_Weather_Swap_Cash,
Commodity_Freight_Exotic,
Commodity_Freight_LoanLease_Cash,
Commodity_Freight_LoanLease_Physical,
Commodity_Freight_Option_Cash,
Commodity_Freight_Option_Physical,
Commodity_Freight_SpotFwd_Physical,
Commodity_Freight_Swap_Cash,
Commodity_Index_Exotic,
Commodity_Index_Option_Cash,
Commodity_Index_Swap_Cash,
Commodity_Metals_NonPrecious_Exotic,
Commodity_Metals_NonPrecious_LoanLease_Cash,
Commodity_Metals_NonPrecious_LoanLease_Physical,
Commodity_Metals_NonPrecious_Option_Cash,
Commodity_Metals_NonPrecious_Option_Physical,
Commodity_Metals_NonPrecious_SpotFwd_Physical,
Commodity_Metals_NonPrecious_Swap_Cash,
Commodity_Metals_Precious_Exotic,
Commodity_Metals_Precious_LoanLease_Cash,
Commodity_Metals_Precious_LoanLease_Physical,
Commodity_Metals_Precious_Option_Cash,
Commodity_Metals_Precious_Option_Physical,
Commodity_Metals_Precious_SpotFwd_Physical,
Commodity_Metals_Precious_Swap_Cash,
Commodity_MultiCommodityExotic,
Credit_Exotic_Corporate_Refobonly,
Credit_Exotic_Other,
Credit_Exotic_StructuredCDS_ContingentCDS,
Credit_Exotic_StructuredCDS_FirsttoDefaultNthtoDefault,
Credit_Exotic_StructuredCDS_LongformBespoke,
Credit_Exotic_StructuredCDS_StandardTermsBespoke,
Credit_Index_ABX_ABXHE,
Credit_Index_CDX_CDXEmergingMarkets,
Credit_Index_CDX_CDXEmergingMarketsDiversified,
Credit_Index_CDX_CDXHY,
Credit_Index_CDX_CDXIG,
Credit_Index_CDX_CDXXO,
Credit_Index_CDX_StandardLCDXBullet,
Credit_Index_CMBX_CMBX,
Credit_Index_IOS_IOS,
Credit_Index_iTraxx_iTraxxAsiaExJapan,
Credit_Index_iTraxx_iTraxxAustralia,
Credit_Index_iTraxx_iTraxxEurope,
Credit_Index_iTraxx_iTraxxJapan,
Credit_Index_iTraxx_iTraxxLevX,
Credit_Index_iTraxx_ItraxxSDI,
Credit_Index_iTraxx_iTraxxSovX,
Credit_Index_LCDX_LCDX,
Credit_Index_MBX_MBX,
Credit_Index_MCDX_MCDX,
Credit_Index_PO_PO,
Credit_Index_PrimeX_PrimeX,
Credit_Index_TRX_TRX,
Credit_IndexTranche_ABX_ABXTranche,
Credit_IndexTranche_CDX_CDXEmergingMarketsDiversifiedTranche,
Credit_IndexTranche_CDX_CDXTrancheHY,
Credit_IndexTranche_CDX_CDXTrancheIG,
Credit_IndexTranche_CDX_CDXTrancheXO,
Credit_IndexTranche_CDX_StandardCDXTrancheHY,
Credit_IndexTranche_CDX_StandardCDXTrancheIG,
Credit_IndexTranche_CDXStructuredTranche_CDXBlendedTranche,
Credit_IndexTranche_CDXStructuredTranche_CDXRiskyZeroTranche,
Credit_IndexTranche_iTraxx_iTraxxAsiaExJapanTranche,
Credit_IndexTranche_iTraxx_iTraxxAustraliaTranche,
Credit_IndexTranche_iTraxx_iTraxxEuropeTranche,
Credit_IndexTranche_iTraxx_iTraxxJapanTranche,
Credit_IndexTranche_iTraxx_StandardiTraxxEuropeTranche,
Credit_IndexTranche_iTraxxStructuredTranche_iTraxxBlendedTranche,
Credit_IndexTranche_iTraxxStructuredTranche_iTraxxRiskyZeroTranche,
Credit_IndexTranche_LCDX_LCDXTranche,
Credit_IndexTranche_LCDX_StandardLCDXBulletTranche,
Credit_SingleName_ABS_CDSonCDO,
Credit_SingleName_ABS_CMBS,
Credit_SingleName_ABS_EuropeanCMBS,
Credit_SingleName_ABS_EuropeanRMBS,
Credit_SingleName_ABS_RMBS,
Credit_SingleName_Corporate_AsiaCorporate,
Credit_SingleName_Corporate_AustraliaCorporate,
Credit_SingleName_Corporate_EmergingEuropeanCorporate,
Credit_SingleName_Corporate_EmergingEuropeanCorporateLPN,
Credit_SingleName_Corporate_EuropeanCorporate,
Credit_SingleName_Corporate_JapanCorporate,
Credit_SingleName_Corporate_LatinAmericaCorporate,
Credit_SingleName_Corporate_LatinAmericaCorporateBond,
Credit_SingleName_Corporate_LatinAmericaCorporateBondOrLoan,
Credit_SingleName_Corporate_NewZealandCorporate,
Credit_SingleName_Corporate_NorthAmericanCorporate,
Credit_SingleName_Corporate_SingaporeCorporate,
Credit_SingleName_Corporate_StandardAsiaCorporate,
Credit_SingleName_Corporate_StandardAustraliaCorporate,
Credit_SingleName_Corporate_StandardEmergingEuropeanCorporate,
Credit_SingleName_Corporate_StandardEmergingEuropeanCorporateLPN,
Credit_SingleName_Corporate_StandardEuropeanCorporate,
Credit_SingleName_Corporate_StandardJapanCorporate,
Credit_SingleName_Corporate_StandardLatinAmericaCorporateBond,
Credit_SingleName_Corporate_StandardLatinAmericaCorporateBondOrLoan,
Credit_SingleName_Corporate_StandardNewZealandCorporate,
Credit_SingleName_Corporate_StandardNorthAmericanCorporate,
Credit_SingleName_Corporate_StandardSingaporeCorporate,
Credit_SingleName_Corporate_StandardSubordinatedEuropeanInsuranceCorporate,
Credit_SingleName_Corporate_StandardSukukCorporate,
Credit_SingleName_Corporate_SubordinatedEuropeanInsuranceCorporate,
Credit_SingleName_Corporate_SukukCorporate,
Credit_SingleName_Loans_ELCDS,
Credit_SingleName_Loans_LCDS,
Credit_SingleName_Loans_StandardLCDSBullet,
Credit_SingleName_Muni_USMunicipalFullFaithAndCredit,
Credit_SingleName_Muni_USMunicipalGeneralFund,
Credit_SingleName_Muni_USMunicipalRevenue,
Credit_SingleName_RecoveryCDS_FixedRecoverySwaps,
Credit_SingleName_RecoveryCDS_RecoveryLocks,
Credit_SingleName_Sovereign_AsiaSovereign,
Credit_SingleName_Sovereign_AustraliaSovereign,
Credit_SingleName_Sovereign_EmergingEuropeanAndMiddleEasternSovereign,
Credit_SingleName_Sovereign_JapanSovereign,
Credit_SingleName_Sovereign_LatinAmericaSovereign,
Credit_SingleName_Sovereign_NewZealandSovereign,
Credit_SingleName_Sovereign_SingaporeSovereign,
Credit_SingleName_Sovereign_StandardAsiaSovereign,
Credit_SingleName_Sovereign_StandardAustraliaSovereign,
Credit_SingleName_Sovereign_StandardEmergingEuropeanAndMiddleEasternSovereign,
Credit_SingleName_Sovereign_StandardJapanSovereign,
Credit_SingleName_Sovereign_StandardLatinAmericaSovereign,
Credit_SingleName_Sovereign_StandardNewZealandSovereign,
Credit_SingleName_Sovereign_StandardSingaporeSovereign,
Credit_SingleName_Sovereign_StandardSukukSovereign,
Credit_SingleName_Sovereign_StandardWesternEuropeanSovereign,
Credit_SingleName_Sovereign_SukukSovereign,
Credit_SingleName_Sovereign_WesternEuropeanSovereign,
Credit_Swaptions_CDX_CDXSwaption,
Credit_Swaptions_Corporate_CDSSwaption,
Credit_Swaptions_iTraxx_iTraxxAsiaExJapanSwaption,
Credit_Swaptions_iTraxx_iTraxxAustraliaSwaption,
Credit_Swaptions_iTraxx_iTraxxEuropeSwaption,
Credit_Swaptions_iTraxx_iTraxxJapanSwaption,
Credit_Swaptions_iTraxx_iTraxxSovXSwaption,
Credit_Swaptions_Muni_CDSSwaption,
Credit_Swaptions_Sovereign_CDSSwaption,
Credit_TotalReturnSwap,
Equity_ContractForDifference_PriceReturnBasicPerformance_Basket,
Equity_ContractForDifference_PriceReturnBasicPerformance_SingleIndex,
Equity_ContractForDifference_PriceReturnBasicPerformance_SingleName,
Equity_Forward_PriceReturnBasicPerformance_Basket,
Equity_Forward_PriceReturnBasicPerformance_SingleIndex,
Equity_Forward_PriceReturnBasicPerformance_SingleName,
Equity_Option_ParameterReturnDividend_Basket,
Equity_Option_ParameterReturnDividend_SingleIndex,
Equity_Option_ParameterReturnDividend_SingleName,
Equity_Option_ParameterReturnVariance_Basket,
Equity_Option_ParameterReturnVariance_SingleIndex,
Equity_Option_ParameterReturnVariance_SingleName,
Equity_Option_ParameterReturnVolatility_Basket,
Equity_Option_ParameterReturnVolatility_SingleIndex,
Equity_Option_ParameterReturnVolatility_SingleName,
Equity_Option_PriceReturnBasicPerformance_Basket,
Equity_Option_PriceReturnBasicPerformance_SingleIndex,
Equity_Option_PriceReturnBasicPerformance_SingleName,
Equity_Other,
Equity_PortfolioSwap_PriceReturnBasicPerformance_Basket,
Equity_PortfolioSwap_PriceReturnBasicPerformance_SingleIndex,
Equity_PortfolioSwap_PriceReturnBasicPerformance_SingleName,
Equity_Swap_ParameterReturnDividend_Basket,
Equity_Swap_ParameterReturnDividend_SingleIndex,
Equity_Swap_ParameterReturnDividend_SingleName,
Equity_Swap_ParameterReturnVariance_Basket,
Equity_Swap_ParameterReturnVariance_SingleIndex,
Equity_Swap_ParameterReturnVariance_SingleName,
Equity_Swap_ParameterReturnVolatility_Basket,
Equity_Swap_ParameterReturnVolatility_SingleIndex,
Equity_Swap_ParameterReturnVolatility_SingleName,
Equity_Swap_PriceReturnBasicPerformance_Basket,
Equity_Swap_PriceReturnBasicPerformance_SingleIndex,
Equity_Swap_PriceReturnBasicPerformance_SingleName,
ForeignExchange_ComplexExotic,
ForeignExchange_Forward,
ForeignExchange_NDF,
ForeignExchange_NDO,
ForeignExchange_SimpleExotic_Barrier,
ForeignExchange_SimpleExotic_Digital,
ForeignExchange_Spot,
ForeignExchange_VanillaOption,
InterestRate_CapFloor,
InterestRate_CrossCurrency_Basis,
InterestRate_CrossCurrency_FixedFixed,
InterestRate_CrossCurrency_FixedFloat,
InterestRate_Exotic,
InterestRate_FRA,
InterestRate_IRSwap_Basis,
InterestRate_IRSwap_FixedFixed,
InterestRate_IRSwap_FixedFloat,
InterestRate_IRSwap_Inflation,
InterestRate_IRSwap_OIS,
InterestRate_Option_DebtOption,
InterestRate_Option_Swaption,
//Added
ForeignExchange_Swap,
InterestRate_Debt_Government_Fixed_Bullet,
InterestRate_Debt_Government_Float_Bullet,
Inflation_Debt_Government_Fixed_Ammortising,
Inflation_Debt_Government_Float_Ammortising,
InterestRate_TermDeposit,
Cash_Payment,
Credit_Debt_ABS_CDSonCDO,
Credit_Debt_ABS_CMBS,
Credit_Debt_ABS_EuropeanCMBS,
Credit_Debt_ABS_EuropeanRMBS,
Credit_Debt_ABS_RMBS,
Equity_OrdinaryShares,
Equity_Forward_Physical,
Property_Residential,
Exchange_Traded_Future
}
public partial class ProductTaxonomyValue : IFpMLCodeValue
{
public ProductTaxonomyValue()
{ }
public ProductTaxonomyValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ProductTaxonomyScheme : IFpMLCodeScheme
{
private static readonly string[] EnumStrings =
{
null, // (0) Undefined
"Commodity:Agricultural:Dairy:Exotic",
"Commodity:Agricultural:Dairy:LoanLease:Cash",
"Commodity:Agricultural:Dairy:LoanLease:Physical",
"Commodity:Agricultural:Dairy:Option:Cash",
"Commodity:Agricultural:Dairy:Option:Physical",
"Commodity:Agricultural:Dairy:SpotFwd:Physical",
"Commodity:Agricultural:Dairy:Swap:Cash",
"Commodity:Agricultural:Forestry:Exotic",
"Commodity:Agricultural:Forestry:LoanLease:Cash",
"Commodity:Agricultural:Forestry:LoanLease:Physical",
"Commodity:Agricultural:Forestry:Option:Cash",
"Commodity:Agricultural:Forestry:Option:Physical",
"Commodity:Agricultural:Forestry:SpotFwd:Physical",
"Commodity:Agricultural:Forestry:Swap:Cash",
"Commodity:Agricultural:GrainsOilSeeds:Exotic",
"Commodity:Agricultural:GrainsOilSeeds:LoanLease:Cash",
"Commodity:Agricultural:GrainsOilSeeds:LoanLease:Physical",
"Commodity:Agricultural:GrainsOilSeeds:Option:Cash",
"Commodity:Agricultural:GrainsOilSeeds:Option:Physical",
"Commodity:Agricultural:GrainsOilSeeds:SpotFwd:Physical",
"Commodity:Agricultural:GrainsOilSeeds:Swap:Cash",
"Commodity:Agricultural:Livestock:Exotic",
"Commodity:Agricultural:Livestock:LoanLease:Cash",
"Commodity:Agricultural:Livestock:LoanLease:Physical",
"Commodity:Agricultural:Livestock:Option:Cash",
"Commodity:Agricultural:Livestock:Option:Physical",
"Commodity:Agricultural:Livestock:SpotFwd:Physical",
"Commodity:Agricultural:Livestock:Swap:Cash",
"Commodity:Agricultural:Softs:Exotic",
"Commodity:Agricultural:Softs:LoanLease:Cash",
"Commodity:Agricultural:Softs:LoanLease:Physical",
"Commodity:Agricultural:Softs:Option:Cash",
"Commodity:Agricultural:Softs:Option:Physical",
"Commodity:Agricultural:Softs:SpotFwd:Physical",
"Commodity:Agricultural:Softs:Swap:Cash",
"Commodity:Energy:Coal:Exotic",
"Commodity:Energy:Coal:LoanLease:Cash",
"Commodity:Energy:Coal:LoanLease:Physical",
"Commodity:Energy:Coal:Option:Cash",
"Commodity:Energy:Coal:Option:Physical",
"Commodity:Energy:Coal:SpotFwd:Physical",
"Commodity:Energy:Coal:Swap:Cash",
"Commodity:Energy:Elec:Exotic",
"Commodity:Energy:Elec:LoanLease:Cash",
"Commodity:Energy:Elec:LoanLease:Physical",
"Commodity:Energy:Elec:Option:Cash",
"Commodity:Energy:Elec:Option:Physical",
"Commodity:Energy:Elec:SpotFwd:Physical",
"Commodity:Energy:Elec:Swap:Cash",
"Commodity:Energy:Elec:Transmission",
"Commodity:Energy:InterEnergy:Exotic",
"Commodity:Energy:InterEnergy:LoanLease:Cash",
"Commodity:Energy:InterEnergy:LoanLease:Physical",
"Commodity:Energy:InterEnergy:Option:Cash",
"Commodity:Energy:InterEnergy:Option:Physical",
"Commodity:Energy:InterEnergy:SpotFwd:Physical",
"Commodity:Energy:InterEnergy:Swap:Cash",
"Commodity:Energy:NatGas:Exotic",
"Commodity:Energy:NatGas:LoanLease:Cash",
"Commodity:Energy:NatGas:LoanLease:Physical",
"Commodity:Energy:NatGas:Option:Cash",
"Commodity:Energy:NatGas:Option:Physical",
"Commodity:Energy:NatGas:SpotFwd:Physical",
"Commodity:Energy:NatGas:Swap:Cash",
"Commodity:Energy:NatGas:Transport",
"Commodity:Energy:Oil:Exotic",
"Commodity:Energy:Oil:LoanLease:Cash",
"Commodity:Energy:Oil:LoanLease:Physical",
"Commodity:Energy:Oil:Option:Cash",
"Commodity:Energy:Oil:Option:Physical",
"Commodity:Energy:Oil:SpotFwd:Physical",
"Commodity:Energy:Oil:Swap:Cash",
"Commodity:Environmental:Emissions:Exotic",
"Commodity:Environmental:Emissions:LoanLease:Cash",
"Commodity:Environmental:Emissions:LoanLease:Physical",
"Commodity:Environmental:Emissions:Option:Cash",
"Commodity:Environmental:Emissions:Option:Physical",
"Commodity:Environmental:Emissions:SpotFwd:Physical",
"Commodity:Environmental:Emissions:Swap:Cash",
"Commodity:Environmental:Weather:Exotic",
"Commodity:Environmental:Weather:LoanLease:Cash",
"Commodity:Environmental:Weather:Option:Cash",
"Commodity:Environmental:Weather:Swap:Cash",
"Commodity:Freight:Exotic",
"Commodity:Freight:LoanLease:Cash",
"Commodity:Freight:LoanLease:Physical",
"Commodity:Freight:Option:Cash",
"Commodity:Freight:Option:Physical",
"Commodity:Freight:SpotFwd:Physical",
"Commodity:Freight:Swap:Cash",
"Commodity:Index:Exotic",
"Commodity:Index:Option:Cash",
"Commodity:Index:Swap:Cash",
"Commodity:Metals:NonPrecious:Exotic",
"Commodity:Metals:NonPrecious:LoanLease:Cash",
"Commodity:Metals:NonPrecious:LoanLease:Physical",
"Commodity:Metals:NonPrecious:Option:Cash",
"Commodity:Metals:NonPrecious:Option:Physical",
"Commodity:Metals:NonPrecious:SpotFwd:Physical",
"Commodity:Metals:NonPrecious:Swap:Cash",
"Commodity:Metals:Precious:Exotic",
"Commodity:Metals:Precious:LoanLease:Cash",
"Commodity:Metals:Precious:LoanLease:Physical",
"Commodity:Metals:Precious:Option:Cash",
"Commodity:Metals:Precious:Option:Physical",
"Commodity:Metals:Precious:SpotFwd:Physical",
"Commodity:Metals:Precious:Swap:Cash",
"Commodity:MultiCommodityExotic",
"Credit:Exotic:Corporate:Refobonly",
"Credit:Exotic:Other",
"Credit:Exotic:StructuredCDS:ContingentCDS",
"Credit:Exotic:StructuredCDS:FirsttoDefaultNthtoDefault",
"Credit:Exotic:StructuredCDS:LongformBespoke",
"Credit:Exotic:StructuredCDS:StandardTermsBespoke",
"Credit:Index:ABX:ABXHE",
"Credit:Index:CDX:CDXEmergingMarkets",
"Credit:Index:CDX:CDXEmergingMarketsDiversified",
"Credit:Index:CDX:CDXHY",
"Credit:Index:CDX:CDXIG",
"Credit:Index:CDX:CDXXO",
"Credit:Index:CDX:StandardLCDXBullet",
"Credit:Index:CMBX:CMBX",
"Credit:Index:IOS:IOS",
"Credit:Index:iTraxx:iTraxxAsiaExJapan",
"Credit:Index:iTraxx:iTraxxAustralia",
"Credit:Index:iTraxx:iTraxxEurope",
"Credit:Index:iTraxx:iTraxxJapan",
"Credit:Index:iTraxx:iTraxxLevX",
"Credit:Index:iTraxx:ItraxxSDI",
"Credit:Index:iTraxx:iTraxxSovX",
"Credit:Index:LCDX:LCDX",
"Credit:Index:MBX:MBX",
"Credit:Index:MCDX:MCDX",
"Credit:Index:PO:PO",
"Credit:Index:PrimeX:PrimeX",
"Credit:Index:TRX:TRX",
"Credit:IndexTranche:ABX:ABXTranche",
"Credit:IndexTranche:CDX:CDXEmergingMarketsDiversifiedTranche",
"Credit:IndexTranche:CDX:CDXTrancheHY",
"Credit:IndexTranche:CDX:CDXTrancheIG",
"Credit:IndexTranche:CDX:CDXTrancheXO",
"Credit:IndexTranche:CDX:StandardCDXTrancheHY",
"Credit:IndexTranche:CDX:StandardCDXTrancheIG",
"Credit:IndexTranche:CDXStructuredTranche:CDXBlendedTranche",
"Credit:IndexTranche:CDXStructuredTranche:CDXRiskyZeroTranche",
"Credit:IndexTranche:iTraxx:iTraxxAsiaExJapanTranche",
"Credit:IndexTranche:iTraxx:iTraxxAustraliaTranche",
"Credit:IndexTranche:iTraxx:iTraxxEuropeTranche",
"Credit:IndexTranche:iTraxx:iTraxxJapanTranche",
"Credit:IndexTranche:iTraxx:StandardiTraxxEuropeTranche",
"Credit:IndexTranche:iTraxxStructuredTranche:iTraxxBlendedTranche",
"Credit:IndexTranche:iTraxxStructuredTranche:iTraxxRiskyZeroTranche",
"Credit:IndexTranche:LCDX:LCDXTranche",
"Credit:IndexTranche:LCDX:StandardLCDXBulletTranche",
"Credit:SingleName:ABS:CDSonCDO",
"Credit:SingleName:ABS:CMBS",
"Credit:SingleName:ABS:EuropeanCMBS",
"Credit:SingleName:ABS:EuropeanRMBS",
"Credit:SingleName:ABS:RMBS",
"Credit:SingleName:Corporate:AsiaCorporate",
"Credit:SingleName:Corporate:AustraliaCorporate",
"Credit:SingleName:Corporate:EmergingEuropeanCorporate",
"Credit:SingleName:Corporate:EmergingEuropeanCorporateLPN",
"Credit:SingleName:Corporate:EuropeanCorporate",
"Credit:SingleName:Corporate:JapanCorporate",
"Credit:SingleName:Corporate:LatinAmericaCorporate",
"Credit:SingleName:Corporate:LatinAmericaCorporateBond",
"Credit:SingleName:Corporate:LatinAmericaCorporateBondOrLoan",
"Credit:SingleName:Corporate:NewZealandCorporate",
"Credit:SingleName:Corporate:NorthAmericanCorporate",
"Credit:SingleName:Corporate:SingaporeCorporate",
"Credit:SingleName:Corporate:StandardAsiaCorporate",
"Credit:SingleName:Corporate:StandardAustraliaCorporate",
"Credit:SingleName:Corporate:StandardEmergingEuropeanCorporate",
"Credit:SingleName:Corporate:StandardEmergingEuropeanCorporateLPN",
"Credit:SingleName:Corporate:StandardEuropeanCorporate",
"Credit:SingleName:Corporate:StandardJapanCorporate",
"Credit:SingleName:Corporate:StandardLatinAmericaCorporateBond",
"Credit:SingleName:Corporate:StandardLatinAmericaCorporateBondOrLoan",
"Credit:SingleName:Corporate:StandardNewZealandCorporate",
"Credit:SingleName:Corporate:StandardNorthAmericanCorporate",
"Credit:SingleName:Corporate:StandardSingaporeCorporate",
"Credit:SingleName:Corporate:StandardSubordinatedEuropeanInsuranceCorporate",
"Credit:SingleName:Corporate:StandardSukukCorporate",
"Credit:SingleName:Corporate:SubordinatedEuropeanInsuranceCorporate",
"Credit:SingleName:Corporate:SukukCorporate",
"Credit:SingleName:Loans:ELCDS",
"Credit:SingleName:Loans:LCDS",
"Credit:SingleName:Loans:StandardLCDSBullet",
"Credit:SingleName:Muni:USMunicipalFullFaithAndCredit",
"Credit:SingleName:Muni:USMunicipalGeneralFund",
"Credit:SingleName:Muni:USMunicipalRevenue",
"Credit:SingleName:RecoveryCDS:FixedRecoverySwaps",
"Credit:SingleName:RecoveryCDS:RecoveryLocks",
"Credit:SingleName:Sovereign:AsiaSovereign",
"Credit:SingleName:Sovereign:AustraliaSovereign",
"Credit:SingleName:Sovereign:EmergingEuropeanAndMiddleEasternSovereign",
"Credit:SingleName:Sovereign:JapanSovereign",
"Credit:SingleName:Sovereign:LatinAmericaSovereign",
"Credit:SingleName:Sovereign:NewZealandSovereign",
"Credit:SingleName:Sovereign:SingaporeSovereign",
"Credit:SingleName:Sovereign:StandardAsiaSovereign",
"Credit:SingleName:Sovereign:StandardAustraliaSovereign",
"Credit:SingleName:Sovereign:StandardEmergingEuropeanAndMiddleEasternSovereign",
"Credit:SingleName:Sovereign:StandardJapanSovereign",
"Credit:SingleName:Sovereign:StandardLatinAmericaSovereign",
"Credit:SingleName:Sovereign:StandardNewZealandSovereign",
"Credit:SingleName:Sovereign:StandardSingaporeSovereign",
"Credit:SingleName:Sovereign:StandardSukukSovereign",
"Credit:SingleName:Sovereign:StandardWesternEuropeanSovereign",
"Credit:SingleName:Sovereign:SukukSovereign",
"Credit:SingleName:Sovereign:WesternEuropeanSovereign",
"Credit:Swaptions:CDX:CDXSwaption",
"Credit:Swaptions:Corporate:CDSSwaption",
"Credit:Swaptions:iTraxx:iTraxxAsiaExJapanSwaption",
"Credit:Swaptions:iTraxx:iTraxxAustraliaSwaption",
"Credit:Swaptions:iTraxx:iTraxxEuropeSwaption",
"Credit:Swaptions:iTraxx:iTraxxJapanSwaption",
"Credit:Swaptions:iTraxx:iTraxxSovXSwaption",
"Credit:Swaptions:Muni:CDSSwaption",
"Credit:Swaptions:Sovereign:CDSSwaption",
"Credit:TotalReturnSwap",
"Equity:ContractForDifference:PriceReturnBasicPerformance:Basket",
"Equity:ContractForDifference:PriceReturnBasicPerformance:SingleIndex",
"Equity:ContractForDifference:PriceReturnBasicPerformance:SingleName",
"Equity:Forward:PriceReturnBasicPerformance:Basket",
"Equity:Forward:PriceReturnBasicPerformance:SingleIndex",
"Equity:Forward:PriceReturnBasicPerformance:SingleName",
"Equity:Option:ParameterReturnDividend:Basket",
"Equity:Option:ParameterReturnDividend:SingleIndex",
"Equity:Option:ParameterReturnDividend:SingleName",
"Equity:Option:ParameterReturnVariance:Basket",
"Equity:Option:ParameterReturnVariance:SingleIndex",
"Equity:Option:ParameterReturnVariance:SingleName",
"Equity:Option:ParameterReturnVolatility:Basket",
"Equity:Option:ParameterReturnVolatility:SingleIndex",
"Equity:Option:ParameterReturnVolatility:SingleName",
"Equity:Option:PriceReturnBasicPerformance:Basket",
"Equity:Option:PriceReturnBasicPerformance:SingleIndex",
"Equity:Option:PriceReturnBasicPerformance:SingleName",
"Equity:Other",
"Equity:PortfolioSwap:PriceReturnBasicPerformance:Basket",
"Equity:PortfolioSwap:PriceReturnBasicPerformance:SingleIndex",
"Equity:PortfolioSwap:PriceReturnBasicPerformance:SingleName",
"Equity:Swap:ParameterReturnDividend:Basket",
"Equity:Swap:ParameterReturnDividend:SingleIndex",
"Equity:Swap:ParameterReturnDividend:SingleName",
"Equity:Swap:ParameterReturnVariance:Basket",
"Equity:Swap:ParameterReturnVariance:SingleIndex",
"Equity:Swap:ParameterReturnVariance:SingleName",
"Equity:Swap:ParameterReturnVolatility:Basket",
"Equity:Swap:ParameterReturnVolatility:SingleIndex",
"Equity:Swap:ParameterReturnVolatility:SingleName",
"Equity:Swap:PriceReturnBasicPerformance:Basket",
"Equity:Swap:PriceReturnBasicPerformance:SingleIndex",
"Equity:Swap:PriceReturnBasicPerformance:SingleName",
"ForeignExchange:ComplexExotic",
"ForeignExchange:Forward",
"ForeignExchange:NDF",
"ForeignExchange:NDO",
"ForeignExchange:SimpleExotic:Barrier",
"ForeignExchange:SimpleExotic:Digital",
"ForeignExchange:Spot",
"ForeignExchange:VanillaOption",
"InterestRate:CapFloor",
"InterestRate:CrossCurrency:Basis",
"InterestRate:CrossCurrency:FixedFixed",
"InterestRate:CrossCurrency:FixedFloat",
"InterestRate:Exotic",
"InterestRate:FRA",
"InterestRate:IRSwap:Basis",
"InterestRate:IRSwap:FixedFixed",
"InterestRate:IRSwap:FixedFloat",
"InterestRate:IRSwap:Inflation",
"InterestRate:IRSwap:OIS",
"InterestRate:Option:DebtOption",
"InterestRate:Option:Swaption",
//Added to meet deficiencies.
"ForeignExchange:Swap",
"InterestRate:Debt:Government:Fixed:Bullet",
"InterestRate:Debt:Government:Float:Bullet",
"Inflation:Debt:Government:Fixed:Ammortising",
"Inflation:Debt:Government:Float:Ammortising",
"InterestRate:TermDeposit",
"Cash:Payment",
"Credit:Debt:ABS:CDSonCDO",
"Credit:Debt:ABS:CMBS",
"Credit:Debt:ABS:EuropeanCMBS",
"Credit:Debt:ABS:EuropeanRMBS",
"Credit:Debt:ABS:RMBS",
"Equity:OrdinaryShares",
"Equity:Forward:Physical",
"Property:Residential",
"ExchangeTraded:Future",
null // (nn) _LAST_
};
public static string GetEnumString(ProductTaxonomyEnum id) { return EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ProductTaxonomyEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ProductTaxonomyEnum tempId in Enum.GetValues(typeof(ProductTaxonomyEnum)))
{
if (String.Compare(idString, EnumStrings[(int)tempId], StringComparison.OrdinalIgnoreCase) == 0)
{
id = tempId;
return true;
}
}
id = ProductTaxonomyEnum.Undefined;
return false;
}
public static ProductTaxonomyEnum ParseEnumString(string idString)
{
ProductTaxonomyEnum result;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ProductTaxonomyEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ProductTaxonomy"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ProductTaxonomy");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ProductTaxonomyValue(dataRow); }
public string GetFpMLSource() { return "product-taxonomy-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ProductTaxonomyValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ProductTaxonomyValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new ProductTaxonomyValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ProductTaxonomyValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ProductTypeSimpleScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ProductTypeSimple ----------------------------------------
public enum ProductTypeSimpleEnum
{
Undefined,
InterestRateSwap, // (1) "InterestRateSwap"
AssetSwap, // (2) "AssetSwap"
InflationSwap, // (3) "InflationSwap"
CrossCurrencySwap, // (4) "CrossCurrencySwap"
CreditDefaultSwap, // (5) "CreditDefaultSwap"
TotalReturnSwap, // (6) "TotalReturnSwap"
VarianceSwap, // (7) "VarianceSwap"
CapFloor, // (8) "CapFloor"
FRA, // (9) "FRA"
FxForward, // (10) "FxForward"
FxSwap, // (11) "FxSwap"
EquityOption, // (12) "EquityOption"
BondOption, // (13) "BondOption"
FxOption, // (14) "FxOption"
FxSpot, // (15) "FxSpot"
FxOptionStrategy, // (16) "FxOptionStrategy"
BulletPayment, // (17) "BulletPayment"
CreditDefaultIndex, // (18) "CreditDefaultIndex"
CreditDefaultIndexTranche, // (19) "CreditDefaultIndexTranche"
CreditDefaultBasket, // (20) "CreditDefaultBasket"
CreditDefaultBasketTranche, // (21) "CreditDefaultBasketTranche"
CreditDefaultOption, // (22) "CreditDefaultOption"
EquityForward, // (23) "EquityForward"
InterestRateSwaption, // (24) "InterestRateSwaption"
TermDeposit, // (25) "TermDeposit"
DividendSwap, // (26) "DividendSwap"
ConvertibleBondOption, // (27) "ConvertibleBondOption"
BondTransaction, // (28) "BondTransaction"
EquityTransaction, // (29) "EquityTransaction"
PropertyTransaction, // (30) "PropertyTransaction"
FutureTransaction, // (31) "FutureTransaction"
CommodityForward, // (32) "CommodityForward"
_LAST_
}
public partial class ProductTypeSimpleValue : IFpMLCodeValue
{
public ProductTypeSimpleValue()
{ }
public ProductTypeSimpleValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ProductTypeSimpleScheme : IFpMLCodeScheme
{
private static readonly string[] EnumStrings =
{
null, // (0) Undefined
"InterestRateSwap", // (1) InterestRateSwap
"AssetSwap", // (2) AssetSwap
"InflationSwap", // (3) InflationSwap
"CrossCurrencySwap", // (4) CrossCurrencySwap
"CreditDefaultSwap", // (5) CreditDefaultSwap
"TotalReturnSwap", // (6) TotalReturnSwap
"VarianceSwap", // (7) VarianceSwap
"CapFloor", // (8) CapFloor
"FRA", // (9) FRA
"FxForward", // (10) FxForward
"FxSwap", // (11) FxSwap
"EquityOption", // (12) EquityOption
"BondOption", // (13) BondOption
"FxOption", // (14) FxOption
"FxSpot", // (15) FxSpot
"FxOptionStrategy", // (16) FxOptionStrategy
"BulletPayment", // (17) BulletPayment
"CreditDefaultIndex", // (18) CreditDefaultIndex
"CreditDefaultIndexTranche", // (19) CreditDefaultIndexTranche
"CreditDefaultBasket", // (20) CreditDefaultBasket
"CreditDefaultBasketTranche", // (21) CreditDefaultBasketTranche
"CreditDefaultOption", // (22) CreditDefaultOption
"EquityForward", // (23) EquityForward
"InterestRateSwaption", // (24) InterestRateSwaption
"TermDeposit", // (25) TermDeposit
"DividendSwap", // (26) DividendSwap
"ConvertibleBondOption", // (27) ConvertibleBondOption
"BondTransaction", // (28) BondTransaction
"EquityTransaction", // (29) EquityTransaction
"PropertyTransaction", // (30) "PropertyTransaction"
"FutureTransaction", //(31) FutureTransaction
"CommodityForward", // (32) "CommodityForward"
null // (nn) _LAST_
};
public static string GetEnumString(ProductTypeSimpleEnum id) { return EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ProductTypeSimpleEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ProductTypeSimpleEnum tempId in Enum.GetValues(typeof(ProductTypeSimpleEnum)))
{
if (String.Compare(idString, EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = ProductTypeSimpleEnum.Undefined;
return false;
}
public static ProductTypeSimpleEnum ParseEnumString(string idString)
{
var result = ProductTypeSimpleEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ProductTypeSimpleEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ProductTypeSimple"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ProductTypeSimple");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ProductTypeSimpleValue(dataRow); }
public string GetFpMLSource() { return "product-type-simple-1-2"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ProductTypeSimpleValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ProductTypeSimpleValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new ProductTypeSimpleValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ProductTypeSimpleValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ProductTypeSimpleScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- QueryParameterOperator ----------------------------------------
public enum QueryParameterOperatorEnum
{
Undefined,
Equals, // (1) "Equals"
NotEquals, // (2) "NotEquals"
LessThan, // (3) "LessThan"
GreaterThan, // (4) "GreaterThan"
_LAST_
}
public partial class QueryParameterOperatorValue : IFpMLCodeValue
{
public QueryParameterOperatorValue()
{ }
public QueryParameterOperatorValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class QueryParameterOperatorScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Equals", // (1) Equals
"NotEquals", // (2) NotEquals
"LessThan", // (3) LessThan
"GreaterThan", // (4) GreaterThan
null // (nn) _LAST_
};
public static string GetEnumString(QueryParameterOperatorEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out QueryParameterOperatorEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (QueryParameterOperatorEnum tempId in Enum.GetValues(typeof(QueryParameterOperatorEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = QueryParameterOperatorEnum.Undefined;
return false;
}
public static QueryParameterOperatorEnum ParseEnumString(string idString)
{
QueryParameterOperatorEnum result = QueryParameterOperatorEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to QueryParameterOperatorEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "QueryParameterOperator"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "QueryParameterOperator");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new QueryParameterOperatorValue(dataRow); }
public string GetFpMLSource() { return "query-parameter-operator-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(QueryParameterOperatorValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(QueryParameterOperatorValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
QueryParameterOperatorValue[] newValues = new QueryParameterOperatorValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (QueryParameterOperatorValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("QueryParameterOperatorScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- QuoteTiming ----------------------------------------
public enum QuoteTimingEnum
{
Undefined,
Open, // (1) "Open"
Close, // (2) "Close"
High, // (3) "High"
Low, // (4) "Low"
_LAST_
}
public partial class QuoteTimingValue : IFpMLCodeValue
{
public QuoteTimingValue()
{ }
public QuoteTimingValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class QuoteTimingScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Open", // (1) Open
"Close", // (2) Close
"High", // (3) High
"Low", // (4) Low
null // (nn) _LAST_
};
public static string GetEnumString(QuoteTimingEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out QuoteTimingEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (QuoteTimingEnum tempId in Enum.GetValues(typeof(QuoteTimingEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = QuoteTimingEnum.Undefined;
return false;
}
public static QuoteTimingEnum ParseEnumString(string idString)
{
QuoteTimingEnum result = QuoteTimingEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to QuoteTimingEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "QuoteTiming"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "QuoteTiming");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new QuoteTimingValue(dataRow); }
public string GetFpMLSource() { return "quote-timing-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(QuoteTimingValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(QuoteTimingValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
QuoteTimingValue[] newValues = new QuoteTimingValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (QuoteTimingValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("QuoteTimingScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ReasonCode ----------------------------------------
public enum ReasonCodeEnum
{
Undefined,
_100, // (1) "100"
_101, // (2) "101"
_102, // (3) "102"
_103, // (4) "103"
_104, // (5) "104"
_105, // (6) "105"
_106, // (7) "106"
_110, // (8) "110"
_111, // (9) "111"
_200, // (10) "200"
_201, // (11) "201"
_202, // (12) "202"
_203, // (13) "203"
_204, // (14) "204"
_210, // (15) "210"
_211, // (16) "211"
_300, // (17) "300"
_301, // (18) "301"
_302, // (19) "302"
_303, // (20) "303"
_304, // (21) "304"
_305, // (22) "305"
_306, // (23) "306"
_307, // (24) "307"
_308, // (25) "308"
_310, // (26) "310"
_311, // (27) "311"
_400, // (28) "400"
_401, // (29) "401"
_402, // (30) "402"
_403, // (31) "403"
_404, // (32) "404"
_410, // (33) "410"
_411, // (34) "411"
_LAST_
}
public partial class ReasonCodeValue : IFpMLCodeValue
{
public ReasonCodeValue()
{ }
public ReasonCodeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ReasonCodeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"100", // (1) _100
"101", // (2) _101
"102", // (3) _102
"103", // (4) _103
"104", // (5) _104
"105", // (6) _105
"106", // (7) _106
"110", // (8) _110
"111", // (9) _111
"200", // (10) _200
"201", // (11) _201
"202", // (12) _202
"203", // (13) _203
"204", // (14) _204
"210", // (15) _210
"211", // (16) _211
"300", // (17) _300
"301", // (18) _301
"302", // (19) _302
"303", // (20) _303
"304", // (21) _304
"305", // (22) _305
"306", // (23) _306
"307", // (24) _307
"308", // (25) _308
"310", // (26) _310
"311", // (27) _311
"400", // (28) _400
"401", // (29) _401
"402", // (30) _402
"403", // (31) _403
"404", // (32) _404
"410", // (33) _410
"411", // (34) _411
null // (nn) _LAST_
};
public static string GetEnumString(ReasonCodeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ReasonCodeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ReasonCodeEnum tempId in Enum.GetValues(typeof(ReasonCodeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = ReasonCodeEnum.Undefined;
return false;
}
public static ReasonCodeEnum ParseEnumString(string idString)
{
ReasonCodeEnum result = ReasonCodeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ReasonCodeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ReasonCode"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ReasonCode");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ReasonCodeValue(dataRow); }
public string GetFpMLSource() { return "reason-code-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ReasonCodeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ReasonCodeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
ReasonCodeValue[] newValues = new ReasonCodeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ReasonCodeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ReasonCodeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- Restructuring ----------------------------------------
public enum RestructuringEnum
{
Undefined,
R, // (1) "R"
ModR, // (2) "ModR"
ModModR, // (3) "ModModR"
_LAST_
}
public partial class RestructuringValue : IFpMLCodeValue
{
public RestructuringValue()
{ }
public RestructuringValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class RestructuringScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"R", // (1) R
"ModR", // (2) ModR
"ModModR", // (3) ModModR
null // (nn) _LAST_
};
public static string GetEnumString(RestructuringEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out RestructuringEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (RestructuringEnum tempId in Enum.GetValues(typeof(RestructuringEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = RestructuringEnum.Undefined;
return false;
}
public static RestructuringEnum ParseEnumString(string idString)
{
RestructuringEnum result = RestructuringEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to RestructuringEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "Restructuring"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "Restructuring");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new RestructuringValue(dataRow); }
public string GetFpMLSource() { return "restructuring-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(RestructuringValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(RestructuringValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
RestructuringValue[] newValues = new RestructuringValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (RestructuringValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("RestructuringScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- ScheduledDateType ----------------------------------------
public enum ScheduledDateTypeEnum
{
Undefined,
Effective, // (1) "Effective"
Termination, // (2) "Termination"
FirstPayment, // (3) "FirstPayment"
PreviousPayment, // (4) "PreviousPayment"
NextPayment, // (5) "NextPayment"
FinalPayment, // (6) "FinalPayment"
PreviousReset, // (7) "PreviousReset"
NextReset, // (8) "NextReset"
AccrualStart, // (9) "AccrualStart"
_LAST_
}
public partial class ScheduledDateTypeValue : IFpMLCodeValue
{
public ScheduledDateTypeValue()
{ }
public ScheduledDateTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class ScheduledDateTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Effective", // (1) Effective
"Termination", // (2) Termination
"FirstPayment", // (3) FirstPayment
"PreviousPayment", // (4) PreviousPayment
"NextPayment", // (5) NextPayment
"FinalPayment", // (6) FinalPayment
"PreviousReset", // (7) PreviousReset
"NextReset", // (8) NextReset
"AccrualStart", // (9) AccrualStart
null // (nn) _LAST_
};
public static string GetEnumString(ScheduledDateTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out ScheduledDateTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (ScheduledDateTypeEnum tempId in Enum.GetValues(typeof(ScheduledDateTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = ScheduledDateTypeEnum.Undefined;
return false;
}
public static ScheduledDateTypeEnum ParseEnumString(string idString)
{
ScheduledDateTypeEnum result = ScheduledDateTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to ScheduledDateTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "ScheduledDateType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "ScheduledDateType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new ScheduledDateTypeValue(dataRow); }
public string GetFpMLSource() { return "scheduled-date-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(ScheduledDateTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(ScheduledDateTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
ScheduledDateTypeValue[] newValues = new ScheduledDateTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (ScheduledDateTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("ScheduledDateTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- SettledEntityMatrixSource ----------------------------------------
public enum SettledEntityMatrixSourceEnum
{
Undefined,
Publisher, // (1) "Publisher"
ConfirmationAnnex, // (2) "ConfirmationAnnex"
NotApplicable, // (3) "NotApplicable"
_LAST_
}
public partial class SettledEntityMatrixSourceValue : IFpMLCodeValue
{
public SettledEntityMatrixSourceValue()
{ }
public SettledEntityMatrixSourceValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class SettledEntityMatrixSourceScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Publisher", // (1) Publisher
"ConfirmationAnnex", // (2) ConfirmationAnnex
"NotApplicable", // (3) NotApplicable
null // (nn) _LAST_
};
public static string GetEnumString(SettledEntityMatrixSourceEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out SettledEntityMatrixSourceEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (SettledEntityMatrixSourceEnum tempId in Enum.GetValues(typeof(SettledEntityMatrixSourceEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = SettledEntityMatrixSourceEnum.Undefined;
return false;
}
public static SettledEntityMatrixSourceEnum ParseEnumString(string idString)
{
SettledEntityMatrixSourceEnum result = SettledEntityMatrixSourceEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to SettledEntityMatrixSourceEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "SettledEntityMatrixSource"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "SettledEntityMatrixSource");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new SettledEntityMatrixSourceValue(dataRow); }
public string GetFpMLSource() { return "settled-entity-matrix-source-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(SettledEntityMatrixSourceValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(SettledEntityMatrixSourceValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
SettledEntityMatrixSourceValue[] newValues = new SettledEntityMatrixSourceValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (SettledEntityMatrixSourceValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("SettledEntityMatrixSourceScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- SettlementMethod ----------------------------------------
public enum SettlementMethodEnum
{
Undefined,
Chaps, // (1) "Chaps"
ChipsABA, // (2) "ChipsABA"
ChipsUID, // (3) "ChipsUID"
CLS, // (4) "CLS"
Fedwire, // (5) "Fedwire"
SWIFT, // (6) "SWIFT"
DDA, // (7) "DDA"
_LAST_
}
public partial class SettlementMethodValue : IFpMLCodeValue
{
public SettlementMethodValue()
{ }
public SettlementMethodValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class SettlementMethodScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Chaps", // (1) Chaps
"ChipsABA", // (2) ChipsABA
"ChipsUID", // (3) ChipsUID
"CLS", // (4) CLS
"Fedwire", // (5) Fedwire
"SWIFT", // (6) SWIFT
"DDA", // (7) DDA
null // (nn) _LAST_
};
public static string GetEnumString(SettlementMethodEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out SettlementMethodEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (SettlementMethodEnum tempId in Enum.GetValues(typeof(SettlementMethodEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = SettlementMethodEnum.Undefined;
return false;
}
public static SettlementMethodEnum ParseEnumString(string idString)
{
SettlementMethodEnum result = SettlementMethodEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to SettlementMethodEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "SettlementMethod"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "SettlementMethod");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new SettlementMethodValue(dataRow); }
public string GetFpMLSource() { return "settlement-method-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(SettlementMethodValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(SettlementMethodValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
SettlementMethodValue[] newValues = new SettlementMethodValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (SettlementMethodValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("SettlementMethodScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- SettlementPriceSource ----------------------------------------
public enum SettlementPriceSourceEnum
{
Undefined,
Bid, // (1) "Bid"
Offer, // (2) "Offer"
Mid, // (3) "Mid"
NASDAQ, // (4) "NASDAQ"
OfficialClose, // (5) "OfficialClose"
OfficialSettlement, // (6) "OfficialSettlement"
PrezzoDiRiferimento, // (7) "PrezzoDiRiferimento"
_LAST_
}
public partial class SettlementPriceSourceValue : IFpMLCodeValue
{
public SettlementPriceSourceValue()
{ }
public SettlementPriceSourceValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class SettlementPriceSourceScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Bid", // (1) Bid
"Offer", // (2) Offer
"Mid", // (3) Mid
"NASDAQ", // (4) NASDAQ
"OfficialClose", // (5) OfficialClose
"OfficialSettlement", // (6) OfficialSettlement
"PrezzoDiRiferimento", // (7) PrezzoDiRiferimento
null // (nn) _LAST_
};
public static string GetEnumString(SettlementPriceSourceEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out SettlementPriceSourceEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (SettlementPriceSourceEnum tempId in Enum.GetValues(typeof(SettlementPriceSourceEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = SettlementPriceSourceEnum.Undefined;
return false;
}
public static SettlementPriceSourceEnum ParseEnumString(string idString)
{
SettlementPriceSourceEnum result = SettlementPriceSourceEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to SettlementPriceSourceEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "SettlementPriceSource"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "SettlementPriceSource");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new SettlementPriceSourceValue(dataRow); }
public string GetFpMLSource() { return "settlement-price-source-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(SettlementPriceSourceValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(SettlementPriceSourceValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
SettlementPriceSourceValue[] newValues = new SettlementPriceSourceValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (SettlementPriceSourceValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("SettlementPriceSourceScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- SettlementRateOption ----------------------------------------
public enum SettlementRateOptionEnum
{
Undefined,
CNY_SAEC_CNY01, // (1) "CNY.SAEC/CNY01"
INR_RBIB_INR01, // (2) "INR.RBIB/INR01"
KRW_KEBEY_KRW01, // (3) "KRW.KEBEY/KRW01"
KRW_KFTC18_KRW02, // (4) "KRW.KFTC18/KRW02"
KRW_TELERATE_45644_KRW03, // (5) "KRW.TELERATE.45644/KRW03"
PKR_SBPK_PKR01, // (6) "PKR.SBPK/PKR01"
PHP_PHPESO_PHP01, // (7) "PHP.PHPESO/PHP01"
PHP_TELERATE_2920_PHP02, // (8) "PHP.TELERATE.2920/PHP02"
PHP_TELERATE_15439_PHP03, // (9) "PHP.TELERATE.15439/PHP03"
TWD_TELERATE_6161_TWD01, // (10) "TWD.TELERATE.6161/TWD01"
TWD_TFEMA_TWD02, // (11) "TWD.TFEMA/TWD02"
TWD_TPFL_TWD03, // (12) "TWD.TPFL/TWD03"
PLZ_NBPQ_PLZ01, // (13) "PLZ.NBPQ/PLZ01"
PLZ_NBPR_PLZ02, // (14) "PLZ.NBPR/PLZ02"
RUB_MICEXFRX_RUB01, // (15) "RUB.MICEXFRX/RUB01"
RUB_MMVB_RUB02, // (16) "RUB.MMVB/RUB02"
SKK_NBSB_SKK01, // (17) "SKK.NBSB/SKK01"
UAH_UICEI_UAH01, // (18) "UAH.UICEI/UAH01"
ARS_BNAR_ARS01, // (19) "ARS.BNAR/ARS01"
ARS_OFFICIAL_RATE_ARS02, // (20) "ARS.OFFICIAL.RATE/ARS02"
BRL_BRBY_BRL01, // (21) "BRL.BRBY/BRL01"
BRL_OFFICIAL_RATE_BRL02, // (22) "BRL.OFFICIAL.RATE/BRL02"
BRL_PCOT_COMMERCIAL_BRL03, // (23) "BRL.PCOT-COMMERCIAL/BRL03"
BRL_PCOT_FLOATING_BRL04, // (24) "BRL.PCOT-FLOATING/BRL04"
BRL_PTAX_COMMERCIAL_BRL05, // (25) "BRL.PTAX-COMMERCIAL/BRL05"
BRL_PTAX_COMMERCIAL_BRFR_BRL06, // (26) "BRL.PTAX-COMMERCIAL.BRFR/BRL06"
BRL_PTAX_FLOATING_BRL07, // (27) "BRL.PTAX-FLOATING/BRL07"
BRL_PTAX_FLOATING_BRFR_BRL08, // (28) "BRL.PTAX-FLOATING.BRFR/BRL08"
CLP_BCCH_CLP01, // (29) "CLP.BCCH/CLP01"
CLP_CHILD_INFORMAL_CLP02, // (30) "CLP.CHILD-INFORMAL/CLP02"
CLP_CHILD_INTERBANK_CLP03, // (31) "CLP.CHILD-INTERBANK/CLP03"
CLP_CHILD_OBSERVADO_CLP04, // (32) "CLP.CHILD-OBSERVADO/CLP04"
CLP_CHILG_INFORMAL_CLP05, // (33) "CLP.CHILG-INFORMAL/CLP05"
CLP_CHILG_INTERBANK_CLP06, // (34) "CLP.CHILG-INTERBANK/CLP06"
CLP_CHILG_OBSERVADO_CLP07, // (35) "CLP.CHILG-OBSERVADO/CLP07"
CLP_OFFICIAL_RATE_CLP08, // (36) "CLP.OFFICIAL.RATE/CLP08"
CLP_TELERATE_38942_CLP09, // (37) "CLP.TELERATE.38942/CLP09"
COP_CO_COL03_COP01, // (38) "COP.CO/COL03/COP01"
COP_TCRM_COP02, // (39) "COP.TCRM/COP02"
ECS_DNRP_ECS01, // (40) "ECS.DNRP/ECS01"
MXP_BNMX_MXP01, // (41) "MXP.BNMX/MXP01"
MXP_FIXING_RATE_MXP02, // (42) "MXP.FIXING.RATE/MXP02"
MXP_MEX01_MXP03, // (43) "MXP.MEX01/MXP03"
MXP_PUBLISHED_MXP04, // (44) "MXP.PUBLISHED/MXP04"
PEN_PDSB_PEN01, // (45) "PEN.PDSB/PEN01"
VER_VBCV_VEB01, // (46) "VER.VBCV/VEB01"
ILS_BOIJ_ILS01, // (47) "ILS.BOIJ/ILS01"
ILS_FXIL_ILS02, // (48) "ILS.FXIL/ILS02"
LBP_BDLX_LBP01, // (49) "LBP.BDLX/LBP01"
MAD_OFFICIAL_RATE_MAD01, // (50) "MAD.OFFICIAL.RATE/MAD01"
CURRENCY_IMPLIED_RATE__ADR__CURA1, // (51) "CURRENCY-IMPLIED.RATE.(ADR)/CURA1"
CURRENCY_IMPLIED_RATE__LOCAL_ASSET__CURA2, // (52) "CURRENCY-IMPLIED.RATE.(LOCAL.ASSET)/CURA2"
CURRENCY_MUTUAL_AGREEMENT_CURA3, // (53) "CURRENCY-MUTUAL.AGREEMENT/CURA3"
CURRENCY_REFERENCE_DEALERS_CURA4, // (54) "CURRENCY-REFERENCE.DEALERS/CURA4"
CURRENCY_WHOLESALE_MARKET_CURA5, // (55) "CURRENCY-WHOLESALE.MARKET/CURA5"
MYR_ABS_MYR01, // (56) "MYR.ABS/MYR01"
IDR_ABS_IDR01, // (57) "IDR.ABS/IDR01"
THB_ABS_THB01, // (58) "THB.ABS/THB01"
BRL_PTAX_BRL09, // (59) "BRL.PTAX/BRL09"
_LAST_
}
public partial class SettlementRateOptionValue : IFpMLCodeValue
{
public SettlementRateOptionValue()
{ }
public SettlementRateOptionValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class SettlementRateOptionScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"CNY.SAEC/CNY01", // (1) CNY_SAEC_CNY01
"INR.RBIB/INR01", // (2) INR_RBIB_INR01
"KRW.KEBEY/KRW01", // (3) KRW_KEBEY_KRW01
"KRW.KFTC18/KRW02", // (4) KRW_KFTC18_KRW02
"KRW.TELERATE.45644/KRW03", // (5) KRW_TELERATE_45644_KRW03
"PKR.SBPK/PKR01", // (6) PKR_SBPK_PKR01
"PHP.PHPESO/PHP01", // (7) PHP_PHPESO_PHP01
"PHP.TELERATE.2920/PHP02", // (8) PHP_TELERATE_2920_PHP02
"PHP.TELERATE.15439/PHP03", // (9) PHP_TELERATE_15439_PHP03
"TWD.TELERATE.6161/TWD01", // (10) TWD_TELERATE_6161_TWD01
"TWD.TFEMA/TWD02", // (11) TWD_TFEMA_TWD02
"TWD.TPFL/TWD03", // (12) TWD_TPFL_TWD03
"PLZ.NBPQ/PLZ01", // (13) PLZ_NBPQ_PLZ01
"PLZ.NBPR/PLZ02", // (14) PLZ_NBPR_PLZ02
"RUB.MICEXFRX/RUB01", // (15) RUB_MICEXFRX_RUB01
"RUB.MMVB/RUB02", // (16) RUB_MMVB_RUB02
"SKK.NBSB/SKK01", // (17) SKK_NBSB_SKK01
"UAH.UICEI/UAH01", // (18) UAH_UICEI_UAH01
"ARS.BNAR/ARS01", // (19) ARS_BNAR_ARS01
"ARS.OFFICIAL.RATE/ARS02", // (20) ARS_OFFICIAL_RATE_ARS02
"BRL.BRBY/BRL01", // (21) BRL_BRBY_BRL01
"BRL.OFFICIAL.RATE/BRL02", // (22) BRL_OFFICIAL_RATE_BRL02
"BRL.PCOT-COMMERCIAL/BRL03", // (23) BRL_PCOT_COMMERCIAL_BRL03
"BRL.PCOT-FLOATING/BRL04", // (24) BRL_PCOT_FLOATING_BRL04
"BRL.PTAX-COMMERCIAL/BRL05", // (25) BRL_PTAX_COMMERCIAL_BRL05
"BRL.PTAX-COMMERCIAL.BRFR/BRL06", // (26) BRL_PTAX_COMMERCIAL_BRFR_BRL06
"BRL.PTAX-FLOATING/BRL07", // (27) BRL_PTAX_FLOATING_BRL07
"BRL.PTAX-FLOATING.BRFR/BRL08", // (28) BRL_PTAX_FLOATING_BRFR_BRL08
"CLP.BCCH/CLP01", // (29) CLP_BCCH_CLP01
"CLP.CHILD-INFORMAL/CLP02", // (30) CLP_CHILD_INFORMAL_CLP02
"CLP.CHILD-INTERBANK/CLP03", // (31) CLP_CHILD_INTERBANK_CLP03
"CLP.CHILD-OBSERVADO/CLP04", // (32) CLP_CHILD_OBSERVADO_CLP04
"CLP.CHILG-INFORMAL/CLP05", // (33) CLP_CHILG_INFORMAL_CLP05
"CLP.CHILG-INTERBANK/CLP06", // (34) CLP_CHILG_INTERBANK_CLP06
"CLP.CHILG-OBSERVADO/CLP07", // (35) CLP_CHILG_OBSERVADO_CLP07
"CLP.OFFICIAL.RATE/CLP08", // (36) CLP_OFFICIAL_RATE_CLP08
"CLP.TELERATE.38942/CLP09", // (37) CLP_TELERATE_38942_CLP09
"COP.CO/COL03/COP01", // (38) COP_CO_COL03_COP01
"COP.TCRM/COP02", // (39) COP_TCRM_COP02
"ECS.DNRP/ECS01", // (40) ECS_DNRP_ECS01
"MXP.BNMX/MXP01", // (41) MXP_BNMX_MXP01
"MXP.FIXING.RATE/MXP02", // (42) MXP_FIXING_RATE_MXP02
"MXP.MEX01/MXP03", // (43) MXP_MEX01_MXP03
"MXP.PUBLISHED/MXP04", // (44) MXP_PUBLISHED_MXP04
"PEN.PDSB/PEN01", // (45) PEN_PDSB_PEN01
"VER.VBCV/VEB01", // (46) VER_VBCV_VEB01
"ILS.BOIJ/ILS01", // (47) ILS_BOIJ_ILS01
"ILS.FXIL/ILS02", // (48) ILS_FXIL_ILS02
"LBP.BDLX/LBP01", // (49) LBP_BDLX_LBP01
"MAD.OFFICIAL.RATE/MAD01", // (50) MAD_OFFICIAL_RATE_MAD01
"CURRENCY-IMPLIED.RATE.(ADR)/CURA1", // (51) CURRENCY_IMPLIED_RATE__ADR__CURA1
"CURRENCY-IMPLIED.RATE.(LOCAL.ASSET)/CURA2", // (52) CURRENCY_IMPLIED_RATE__LOCAL_ASSET__CURA2
"CURRENCY-MUTUAL.AGREEMENT/CURA3", // (53) CURRENCY_MUTUAL_AGREEMENT_CURA3
"CURRENCY-REFERENCE.DEALERS/CURA4", // (54) CURRENCY_REFERENCE_DEALERS_CURA4
"CURRENCY-WHOLESALE.MARKET/CURA5", // (55) CURRENCY_WHOLESALE_MARKET_CURA5
"MYR.ABS/MYR01", // (56) MYR_ABS_MYR01
"IDR.ABS/IDR01", // (57) IDR_ABS_IDR01
"THB.ABS/THB01", // (58) THB_ABS_THB01
"BRL.PTAX/BRL09", // (59) BRL_PTAX_BRL09
null // (nn) _LAST_
};
public static string GetEnumString(SettlementRateOptionEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out SettlementRateOptionEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (SettlementRateOptionEnum tempId in Enum.GetValues(typeof(SettlementRateOptionEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = SettlementRateOptionEnum.Undefined;
return false;
}
public static SettlementRateOptionEnum ParseEnumString(string idString)
{
SettlementRateOptionEnum result = SettlementRateOptionEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to SettlementRateOptionEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "SettlementRateOption"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "SettlementRateOption");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new SettlementRateOptionValue(dataRow); }
public string GetFpMLSource() { return "settlement-rate-option-2-1"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(SettlementRateOptionValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(SettlementRateOptionValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new SettlementRateOptionValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (SettlementRateOptionValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("SettlementRateOptionScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- SpreadScheduleType ----------------------------------------
public enum SpreadScheduleTypeEnum
{
Undefined,
Long, // (1) "Long"
Short, // (2) "Short"
_LAST_
}
public partial class SpreadScheduleTypeValue : IFpMLCodeValue
{
public SpreadScheduleTypeValue()
{ }
public SpreadScheduleTypeValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class SpreadScheduleTypeScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Long", // (1) Long
"Short", // (2) Short
null // (nn) _LAST_
};
public static string GetEnumString(SpreadScheduleTypeEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out SpreadScheduleTypeEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (SpreadScheduleTypeEnum tempId in Enum.GetValues(typeof(SpreadScheduleTypeEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = SpreadScheduleTypeEnum.Undefined;
return false;
}
public static SpreadScheduleTypeEnum ParseEnumString(string idString)
{
var result = SpreadScheduleTypeEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to SpreadScheduleTypeEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "SpreadScheduleType"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
var result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "SpreadScheduleType");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new SpreadScheduleTypeValue(dataRow); }
public string GetFpMLSource() { return "spread-schedule-type-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(SpreadScheduleTypeValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(SpreadScheduleTypeValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
var newValues = new SpreadScheduleTypeValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (SpreadScheduleTypeValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("SpreadScheduleTypeScheme.AddCodeValue failed: {0}", excp));
}
}
}
// ---------------------------------------- TradeCashflowsStatus ----------------------------------------
public enum TradeCashflowsStatusEnum
{
Undefined,
Alleged, // (1) "Alleged"
Matched, // (2) "Matched"
Mismatched, // (3) "Mismatched"
Unmatched, // (4) "Unmatched"
_LAST_
}
public partial class TradeCashflowsStatusValue : IFpMLCodeValue
{
public TradeCashflowsStatusValue()
{ }
public TradeCashflowsStatusValue(Row dataRow)
{
if ((dataRow != null) && (dataRow.Value != null))
{
if ((dataRow.Value.Length > 0) && (dataRow.Value[0] != null))
Code = dataRow.Value[0].SimpleValue.Value;
if ((dataRow.Value.Length > 1) && (dataRow.Value[1] != null))
Source = dataRow.Value[1].SimpleValue.Value;
if ((dataRow.Value.Length > 2) && (dataRow.Value[2] != null))
Description = dataRow.Value[2].SimpleValue.Value;
}
}
public string GetPrimaryKey() { return Code; }
}
public partial class TradeCashflowsStatusScheme : IFpMLCodeScheme
{
private static readonly string[] _EnumStrings =
{
null, // (0) Undefined
"Alleged", // (1) Alleged
"Matched", // (2) Matched
"Mismatched", // (3) Mismatched
"Unmatched", // (4) Unmatched
null // (nn) _LAST_
};
public static string GetEnumString(TradeCashflowsStatusEnum id) { return _EnumStrings[(int)id]; }
public static bool TryParseEnumString(string idString, out TradeCashflowsStatusEnum id)
{
// note: we cannot use Enum.Parse() here, hence the loop...
foreach (TradeCashflowsStatusEnum tempId in Enum.GetValues(typeof(TradeCashflowsStatusEnum)))
{
if (String.Compare(idString, _EnumStrings[(int)tempId], true) == 0)
{
id = tempId;
return true;
}
}
id = TradeCashflowsStatusEnum.Undefined;
return false;
}
public static TradeCashflowsStatusEnum ParseEnumString(string idString)
{
TradeCashflowsStatusEnum result = TradeCashflowsStatusEnum.Undefined;
if (!TryParseEnumString(idString, out result))
throw new ArgumentException(String.Format("Cannot convert '{0}' to TradeCashflowsStatusEnum", idString));
return result;
}
public string GetItemName(string suffix)
{
return "Orion.V5r3.Configuration.FpMLCodeScheme." + "TradeCashflowsStatus"
+ ((suffix == null) ? null : ("." + suffix));
}
public NamedValueSet GetItemProps()
{
NamedValueSet result = new NamedValueSet();
result.Set("Type", "FpMLCodeScheme");
result.Set("FpMLCodeScheme", "TradeCashflowsStatus");
return result;
}
public IFpMLCodeValue CreateCodeValue(Row dataRow) { return new TradeCashflowsStatusValue(dataRow); }
public string GetFpMLSource() { return "trade-cashflows-status-1-0"; }
public void AddCodeValue(IFpMLCodeValue codeValue)
{
try
{
if (codeValue.GetType() != typeof(TradeCashflowsStatusValue))
throw new ApplicationException(
String.Format("Cannot convert type '{0}' to '{1}'!", codeValue.GetType().Name, typeof(TradeCashflowsStatusValue).Name));
int newLength = 1;
if (schemeValuesField != null)
newLength = schemeValuesField.Length + 1;
TradeCashflowsStatusValue[] newValues = new TradeCashflowsStatusValue[newLength];
if (schemeValuesField != null)
schemeValuesField.CopyTo(newValues, 0);
newValues[newLength - 1] = (TradeCashflowsStatusValue)codeValue;
schemeValuesField = newValues;
}
catch (Exception excp)
{
Trace.WriteLine(String.Format("TradeCashflowsStatusScheme.AddCodeValue failed: {0}", excp));
}
}
}
}
| 46.885919 | 151 | 0.581916 | [
"BSD-3-Clause"
] | mmrath/Highlander.Net | Metadata/FpML.V5r11/FpML.V5r11.Codes/FpMLCodesExt.cs | 340,298 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Yodii.Model
{
interface IDeferredActions
{
}
}
| 12.153846 | 33 | 0.721519 | [
"MIT"
] | mfkl/YodiiStaticProxy.Fody | Yodii.Model/Host/IDeferredActions.cs | 160 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("03. Ones-And-Zeros")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("03. Ones-And-Zeros")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("dd42c96a-d280-41b5-9801-e10681911cc0")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.081081 | 84 | 0.741661 | [
"MIT"
] | petyakostova/Telerik-Academy | C#/C# 1 Contests/3/Ones-And-Zeros/03. Ones-And-Zeros/Properties/AssemblyInfo.cs | 1,412 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Labs_ASPToDo2.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
} | 19.333333 | 67 | 0.565517 | [
"MIT"
] | SebastianTrifa/c- | Labs_ASPToDo2/Controllers/HomeController.cs | 582 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XFwithFbSDK.WinPhone")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XFwithFbSDK.WinPhone")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("65077432-0c92-466b-b68d-911a8ec84f1d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
| 38.210526 | 84 | 0.754132 | [
"MIT"
] | CuljakIvan/Xamarin | XFwithFbSDK/XFwithFbSDK/XFwithFbSDK.WinPhone/Properties/AssemblyInfo.cs | 1,455 | C# |
using System.Linq;
using System.Threading.Tasks;
using Acs1;
using Acs5;
using AElf.Contracts.Economic.TestBase;
using AElf.Contracts.MultiToken;
using AElf.Contracts.TokenConverter;
using AElf.Types;
using Google.Protobuf.WellKnownTypes;
using Shouldly;
using Xunit;
namespace AElf.Contracts.EconomicSystem.Tests.BVT
{
public partial class EconomicSystemTest : EconomicSystemTestBase
{
public EconomicSystemTest()
{
InitializeContracts();
}
[Fact]
public async Task EconomistSystem_CheckBasicInformation_Test()
{
// Treasury contract created Treasury Profit Item and set Profit Id to Profit Contract.
var treasuryProfit = await ProfitContractStub.GetScheme.CallAsync(ProfitItemsIds[ProfitType.Treasury]);
treasuryProfit.Manager.ShouldBe(TreasuryContractAddress);
treasuryProfit.SubSchemes.Count.ShouldBe(3);
treasuryProfit.IsReleaseAllBalanceEveryTimeByDefault.ShouldBe(true);
// Token Converter Contract created AETC token.
var tokenInformation = await TokenContractStub.GetTokenInfo.CallAsync(new GetTokenInfoInput
{
Symbol = EconomicSystemTestConstants.ConverterTokenSymbol
});
tokenInformation.Issuer.ShouldBe(TokenConverterContractAddress);
tokenInformation.TotalSupply.ShouldBe(EconomicSystemTestConstants.TotalSupply);
}
private async Task EconomistSystem_SetMethodTransactionFee_Test()
{
const long feeAmount = 10L;
await TransactionFeeChargingContractStub.SetMethodFee.SendAsync(new TokenAmounts
{
Method = nameof(TransactionFeeChargingContractStub.SendForFun),
Amounts =
{
new TokenAmount
{
Symbol = EconomicSystemTestConstants.NativeTokenSymbol,
Amount = feeAmount
}
}
});
var tokenAmount = await TransactionFeeChargingContractStub.GetMethodFee.CallAsync(new MethodName
{
Name = nameof(TransactionFeeChargingContractStub.SendForFun)
});
tokenAmount.Amounts.First(a => a.Symbol == EconomicSystemTestConstants.NativeTokenSymbol).Amount
.ShouldBe(feeAmount);
}
[Fact]
public async Task EconomistSystem_ChargeMethodTransactionFee_Test()
{
await EconomistSystem_SetMethodTransactionFee_Test();
var chosenOneKeyPair = CoreDataCenterKeyPairs.First();
var chosenOneAddress = Address.FromPublicKey(chosenOneKeyPair.PublicKey);
var balanceBefore = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.NativeTokenSymbol
});
var tycoon = GetTransactionFeeChargingContractTester(chosenOneKeyPair);
await tycoon.SendForFun.SendAsync(new Empty());
var balanceAfter = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.NativeTokenSymbol
});
balanceAfter.Balance.ShouldBe(balanceBefore.Balance - 10L);
}
[Fact]
public async Task EconomicSystem_ChargeMethodTransactionFeeEvenExecutionFailed()
{
const long feeAmount = 10L;
await TransactionFeeChargingContractStub.SetMethodFee.SendAsync(new TokenAmounts
{
Method = nameof(TransactionFeeChargingContractStub.SupposedToFail),
Amounts =
{
new TokenAmount
{
Symbol = EconomicSystemTestConstants.NativeTokenSymbol,
Amount = feeAmount
}
}
});
var chosenOneKeyPair = CoreDataCenterKeyPairs.First();
var chosenOneAddress = Address.FromPublicKey(chosenOneKeyPair.PublicKey);
var balanceBefore = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.NativeTokenSymbol
});
var tycoon = GetTransactionFeeChargingContractTester(chosenOneKeyPair);
var transactionResult = await tycoon.SupposedToFail.SendAsync(new Empty());
transactionResult.TransactionResult.Status.ShouldBe(TransactionResultStatus.Failed);
var balanceAfter = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.NativeTokenSymbol
});
balanceAfter.Balance.ShouldBe(balanceBefore.Balance);
}
private async Task<long> EconomistSystem_SetMethodTransactionFee_MultipleSymbol_Test()
{
const long feeAmount = 10L;
await TransactionFeeChargingContractStub.SetMethodFee.SendAsync(new TokenAmounts
{
Method = nameof(TransactionFeeChargingContractStub.SendForFun),
Amounts =
{
new TokenAmount
{
Symbol = EconomicSystemTestConstants.TransactionFeeChargingContractTokenSymbol,
Amount = feeAmount
},
new TokenAmount
{
Symbol = EconomicSystemTestConstants.NativeTokenSymbol,
Amount = feeAmount
}
}
});
var tokenAmount = await TransactionFeeChargingContractStub.GetMethodFee.CallAsync(new MethodName
{
Name = nameof(TransactionFeeChargingContractStub.SendForFun)
});
tokenAmount.Amounts.First(a => a.Symbol == EconomicSystemTestConstants.NativeTokenSymbol).Amount
.ShouldBe(feeAmount);
tokenAmount.Amounts
.First(a => a.Symbol == EconomicSystemTestConstants.TransactionFeeChargingContractTokenSymbol).Amount
.ShouldBe(feeAmount);
return feeAmount;
}
[Fact]
public async Task EconomicSystem_ChargeMethodTransactionFee_MultipleSymbol_Test()
{
var feeAmount = await EconomistSystem_SetMethodTransactionFee_MultipleSymbol_Test();
var chosenOneKeyPair = CoreDataCenterKeyPairs.First();
var chosenOneAddress = Address.FromPublicKey(chosenOneKeyPair.PublicKey);
{
var balance = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.TransactionFeeChargingContractTokenSymbol
});
balance.Balance.ShouldBe(0);
}
// The chosen one decide to buy some TFCC tokens.
var chosenOneTokenContractStub =
GetTester<TokenContractContainer.TokenContractStub>(TokenContractAddress, chosenOneKeyPair);
await chosenOneTokenContractStub.Approve.SendAsync(new ApproveInput
{
Spender = TokenConverterContractAddress,
Symbol = EconomicSystemTestConstants.NativeTokenSymbol,
Amount = 100_000_00000000 // Enough,
});
var chosenOneTokenConverterContractStub =
GetTester<TokenConverterContractContainer.TokenConverterContractStub>(TokenConverterContractAddress,
chosenOneKeyPair);
var result = await chosenOneTokenConverterContractStub.Buy.SendAsync(new BuyInput
{
Symbol = EconomicSystemTestConstants.TransactionFeeChargingContractTokenSymbol,
Amount = feeAmount
});
result.TransactionResult.Status.ShouldBe(TransactionResultStatus.Mined);
{
var balance = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.TransactionFeeChargingContractTokenSymbol
});
balance.Balance.ShouldBe(feeAmount);
}
var tycoon = GetTransactionFeeChargingContractTester(chosenOneKeyPair);
await tycoon.SendForFun.SendAsync(new Empty());
{
var balance = await TokenContractStub.GetBalance.CallAsync(new GetBalanceInput
{
Owner = chosenOneAddress,
Symbol = EconomicSystemTestConstants.TransactionFeeChargingContractTokenSymbol
});
balance.Balance.ShouldBe(0L);
}
}
[Fact]
public async Task EconomistSystem_SetMethodCallThreshold_Test()
{
const long feeAmount = 100L;
var setMethodResult = await MethodCallThresholdContractStub.SetMethodCallingThreshold.SendAsync(
new SetMethodCallingThresholdInput
{
Method = nameof(MethodCallThresholdContractStub.SendForFun),
SymbolToAmount = {{EconomicSystemTestConstants.NativeTokenSymbol, feeAmount}}
});
setMethodResult.TransactionResult.Status.ShouldBe(TransactionResultStatus.Mined);
var tokenAmount = await MethodCallThresholdContractStub.GetMethodCallingThreshold.CallAsync(new StringValue
{
Value = nameof(MethodCallThresholdContractStub.SendForFun)
});
tokenAmount.SymbolToAmount[EconomicSystemTestConstants.NativeTokenSymbol].ShouldBe(feeAmount);
}
}
} | 43.517241 | 119 | 0.623415 | [
"MIT"
] | lpo1015/AElf | test/AElf.Contracts.EconomicSystem.Tests/BVT/TreasuryBasicTests.cs | 10,096 | C# |
using System;
using System.IO;
using System.Text;
namespace ICSharpCode.SharpZipLib.Tar
{
/// <summary>
/// Used to advise clients of 'events' while processing archives
/// </summary>
public delegate void ProgressMessageHandler(TarArchive archive, TarEntry entry, string message);
/// <summary>
/// The TarArchive class implements the concept of a
/// 'Tape Archive'. A tar archive is a series of entries, each of
/// which represents a file system object. Each entry in
/// the archive consists of a header block followed by 0 or more data blocks.
/// Directory entries consist only of the header block, and are followed by entries
/// for the directory's contents. File entries consist of a
/// header followed by the number of blocks needed to
/// contain the file's contents. All entries are written on
/// block boundaries. Blocks are 512 bytes long.
///
/// TarArchives are instantiated in either read or write mode,
/// based upon whether they are instantiated with an InputStream
/// or an OutputStream. Once instantiated TarArchives read/write
/// mode can not be changed.
///
/// There is currently no support for random access to tar archives.
/// However, it seems that subclassing TarArchive, and using the
/// TarBuffer.CurrentRecord and TarBuffer.CurrentBlock
/// properties, this would be rather trivial.
/// </summary>
public class TarArchive : IDisposable
{
/// <summary>
/// Client hook allowing detailed information to be reported during processing
/// </summary>
public event ProgressMessageHandler ProgressMessageEvent;
/// <summary>
/// Raises the ProgressMessage event
/// </summary>
/// <param name="entry">The <see cref="TarEntry">TarEntry</see> for this event</param>
/// <param name="message">message for this event. Null is no message</param>
protected virtual void OnProgressMessageEvent(TarEntry entry, string message)
{
ProgressMessageHandler handler = ProgressMessageEvent;
if (handler != null)
{
handler(this, entry, message);
}
}
//#region Constructors
/// <summary>
/// Constructor for a default <see cref="TarArchive"/>.
/// </summary>
protected TarArchive()
{
}
/// <summary>
/// Initalise a TarArchive for input.
/// </summary>
/// <param name="stream">The <see cref="TarInputStream"/> to use for input.</param>
protected TarArchive(TarInputStream stream)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
tarIn = stream;
}
/// <summary>
/// Initialise a TarArchive for output.
/// </summary>
/// <param name="stream">The <see cref="TarOutputStream"/> to use for output.</param>
protected TarArchive(TarOutputStream stream)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
tarOut = stream;
}
//#endregion Constructors
//#region Static factory methods
/// <summary>
/// The InputStream based constructors create a TarArchive for the
/// purposes of extracting or listing a tar archive. Thus, use
/// these constructors when you wish to extract files from or list
/// the contents of an existing tar archive.
/// </summary>
/// <param name="inputStream">The stream to retrieve archive data from.</param>
/// <returns>Returns a new <see cref="TarArchive"/> suitable for reading from.</returns>
public static TarArchive CreateInputTarArchive(Stream inputStream)
{
if (inputStream == null)
{
throw new ArgumentNullException(nameof(inputStream));
}
var tarStream = inputStream as TarInputStream;
TarArchive result;
if (tarStream != null)
{
result = new TarArchive(tarStream);
}
else
{
result = CreateInputTarArchive(inputStream, TarBuffer.DefaultBlockFactor);
}
return result;
}
/// <summary>
/// Create TarArchive for reading setting block factor
/// </summary>
/// <param name="inputStream">A stream containing the tar archive contents</param>
/// <param name="blockFactor">The blocking factor to apply</param>
/// <returns>Returns a <see cref="TarArchive"/> suitable for reading.</returns>
public static TarArchive CreateInputTarArchive(Stream inputStream, int blockFactor)
{
if (inputStream == null)
{
throw new ArgumentNullException(nameof(inputStream));
}
if (inputStream is TarInputStream)
{
throw new ArgumentException("TarInputStream not valid");
}
return new TarArchive(new TarInputStream(inputStream, blockFactor));
}
/// <summary>
/// Create a TarArchive for writing to, using the default blocking factor
/// </summary>
/// <param name="outputStream">The <see cref="Stream"/> to write to</param>
/// <returns>Returns a <see cref="TarArchive"/> suitable for writing.</returns>
public static TarArchive CreateOutputTarArchive(Stream outputStream)
{
if (outputStream == null)
{
throw new ArgumentNullException(nameof(outputStream));
}
var tarStream = outputStream as TarOutputStream;
TarArchive result;
if (tarStream != null)
{
result = new TarArchive(tarStream);
}
else
{
result = CreateOutputTarArchive(outputStream, TarBuffer.DefaultBlockFactor);
}
return result;
}
/// <summary>
/// Create a <see cref="TarArchive">tar archive</see> for writing.
/// </summary>
/// <param name="outputStream">The stream to write to</param>
/// <param name="blockFactor">The blocking factor to use for buffering.</param>
/// <returns>Returns a <see cref="TarArchive"/> suitable for writing.</returns>
public static TarArchive CreateOutputTarArchive(Stream outputStream, int blockFactor)
{
if (outputStream == null)
{
throw new ArgumentNullException(nameof(outputStream));
}
if (outputStream is TarOutputStream)
{
throw new ArgumentException("TarOutputStream is not valid");
}
return new TarArchive(new TarOutputStream(outputStream, blockFactor));
}
//#endregion Static factory methods
/// <summary>
/// Set the flag that determines whether existing files are
/// kept, or overwritten during extraction.
/// </summary>
/// <param name="keepExistingFiles">
/// If true, do not overwrite existing files.
/// </param>
public void SetKeepOldFiles(bool keepExistingFiles)
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
keepOldFiles = keepExistingFiles;
}
/// <summary>
/// Get/set the ascii file translation flag. If ascii file translation
/// is true, then the file is checked to see if it a binary file or not.
/// If the flag is true and the test indicates it is ascii text
/// file, it will be translated. The translation converts the local
/// operating system's concept of line ends into the UNIX line end,
/// '\n', which is the defacto standard for a TAR archive. This makes
/// text files compatible with UNIX.
/// </summary>
public bool AsciiTranslate
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return asciiTranslate;
}
set
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
asciiTranslate = value;
}
}
/// <summary>
/// Set the ascii file translation flag.
/// </summary>
/// <param name= "translateAsciiFiles">
/// If true, translate ascii text files.
/// </param>
[Obsolete("Use the AsciiTranslate property")]
public void SetAsciiTranslation(bool translateAsciiFiles)
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
asciiTranslate = translateAsciiFiles;
}
/// <summary>
/// PathPrefix is added to entry names as they are written if the value is not null.
/// A slash character is appended after PathPrefix
/// </summary>
public string PathPrefix
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return pathPrefix;
}
set
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
pathPrefix = value;
}
}
/// <summary>
/// RootPath is removed from entry names if it is found at the
/// beginning of the name.
/// </summary>
public string RootPath
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return rootPath;
}
set
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
// Convert to forward slashes for matching. Trim trailing / for correct final path
rootPath = value.Replace('\\', '/').TrimEnd('/');
}
}
/// <summary>
/// Set user and group information that will be used to fill in the
/// tar archive's entry headers. This information is based on that available
/// for the linux operating system, which is not always available on other
/// operating systems. TarArchive allows the programmer to specify values
/// to be used in their place.
/// <see cref="ApplyUserInfoOverrides"/> is set to true by this call.
/// </summary>
/// <param name="userId">
/// The user id to use in the headers.
/// </param>
/// <param name="userName">
/// The user name to use in the headers.
/// </param>
/// <param name="groupId">
/// The group id to use in the headers.
/// </param>
/// <param name="groupName">
/// The group name to use in the headers.
/// </param>
public void SetUserInfo(int userId, string userName, int groupId, string groupName)
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
this.userId = userId;
this.userName = userName;
this.groupId = groupId;
this.groupName = groupName;
applyUserInfoOverrides = true;
}
/// <summary>
/// Get or set a value indicating if overrides defined by <see cref="SetUserInfo">SetUserInfo</see> should be applied.
/// </summary>
/// <remarks>If overrides are not applied then the values as set in each header will be used.</remarks>
public bool ApplyUserInfoOverrides
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return applyUserInfoOverrides;
}
set
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
applyUserInfoOverrides = value;
}
}
/// <summary>
/// Get the archive user id.
/// See <see cref="ApplyUserInfoOverrides">ApplyUserInfoOverrides</see> for detail
/// on how to allow setting values on a per entry basis.
/// </summary>
/// <returns>
/// The current user id.
/// </returns>
public int UserId
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return userId;
}
}
/// <summary>
/// Get the archive user name.
/// See <see cref="ApplyUserInfoOverrides">ApplyUserInfoOverrides</see> for detail
/// on how to allow setting values on a per entry basis.
/// </summary>
/// <returns>
/// The current user name.
/// </returns>
public string UserName
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return userName;
}
}
/// <summary>
/// Get the archive group id.
/// See <see cref="ApplyUserInfoOverrides">ApplyUserInfoOverrides</see> for detail
/// on how to allow setting values on a per entry basis.
/// </summary>
/// <returns>
/// The current group id.
/// </returns>
public int GroupId
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return groupId;
}
}
/// <summary>
/// Get the archive group name.
/// See <see cref="ApplyUserInfoOverrides">ApplyUserInfoOverrides</see> for detail
/// on how to allow setting values on a per entry basis.
/// </summary>
/// <returns>
/// The current group name.
/// </returns>
public string GroupName
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
return groupName;
}
}
/// <summary>
/// Get the archive's record size. Tar archives are composed of
/// a series of RECORDS each containing a number of BLOCKS.
/// This allowed tar archives to match the IO characteristics of
/// the physical device being used. Archives are expected
/// to be properly "blocked".
/// </summary>
/// <returns>
/// The record size this archive is using.
/// </returns>
public int RecordSize
{
get
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
if (tarIn != null)
{
return tarIn.RecordSize;
}
else if (tarOut != null)
{
return tarOut.RecordSize;
}
return TarBuffer.DefaultRecordSize;
}
}
/// <summary>
/// Sets the IsStreamOwner property on the underlying stream.
/// Set this to false to prevent the Close of the TarArchive from closing the stream.
/// </summary>
public bool IsStreamOwner
{
set
{
if (tarIn != null)
{
tarIn.IsStreamOwner = value;
}
else
{
tarOut.IsStreamOwner = value;
}
}
}
/// <summary>
/// Close the archive.
/// </summary>
[Obsolete("Use Close instead")]
public void CloseArchive()
{
Close();
}
/// <summary>
/// Perform the "list" command for the archive contents.
///
/// NOTE That this method uses the <see cref="ProgressMessageEvent"> progress event</see> to actually list
/// the contents. If the progress display event is not set, nothing will be listed!
/// </summary>
public void ListContents()
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
while (true)
{
TarEntry entry = tarIn.GetNextEntry();
if (entry == null)
{
break;
}
OnProgressMessageEvent(entry, null);
}
}
/// <summary>
/// Perform the "extract" command and extract the contents of the archive.
/// </summary>
/// <param name="destinationDirectory">
/// The destination directory into which to extract.
/// </param>
public void ExtractContents(string destinationDirectory)
{
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
while (true)
{
TarEntry entry = tarIn.GetNextEntry();
if (entry == null)
{
break;
}
if (entry.TarHeader.TypeFlag == TarHeader.LF_LINK || entry.TarHeader.TypeFlag == TarHeader.LF_SYMLINK)
continue;
ExtractEntry(destinationDirectory, entry);
}
}
/// <summary>
/// Extract an entry from the archive. This method assumes that the
/// tarIn stream has been properly set with a call to GetNextEntry().
/// </summary>
/// <param name="destDir">
/// The destination directory into which to extract.
/// </param>
/// <param name="entry">
/// The TarEntry returned by tarIn.GetNextEntry().
/// </param>
private void ExtractEntry(string destDir, TarEntry entry)
{
OnProgressMessageEvent(entry, null);
string name = entry.Name;
if (Path.IsPathRooted(name))
{
// NOTE:
// for UNC names... \\machine\share\zoom\beet.txt gives \zoom\beet.txt
name = name.Substring(Path.GetPathRoot(name).Length);
}
name = name.Replace('/', Path.DirectorySeparatorChar);
string destFile = Path.Combine(destDir, name);
if (entry.IsDirectory)
{
EnsureDirectoryExists(destFile);
}
else
{
string parentDirectory = Path.GetDirectoryName(destFile);
EnsureDirectoryExists(parentDirectory);
bool process = true;
var fileInfo = new FileInfo(destFile);
if (fileInfo.Exists)
{
if (keepOldFiles)
{
OnProgressMessageEvent(entry, "Destination file already exists");
process = false;
}
else if ((fileInfo.Attributes & FileAttributes.ReadOnly) != 0)
{
OnProgressMessageEvent(entry, "Destination file already exists, and is read-only");
process = false;
}
}
if (process)
{
using (var outputStream = File.Create(destFile))
{
if (this.asciiTranslate)
{
// May need to translate the file.
ExtractAndTranslateEntry(destFile, outputStream);
}
else
{
// If translation is disabled, just copy the entry across directly.
tarIn.CopyEntryContents(outputStream);
}
}
}
}
}
// Extract a TAR entry, and perform an ASCII translation if required.
private void ExtractAndTranslateEntry(string destFile, Stream outputStream)
{
bool asciiTrans = !IsBinary(destFile);
if (asciiTrans)
{
using (var outw = new StreamWriter(outputStream, new UTF8Encoding(false), 1024, true))
{
byte[] rdbuf = new byte[32 * 1024];
while (true)
{
int numRead = tarIn.Read(rdbuf, 0, rdbuf.Length);
if (numRead <= 0)
{
break;
}
for (int off = 0, b = 0; b < numRead; ++b)
{
if (rdbuf[b] == 10)
{
string s = Encoding.ASCII.GetString(rdbuf, off, (b - off));
outw.WriteLine(s);
off = b + 1;
}
}
}
}
}
else
{
// No translation required.
tarIn.CopyEntryContents(outputStream);
}
}
/// <summary>
/// Write an entry to the archive. This method will call the putNextEntry
/// and then write the contents of the entry, and finally call closeEntry()
/// for entries that are files. For directories, it will call putNextEntry(),
/// and then, if the recurse flag is true, process each entry that is a
/// child of the directory.
/// </summary>
/// <param name="sourceEntry">
/// The TarEntry representing the entry to write to the archive.
/// </param>
/// <param name="recurse">
/// If true, process the children of directory entries.
/// </param>
public void WriteEntry(TarEntry sourceEntry, bool recurse)
{
if (sourceEntry == null)
{
throw new ArgumentNullException(nameof(sourceEntry));
}
if (isDisposed)
{
throw new ObjectDisposedException("TarArchive");
}
try
{
if (recurse)
{
TarHeader.SetValueDefaults(sourceEntry.UserId, sourceEntry.UserName,
sourceEntry.GroupId, sourceEntry.GroupName);
}
WriteEntryCore(sourceEntry, recurse);
}
finally
{
if (recurse)
{
TarHeader.RestoreSetValues();
}
}
}
/// <summary>
/// Write an entry to the archive. This method will call the putNextEntry
/// and then write the contents of the entry, and finally call closeEntry()
/// for entries that are files. For directories, it will call putNextEntry(),
/// and then, if the recurse flag is true, process each entry that is a
/// child of the directory.
/// </summary>
/// <param name="sourceEntry">
/// The TarEntry representing the entry to write to the archive.
/// </param>
/// <param name="recurse">
/// If true, process the children of directory entries.
/// </param>
private void WriteEntryCore(TarEntry sourceEntry, bool recurse)
{
string tempFileName = null;
string entryFilename = sourceEntry.File;
var entry = (TarEntry)sourceEntry.Clone();
if (applyUserInfoOverrides)
{
entry.GroupId = groupId;
entry.GroupName = groupName;
entry.UserId = userId;
entry.UserName = userName;
}
OnProgressMessageEvent(entry, null);
if (asciiTranslate && !entry.IsDirectory)
{
if (!IsBinary(entryFilename))
{
tempFileName = Path.GetTempFileName();
using (StreamReader inStream = File.OpenText(entryFilename))
{
using (Stream outStream = File.Create(tempFileName))
{
while (true)
{
string line = inStream.ReadLine();
if (line == null)
{
break;
}
byte[] data = Encoding.ASCII.GetBytes(line);
outStream.Write(data, 0, data.Length);
outStream.WriteByte((byte)'\n');
}
outStream.Flush();
}
}
entry.Size = new FileInfo(tempFileName).Length;
entryFilename = tempFileName;
}
}
string newName = null;
if (!String.IsNullOrEmpty(rootPath))
{
if (entry.Name.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase))
{
newName = entry.Name.Substring(rootPath.Length + 1);
}
}
if (pathPrefix != null)
{
newName = (newName == null) ? pathPrefix + "/" + entry.Name : pathPrefix + "/" + newName;
}
if (newName != null)
{
entry.Name = newName;
}
tarOut.PutNextEntry(entry);
if (entry.IsDirectory)
{
if (recurse)
{
TarEntry[] list = entry.GetDirectoryEntries();
for (int i = 0; i < list.Length; ++i)
{
WriteEntryCore(list[i], recurse);
}
}
}
else
{
using (Stream inputStream = File.OpenRead(entryFilename))
{
byte[] localBuffer = new byte[32 * 1024];
while (true)
{
int numRead = inputStream.Read(localBuffer, 0, localBuffer.Length);
if (numRead <= 0)
{
break;
}
tarOut.Write(localBuffer, 0, numRead);
}
}
if (!string.IsNullOrEmpty(tempFileName))
{
File.Delete(tempFileName);
}
tarOut.CloseEntry();
}
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases the unmanaged resources used by the FileStream and optionally releases the managed resources.
/// </summary>
/// <param name="disposing">true to release both managed and unmanaged resources;
/// false to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
isDisposed = true;
if (disposing)
{
if (tarOut != null)
{
tarOut.Flush();
tarOut.Dispose();
}
if (tarIn != null)
{
tarIn.Dispose();
}
}
}
}
/// <summary>
/// Closes the archive and releases any associated resources.
/// </summary>
public virtual void Close()
{
Dispose(true);
}
/// <summary>
/// Ensures that resources are freed and other cleanup operations are performed
/// when the garbage collector reclaims the <see cref="TarArchive"/>.
/// </summary>
~TarArchive()
{
Dispose(false);
}
private static void EnsureDirectoryExists(string directoryName)
{
if (!Directory.Exists(directoryName))
{
try
{
Directory.CreateDirectory(directoryName);
}
catch (BaseException e)
{
throw new TarException("BaseException creating directory '" + directoryName + "', " + e.Message, e);
}
}
}
// TODO: TarArchive - Is there a better way to test for a text file?
// It no longer reads entire files into memory but is still a weak test!
// This assumes that byte values 0-7, 14-31 or 255 are binary
// and that all non text files contain one of these values
private static bool IsBinary(string filename)
{
using (FileStream fs = File.OpenRead(filename))
{
int sampleSize = Math.Min(4096, (int)fs.Length);
byte[] content = new byte[sampleSize];
int bytesRead = fs.Read(content, 0, sampleSize);
for (int i = 0; i < bytesRead; ++i)
{
byte b = content[i];
if ((b < 8) || ((b > 13) && (b < 32)) || (b == 255))
{
return true;
}
}
}
return false;
}
//#region Instance Fields
private bool keepOldFiles;
private bool asciiTranslate;
private int userId;
private string userName = string.Empty;
private int groupId;
private string groupName = string.Empty;
private string rootPath;
private string pathPrefix;
private bool applyUserInfoOverrides;
private TarInputStream tarIn;
private TarOutputStream tarOut;
private bool isDisposed;
//#endregion Instance Fields
}
}
| 24.78125 | 120 | 0.645818 | [
"MIT"
] | WorkhorsyTest/SharpZipLibD | source/ICSharpCode/SharpZipLib/Tar/TarArchive.cs | 23,790 | C# |
using System;
using System.Runtime.InteropServices;
namespace Veldrid.Sdl2
{
public static unsafe partial class Sdl2Native
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate SDL_Keymod SDL_GetModState_t();
private static SDL_GetModState_t s_sdl_getModState = Sdl2Native.LoadFunction<SDL_GetModState_t>("SDL_GetModState");
/// <summary>
/// Returns an OR'd combination of the modifier keys for the keyboard. See SDL_Keymod for details.
/// </summary>
public static SDL_Keymod SDL_GetModState() => s_sdl_getModState();
}
}
| 35.941176 | 123 | 0.716858 | [
"MIT"
] | BSG-75/veldrid | src/Veldrid.SDL2/Sdl2.Keyboard.cs | 613 | C# |
using System;
using System.IO;
namespace Dicom.Imaging.LUT {
/// <summary>
/// Paletter color LUT implementation of <seealso cref="ILUT"/> maps PALETTE COLOR images
/// </summary>
public class PaletteColorLUT : ILUT {
#region Private Members
private int _first;
private Color32[] _lut;
#endregion
#region Public Constructors
/// <summary>
/// Initialize new instance of <seealso cref="PaletteColorLUT"/>
/// </summary>
/// <param name="firstEntry">The first entry (minium value)</param>
/// <param name="lut">The palette color LUT</param>
public PaletteColorLUT(int firstEntry, Color32[] lut) {
_first = firstEntry;
ColorMap = lut;
}
#endregion
#region Public Properties
/// <summary>
/// The color map
/// </summary>
public Color32[] ColorMap {
get { return _lut; }
set { _lut = value; }
}
public int MinimumOutputValue {
get { return int.MinValue; }
}
public int MaximumOutputValue {
get { return int.MaxValue; }
}
public bool IsValid {
get { return _lut != null; }
}
public int this[int value] {
get {
return _lut[value + _first].Value;
}
}
#endregion
#region Public Methods
public void Recalculate() {
}
#endregion
}
}
| 20.533333 | 90 | 0.651786 | [
"BSD-3-Clause"
] | chunhuxiao/fo-dicom | DICOM/Imaging/LUT/PaletteColorLUT.cs | 1,234 | C# |
using Comet.Graphics;
using System;
using System.Collections.Generic;
using System.Text;
namespace Comet.Styles
{
public class ButtonStyle : ViewStyle
{
public StyleAwareValue<ControlState,Color> TextColor { get; set; }
public StyleAwareValue<ControlState, FontAttributes> TextFont { get; set; }
public StyleAwareValue<ControlState, Thickness> Padding { get; set; }
}
}
| 21.333333 | 77 | 0.763021 | [
"MIT"
] | VincentH-Net/Comet | src/Comet/Styles/ButtonStyle.cs | 386 | C# |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Xunit;
using Xunit.Abstractions;
namespace Microsoft.Coyote.Actors.SystematicTesting.Tests
{
public class MustHandleEventTests : BaseActorSystematicTest
{
public MustHandleEventTests(ITestOutputHelper output)
: base(output)
{
}
private class MustHandleEvent : Event
{
}
private class MoveEvent : Event
{
}
private class M1 : StateMachine
{
[Start]
[IgnoreEvents(typeof(MustHandleEvent))]
private class Init : State
{
}
}
[Fact(Timeout = 5000)]
public void TestMustHandleEventNotTriggeredInStateMachine()
{
this.Test(r =>
{
var m = r.CreateActor(typeof(M1));
r.SendEvent(m, new MustHandleEvent(), options: new SendOptions(mustHandle: true));
r.SendEvent(m, HaltEvent.Instance);
},
configuration: Configuration.Create().WithTestingIterations(100));
}
private class M2 : StateMachine
{
[Start]
[DeferEvents(typeof(MustHandleEvent))]
private class Init : State
{
}
}
[Fact(Timeout = 5000)]
public void TestMustHandleDeferredEventInStateMachine()
{
this.TestWithError(r =>
{
var m = r.CreateActor(typeof(M2));
r.SendEvent(m, new MustHandleEvent(), options: new SendOptions(mustHandle: true));
r.SendEvent(m, HaltEvent.Instance);
},
configuration: Configuration.Create().WithTestingIterations(1),
expectedError: "M2() halted before dequeueing must-handle event 'MustHandleEvent'.",
replay: true);
}
private class M3 : StateMachine
{
[Start]
[OnEntry(nameof(InitOnEntry))]
[DeferEvents(typeof(MustHandleEvent))]
private class Init : State
{
}
private void InitOnEntry() => this.RaiseHaltEvent();
}
[Fact(Timeout = 5000)]
public void TestMustHandleEventAfterHaltInStateMachine()
{
this.TestWithError(r =>
{
var m = r.CreateActor(typeof(M3));
r.SendEvent(m, new MustHandleEvent(), options: new SendOptions(mustHandle: true));
},
configuration: Configuration.Create().WithTestingIterations(500),
expectedErrors: new string[]
{
"A must-handle event 'MustHandleEvent' was sent to M3() which has halted.",
"M3() halted before dequeueing must-handle event 'MustHandleEvent'."
},
replay: true);
}
private class M4 : StateMachine
{
[Start]
[OnEntry(nameof(InitOnEntry))]
[DeferEvents(typeof(MustHandleEvent))]
private class Init : State
{
}
private void InitOnEntry()
{
this.SendEvent(this.Id, HaltEvent.Instance);
}
}
[Fact(Timeout = 5000)]
public void TestMustHandleEventAfterSendingHaltInStateMachine()
{
this.TestWithError(r =>
{
var m = r.CreateActor(typeof(M4));
r.SendEvent(m, new MustHandleEvent(), options: new SendOptions(mustHandle: true));
},
configuration: Configuration.Create().WithTestingIterations(500),
expectedErrors: new string[]
{
"A must-handle event 'MustHandleEvent' was sent to M4() which has halted.",
"M4() halted before dequeueing must-handle event 'MustHandleEvent'."
},
replay: true);
}
private class M5 : StateMachine
{
[Start]
[DeferEvents(typeof(MustHandleEvent), typeof(HaltEvent))]
[OnEventGotoState(typeof(MoveEvent), typeof(Next))]
private class Init : State
{
}
private class Next : State
{
}
}
[Fact(Timeout = 5000)]
public void TestMustHandleDeferredEventAfterStateTransition()
{
this.TestWithError(r =>
{
var m = r.CreateActor(typeof(M5));
r.SendEvent(m, HaltEvent.Instance);
r.SendEvent(m, new MustHandleEvent(), options: new SendOptions(mustHandle: true));
r.SendEvent(m, new MoveEvent());
},
configuration: Configuration.Create().WithTestingIterations(1),
expectedError: "M5() halted before dequeueing must-handle event 'MustHandleEvent'.",
replay: true);
}
}
}
| 31.477987 | 98 | 0.529071 | [
"MIT"
] | arunt1204/coyote | Tests/Tests.Actors.SystematicTesting/EventHandling/MustHandleEventTests.cs | 5,007 | C# |
namespace ShoppingCartStore.Services.DataServices
{
using ShoppingCartStore.Common.BindingModels.Product;
using ShoppingCartStore.Common.ServiceModels.Wishlist;
using ShoppingCartStore.Common.ViewModels.Product;
using System.Collections.Generic;
using System.Threading.Tasks;
public interface IProductService
{
Task CreateAsync(CreateProductBindingModel model);
ICollection<ProductViewModel> GetAllViewModelsFilteredAsync(FilterBindingModel filterBindingModel);
ICollection<ProductViewModel> GetAllViewModelsAsync();
ProductViewModel FindById(string id);
}
}
| 31.4 | 107 | 0.778662 | [
"MIT"
] | raulerivassanz/ShoppingCartStore | src/Services/ShoppingCartStore.Services.DataServices/IProductService.cs | 630 | C# |
using System;
using System.Collections.Generic;
namespace MultiBracketValidation
{
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
public static bool MultiHBracketValidation(string input)
{
var bracketsOpening = new List<string>();
var bracketsClosing = new List<string>();
bool balanced = false;
for (int i = 0; i < input.Length; i++)
{
if (input[i].ToString() == "{" ||
input[i].ToString() == "(" ||
input[i].ToString() == "[")
{
bracketsOpening.Add(input[i].ToString());
}
else if (input[i].ToString() == "}" ||
input[i].ToString() == ")" ||
input[i].ToString() == "]")
{
bracketsClosing.Add(input[i].ToString());
}
}
if (bracketsOpening.Count == bracketsClosing.Count)
{
for (int i = 0; i < bracketsOpening.Count; i++)
{
if (bracketsOpening[i] == "{" && bracketsClosing[i] == "}")
{
balanced = true;
}
else if (bracketsOpening[i] == "(" && bracketsClosing[i] == ")")
{
balanced = true;
}
else if (bracketsOpening[i] == "[" && bracketsClosing[i] == "]")
{
balanced = true;
}
}
if (input.Contains("{)") ||
input.Contains("{]") ||
input.Contains("(}") ||
input.Contains("(]") ||
input.Contains("[}") ||
input.Contains("[)"))
{
balanced = false;
}
}
return balanced;
}
}
}
| 31.029412 | 84 | 0.364929 | [
"MIT"
] | jeremymaya/data-structures-and-algorithms | challenges/MultiBracketValidation/MultiBracketValidation/Program.cs | 2,112 | C# |
using System.Runtime.InteropServices;
using FFXIVClientStructs.Common;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Client.UI.Shell;
namespace FFXIVClientStructs.FFXIV.Client.UI
{
// Client::UI::UIModule
// Client::UI::UIModuleInterface
[StructLayout(LayoutKind.Explicit, Size = 0xE2070)]
public unsafe partial struct UIModule
{
[FieldOffset(0x0)] public void* vtbl;
[FieldOffset(0x0)] public void** vfunc;
[FieldOffset(0x8)] public Unk1 UnkObj1;
[FieldOffset(0x10)] public Unk2 UnkObj2;
[FieldOffset(0x18)] public Unk3 UnkObj3;
[FieldOffset(0x20)] public void* unk;
[FieldOffset(0x28)] public void* SystemConfig;
[FieldOffset(0xB7FC0)] public RaptureAtkModule RaptureAtkModule; // note: NOT a pointer, the module's a member
/*
dq 0 ; +0x30
dq 23000000000h ; +0x38
dq 0 ; +0x40
dq 23000000000h ; +0x48
dq 0 ; +0x50
and so on...
*/
[VirtualFunction(6)]
public partial RaptureTextModule* GetRaptureTextModule();
[VirtualFunction(7)]
public partial RaptureAtkModule* GetRaptureAtkModule();
[VirtualFunction(9)]
public partial RaptureShellModule* GetRaptureShellModule();
[VirtualFunction(10)]
public partial PronounModule* GetPronounModule();
[VirtualFunction(11)]
public partial RaptureLogModule* GetRaptureLogModule();
[VirtualFunction(12)]
public partial RaptureMacroModule* GetRaptureMacroModule();
[VirtualFunction(34)]
public partial AgentModule* GetAgentModule();
[VirtualFunction(36)]
public partial UI3DModule* GetUI3DModule();
[StructLayout(LayoutKind.Explicit, Size = 0x8)]
public struct Unk1
{
[FieldOffset(0x0)] public void* vtbl;
[FieldOffset(0x0)] public void** vfunc;
}
[StructLayout(LayoutKind.Explicit, Size = 0x8)]
public struct Unk2
{
[FieldOffset(0x0)] public void* vtbl;
[FieldOffset(0x0)] public void** vfunc;
}
[StructLayout(LayoutKind.Explicit, Size = 0x8)] // size?
public struct Unk3
{
[FieldOffset(0x0)] public void* vtbl;
[FieldOffset(0x0)] public void** vfunc;
}
}
} | 33.75641 | 118 | 0.585264 | [
"MIT"
] | 0ceal0t/FFXIVClientStructs | FFXIVClientStructs/FFXIV/Client/UI/UIModule.cs | 2,635 | C# |
#region License
//
// Author: Nate Kohari <nkohari@gmail.com>
// Copyright (c) 2007-2008, Enkari, Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
#region Using Directives
using System;
using Ninject.Core;
#endregion
namespace Ninject.Tests
{
public class RequestsTagB : IMock
{
/*----------------------------------------------------------------------------------------*/
private IMock _child;
/*----------------------------------------------------------------------------------------*/
[Inject, Tag("B")]
public IMock Child
{
get { return _child; }
set { _child = value; }
}
/*----------------------------------------------------------------------------------------*/
}
} | 31.384615 | 94 | 0.551471 | [
"Apache-2.0"
] | ninject/ninject1 | src/Tests/Mocks/RequestsTagB.cs | 1,224 | C# |
using LineApiUseCaseSmartRetail.Enums;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.Cosmos;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace LineApiUseCaseSmartRetail
{
/// <summary>
/// 商品情報を取得するFunction
/// </summary>
public class GetItemInfo : BaseFunction
{
public GetItemInfo(CosmosClient client) : base(client)
{
}
[FunctionName("get_item_info")]
public async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "get_item_info")] GetItemInfoRequest req,
ILogger log)
{
if (req == null || string.IsNullOrWhiteSpace(req.Barcode))
{
return new BadRequestObjectResult("パラメータ未設定エラー");
}
var item = await GetItemByBarcodeAsync(req.Barcode);
if (item == null)
{
log.LogWarning("商品情報が取得できませんでした|barcode={barcode}", req.Barcode);
return new BadRequestObjectResult("商品情報が取得できませんでした");
}
var response = new GetItemInfoResponse
{
Name = item.ItemName,
Price = item.ItemPrice,
ImageUrl = item.ImageUrl,
};
// クーポンがあれば取得
if (!string.IsNullOrEmpty(req.CouponId))
{
var coupon = await GetCouponByCouponIdAsync(req.CouponId);
if (coupon != null)
{
response.DiscountWay = coupon.DiscountWay;
response.DiscountRate = coupon.DiscountRate;
}
}
return new OkObjectResult(response);
}
/// <summary>
/// get_item_info Functionのリクエスト
/// </summary>
public class GetItemInfoRequest
{
public string Barcode { get; set; }
public string CouponId { get; set; }
}
/// <summary>
/// get_item_info Functionのレスポンス
/// </summary>
public class GetItemInfoResponse
{
public string Name { get; set; }
public float Price { get; set; }
public string ImageUrl { get; set; }
public DiscountWay DiscountWay { get; set; }
public float DiscountRate { get; set; }
}
}
}
| 31.575 | 111 | 0.536025 | [
"Unlicense"
] | line/line-api-use-case-smart-retail-azure | backend/src/LineApiUseCaseSmartRetail/GetItemInfo.cs | 2,672 | C# |
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TexturePackerLoader;
namespace MonoTarget
{
public class GameObject
{
public float Rotation;
public bool IsActive;
public bool IsAnimated;
public Color Color;
public Texture2D Texture;
public Game1 _game;
public Vector2 Position;
public Vector2 Origin;
public GameObject()
{
IsAnimated = false;
IsActive = false;
}
public virtual void Initialize(Game1 game, string TextureName = null, float x = 0.0f, float y = 0.0f)
{
_game = game;
Rotation = 0.0f;
Color = Color.White;
Position = new Vector2(x, y);
if (TextureName != null)
{
Texture = _game.Content.Load<Texture2D>(TextureName);
}
IsActive = true;
}
public virtual void Update(GameTime gametime)
{
}
public virtual void Draw(SpriteBatch spriteBatch)
{
}
public virtual void Draw(SpriteRender spriteRender)
{
}
}
}
| 21.733333 | 109 | 0.569785 | [
"MIT"
] | DigitalOxCanada/MonoTarget | Day9/GameObject.cs | 1,306 | C# |
using System;
using System.Windows.Forms;
namespace XNALara
{
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args) {
try {
using (Game game = new Game()) {
game.Run();
}
}
catch (Exception ex) {
MessageBox.Show(ex.Message + "\n" + ex.StackTrace, "Error!",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
| 24.08 | 76 | 0.465116 | [
"Apache-2.0"
] | AerysBat/XNALara | Program.cs | 602 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.Devices.Geolocation.Geofencing
{
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
#endif
public partial class GeofenceMonitor
{
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public global::System.Collections.Generic.IList<global::Windows.Devices.Geolocation.Geofencing.Geofence> Geofences
{
get
{
throw new global::System.NotImplementedException("The member IList<Geofence> GeofenceMonitor.Geofences is not implemented in Uno.");
}
}
#endif
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public global::Windows.Devices.Geolocation.Geoposition LastKnownGeoposition
{
get
{
throw new global::System.NotImplementedException("The member Geoposition GeofenceMonitor.LastKnownGeoposition is not implemented in Uno.");
}
}
#endif
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public global::Windows.Devices.Geolocation.Geofencing.GeofenceMonitorStatus Status
{
get
{
throw new global::System.NotImplementedException("The member GeofenceMonitorStatus GeofenceMonitor.Status is not implemented in Uno.");
}
}
#endif
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public static global::Windows.Devices.Geolocation.Geofencing.GeofenceMonitor Current
{
get
{
throw new global::System.NotImplementedException("The member GeofenceMonitor GeofenceMonitor.Current is not implemented in Uno.");
}
}
#endif
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.Status.get
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.Geofences.get
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.LastKnownGeoposition.get
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.GeofenceStateChanged.add
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.GeofenceStateChanged.remove
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public global::System.Collections.Generic.IReadOnlyList<global::Windows.Devices.Geolocation.Geofencing.GeofenceStateChangeReport> ReadReports()
{
throw new global::System.NotImplementedException("The member IReadOnlyList<GeofenceStateChangeReport> GeofenceMonitor.ReadReports() is not implemented in Uno.");
}
#endif
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.StatusChanged.add
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.StatusChanged.remove
// Forced skipping of method Windows.Devices.Geolocation.Geofencing.GeofenceMonitor.Current.get
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public event global::Windows.Foundation.TypedEventHandler<global::Windows.Devices.Geolocation.Geofencing.GeofenceMonitor, object> GeofenceStateChanged
{
[global::Uno.NotImplemented]
add
{
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Devices.Geolocation.Geofencing.GeofenceMonitor", "event TypedEventHandler<GeofenceMonitor, object> GeofenceMonitor.GeofenceStateChanged");
}
[global::Uno.NotImplemented]
remove
{
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Devices.Geolocation.Geofencing.GeofenceMonitor", "event TypedEventHandler<GeofenceMonitor, object> GeofenceMonitor.GeofenceStateChanged");
}
}
#endif
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public event global::Windows.Foundation.TypedEventHandler<global::Windows.Devices.Geolocation.Geofencing.GeofenceMonitor, object> StatusChanged
{
[global::Uno.NotImplemented]
add
{
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Devices.Geolocation.Geofencing.GeofenceMonitor", "event TypedEventHandler<GeofenceMonitor, object> GeofenceMonitor.StatusChanged");
}
[global::Uno.NotImplemented]
remove
{
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Devices.Geolocation.Geofencing.GeofenceMonitor", "event TypedEventHandler<GeofenceMonitor, object> GeofenceMonitor.StatusChanged");
}
}
#endif
}
}
| 45.585859 | 225 | 0.783736 | [
"Apache-2.0"
] | nv-ksavaria/Uno | src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Geolocation.Geofencing/GeofenceMonitor.cs | 4,513 | C# |
using AutoMapper;
using DAL.Models;
using WebApi.DataTransferObjects;
using WebApi.ViewModels;
namespace WebApi
{
public class AutoMapping : Profile
{
public AutoMapping()
{
// ViewModels to Models
CreateMap<OrderViewModel, Order>(MemberList.Source);
CreateMap<ProductViewModel, Product>(MemberList.Source);
CreateMap<ProductOrderViewModel, ProductOrder>(MemberList.Source);
// Models to DataTransferObjects
CreateMap<Order, OrderDto>(MemberList.None);
CreateMap<Product, ProductOrderDto>(MemberList.None)
.ForMember(dest => dest.Price, options => options.Ignore());
CreateMap<ProductOrder, ProductOrderDto>(MemberList.None)
.ForMember(dest => dest.Id, options => options.MapFrom(source => source.ProductId));
}
}
}
| 33.961538 | 100 | 0.645527 | [
"MIT"
] | gcasu/netcore-webapi | WebApi/AutoMapping.cs | 885 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using UnityEngine.Audio;
namespace Microsoft.MixedReality.SpectatorView
{
[Serializable]
internal class AudioMixerGroupAsset : AssetCacheEntry<AudioMixerGroup> { }
internal class AudioMixerGroupAssetCache : AssetCache<AudioMixerGroupAsset, AudioMixerGroup>
{
private static bool IsAudioMixerFileExtension(string fileExtension)
{
return fileExtension == ".mixer";
}
protected override IEnumerable<AudioMixerGroup> EnumerateAllAssets()
{
foreach (AudioMixer mixer in EnumerateAllAssetsInAssetDatabase<AudioMixer>(IsAudioMixerFileExtension))
{
AudioMixerGroup[] groups = mixer.FindMatchingGroups("");
foreach (AudioMixerGroup group in groups)
{
yield return group;
}
}
}
}
} | 33.636364 | 115 | 0.644144 | [
"MIT"
] | GooDtoLivE/MixedReality-SpectatorView | src/SpectatorView.Unity/Assets/SpectatorView/Scripts/StateSynchronization/NetworkedComponents/AudioSource/AudioMixerGroupAssetCache.cs | 1,112 | C# |
//
// NotWorkingAttribute.cs
//
// Author:
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (c) 2015 Xamarin, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Xamarin.AsyncTests;
namespace Xamarin.WebTests.TestAttributes
{
[AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Field, AllowMultiple = false)]
public class NotWorkingAttribute : TestFeatureAttribute
{
public static readonly TestFeature Instance = new TestFeature ("NotWorking", "Include not working tests");
public override TestFeature Feature {
get { return Instance; }
}
}
}
| 39.5 | 116 | 0.760699 | [
"MIT"
] | xamarin/web-tests | Xamarin.WebTests.Framework/Xamarin.WebTests.TestAttributes/NotWorkingAttribute.cs | 1,661 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using Snowflake.Configuration;
namespace Snowflake.Extensibility.Provisioning
{
/// <summary>
/// Represents a plugin initialized with a provision
/// A provisioned plugin has access to a logger, configuration options, and a content directory.
/// </summary>
public interface IProvisionedPlugin : IPlugin
{
/// <summary>
/// Gets the plugin provision from the active plugin manager for this instance
/// </summary>
IPluginProvision Provision { get; }
/// <summary>
/// Gets the plugin configuration
/// </summary>
/// <returns>The plugin configuration</returns>
IConfigurationSection GetPluginConfiguration();
}
}
| 30.153846 | 100 | 0.664541 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | SnowflakePowered/snowflake | src/Snowflake.Framework.Primitives/Extensibility/Provisioning/IProvisionedPlugin.cs | 786 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Gcp.Compute.Outputs
{
[OutputType]
public sealed class ResourcePolicySnapshotSchedulePolicy
{
/// <summary>
/// Retention policy applied to snapshots created by this resource policy.
/// Structure is documented below.
/// </summary>
public readonly Outputs.ResourcePolicySnapshotSchedulePolicyRetentionPolicy? RetentionPolicy;
/// <summary>
/// Contains one of an `hourlySchedule`, `dailySchedule`, or `weeklySchedule`.
/// Structure is documented below.
/// </summary>
public readonly Outputs.ResourcePolicySnapshotSchedulePolicySchedule Schedule;
/// <summary>
/// Properties with which the snapshots are created, such as labels.
/// Structure is documented below.
/// </summary>
public readonly Outputs.ResourcePolicySnapshotSchedulePolicySnapshotProperties? SnapshotProperties;
[OutputConstructor]
private ResourcePolicySnapshotSchedulePolicy(
Outputs.ResourcePolicySnapshotSchedulePolicyRetentionPolicy? retentionPolicy,
Outputs.ResourcePolicySnapshotSchedulePolicySchedule schedule,
Outputs.ResourcePolicySnapshotSchedulePolicySnapshotProperties? snapshotProperties)
{
RetentionPolicy = retentionPolicy;
Schedule = schedule;
SnapshotProperties = snapshotProperties;
}
}
}
| 38.130435 | 107 | 0.700684 | [
"ECL-2.0",
"Apache-2.0"
] | dimpu47/pulumi-gcp | sdk/dotnet/Compute/Outputs/ResourcePolicySnapshotSchedulePolicy.cs | 1,754 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using SBCA.UnifiedDataStandard.Component;
using SBCA.UnifiedDataStandard.QualityControl;
namespace SBCA.UnifiedDataStandard
{
public class UnifiedDataStandardFile
{
/// <summary>
/// The Manifest contains the UDS version
/// </summary>
public Manifest Manifest { get; set; }
public List<ComponentFile> ComponentFiles { get; set; } = new List<ComponentFile>();
public List<QualityControlFile> QualityControlFiles { get; set; } = new List<QualityControlFile>();
public byte[] Write()
{
var stream = new MemoryStream();
var archive = new ZipArchive(stream, ZipArchiveMode.Create);
AddFile("Manifest.json", Manifest.Write(), archive);
foreach (var component in ComponentFiles)
{
AddFile($"{component.Name}.component", component.Write(), archive);
}
foreach (var qualityControlFile in QualityControlFiles)
{
AddFile($"{qualityControlFile.ComponentName}.qc", qualityControlFile.Write(), archive);
}
// The archive must first be disposed in order to write out end-of-file metadata and checksums.
archive.Dispose();
archive = null;
return stream.ToArray();
}
public static UnifiedDataStandardFile Read(ZipArchive archive)
{
var newUDSFile = new UnifiedDataStandardFile();
foreach (var zippedFile in archive.Entries.Where(entry => entry.Name.EndsWith(".component")))
{
var contents = new StreamReader(zippedFile.Open()).ReadToEnd();
var component = ComponentFile.Read(contents);
foreach (var member in component.Members)
{
var matchingMaterial = component.Lumbers.Single(material => material.Guid == member.MaterialGuid);
member.Lumber = matchingMaterial;
}
foreach (var platePair in component.ConnectorPlatePairs)
{
foreach (var plate in platePair.ConnectorPlates)
{
var matchingMaterial =
component.ConnectorPlateTypes.Single(material => material.Guid == plate.MaterialGuid);
plate.ConnectorPlateType = matchingMaterial;
}
}
foreach (var hanger in component.Hangers)
{
var matchingMaterial =
component.HangerTypes.Single(material => material.Guid == hanger.MaterialGuid);
hanger.HangerType = matchingMaterial;
}
foreach (var bearing in component.Bearings)
{
foreach (var guid in bearing.InstallationHardwareGuids)
{
var matchingHardware =
component.AllInstallationHardwares.Single(hardware => hardware.Guid == guid);
bearing.InstallationHardwares.Add(matchingHardware);
}
}
newUDSFile.ComponentFiles.Add(component);
}
foreach (var zippedFile in archive.Entries.Where(entry => entry.Name.EndsWith(".qc")))
{
var contents = new StreamReader(zippedFile.Open()).ReadToEnd();
var qcFile = QualityControlFile.Read(contents);
var matchingComponent = newUDSFile.ComponentFiles.Single(componentFile => componentFile.Name.Contains(qcFile.ComponentName));
qcFile.Component = matchingComponent;
foreach (var plateData in qcFile.PlateQualityControlDatas)
{
plateData.ConnectorPlatePair = matchingComponent.ConnectorPlatePairs.Single(connectorSet => connectorSet.Guid == plateData.PlatePairGuid);
foreach (var contactArea in plateData.ContactAreas)
{
contactArea.Member = matchingComponent.Members.Single(member => member.Guid == contactArea.MemberGuid);
}
}
newUDSFile.QualityControlFiles.Add(qcFile);
}
return newUDSFile;
}
public void AddFile(string fileName, string fileContents, ZipArchive archive)
{
var fileData = Encoding.UTF8.GetBytes(fileContents);
if (archive == null)
{
throw new Exception("ZipArchive has already been closed and the zip has been created. Unable to add more files.");
}
using (var zipEntryStream = archive.CreateEntry(fileName).Open())
{
zipEntryStream.Write(fileData, 0, fileData.Length);
}
}
}
}
| 39.085271 | 158 | 0.570805 | [
"MIT"
] | sbca-uds/SBCA-Unified-Data-Standard | SBCA_DataStandard/UnifiedDataStandardFile.cs | 5,044 | C# |
using System.IO;
using FluentAssertions;
using NUnit.Framework;
// Cyotek Color Picker controls library
// Copyright © 2013-2017 Cyotek Ltd.
// http://cyotek.com/blog/tag/colorpicker
// Licensed under the MIT License. See license.txt for the full text.
// If you use this code in your applications, donations or attribution are welcome
namespace Cyotek.Windows.Forms.ColorPicker.Tests
{
/// <summary>
/// Tests for the <see cref="GimpPaletteSerializer"/> class.
/// </summary>
[TestFixture]
public class GimpPaletteSerializerTests : TestBase
{
#region Tests
[Test]
public void CanReadTest()
{
// arrange
IPaletteSerializer target;
bool actual;
target = new GimpPaletteSerializer();
// act
actual = target.CanRead;
// assert
actual.Should().BeTrue();
}
[Test]
public void CanWriteTest()
{
// arrange
IPaletteSerializer target;
bool actual;
target = new GimpPaletteSerializer();
// act
actual = target.CanWrite;
// assert
actual.Should().BeTrue();
}
[Test]
public void DeserializeTest()
{
// arrange
IPaletteSerializer target;
string fileName;
ColorCollection expected;
ColorCollection actual;
fileName = Path.Combine(this.DataPath, "db32.gpl");
target = new GimpPaletteSerializer();
expected = this.CreateDawnBringer32Palette(false);
// act
using (Stream stream = File.OpenRead(fileName))
{
actual = target.Deserialize(stream);
}
// assert
CollectionAssert.AreEqual(expected, actual);
}
[Test]
[Timeout(1000)]
public void DeserializeWithCommentsTest()
{
// arrange
IPaletteSerializer target;
string fileName;
ColorCollection expected;
ColorCollection actual;
fileName = Path.Combine(this.DataPath, "db16-comments.gpl");
target = new GimpPaletteSerializer();
expected = this.CreateDawnBringer16Palette(false);
// act
using (Stream stream = File.OpenRead(fileName))
{
actual = target.Deserialize(stream);
}
// assert
CollectionAssert.AreEqual(expected, actual);
}
[Test]
public void GetSerializerTest()
{
// arrange
IPaletteSerializer actual;
string workFileName;
workFileName = Path.GetTempFileName();
File.Copy(Path.Combine(this.DataPath, "db32.gpl"), workFileName, true);
// act
actual = PaletteSerializer.GetSerializer(workFileName);
File.Delete(workFileName);
// assert
actual.Should().BeOfType<GimpPaletteSerializer>();
}
[Test]
public void SerializeTest()
{
// arrange
IPaletteSerializer target;
ColorCollection expected;
ColorCollection actual;
MemoryStream write;
target = new GimpPaletteSerializer();
expected = this.CreateDawnBringer32Palette(false);
write = new MemoryStream();
// act
target.Serialize(write, expected);
using (MemoryStream read = new MemoryStream(write.ToArray()))
{
actual = new GimpPaletteSerializer().Deserialize(read);
}
// assert
CollectionAssert.AreEqual(expected, actual);
}
#endregion
}
}
| 22.69281 | 83 | 0.605991 | [
"MIT"
] | Code-Artist/Cyotek.Windows.Forms.ColorPicker | Cyotek.Windows.Forms.ColorPicker.Tests/GimpPaletteSerializerTests.cs | 3,475 | C# |
// Copyright 2021 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 Google.Analytics.Admin.V1Alpha.Snippets
{
using Google.Analytics.Admin.V1Alpha;
public sealed partial class GeneratedAnalyticsAdminServiceClientStandaloneSnippets
{
/// <summary>Snippet for DeleteConversionEvent</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void DeleteConversionEventRequestObject()
{
// Create client
AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.Create();
// Initialize request argument(s)
DeleteConversionEventRequest request = new DeleteConversionEventRequest
{
ConversionEventName = ConversionEventName.FromPropertyConversionEvent("[PROPERTY]", "[CONVERSION_EVENT]"),
};
// Make the request
analyticsAdminServiceClient.DeleteConversionEvent(request);
}
}
}
| 40.190476 | 122 | 0.700237 | [
"Apache-2.0"
] | googleapis/googleapis-gen | google/analytics/admin/v1alpha/google-analytics-admin-v1alpha-csharp/Google.Analytics.Admin.V1Alpha.StandaloneSnippets/AnalyticsAdminServiceClient.DeleteConversionEventRequestObjectSnippet.g.cs | 1,688 | C# |
using System;
using System.Collections;
using System.Reflection;
using System.Text;
using System.Collections.Generic;
using System.Linq;
namespace Python.Runtime
{
/// <summary>
/// A MethodBinder encapsulates information about a (possibly overloaded)
/// managed method, and is responsible for selecting the right method given
/// a set of Python arguments. This is also used as a base class for the
/// ConstructorBinder, a minor variation used to invoke constructors.
/// </summary>
internal class MethodBinder
{
public ArrayList list;
public MethodBase[] methods;
public bool init = false;
public bool allow_threads = true;
internal MethodBinder()
{
list = new ArrayList();
}
internal MethodBinder(MethodInfo mi)
{
list = new ArrayList { mi };
}
public int Count
{
get { return list.Count; }
}
internal void AddMethod(MethodBase m)
{
list.Add(m);
}
/// <summary>
/// Given a sequence of MethodInfo and a sequence of types, return the
/// MethodInfo that matches the signature represented by those types.
/// </summary>
internal static MethodInfo MatchSignature(MethodInfo[] mi, Type[] tp)
{
if (tp == null)
{
return null;
}
int count = tp.Length;
foreach (MethodInfo t in mi)
{
ParameterInfo[] pi = t.GetParameters();
if (pi.Length != count)
{
continue;
}
for (var n = 0; n < pi.Length; n++)
{
if (tp[n] != pi[n].ParameterType)
{
break;
}
if (n == pi.Length - 1)
{
return t;
}
}
}
return null;
}
/// <summary>
/// Given a sequence of MethodInfo and a sequence of type parameters,
/// return the MethodInfo that represents the matching closed generic.
/// </summary>
internal static MethodInfo MatchParameters(MethodInfo[] mi, Type[] tp)
{
if (tp == null)
{
return null;
}
int count = tp.Length;
foreach (MethodInfo t in mi)
{
if (!t.IsGenericMethodDefinition)
{
continue;
}
Type[] args = t.GetGenericArguments();
if (args.Length != count)
{
continue;
}
return t.MakeGenericMethod(tp);
}
return null;
}
/// <summary>
/// Given a sequence of MethodInfo and two sequences of type parameters,
/// return the MethodInfo that matches the signature and the closed generic.
/// </summary>
internal static MethodInfo MatchSignatureAndParameters(MethodInfo[] mi, Type[] genericTp, Type[] sigTp)
{
if (genericTp == null || sigTp == null)
{
return null;
}
int genericCount = genericTp.Length;
int signatureCount = sigTp.Length;
foreach (MethodInfo t in mi)
{
if (!t.IsGenericMethodDefinition)
{
continue;
}
Type[] genericArgs = t.GetGenericArguments();
if (genericArgs.Length != genericCount)
{
continue;
}
ParameterInfo[] pi = t.GetParameters();
if (pi.Length != signatureCount)
{
continue;
}
for (var n = 0; n < pi.Length; n++)
{
if (sigTp[n] != pi[n].ParameterType)
{
break;
}
if (n == pi.Length - 1)
{
MethodInfo match = t;
if (match.IsGenericMethodDefinition)
{
// FIXME: typeArgs not used
Type[] typeArgs = match.GetGenericArguments();
return match.MakeGenericMethod(genericTp);
}
return match;
}
}
}
return null;
}
/// <summary>
/// Return the array of MethodInfo for this method. The result array
/// is arranged in order of precedence (done lazily to avoid doing it
/// at all for methods that are never called).
/// </summary>
internal MethodBase[] GetMethods()
{
if (!init)
{
// I'm sure this could be made more efficient.
list.Sort(new MethodSorter());
methods = (MethodBase[])list.ToArray(typeof(MethodBase));
init = true;
}
return methods;
}
/// <summary>
/// Precedence algorithm largely lifted from Jython - the concerns are
/// generally the same so we'll start with this and tweak as necessary.
/// </summary>
/// <remarks>
/// Based from Jython `org.python.core.ReflectedArgs.precedence`
/// See: https://github.com/jythontools/jython/blob/master/src/org/python/core/ReflectedArgs.java#L192
/// </remarks>
internal static int GetPrecedence(MethodBase mi)
{
ParameterInfo[] pi = mi.GetParameters();
int val = mi.IsStatic ? 3000 : 0;
int num = pi.Length;
val += mi.IsGenericMethod ? 1 : 0;
for (var i = 0; i < num; i++)
{
val += ArgPrecedence(pi[i].ParameterType);
}
return val;
}
/// <summary>
/// Return a precedence value for a particular Type object.
/// </summary>
internal static int ArgPrecedence(Type t)
{
Type objectType = typeof(object);
if (t == objectType)
{
return 3000;
}
if (t.IsArray)
{
Type e = t.GetElementType();
if (e == objectType)
{
return 2500;
}
return 100 + ArgPrecedence(e);
}
TypeCode tc = Type.GetTypeCode(t);
// TODO: Clean up
switch (tc)
{
case TypeCode.Object:
return 1;
case TypeCode.UInt64:
return 10;
case TypeCode.UInt32:
return 11;
case TypeCode.UInt16:
return 12;
case TypeCode.Int64:
return 13;
case TypeCode.Int32:
return 14;
case TypeCode.Int16:
return 15;
case TypeCode.Char:
return 16;
case TypeCode.SByte:
return 17;
case TypeCode.Byte:
return 18;
case TypeCode.Single:
return 20;
case TypeCode.Double:
return 21;
case TypeCode.String:
return 30;
case TypeCode.Boolean:
return 40;
}
return 2000;
}
/// <summary>
/// Bind the given Python instance and arguments to a particular method
/// overload and return a structure that contains the converted Python
/// instance, converted arguments and the correct method to call.
/// </summary>
internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw)
{
return Bind(inst, args, kw, null, null);
}
internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info)
{
return Bind(inst, args, kw, info, null);
}
internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo)
{
// loop to find match, return invoker w/ or /wo error
MethodBase[] _methods = null;
var kwargDict = new Dictionary<string, IntPtr>();
if (kw != IntPtr.Zero)
{
var pynkwargs = (int)Runtime.PyDict_Size(kw);
IntPtr keylist = Runtime.PyDict_Keys(kw);
IntPtr valueList = Runtime.PyDict_Values(kw);
for (int i = 0; i < pynkwargs; ++i)
{
var keyStr = Runtime.GetManagedString(Runtime.PyList_GetItem(new BorrowedReference(keylist), i));
kwargDict[keyStr] = Runtime.PyList_GetItem(new BorrowedReference(valueList), i).DangerousGetAddress();
}
Runtime.XDecref(keylist);
Runtime.XDecref(valueList);
}
var pynargs = (int)Runtime.PyTuple_Size(args);
var isGeneric = false;
if (info != null)
{
_methods = new MethodBase[1];
_methods.SetValue(info, 0);
}
else
{
_methods = GetMethods();
}
// TODO: Clean up
foreach (MethodBase mi in _methods)
{
if (mi.IsGenericMethod)
{
isGeneric = true;
}
ParameterInfo[] pi = mi.GetParameters();
ArrayList defaultArgList;
bool paramsArray;
if (!MatchesArgumentCount(pynargs, pi, kwargDict, out paramsArray, out defaultArgList))
{
continue;
}
var outs = 0;
var margs = TryConvertArguments(pi, paramsArray, args, pynargs, kwargDict, defaultArgList,
needsResolution: _methods.Length > 1,
outs: out outs);
if (margs == null)
{
continue;
}
object target = null;
if (!mi.IsStatic && inst != IntPtr.Zero)
{
//CLRObject co = (CLRObject)ManagedType.GetManagedObject(inst);
// InvalidCastException: Unable to cast object of type
// 'Python.Runtime.ClassObject' to type 'Python.Runtime.CLRObject'
var co = ManagedType.GetManagedObject(inst) as CLRObject;
// Sanity check: this ensures a graceful exit if someone does
// something intentionally wrong like call a non-static method
// on the class rather than on an instance of the class.
// XXX maybe better to do this before all the other rigmarole.
if (co == null)
{
return null;
}
target = co.inst;
}
return new Binding(mi, target, margs, outs);
}
// We weren't able to find a matching method but at least one
// is a generic method and info is null. That happens when a generic
// method was not called using the [] syntax. Let's introspect the
// type of the arguments and use it to construct the correct method.
if (isGeneric && info == null && methodinfo != null)
{
Type[] types = Runtime.PythonArgsToTypeArray(args, true);
MethodInfo mi = MatchParameters(methodinfo, types);
return Bind(inst, args, kw, mi, null);
}
return null;
}
static IntPtr HandleParamsArray(IntPtr args, int arrayStart, int pyArgCount, out bool isNewReference)
{
isNewReference = false;
IntPtr op;
// for a params method, we may have a sequence or single/multiple items
// here we look to see if the item at the paramIndex is there or not
// and then if it is a sequence itself.
if ((pyArgCount - arrayStart) == 1)
{
// we only have one argument left, so we need to check it
// to see if it is a sequence or a single item
IntPtr item = Runtime.PyTuple_GetItem(args, arrayStart);
if (!Runtime.PyString_Check(item) && Runtime.PySequence_Check(item))
{
// it's a sequence (and not a string), so we use it as the op
op = item;
}
else
{
isNewReference = true;
op = Runtime.PyTuple_GetSlice(args, arrayStart, pyArgCount);
}
}
else
{
isNewReference = true;
op = Runtime.PyTuple_GetSlice(args, arrayStart, pyArgCount);
}
return op;
}
/// <summary>
/// Attempts to convert Python positional argument tuple and keyword argument table
/// into an array of managed objects, that can be passed to a method.
/// </summary>
/// <param name="pi">Information about expected parameters</param>
/// <param name="paramsArray"><c>true</c>, if the last parameter is a params array.</param>
/// <param name="args">A pointer to the Python argument tuple</param>
/// <param name="pyArgCount">Number of arguments, passed by Python</param>
/// <param name="kwargDict">Dictionary of keyword argument name to python object pointer</param>
/// <param name="defaultArgList">A list of default values for omitted parameters</param>
/// <param name="needsResolution"><c>true</c>, if overloading resolution is required</param>
/// <param name="outs">Returns number of output parameters</param>
/// <returns>An array of .NET arguments, that can be passed to a method.</returns>
static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
IntPtr args, int pyArgCount,
Dictionary<string, IntPtr> kwargDict,
ArrayList defaultArgList,
bool needsResolution,
out int outs)
{
outs = 0;
var margs = new object[pi.Length];
int arrayStart = paramsArray ? pi.Length - 1 : -1;
for (int paramIndex = 0; paramIndex < pi.Length; paramIndex++)
{
var parameter = pi[paramIndex];
bool hasNamedParam = kwargDict.ContainsKey(parameter.Name);
bool isNewReference = false;
if (paramIndex >= pyArgCount && !(hasNamedParam || (paramsArray && paramIndex == arrayStart)))
{
if (defaultArgList != null)
{
margs[paramIndex] = defaultArgList[paramIndex - pyArgCount];
}
continue;
}
IntPtr op;
if (hasNamedParam)
{
op = kwargDict[parameter.Name];
}
else
{
if(arrayStart == paramIndex)
{
op = HandleParamsArray(args, arrayStart, pyArgCount, out isNewReference);
}
else
{
op = Runtime.PyTuple_GetItem(args, paramIndex);
}
}
bool isOut;
if (!TryConvertArgument(op, parameter.ParameterType, needsResolution, out margs[paramIndex], out isOut))
{
return null;
}
if (isNewReference)
{
// TODO: is this a bug? Should this happen even if the conversion fails?
// GetSlice() creates a new reference but GetItem()
// returns only a borrow reference.
Runtime.XDecref(op);
}
if (parameter.IsOut || isOut)
{
outs++;
}
}
return margs;
}
static bool TryConvertArgument(IntPtr op, Type parameterType, bool needsResolution,
out object arg, out bool isOut)
{
arg = null;
isOut = false;
var clrtype = TryComputeClrArgumentType(parameterType, op, needsResolution: needsResolution);
if (clrtype == null)
{
return false;
}
if (!Converter.ToManaged(op, clrtype, out arg, false))
{
Exceptions.Clear();
return false;
}
isOut = clrtype.IsByRef;
return true;
}
static Type TryComputeClrArgumentType(Type parameterType, IntPtr argument, bool needsResolution)
{
// this logic below handles cases when multiple overloading methods
// are ambiguous, hence comparison between Python and CLR types
// is necessary
Type clrtype = null;
IntPtr pyoptype;
if (needsResolution)
{
// HACK: each overload should be weighted in some way instead
pyoptype = Runtime.PyObject_Type(argument);
Exceptions.Clear();
if (pyoptype != IntPtr.Zero)
{
clrtype = Converter.GetTypeByAlias(pyoptype);
}
Runtime.XDecref(pyoptype);
}
if (clrtype != null)
{
var typematch = false;
if ((parameterType != typeof(object)) && (parameterType != clrtype))
{
IntPtr pytype = Converter.GetPythonTypeByAlias(parameterType);
pyoptype = Runtime.PyObject_Type(argument);
Exceptions.Clear();
if (pyoptype != IntPtr.Zero)
{
if (pytype != pyoptype)
{
typematch = false;
}
else
{
typematch = true;
clrtype = parameterType;
}
}
if (!typematch)
{
// this takes care of enum values
TypeCode argtypecode = Type.GetTypeCode(parameterType);
TypeCode paramtypecode = Type.GetTypeCode(clrtype);
if (argtypecode == paramtypecode)
{
typematch = true;
clrtype = parameterType;
}
}
Runtime.XDecref(pyoptype);
if (!typematch)
{
return null;
}
}
else
{
typematch = true;
clrtype = parameterType;
}
}
else
{
clrtype = parameterType;
}
return clrtype;
}
static bool MatchesArgumentCount(int positionalArgumentCount, ParameterInfo[] parameters,
Dictionary<string, IntPtr> kwargDict,
out bool paramsArray,
out ArrayList defaultArgList)
{
defaultArgList = null;
var match = false;
paramsArray = parameters.Length > 0 ? Attribute.IsDefined(parameters[parameters.Length - 1], typeof(ParamArrayAttribute)) : false;
if (positionalArgumentCount == parameters.Length)
{
match = true;
}
else if (positionalArgumentCount < parameters.Length)
{
// every parameter past 'positionalArgumentCount' must have either
// a corresponding keyword argument or a default parameter
match = true;
defaultArgList = new ArrayList();
for (var v = positionalArgumentCount; v < parameters.Length; v++)
{
if (kwargDict.ContainsKey(parameters[v].Name))
{
// we have a keyword argument for this parameter,
// no need to check for a default parameter, but put a null
// placeholder in defaultArgList
defaultArgList.Add(null);
}
else if (parameters[v].IsOptional)
{
// IsOptional will be true if the parameter has a default value,
// or if the parameter has the [Optional] attribute specified.
// The GetDefaultValue() extension method will return the value
// to be passed in as the parameter value
defaultArgList.Add(parameters[v].GetDefaultValue());
}
else if(!paramsArray)
{
match = false;
}
}
}
else if (positionalArgumentCount > parameters.Length && parameters.Length > 0 &&
Attribute.IsDefined(parameters[parameters.Length - 1], typeof(ParamArrayAttribute)))
{
// This is a `foo(params object[] bar)` style method
match = true;
paramsArray = true;
}
return match;
}
internal virtual IntPtr Invoke(IntPtr inst, IntPtr args, IntPtr kw)
{
return Invoke(inst, args, kw, null, null);
}
internal virtual IntPtr Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info)
{
return Invoke(inst, args, kw, info, null);
}
protected static void AppendArgumentTypes(StringBuilder to, IntPtr args)
{
long argCount = Runtime.PyTuple_Size(args);
to.Append("(");
for (long argIndex = 0; argIndex < argCount; argIndex++)
{
var arg = Runtime.PyTuple_GetItem(args, argIndex);
if (arg != IntPtr.Zero)
{
var type = Runtime.PyObject_Type(arg);
if (type != IntPtr.Zero)
{
try
{
var description = Runtime.PyObject_Unicode(type);
if (description != IntPtr.Zero)
{
to.Append(Runtime.GetManagedString(description));
Runtime.XDecref(description);
}
}
finally
{
Runtime.XDecref(type);
}
}
}
if (argIndex + 1 < argCount)
to.Append(", ");
}
to.Append(')');
}
internal virtual IntPtr Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo)
{
Binding binding = Bind(inst, args, kw, info, methodinfo);
object result;
IntPtr ts = IntPtr.Zero;
if (binding == null)
{
var value = new StringBuilder("No method matches given arguments");
if (methodinfo != null && methodinfo.Length > 0)
{
value.Append($" for {methodinfo[0].Name}");
}
value.Append(": ");
AppendArgumentTypes(to: value, args);
Exceptions.SetError(Exceptions.TypeError, value.ToString());
return IntPtr.Zero;
}
if (allow_threads)
{
ts = PythonEngine.BeginAllowThreads();
}
try
{
result = binding.info.Invoke(binding.inst, BindingFlags.Default, null, binding.args, null);
}
catch (Exception e)
{
if (e.InnerException != null)
{
e = e.InnerException;
}
if (allow_threads)
{
PythonEngine.EndAllowThreads(ts);
}
Exceptions.SetError(e);
return IntPtr.Zero;
}
if (allow_threads)
{
PythonEngine.EndAllowThreads(ts);
}
// If there are out parameters, we return a tuple containing
// the result followed by the out parameters. If there is only
// one out parameter and the return type of the method is void,
// we return the out parameter as the result to Python (for
// code compatibility with ironpython).
var mi = (MethodInfo)binding.info;
if (binding.outs == 1 && mi.ReturnType == typeof(void))
{
}
if (binding.outs > 0)
{
ParameterInfo[] pi = mi.GetParameters();
int c = pi.Length;
var n = 0;
IntPtr t = Runtime.PyTuple_New(binding.outs + 1);
IntPtr v = Converter.ToPython(result, mi.ReturnType);
Runtime.PyTuple_SetItem(t, n, v);
n++;
for (var i = 0; i < c; i++)
{
Type pt = pi[i].ParameterType;
if (pi[i].IsOut || pt.IsByRef)
{
v = Converter.ToPython(binding.args[i], pt);
Runtime.PyTuple_SetItem(t, n, v);
n++;
}
}
if (binding.outs == 1 && mi.ReturnType == typeof(void))
{
v = Runtime.PyTuple_GetItem(t, 1);
Runtime.XIncref(v);
Runtime.XDecref(t);
return v;
}
return t;
}
return Converter.ToPython(result, mi.ReturnType);
}
}
/// <summary>
/// Utility class to sort method info by parameter type precedence.
/// </summary>
internal class MethodSorter : IComparer
{
int IComparer.Compare(object m1, object m2)
{
var me1 = (MethodBase)m1;
var me2 = (MethodBase)m2;
if (me1.DeclaringType != me2.DeclaringType)
{
// m2's type derives from m1's type, favor m2
if (me1.DeclaringType.IsAssignableFrom(me2.DeclaringType))
return 1;
// m1's type derives from m2's type, favor m1
if (me2.DeclaringType.IsAssignableFrom(me1.DeclaringType))
return -1;
}
int p1 = MethodBinder.GetPrecedence((MethodBase)m1);
int p2 = MethodBinder.GetPrecedence((MethodBase)m2);
if (p1 < p2)
{
return -1;
}
if (p1 > p2)
{
return 1;
}
return 0;
}
}
/// <summary>
/// A Binding is a utility instance that bundles together a MethodInfo
/// representing a method to call, a (possibly null) target instance for
/// the call, and the arguments for the call (all as managed values).
/// </summary>
internal class Binding
{
public MethodBase info;
public object[] args;
public object inst;
public int outs;
internal Binding(MethodBase info, object inst, object[] args, int outs)
{
this.info = info;
this.inst = inst;
this.args = args;
this.outs = outs;
}
}
static internal class ParameterInfoExtensions
{
public static object GetDefaultValue(this ParameterInfo parameterInfo)
{
// parameterInfo.HasDefaultValue is preferable but doesn't exist in .NET 4.0
bool hasDefaultValue = (parameterInfo.Attributes & ParameterAttributes.HasDefault) ==
ParameterAttributes.HasDefault;
if (hasDefaultValue)
{
return parameterInfo.DefaultValue;
}
else
{
// [OptionalAttribute] was specified for the parameter.
// See https://stackoverflow.com/questions/3416216/optionalattribute-parameters-default-value
// for rules on determining the value to pass to the parameter
var type = parameterInfo.ParameterType;
if (type == typeof(object))
return Type.Missing;
else if (type.IsValueType)
return Activator.CreateInstance(type);
else
return null;
}
}
}
}
| 35.250585 | 162 | 0.465852 | [
"MIT"
] | danabr/pythonnet | src/runtime/methodbinder.cs | 30,104 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the translate-2017-07-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Translate.Model
{
/// <summary>
/// This is the response object from the ImportTerminology operation.
/// </summary>
public partial class ImportTerminologyResponse : AmazonWebServiceResponse
{
private TerminologyDataLocation _auxiliaryDataLocation;
private TerminologyProperties _terminologyProperties;
/// <summary>
/// Gets and sets the property AuxiliaryDataLocation.
/// <para>
/// The Amazon S3 location of a file that provides any errors or warnings that were produced
/// by your input file. This file was created when Amazon Translate attempted to create
/// a terminology resource. The location is returned as a presigned URL to that has a
/// 30 minute expiration.
/// </para>
/// </summary>
public TerminologyDataLocation AuxiliaryDataLocation
{
get { return this._auxiliaryDataLocation; }
set { this._auxiliaryDataLocation = value; }
}
// Check to see if AuxiliaryDataLocation property is set
internal bool IsSetAuxiliaryDataLocation()
{
return this._auxiliaryDataLocation != null;
}
/// <summary>
/// Gets and sets the property TerminologyProperties.
/// <para>
/// The properties of the custom terminology being imported.
/// </para>
/// </summary>
public TerminologyProperties TerminologyProperties
{
get { return this._terminologyProperties; }
set { this._terminologyProperties = value; }
}
// Check to see if TerminologyProperties property is set
internal bool IsSetTerminologyProperties()
{
return this._terminologyProperties != null;
}
}
} | 34.291139 | 107 | 0.666667 | [
"Apache-2.0"
] | EbstaLimited/aws-sdk-net | sdk/src/Services/Translate/Generated/Model/ImportTerminologyResponse.cs | 2,709 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KidzCodeTurtlebot
{
public class Path
{
private List<Drive> path;
public Path()
{
this.path = new List<Drive>();
}
public Path(List<Drive> path)
{
this.path = path;
}
public static Path getPath1()
{
List<Drive> data = new List<Drive>();
data.Add(Drive.STRAIGHT);
data.Add(Drive.LEFT);
data.Add(Drive.RIGHT);
data.Add(Drive.STRAIGHT);
data.Add(Drive.RIGHT);
data.Add(Drive.RIGHT);
data.Add(Drive.LEFT);
data.Add(Drive.LEFT);
data.Add(Drive.STRAIGHT);
data.Add(Drive.LEFT);
data.Add(Drive.STRAIGHT);
data.Add(Drive.STRAIGHT);
data.Add(Drive.LEFT);
data.Add(Drive.STRAIGHT);
data.Add(Drive.STRAIGHT);
data.Add(Drive.STRAIGHT);
return new Path(data);
}
public List<Drive> Data
{
get
{
return path;
}
set
{
this.path = value;
}
}
}
}
| 21.370968 | 49 | 0.472453 | [
"BSD-3-Clause"
] | WisconsinRobotics/KidzCodeTurtlebot | KidzCodeTurtlebot/Path.cs | 1,327 | C# |
/*
* Intersight REST API
*
* This is Intersight REST API
*
* OpenAPI spec version: 1.0.9-262
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = intersight.Client.SwaggerDateConverter;
namespace intersight.Model
{
/// <summary>
/// Authorization input for the external site
/// </summary>
[DataContract]
public partial class SoftwarerepositoryAuthorization : IEquatable<SoftwarerepositoryAuthorization>, IValidatableObject
{
/// <summary>
/// Repositry the user credentials are for
/// </summary>
/// <value>Repositry the user credentials are for </value>
[JsonConverter(typeof(StringEnumConverter))]
public enum RepositoryTypeEnum
{
/// <summary>
/// Enum Cisco for "cisco"
/// </summary>
[EnumMember(Value = "cisco")]
Cisco
}
/// <summary>
/// Repositry the user credentials are for
/// </summary>
/// <value>Repositry the user credentials are for </value>
[DataMember(Name="RepositoryType", EmitDefaultValue=false)]
public RepositoryTypeEnum? RepositoryType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="SoftwarerepositoryAuthorization" /> class.
/// </summary>
/// <param name="Ancestors">Ancestors is an array containing the MO references of the ancestors in the object containment hierarchy. .</param>
/// <param name="Moid">A unique identifier of this Managed Object instance. .</param>
/// <param name="Owners">An array of owners which represent effective ownership of this object. .</param>
/// <param name="Parent">The direct ancestor of this managed object in the containment hierarchy. .</param>
/// <param name="Tags">An array of tags, which allow to add key, value meta-data to managed objects. .</param>
/// <param name="VersionContext">The versioning info for this managed object .</param>
/// <param name="Account">Account relation .</param>
/// <param name="IsPasswordSet">IsPasswordSet.</param>
/// <param name="IsUserIdSet">IsUserIdSet.</param>
/// <param name="Password">User password for the external site .</param>
/// <param name="RepositoryType">Repositry the user credentials are for (default to RepositoryTypeEnum.Cisco).</param>
/// <param name="UserId">User id for the external site .</param>
public SoftwarerepositoryAuthorization(List<MoBaseMoRef> Ancestors = default(List<MoBaseMoRef>), string Moid = default(string), List<string> Owners = default(List<string>), MoBaseMoRef Parent = default(MoBaseMoRef), List<MoTag> Tags = default(List<MoTag>), MoVersionContext VersionContext = default(MoVersionContext), IamAccountRef Account = default(IamAccountRef), bool? IsPasswordSet = default(bool?), bool? IsUserIdSet = default(bool?), string Password = default(string), RepositoryTypeEnum? RepositoryType = RepositoryTypeEnum.Cisco, string UserId = default(string))
{
this.Ancestors = Ancestors;
this.Moid = Moid;
this.Owners = Owners;
this.Parent = Parent;
this.Tags = Tags;
this.VersionContext = VersionContext;
this.Account = Account;
this.IsPasswordSet = IsPasswordSet;
this.IsUserIdSet = IsUserIdSet;
this.Password = Password;
// use default value if no "RepositoryType" provided
if (RepositoryType == null)
{
this.RepositoryType = RepositoryTypeEnum.Cisco;
}
else
{
this.RepositoryType = RepositoryType;
}
this.UserId = UserId;
}
/// <summary>
/// The Account ID for this managed object.
/// </summary>
/// <value>The Account ID for this managed object. </value>
[DataMember(Name="AccountMoid", EmitDefaultValue=false)]
public string AccountMoid { get; private set; }
/// <summary>
/// Ancestors is an array containing the MO references of the ancestors in the object containment hierarchy.
/// </summary>
/// <value>Ancestors is an array containing the MO references of the ancestors in the object containment hierarchy. </value>
[DataMember(Name="Ancestors", EmitDefaultValue=false)]
public List<MoBaseMoRef> Ancestors { get; set; }
/// <summary>
/// The time when this managed object was created.
/// </summary>
/// <value>The time when this managed object was created. </value>
[DataMember(Name="CreateTime", EmitDefaultValue=false)]
public DateTime? CreateTime { get; private set; }
/// <summary>
/// The time when this managed object was last modified.
/// </summary>
/// <value>The time when this managed object was last modified. </value>
[DataMember(Name="ModTime", EmitDefaultValue=false)]
public DateTime? ModTime { get; private set; }
/// <summary>
/// A unique identifier of this Managed Object instance.
/// </summary>
/// <value>A unique identifier of this Managed Object instance. </value>
[DataMember(Name="Moid", EmitDefaultValue=false)]
public string Moid { get; set; }
/// <summary>
/// The fully-qualified type of this managed object, e.g. the class name.
/// </summary>
/// <value>The fully-qualified type of this managed object, e.g. the class name. </value>
[DataMember(Name="ObjectType", EmitDefaultValue=false)]
public string ObjectType { get; private set; }
/// <summary>
/// An array of owners which represent effective ownership of this object.
/// </summary>
/// <value>An array of owners which represent effective ownership of this object. </value>
[DataMember(Name="Owners", EmitDefaultValue=false)]
public List<string> Owners { get; set; }
/// <summary>
/// The direct ancestor of this managed object in the containment hierarchy.
/// </summary>
/// <value>The direct ancestor of this managed object in the containment hierarchy. </value>
[DataMember(Name="Parent", EmitDefaultValue=false)]
public MoBaseMoRef Parent { get; set; }
/// <summary>
/// An array of tags, which allow to add key, value meta-data to managed objects.
/// </summary>
/// <value>An array of tags, which allow to add key, value meta-data to managed objects. </value>
[DataMember(Name="Tags", EmitDefaultValue=false)]
public List<MoTag> Tags { get; set; }
/// <summary>
/// The versioning info for this managed object
/// </summary>
/// <value>The versioning info for this managed object </value>
[DataMember(Name="VersionContext", EmitDefaultValue=false)]
public MoVersionContext VersionContext { get; set; }
/// <summary>
/// Account relation
/// </summary>
/// <value>Account relation </value>
[DataMember(Name="Account", EmitDefaultValue=false)]
public IamAccountRef Account { get; set; }
/// <summary>
/// Gets or Sets IsPasswordSet
/// </summary>
[DataMember(Name="IsPasswordSet", EmitDefaultValue=false)]
public bool? IsPasswordSet { get; set; }
/// <summary>
/// Gets or Sets IsUserIdSet
/// </summary>
[DataMember(Name="IsUserIdSet", EmitDefaultValue=false)]
public bool? IsUserIdSet { get; set; }
/// <summary>
/// User password for the external site
/// </summary>
/// <value>User password for the external site </value>
[DataMember(Name="Password", EmitDefaultValue=false)]
public string Password { get; set; }
/// <summary>
/// User id for the external site
/// </summary>
/// <value>User id for the external site </value>
[DataMember(Name="UserId", EmitDefaultValue=false)]
public string UserId { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class SoftwarerepositoryAuthorization {\n");
sb.Append(" AccountMoid: ").Append(AccountMoid).Append("\n");
sb.Append(" Ancestors: ").Append(Ancestors).Append("\n");
sb.Append(" CreateTime: ").Append(CreateTime).Append("\n");
sb.Append(" ModTime: ").Append(ModTime).Append("\n");
sb.Append(" Moid: ").Append(Moid).Append("\n");
sb.Append(" ObjectType: ").Append(ObjectType).Append("\n");
sb.Append(" Owners: ").Append(Owners).Append("\n");
sb.Append(" Parent: ").Append(Parent).Append("\n");
sb.Append(" Tags: ").Append(Tags).Append("\n");
sb.Append(" VersionContext: ").Append(VersionContext).Append("\n");
sb.Append(" Account: ").Append(Account).Append("\n");
sb.Append(" IsPasswordSet: ").Append(IsPasswordSet).Append("\n");
sb.Append(" IsUserIdSet: ").Append(IsUserIdSet).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" RepositoryType: ").Append(RepositoryType).Append("\n");
sb.Append(" UserId: ").Append(UserId).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as SoftwarerepositoryAuthorization);
}
/// <summary>
/// Returns true if SoftwarerepositoryAuthorization instances are equal
/// </summary>
/// <param name="other">Instance of SoftwarerepositoryAuthorization to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(SoftwarerepositoryAuthorization other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.AccountMoid == other.AccountMoid ||
this.AccountMoid != null &&
this.AccountMoid.Equals(other.AccountMoid)
) &&
(
this.Ancestors == other.Ancestors ||
this.Ancestors != null &&
this.Ancestors.SequenceEqual(other.Ancestors)
) &&
(
this.CreateTime == other.CreateTime ||
this.CreateTime != null &&
this.CreateTime.Equals(other.CreateTime)
) &&
(
this.ModTime == other.ModTime ||
this.ModTime != null &&
this.ModTime.Equals(other.ModTime)
) &&
(
this.Moid == other.Moid ||
this.Moid != null &&
this.Moid.Equals(other.Moid)
) &&
(
this.ObjectType == other.ObjectType ||
this.ObjectType != null &&
this.ObjectType.Equals(other.ObjectType)
) &&
(
this.Owners == other.Owners ||
this.Owners != null &&
this.Owners.SequenceEqual(other.Owners)
) &&
(
this.Parent == other.Parent ||
this.Parent != null &&
this.Parent.Equals(other.Parent)
) &&
(
this.Tags == other.Tags ||
this.Tags != null &&
this.Tags.SequenceEqual(other.Tags)
) &&
(
this.VersionContext == other.VersionContext ||
this.VersionContext != null &&
this.VersionContext.Equals(other.VersionContext)
) &&
(
this.Account == other.Account ||
this.Account != null &&
this.Account.Equals(other.Account)
) &&
(
this.IsPasswordSet == other.IsPasswordSet ||
this.IsPasswordSet != null &&
this.IsPasswordSet.Equals(other.IsPasswordSet)
) &&
(
this.IsUserIdSet == other.IsUserIdSet ||
this.IsUserIdSet != null &&
this.IsUserIdSet.Equals(other.IsUserIdSet)
) &&
(
this.Password == other.Password ||
this.Password != null &&
this.Password.Equals(other.Password)
) &&
(
this.RepositoryType == other.RepositoryType ||
this.RepositoryType != null &&
this.RepositoryType.Equals(other.RepositoryType)
) &&
(
this.UserId == other.UserId ||
this.UserId != null &&
this.UserId.Equals(other.UserId)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.AccountMoid != null)
hash = hash * 59 + this.AccountMoid.GetHashCode();
if (this.Ancestors != null)
hash = hash * 59 + this.Ancestors.GetHashCode();
if (this.CreateTime != null)
hash = hash * 59 + this.CreateTime.GetHashCode();
if (this.ModTime != null)
hash = hash * 59 + this.ModTime.GetHashCode();
if (this.Moid != null)
hash = hash * 59 + this.Moid.GetHashCode();
if (this.ObjectType != null)
hash = hash * 59 + this.ObjectType.GetHashCode();
if (this.Owners != null)
hash = hash * 59 + this.Owners.GetHashCode();
if (this.Parent != null)
hash = hash * 59 + this.Parent.GetHashCode();
if (this.Tags != null)
hash = hash * 59 + this.Tags.GetHashCode();
if (this.VersionContext != null)
hash = hash * 59 + this.VersionContext.GetHashCode();
if (this.Account != null)
hash = hash * 59 + this.Account.GetHashCode();
if (this.IsPasswordSet != null)
hash = hash * 59 + this.IsPasswordSet.GetHashCode();
if (this.IsUserIdSet != null)
hash = hash * 59 + this.IsUserIdSet.GetHashCode();
if (this.Password != null)
hash = hash * 59 + this.Password.GetHashCode();
if (this.RepositoryType != null)
hash = hash * 59 + this.RepositoryType.GetHashCode();
if (this.UserId != null)
hash = hash * 59 + this.UserId.GetHashCode();
return hash;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 43.497487 | 578 | 0.546037 | [
"Apache-2.0"
] | ategaw-cisco/intersight-powershell | csharp/swaggerClient/src/intersight/Model/SoftwarerepositoryAuthorization.cs | 17,312 | C# |
using InquirerCore.Validators;
using System;
using System.Collections.Generic;
using System.Text;
namespace InquirerCore.Prompts
{
public interface IPrompt
{
int[] Render();
string[] GetQuestion();
string Answer();
void Ask();
void SetValid(IValidator validator);
bool IsValidAnswer(string answer);
}
}
| 20.277778 | 44 | 0.649315 | [
"MIT"
] | Ibrahim-Islam/Inquirer | src/Inquirer/Prompts/IPrompt.cs | 367 | C# |
// <copyright file="BucketMap{T}.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.GameLogic
{
using System;
using System.Collections.Generic;
using System.Linq;
using Interfaces;
using MUnique.OpenMU.Pathfinding;
/// <summary>
/// A two-dimensional map of buckets.
/// </summary>
/// <typeparam name="T">The type of objects which should be hold.</typeparam>
internal class BucketMap<T>
{
private const int DefaultListCapacity = 4;
private readonly Bucket<T>[] list;
/// <summary>
/// Initializes a new instance of the <see cref="BucketMap{T}"/> class.
/// </summary>
public BucketMap()
{
this.BucketSideLength = 4;
this.list = new Bucket<T>[0x100 / this.BucketSideLength * 0x100 / this.BucketSideLength];
this.InitList(DefaultListCapacity);
}
/// <summary>
/// Initializes a new instance of the <see cref="BucketMap{T}"/> class.
/// </summary>
/// <param name="sideLength">Length of the side.</param>
/// <param name="createLists">if set to <c>true</c> the all lists are created now, and not by demand.</param>
/// <param name="listCapacity">The list capacity.</param>
/// <param name="bucketSideLength">Length of the bucket side.</param>
/// <exception cref="System.ArgumentException">SideLength must be a multiple of BucketSideLength.</exception>
public BucketMap(int sideLength, bool createLists, int listCapacity, int bucketSideLength)
{
if (sideLength % bucketSideLength != 0)
{
throw new ArgumentException($"SideLength ({sideLength}) must be a multiple of BucketSideLength ({bucketSideLength}).");
}
this.BucketSideLength = bucketSideLength;
this.SideLength = sideLength / bucketSideLength;
this.list = new Bucket<T>[this.SideLength * this.SideLength];
if (createLists)
{
this.InitList(listCapacity);
}
}
/// <summary>
/// Gets or sets the length of a side of the map. This value should be a multiple of <see cref="BucketSideLength"/>.
/// </summary>
public int SideLength { get; set; }
/// <summary>
/// Gets or sets the length of the bucket side.
/// </summary>
/// <value>
/// The length of the bucket side.
/// </value>
public int BucketSideLength { get; set; }
/// <summary>
/// Gets or sets the <see cref="Bucket{T}"/> at the specified coordinates.
/// </summary>
/// <value>
/// The <see cref="Bucket{T}"/>.
/// </value>
/// <param name="point">The coordinates.</param>
/// <returns>The <see cref="Bucket{T}"/> at the specified coordinates.</returns>
public Bucket<T> this[Point point]
{
get => this.list[this.GetListIndex(point)];
set => this.list[this.GetListIndex(point)] = value;
}
/// <summary>
/// Gets the items which are in range of the specified coordinates and range.
/// </summary>
/// <param name="point">The coordinates.</param>
/// <param name="range">The maximum range.</param>
/// <returns>The items which are in range of the specified coordinate and range.</returns>
public IEnumerable<ILocateable> GetInRange(Point point, int range)
{
var result = new List<ILocateable>();
var buckets = this.GetBucketsInRange(point, range);
foreach (var bucket in buckets)
{
result.AddRange(bucket.OfType<ILocateable>().Where(obj => obj.IsInRange(point, range)));
}
return result;
}
/// <summary>
/// Gets the buckets in the specified range of the specified coordinates.
/// </summary>
/// <param name="point">The coordinates.</param>
/// <param name="range">The range.</param>
/// <returns>The buckets in the specified range of the specified coordinate.</returns>
public IEnumerable<Bucket<T>> GetBucketsInRange(Point point, int range)
{
int maxX = Math.Min(point.X + range, (this.SideLength - 1) * this.BucketSideLength) / this.BucketSideLength;
int maxY = Math.Min(point.Y + range, (this.SideLength - 1) * this.BucketSideLength) / this.BucketSideLength;
int minX = Math.Max(point.X - range, 0) / this.BucketSideLength;
int minY = Math.Max(point.Y - range, 0) / this.BucketSideLength;
for (int i = minX; maxX >= i; ++i)
{
for (int j = minY; maxY >= j; ++j)
{
yield return this.list[i + (j * this.SideLength)];
}
}
}
private int GetListIndex(Point point) => (point.X / this.BucketSideLength) + ((point.Y / this.BucketSideLength) * this.SideLength);
private void InitList(int listCapacity)
{
for (int i = 0; i < this.list.Length; ++i)
{
this.list[i] = new Bucket<T>(listCapacity);
}
}
}
}
| 39.859259 | 139 | 0.571641 | [
"MIT"
] | Apollyon221/OpenMU | src/GameLogic/BucketMap{T}.cs | 5,383 | C# |
namespace TheStore.Site.Controllers.Api
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using TheStore.Services.Interfaces;
using TheStore.Site.Areas.Admin.Models;
using TheStore.Site.ModelsFactories.Interfaces;
public class CategoryController : ApiController
{
private readonly ICategoryService CategoryService;
private readonly ICategoryModelFactory CategoryModelFactory;
public CategoryController(ICategoryService categoryService, ICategoryModelFactory categoryModelFactory)
{
this.CategoryService = categoryService ?? throw new ArgumentNullException(nameof(categoryService));
this.CategoryModelFactory = categoryModelFactory ?? throw new ArgumentNullException(nameof(categoryModelFactory));
}
[HttpGet]
public IHttpActionResult Get()
{
var data = this.CategoryService.GetAll();
var vModels = data.Select(x => this.CategoryModelFactory.ProduceCategoryListModel(x));
return this.Ok(vModels);
}
[HttpDelete]
public IHttpActionResult Delete(int id)
{
try
{
var category = this.CategoryService.Delete(id);
if (category == null)
return this.NotFound();
return this.Ok(category.Id);
}
catch (Exception)
{
// TODO: Log the exception.
return this.BadRequest();
throw;
}
}
}
}
| 31.803922 | 126 | 0.609125 | [
"Apache-2.0"
] | MarioZisov/TheStore | Source/TheStore.Site/Controllers/Api/CategoryController.cs | 1,624 | C# |
using Cake.Common.Tests.Fixtures.Tools;
using Cake.Common.Tools.XUnit;
using Cake.Core;
using Cake.Core.IO;
using Cake.Testing;
using Cake.Testing.Xunit;
using Xunit;
namespace Cake.Common.Tests.Unit.Tools.XUnit
{
public sealed class XUnit2RunnerTests
{
public sealed class TheRunMethod
{
[Fact]
public void Should_Throw_If_Assembly_Path_Is_Null()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.AssemblyPaths = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsArgumentNullException(result, "assemblyPaths");
}
[Fact]
public void Should_Throw_If_XUnit_Runner_Was_Not_Found()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.GivenDefaultToolDoNotExist();
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsType<CakeException>(result);
Assert.Equal("xUnit.net (v2): Could not locate executable.", result.Message);
}
[Theory]
[InlineData("/bin/tools/xUnit/xunit.exe", "/bin/tools/xUnit/xunit.exe")]
[InlineData("./tools/xUnit/xunit.exe", "/Working/tools/xUnit/xunit.exe")]
public void Should_Use_XUnit_Runner_From_Tool_Path_If_Provided(string toolPath, string expected)
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.ToolPath = toolPath;
fixture.GivenSettingsToolPathExist();
// When
var result = fixture.Run();
// Then
Assert.Equal(expected, result.Path.FullPath);
}
[WindowsTheory]
[InlineData("C:/xUnit/xunit.exe", "C:/xUnit/xunit.exe")]
public void Should_Use_XUnit_Runner_From_Tool_Path_If_Provided_On_Windows(string toolPath, string expected)
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.ToolPath = toolPath;
fixture.GivenSettingsToolPathExist();
// When
var result = fixture.Run();
// Then
Assert.Equal(expected, result.Path.FullPath);
}
[Fact]
public void Should_Find_XUnit_Runner_If_Tool_Path_Not_Provided()
{
// Given
var fixture = new XUnit2RunnerFixture();
// When
var result = fixture.Run();
// Then
Assert.Equal("/Working/tools/xunit.console.exe", result.Path.FullPath);
}
[Fact]
public void Should_Use_Provided_Assembly_Path_In_Process_Arguments()
{
// Given
var fixture = new XUnit2RunnerFixture();
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\"", result.Args);
}
[Fact]
public void Should_Use_Provided_Assembly_Paths_In_Process_Arguments()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.AssemblyPaths = new FilePath[] { "./Test1.dll", "./Test2.dll" };
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" \"/Working/Test2.dll\"", result.Args);
}
[Fact]
public void Should_Set_Working_Directory()
{
// Given
var fixture = new XUnit2RunnerFixture();
// When
var result = fixture.Run();
// Then
Assert.Equal("/Working", result.Process.WorkingDirectory.FullPath);
}
[Fact]
public void Should_Throw_If_Process_Was_Not_Started()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.GivenProcessCannotStart();
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsType<CakeException>(result);
Assert.Equal("xUnit.net (v2): Process was not started.", result.Message);
}
[Fact]
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.GivenProcessExitsWithCode(1);
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsType<CakeException>(result);
Assert.Equal("xUnit.net (v2): Process returned an error (exit code 1).", result.Message);
}
[Fact]
public void Should_Throw_If_HtmlReport_Is_Set_But_OutputDirectory_Is_Null()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.HtmlReport = true;
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsType<CakeException>(result);
Assert.Equal("Cannot generate HTML report when no output directory has been set.", result.Message);
}
[Fact]
public void Should_Generate_Html_Report_With_Correct_Name_For_Single_Assembly()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.OutputDirectory = "/Output";
fixture.Settings.HtmlReport = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -html \"/Output/Test1.dll.html\"", result.Args);
}
[Fact]
public void Should_Generate_Html_Report_With_Correct_Name_For_Multiple_Assemblies()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.AssemblyPaths = new FilePath[] { "./Test1.dll", "./Test2.dll" };
fixture.Settings.OutputDirectory = "/Output";
fixture.Settings.HtmlReport = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" \"/Working/Test2.dll\" " +
"-html \"/Output/TestResults.html\"", result.Args);
}
[Fact]
public void Should_Throw_If_XmlReport_Is_Set_But_OutputDirectory_Is_Null()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.XmlReport = true;
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsType<CakeException>(result);
Assert.Equal("Cannot generate XML report when no output directory has been set.", result.Message);
}
[Fact]
public void Should_Generate_Xml_Report_With_Correct_Name_For_Single_Assembly()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.OutputDirectory = "/Output";
fixture.Settings.XmlReport = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -xml \"/Output/Test1.dll.xml\"", result.Args);
}
[Fact]
public void Should_Generate_Xml_Report_With_Correct_Name_For_Multiple_Assemblies()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.AssemblyPaths = new FilePath[] { "./Test1.dll", "./Test2.dll" };
fixture.Settings.OutputDirectory = "/Output";
fixture.Settings.XmlReport = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" \"/Working/Test2.dll\" " +
"-xml \"/Output/TestResults.xml\"", result.Args);
}
[Fact]
public void Should_Throw_If_XmlReportV1_Is_Set_But_OutputDirectory_Is_Null()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.XmlReportV1 = true;
// When
var result = Record.Exception(() => fixture.Run());
// Then
Assert.IsType<CakeException>(result);
Assert.Equal("Cannot generate XML report when no output directory has been set.", result.Message);
}
[Fact]
public void Should_Generate_Legacy_Xml_Report_With_Correct_Name_For_Single_Assembly()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.OutputDirectory = "/Output";
fixture.Settings.XmlReportV1 = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -xmlv1 \"/Output/Test1.dll.xml\"", result.Args);
}
[Fact]
public void Should_Generate_Legacy_Xml_Report_With_Correct_Name_For_Multiple_Assemblies()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.AssemblyPaths = new FilePath[] { "./Test1.dll", "./Test2.dll" };
fixture.Settings.OutputDirectory = "/Output";
fixture.Settings.XmlReportV1 = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" \"/Working/Test2.dll\" " +
"-xmlv1 \"/Output/TestResults.xml\"", result.Args);
}
[Fact]
public void Should_Not_Use_Shadow_Copying_If_Disabled_In_Settings()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.ShadowCopy = false;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -noshadow", result.Args);
}
[Fact]
public void Should_Not_Use_App_Domains_If_Disabled_In_Settings()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.NoAppDomain = true;
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -noappdomain", result.Args);
}
[Theory]
[InlineData(ParallelismOption.All, "\"/Working/Test1.dll\" -parallel all")]
[InlineData(ParallelismOption.Assemblies, "\"/Working/Test1.dll\" -parallel assemblies")]
[InlineData(ParallelismOption.Collections, "\"/Working/Test1.dll\" -parallel collections")]
[InlineData(ParallelismOption.None, "\"/Working/Test1.dll\"")]
public void Should_Use_Parallel_Switch_If_Settings_Value_Is_Not_None(ParallelismOption option, string expected)
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.Parallelism = option;
// When
var result = fixture.Run();
// Then
Assert.Equal(expected, result.Args);
}
[Theory]
[InlineData(null, "\"/Working/Test1.dll\"")]
[InlineData(0, "\"/Working/Test1.dll\" -maxthreads unlimited")]
[InlineData(3, "\"/Working/Test1.dll\" -maxthreads 3")]
public void Should_Use_MaxThreads_Switch_If_Settings_Value_Is_Not_Null(int? option, string expected)
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.MaxThreads = option;
// When
var result = fixture.Run();
// Then
Assert.Equal(expected, result.Args);
}
[Fact]
public void Should_Set_Switches_For_TraitsToInclude_Defined_In_Settings()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.IncludeTrait("Trait1", "value1A", "value1B");
fixture.Settings.IncludeTrait("Trait2", "value2");
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -trait \"Trait1=value1A\" -trait \"Trait1=value1B\" -trait \"Trait2=value2\"", result.Args);
}
[Fact]
public void Should_Set_Switches_For_TraitsToExclude_Defined_In_Settings()
{
// Given
var fixture = new XUnit2RunnerFixture();
fixture.Settings.ExcludeTrait("Trait1", "value1A", "value1B");
fixture.Settings.ExcludeTrait("Trait2", "value2");
// When
var result = fixture.Run();
// Then
Assert.Equal("\"/Working/Test1.dll\" -notrait \"Trait1=value1A\" -notrait \"Trait1=value1B\" -notrait \"Trait2=value2\"", result.Args);
}
}
}
} | 35.670886 | 151 | 0.508801 | [
"MIT"
] | RichiCoder1/cake | src/Cake.Common.Tests/Unit/Tools/XUnit/XUnit2RunnerTests.cs | 14,092 | C# |
using Microsoft.EntityFrameworkCore.Migrations;
namespace OutronicShop.Backend.Database.Migrations
{
public partial class ProductsMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
| 19.833333 | 71 | 0.686275 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | mathieu900v/outronicshop | dotnet/srcs/OutronicShop.Backend.Database/Migrations/20210422150356_ProductsMigration.cs | 359 | C# |
namespace AutoMapper
{
/// <summary>
/// Converts source type to destination type instead of normal member mapping
/// </summary>
/// <typeparam name="TSource">Source type</typeparam>
/// <typeparam name="TDestination">Destination type</typeparam>
public interface ITypeConverter<in TSource, out TDestination>
{
/// <summary>
/// Performs conversion from source to destination type
/// </summary>
/// <param name="context">Resolution context</param>
/// <returns>Destination object</returns>
TDestination Convert(ResolutionContext context);
}
}
| 32.157895 | 81 | 0.667758 | [
"MIT"
] | billrob/AutoMapper | src/AutoMapper/ITypeConverter.cs | 611 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using NeoGeniX.Forms;
namespace theCatalyst
{
public partial class theEditorLegacy : DarkForm
{
string path = "";
public theEditorLegacy()
{
InitializeComponent();
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Clear();
path = "";
}
private void undoToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Undo();
}
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Cut();
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Copy();
}
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Paste();
}
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.SelectAll();
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
StreamReader streamReader = new StreamReader(openFileDialog1.OpenFile());
textBox1.Text = streamReader.ReadToEnd();
path = openFileDialog1.FileName;
streamReader.Close();
}
public void openFile(string path)
{
StreamReader streamReader = new StreamReader(File.OpenRead(path));
textBox1.Text = streamReader.ReadToEnd();
path = openFileDialog1.FileName;
streamReader.Close();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (path == "")
{
saveAsToolStripMenuItem_Click(sender, e);
} else
{
Stream stream = File.Open(path, FileMode.Open);
StreamWriter streamWriter = new StreamWriter(stream);
streamWriter.WriteLine(textBox1.Text);
streamWriter.Close();
}
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
saveFileDialog1.ShowDialog();
}
private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
{
StreamWriter streamWriter = new StreamWriter(saveFileDialog1.OpenFile());
streamWriter.WriteLine(textBox1.Text);
streamWriter.Close();
}
private void theEditor_Load(object sender, EventArgs e)
{
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox1 aboutBox1 = new AboutBox1();
aboutBox1.Show();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
| 27.237705 | 85 | 0.588023 | [
"Apache-2.0"
] | iAwesome404/ProshellCatalyst | Cairo Desktop/theCatalyst/theEditorLegacy.cs | 3,325 | C# |
using System;
using Newtonsoft.Json;
namespace Essensoft.AspNetCore.Payment.Alipay.Domain
{
/// <summary>
/// AlipayEcoLogisticsExpressNonserviceQueryModel Data Structure.
/// </summary>
[Serializable]
public class AlipayEcoLogisticsExpressNonserviceQueryModel : AlipayObject
{
/// <summary>
/// 物流机构编码,参照物流机构编码文档,<a href="https://expressprod.oss-cn-hangzhou.aliyuncs.com/docs/%E5%AF%84%E4%BB%B6%E5%B9%B3%E5%8F%B0-%E7%89%A9%E6%B5%81%E6%9C%BA%E6%9E%84%E7%BC%96%E7%A0%81%E6%96%87%E6%A1%A3.xlsx">点此下载</a>。
/// </summary>
[JsonProperty("logis_merch_code")]
public string LogisMerchCode { get; set; }
}
}
| 35.263158 | 218 | 0.670149 | [
"MIT"
] | gebiWangshushu/payment | src/Essensoft.AspNetCore.Payment.Alipay/Domain/AlipayEcoLogisticsExpressNonserviceQueryModel.cs | 718 | C# |
using System;
using System.Collections.Generic;
using OpenBveApi.Runtime;
namespace Plugin {
internal class RunOnceEvent : Event {
internal RunOnceEvent(Script script) {
this.Script = script;
this.Conditions = new List<Condition>();
this.Actions = new List<Action>();
}
}
internal class KeyDownEvent : Event {
internal VirtualKeys Key;
internal KeyDownEvent(Script script, VirtualKeys key) {
this.Script = script;
this.Conditions = new List<Condition>();
this.Actions = new List<Action>();
this.Key = key;
}
}
internal class KeyPressEvent : Event {
internal VirtualKeys Key;
internal KeyPressEvent(Script script, VirtualKeys key) {
this.Script = script;
this.Conditions = new List<Condition>();
this.Actions = new List<Action>();
this.Key = key;
}
}
internal class KeyUpEvent : Event {
internal VirtualKeys Key;
internal KeyUpEvent(Script script, VirtualKeys key) {
this.Script = script;
this.Conditions = new List<Condition>();
this.Actions = new List<Action>();
this.Key = key;
}
}
internal class BeaconEvent : Event {
internal RangeCollection Type;
internal RangeCollection Signal;
internal BeaconEvent(Script script, RangeCollection type, RangeCollection signal) {
this.Script = script;
this.Conditions = new List<Condition>();
this.Actions = new List<Action>();
this.Type = type;
this.Signal = signal;
}
}
internal class CountdownEvent : Event {
internal double Current;
internal double Maximum;
internal CountdownEvent(Script script, double maximum) {
this.Script = script;
this.Conditions = new List<Condition>();
this.Actions = new List<Action>();
this.Current = 0.0;
this.Maximum = maximum;
}
internal override void Perform() {
if (!this.Script.Events.Contains(this)) {
this.Current = 0.0;
this.Script.Events.Add(this);
}
}
}
} | 25.226667 | 85 | 0.692389 | [
"Apache-2.0"
] | joeyfoo/alstom-metropolis-for-openbve | alstom-metropolis-content/plugin/trainscript-train-plugin/SourceCode/Plugin/Tags.Events.cs | 1,894 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExchangeApi
{
public enum OrderType
{
Unknown = -1,
Market,
Limit,
}
}
| 14.6875 | 33 | 0.651064 | [
"MIT"
] | Eternity714/DeepQuant.ExchangeApi | src/ExchangeApi.Abstractions/OrderType.cs | 237 | C# |
#region Licencia
/*
Copyright 2013 Juan Diego Martinez
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Northwind.Data.Model;
namespace Northwind.Data.Repositories
{
/// <summary>
/// Interfaz que representa un repositorio de entidades <see cref="ShipperEntity"/>
/// </summary>
public interface IShipperEntityRepository : IRepository<ShipperEntity>
{
}
}
| 28.4 | 84 | 0.742455 | [
"Apache-2.0"
] | jdmartinez/Northwind | Northwind.Data/Repositories/IShipperRepository.cs | 996 | C# |
//-------------------------------------------------------------------------
// Copyright © 2019 Province of British Columbia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//-------------------------------------------------------------------------
namespace HealthGateway.WebClient.Models.AcaPy
{
/// <summary>
/// Represents the State of the Connection.
/// </summary>
public static class ConnectionState
{
/// <summary>
/// Connection state of invitation.
/// </summary>
public const string Invitation = "invitation";
/// <summary>
/// Connection state of request.
/// </summary>
public const string Request = "request";
/// <summary>
/// Connection state of response.
/// </summary>
public const string Response = "response";
/// <summary>
/// Connection state of active.
/// </summary>
public const string Active = "active";
}
}
| 33.977273 | 75 | 0.575251 | [
"Apache-2.0"
] | WadeBarnes/healthgateway | Apps/WebClient/src/Server/Models/AcaPy/ConnectionState.cs | 1,496 | C# |
using UI.RadialMenu;
using UI.SelectionBox;
using UnityEngine;
using Zenject;
namespace UI {
/// <summary>
/// Installs UI elements that can be reused throughout the application. Normally injected in the project context.
/// </summary>
public class UIInstaller : MonoInstaller {
[SerializeField]
private ModalViewController _modalViewControllerPrefab;
[SerializeField]
private SelectionBoxBehaviour _selectionBoxBehaviour;
public override void InstallBindings() {
Container.Bind<IModalViewController>().To<ModalViewController>()
.FromComponentsInNewPrefab(_modalViewControllerPrefab).AsSingle()
.Lazy();
Container.Bind<ISelectionBox>().To<SelectionBoxBehaviour>()
.FromComponentsInNewPrefab(_selectionBoxBehaviour).AsSingle()
.Lazy();
}
}
} | 34.814815 | 117 | 0.642553 | [
"Apache-2.0"
] | dcasadevall/tabletop-combat-helper | Assets/Scripts/UI/UIInstaller.cs | 940 | C# |
using Test.Database;
using Test.InputModels;
using Test.Repository;
using System;
using System.Linq;
using System.Threading.Tasks;
using Threax.AspNetCore.Tests;
using Xunit;
namespace Test.Tests
{
public static partial class ValueTests
{
public class Repository : IDisposable
{
private Mockup mockup = new Mockup().SetupGlobal().SetupModel();
public Repository()
{
}
public void Dispose()
{
mockup.Dispose();
}
[Fact]
async Task Add()
{
var repo = mockup.Get<IValueRepository>();
var result = await repo.Add(ValueTests.CreateInput());
Assert.NotNull(result);
}
[Fact]
async Task AddRange()
{
var repo = mockup.Get<IValueRepository>();
await repo.AddRange(new ValueInput[] { ValueTests.CreateInput(), ValueTests.CreateInput(), ValueTests.CreateInput() });
}
[Fact]
async Task Delete()
{
var dbContext = mockup.Get<AppDbContext>();
var repo = mockup.Get<IValueRepository>();
await repo.AddRange(new ValueInput[] { ValueTests.CreateInput(), ValueTests.CreateInput(), ValueTests.CreateInput() });
var result = await repo.Add(ValueTests.CreateInput());
Assert.Equal<int>(4, dbContext.LotsaValues.Count());
await repo.Delete(result.ValueId);
Assert.Equal<int>(3, dbContext.LotsaValues.Count());
}
[Fact]
async Task Get()
{
var dbContext = mockup.Get<AppDbContext>();
var repo = mockup.Get<IValueRepository>();
await repo.AddRange(new ValueInput[] { ValueTests.CreateInput(), ValueTests.CreateInput(), ValueTests.CreateInput() });
var result = await repo.Add(ValueTests.CreateInput());
Assert.Equal<int>(4, dbContext.LotsaValues.Count());
var getResult = await repo.Get(result.ValueId);
Assert.NotNull(getResult);
}
[Fact]
async Task HasLotsaValuesEmpty()
{
var repo = mockup.Get<IValueRepository>();
Assert.False(await repo.HasLotsaValues());
}
[Fact]
async Task HasLotsaValues()
{
var repo = mockup.Get<IValueRepository>();
await repo.AddRange(new ValueInput[] { ValueTests.CreateInput(), ValueTests.CreateInput(), ValueTests.CreateInput() });
Assert.True(await repo.HasLotsaValues());
}
[Fact]
async Task List()
{
//This could be more complete
var repo = mockup.Get<IValueRepository>();
await repo.AddRange(new ValueInput[] { ValueTests.CreateInput(), ValueTests.CreateInput(), ValueTests.CreateInput() });
var query = new ValueQuery();
var result = await repo.List(query);
Assert.Equal(query.Limit, result.Limit);
Assert.Equal(query.Offset, result.Offset);
Assert.Equal(3, result.Total);
Assert.NotEmpty(result.Items);
}
[Fact]
async Task Update()
{
var repo = mockup.Get<IValueRepository>();
var result = await repo.Add(ValueTests.CreateInput());
Assert.NotNull(result);
var updateResult = await repo.Update(result.ValueId, ValueTests.CreateInput());
Assert.NotNull(updateResult);
}
}
}
} | 35.766355 | 135 | 0.530442 | [
"MIT"
] | thereclusive/Threax.AspNetCore.Hypermedia | test/Threax.ModelGen.Tests/TestFiles/PluralNameTests/Tests/Value/ValueRepositoryTests.cs | 3,827 | C# |
/**********************************************************************************************************************
* Notifiable.NET (https://github.com/mkloubert/Notifiable.NET) *
* *
* Copyright (c) 2015, Marcel Joachim Kloubert <marcel.kloubert@gmx.net> *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
* following conditions are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* 2. 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. *
* *
* 3. Neither the name of the copyright holder 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 System.Windows;
using MarcelJoachimKloubert.Extensions;
namespace MarcelJoachimKloubert.Examples.Notifiable.WPF
{
/// <summary>
/// Code behind of MainWindow.xaml.
/// </summary>
public partial class MainWindow : Window
{
#region Constructors (1)
/// <summary>
/// Initializes a new instance of the <see cref="MainWindow" /> class.
/// </summary>
public MainWindow()
{
InitializeComponent();
}
#endregion Constructors (1)
#region Events (1)
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var vm = new ViewModel()
{
StringValue = "Change this to see effects...",
};
vm.RegisterForPropertyChanged((ctx) =>
{
if (ctx.Value != null)
{
}
}, (v) => v.StringValue);
DataContext = vm;
}
#endregion
}
} | 60.864865 | 121 | 0.400755 | [
"BSD-3-Clause"
] | mkloubert/Notifiable.NET | MarcelJoachimKloubert.Examples.Notifiable.WPF/MainWindow.xaml.cs | 4,506 | C# |
using Checkem.Windows.CustomComponents;
using Checkem.Models;
using System;
using Sphere.Readable;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Controls;
using System.Windows;
using System.Collections.Generic;
namespace Checkem.Views
{
public partial class DetailsPanel : UserControl, INotifyPropertyChanged
{
public DetailsPanel(Itembar itembar)
{
this.DataContext = this;
//Copy the item bar
this.itembar = itembar;
//Get item bar's todo properties
this.todo = itembar.todo;
InitializeComponent();
//Load in available tag choices
LoadAvailableTagItemsChoices();
//Load in the current item's tags
LoadTagItems();
ShowReminderDetails();
}
#region Event
public event PropertyChangedEventHandler PropertyChanged;
public event EventHandler Close;
public event EventHandler UpdateChosenTag;
#endregion
#region Variable
private Itembar itembar;
private bool ReminderFirstSetup = true;
#endregion
#region Property
//I was Tring to Update the TodoItem After it have a tag
TodoManager todoManager = new TodoManager();
TagManager tagManager = new TagManager();
public Todo todo = new Todo();
public string Title
{
get
{
return todo.Title;
}
set
{
//this will prevent user from saving task without title
if (value != string.Empty)
{
if (todo.Title != value)
{
todo.Title = value;
//update item bar's title text block's text
itembar.Update_Title();
OnPropertyChanged();
}
}
}
}
public string Description
{
get
{
return todo.Description;
}
set
{
if (todo.Description != value)
{
todo.Description = value;
itembar.Update_Description();
OnPropertyChanged();
}
}
}
public bool IsCompleted
{
get
{
return todo.IsCompleted;
}
set
{
if (todo.IsCompleted != value)
{
todo.IsCompleted = value;
//update completion check box's check state in item bar
itembar.Update_IsCompleted();
OnPropertyChanged();
}
}
}
public bool IsStarred
{
get
{
return todo.IsStarred;
}
set
{
if (todo.IsStarred != value)
{
todo.IsStarred = value;
//update star toggle's check state in item bar
itembar.Update_IsStarred();
OnPropertyChanged();
}
}
}
public string CreationDateTime
{
get
{
return $"Created on {DateTimeManipulator.SimplifiedDate(todo.CreationDateTime)}";
}
}
public ReminderState ReminderState
{
get
{
return itembar.ReminderState;
}
set
{
if (itembar.ReminderState != value)
{
itembar.ReminderState = value;
SetReminderDetailsVisualState();
}
}
}
#endregion
protected void OnPropertyChanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
private void StoryBoard_Completed(object sender, EventArgs e)
{
TrySetBeginDateTime();
TrySetEndDateTime();
Close?.Invoke(this, EventArgs.Empty);
}
#region Reminder
#region Show reminder dateails
private void ShowReminderDetails()
{
switch (ReminderState)
{
case ReminderState.None:
{
SetReminderDetailsVisualState();
break;
}
case ReminderState.Basic:
{
SetReminderDetailsVisualState();
//Show basic reminder's date time in date time picker
EndDatePicker.Text = $"{this.todo.EndDateTime.Value.Month}/{this.todo.EndDateTime.Value.Day}/{this.todo.EndDateTime.Value.Year}";
EndTimePicker.SelectedTime = Convert.ToDateTime(string.Format("{0:h:mm tt}", this.todo.EndDateTime));
TrySetEndDateTime();
break;
}
case ReminderState.Advance:
{
SetReminderDetailsVisualState();
//Show advance reminder's date time in date time picker
BeginDatePicker.Text = $"{this.todo.BeginDateTime.Value.Month}/{this.todo.BeginDateTime.Value.Day}/{this.todo.BeginDateTime.Value.Year}";
BeginTimePicker.SelectedTime = Convert.ToDateTime(string.Format("{0:h:mm tt}", this.todo.BeginDateTime));
EndDatePicker.Text = $"{this.todo.EndDateTime.Value.Month}/{this.todo.EndDateTime.Value.Day}/{this.todo.EndDateTime.Value.Year}";
EndTimePicker.SelectedTime = Convert.ToDateTime(string.Format("{0:h:mm tt}", this.todo.EndDateTime));
TrySetBeginDateTime();
TrySetEndDateTime();
break;
}
default:
break;
}
ReminderFirstSetup = false;
}
#endregion
#region Set reminder details visual state
private void SetReminderDetailsVisualState()
{
BeginDateTimeWarningTextBlock.Visibility = Visibility.Collapsed;
EndDateTimeWarningTextBlock.Visibility = Visibility.Collapsed;
#region Prevent empty entries
if (BeginDatePicker.SelectedDate != null && todo.BeginDateTime.HasValue)
{
BeginDatePicker.SelectedDate = todo.BeginDateTime.Value;
}
else
{
BeginDatePicker.SelectedDate = DateTime.Now.Date;
}
if (BeginTimePicker.SelectedTime != null && todo.BeginDateTime.HasValue)
{
BeginTimePicker.SelectedTime = todo.BeginDateTime.Value;
}
else
{
BeginTimePicker.SelectedTime = DateTime.Now.Date;
}
if (EndDatePicker.SelectedDate != null && todo.EndDateTime.HasValue)
{
EndDatePicker.SelectedDate = todo.EndDateTime.Value;
}
else
{
EndDatePicker.SelectedDate = DateTime.Now.Date;
}
if (EndTimePicker.SelectedTime != null && todo.EndDateTime.HasValue)
{
EndTimePicker.SelectedTime = todo.EndDateTime.Value;
}
else
{
EndTimePicker.SelectedTime = DateTime.Now.Date;
}
#endregion
switch (ReminderState)
{
case ReminderState.None:
{
ReminderSelecter.SelectedIndex = 2;
BeginDateTimeField.Visibility = Visibility.Collapsed;
EndDateTimeField.Visibility = Visibility.Collapsed;
break;
}
case ReminderState.Basic:
{
ReminderSelecter.SelectedIndex = 0;
BeginDateTimeField.Visibility = Visibility.Collapsed;
EndDateTimeField.Visibility = Visibility.Visible;
break;
}
case ReminderState.Advance:
{
ReminderSelecter.SelectedIndex = 1;
BeginDateTimeField.Visibility = Visibility.Visible;
EndDateTimeField.Visibility = Visibility.Visible;
break;
}
default:
break;
}
}
#endregion
#region Set date time value
private void TrySetBeginDateTime()
{
try
{
string dateTimeString = BeginDatePicker.SelectedDate.Value.ToString("yyyy-MM-dd") + "T" + BeginTimePicker.SelectedTime.Value.ToString("HH:mm:ss");
todo.BeginDateTime = Convert.ToDateTime(dateTimeString);
itembar.Update_Reminder();
BeginDateTimeWarningTextBlock.Visibility = Visibility.Collapsed;
}
catch (Exception)
{
BeginDateTimeWarningTextBlock.Visibility = Visibility.Visible;
}
}
private void TrySetEndDateTime()
{
try
{
string dateTimeString = EndDatePicker.SelectedDate.Value.ToString("yyyy-MM-dd") + "T" + EndTimePicker.SelectedTime.Value.ToString("HH:mm:ss");
todo.EndDateTime = Convert.ToDateTime(dateTimeString);
itembar.Update_Reminder();
EndDateTimeWarningTextBlock.Visibility = Visibility.Collapsed;
}
catch (Exception)
{
EndDateTimeWarningTextBlock.Visibility = Visibility.Visible;
}
}
#endregion
#region Reminder selector events
private void ListBoxItem_NoReminder_Selected(object sender, System.Windows.RoutedEventArgs e)
{
this.ReminderState = ReminderState.None;
}
private void ListBoxItem_BasicReminder_Selected(object sender, System.Windows.RoutedEventArgs e)
{
this.ReminderState = ReminderState.Basic;
}
private void ListBoxItem_AdvanceReminder_Selected(object sender, System.Windows.RoutedEventArgs e)
{
this.ReminderState = ReminderState.Advance;
}
#endregion
#region Date time picker value changed event handlers
private void BeginDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
{
if (!ReminderFirstSetup)
{
TrySetBeginDateTime();
}
}
private void BeginTimePicker_SelectedTimeChanged(object sender, RoutedPropertyChangedEventArgs<DateTime?> e)
{
if (!ReminderFirstSetup)
{
TrySetBeginDateTime();
}
}
private void EndDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
{
if (!ReminderFirstSetup)
{
TrySetEndDateTime();
}
}
private void EndTimePicker_SelectedTimeChanged(object sender, RoutedPropertyChangedEventArgs<DateTime?> e)
{
DateTime? dateTime = EndTimePicker.SelectedTime;
//DateTime? dateTime2 = EndTimePicker.SelectedTime;
if (!ReminderFirstSetup)
{
TrySetEndDateTime();
}
}
#endregion
#endregion
#region Load available tag items coices
//Load all available tag choices from Tag.json
private void LoadAvailableTagItemsChoices()
{
if (tagManager.Inventory != null)
{
foreach (TagItem item in tagManager.Inventory)
{
if (itembar.TagItems.FindIndex(x => x.ID == item.ID) == -1)
{
TagItemCombobox.Items.Add(new PreviewTag(item));
}
}
}
}
//Load in the current item's tags
private void LoadTagItems()
{
if (todo.TagItems != null)
{
foreach (var item in todo.TagItems)
{
PreviewTag tag = new PreviewTag(item);
tag.RemovePreTag += new EventHandler(this.RemovePreTag);
TagDisplay.Children.Add(tag);
}
}
}
private void RemovePreTag(object sender, EventArgs e)
{
PreviewTag tag = sender as PreviewTag;
todo.TagItems.RemoveAt(todo.TagItems.FindIndex(x => x.ID == tag.tagItem.ID));
UpdateChosenTag?.Invoke(itembar, EventArgs.Empty);
LoadTag();
itembar.LoadTagItems();
LoadAvailableTagItemsChoices();
}
#endregion
private void BeginDatePicker_LostFocus(object sender, RoutedEventArgs e)
{
//System.Windows.Forms.MessageBox.Show("Test");
}
//Due to itembar.TagItem or Todo.TagItems didn't
//get a actual data(get;set;) so it cannot use "Add" or
//"itembar.TagItems[x] = TagItem[y]"
// I guseed you already knew it but I still want to make a note
private void TagComBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (TagItemCombobox.SelectedItem.GetType().Name == "PreviewTag")
{
//MessageBox.Show(TagItemCombobox.SelectedItem.GetType().Name);
PreviewTag tag = TagItemCombobox.SelectedItem as PreviewTag;
TagItem tagItem = tag.tagItem;
todo.TagItems.Add(tagItem);
LoadTag();
TagItemCombobox.SelectedIndex = 0;
TagItemCombobox.Items.Remove(tag);
}
itembar.LoadTagItems();
}
private void LoadTag()
{
TagDisplay.Children.Clear();
foreach (var item in todo.TagItems)
{
PreviewTag previewTag = new PreviewTag(item);
previewTag.tagItem = item;
previewTag.RemovePreTag += new EventHandler(this.RemovePreTag);
TagDisplay.Children.Add(previewTag);
}
}
}
}
| 28.881783 | 162 | 0.511843 | [
"Apache-2.0"
] | Ballpits/checkem-applications | src/Checkem.Windows/Views/DetailsPanel.xaml.cs | 14,905 | C# |
/*
*
* (c) Copyright Ascensio System Limited 2010-2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using ASC.Common.Logging;
using ASC.Core;
using ASC.Files.Core;
using ASC.Web.Core.Files;
using ASC.Web.Core.Users;
using ASC.Web.Files.Classes;
using ASC.Web.Files.Core;
using ASC.Web.Files.Services.DocumentService;
using File = ASC.Files.Core.File;
namespace ASC.Files.ThumbnailBuilder
{
internal class Builder
{
private readonly ConfigSection config;
private readonly ILog logger;
public Builder(ConfigSection configSection, ILog log)
{
config = configSection;
logger = log;
}
public void BuildThumbnails(IEnumerable<FileData> filesWithoutThumbnails)
{
try
{
Parallel.ForEach(
filesWithoutThumbnails,
new ParallelOptions { MaxDegreeOfParallelism = config.MaxDegreeOfParallelism },
(fileData) => { BuildThumbnail(fileData); }
);
}
catch (Exception exception)
{
logger.Error(string.Format("BuildThumbnails: filesWithoutThumbnails.Count: {0}.", filesWithoutThumbnails.Count()), exception);
}
}
private void BuildThumbnail(FileData fileData)
{
try
{
CoreContext.TenantManager.SetCurrentTenant(fileData.TenantId);
using (var fileDao = Global.DaoFactory.GetFileDao())
{
if (fileDao == null)
{
logger.ErrorFormat("BuildThumbnail: TenantId: {0}. FileDao could not be null.", fileData.TenantId);
return;
}
GenerateThumbnail(fileDao, fileData);
}
}
catch (Exception exception)
{
logger.Error(string.Format("BuildThumbnail: TenantId: {0}.", fileData.TenantId), exception);
}
finally
{
Launcher.Queue.TryRemove(fileData.FileId, out _);
}
}
private void GenerateThumbnail(IFileDao fileDao, FileData fileData)
{
File file = null;
try
{
file = fileDao.GetFile(fileData.FileId);
if (file == null)
{
logger.ErrorFormat("GenerateThumbnail: FileId: {0}. File not found.", fileData.FileId);
return;
}
if (file.ThumbnailStatus != Thumbnail.Waiting)
{
logger.InfoFormat("GenerateThumbnail: FileId: {0}. Thumbnail already processed.", fileData.FileId);
return;
}
var ext = FileUtility.GetFileExtension(file.Title);
if (!config.FormatsArray.Contains(ext) || file.Encrypted || file.RootFolderType == FolderType.TRASH || file.ContentLength > config.AvailableFileSize)
{
file.ThumbnailStatus = Thumbnail.NotRequired;
fileDao.SaveThumbnail(file, null);
return;
}
if (IsImage(file))
{
CropImage(fileDao, file);
}
else
{
MakeThumbnail(fileDao, file);
}
}
catch (Exception exception)
{
logger.Error(string.Format("GenerateThumbnail: FileId: {0}.", fileData.FileId), exception);
if (file != null)
{
file.ThumbnailStatus = Thumbnail.Error;
fileDao.SaveThumbnail(file, null);
}
}
}
private void MakeThumbnail(IFileDao fileDao, File file)
{
logger.DebugFormat("MakeThumbnail: FileId: {0}.", file.ID);
string thumbnailUrl = null;
var attempt = 1;
do
{
try
{
if (GetThumbnailUrl(file, Global.ThumbnailExtension, out thumbnailUrl))
{
break;
}
}
catch (Exception exception)
{
if (exception.InnerException != null)
{
var documentServiceException = exception.InnerException as DocumentService.DocumentServiceException;
if (documentServiceException != null)
{
if (documentServiceException.Code == DocumentService.DocumentServiceException.ErrorCode.ConvertPassword)
{
throw new Exception(string.Format("MakeThumbnail: FileId: {0}. Encrypted file.", file.ID));
}
if (documentServiceException.Code == DocumentService.DocumentServiceException.ErrorCode.Convert)
{
throw new Exception(string.Format("MakeThumbnail: FileId: {0}. Could not convert.", file.ID));
}
}
}
}
if (attempt >= config.AttemptsLimit)
{
throw new Exception(string.Format("MakeThumbnail: FileId: {0}. Attempts limmit exceeded.", file.ID));
}
else
{
logger.DebugFormat("MakeThumbnail: FileId: {0}. Sleep {1} after attempt #{2}. ", file.ID, config.AttemptWaitInterval, attempt);
attempt++;
}
Thread.Sleep(config.AttemptWaitInterval);
}
while (string.IsNullOrEmpty(thumbnailUrl));
SaveThumbnail(fileDao, file, thumbnailUrl);
}
private bool GetThumbnailUrl(File file, string toExtension, out string url)
{
var fileUri = PathProvider.GetFileStreamUrl(file);
fileUri = DocumentServiceConnector.ReplaceCommunityAdress(fileUri);
var fileExtension = file.ConvertedExtension;
var docKey = DocumentServiceHelper.GetDocKey(file);
var thumbnail = new DocumentService.ThumbnailData
{
Aspect = 2,
First = true,
//Height = config.ThumbnaillHeight,
//Width = config.ThumbnaillWidth
};
var spreadsheetLayout = new DocumentService.SpreadsheetLayout
{
IgnorePrintArea = true,
//Orientation = "landscape", // "297mm" x "210mm"
FitToHeight = 0,
FitToWidth = 1,
Headings = false,
GridLines = false,
Margins = new DocumentService.Margins
{
Top = "0mm",
Right = "0mm",
Bottom = "0mm",
Left = "0mm"
},
PageSize = new DocumentService.PageSize
{
Width = (config.ThumbnaillWidth * 1.5) + "mm", // 192 * 1.5 = "288mm",
Height = (config.ThumbnaillHeight * 1.5) + "mm" // 128 * 1.5 = "192mm"
}
};
var operationResultProgress = DocumentServiceConnector.GetConvertedUri(fileUri, fileExtension, toExtension, docKey, null, thumbnail, spreadsheetLayout, false, out url);
operationResultProgress = Math.Min(operationResultProgress, 100);
return operationResultProgress == 100;
}
private void SaveThumbnail(IFileDao fileDao, File file, string thumbnailUrl)
{
logger.DebugFormat("SaveThumbnail: FileId: {0}. ThumbnailUrl {1}.", file.ID, thumbnailUrl);
var req = (HttpWebRequest)WebRequest.Create(thumbnailUrl);
//HACK: http://ubuntuforums.org/showthread.php?t=1841740
if (WorkContext.IsMono && ServicePointManager.ServerCertificateValidationCallback == null)
{
ServicePointManager.ServerCertificateValidationCallback += (s, c, n, p) => true;
}
using (var stream = new ResponseStream(req.GetResponse()))
{
Crop(fileDao, file, stream);
}
logger.DebugFormat("SaveThumbnail: FileId: {0}. Successfully saved.", file.ID);
}
private bool IsImage(File file)
{
var extension = FileUtility.GetFileExtension(file.Title);
return FileUtility.ExtsImage.Contains(extension);
}
private void CropImage(IFileDao fileDao, File file)
{
logger.DebugFormat("CropImage: FileId: {0}.", file.ID);
using (var stream = fileDao.GetFileStream(file))
{
Crop(fileDao, file, stream);
}
logger.DebugFormat("CropImage: FileId: {0}. Successfully saved.", file.ID);
}
private void Crop(IFileDao fileDao, File file, Stream stream)
{
using (var sourceBitmap = new Bitmap(stream))
{
using (var targetBitmap = GetImageThumbnail(sourceBitmap))
{
using (var targetStream = new MemoryStream())
{
targetBitmap.Save(targetStream, System.Drawing.Imaging.ImageFormat.Png);
fileDao.SaveThumbnail(file, targetStream);
}
}
}
}
private Image GetImageThumbnail(Bitmap sourceBitmap)
{
//bad for small or disproportionate images
//return sourceBitmap.GetThumbnailImage(config.ThumbnaillWidth, config.ThumbnaillHeight, () => false, IntPtr.Zero);
var targetSize = new Size(Math.Min(sourceBitmap.Width, config.ThumbnaillWidth), Math.Min(sourceBitmap.Height, config.ThumbnaillHeight));
var point = new Point(0, 0);
var size = targetSize;
if (sourceBitmap.Width > config.ThumbnaillWidth && sourceBitmap.Height > config.ThumbnaillHeight)
{
if (sourceBitmap.Width > sourceBitmap.Height)
{
var width = (int)(config.ThumbnaillWidth * (sourceBitmap.Height / (1.0 * config.ThumbnaillHeight)));
size = new Size(width, sourceBitmap.Height);
}
else
{
var height = (int)(config.ThumbnaillHeight * (sourceBitmap.Width / (1.0 * config.ThumbnaillWidth)));
size = new Size(sourceBitmap.Width, height);
}
}
if (sourceBitmap.Width > sourceBitmap.Height)
{
point.X = (sourceBitmap.Width - size.Width) / 2;
}
var targetThumbnailSettings = new UserPhotoThumbnailSettings(point, size);
return UserPhotoThumbnailManager.GetBitmap(sourceBitmap, targetSize, targetThumbnailSettings, InterpolationMode.Bilinear);
}
}
}
| 37.080247 | 180 | 0.533877 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | ONLYOFFICE/CommunityServer | module/ASC.Files.ThumbnailBuilder/Builder.cs | 12,016 | C# |
/*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 20220523
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
namespace Org.OpenAPITools.Apis
{
public partial class ContestEffectApi
{
[FunctionName("ContestEffectApi_ContestEffectList")]
public async Task<IActionResult> _ContestEffectList([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/api/v2/contest-effect/")]HttpRequest req, ExecutionContext context)
{
var method = this.GetType().GetMethod("ContestEffectList");
return method != null
? (await ((Task<IActionResult>)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false))
: new StatusCodeResult((int)HttpStatusCode.NotImplemented);
}
[FunctionName("ContestEffectApi_ContestEffectRead")]
public async Task<IActionResult> _ContestEffectRead([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/api/v2/contest-effect/{id}/")]HttpRequest req, ExecutionContext context, int id)
{
var method = this.GetType().GetMethod("ContestEffectRead");
return method != null
? (await ((Task<IActionResult>)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false))
: new StatusCodeResult((int)HttpStatusCode.NotImplemented);
}
}
}
| 39.697674 | 200 | 0.694786 | [
"MIT"
] | cliffano/pokeapi-clients | clients/csharp-netcore-functions/generated/generatedSrc/Functions/ContestEffectApi.cs | 1,707 | C# |
using System.Data.SqlClient;
using System.Threading;
using System.Threading.Tasks;
using ESFA.DC.ILR1819.DataStore.Interface;
using ESFA.DC.ILR1819.DataStore.Model.File;
using ESFA.DC.ILR1819.DataStore.PersistData.Abstract;
namespace ESFA.DC.ILR1819.DataStore.PersistData.Persist
{
public sealed class StoreValidationOutput : AbstractStore, IStoreService<ValidationData>
{
public StoreValidationOutput(IBulkInsert bulkInsert)
: base(bulkInsert)
{
}
public async Task StoreAsync(ValidationData model, SqlConnection sqlConnection, CancellationToken cancellationToken)
{
await _bulkInsert.Insert("dbo.ValidationError", model.ValidationErrors, sqlConnection, cancellationToken);
}
}
}
| 33.391304 | 124 | 0.74349 | [
"MIT"
] | SkillsFundingAgency/DC-ILR-1819-DataStore | src/ESFA.DC.ILR1819.DataStore.PersistData/Persist/StoreValidationOutput.cs | 770 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace M3PlusSimulator {
public class Command {
public int Value;
public int Size;
public bool IsHighDecoder;
public Operation Operation;
public Registrer Registrer;
public Controller Controller;
public delegate void Function(Simulator simulator);
public Function Execute;
public Command Next;
public byte Bytes;
public void CreateFunction() {
if(IsHighDecoder) {
switch(Controller) {
case Controller.JMP:
Execute = delegate(Simulator simulator) {
simulator.NextInstruction = Value;
};
break;
case Controller.JMPC:
Execute = delegate (Simulator simulator) {
if(simulator.Flag_C)
simulator.NextInstruction = Value;
};
break;
case Controller.JMPZ:
Execute = delegate (Simulator simulator) {
if(simulator.Flag_Z)
simulator.NextInstruction = Value;
};
break;
case Controller.CALL:
throw new NotImplementedException();
break;
case Controller.RET:
throw new NotImplementedException();
break;
default:
break;
}
}
}
public string HexString {
get {
return null;
}
}
public byte[] HexArray {
get {
return null;
}
}
public string Description {
get {
string res = "";
if(IsHighDecoder) {
switch(Controller) {
case Controller.JMP:
res += "Pula para o endereço " + Value + " da ROM.";
break;
case Controller.JMPC:
res += "Pula para o endereço " + Value + " da ROM se o flag C estiver ativo.";
break;
case Controller.JMPZ:
res += "Pula para o endereço " + Value + " da ROM se o flag Z estiver ativo.";
break;
case Controller.CALL:
res += "Chama o procedimento no endereço " + Value + " da ROM.";
break;
case Controller.RET:
res += "Retorna do procedimento";
break;
default:
break;
}
} else {
switch(Operation) {
case Operation.ADD:
res += "Executa a operação ADD (adição) entre o acumulador e ";
break;
case Operation.SUB:
res += "Executa a operação SUB (subtração) entre o acumulador e ";
break;
case Operation.AND:
res += "Executa a operação AND (e) entre o acumulador e ";
break;
case Operation.OR:
res += "Executa a operação OR (ou) entre o acumulador e ";
break;
case Operation.XOR:
res += "Executa a operação XOR (ou especial) entre o acumulador e ";
break;
case Operation.NOT:
res += "Executa a operação NOT (não) entre o acumulador e ";
break;
case Operation.MOV:
res += "Executa a operação MOV (move) entre o acumulador e ";
break;
case Operation.INC:
res += "Executa a operação INC (incrementa) no acumulador e envia no";
break;
default:
break;
}
}
return null;
}
}
public static Command Decode(int[] Program, int Begin) {
int Current = Begin;
Command Command = new Command();
Command.Bytes++;
if(Program[Current] == 0x07) {
Current++;
Command.Bytes++;
Command.IsHighDecoder = true;
}
if(Command.IsHighDecoder) {
switch(Program[Current]) {
case 0x00: //ADD DADO,A
break;
case 0x01: //ADD DADO,B
break;
case 0x02: //ADD DADO,#RAM
Command.Bytes++;
break;
case 0x03: //JMP
Command.Bytes++;
break;
case 0x04: //JMPC
Command.Bytes++;
break;
case 0x05: //JMPZ
Command.Bytes++;
break;
case 0x06: //CALL
Command.Bytes++;
break;
case 0x07: //RET
break;
case 0x09: //ADD DADO,C
break;
case 0x11: //ADD DADO,D
break;
case 0x19: //ADD DADO,E
break;
default:
throw new Exception("Programa mal formulado.");
}
} else {
switch(Program[Current]) {
}
}
return Command;
}
}
public enum Operation {
ADD, SUB, AND, OR, XOR, NOT, MOV, INC
}
public enum Registrer {
B_IN1_OUT1, C_IN2_OUT2, D_IN3_OUT3, E_IN4_OUT4
}
public enum Controller {
ACC_ACC_ACC, ACC_ACC_REG, ACC_ACC_RAM, ACC_ACC_OUT, ACC_REG_ACC, ACC_RAM_ACC, ACC_IN_ACC,
ACC_DATA_ACC, ACC_DATA_REG, ACC_DATA_RAM, JMP, JMPC, JMPZ, CALL, RET
}
}
| 36.47027 | 106 | 0.385356 | [
"MIT"
] | jeanklann/M3PlusMicrocontrollerSimulator | SimuladorM3Mais/Command.cs | 6,774 | C# |
using Dapper;
using Database.Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
namespace DapperNetStandard
{
public class Places
{
private const string language = "";
private const string projectId = "";
private readonly string connectionString;
public Places(string connectionString)
{
this.connectionString = connectionString;
}
public async Task<IEnumerable<Place>> SearchAsync(string query)
{
var sql = @"SELECT pl.Name, pl.Description, p.ImageUrl
FROM PlaceLanguages pl
INNER JOIN Places p ON pl.PlaceId = p.PlaceId
WHERE pl.LanguageCode = @language AND p.ProjectId = @projectId
AND (pl.Name LIKE @query OR pl.Description LIKE @query)
ORDER BY pl.[Name]";
using (var conn = new SqlConnection(connectionString))
{
var places = await conn.QueryAsync<Place>(sql, new { language = language, projectId = projectId, query = $"%{query}%" });
return places;
}
}
}
}
| 31.225 | 137 | 0.582866 | [
"MIT"
] | marcominerva/SqlSat707 | DapperNetStandard/Database/Places.cs | 1,251 | C# |
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Emotify.Models;
using Emotify.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
namespace Emotify.Extensions
{
public static class BuiltinExtensions
{
// https://stackoverflow.com/a/14895226/11141271
public static async Task<IList<T>> WhereParallelAsync<T>(
this IEnumerable<T> source,
Func<T, Task<bool>> predicate
)
{
var results = new ConcurrentQueue<T>();
var tasks = source.Select(
async item =>
{
if (await predicate(item))
results.Enqueue(item);
}
);
await Task.WhenAll(tasks);
return results.ToList();
}
public static async Task<IList<T>> WhereAuthorizedAsync<T>(
this IEnumerable<T> source,
ClaimsPrincipal user,
IAuthorizationService authorizationService,
IAuthorizationRequirement requirement
)
{
return await source.WhereParallelAsync(
async item =>
{
var result = await authorizationService.AuthorizeAsync(user, item, requirement);
return result.Succeeded;
}
);
}
public static async Task<IList<T>> ExceptAuthorizedAsync<T>(
this IEnumerable<T> source,
ClaimsPrincipal user,
IAuthorizationService authorizationService,
IAuthorizationRequirement requirement
)
{
return await source.WhereParallelAsync(
async item =>
{
var result = await authorizationService.AuthorizeAsync(user, item, requirement);
return !result.Succeeded;
}
);
}
// public static async Task<IdentityResult> MigrateDataAndDelete(
// this UserHelper userHelper,
// User user,
// EmotifyDbContext context
// )
// {
// var placeholderUser = new User { UserName = "DeletedUser" };
// await userHelper.CreateAsync(placeholderUser);
// IQueryable<UserOwnable>[] toMove = { context.Emotes.AsQueryable(), context.EnrolledGuilds };
// foreach (var items in toMove)
// {
// await items.ForEachAsync(item =>
// {
// item.Owner = placeholderUser;
// item.OwnerUserId = placeholderUser.Id;
// context.Entry(item).State = EntityState.Modified;
// });
// }
//
// await context.SaveChangesAsync();
//
// return await userHelper.DeleteAsync(user);
// }
}
} | 33.793478 | 107 | 0.545513 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | TeamDman/emotify | app/Extensions/BuiltinExtensions.cs | 3,111 | C# |
namespace Stripe
{
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
[JsonConverter(typeof(StringEnumConverter))]
public enum PlanTierUpTo
{
/// <summary>Use this value to define a fallback tier.</summary>
[EnumMember(Value = "inf")]
Inf,
}
}
| 22.6 | 72 | 0.654867 | [
"Apache-2.0"
] | Furysoft/stripe-dotnet | src/Stripe.net/Services/Plans/PlanTierUpTo.cs | 339 | C# |
// Copyright by the contributors to the Dafny Project
// SPDX-License-Identifier: MIT
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using DafnyServer.CounterExampleGeneration;
using Microsoft.Boogie;
namespace DafnyServer {
public class CounterExampleProvider {
private const int maximumCounterexampleDepth = 5;
public const string ModelBvd = "./model.bvd";
public CounterExample LoadCounterModel() {
try {
var models = LoadModelFromFile();
return ConvertModels(models);
} catch (Exception) {
return new CounterExample();
}
}
private static List<DafnyModel> LoadModelFromFile() {
using var wr = new StreamReader(ModelBvd);
var output = wr.ReadToEnd();
var models = ExtractModels(output);
var dafnyModels = BuildModels(models).ToList();
return dafnyModels;
}
private static IEnumerable<DafnyModel> BuildModels(IEnumerable<Model> modelList) {
return modelList.Select(model => new DafnyModel(model));
}
private static List<Model> ExtractModels(string output) {
const string begin = "*** MODEL";
const string end = "*** END_MODEL";
var beginIndex = output.IndexOf(begin, StringComparison.Ordinal);
var endIndex = output.IndexOf(end, StringComparison.Ordinal);
if (beginIndex == -1 || endIndex == -1) {
return new List<Model>();
}
var modelString = output.Substring(beginIndex, endIndex + end.Length - beginIndex);
var models = Model.ParseModels(new StringReader(modelString));
return models;
}
private CounterExample ConvertModels(List<DafnyModel> specificModels) {
foreach (var dafnyModel in specificModels) {
var counterExample = new CounterExample();
foreach (var state in dafnyModel.States) {
if (state == null) continue;
var counterExampleState = new CounterExampleState {
Name = state.FullStateName
};
AddLineInformation(counterExampleState, state.FullStateName);
var vars = state.ExpandedVariableSet(maximumCounterexampleDepth);
foreach (var variableNode in vars) {
counterExampleState.Variables.Add(new CounterExampleVariable {
Name = variableNode.ShortName,
Value = variableNode.Value,
// CanonicalName is same as Value now but keeping this for legacy
CanonicalName = variableNode.Value
});
}
var index = counterExample.States.FindIndex(c => c.Column == counterExampleState.Column && c.Line == counterExampleState.Line);
if (index != -1) {
counterExample.States[index] = counterExampleState;
} else {
counterExample.States.Add(counterExampleState);
}
}
return counterExample;
}
return new CounterExample();
}
private static void AddLineInformation(CounterExampleState state, string stateCapturedStateName) {
if ("<initial>".Equals(stateCapturedStateName)) {
state.Line = 0;
state.Column = 0;
return;
}
var regex = ".*?(dfy)(\\()(\\d+)(,)(\\d+)(\\))";
var r = new Regex(regex, RegexOptions.IgnoreCase | RegexOptions.Singleline);
var m = r.Match(stateCapturedStateName);
if (m.Success) {
var lineStr = m.Groups[3].ToString();
state.Line = int.Parse(lineStr);
var columnStr = m.Groups[5].ToString();
state.Column = int.Parse(columnStr);
}
}
[Serializable]
[DataContract]
public class CounterExample {
[DataMember]
public List<CounterExampleState> States { get; set; }
public CounterExample() {
States = new List<CounterExampleState>();
}
}
[Serializable]
[DataContract]
public class CounterExampleState {
[DataMember]
public List<CounterExampleVariable> Variables { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public int Line { get; set; }
[DataMember]
public int Column { get; set; }
public CounterExampleState() {
Variables = new List<CounterExampleVariable>();
}
}
[Serializable]
[DataContract]
public class CounterExampleVariable {
[DataMember]
public string Name { get; set; }
[DataMember]
public string RealName { get; set; }
[DataMember]
public string Value { get; set; }
[DataMember]
public string CanonicalName { get; set; }
}
}
} | 31.567568 | 137 | 0.636986 | [
"MIT"
] | UnknownGuardian/dafny | Source/DafnyServer/CounterExampleProvider.cs | 4,674 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using LiteNetLib.Utils;
namespace BeatTogether.DedicatedServer.Messaging.Abstractions
{
public interface IPacketRegistry
{
/// <summary>
/// Retrieves the identifiers of all registered packets.
/// </summary>
/// <returns>The identifiers of all registered packets.</returns>
IReadOnlyDictionary<Type, IEnumerable<byte>> GetAllPacketIds();
/// <summary>
/// Retrieves the identifiers associated with the packet
/// of the given <see cref="Type"/>.
/// </summary>
/// <param name="type">The <see cref="Type"/> of packet.</param>
/// <returns>The identifiers associated with the packet.</returns>
IEnumerable<byte> GetPacketIds(Type type);
/// <summary>
/// Retrieves the identifiers associated with the packet of type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of packet.</typeparam>
/// <returns>The identifiers associated with the packet.</returns>
IEnumerable<byte> GetPacketIds<T>()
where T : class, INetSerializable;
/// <summary>
/// Retrieves the <see cref="Type"/> of the packet
/// associated with the given <paramref name="packetId"/>.
/// </summary>
/// <param name="packetId">
/// The identifier associated with the packet.
/// This must be castable to a <see cref="byte"/>.
/// </param>
/// <returns>The <see cref="Type"/> object of the packet.</returns>
Type GetPacketType(object packetId);
/// <summary>
/// Retrieves the <see cref="IPacketRegistry"/> instance
/// associated with the given <paramref name="packetRegistryId"/>.
/// </summary>
/// <param name="packetRegistryId">
/// The identifier associated with the sub packet registry.
/// This must be castable to a <see cref="byte"/>.
/// </param>
/// <returns>The <see cref="IPacketRegistry"/> instance associated with the given identifier.</returns>
IPacketRegistry GetSubPacketRegistry(object packetRegistryId);
/// <summary>
/// Creates a new instance of the packet associated with the given <paramref name="packetId"/>.
/// </summary>
/// <param name="packetId">
/// The identifier associated with the packet.
/// This must be castable to a <see cref="byte"/>.
/// </param>
/// <returns>The packet instance.</returns>
INetSerializable CreatePacket(object packetId);
/// <summary>
/// Retrieves the identifiers associated with the packet
/// of the given <see cref="Type"/>.
/// </summary>
/// <param name="type">The <see cref="Type"/> of packet.</param>
/// <param name="packetIds">The identifiers associated with the packet.</param>
/// <returns>
/// <see langword="true"/> when the <paramref name="packetIds"/> were retrieved successfully;
/// <see langword="false"/> otherwise.
/// </returns>
bool TryGetPacketIds(Type type, [MaybeNullWhen(false)] out IEnumerable<byte> packetIds);
/// <summary>
/// Retrieves the identifiers associated with the packet of type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of packet.</typeparam>
/// <param name="packetIds">The identifiers associated with the packet.</param>
/// <returns>
/// <see langword="true"/> when the <paramref name="packetIds"/> were retrieved successfully;
/// <see langword="false"/> otherwise.
/// </returns>
bool TryGetPacketIds<T>([MaybeNullWhen(false)] out IEnumerable<byte> packetIds)
where T : class, INetSerializable;
/// <summary>
/// Retrieves the <see cref="Type"/> of the packet
/// associated with the given <paramref name="packetId"/>.
/// </summary>
/// <param name="packetId">
/// The identifier associated with the packet.
/// This must be castable to a <see cref="byte"/>.
/// </param>
/// <param name="type">The <see cref="Type"/> object of the packet.</param>
/// <returns>
/// <see langword="true"/> when the <paramref name="type"/> was retrieved successfully;
/// <see langword="false"/> otherwise.</returns>
bool TryGetPacketType(object packetId, [MaybeNullWhen(false)] out Type type);
/// <summary>
/// Retrieves the <see cref="IPacketRegistry"/> instance
/// associated with the given <paramref name="packetRegistryId"/>.
/// </summary>
/// <param name="packetRegistryId">
/// The identifier associated with the sub packet registry.
/// This must be castable to a <see cref="byte"/>.
/// </param>
/// <param name="packetRegistry">
/// The <see cref="IPacketRegistry"/> instance
/// associated with the given identifier.
/// </param>
/// <returns>
/// <see langword="true"/> when the <paramref name="packetRegistry"/> was retrieved successfully;
/// <see langword="false"/> otherwise.</returns>
bool TryGetSubPacketRegistry(object packetRegistryId, [MaybeNullWhen(false)] out IPacketRegistry packetRegistry);
/// <summary>
/// Creates a new instance of the packet associated with the given <paramref name="packetId"/>.
/// </summary>
/// <param name="packetId">
/// The identifier associated with the packet.
/// This must be castable to a <see cref="uint"/>.
/// </param>
/// <param name="packet">The packet instance.</param>
/// <returns>
/// <see langword="true"/> when the <paramref name="packet"/> was created successfully;
/// <see langword="false"/> otherwise.
/// </returns>
bool TryCreatePacket(object packetId, [MaybeNullWhen(false)] out INetSerializable packet);
}
}
| 45.619403 | 121 | 0.601014 | [
"MIT"
] | pythonology/BeatTogether.DedicatedServer | BeatTogether.DedicatedServer.Messaging/Abstractions/IPacketRegistry.cs | 6,115 | C# |
using UnityEngine;
namespace com.liteninja.soa.Events
{
[CreateAssetMenu(
fileName = "TransformEvent",
menuName = SOAConsts.MenuNameBase + "/Events/Transform Event",
order = SOAConsts.MenuOrderUnityObjectEvent + 3
)]
public class TransformEvent : AEvent<Transform>
{
}
}
| 22.642857 | 70 | 0.66877 | [
"MIT"
] | sponticelli/LiteNinja-ScriptableObjectArchitecture | Runtime/Events/TransformEvent.cs | 319 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Automation
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Extension methods for DscNodeConfigurationOperations.
/// </summary>
public static partial class DscNodeConfigurationOperationsExtensions
{
/// <summary>
/// Delete the Dsc node configurations by node configuration.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='nodeConfigurationName'>
/// The Dsc node configuration name.
/// </param>
public static void Delete(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName)
{
operations.DeleteAsync(resourceGroupName, automationAccountName, nodeConfigurationName).GetAwaiter().GetResult();
}
/// <summary>
/// Delete the Dsc node configurations by node configuration.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='nodeConfigurationName'>
/// The Dsc node configuration name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
/// <summary>
/// Retrieve the Dsc node configurations by node configuration.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='nodeConfigurationName'>
/// The Dsc node configuration name.
/// </param>
public static DscNodeConfiguration Get(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName)
{
return operations.GetAsync(resourceGroupName, automationAccountName, nodeConfigurationName).GetAwaiter().GetResult();
}
/// <summary>
/// Retrieve the Dsc node configurations by node configuration.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='nodeConfigurationName'>
/// The Dsc node configuration name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<DscNodeConfiguration> GetAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Create the node configuration identified by node configuration name.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='nodeConfigurationName'>
/// The create or update parameters for configuration.
/// </param>
/// <param name='parameters'>
/// The create or update parameters for configuration.
/// </param>
public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters)
{
return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters).GetAwaiter().GetResult();
}
/// <summary>
/// Create the node configuration identified by node configuration name.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='nodeConfigurationName'>
/// The create or update parameters for configuration.
/// </param>
/// <param name='parameters'>
/// The create or update parameters for configuration.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<DscNodeConfiguration> CreateOrUpdateAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Retrieve a list of dsc node configurations.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='filter'>
/// The filter to apply on the operation.
/// </param>
public static IPage<DscNodeConfiguration> ListByAutomationAccount(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string))
{
return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, filter).GetAwaiter().GetResult();
}
/// <summary>
/// Retrieve a list of dsc node configurations.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The resource group name.
/// </param>
/// <param name='automationAccountName'>
/// The automation account name.
/// </param>
/// <param name='filter'>
/// The filter to apply on the operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<DscNodeConfiguration>> ListByAutomationAccountAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, filter, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Retrieve a list of dsc node configurations.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<DscNodeConfiguration> ListByAutomationAccountNext(this IDscNodeConfigurationOperations operations, string nextPageLink)
{
return operations.ListByAutomationAccountNextAsync(nextPageLink).GetAwaiter().GetResult();
}
/// <summary>
/// Retrieve a list of dsc node configurations.
/// <see href="http://aka.ms/azureautomationsdk/dscnodeconfigurations" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<DscNodeConfiguration>> ListByAutomationAccountNextAsync(this IDscNodeConfigurationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
}
}
| 49.918288 | 336 | 0.595136 | [
"MIT"
] | AzureAutomationTeam/azure-sdk-for-net | src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperationsExtensions.cs | 12,829 | C# |
using Microsoft.EntityFrameworkCore.Migrations;
namespace PoolDays.Migrations
{
public partial class AddComments : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CommentId",
table: "Pools",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "CommentId",
table: "Jacuzzies",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "Comments",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Text = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: true),
ProductRankting = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Comments", x => x.Id);
table.ForeignKey(
name: "FK_Comments_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "CommentJacuzzi",
columns: table => new
{
CommentsId = table.Column<int>(type: "int", nullable: false),
JacuzzisId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CommentJacuzzi", x => new { x.CommentsId, x.JacuzzisId });
table.ForeignKey(
name: "FK_CommentJacuzzi_Comments_CommentsId",
column: x => x.CommentsId,
principalTable: "Comments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CommentJacuzzi_Jacuzzies_JacuzzisId",
column: x => x.JacuzzisId,
principalTable: "Jacuzzies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CommentPool",
columns: table => new
{
CommentsId = table.Column<int>(type: "int", nullable: false),
PoolsId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CommentPool", x => new { x.CommentsId, x.PoolsId });
table.ForeignKey(
name: "FK_CommentPool_Comments_CommentsId",
column: x => x.CommentsId,
principalTable: "Comments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CommentPool_Pools_PoolsId",
column: x => x.PoolsId,
principalTable: "Pools",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CommentJacuzzi_JacuzzisId",
table: "CommentJacuzzi",
column: "JacuzzisId");
migrationBuilder.CreateIndex(
name: "IX_CommentPool_PoolsId",
table: "CommentPool",
column: "PoolsId");
migrationBuilder.CreateIndex(
name: "IX_Comments_UserId",
table: "Comments",
column: "UserId",
unique: true,
filter: "[UserId] IS NOT NULL");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CommentJacuzzi");
migrationBuilder.DropTable(
name: "CommentPool");
migrationBuilder.DropTable(
name: "Comments");
migrationBuilder.DropColumn(
name: "CommentId",
table: "Pools");
migrationBuilder.DropColumn(
name: "CommentId",
table: "Jacuzzies");
}
}
}
| 38.618321 | 100 | 0.464519 | [
"MIT"
] | IvanGIvanov/ASP.NET-Core-PoolDays | PoolDays/Migrations/20210812134817_AddComments.cs | 5,061 | C# |
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using RestSharp;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Org.OpenAPITools.Api
{
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IStoreApi : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns></returns>
void DeleteOrder (string orderId);
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
/// <summary>
/// Returns pet inventories by status
/// </summary>
/// <remarks>
/// Returns a map of status codes to quantities
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Dictionary<string, int?></returns>
Dictionary<string, int?> GetInventory ();
/// <summary>
/// Returns pet inventories by status
/// </summary>
/// <remarks>
/// Returns a map of status codes to quantities
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of Dictionary<string, int?></returns>
ApiResponse<Dictionary<string, int?>> GetInventoryWithHttpInfo ();
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Order</returns>
Order GetOrderById (long? orderId);
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>ApiResponse of Order</returns>
ApiResponse<Order> GetOrderByIdWithHttpInfo (long? orderId);
/// <summary>
/// Place an order for a pet
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
Order PlaceOrder (Order body);
/// <summary>
/// Place an order for a pet
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
#endregion Synchronous Operations
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public partial class StoreApi : IStoreApi
{
private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
/// <summary>
/// Initializes a new instance of the <see cref="StoreApi"/> class.
/// </summary>
/// <returns></returns>
public StoreApi(String basePath)
{
this.Configuration = new Org.OpenAPITools.Client.Configuration { BasePath = basePath };
ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="StoreApi"/> class
/// </summary>
/// <returns></returns>
public StoreApi()
{
this.Configuration = Org.OpenAPITools.Client.Configuration.Default;
ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="StoreApi"/> class
/// using Configuration object
/// </summary>
/// <param name="configuration">An instance of Configuration</param>
/// <returns></returns>
public StoreApi(Org.OpenAPITools.Client.Configuration configuration = null)
{
if (configuration == null) // use the default one in Configuration
this.Configuration = Org.OpenAPITools.Client.Configuration.Default;
else
this.Configuration = configuration;
ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Gets the base path of the API client.
/// </summary>
/// <value>The base path</value>
public String GetBasePath()
{
return this.Configuration.ApiClient.RestClient.BaseUrl.ToString();
}
/// <summary>
/// Sets the base path of the API client.
/// </summary>
/// <value>The base path</value>
[Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
public void SetBasePath(String basePath)
{
// do nothing
}
/// <summary>
/// Gets or sets the configuration object
/// </summary>
/// <value>An instance of the Configuration</value>
public Org.OpenAPITools.Client.Configuration Configuration {get; set;}
/// <summary>
/// Provides a factory method hook for the creation of exceptions.
/// </summary>
public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
{
get
{
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
{
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
}
return _exceptionFactory;
}
set { _exceptionFactory = value; }
}
/// <summary>
/// Gets the default header.
/// </summary>
/// <returns>Dictionary of HTTP header</returns>
[Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
public IDictionary<String, String> DefaultHeader()
{
return new Dictionary<string, string>(this.Configuration.DefaultHeader);
}
/// <summary>
/// Add default header.
/// </summary>
/// <param name="key">Header field name.</param>
/// <param name="value">Header field value.</param>
/// <returns></returns>
[Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
public void AddDefaultHeader(string key, string value)
{
this.Configuration.AddDefaultHeader(key, value);
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns></returns>
public void DeleteOrder (string orderId)
{
DeleteOrderWithHttpInfo(orderId);
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("order_id", this.Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("DeleteOrder", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Dictionary<string, int?></returns>
public Dictionary<string, int?> GetInventory ()
{
ApiResponse<Dictionary<string, int?>> localVarResponse = GetInventoryWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of Dictionary<string, int?></returns>
public ApiResponse< Dictionary<string, int?> > GetInventoryWithHttpInfo ()
{
var localVarPath = "/store/inventory";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// authentication (api_key) required
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = this.Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("GetInventory", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(Dictionary<string, int?>) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary<string, int?>)));
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Order</returns>
public Order GetOrderById (long? orderId)
{
ApiResponse<Order> localVarResponse = GetOrderByIdWithHttpInfo(orderId);
return localVarResponse.Data;
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>ApiResponse of Order</returns>
public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("order_id", this.Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("GetOrderById", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Order>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
/// <summary>
/// Place an order for a pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
public Order PlaceOrder (Order body)
{
ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(body);
return localVarResponse.Data;
}
/// <summary>
/// Place an order for a pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
var localVarPath = "/store/order";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("PlaceOrder", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Order>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
}
}
| 46.231707 | 159 | 0.625605 | [
"Apache-2.0"
] | DABH/openapi-generator | samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/StoreApi.cs | 22,746 | C# |
using System;
using Automated.Arca.Abstractions.Core;
using Automated.Arca.Abstractions.Specialized;
using Automated.Arca.Attributes.Specialized;
namespace Automated.Arca.Extensions.Specialized
{
public class ExtensionForDomainEventHandlerAttribute : ExtensionForSpecializedAttribute
{
public override Type AttributeType => typeof( DomainEventHandlerAttribute );
public ExtensionForDomainEventHandlerAttribute( IExtensionDependencyProvider extensionDependencyProvider )
: base( extensionDependencyProvider )
{
}
public override void Register( IRegistrationContext context, ProcessableAttribute attribute, Type typeWithAttribute )
{
D.R.InstantiatePerScope( typeWithAttribute, false );
}
public override void Configure( IConfigurationContext context, ProcessableAttribute attribute, Type typeWithAttribute )
{
var attributeTyped = (DomainEventHandlerAttribute)attribute;
var eventRegistry = D.P.GetRequiredInstance<IDomainEventRegistry>();
var eventHandlerRegistry = D.P.GetRequiredInstance<IDomainEventHandlerRegistry>();
eventRegistry.Add( attributeTyped.EventIdentifier, attributeTyped.EventType );
eventHandlerRegistry.Add( attributeTyped.EventStreamIdentifier, typeWithAttribute );
}
}
}
| 36.558824 | 121 | 0.820595 | [
"MIT"
] | georgehara/Arca | Automated.Arca.Extensions.Specialized/ExtensionForDomainEventHandlerAttribute.cs | 1,245 | C# |
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using Xunit;
namespace Frends.File.Tests
{
public class UnitTest : FileTestBase
{
public UnitTest()
{
TestFileContext.CreateFiles(
"folder/foo/sub/test.xml",
"folder/bar/sub/example.xml");
}
[Fact]
public void FileDeleteWithPatternMatching()
{
var results = File.Delete(
new DeleteInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/*.xml"
},
new DeleteOption() { },
CancellationToken.None);
Assert.Equal(2, results.Count);
}
[Fact]
public void FileDeleteShouldNotThrowIfNoFilesFound()
{
var results = File.Delete(
new DeleteInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/*.unknown"
},
new DeleteOption() { },
CancellationToken.None);
Assert.Empty(results);
}
[Fact]
public async Task FileMoveOverWrite()
{
const string contentForFileToBeOverwritten = "firstFile";
TestFileContext.CreateFile("folder/test.xml", contentForFileToBeOverwritten);
var createdFile = System.IO.File.ReadAllText(Path.Combine(TestFileContext.RootPath, "folder/test.xml"));
Assert.Equal(contentForFileToBeOverwritten, createdFile);
var results = await File.Move(
new MoveInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/sub/*.xml",
TargetDirectory = Path.Combine(TestFileContext.RootPath, "folder")
},
new MoveOptions()
{
IfTargetFileExists = FileExistsAction.Overwrite
},
CancellationToken.None);
var overWrittenFIle = System.IO.File.ReadAllText(Path.Combine(TestFileContext.RootPath, "folder/test.xml"));
Assert.NotEqual(contentForFileToBeOverwritten, overWrittenFIle);
Assert.Equal(2, results.Count);
var destinationFilesLength = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder")).Length;
Assert.Equal(2, destinationFilesLength);
var secondMoveShouldBeEmpty = await File.Move(
new MoveInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/sub/*.xml",
TargetDirectory = Path.Combine(TestFileContext.RootPath, "folder")
},
new MoveOptions()
{
IfTargetFileExists = FileExistsAction.Overwrite
},
CancellationToken.None);
Assert.Empty(secondMoveShouldBeEmpty);
}
[Fact]
public async Task FileMoveCopy()
{
const string contentForOriginalFile = "firstFile";
TestFileContext.CreateFile("folder/test.xml", contentForOriginalFile);
var results = await File.Move(
new MoveInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/sub/*.xml",
TargetDirectory = Path.Combine(TestFileContext.RootPath, "folder")
},
new MoveOptions() { IfTargetFileExists = FileExistsAction.Rename },
CancellationToken.None);
Assert.Equal(2, results.Count);
var originalFile = System.IO.File.ReadAllText(Path.Combine(TestFileContext.RootPath, "folder\\test.xml"));
var copiedFile = System.IO.File.ReadAllText(Path.Combine(TestFileContext.RootPath, "folder\\test(1).xml"));
Assert.Equal(contentForOriginalFile, originalFile);
Assert.StartsWith("Automatically generated for testing on", copiedFile);
var destinationFilesLength = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder")).Length;
Assert.Equal(3, destinationFilesLength);
var secondMoveShouldBeEmpty = await File.Move(
new MoveInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/sub/*.xml",
TargetDirectory = Path.Combine(TestFileContext.RootPath, "folder")
},
new MoveOptions() { IfTargetFileExists = FileExistsAction.Rename },
CancellationToken.None);
Assert.Empty(secondMoveShouldBeEmpty);
}
[Fact]
public async Task FileMoveThrowShouldThrowIfFIleExistsAtDestination()
{
const string contentForOriginalFile = "firstFile";
TestFileContext.CreateFile("folder/test.xml", contentForOriginalFile);
var ex = await Assert.ThrowsAsync<IOException>(async () => await File.Move(
new MoveInput()
{
Directory = TestFileContext.RootPath,
Pattern = "**/sub/*.xml",
TargetDirectory = Path.Combine(TestFileContext.RootPath, "folder")
},
new MoveOptions()
{
IfTargetFileExists = FileExistsAction.Throw
},
CancellationToken.None));
Assert.Equal($"File '{Path.Combine(TestFileContext.RootPath, "folder\\test.xml")}' already exists. No files moved.", ex.Message);
var originalFile = System.IO.File.ReadAllText(Path.Combine(TestFileContext.RootPath, "folder\\test.xml"));
Assert.Equal(contentForOriginalFile, originalFile);
var destinationFilesLength = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder"));
Assert.Single(destinationFilesLength);
var sourceFolder1 = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder/foo/sub/"));
Assert.Single(sourceFolder1);
var sourceFolder2 = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder/bar/sub/"));
Assert.Single(sourceFolder2);
}
[Fact]
public void RenameFile()
{
var resultsOverWrite = File.Rename(
new RenameInput()
{
Path = Path.Combine(TestFileContext.RootPath, "folder/foo/sub/test.xml"),
NewFileName = "newTest.xml"
},
new RenameOption()
{
RenameBehaviour = FileExistsAction.Overwrite
});
Assert.Equal(Path.Combine(TestFileContext.RootPath, "folder\\foo\\sub\\newTest.xml"), resultsOverWrite.Path);
var resultsCopy = File.Rename(
new RenameInput()
{
Path = Path.Combine(TestFileContext.RootPath, "folder/foo/sub/newTest.xml"),
NewFileName = "newTest.xml"
},
new RenameOption()
{
RenameBehaviour = FileExistsAction.Rename
});
Assert.Equal(Path.Combine(TestFileContext.RootPath, "folder\\foo\\sub\\newTest(1).xml"), resultsCopy.Path);
var results = File.Rename(
new RenameInput()
{
Path = Path.Combine(TestFileContext.RootPath, "folder/foo/sub/newTest(1).xml"),
NewFileName = "newTest.xml"
},
new RenameOption()
{
RenameBehaviour = FileExistsAction.Throw
});
Assert.Equal(Path.Combine(TestFileContext.RootPath, "folder\\foo\\sub\\newTest.xml"), results.Path);
var folderFiles = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder/foo/sub/"));
Assert.Single(folderFiles);
TestFileContext.CreateFile("folder/foo/sub/throwTest.xml", "temp");
var ex = Assert.Throws<IOException>(() => File.Rename(
new RenameInput()
{
Path = Path.Combine(TestFileContext.RootPath, "folder/foo/sub/newTest.xml"),
NewFileName = "throwTest.xml"
},
new RenameOption()
{
RenameBehaviour = FileExistsAction.Throw
}));
Assert.Contains("throwTest.xml", ex.Message);
folderFiles = Directory.GetFiles(Path.Combine(TestFileContext.RootPath, "folder/foo/sub/"));
Assert.Equal(2, folderFiles.Length);
}
[Fact]
public void FindFiles()
{
TestFileContext.CreateFiles("folder/foo/test.txt",
"folder/foo/sub/test3.txt",
"folder/foo/sub/test.txt",
"folder/bar/sub/example2.json");
var results = File.Find(new FindInput() { Directory = TestFileContext.RootPath, Pattern = "**/*.xml" }, new FindOption());
Assert.Equal(2, results.Count);
Assert.True(results.All(x => x.Extension.Equals(".xml")));
}
[Fact]
public void FindFilesShouldThrowIfFolderNotExist()
{
var ex = Assert.Throws<Exception>(() => File.Find(
new FindInput()
{
Directory = "DoesNotExist",
Pattern = "**.*"
},
new FindOption()));
Assert.Contains("Directory does not exist or you do not have read access", ex.Message);
}
[Fact]
public async Task WriteFileAppend()
{
TestFileContext.CreateFile("test.txt", "old content");
var result = await File.Write(
new WriteInput()
{
Content = "new content",
Path = Path.Combine(TestFileContext.RootPath, "test.txt")
},
new WriteOption()
{
WriteBehaviour = WriteBehaviour.Append
});
var fileContent = System.IO.File.ReadAllText(result.Path);
Assert.Equal("old contentnew content", fileContent);
}
[Fact]
public async Task WriteFileOverWrite()
{
TestFileContext.CreateFile("test.txt", "old content");
var result = await File.Write(
new WriteInput()
{
Content = "new content",
Path = Path.Combine(TestFileContext.RootPath, "test.txt")
},
new WriteOption()
{
WriteBehaviour = WriteBehaviour.Overwrite
});
var fileContent = System.IO.File.ReadAllText(result.Path);
Assert.Equal("new content", fileContent);
}
[Fact]
public async Task WriteFileThrow()
{
TestFileContext.CreateFile("test.txt", "old content");
var ex = await Assert.ThrowsAsync<IOException>(async () => await File.Write(
new WriteInput()
{
Content = "new content",
Path = Path.Combine(TestFileContext.RootPath, "test.txt")
},
new WriteOption()
{
WriteBehaviour = WriteBehaviour.Throw
}));
var fileContent = System.IO.File.ReadAllText(Path.Combine(TestFileContext.RootPath, "test.txt"));
Assert.Equal("old content", fileContent);
Assert.Equal($"File already exists: {Path.Combine(TestFileContext.RootPath, "test.txt")}", ex.Message);
}
[Fact]
public async Task WriteFileBytesAppend()
{
var imageBytes = System.IO.File.ReadAllBytes(BinaryTestFilePath);
TestFileContext.CreateBinaryFile("test.png", new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 }); // empty png
var result = await File.WriteBytes(
new WriteBytesInput()
{
ContentBytes = imageBytes,
Path = Path.Combine(TestFileContext.RootPath, "test.png")
},
new WriteBytesOption()
{
WriteBehaviour = WriteBehaviour.Append
});
var fileContentBytes = System.IO.File.ReadAllBytes(result.Path);
Assert.Equal(8 + imageBytes.Length, fileContentBytes.Length);
}
[Fact]
public async Task WriteFileBytesOverwrite()
{
var imageBytes = System.IO.File.ReadAllBytes(BinaryTestFilePath);
TestFileContext.CreateBinaryFile("test.png", new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 }); // empty png
var result = await File.WriteBytes(
new WriteBytesInput()
{
ContentBytes = imageBytes,
Path = Path.Combine(TestFileContext.RootPath, "test.png")
},
new WriteBytesOption()
{
WriteBehaviour = WriteBehaviour.Overwrite
});
var fileContentBytes = System.IO.File.ReadAllBytes(result.Path);
Assert.Equal(imageBytes.Length, fileContentBytes.Length);
Assert.Equal(imageBytes, fileContentBytes);
}
[Fact]
public async Task WriteFileBytesThrow()
{
var imageBytes = System.IO.File.ReadAllBytes(BinaryTestFilePath);
TestFileContext.CreateBinaryFile("test.png", new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 }); // empty png
var result = await File.WriteBytes(
new WriteBytesInput()
{
ContentBytes = imageBytes,
Path = Path.Combine(TestFileContext.RootPath, "test.png")
},
new WriteBytesOption()
{
WriteBehaviour = WriteBehaviour.Overwrite
});
var fileContentBytes = System.IO.File.ReadAllBytes(result.Path);
Assert.Equal(imageBytes.Length, fileContentBytes.Length);
Assert.Equal(imageBytes, fileContentBytes);
}
[Fact]
public async Task ReadFileContent()
{
var fileContent = "Well this is content with some extra nice ümlauts: ÄÖåå 你好!";
TestFileContext.CreateFile("Folder/test.txt", fileContent);
var result = await File.Read(new ReadInput() { Path = Path.Combine(TestFileContext.RootPath, "folder/test.txt") }, new ReadOption() { });
Assert.Equal(fileContent, result.Content);
}
[Fact]
public async Task ReadFileContentBytes()
{
var result = await File.ReadBytes(new ReadInput() { Path = BinaryTestFilePath }, new ReadBytesOption() { });
var expectedData = System.IO.File.ReadAllBytes(BinaryTestFilePath);
Assert.Equal(expectedData.Length, result.ContentBytes.Length);
Assert.Equal(expectedData, result.ContentBytes);
}
[Fact]
public async Task WriteReadFileWithLatin1()
{
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestFiles/ansi.txt"); //ansi is Latin1 here
var res = await File.Read(
new ReadInput()
{
Path = path
},
new ReadOption()
{
FileEncoding = FileEncoding.Other,
EncodingInString = "Latin1"
});
var result = await File.Write(new WriteInput() { Content = res.Content, Path = Path.Combine(TestFileContext.RootPath, "test.txt") }, new WriteOption() { FileEncoding = FileEncoding.Other, EncodingInString = "Latin1", WriteBehaviour = WriteBehaviour.Append });
var fileContent = System.IO.File.ReadAllText(result.Path); //Without encoding it will use UTF-8 and the text will be scrambled
Assert.NotEqual("ÅÖÄåöÄ", fileContent);
fileContent = System.IO.File.ReadAllText(result.Path, Encoding.GetEncoding("Latin1"));
Assert.Equal("ÅÖÄåöä", fileContent);
}
[Fact]
public async Task WriteReadFileWithUtf8NoBom()
{
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestFiles/utf8nobom.txt");
var res = await File.Read(
new ReadInput()
{
Path = path
},
new ReadOption()
{
FileEncoding = FileEncoding.UTF8,
EnableBom = false
});
var result = await File.Write(
new WriteInput()
{
Content = res.Content,
Path = Path.Combine(TestFileContext.RootPath, "test.txt")
},
new WriteOption()
{
FileEncoding = FileEncoding.UTF8,
EnableBom = false
});
var fileContent = System.IO.File.ReadAllText(result.Path, Encoding.UTF8);
Assert.Equal("ÅÖÄåöä", fileContent);
}
private static string BinaryTestFilePath => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestFiles/frends_favicon.png");
}
}
| 39.106987 | 271 | 0.540562 | [
"MIT"
] | FrendsPlatform/Frends.File | Frends.File.Tests/UnitTest.cs | 17,940 | C# |
#region copyright
// Copyright 2015 Habart Thierry
//
// 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
using Microsoft.EntityFrameworkCore;
using SimpleIdentityServer.EF.Models;
namespace SimpleIdentityServer.EF.Mappings
{
public static class ConsentScopeMapping
{
public static void AddConsentScopeMapping(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<ConsentScope>()
.ToTable("consentScopes")
.HasKey(c => new { c.ConsentId, c.ScopeName });
}
}
}
| 33.125 | 81 | 0.710377 | [
"Apache-2.0"
] | appkins/SimpleIdentityServer | SimpleIdentityServer/src/Apis/SimpleIdServer/SimpleIdentityServer.EF/Mappings/ConsentScopeMapping.cs | 1,062 | C# |
namespace Shopping.Aggregator.Models {
public class BasketItemExtendedModel {
public int Quantity { get; set; }
public string Color { get; set; }
public decimal Price { get; set; }
public string ProductId { get; set; }
public string ProductName { get; set; }
//Product Related Additional Fields
public string Category { get; set; }
public string Summary { get; set; }
public string Description { get; set; }
public string ImageFile { get; set; }
}
} | 38.428571 | 47 | 0.613383 | [
"MIT"
] | mertKarasakal/AspnetMicroservices | src/ApiGateways/Shopping.Aggregator/Models/BasketItemExtendedModel.cs | 540 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using AsmResolver.Collections;
using AsmResolver.DotNet.Builder;
using AsmResolver.DotNet.Collections;
using AsmResolver.DotNet.Serialized;
using AsmResolver.DotNet.Signatures;
using AsmResolver.PE;
using AsmResolver.PE.Builder;
using AsmResolver.PE.DotNet;
using AsmResolver.PE.DotNet.Builder;
using AsmResolver.PE.DotNet.Metadata.Tables;
using AsmResolver.PE.DotNet.Metadata.Tables.Rows;
using AsmResolver.PE.File;
namespace AsmResolver.DotNet
{
/// <summary>
/// Represents an assembly of self-describing modules of an executable file hosted by a common language runtime (CLR).
/// </summary>
public class AssemblyDefinition : AssemblyDescriptor, IHasSecurityDeclaration
{
private IList<ModuleDefinition> _modules;
private IList<SecurityDeclaration> _securityDeclarations;
private readonly LazyVariable<byte[]> _publicKey;
private byte[] _publicKeyToken;
/// <summary>
/// Reads a .NET assembly from the provided input buffer.
/// </summary>
/// <param name="buffer">The raw contents of the executable file to load.</param>
/// <returns>The module.</returns>
/// <exception cref="BadImageFormatException">Occurs when the image does not contain a valid .NET metadata directory.</exception>
public static AssemblyDefinition FromBytes(byte[] buffer) =>
FromImage(PEImage.FromBytes(buffer));
/// <summary>
/// Reads a .NET assembly from the provided input file.
/// </summary>
/// <param name="filePath">The file path to the input executable to load.</param>
/// <returns>The module.</returns>
/// <exception cref="BadImageFormatException">Occurs when the image does not contain a valid .NET metadata directory.</exception>
public static AssemblyDefinition FromFile(string filePath) =>
FromImage(PEImage.FromFile(filePath), new ModuleReaderParameters(Path.GetDirectoryName(filePath)));
/// <summary>
/// Reads a .NET assembly from the provided input file.
/// </summary>
/// <param name="file">The portable executable file to load.</param>
/// <returns>The module.</returns>
/// <exception cref="BadImageFormatException">Occurs when the image does not contain a valid .NET metadata directory.</exception>
public static AssemblyDefinition FromFile(PEFile file) =>
FromImage(PEImage.FromFile(file));
/// <summary>
/// Reads a .NET assembly from an input stream.
/// </summary>
/// <param name="reader">The input stream pointing at the beginning of the executable to load.</param>
/// <param name="mode">Indicates the input PE is mapped or unmapped.</param>
/// <returns>The module.</returns>
/// <exception cref="BadImageFormatException">Occurs when the image does not contain a valid .NET metadata directory.</exception>
public static AssemblyDefinition FromReader(IBinaryStreamReader reader, PEMappingMode mode = PEMappingMode.Unmapped) =>
FromImage(PEImage.FromReader(reader, mode));
/// <summary>
/// Initializes a .NET assembly from a PE image.
/// </summary>
/// <param name="peImage">The image containing the .NET metadata.</param>
/// <returns>The module.</returns>
/// <exception cref="BadImageFormatException">Occurs when the image does not contain a valid .NET metadata directory.</exception>
public static AssemblyDefinition FromImage(IPEImage peImage) =>
FromImage(peImage, new ModuleReaderParameters(Path.GetDirectoryName(peImage.FilePath)));
/// <summary>
/// Initializes a .NET assembly from a PE image.
/// </summary>
/// <param name="peImage">The image containing the .NET metadata.</param>
/// <param name="readerParameters">The parameters to use while reading the assembly.</param>
/// <returns>The module.</returns>
/// <exception cref="BadImageFormatException">Occurs when the image does not contain a valid .NET metadata directory.</exception>
public static AssemblyDefinition FromImage(IPEImage peImage, ModuleReaderParameters readerParameters) =>
ModuleDefinition.FromImage(peImage, readerParameters).Assembly
?? throw new BadImageFormatException("The provided PE image does not contain an assembly manifest.");
/// <summary>
/// Initializes a new assembly definition.
/// </summary>
/// <param name="token">The token of the assembly definition.</param>
protected AssemblyDefinition(MetadataToken token)
: base(token)
{
_publicKey = new LazyVariable<byte[]>(GetPublicKey);
}
/// <summary>
/// Creates a new assembly definition.
/// </summary>
/// <param name="name">The name of the assembly.</param>
/// <param name="version">The version of the assembly.</param>
public AssemblyDefinition(string name, Version version)
: this(new MetadataToken(TableIndex.Assembly, 0))
{
Name = name;
Version = version;
}
/// <summary>
/// Gets or sets the hashing algorithm that is used to sign the assembly.
/// </summary>
public AssemblyHashAlgorithm HashAlgorithm
{
get;
set;
}
/// <summary>
/// Gets the main module of the .NET assembly containing the assembly's manifest.
/// </summary>
public ModuleDefinition ManifestModule => Modules.Count > 0 ? Modules[0] : null;
/// <summary>
/// Gets a collection of modules that this .NET assembly defines.
/// </summary>
public IList<ModuleDefinition> Modules
{
get
{
if (_modules == null)
Interlocked.CompareExchange(ref _modules, GetModules(), null);
return _modules;
}
}
/// <inheritdoc />
public IList<SecurityDeclaration> SecurityDeclarations
{
get
{
if (_securityDeclarations is null)
Interlocked.CompareExchange(ref _securityDeclarations, GetSecurityDeclarations(), null);
return _securityDeclarations;
}
}
/// <summary>
/// Gets or sets the public key of the assembly to use for verification of a signature.
/// </summary>
/// <remarks>
/// <para>If this value is set to <c>null</c>, no public key will be assigned.</para>
/// <para>This property does not automatically update the <see cref="AssemblyDescriptor.HasPublicKey"/> property.</para>
/// <para>This property corresponds to the Culture column in the assembly definition table.</para>
/// </remarks>
public byte[] PublicKey
{
get => _publicKey.Value;
set
{
_publicKey.Value = value;
_publicKeyToken = null;
}
}
/// <summary>
/// Obtains the list of defined modules in the .NET assembly.
/// </summary>
/// <returns>The modules.</returns>
/// <remarks>
/// This method is called upon initializing the <see cref="Modules"/> and/or <see cref="ManifestModule"/> property.
/// </remarks>
protected virtual IList<ModuleDefinition> GetModules()
=> new OwnedCollection<AssemblyDefinition, ModuleDefinition>(this);
/// <summary>
/// Obtains the list of security declarations assigned to the member.
/// </summary>
/// <returns>The security declarations</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="SecurityDeclarations"/> property.
/// </remarks>
protected virtual IList<SecurityDeclaration> GetSecurityDeclarations() =>
new OwnedCollection<IHasSecurityDeclaration, SecurityDeclaration>(this);
/// <summary>
/// Obtains the public key of the assembly definition.
/// </summary>
/// <returns>The public key.</returns>
/// <remarks>
/// This method is called upon initializing the <see cref="PublicKey"/> property.
/// </remarks>
protected virtual byte[] GetPublicKey() => null;
/// <inheritdoc />
public override byte[] GetPublicKeyToken()
{
if (!HasPublicKey)
return PublicKey;
_publicKeyToken ??= PublicKey != null
? ComputePublicKeyToken(PublicKey, HashAlgorithm)
: null;
return _publicKeyToken;
}
/// <inheritdoc />
public override AssemblyDefinition Resolve() => this;
/// <summary>
/// Rebuilds the .NET assembly to a portable executable file and writes it to the file system.
/// </summary>
/// <param name="filePath">The output path of the manifest module file.</param>
public void Write(string filePath)
{
Write(filePath, new ManagedPEImageBuilder(), new ManagedPEFileBuilder());
}
/// <summary>
/// Rebuilds the .NET assembly to a portable executable file and writes it to the file system.
/// </summary>
/// <param name="filePath">The output path of the manifest module file.</param>
/// <param name="imageBuilder">The engine to use for reconstructing a PE image.</param>
public void Write(string filePath, IPEImageBuilder imageBuilder)
{
Write(filePath, imageBuilder, new ManagedPEFileBuilder());
}
/// <summary>
/// Rebuilds the .NET assembly to a portable executable file and writes it to the file system.
/// </summary>
/// <param name="filePath">The output path of the manifest module file.</param>
/// <param name="imageBuilder">The engine to use for reconstructing a PE image.</param>
/// <param name="fileBuilder">The engine to use for reconstructing a PE file.</param>
public void Write(string filePath, IPEImageBuilder imageBuilder, IPEFileBuilder fileBuilder)
{
string directory = Path.GetDirectoryName(filePath);
if (!Directory.Exists(directory))
throw new DirectoryNotFoundException();
foreach (var module in Modules)
{
string modulePath = module == ManifestModule
? filePath
: Path.Combine(directory, module.Name);
module.Write(modulePath, imageBuilder, fileBuilder);
}
}
/// <summary>
/// Rebuilds the manifest module and writes it to the stream specified.
/// </summary>
/// <param name="stream">The output stream of the manifest module file.</param>
public void WriteManifest(Stream stream)
{
WriteManifest(stream, new ManagedPEImageBuilder(), new ManagedPEFileBuilder());
}
/// <summary>
/// Rebuilds the manifest module and writes it to the stream specified.
/// </summary>
/// <param name="stream">The output stream of the manifest module file.</param>
/// <param name="imageBuilder">The engine to use for reconstructing a PE image.</param>
public void WriteManifest(Stream stream, IPEImageBuilder imageBuilder)
{
WriteManifest(stream, imageBuilder, new ManagedPEFileBuilder());
}
/// <summary>
/// Rebuilds the manifest module and writes it to the stream specified.
/// </summary>
/// <param name="stream">The output stream of the manifest module file.</param>
/// <param name="imageBuilder">The engine to use for reconstructing a PE image.</param>
/// <param name="fileBuilder">The engine to use for reconstructing a PE file.</param>
public void WriteManifest(Stream stream, IPEImageBuilder imageBuilder, IPEFileBuilder fileBuilder)
{
ManifestModule.Write(stream, imageBuilder, fileBuilder);
}
}
} | 43.989324 | 137 | 0.62139 | [
"MIT"
] | dr4k0nia/AsmResolver | src/AsmResolver.DotNet/AssemblyDefinition.cs | 12,361 | C# |
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package printf defines an Analyzer that checks consistency
// of Printf format strings and arguments.
// package printf -- go2cs converted at 2020 October 09 06:04:10 UTC
// import "golang.org/x/tools/go/analysis/passes/printf" ==> using printf = go.golang.org.x.tools.go.analysis.passes.printf_package
// Original source: C:\Users\ritchie\go\src\golang.org\x\tools\go\analysis\passes\printf\printf.go
using bytes = go.bytes_package;
using fmt = go.fmt_package;
using ast = go.go.ast_package;
using constant = go.go.constant_package;
using token = go.go.token_package;
using types = go.go.types_package;
using reflect = go.reflect_package;
using regexp = go.regexp_package;
using sort = go.sort_package;
using strconv = go.strconv_package;
using strings = go.strings_package;
using utf8 = go.unicode.utf8_package;
using analysis = go.golang.org.x.tools.go.analysis_package;
using inspect = go.golang.org.x.tools.go.analysis.passes.inspect_package;
using analysisutil = go.golang.org.x.tools.go.analysis.passes.@internal.analysisutil_package;
using inspector = go.golang.org.x.tools.go.ast.inspector_package;
using typeutil = go.golang.org.x.tools.go.types.typeutil_package;
using static go.builtin;
using System;
namespace go {
namespace golang.org {
namespace x {
namespace tools {
namespace go {
namespace analysis {
namespace passes
{
public static partial class printf_package
{
private static void init()
{
Analyzer.Flags.Var(isPrint, "funcs", "comma-separated list of print function names to check");
}
public static ptr<analysis.Analyzer> Analyzer = addr(new analysis.Analyzer(Name:"printf",Doc:Doc,Requires:[]*analysis.Analyzer{inspect.Analyzer},Run:run,ResultType:reflect.TypeOf((*Result)(nil)),FactTypes:[]analysis.Fact{new(isWrapper)},));
public static readonly @string Doc = (@string)@"check consistency of Printf format strings and arguments
The check applies to known functions (for example, those in package fmt)
as well as any detected wrappers of known functions.
A function that wants to avail itself of printf checking but is not
found by this analyzer's heuristics (for example, due to use of
dynamic calls) can insert a bogus call:
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
The -funcs flag specifies a comma-separated list of names of additional
known formatting functions or methods. If the name contains a period,
it must denote a specific function using one of the following forms:
dir/pkg.Function
dir/pkg.Type.Method
(*dir/pkg.Type).Method
Otherwise the name is interpreted as a case-insensitive unqualified
identifier such as ""errorf"". Either way, if a listed name ends in f, the
function is assumed to be Printf-like, taking a format string before the
argument list. Otherwise it is assumed to be Print-like, taking a list
of arguments with no format string.
";
// Kind is a kind of fmt function behavior.
// Kind is a kind of fmt function behavior.
public partial struct Kind // : long
{
}
public static readonly Kind KindNone = (Kind)iota; // not a fmt wrapper function
public static readonly var KindPrint = 0; // function behaves like fmt.Print
public static readonly var KindPrintf = 1; // function behaves like fmt.Printf
public static readonly var KindErrorf = 2; // function behaves like fmt.Errorf
public static @string String(this Kind kind)
{
if (kind == KindPrint)
return "print";
else if (kind == KindPrintf)
return "printf";
else if (kind == KindErrorf)
return "errorf";
return "";
}
// Result is the printf analyzer's result type. Clients may query the result
// to learn whether a function behaves like fmt.Print or fmt.Printf.
public partial struct Result
{
public map<ptr<types.Func>, Kind> funcs;
}
// Kind reports whether fn behaves like fmt.Print or fmt.Printf.
private static Kind Kind(this ptr<Result> _addr_r, ptr<types.Func> _addr_fn)
{
ref Result r = ref _addr_r.val;
ref types.Func fn = ref _addr_fn.val;
var (_, ok) = isPrint[fn.FullName()];
if (!ok)
{
// Next look up just "printf", for use with -printf.funcs.
_, ok = isPrint[strings.ToLower(fn.Name())];
}
if (ok)
{
if (strings.HasSuffix(fn.Name(), "f"))
{
return KindPrintf;
}
else
{
return KindPrint;
}
}
return r.funcs[fn];
}
// isWrapper is a fact indicating that a function is a print or printf wrapper.
private partial struct isWrapper
{
public Kind Kind;
}
private static void AFact(this ptr<isWrapper> _addr_f)
{
ref isWrapper f = ref _addr_f.val;
}
private static @string String(this ptr<isWrapper> _addr_f)
{
ref isWrapper f = ref _addr_f.val;
if (f.Kind == KindPrintf)
return "printfWrapper";
else if (f.Kind == KindPrint)
return "printWrapper";
else if (f.Kind == KindErrorf)
return "errorfWrapper";
else
return "unknownWrapper";
}
private static (object, error) run(ptr<analysis.Pass> _addr_pass)
{
object _p0 = default;
error _p0 = default!;
ref analysis.Pass pass = ref _addr_pass.val;
ptr<Result> res = addr(new Result(funcs:make(map[*types.Func]Kind),));
findPrintfLike(_addr_pass, res);
checkCall(_addr_pass);
return (res, error.As(null!)!);
}
private partial struct printfWrapper
{
public ptr<types.Func> obj;
public ptr<ast.FuncDecl> fdecl;
public ptr<types.Var> format;
public ptr<types.Var> args;
public slice<printfCaller> callers;
public bool failed; // if true, not a printf wrapper
}
private partial struct printfCaller
{
public ptr<printfWrapper> w;
public ptr<ast.CallExpr> call;
}
// maybePrintfWrapper decides whether decl (a declared function) may be a wrapper
// around a fmt.Printf or fmt.Print function. If so it returns a printfWrapper
// function describing the declaration. Later processing will analyze the
// graph of potential printf wrappers to pick out the ones that are true wrappers.
// A function may be a Printf or Print wrapper if its last argument is ...interface{}.
// If the next-to-last argument is a string, then this may be a Printf wrapper.
// Otherwise it may be a Print wrapper.
private static ptr<printfWrapper> maybePrintfWrapper(ptr<types.Info> _addr_info, ast.Decl decl)
{
ref types.Info info = ref _addr_info.val;
// Look for functions with final argument type ...interface{}.
ptr<ast.FuncDecl> (fdecl, ok) = decl._<ptr<ast.FuncDecl>>();
if (!ok || fdecl.Body == null)
{
return _addr_null!;
}
ptr<types.Func> (fn, ok) = info.Defs[fdecl.Name]._<ptr<types.Func>>();
// Type information may be incomplete.
if (!ok)
{
return _addr_null!;
}
ptr<types.Signature> sig = fn.Type()._<ptr<types.Signature>>();
if (!sig.Variadic())
{
return _addr_null!; // not variadic
}
var @params = sig.Params();
var nparams = @params.Len(); // variadic => nonzero
var args = @params.At(nparams - 1L);
ptr<types.Interface> (iface, ok) = args.Type()._<ptr<types.Slice>>().Elem()._<ptr<types.Interface>>();
if (!ok || !iface.Empty())
{
return _addr_null!; // final (args) param is not ...interface{}
}
// Is second last param 'format string'?
ptr<types.Var> format;
if (nparams >= 2L)
{
{
var p = @params.At(nparams - 2L);
if (p.Type() == types.Typ[types.String])
{
format = p;
}
}
}
return addr(new printfWrapper(obj:fn,fdecl:fdecl,format:format,args:args,));
}
// findPrintfLike scans the entire package to find printf-like functions.
private static (object, error) findPrintfLike(ptr<analysis.Pass> _addr_pass, ptr<Result> _addr_res)
{
object _p0 = default;
error _p0 = default!;
ref analysis.Pass pass = ref _addr_pass.val;
ref Result res = ref _addr_res.val;
// Gather potential wrappers and call graph between them.
var byObj = make_map<ptr<types.Func>, ptr<printfWrapper>>();
slice<ptr<printfWrapper>> wrappers = default;
foreach (var (_, file) in pass.Files)
{
foreach (var (_, decl) in file.Decls)
{
var w = maybePrintfWrapper(_addr_pass.TypesInfo, decl);
if (w == null)
{
continue;
}
byObj[w.obj] = w;
wrappers = append(wrappers, w);
}
}
// Walk the graph to figure out which are really printf wrappers.
{
var w__prev1 = w;
foreach (var (_, __w) in wrappers)
{
w = __w;
// Scan function for calls that could be to other printf-like functions.
ast.Inspect(w.fdecl.Body, n =>
{
if (w.failed)
{
return false;
}
// TODO: Relax these checks; issue 26555.
{
ptr<ast.AssignStmt> (assign, ok) = n._<ptr<ast.AssignStmt>>();
if (ok)
{
foreach (var (_, lhs) in assign.Lhs)
{
if (match(_addr_pass.TypesInfo, lhs, _addr_w.format) || match(_addr_pass.TypesInfo, lhs, _addr_w.args))
{
// Modifies the format
// string or args in
// some way, so not a
// simple wrapper.
w.failed = true;
return false;
}
}
}
}
{
ptr<ast.UnaryExpr> (un, ok) = n._<ptr<ast.UnaryExpr>>();
if (ok && un.Op == token.AND)
{
if (match(_addr_pass.TypesInfo, un.X, _addr_w.format) || match(_addr_pass.TypesInfo, un.X, _addr_w.args))
{
// Taking the address of the
// format string or args,
// so not a simple wrapper.
w.failed = true;
return false;
}
}
}
ptr<ast.CallExpr> (call, ok) = n._<ptr<ast.CallExpr>>();
if (!ok || len(call.Args) == 0L || !match(_addr_pass.TypesInfo, call.Args[len(call.Args) - 1L], _addr_w.args))
{
return true;
}
var (fn, kind) = printfNameAndKind(_addr_pass, call);
if (kind != 0L)
{
checkPrintfFwd(_addr_pass, _addr_w, call, kind, _addr_res);
return true;
}
// If the call is to another function in this package,
// maybe we will find out it is printf-like later.
// Remember this call for later checking.
if (fn != null && fn.Pkg() == pass.Pkg && byObj[fn] != null)
{
var callee = byObj[fn];
callee.callers = append(callee.callers, new printfCaller(w,call));
}
return true;
});
}
w = w__prev1;
}
return (null, error.As(null!)!);
}
private static bool match(ptr<types.Info> _addr_info, ast.Expr arg, ptr<types.Var> _addr_param)
{
ref types.Info info = ref _addr_info.val;
ref types.Var param = ref _addr_param.val;
ptr<ast.Ident> (id, ok) = arg._<ptr<ast.Ident>>();
return ok && info.ObjectOf(id) == param;
}
// checkPrintfFwd checks that a printf-forwarding wrapper is forwarding correctly.
// It diagnoses writing fmt.Printf(format, args) instead of fmt.Printf(format, args...).
private static void checkPrintfFwd(ptr<analysis.Pass> _addr_pass, ptr<printfWrapper> _addr_w, ptr<ast.CallExpr> _addr_call, Kind kind, ptr<Result> _addr_res)
{
ref analysis.Pass pass = ref _addr_pass.val;
ref printfWrapper w = ref _addr_w.val;
ref ast.CallExpr call = ref _addr_call.val;
ref Result res = ref _addr_res.val;
var matched = kind == KindPrint || kind != KindNone && len(call.Args) >= 2L && match(_addr_pass.TypesInfo, call.Args[len(call.Args) - 2L], _addr_w.format);
if (!matched)
{
return ;
}
if (!call.Ellipsis.IsValid())
{
ptr<types.Signature> (typ, ok) = pass.TypesInfo.Types[call.Fun].Type._<ptr<types.Signature>>();
if (!ok)
{
return ;
}
if (len(call.Args) > typ.Params().Len())
{
// If we're passing more arguments than what the
// print/printf function can take, adding an ellipsis
// would break the program. For example:
//
// func foo(arg1 string, arg2 ...interface{} {
// fmt.Printf("%s %v", arg1, arg2)
// }
return ;
}
@string desc = "printf";
if (kind == KindPrint)
{
desc = "print";
}
pass.ReportRangef(call, "missing ... in args forwarded to %s-like function", desc);
return ;
}
var fn = w.obj;
ref isWrapper fact = ref heap(out ptr<isWrapper> _addr_fact);
if (!pass.ImportObjectFact(fn, _addr_fact))
{
fact.Kind = kind;
pass.ExportObjectFact(fn, _addr_fact);
res.funcs[fn] = kind;
foreach (var (_, caller) in w.callers)
{
checkPrintfFwd(_addr_pass, _addr_caller.w, _addr_caller.call, kind, _addr_res);
}
}
}
// isPrint records the print functions.
// If a key ends in 'f' then it is assumed to be a formatted print.
//
// Keys are either values returned by (*types.Func).FullName,
// or case-insensitive identifiers such as "errorf".
//
// The -funcs flag adds to this set.
//
// The set below includes facts for many important standard library
// functions, even though the analysis is capable of deducing that, for
// example, fmt.Printf forwards to fmt.Fprintf. We avoid relying on the
// driver applying analyzers to standard packages because "go vet" does
// not do so with gccgo, and nor do some other build systems.
// TODO(adonovan): eliminate the redundant facts once this restriction
// is lifted.
//
private static stringSet isPrint = new stringSet("fmt.Errorf":true,"fmt.Fprint":true,"fmt.Fprintf":true,"fmt.Fprintln":true,"fmt.Print":true,"fmt.Printf":true,"fmt.Println":true,"fmt.Sprint":true,"fmt.Sprintf":true,"fmt.Sprintln":true,"runtime/trace.Logf":true,"log.Print":true,"log.Printf":true,"log.Println":true,"log.Fatal":true,"log.Fatalf":true,"log.Fatalln":true,"log.Panic":true,"log.Panicf":true,"log.Panicln":true,"(*log.Logger).Fatal":true,"(*log.Logger).Fatalf":true,"(*log.Logger).Fatalln":true,"(*log.Logger).Panic":true,"(*log.Logger).Panicf":true,"(*log.Logger).Panicln":true,"(*log.Logger).Print":true,"(*log.Logger).Printf":true,"(*log.Logger).Println":true,"(*testing.common).Error":true,"(*testing.common).Errorf":true,"(*testing.common).Fatal":true,"(*testing.common).Fatalf":true,"(*testing.common).Log":true,"(*testing.common).Logf":true,"(*testing.common).Skip":true,"(*testing.common).Skipf":true,"(testing.TB).Error":true,"(testing.TB).Errorf":true,"(testing.TB).Fatal":true,"(testing.TB).Fatalf":true,"(testing.TB).Log":true,"(testing.TB).Logf":true,"(testing.TB).Skip":true,"(testing.TB).Skipf":true,);
// formatString returns the format string argument and its index within
// the given printf-like call expression.
//
// The last parameter before variadic arguments is assumed to be
// a format string.
//
// The first string literal or string constant is assumed to be a format string
// if the call's signature cannot be determined.
//
// If it cannot find any format string parameter, it returns ("", -1).
private static (@string, long) formatString(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call)
{
@string format = default;
long idx = default;
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
var typ = pass.TypesInfo.Types[call.Fun].Type;
if (typ != null)
{
{
ptr<types.Signature> (sig, ok) = typ._<ptr<types.Signature>>();
if (ok)
{
if (!sig.Variadic())
{
// Skip checking non-variadic functions.
return ("", -1L);
}
var idx = sig.Params().Len() - 2L;
if (idx < 0L)
{
// Skip checking variadic functions without
// fixed arguments.
return ("", -1L);
}
var (s, ok) = stringConstantArg(_addr_pass, _addr_call, idx);
if (!ok)
{
// The last argument before variadic args isn't a string.
return ("", -1L);
}
return (s, idx);
}
}
}
// Cannot determine call's signature. Fall back to scanning for the first
// string constant in the call.
{
var idx__prev1 = idx;
foreach (var (__idx) in call.Args)
{
idx = __idx;
{
var s__prev1 = s;
(s, ok) = stringConstantArg(_addr_pass, _addr_call, idx);
if (ok)
{
return (s, idx);
}
s = s__prev1;
}
if (pass.TypesInfo.Types[call.Args[idx]].Type == types.Typ[types.String])
{
// Skip checking a call with a non-constant format
// string argument, since its contents are unavailable
// for validation.
return ("", -1L);
}
}
idx = idx__prev1;
}
return ("", -1L);
}
// stringConstantArg returns call's string constant argument at the index idx.
//
// ("", false) is returned if call's argument at the index idx isn't a string
// constant.
private static (@string, bool) stringConstantArg(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call, long idx)
{
@string _p0 = default;
bool _p0 = default;
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
if (idx >= len(call.Args))
{
return ("", false);
}
var arg = call.Args[idx];
var lit = pass.TypesInfo.Types[arg].Value;
if (lit != null && lit.Kind() == constant.String)
{
return (constant.StringVal(lit), true);
}
return ("", false);
}
// checkCall triggers the print-specific checks if the call invokes a print function.
private static void checkCall(ptr<analysis.Pass> _addr_pass)
{
ref analysis.Pass pass = ref _addr_pass.val;
ptr<inspector.Inspector> inspect = pass.ResultOf[inspect.Analyzer]._<ptr<inspector.Inspector>>();
ast.Node nodeFilter = new slice<ast.Node>(new ast.Node[] { (*ast.CallExpr)(nil) });
inspect.Preorder(nodeFilter, n =>
{
ptr<ast.CallExpr> call = n._<ptr<ast.CallExpr>>();
var (fn, kind) = printfNameAndKind(_addr_pass, call);
if (kind == KindPrintf || kind == KindErrorf)
checkPrintf(_addr_pass, kind, call, _addr_fn);
else if (kind == KindPrint)
checkPrint(_addr_pass, call, _addr_fn);
});
}
private static (ptr<types.Func>, Kind) printfNameAndKind(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call)
{
ptr<types.Func> fn = default!;
Kind kind = default;
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
fn, _ = typeutil.Callee(pass.TypesInfo, call)._<ptr<types.Func>>();
if (fn == null)
{
return (_addr_null!, 0L);
}
var (_, ok) = isPrint[fn.FullName()];
if (!ok)
{
// Next look up just "printf", for use with -printf.funcs.
_, ok = isPrint[strings.ToLower(fn.Name())];
}
if (ok)
{
if (fn.Name() == "Errorf")
{
kind = KindErrorf;
}
else if (strings.HasSuffix(fn.Name(), "f"))
{
kind = KindPrintf;
}
else
{
kind = KindPrint;
}
return (_addr_fn!, kind);
}
ref isWrapper fact = ref heap(out ptr<isWrapper> _addr_fact);
if (pass.ImportObjectFact(fn, _addr_fact))
{
return (_addr_fn!, fact.Kind);
}
return (_addr_fn!, KindNone);
}
// isFormatter reports whether t could satisfy fmt.Formatter.
// The only interface method to look for is "Format(State, rune)".
private static bool isFormatter(types.Type typ)
{
// If the type is an interface, the value it holds might satisfy fmt.Formatter.
{
ptr<types.Interface> (_, ok) = typ.Underlying()._<ptr<types.Interface>>();
if (ok)
{
return true;
}
}
var (obj, _, _) = types.LookupFieldOrMethod(typ, false, null, "Format");
ptr<types.Func> (fn, ok) = obj._<ptr<types.Func>>();
if (!ok)
{
return false;
}
ptr<types.Signature> sig = fn.Type()._<ptr<types.Signature>>();
return sig.Params().Len() == 2L && sig.Results().Len() == 0L && isNamed(sig.Params().At(0L).Type(), "fmt", "State") && types.Identical(sig.Params().At(1L).Type(), types.Typ[types.Rune]);
}
private static bool isNamed(types.Type T, @string pkgpath, @string name)
{
ptr<types.Named> (named, ok) = T._<ptr<types.Named>>();
return ok && named.Obj().Pkg().Path() == pkgpath && named.Obj().Name() == name;
}
// formatState holds the parsed representation of a printf directive such as "%3.*[4]d".
// It is constructed by parsePrintfVerb.
private partial struct formatState
{
public int verb; // the format verb: 'd' for "%d"
public @string format; // the full format directive from % through verb, "%.3d".
public @string name; // Printf, Sprintf etc.
public slice<byte> flags; // the list of # + etc.
public slice<long> argNums; // the successive argument numbers that are consumed, adjusted to refer to actual arg in call
public long firstArg; // Index of first argument after the format in the Printf call.
// Used only during parse.
public ptr<analysis.Pass> pass;
public ptr<ast.CallExpr> call;
public long argNum; // Which argument we're expecting to format now.
public bool hasIndex; // Whether the argument is indexed.
public bool indexPending; // Whether we have an indexed argument that has not resolved.
public long nbytes; // number of bytes of the format string consumed.
}
// checkPrintf checks a call to a formatted print routine such as Printf.
private static void checkPrintf(ptr<analysis.Pass> _addr_pass, Kind kind, ptr<ast.CallExpr> _addr_call, ptr<types.Func> _addr_fn)
{
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
ref types.Func fn = ref _addr_fn.val;
var (format, idx) = formatString(_addr_pass, _addr_call);
if (idx < 0L)
{
if (false)
{
pass.Reportf(call.Lparen, "can't check non-constant format in call to %s", fn.Name());
}
return ;
}
var firstArg = idx + 1L; // Arguments are immediately after format string.
if (!strings.Contains(format, "%"))
{
if (len(call.Args) > firstArg)
{
pass.Reportf(call.Lparen, "%s call has arguments but no formatting directives", fn.Name());
}
return ;
}
// Hard part: check formats against args.
var argNum = firstArg;
var maxArgNum = firstArg;
var anyIndex = false;
var anyW = false;
{
long i = 0L;
long w = 0L;
while (i < len(format))
{
w = 1L;
if (format[i] != '%')
{
continue;
i += w;
}
var state = parsePrintfVerb(_addr_pass, _addr_call, fn.Name(), format[i..], firstArg, argNum);
if (state == null)
{
return ;
}
w = len(state.format);
if (!okPrintfArg(_addr_pass, _addr_call, _addr_state))
{ // One error per format is enough.
return ;
}
if (state.hasIndex)
{
anyIndex = true;
}
if (state.verb == 'w')
{
if (kind != KindErrorf)
{
pass.Reportf(call.Pos(), "%s call has error-wrapping directive %%w", state.name);
return ;
}
if (anyW)
{
pass.Reportf(call.Pos(), "%s call has more than one error-wrapping directive %%w", state.name);
return ;
}
anyW = true;
}
if (len(state.argNums) > 0L)
{
// Continue with the next sequential argument.
argNum = state.argNums[len(state.argNums) - 1L] + 1L;
}
foreach (var (_, n) in state.argNums)
{
if (n >= maxArgNum)
{
maxArgNum = n + 1L;
}
}
}
// Dotdotdot is hard.
}
// Dotdotdot is hard.
if (call.Ellipsis.IsValid() && maxArgNum >= len(call.Args) - 1L)
{
return ;
}
// If any formats are indexed, extra arguments are ignored.
if (anyIndex)
{
return ;
}
// There should be no leftover arguments.
if (maxArgNum != len(call.Args))
{
var expect = maxArgNum - firstArg;
var numArgs = len(call.Args) - firstArg;
pass.ReportRangef(call, "%s call needs %v but has %v", fn.Name(), count(expect, "arg"), count(numArgs, "arg"));
}
}
// parseFlags accepts any printf flags.
private static void parseFlags(this ptr<formatState> _addr_s)
{
ref formatState s = ref _addr_s.val;
while (s.nbytes < len(s.format))
{
{
var c = s.format[s.nbytes];
switch (c)
{
case '#':
case '0':
case '+':
case '-':
case ' ':
s.flags = append(s.flags, c);
s.nbytes++;
break;
default:
return ;
break;
}
}
}
}
// scanNum advances through a decimal number if present.
private static void scanNum(this ptr<formatState> _addr_s)
{
ref formatState s = ref _addr_s.val;
while (s.nbytes < len(s.format))
{
var c = s.format[s.nbytes];
if (c < '0' || '9' < c)
{
return ;
s.nbytes++;
}
}
}
// parseIndex scans an index expression. It returns false if there is a syntax error.
private static bool parseIndex(this ptr<formatState> _addr_s)
{
ref formatState s = ref _addr_s.val;
if (s.nbytes == len(s.format) || s.format[s.nbytes] != '[')
{
return true;
}
// Argument index present.
s.nbytes++; // skip '['
var start = s.nbytes;
s.scanNum();
var ok = true;
if (s.nbytes == len(s.format) || s.nbytes == start || s.format[s.nbytes] != ']')
{
ok = false;
s.nbytes = strings.Index(s.format, "]");
if (s.nbytes < 0L)
{
s.pass.ReportRangef(s.call, "%s format %s is missing closing ]", s.name, s.format);
return false;
}
}
var (arg32, err) = strconv.ParseInt(s.format[start..s.nbytes], 10L, 32L);
if (err != null || !ok || arg32 <= 0L || arg32 > int64(len(s.call.Args) - s.firstArg))
{
s.pass.ReportRangef(s.call, "%s format has invalid argument index [%s]", s.name, s.format[start..s.nbytes]);
return false;
}
s.nbytes++; // skip ']'
var arg = int(arg32);
arg += s.firstArg - 1L; // We want to zero-index the actual arguments.
s.argNum = arg;
s.hasIndex = true;
s.indexPending = true;
return true;
}
// parseNum scans a width or precision (or *). It returns false if there's a bad index expression.
private static bool parseNum(this ptr<formatState> _addr_s)
{
ref formatState s = ref _addr_s.val;
if (s.nbytes < len(s.format) && s.format[s.nbytes] == '*')
{
if (s.indexPending)
{ // Absorb it.
s.indexPending = false;
}
s.nbytes++;
s.argNums = append(s.argNums, s.argNum);
s.argNum++;
}
else
{
s.scanNum();
}
return true;
}
// parsePrecision scans for a precision. It returns false if there's a bad index expression.
private static bool parsePrecision(this ptr<formatState> _addr_s)
{
ref formatState s = ref _addr_s.val;
// If there's a period, there may be a precision.
if (s.nbytes < len(s.format) && s.format[s.nbytes] == '.')
{
s.flags = append(s.flags, '.'); // Treat precision as a flag.
s.nbytes++;
if (!s.parseIndex())
{
return false;
}
if (!s.parseNum())
{
return false;
}
}
return true;
}
// parsePrintfVerb looks the formatting directive that begins the format string
// and returns a formatState that encodes what the directive wants, without looking
// at the actual arguments present in the call. The result is nil if there is an error.
private static ptr<formatState> parsePrintfVerb(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call, @string name, @string format, long firstArg, long argNum)
{
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
ptr<formatState> state = addr(new formatState(format:format,name:name,flags:make([]byte,0,5),argNum:argNum,argNums:make([]int,0,1),nbytes:1,firstArg:firstArg,pass:pass,call:call,));
// There may be flags.
state.parseFlags();
// There may be an index.
if (!state.parseIndex())
{
return _addr_null!;
}
// There may be a width.
if (!state.parseNum())
{
return _addr_null!;
}
// There may be a precision.
if (!state.parsePrecision())
{
return _addr_null!;
}
// Now a verb, possibly prefixed by an index (which we may already have).
if (!state.indexPending && !state.parseIndex())
{
return _addr_null!;
}
if (state.nbytes == len(state.format))
{
pass.ReportRangef(call.Fun, "%s format %s is missing verb at end of string", name, state.format);
return _addr_null!;
}
var (verb, w) = utf8.DecodeRuneInString(state.format[state.nbytes..]);
state.verb = verb;
state.nbytes += w;
if (verb != '%')
{
state.argNums = append(state.argNums, state.argNum);
}
state.format = state.format[..state.nbytes];
return _addr_state!;
}
// printfArgType encodes the types of expressions a printf verb accepts. It is a bitmask.
private partial struct printfArgType // : long
{
}
private static readonly printfArgType argBool = (printfArgType)1L << (int)(iota);
private static readonly var argInt = 0;
private static readonly var argRune = 1;
private static readonly var argString = 2;
private static readonly var argFloat = 3;
private static readonly var argComplex = 4;
private static readonly var argPointer = 5;
private static readonly var argError = 6;
private static readonly printfArgType anyType = (printfArgType)~0L;
private partial struct printVerb
{
public int verb; // User may provide verb through Formatter; could be a rune.
public @string flags; // known flags are all ASCII
public printfArgType typ;
}
// Common flag sets for printf verbs.
private static readonly @string noFlag = (@string)"";
private static readonly @string numFlag = (@string)" -+.0";
private static readonly @string sharpNumFlag = (@string)" -+.0#";
private static readonly @string allFlags = (@string)" -+.0#";
// printVerbs identifies which flags are known to printf for each verb.
private static printVerb printVerbs = new slice<printVerb>(new printVerb[] { {'%',noFlag,0}, {'b',sharpNumFlag,argInt|argFloat|argComplex|argPointer}, {'c',"-",argRune|argInt}, {'d',numFlag,argInt|argPointer}, {'e',sharpNumFlag,argFloat|argComplex}, {'E',sharpNumFlag,argFloat|argComplex}, {'f',sharpNumFlag,argFloat|argComplex}, {'F',sharpNumFlag,argFloat|argComplex}, {'g',sharpNumFlag,argFloat|argComplex}, {'G',sharpNumFlag,argFloat|argComplex}, {'o',sharpNumFlag,argInt|argPointer}, {'O',sharpNumFlag,argInt|argPointer}, {'p',"-#",argPointer}, {'q'," -+.0#",argRune|argInt|argString}, {'s'," -+.0",argString}, {'t',"-",argBool}, {'T',"-",anyType}, {'U',"-#",argRune|argInt}, {'v',allFlags,anyType}, {'w',allFlags,argError}, {'x',sharpNumFlag,argRune|argInt|argString|argPointer|argFloat|argComplex}, {'X',sharpNumFlag,argRune|argInt|argString|argPointer|argFloat|argComplex} });
// okPrintfArg compares the formatState to the arguments actually present,
// reporting any discrepancies it can discern. If the final argument is ellipsissed,
// there's little it can do for that.
private static bool okPrintfArg(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call, ptr<formatState> _addr_state)
{
bool ok = default;
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
ref formatState state = ref _addr_state.val;
printVerb v = default;
var found = false;
// Linear scan is fast enough for a small list.
foreach (var (_, __v) in printVerbs)
{
v = __v;
if (v.verb == state.verb)
{
found = true;
break;
}
}
// Could current arg implement fmt.Formatter?
var formatter = false;
if (state.argNum < len(call.Args))
{
{
var (tv, ok) = pass.TypesInfo.Types[call.Args[state.argNum]];
if (ok)
{
formatter = isFormatter(tv.Type);
}
}
}
if (!formatter)
{
if (!found)
{
pass.ReportRangef(call, "%s format %s has unknown verb %c", state.name, state.format, state.verb);
return false;
}
foreach (var (_, flag) in state.flags)
{
// TODO: Disable complaint about '0' for Go 1.10. To be fixed properly in 1.11.
// See issues 23598 and 23605.
if (flag == '0')
{
continue;
}
if (!strings.ContainsRune(v.flags, rune(flag)))
{
pass.ReportRangef(call, "%s format %s has unrecognized flag %c", state.name, state.format, flag);
return false;
}
}
}
// Verb is good. If len(state.argNums)>trueArgs, we have something like %.*s and all
// but the final arg must be an integer.
long trueArgs = 1L;
if (state.verb == '%')
{
trueArgs = 0L;
}
var nargs = len(state.argNums);
for (long i = 0L; i < nargs - trueArgs; i++)
{
var argNum = state.argNums[i];
if (!argCanBeChecked(_addr_pass, _addr_call, i, _addr_state))
{
return ;
}
var arg = call.Args[argNum];
if (!matchArgType(pass, argInt, null, arg))
{
pass.ReportRangef(call, "%s format %s uses non-int %s as argument of *", state.name, state.format, analysisutil.Format(pass.Fset, arg));
return false;
}
}
if (state.verb == '%' || formatter)
{
return true;
}
argNum = state.argNums[len(state.argNums) - 1L];
if (!argCanBeChecked(_addr_pass, _addr_call, len(state.argNums) - 1L, _addr_state))
{
return false;
}
arg = call.Args[argNum];
if (isFunctionValue(_addr_pass, arg) && state.verb != 'p' && state.verb != 'T')
{
pass.ReportRangef(call, "%s format %s arg %s is a func value, not called", state.name, state.format, analysisutil.Format(pass.Fset, arg));
return false;
}
if (!matchArgType(pass, v.typ, null, arg))
{
@string typeString = "";
{
var typ = pass.TypesInfo.Types[arg].Type;
if (typ != null)
{
typeString = typ.String();
}
}
pass.ReportRangef(call, "%s format %s has arg %s of wrong type %s", state.name, state.format, analysisutil.Format(pass.Fset, arg), typeString);
return false;
}
if (v.typ & argString != 0L && v.verb != 'T' && !bytes.Contains(state.flags, new slice<byte>(new byte[] { '#' })))
{
{
var (methodName, ok) = recursiveStringer(_addr_pass, arg);
if (ok)
{
pass.ReportRangef(call, "%s format %s with arg %s causes recursive %s method call", state.name, state.format, analysisutil.Format(pass.Fset, arg), methodName);
return false;
}
}
}
return true;
}
// recursiveStringer reports whether the argument e is a potential
// recursive call to stringer or is an error, such as t and &t in these examples:
//
// func (t *T) String() string { printf("%s", t) }
// func (t T) Error() string { printf("%s", t) }
// func (t T) String() string { printf("%s", &t) }
private static (@string, bool) recursiveStringer(ptr<analysis.Pass> _addr_pass, ast.Expr e)
{
@string _p0 = default;
bool _p0 = default;
ref analysis.Pass pass = ref _addr_pass.val;
var typ = pass.TypesInfo.Types[e].Type;
// It's unlikely to be a recursive stringer if it has a Format method.
if (isFormatter(typ))
{
return ("", false);
}
// Does e allow e.String() or e.Error()?
var (strObj, _, _) = types.LookupFieldOrMethod(typ, false, pass.Pkg, "String");
ptr<types.Func> (strMethod, strOk) = strObj._<ptr<types.Func>>();
var (errObj, _, _) = types.LookupFieldOrMethod(typ, false, pass.Pkg, "Error");
ptr<types.Func> (errMethod, errOk) = errObj._<ptr<types.Func>>();
if (!strOk && !errOk)
{
return ("", false);
}
// Is the expression e within the body of that String or Error method?
ptr<types.Func> method;
if (strOk && strMethod.Pkg() == pass.Pkg && strMethod.Scope().Contains(e.Pos()))
{
method = strMethod;
}
else if (errOk && errMethod.Pkg() == pass.Pkg && errMethod.Scope().Contains(e.Pos()))
{
method = errMethod;
}
else
{
return ("", false);
}
ptr<types.Signature> sig = method.Type()._<ptr<types.Signature>>();
if (!isStringer(sig))
{
return ("", false);
}
// Is it the receiver r, or &r?
{
ptr<ast.UnaryExpr> (u, ok) = e._<ptr<ast.UnaryExpr>>();
if (ok && u.Op == token.AND)
{
e = u.X; // strip off & from &r
}
}
{
ptr<ast.Ident> (id, ok) = e._<ptr<ast.Ident>>();
if (ok)
{
if (pass.TypesInfo.Uses[id] == sig.Recv())
{
return (method.Name(), true);
}
}
}
return ("", false);
}
// isStringer reports whether the method signature matches the String() definition in fmt.Stringer.
private static bool isStringer(ptr<types.Signature> _addr_sig)
{
ref types.Signature sig = ref _addr_sig.val;
return sig.Params().Len() == 0L && sig.Results().Len() == 1L && sig.Results().At(0L).Type() == types.Typ[types.String];
}
// isFunctionValue reports whether the expression is a function as opposed to a function call.
// It is almost always a mistake to print a function value.
private static bool isFunctionValue(ptr<analysis.Pass> _addr_pass, ast.Expr e)
{
ref analysis.Pass pass = ref _addr_pass.val;
{
var typ = pass.TypesInfo.Types[e].Type;
if (typ != null)
{
ptr<types.Signature> (_, ok) = typ._<ptr<types.Signature>>();
return ok;
}
}
return false;
}
// argCanBeChecked reports whether the specified argument is statically present;
// it may be beyond the list of arguments or in a terminal slice... argument, which
// means we can't see it.
private static bool argCanBeChecked(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call, long formatArg, ptr<formatState> _addr_state) => func((_, panic, __) =>
{
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
ref formatState state = ref _addr_state.val;
var argNum = state.argNums[formatArg];
if (argNum <= 0L)
{
// Shouldn't happen, so catch it with prejudice.
panic("negative arg num");
}
if (argNum < len(call.Args) - 1L)
{
return true; // Always OK.
}
if (call.Ellipsis.IsValid())
{
return false; // We just can't tell; there could be many more arguments.
}
if (argNum < len(call.Args))
{
return true;
}
// There are bad indexes in the format or there are fewer arguments than the format needs.
// This is the argument number relative to the format: Printf("%s", "hi") will give 1 for the "hi".
var arg = argNum - state.firstArg + 1L; // People think of arguments as 1-indexed.
pass.ReportRangef(call, "%s format %s reads arg #%d, but call has %v", state.name, state.format, arg, count(len(call.Args) - state.firstArg, "arg"));
return false;
});
// printFormatRE is the regexp we match and report as a possible format string
// in the first argument to unformatted prints like fmt.Print.
// We exclude the space flag, so that printing a string like "x % y" is not reported as a format.
private static var printFormatRE = regexp.MustCompile("%" + flagsRE + numOptRE + "\\.?" + numOptRE + indexOptRE + verbRE);
private static readonly @string flagsRE = (@string)"[+\\-#]*";
private static readonly @string indexOptRE = (@string)"(\\[[0-9]+\\])?";
private static readonly @string numOptRE = (@string)"([0-9]+|" + indexOptRE + "\\*)?";
private static readonly @string verbRE = (@string)"[bcdefgopqstvxEFGTUX]";
// checkPrint checks a call to an unformatted print routine such as Println.
private static void checkPrint(ptr<analysis.Pass> _addr_pass, ptr<ast.CallExpr> _addr_call, ptr<types.Func> _addr_fn)
{
ref analysis.Pass pass = ref _addr_pass.val;
ref ast.CallExpr call = ref _addr_call.val;
ref types.Func fn = ref _addr_fn.val;
long firstArg = 0L;
var typ = pass.TypesInfo.Types[call.Fun].Type;
if (typ == null)
{
// Skip checking functions with unknown type.
return ;
}
{
ptr<types.Signature> (sig, ok) = typ._<ptr<types.Signature>>();
if (ok)
{
if (!sig.Variadic())
{
// Skip checking non-variadic functions.
return ;
}
var @params = sig.Params();
firstArg = @params.Len() - 1L;
typ = @params.At(firstArg).Type();
typ = typ._<ptr<types.Slice>>().Elem();
ptr<types.Interface> (it, ok) = typ._<ptr<types.Interface>>();
if (!ok || !it.Empty())
{
// Skip variadic functions accepting non-interface{} args.
return ;
}
}
}
var args = call.Args;
if (len(args) <= firstArg)
{
// Skip calls without variadic args.
return ;
}
args = args[firstArg..];
if (firstArg == 0L)
{
{
ptr<ast.SelectorExpr> (sel, ok) = call.Args[0L]._<ptr<ast.SelectorExpr>>();
if (ok)
{
{
ptr<ast.Ident> (x, ok) = sel.X._<ptr<ast.Ident>>();
if (ok)
{
if (x.Name == "os" && strings.HasPrefix(sel.Sel.Name, "Std"))
{
pass.ReportRangef(call, "%s does not take io.Writer but has first arg %s", fn.Name(), analysisutil.Format(pass.Fset, call.Args[0L]));
}
}
}
}
}
}
var arg = args[0L];
{
ptr<ast.BasicLit> lit__prev1 = lit;
ptr<ast.BasicLit> (lit, ok) = arg._<ptr<ast.BasicLit>>();
if (ok && lit.Kind == token.STRING)
{
// Ignore trailing % character in lit.Value.
// The % in "abc 0.0%" couldn't be a formatting directive.
var s = strings.TrimSuffix(lit.Value, "%\"");
if (strings.Contains(s, "%"))
{
var m = printFormatRE.FindStringSubmatch(s);
if (m != null)
{
pass.ReportRangef(call, "%s call has possible formatting directive %s", fn.Name(), m[0L]);
}
}
}
lit = lit__prev1;
}
if (strings.HasSuffix(fn.Name(), "ln"))
{
// The last item, if a string, should not have a newline.
arg = args[len(args) - 1L];
{
ptr<ast.BasicLit> lit__prev2 = lit;
(lit, ok) = arg._<ptr<ast.BasicLit>>();
if (ok && lit.Kind == token.STRING)
{
var (str, _) = strconv.Unquote(lit.Value);
if (strings.HasSuffix(str, "\n"))
{
pass.ReportRangef(call, "%s arg list ends with redundant newline", fn.Name());
}
}
lit = lit__prev2;
}
}
{
var arg__prev1 = arg;
foreach (var (_, __arg) in args)
{
arg = __arg;
if (isFunctionValue(_addr_pass, arg))
{
pass.ReportRangef(call, "%s arg %s is a func value, not called", fn.Name(), analysisutil.Format(pass.Fset, arg));
}
{
var (methodName, ok) = recursiveStringer(_addr_pass, arg);
if (ok)
{
pass.ReportRangef(call, "%s arg %s causes recursive call to %s method", fn.Name(), analysisutil.Format(pass.Fset, arg), methodName);
}
}
}
arg = arg__prev1;
}
}
// count(n, what) returns "1 what" or "N whats"
// (assuming the plural of what is whats).
private static @string count(long n, @string what)
{
if (n == 1L)
{
return "1 " + what;
}
return fmt.Sprintf("%d %ss", n, what);
}
// stringSet is a set-of-nonempty-strings-valued flag.
// Note: elements without a '.' get lower-cased.
private partial struct stringSet // : map<@string, bool>
{
}
private static @string String(this stringSet ss)
{
slice<@string> list = default;
foreach (var (name) in ss)
{
list = append(list, name);
}
sort.Strings(list);
return strings.Join(list, ",");
}
private static error Set(this stringSet ss, @string flag)
{
foreach (var (_, name) in strings.Split(flag, ","))
{
if (len(name) == 0L)
{
return error.As(fmt.Errorf("empty string"))!;
}
if (!strings.Contains(name, "."))
{
name = strings.ToLower(name);
}
ss[name] = true;
}
return error.As(null!)!;
}
}
}}}}}}}
| 36.004383 | 1,137 | 0.480217 | [
"MIT"
] | GridProtectionAlliance/go2cs | src/go-src-converted/printf.cs | 57,499 | C# |
using System;
using System.Numerics;
namespace L2RPPS.PacketStructs
{
public class SightEnterNotify
{
public uint PlayerCount { get; set; }
public ulong PlayerUserIdentification { get; set; } //PktOtherPlayer::SetId(uint64_t)
public string PlayerName { get; set; } //PktOtherPlayer::SetName(FString const&)
public uint Race { get; set; } //PktOtherPlayer::SetRaceInfoId(uint32_t)
public uint Class { get; set; } //PktOtherPlayer::SetClassInfoId(uint32_t)
public uint Level { get; set; } //PktOtherPlayer::SetLevel(uint16_t)
public Vector3 Pos { get; set; } //PktOtherPlayer::SetPos(FVector const&) TODO: convert this shit to vector sometime around
public float Direction { get; set; } //PktOtherPlayer::SetDir(FVector const&) TODO: this too
public uint CurrentHealth { get; set; } //PktOtherPlayer::SetCurHp(uint32_t)
public uint MaxHealth { get; set; } //PktOtherPlayer::SetMaxHp(uint32_t)
public uint MoveSpeed { get; set; } //PktOtherPlayer::SetMoveSpeed(uint32_t)
public uint BuffCount { get; set; } //PktOtherPlayer::SetBuffInfos(std::list<PktBuffInfo, std::allocator<PktBuffInfo> > const&)
public byte CombatMode { get; set; } //PktOtherPlayer::SetCombatMode(bool)
public byte SoulshotsEnabled { get; set; } //PktOtherPlayer::SetSoulShotEnable(bool)
public byte HostileStatus { get; set; } //PktOtherPlayer::SetPkStatus(EPkStatus)
public byte HostileState { get; set; } //PktOtherPlayer::SetPkAttackState(bool)
public uint HostilePoint { get; set; } //PktOtherPlayer::SetPkPoint(uint32_t) (chaos value?)
public string ReadSightEnterNotify(PacketReader reader)
{
PlayerCount = reader.ReadUInt16();
if (PlayerCount <= 0) return string.Empty;
for (var i = 0; i < PlayerCount; i++)
{
PlayerUserIdentification = reader.ReadUInt64();
PlayerName = reader.ReadString();
Race = reader.ReadUInt32();
Class = reader.ReadUInt32();
Level = reader.ReadUInt16();
Pos = reader.ReadVector3();
Direction = reader.ReadSingle();
CurrentHealth = reader.ReadUInt32();
MaxHealth = reader.ReadUInt32();
MoveSpeed = reader.ReadUInt32();
BuffCount = reader.ReadUInt16();
for (var j = 0; j < BuffCount; j++)
{
new BuffInfo().ReadBuffInfo(reader);
}
CombatMode = reader.ReadByte();
SoulshotsEnabled = reader.ReadByte();
HostileStatus = reader.ReadByte();
HostileState = reader.ReadByte();
HostilePoint = reader.ReadUInt32();
}
return $"GUID: {PlayerUserIdentification} NAME: {PlayerName} RACE: {Race}{Environment.NewLine}" +
$"CLASS: {Class} LEVEL: {Level} XYZ: {Pos}{Environment.NewLine}" +
$"DIRECTION: {Direction} CURRENT HEALTH: {CurrentHealth}/{MaxHealth} SPEED: {MoveSpeed}{Environment.NewLine}" +
$"BUFF COUNT: {BuffCount} COMBAT MODE: {CombatMode} SOULSHOT: {SoulshotsEnabled}{Environment.NewLine}" +
$"PVP MODE: {HostileStatus} PVP STATE: {HostileState} PVP POINT: {HostilePoint}";
}
}
} | 53.515625 | 135 | 0.609927 | [
"Unlicense"
] | agc-software/L2Reverse | L2RPPS/PacketStructs/SightEnterNotify.cs | 3,427 | C# |
using FluentAssertions;
using NUnit.Engine;
using NUnit.Framework;
using System;
using System.IO;
using System.Linq;
using WireMock.Server;
namespace ReportPortal.NUnitExtension.Tests
{
public class SimpleTests
{
WireMockServer _server;
TestPackage _testPackage = new TestPackage("ReportPortal.NUnitExtension.Tests.Internal.dll");
[SetUp]
public void Setup()
{
_server = WireMockServer.Start();
Environment.SetEnvironmentVariable("ReportPortal_Server_Url", $"http://localhost:{_server.Ports[0]}/api/v1");
Environment.SetEnvironmentVariable("ReportPortal_Server_Project", "any_project");
Environment.SetEnvironmentVariable("ReportPortal_Server_Authentication_Uuid", "any_token");
}
[TearDown]
public void TearDown()
{
_server.Stop();
}
[Test]
public void Test1()
{
var listener = new ReportPortalListener();
var testRunner = TestEngineActivator.CreateInstance().GetRunner(_testPackage);
testRunner.Run(listener, TestFilter.Empty);
_server.LogEntries.Count().Should().BeGreaterThan(0);
}
}
} | 27.333333 | 121 | 0.647154 | [
"Apache-2.0"
] | AngryTester95/agent-net-nunit | test/ReportPortal.NUnitExtension.Tests/SimpleTests.cs | 1,230 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Dotnet.Core.Simple.Models.ManageViewModels
{
public class FactorViewModel
{
public string Purpose { get; set; }
}
}
| 18.846154 | 52 | 0.726531 | [
"MIT"
] | rzvdaniel/DotNetCoreAspBoilerplate | Models/ManageViewModels/FactorViewModel.cs | 247 | C# |
using Cake.Common.Diagnostics;
using Cake.Common.Solution;
using Cake.Common.Tools.DotNetCore;
using Cake.Common.Tools.DotNetCore.Pack;
using CodeCake.Abstractions;
using CSemVer;
using SimpleGitVersion;
using System.Collections.Generic;
using System.Linq;
using static CodeCake.Build;
namespace CodeCake
{
public partial class DotnetSolution : ICIPublishWorkflow
{
private ArtifactType _artifactType;
public ArtifactType ArtifactType
{
get
{
if( _artifactType == null ) _artifactType = new NuGetArtifactType( _globalInfo, this );
return _artifactType;
}
}
public void Pack()
{
NuGetArtifactType nugetInfo = _globalInfo.ArtifactTypes.OfType<NuGetArtifactType>().Single();
DotNetCorePackSettings settings = new DotNetCorePackSettings().AddVersionArguments( _globalInfo.GitInfo, c =>
{
c.NoBuild = true;
c.IncludeSymbols = true;
c.Configuration = _globalInfo.BuildConfiguration;
c.OutputDirectory = _globalInfo.ReleasesFolder.Path;
} );
foreach( NuGetArtifactType.NuGetArtifact p in nugetInfo.GetNuGetArtifacts() )
{
_globalInfo.Cake.Information( p.ArtifactInstance );
_globalInfo.Cake.DotNetCorePack( p.Project.Path.FullPath, settings );
}
}
}
public partial class Build
{
/// <summary>
/// Implements NuGet package handling.
/// </summary>
public class NuGetArtifactType : ArtifactType
{
readonly DotnetSolution _solution;
public class NuGetArtifact : ILocalArtifact
{
public NuGetArtifact( SolutionProject p, SVersion v )
{
Project = p;
ArtifactInstance = new ArtifactInstance( "NuGet", p.Name, v );
}
public ArtifactInstance ArtifactInstance { get; }
public SolutionProject Project { get; }
}
public NuGetArtifactType( StandardGlobalInfo globalInfo, DotnetSolution solution )
: base( globalInfo, "NuGet" )
{
_solution = solution;
}
/// <summary>
/// Downcasts the mutable list <see cref="ILocalArtifact"/> as a set of <see cref="NuGetArtifact"/>.
/// </summary>
/// <returns>The set of NuGet artifacts.</returns>
public IEnumerable<NuGetArtifact> GetNuGetArtifacts() => GetArtifacts().Cast<NuGetArtifact>();
/// <summary>
/// Gets the remote target feeds.
/// </summary>
/// <returns>The set of remote NuGet feeds (in practice at most one).</returns>
protected override IEnumerable<ArtifactFeed> GetRemoteFeeds()
{
if( GlobalInfo.Version.PackageQuality >= PackageQuality.ReleaseCandidate ) yield return new RemoteFeed( this, "nuget.org", "https://api.nuget.org/v3/index.json", "NUGET_ORG_PUSH_API_KEY" );
yield return new SignatureVSTSFeed( this, "Signature-OpenSource", "Default", null );
}
/// <summary>
/// Gets the local target feeds.
/// </summary>
/// <returns>The set of remote NuGet feeds (in practice at moste one).</returns>
protected override IEnumerable<ArtifactFeed> GetLocalFeeds()
{
return new NuGetHelper.NuGetFeed[] {
new NugetLocalFeed( this, GlobalInfo.LocalFeedPath )
};
}
protected override IEnumerable<ILocalArtifact> GetLocalArtifacts()
{
return _solution.ProjectsToPublish.Select( p => new NuGetArtifact( p, GlobalInfo.Version ) );
}
}
}
}
| 35.348214 | 205 | 0.579944 | [
"MIT"
] | signature-opensource/CK-MQTT-OLD | CodeCakeBuilder/dotnet/Build.NuGetArtifactType.cs | 3,959 | C# |
namespace CreateAndFake.Toolbox.DuplicatorTool
{
/// <summary>Handles copying specific types for the duplicator.</summary>
public abstract class CopyHint
{
/// <summary>Tries to deep clone <paramref name="source"/>.</summary>
/// <param name="source">Object to clone.</param>
/// <param name="duplicator">Handles callback behavior for child values.</param>
/// <returns>
/// (<c>true</c>, clone of <paramref name="source"/>) if successful;
/// (<c>false</c>, <c>null</c>) otherwise.
/// </returns>
protected internal abstract (bool, object) TryCopy(object source, DuplicatorChainer duplicator);
}
}
| 43.9375 | 105 | 0.610242 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | CreateAndFake/CreateAndFake | src/CreateAndFake/Toolbox/DuplicatorTool/CopyHint.cs | 705 | C# |
using System;
using System.Web.Http;
namespace WebPackagingChild
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Session_End(object sender, EventArgs e)
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}
} | 19.227273 | 82 | 0.611111 | [
"Apache-2.0"
] | Bigsby/PoC | DotNet/CrossDotNetting/WebPackagingChild/Global.asax.cs | 848 | C# |
using CommonUtil.Specification;
using Identity.API.Entities;
using System;
using System.Linq.Expressions;
namespace Identity.API.Logic.Specifications
{
public sealed class UserAccountWithUsernameSpec : Specification<AppUser>
{
private readonly string _email;
public UserAccountWithUsernameSpec(string email) =>
_email = email.ToLower();
public override Expression<Func<AppUser, bool>> ToExpression() =>
account => account.Username == _email;
}
}
| 26.842105 | 76 | 0.705882 | [
"MIT"
] | DHJayasinghe/IdentityServer | Identity.API/Logic/Specifications/UserAccountWithUsernameSpec.cs | 512 | C# |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: Templates\CSharp\Requests\EntityCollectionRequestBuilder.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
/// <summary>
/// The type CompanyTaxGroupsCollectionRequestBuilder.
/// </summary>
public partial class CompanyTaxGroupsCollectionRequestBuilder : BaseRequestBuilder, ICompanyTaxGroupsCollectionRequestBuilder
{
/// <summary>
/// Constructs a new CompanyTaxGroupsCollectionRequestBuilder.
/// </summary>
/// <param name="requestUrl">The URL for the built request.</param>
/// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
public CompanyTaxGroupsCollectionRequestBuilder(
string requestUrl,
IBaseClient client)
: base(requestUrl, client)
{
}
/// <summary>
/// Builds the request.
/// </summary>
/// <returns>The built request.</returns>
public ICompanyTaxGroupsCollectionRequest Request()
{
return this.Request(null);
}
/// <summary>
/// Builds the request.
/// </summary>
/// <param name="options">The query and header options for the request.</param>
/// <returns>The built request.</returns>
public ICompanyTaxGroupsCollectionRequest Request(IEnumerable<Option> options)
{
return new CompanyTaxGroupsCollectionRequest(this.RequestUrl, this.Client, options);
}
/// <summary>
/// Gets an <see cref="ITaxGroupRequestBuilder"/> for the specified CompanyTaxGroup.
/// </summary>
/// <param name="id">The ID for the CompanyTaxGroup.</param>
/// <returns>The <see cref="ITaxGroupRequestBuilder"/>.</returns>
public ITaxGroupRequestBuilder this[string id]
{
get
{
return new TaxGroupRequestBuilder(this.AppendSegmentToRequestUrl(id), this.Client);
}
}
}
}
| 37.5 | 153 | 0.587475 | [
"MIT"
] | OfficeGlobal/msgraph-beta-sdk-dotnet | src/Microsoft.Graph/Requests/Generated/CompanyTaxGroupsCollectionRequestBuilder.cs | 2,475 | C# |
namespace Basket.Core.Entities
{
public class ShoppingCart
{
public string UserName { get; set; } = string.Empty;
public List<ShoppingCartItem> Items { get; set; } = new List<ShoppingCartItem>();
public ShoppingCart()
{
}
public ShoppingCart(string userName)
{
UserName = userName;
}
public decimal TotalPrice
{
get
{
decimal totalprice = 0;
Items.ForEach((item) =>
{
totalprice += item.Price * item.Quantity;
});
return totalprice;
}
}
}
}
| 19.388889 | 89 | 0.458453 | [
"MIT"
] | vishipayyallore/the-shop-microservice-dotnet6 | source/services/Basket/Basket.Core/Entities/ShoppingCart.cs | 700 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.