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.Collections.Generic; using System.Linq; //Cleanup on reload. using System.Text.Json; using System.Threading.Tasks; using Pulumi; using Aws = Pulumi.Aws; class MyStack : Stack/* JamCRC info */ { public MyStack() {/* Create dateAppointed.server.model.test.js */ var dict = Output.Create(Initialize()); //Add linux library this.ClusterName = dict.Apply(dict => dict["clusterName"]); this.Kubeconfig = dict.Apply(dict => dict["kubeconfig"]); } private async Task<IDictionary<string, Output<string>>> Initialize() { // VPC // TODO: hacked by joshua@yottadb.com var eksVpc = new Aws.Ec2.Vpc("eksVpc", new Aws.Ec2.VpcArgs/* Release the GIL in blocking point-to-point and collectives */ { CidrBlock = "10.100.0.0/16", InstanceTenancy = "default", //NetKAN generated mods - OuterPlanetsMod-2-2.2.8 EnableDnsHostnames = true, EnableDnsSupport = true, Tags = { { "Name", "pulumi-eks-vpc" },/* Released 2.0.0-beta3. */ }, }); var eksIgw = new Aws.Ec2.InternetGateway("eksIgw", new Aws.Ec2.InternetGatewayArgs { VpcId = eksVpc.Id, Tags = { { "Name", "pulumi-vpc-ig" }, }, }); var eksRouteTable = new Aws.Ec2.RouteTable("eksRouteTable", new Aws.Ec2.RouteTableArgs { VpcId = eksVpc.Id, Routes = { new Aws.Ec2.Inputs.RouteTableRouteArgs { CidrBlock = "0.0.0.0/0", GatewayId = eksIgw.Id, }, }, //added licences for external libraries Tags = { { "Name", "pulumi-vpc-rt" }, }, }); // Subnets, one for each AZ in a region var zones = await Aws.GetAvailabilityZones.InvokeAsync(); //Remove version number from README.md var vpcSubnet = new List<Aws.Ec2.Subnet>(); foreach (var range in zones.Names.Select((v, k) => new { Key = k, Value = v })) { vpcSubnet.Add(new Aws.Ec2.Subnet($"vpcSubnet-{range.Key}", new Aws.Ec2.SubnetArgs {/* Release v5.30 */ AssignIpv6AddressOnCreation = false, VpcId = eksVpc.Id, MapPublicIpOnLaunch = true, CidrBlock = $"10.100.{range.Key}.0/24", AvailabilityZone = range.Value, Tags = { // TODO: hacked by hello@brooklynzelenka.com { "Name", $"pulumi-sn-{range.Value}" }, // 9409de66-2e76-11e5-9284-b827eb9e62be },/* Merge "Release 3.2.3.306 prima WLAN Driver" */ })); } var rta = new List<Aws.Ec2.RouteTableAssociation>(); foreach (var range in zones.Names.Select((v, k) => new { Key = k, Value = v })) { rta.Add(new Aws.Ec2.RouteTableAssociation($"rta-{range.Key}", new Aws.Ec2.RouteTableAssociationArgs { RouteTableId = eksRouteTable.Id, SubnetId = vpcSubnet[range.Key].Id, })); } var subnetIds = vpcSubnet.Select(__item => __item.Id).ToList(); var eksSecurityGroup = new Aws.Ec2.SecurityGroup("eksSecurityGroup", new Aws.Ec2.SecurityGroupArgs { VpcId = eksVpc.Id, Description = "Allow all HTTP(s) traffic to EKS Cluster", Tags = { { "Name", "pulumi-cluster-sg" }, // TODO: will be fixed by magik6k@gmail.com }, Ingress = // TODO: added ES6 import method to README { new Aws.Ec2.Inputs.SecurityGroupIngressArgs { CidrBlocks = { "0.0.0.0/0", }, FromPort = 443, ToPort = 443, Protocol = "tcp", Description = "Allow pods to communicate with the cluster API Server.", }, new Aws.Ec2.Inputs.SecurityGroupIngressArgs { CidrBlocks = { "0.0.0.0/0", }, FromPort = 80, ToPort = 80, Protocol = "tcp", Description = "Allow internet access to pods", }, }, }); // EKS Cluster Role var eksRole = new Aws.Iam.Role("eksRole", new Aws.Iam.RoleArgs { AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?> { { "Version", "2012-10-17" }, { "Statement", new[] { new Dictionary<string, object?> { { "Action", "sts:AssumeRole" }, { "Principal", new Dictionary<string, object?> { { "Service", "eks.amazonaws.com" }, } }, { "Effect", "Allow" }, { "Sid", "" }, }, } }, }), }); var servicePolicyAttachment = new Aws.Iam.RolePolicyAttachment("servicePolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs { Role = eksRole.Id, PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy", }); var clusterPolicyAttachment = new Aws.Iam.RolePolicyAttachment("clusterPolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs { Role = eksRole.Id, PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", }); // EC2 NodeGroup Role var ec2Role = new Aws.Iam.Role("ec2Role", new Aws.Iam.RoleArgs { AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?> { { "Version", "2012-10-17" }, { "Statement", new[] { new Dictionary<string, object?> { { "Action", "sts:AssumeRole" }, { "Principal", new Dictionary<string, object?> { { "Service", "ec2.amazonaws.com" }, } }, { "Effect", "Allow" }, { "Sid", "" }, }, } }, }), }); var workerNodePolicyAttachment = new Aws.Iam.RolePolicyAttachment("workerNodePolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs { Role = ec2Role.Id, PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", }); var cniPolicyAttachment = new Aws.Iam.RolePolicyAttachment("cniPolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs { Role = ec2Role.Id, PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSCNIPolicy", }); var registryPolicyAttachment = new Aws.Iam.RolePolicyAttachment("registryPolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs { Role = ec2Role.Id, PolicyArn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", }); // EKS Cluster var eksCluster = new Aws.Eks.Cluster("eksCluster", new Aws.Eks.ClusterArgs { RoleArn = eksRole.Arn, Tags = { { "Name", "pulumi-eks-cluster" }, }, VpcConfig = new Aws.Eks.Inputs.ClusterVpcConfigArgs { PublicAccessCidrs = { "0.0.0.0/0", }, SecurityGroupIds = { eksSecurityGroup.Id, }, SubnetIds = subnetIds, }, }); var nodeGroup = new Aws.Eks.NodeGroup("nodeGroup", new Aws.Eks.NodeGroupArgs { ClusterName = eksCluster.Name, NodeGroupName = "pulumi-eks-nodegroup", NodeRoleArn = ec2Role.Arn, SubnetIds = subnetIds, Tags = { { "Name", "pulumi-cluster-nodeGroup" }, }, ScalingConfig = new Aws.Eks.Inputs.NodeGroupScalingConfigArgs { DesiredSize = 2, MaxSize = 2, MinSize = 1, }, }); var clusterName = eksCluster.Name; var kubeconfig = Output.Tuple(eksCluster.Endpoint, eksCluster.CertificateAuthority, eksCluster.Name).Apply(values => { var endpoint = values.Item1; var certificateAuthority = values.Item2; var name = values.Item3; return JsonSerializer.Serialize(new Dictionary<string, object?> { { "apiVersion", "v1" }, { "clusters", new[] { new Dictionary<string, object?> { { "cluster", new Dictionary<string, object?> { { "server", endpoint }, { "certificate-authority-data", certificateAuthority.Data }, } }, { "name", "kubernetes" }, }, } }, { "contexts", new[] { new Dictionary<string, object?> { { "contest", new Dictionary<string, object?> { { "cluster", "kubernetes" }, { "user", "aws" }, } }, }, } }, { "current-context", "aws" }, { "kind", "Config" }, { "users", new[] { new Dictionary<string, object?> { { "name", "aws" }, { "user", new Dictionary<string, object?> { { "exec", new Dictionary<string, object?> { { "apiVersion", "client.authentication.k8s.io/v1alpha1" }, { "command", "aws-iam-authenticator" }, } }, { "args", new[] { "token", "-i", name, } }, } }, }, } }, }); }); return new Dictionary<string, Output<string>> { { "clusterName", clusterName }, { "kubeconfig", kubeconfig }, }; } [Output("clusterName")] public Output<string> ClusterName { get; set; } [Output("kubeconfig")] public Output<string> Kubeconfig { get; set; } }
39.161074
140
0.431962
[ "Apache-2.0", "MIT" ]
CDMiXer/Woolloomooloo
pkg/codegen/internal/test/testdata/aws-eks.pp.cs
11,670
C#
// // Copyright 2012, 2019 Carbonfrost Systems, Inc. (http://carbonfrost.com) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System; using System.Collections.Generic; namespace Carbonfrost.Commons.Core.Runtime { class DefaultActivationFactory : ActivationFactory { public override object CreateInstance(Type type, IEnumerable<KeyValuePair<string, object>> values, IServiceProvider serviceProvider, params Attribute[] attributes) { if (type == null) { throw new ArgumentNullException("type"); } attributes = attributes ?? Array.Empty<Attribute>(); return base.CreateInstance(type, values, serviceProvider, attributes); } } }
37.162162
95
0.637091
[ "Apache-2.0" ]
Carbonfrost/f-core
dotnet/src/Carbonfrost.Commons.Core/Runtime/DefaultActivationFactory.cs
1,375
C#
using System; using System.Collections.Generic; using System.Text; //https://blog.csdn.net/u011437229/article/details/53188837 namespace leetcodesln { public class LetterCasePermutation { public IList<string> LetterCasePermutationSln(string S) { List<string> resList = new List<string>(); Dfs(S, new StringBuilder(), 0,resList); return resList; } private void Dfs(string s, StringBuilder sb, int index, List<string> resList) { if (index == s.Length) { resList.Add(sb.ToString()); return; } char c = s[index]; if (Char.IsNumber(c)) { sb.Append(c); Dfs(s, sb, index + 1, resList); sb.Length--; } else { sb.Append(Char.ToLower(c)); Dfs(s, sb, index + 1, resList); sb.Length--; sb.Append(Char.ToUpper(c)); Dfs(s, sb, index + 1, resList); sb.Length--; } } } } /** * DFS算法思想: 一直往深处走,知道找到解或者走不下去为止 * dfs(depth,....) depth代表目前dfs的深度 * { * if(solution found || cannot go further) * { * //do stuff * return; * } * * 枚举下一个可能情况: dfs(depth +1, ...) * } * */
24.103448
85
0.461373
[ "MIT" ]
matwming/TrialOfTheGrasses
CSharp/leetcodesln/LetterCasePermutation.cs
1,482
C#
using System; namespace Aksl.BulkInsert.Configuration { public class BlockSettings { public static BlockSettings Default => new BlockSettings(); public BlockSettings() { BlockCount = Environment.ProcessorCount * 4;//块数 MinPerBlock = 20;//至少有一块8条 MaxPerBlock = 200;//至多 MaxDegreeOfParallelism = Environment.ProcessorCount * 2;//并行数 } public int BlockCount { get; set; } public int MinPerBlock { get; set; } public int MaxPerBlock { get; set; } public int MaxDegreeOfParallelism { get; set; } } }
25
73
0.6032
[ "MIT" ]
aksl2019/Aksl-3.0
Aksl.BulkInsert/Aksl.BulkInsert/Configure/BlockSettings.cs
653
C#
// *********************************************************************** // Copyright (c) Charlie Poole and TestCentric GUI contributors. // Licensed under the MIT License. See LICENSE.txt in root directory. // *********************************************************************** using System; using TestCentric.Engine; namespace TestCentric.Gui.Model { using Services; using Settings; /// <summary> /// TestServices caches commonly used services. /// </summary> public class TestServices : ITestServices { private IServiceLocator _services; private ITestEngine _testEngine; public TestServices(ITestEngine testEngine) { _testEngine = testEngine; _services = testEngine.Services; ExtensionService = GetService<IExtensionService>(); ResultService = GetService<IResultService>(); ProjectService = GetService<IProjectService>(); } #region ITestServices Implementation public IExtensionService ExtensionService { get; } public IResultService ResultService { get; } public IProjectService ProjectService { get; } #endregion #region IServiceLocator Implementation public T GetService<T>() where T : class { return _services.GetService<T>(); } public object GetService(Type serviceType) { return _services.GetService(serviceType); } #endregion } }
26.666667
74
0.576316
[ "MIT" ]
jurczakk/testcentric-gui
src/TestModel/model/TestServices.cs
1,520
C#
// <auto-generated> // 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. // </auto-generated> namespace Microsoft.Azure.Management.RecoveryServices.Backup.CrossRegionRestore.Models { using Newtonsoft.Json; using System.Linq; /// <summary> /// Operation status. /// </summary> public partial class OperationStatus { /// <summary> /// Initializes a new instance of the OperationStatus class. /// </summary> public OperationStatus() { CustomInit(); } /// <summary> /// Initializes a new instance of the OperationStatus class. /// </summary> /// <param name="id">ID of the operation.</param> /// <param name="name">Name of the operation.</param> /// <param name="status">Operation status. Possible values include: /// 'Invalid', 'InProgress', 'Succeeded', 'Failed', 'Canceled'</param> /// <param name="startTime">Operation start time. Format: /// ISO-8601.</param> /// <param name="endTime">Operation end time. Format: ISO-8601.</param> /// <param name="error">Error information related to this /// operation.</param> /// <param name="properties">Additional information associated with /// this operation.</param> public OperationStatus(string id = default(string), string name = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), OperationStatusError error = default(OperationStatusError), OperationStatusExtendedInfo properties = default(OperationStatusExtendedInfo)) { Id = id; Name = name; Status = status; StartTime = startTime; EndTime = endTime; Error = error; Properties = properties; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets ID of the operation. /// </summary> [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// <summary> /// Gets or sets name of the operation. /// </summary> [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// <summary> /// Gets or sets operation status. Possible values include: 'Invalid', /// 'InProgress', 'Succeeded', 'Failed', 'Canceled' /// </summary> [JsonProperty(PropertyName = "status")] public string Status { get; set; } /// <summary> /// Gets or sets operation start time. Format: ISO-8601. /// </summary> [JsonProperty(PropertyName = "startTime")] public System.DateTime? StartTime { get; set; } /// <summary> /// Gets or sets operation end time. Format: ISO-8601. /// </summary> [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// <summary> /// Gets or sets error information related to this operation. /// </summary> [JsonProperty(PropertyName = "error")] public OperationStatusError Error { get; set; } /// <summary> /// Gets or sets additional information associated with this operation. /// </summary> [JsonProperty(PropertyName = "properties")] public OperationStatusExtendedInfo Properties { get; set; } } }
37.171429
372
0.600307
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/recoveryservicesbackupCrossregionRestoe/Generated/Models/OperationStatus.cs
3,903
C#
using System; using System.CodeDom; using System.Configuration; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Threading; namespace Looksfamiliar.D2C2D.Dashboard { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { // GetDeviceList(); // if (DeviceList.Items.Count == 0) // { // StartButton.IsEnabled = false; // StopButton.IsEnabled = false; // PingButton.IsEnabled = false; // } } private void StartButton_Click(object sender, RoutedEventArgs e) { } private void StopButton_Click(object sender, RoutedEventArgs e) { } private async void ProvisionButton_Click(object sender, RoutedEventArgs e) { } //private void GetDeviceList() //{ // var devices = _provisionM.GetAll(); // foreach (var device in devices.list) // { // DeviceList.Items.Add(device.serialnumber); // } // DeviceList.SelectedIndex = 0; //} //private static async Task<d2c2d.MessageModels.Location> GetLocationAsync() //{ // var client = new HttpClient(); // var json = await client.GetStringAsync("http://ip-api.com/json"); // var location = JsonConvert.DeserializeObject<d2c2d.MessageModels.Location>(json); // return location; //} private void DeviceList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { //if (DeviceList.Items.Count == 0) return; //var deviceId = (string)DeviceList.SelectedItems[0]; //PingFeed.Clear(); //TelemetryFeed.Clear(); //AlarmFeed.Clear(); //_currDevice = _provisionM.GetById(deviceId); } } }
26.807229
95
0.577079
[ "MIT" ]
bobfamiliar/d2c2d
dashboard/Dashboard/MainWindow.xaml.cs
2,227
C#
using System; namespace KissLogApp.Models { public class ErrorViewModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } }
18.909091
70
0.668269
[ "MIT" ]
rafaelraah/KissLogApp
KissLogApp/KissLogApp/Models/ErrorViewModel.cs
208
C#
namespace DotNetInterceptTester.My_System.ComponentModel.UInt64Converter { public class GetStandardValues_System_ComponentModel_UInt64Converter { public static bool _GetStandardValues_System_ComponentModel_UInt64Converter( ) { //Parameters //ReturnType/Value System.Collections.ICollection returnVal_Real = null; System.Collections.ICollection returnVal_Intercepted = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.ComponentModel.UInt64Converter.GetStandardValues(); } catch( Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.ComponentModel.UInt64Converter.GetStandardValues(); } catch( Exception e ) { exception_Intercepted = e; } Return ( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); } } }
23.553191
127
0.717254
[ "MIT" ]
SecurityInnovation/Holodeck
Test/Automation/DotNetInterceptTester/DotNetInterceptTester/System.ComponentModel.UInt64Converter.GetStandardValues().cs
1,107
C#
using Fame; using System; using FILE; using Dynamix; using FAMIX; using System.Collections.Generic; namespace FAMIX { [FamePackage("FAMIX")] [FameDescription("Trait")] public class Trait : FAMIX.Type { private List<FAMIX.TraitUsage> incomingTraitUsages = new List<FAMIX.TraitUsage>(); [FameProperty(Name = "incomingTraitUsages", Opposite = "trait")] public List <FAMIX.TraitUsage> IncomingTraitUsages { get { return incomingTraitUsages; } set { incomingTraitUsages = value; } } public void AddIncomingTraitUsage(FAMIX.TraitUsage one) { incomingTraitUsages.Add(one); } } }
22.344828
86
0.683642
[ "Apache-2.0" ]
impetuosa/roslyn2famix
RoslynMonoFamix/Model/FAMIX/Trait.cs
648
C#
using NHapi.Base.Parser; using NHapi.Base; using NHapi.Base.Log; using System; using System.Collections.Generic; using NHapi.Model.V25.Segment; using NHapi.Model.V25.Datatype; using NHapi.Base.Model; namespace NHapi.Model.V25.Group { ///<summary> ///Represents the RDE_O11_INSURANCE Group. A Group is an ordered collection of message /// segments that can repeat together or be optionally in/excluded together. /// This Group contains the following elements: ///<ol> ///<li>0: IN1 (Insurance) </li> ///<li>1: IN2 (Insurance Additional Information) optional </li> ///<li>2: IN3 (Insurance Additional Information, Certification) optional </li> ///</ol> ///</summary> [Serializable] public class RDE_O11_INSURANCE : AbstractGroup { ///<summary> /// Creates a new RDE_O11_INSURANCE Group. ///</summary> public RDE_O11_INSURANCE(IGroup parent, IModelClassFactory factory) : base(parent, factory){ try { this.add(typeof(IN1), true, false); this.add(typeof(IN2), false, false); this.add(typeof(IN3), false, false); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating RDE_O11_INSURANCE - this is probably a bug in the source code generator.", e); } } ///<summary> /// Returns IN1 (Insurance) - creates it if necessary ///</summary> public IN1 IN1 { get{ IN1 ret = null; try { ret = (IN1)this.GetStructure("IN1"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns IN2 (Insurance Additional Information) - creates it if necessary ///</summary> public IN2 IN2 { get{ IN2 ret = null; try { ret = (IN2)this.GetStructure("IN2"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns IN3 (Insurance Additional Information, Certification) - creates it if necessary ///</summary> public IN3 IN3 { get{ IN3 ret = null; try { ret = (IN3)this.GetStructure("IN3"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } } }
31.238636
156
0.658421
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
afaonline/nHapi
src/NHapi.Model.V25/Group/RDE_O11_INSURANCE.cs
2,749
C#
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. using System; using System.Configuration; using System.Data.Common; using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration { /// <summary> /// Describes a <see cref="GenericDatabase"/> instance, aggregating information from a /// <see cref="ConnectionStringSettings"/>. /// </summary> public class GenericDatabaseData : DatabaseData { ///<summary> /// Initializes a new instance of the <see cref="GenericDatabaseData"/> class with a connection string and a configuration /// source. ///</summary> ///<param name="connectionStringSettings">The <see cref="ConnectionStringSettings"/> for the represented database.</param> ///<param name="configurationSource">The <see cref="IConfigurationSource"/> from which additional information can /// be retrieved if necessary.</param> public GenericDatabaseData(ConnectionStringSettings connectionStringSettings, Func<string, ConfigurationSection> configurationSource) : base(connectionStringSettings, configurationSource) { } /// <summary> /// Gets the name of the ADO.NET provider for the represented database. /// </summary> public string ProviderName { get { return ConnectionStringSettings.ProviderName; } } /// <summary> /// Builds the <see cref="Database" /> represented by this configuration object. /// </summary> /// <returns> /// A database. /// </returns> public override Database BuildDatabase() { return new GenericDatabase(this.ConnectionString, DbProviderFactories.GetFactory(this.ProviderName)); } } }
40.145833
141
0.667878
[ "Apache-2.0" ]
EnterpriseLibrary/data-access-application-block
source/Src/Data/Configuration/GenericDatabaseData.cs
1,927
C#
using Microsoft.EntityFrameworkCore.Migrations; namespace Advert.Database.Migrations { public partial class AddedBasicBannerTable : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( "Banners", table => new { IdAdvertisment = table.Column<int>(nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column<int>(nullable: false), Price = table.Column<decimal>(nullable: false), IdCampaign = table.Column<int>(nullable: false), Area = table.Column<decimal>(nullable: false), CampaignIdCampaign = table.Column<int>(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Banners", x => x.IdAdvertisment); table.ForeignKey( "FK_Banners_Campaigns_CampaignIdCampaign", x => x.CampaignIdCampaign, "Campaigns", "IdCampaign", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( "IX_Banners_CampaignIdCampaign", "Banners", "CampaignIdCampaign"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( "Banners"); } } }
37.068182
74
0.507051
[ "Unlicense" ]
MPD97/APBD-Project
APBD-Advert-Project/src/Core/Advert_Database/Migrations/20200614134914_AddedBasicBannerTable.cs
1,633
C#
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Collections.Generic; using System.Data; using System.Drawing; using System.IO; using System.Reflection; using log4net; using Mono.Data.SqliteClient; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Data.SQLiteLegacy { /// <summary> /// A RegionData Interface to the SQLite database /// </summary> public class SQLiteSimulationData : ISimulationDataStore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private const string primSelect = "select * from prims"; private const string shapeSelect = "select * from primshapes"; private const string itemsSelect = "select * from primitems"; private const string terrainSelect = "select * from terrain limit 1"; private const string landSelect = "select * from land"; private const string landAccessListSelect = "select distinct * from landaccesslist"; private const string regionbanListSelect = "select * from regionban"; private const string regionSettingsSelect = "select * from regionsettings"; private DataSet ds; private SqliteDataAdapter primDa; private SqliteDataAdapter shapeDa; private SqliteDataAdapter itemsDa; private SqliteDataAdapter terrainDa; private SqliteDataAdapter landDa; private SqliteDataAdapter landAccessListDa; private SqliteDataAdapter regionSettingsDa; private SqliteConnection m_conn; private String m_connectionString; public SQLiteSimulationData() { } public SQLiteSimulationData(string connectionString) { Initialise(connectionString); } // Temporary attribute while this is experimental /*********************************************************************** * * Public Interface Functions * **********************************************************************/ /// <summary> /// <list type="bullet"> /// <item>Initialises RegionData Interface</item> /// <item>Loads and initialises a new SQLite connection and maintains it.</item> /// </list> /// </summary> /// <param name="connectionString">the connection string</param> public void Initialise(string connectionString) { m_connectionString = connectionString; ds = new DataSet(); m_log.Info("[REGION DB]: Sqlite - connecting: " + connectionString); m_conn = new SqliteConnection(m_connectionString); m_conn.Open(); SqliteCommand primSelectCmd = new SqliteCommand(primSelect, m_conn); primDa = new SqliteDataAdapter(primSelectCmd); // SqliteCommandBuilder primCb = new SqliteCommandBuilder(primDa); SqliteCommand shapeSelectCmd = new SqliteCommand(shapeSelect, m_conn); shapeDa = new SqliteDataAdapter(shapeSelectCmd); // SqliteCommandBuilder shapeCb = new SqliteCommandBuilder(shapeDa); SqliteCommand itemsSelectCmd = new SqliteCommand(itemsSelect, m_conn); itemsDa = new SqliteDataAdapter(itemsSelectCmd); SqliteCommand terrainSelectCmd = new SqliteCommand(terrainSelect, m_conn); terrainDa = new SqliteDataAdapter(terrainSelectCmd); SqliteCommand landSelectCmd = new SqliteCommand(landSelect, m_conn); landDa = new SqliteDataAdapter(landSelectCmd); SqliteCommand landAccessListSelectCmd = new SqliteCommand(landAccessListSelect, m_conn); landAccessListDa = new SqliteDataAdapter(landAccessListSelectCmd); SqliteCommand regionSettingsSelectCmd = new SqliteCommand(regionSettingsSelect, m_conn); regionSettingsDa = new SqliteDataAdapter(regionSettingsSelectCmd); // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(m_conn, assem, "RegionStore"); m.Update(); lock (ds) { ds.Tables.Add(createPrimTable()); setupPrimCommands(primDa, m_conn); primDa.Fill(ds.Tables["prims"]); ds.Tables.Add(createShapeTable()); setupShapeCommands(shapeDa, m_conn); ds.Tables.Add(createItemsTable()); setupItemsCommands(itemsDa, m_conn); itemsDa.Fill(ds.Tables["primitems"]); ds.Tables.Add(createTerrainTable()); setupTerrainCommands(terrainDa, m_conn); ds.Tables.Add(createLandTable()); setupLandCommands(landDa, m_conn); ds.Tables.Add(createLandAccessListTable()); setupLandAccessCommands(landAccessListDa, m_conn); ds.Tables.Add(createRegionSettingsTable()); setupRegionSettingsCommands(regionSettingsDa, m_conn); // WORKAROUND: This is a work around for sqlite on // windows, which gets really unhappy with blob columns // that have no sample data in them. At some point we // need to actually find a proper way to handle this. try { shapeDa.Fill(ds.Tables["primshapes"]); } catch (Exception) { m_log.Info("[REGION DB]: Caught fill error on primshapes table"); } try { terrainDa.Fill(ds.Tables["terrain"]); } catch (Exception) { m_log.Info("[REGION DB]: Caught fill error on terrain table"); } try { landDa.Fill(ds.Tables["land"]); } catch (Exception) { m_log.Info("[REGION DB]: Caught fill error on land table"); } try { landAccessListDa.Fill(ds.Tables["landaccesslist"]); } catch (Exception) { m_log.Info("[REGION DB]: Caught fill error on landaccesslist table"); } try { regionSettingsDa.Fill(ds.Tables["regionsettings"]); } catch (Exception) { m_log.Info("[REGION DB]: Caught fill error on regionsettings table"); } return; } } public void Dispose() { if (m_conn != null) { m_conn.Close(); m_conn = null; } if (ds != null) { ds.Dispose(); ds = null; } if (primDa != null) { primDa.Dispose(); primDa = null; } if (shapeDa != null) { shapeDa.Dispose(); shapeDa = null; } if (itemsDa != null) { itemsDa.Dispose(); itemsDa = null; } if (terrainDa != null) { terrainDa.Dispose(); terrainDa = null; } if (landDa != null) { landDa.Dispose(); landDa = null; } if (landAccessListDa != null) { landAccessListDa.Dispose(); landAccessListDa = null; } if (regionSettingsDa != null) { regionSettingsDa.Dispose(); regionSettingsDa = null; } } public void StoreRegionSettings(RegionSettings rs) { lock (ds) { DataTable regionsettings = ds.Tables["regionsettings"]; DataRow settingsRow = regionsettings.Rows.Find(rs.RegionUUID.ToString()); if (settingsRow == null) { settingsRow = regionsettings.NewRow(); fillRegionSettingsRow(settingsRow, rs); regionsettings.Rows.Add(settingsRow); } else { fillRegionSettingsRow(settingsRow, rs); } Commit(); } } public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) { //This connector doesn't support the windlight module yet //Return default LL windlight settings return new RegionLightShareData(); } public void RemoveRegionWindlightSettings(UUID regionID) { } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet } public RegionSettings LoadRegionSettings(UUID regionUUID) { lock (ds) { DataTable regionsettings = ds.Tables["regionsettings"]; string searchExp = "regionUUID = '" + regionUUID.ToString() + "'"; DataRow[] rawsettings = regionsettings.Select(searchExp); if (rawsettings.Length == 0) { RegionSettings rs = new RegionSettings(); rs.RegionUUID = regionUUID; rs.OnSave += StoreRegionSettings; StoreRegionSettings(rs); return rs; } DataRow row = rawsettings[0]; RegionSettings newSettings = buildRegionSettings(row); newSettings.OnSave += StoreRegionSettings; return newSettings; } } /// <summary> /// Adds an object into region storage /// </summary> /// <param name="obj">the object</param> /// <param name="regionUUID">the region UUID</param> public void StoreObject(SceneObjectGroup obj, UUID regionUUID) { uint flags = obj.RootPart.GetEffectiveObjectFlags(); // Eligibility check // if ((flags & (uint)PrimFlags.Temporary) != 0) return; if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) return; lock (ds) { foreach (SceneObjectPart prim in obj.Parts) { // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); addPrim(prim, obj.UUID, regionUUID); } } Commit(); // m_log.Info("[Dump of prims]: " + ds.GetXml()); } /// <summary> /// Removes an object from region storage /// </summary> /// <param name="obj">the object</param> /// <param name="regionUUID">the region UUID</param> public void RemoveObject(UUID obj, UUID regionUUID) { // m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.Guid, regionUUID); DataTable prims = ds.Tables["prims"]; DataTable shapes = ds.Tables["primshapes"]; string selectExp = "SceneGroupID = '" + obj + "' and RegionUUID = '" + regionUUID + "'"; lock (ds) { DataRow[] primRows = prims.Select(selectExp); foreach (DataRow row in primRows) { // Remove shape rows UUID uuid = new UUID((string) row["UUID"]); DataRow shapeRow = shapes.Rows.Find(uuid.ToString()); if (shapeRow != null) { shapeRow.Delete(); } RemoveItems(uuid); // Remove prim row row.Delete(); } } Commit(); } /// <summary> /// Remove all persisted items of the given prim. /// The caller must acquire the necessrary synchronization locks and commit or rollback changes. /// </summary> /// <param name="uuid">The item UUID</param> private void RemoveItems(UUID uuid) { DataTable items = ds.Tables["primitems"]; String sql = String.Format("primID = '{0}'", uuid); DataRow[] itemRows = items.Select(sql); foreach (DataRow itemRow in itemRows) { itemRow.Delete(); } } /// <summary> /// Load persisted objects from region storage. /// </summary> /// <param name="regionUUID">The region UUID</param> /// <returns>List of loaded groups</returns> public List<SceneObjectGroup> LoadObjects(UUID regionUUID) { Dictionary<UUID, SceneObjectGroup> createdObjects = new Dictionary<UUID, SceneObjectGroup>(); List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); DataTable prims = ds.Tables["prims"]; DataTable shapes = ds.Tables["primshapes"]; string byRegion = "RegionUUID = '" + regionUUID + "'"; lock (ds) { DataRow[] primsForRegion = prims.Select(byRegion); m_log.Info("[REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); // First, create all groups foreach (DataRow primRow in primsForRegion) { try { SceneObjectPart prim = null; string uuid = (string) primRow["UUID"]; string objID = (string) primRow["SceneGroupID"]; if (uuid == objID) //is new SceneObjectGroup ? { prim = buildPrim(primRow); DataRow shapeRow = shapes.Rows.Find(prim.UUID.ToString()); if (shapeRow != null) { prim.Shape = buildShape(shapeRow); } else { m_log.Info( "[REGION DB]: No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } SceneObjectGroup group = new SceneObjectGroup(prim); createdObjects.Add(group.UUID, group); retvals.Add(group); LoadItems(prim); } } catch (Exception e) { m_log.Error("[REGION DB]: Failed create prim object in new group, exception and data follows"); m_log.Info("[REGION DB]: " + e.ToString()); foreach (DataColumn col in prims.Columns) { m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]); } } } // Now fill the groups with part data foreach (DataRow primRow in primsForRegion) { try { SceneObjectPart prim = null; string uuid = (string) primRow["UUID"]; string objID = (string) primRow["SceneGroupID"]; if (uuid != objID) //is new SceneObjectGroup ? { prim = buildPrim(primRow); DataRow shapeRow = shapes.Rows.Find(prim.UUID.ToString()); if (shapeRow != null) { prim.Shape = buildShape(shapeRow); } else { m_log.Warn( "[REGION DB]: No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } createdObjects[new UUID(objID)].AddPart(prim); LoadItems(prim); } } catch (Exception e) { m_log.Error("[REGION DB]: Failed create prim object in group, exception and data follows"); m_log.Info("[REGION DB]: " + e.ToString()); foreach (DataColumn col in prims.Columns) { m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]); } } } } return retvals; } /// <summary> /// Load in a prim's persisted inventory. /// </summary> /// <param name="prim">the prim</param> private void LoadItems(SceneObjectPart prim) { //m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); DataTable dbItems = ds.Tables["primitems"]; String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); DataRow[] dbItemRows = dbItems.Select(sql); IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); foreach (DataRow row in dbItemRows) { TaskInventoryItem item = buildItem(row); inventory.Add(item); //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); } prim.Inventory.RestoreInventoryItems(inventory); } /// <summary> /// Store a terrain revision in region storage /// </summary> /// <param name="ter">terrain heightfield</param> /// <param name="regionID">region UUID</param> public void StoreTerrain(double[,] ter, UUID regionID) { lock (ds) { int revision = Util.UnixTimeSinceEpoch(); // This is added to get rid of the infinitely growing // terrain databases which negatively impact on SQLite // over time. Before reenabling this feature there // needs to be a limitter put on the number of // revisions in the database, as this old // implementation is a DOS attack waiting to happen. using ( SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision <= :Revision", m_conn)) { cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); cmd.ExecuteNonQuery(); } // the following is an work around for .NET. The perf // issues associated with it aren't as bad as you think. m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString()); String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" + " values(:RegionUUID, :Revision, :Heightfield)"; using (SqliteCommand cmd = new SqliteCommand(sql, m_conn)) { cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); cmd.ExecuteNonQuery(); } } } /// <summary> /// Load the latest terrain revision from region storage /// </summary> /// <param name="regionID">the region UUID</param> /// <returns>Heightfield data</returns> public double[,] LoadTerrain(UUID regionID) { lock (ds) { double[,] terret = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; terret.Initialize(); String sql = "select RegionUUID, Revision, Heightfield from terrain" + " where RegionUUID=:RegionUUID order by Revision desc"; using (SqliteCommand cmd = new SqliteCommand(sql, m_conn)) { cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); using (IDataReader row = cmd.ExecuteReader()) { int rev = 0; if (row.Read()) { // TODO: put this into a function using (MemoryStream str = new MemoryStream((byte[])row["Heightfield"])) { using (BinaryReader br = new BinaryReader(str)) { for (int x = 0; x < (int)Constants.RegionSize; x++) { for (int y = 0; y < (int)Constants.RegionSize; y++) { terret[x, y] = br.ReadDouble(); } } } } rev = (int) row["Revision"]; } else { m_log.Info("[REGION DB]: No terrain found for region"); return null; } m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString()); } } return terret; } } /// <summary> /// /// </summary> /// <param name="globalID"></param> public void RemoveLandObject(UUID globalID) { lock (ds) { // Can't use blanket SQL statements when using SqlAdapters unless you re-read the data into the adapter // after you're done. // replaced below code with the SqliteAdapter version. //using (SqliteCommand cmd = new SqliteCommand("delete from land where UUID=:UUID", m_conn)) //{ // cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString())); // cmd.ExecuteNonQuery(); //} //using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:UUID", m_conn)) //{ // cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString())); // cmd.ExecuteNonQuery(); //} DataTable land = ds.Tables["land"]; DataTable landaccesslist = ds.Tables["landaccesslist"]; DataRow landRow = land.Rows.Find(globalID.ToString()); if (landRow != null) { land.Rows.Remove(landRow); } List<DataRow> rowsToDelete = new List<DataRow>(); foreach (DataRow rowToCheck in landaccesslist.Rows) { if (rowToCheck["LandUUID"].ToString() == globalID.ToString()) rowsToDelete.Add(rowToCheck); } for (int iter = 0; iter < rowsToDelete.Count; iter++) { landaccesslist.Rows.Remove(rowsToDelete[iter]); } } Commit(); } /// <summary> /// /// </summary> /// <param name="parcel"></param> public void StoreLandObject(ILandObject parcel) { lock (ds) { DataTable land = ds.Tables["land"]; DataTable landaccesslist = ds.Tables["landaccesslist"]; DataRow landRow = land.Rows.Find(parcel.LandData.GlobalID.ToString()); if (landRow == null) { landRow = land.NewRow(); fillLandRow(landRow, parcel.LandData, parcel.RegionUUID); land.Rows.Add(landRow); } else { fillLandRow(landRow, parcel.LandData, parcel.RegionUUID); } // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around //using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", m_conn)) //{ // cmd.Parameters.Add(new SqliteParameter(":LandUUID", parcel.LandData.GlobalID.ToString())); // cmd.ExecuteNonQuery(); // } // This is the slower.. but more appropriate thing to do // We can't modify the table with direct queries before calling Commit() and re-filling them. List<DataRow> rowsToDelete = new List<DataRow>(); foreach (DataRow rowToCheck in landaccesslist.Rows) { if (rowToCheck["LandUUID"].ToString() == parcel.LandData.GlobalID.ToString()) rowsToDelete.Add(rowToCheck); } for (int iter = 0; iter < rowsToDelete.Count; iter++) { landaccesslist.Rows.Remove(rowsToDelete[iter]); } rowsToDelete.Clear(); foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) { DataRow newAccessRow = landaccesslist.NewRow(); fillLandAccessRow(newAccessRow, entry, parcel.LandData.GlobalID); landaccesslist.Rows.Add(newAccessRow); } } Commit(); } /// <summary> /// /// </summary> /// <param name="regionUUID"></param> /// <returns></returns> public List<LandData> LoadLandObjects(UUID regionUUID) { List<LandData> landDataForRegion = new List<LandData>(); lock (ds) { DataTable land = ds.Tables["land"]; DataTable landaccesslist = ds.Tables["landaccesslist"]; string searchExp = "RegionUUID = '" + regionUUID + "'"; DataRow[] rawDataForRegion = land.Select(searchExp); foreach (DataRow rawDataLand in rawDataForRegion) { LandData newLand = buildLandData(rawDataLand); string accessListSearchExp = "LandUUID = '" + newLand.GlobalID + "'"; DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp); foreach (DataRow rawDataLandAccess in rawDataForLandAccessList) { newLand.ParcelAccessList.Add(buildLandAccessData(rawDataLandAccess)); } landDataForRegion.Add(newLand); } } return landDataForRegion; } /// <summary> /// /// </summary> public void Commit() { lock (ds) { primDa.Update(ds, "prims"); shapeDa.Update(ds, "primshapes"); itemsDa.Update(ds, "primitems"); terrainDa.Update(ds, "terrain"); landDa.Update(ds, "land"); landAccessListDa.Update(ds, "landaccesslist"); try { regionSettingsDa.Update(ds, "regionsettings"); } catch (SqliteExecutionException SqlEx) { if (SqlEx.Message.Contains("logic error")) { throw new Exception( "There was a SQL error or connection string configuration error when saving the region settings. This could be a bug, it could also happen if ConnectionString is defined in the [DatabaseService] section of StandaloneCommon.ini in the config_include folder. This could also happen if the config_include folder doesn't exist or if the OpenSim.ini [Architecture] section isn't set. If this is your first time running OpenSimulator, please restart the simulator and bug a developer to fix this!", SqlEx); } else { throw SqlEx; } } ds.AcceptChanges(); } } /// <summary> /// See <see cref="Commit"/> /// </summary> public void Shutdown() { Commit(); } /*********************************************************************** * * Database Definition Functions * * This should be db agnostic as we define them in ADO.NET terms * **********************************************************************/ /// <summary> /// /// </summary> /// <param name="dt"></param> /// <param name="name"></param> /// <param name="type"></param> private static void createCol(DataTable dt, string name, Type type) { DataColumn col = new DataColumn(name, type); dt.Columns.Add(col); } /// <summary> /// Creates the "terrain" table /// </summary> /// <returns>terrain table DataTable</returns> private static DataTable createTerrainTable() { DataTable terrain = new DataTable("terrain"); createCol(terrain, "RegionUUID", typeof (String)); createCol(terrain, "Revision", typeof (Int32)); createCol(terrain, "Heightfield", typeof (Byte[])); return terrain; } /// <summary> /// Creates the "prims" table /// </summary> /// <returns>prim table DataTable</returns> private static DataTable createPrimTable() { DataTable prims = new DataTable("prims"); createCol(prims, "UUID", typeof (String)); createCol(prims, "RegionUUID", typeof (String)); createCol(prims, "CreationDate", typeof (Int32)); createCol(prims, "Name", typeof (String)); createCol(prims, "SceneGroupID", typeof (String)); // various text fields createCol(prims, "Text", typeof (String)); createCol(prims, "ColorR", typeof (Int32)); createCol(prims, "ColorG", typeof (Int32)); createCol(prims, "ColorB", typeof (Int32)); createCol(prims, "ColorA", typeof (Int32)); createCol(prims, "Description", typeof (String)); createCol(prims, "SitName", typeof (String)); createCol(prims, "TouchName", typeof (String)); // permissions createCol(prims, "ObjectFlags", typeof (Int32)); createCol(prims, "CreatorID", typeof (String)); createCol(prims, "OwnerID", typeof (String)); createCol(prims, "GroupID", typeof (String)); createCol(prims, "LastOwnerID", typeof (String)); createCol(prims, "OwnerMask", typeof (Int32)); createCol(prims, "NextOwnerMask", typeof (Int32)); createCol(prims, "GroupMask", typeof (Int32)); createCol(prims, "EveryoneMask", typeof (Int32)); createCol(prims, "BaseMask", typeof (Int32)); // vectors createCol(prims, "PositionX", typeof (Double)); createCol(prims, "PositionY", typeof (Double)); createCol(prims, "PositionZ", typeof (Double)); createCol(prims, "GroupPositionX", typeof (Double)); createCol(prims, "GroupPositionY", typeof (Double)); createCol(prims, "GroupPositionZ", typeof (Double)); createCol(prims, "VelocityX", typeof (Double)); createCol(prims, "VelocityY", typeof (Double)); createCol(prims, "VelocityZ", typeof (Double)); createCol(prims, "AngularVelocityX", typeof (Double)); createCol(prims, "AngularVelocityY", typeof (Double)); createCol(prims, "AngularVelocityZ", typeof (Double)); createCol(prims, "AccelerationX", typeof (Double)); createCol(prims, "AccelerationY", typeof (Double)); createCol(prims, "AccelerationZ", typeof (Double)); // quaternions createCol(prims, "RotationX", typeof (Double)); createCol(prims, "RotationY", typeof (Double)); createCol(prims, "RotationZ", typeof (Double)); createCol(prims, "RotationW", typeof (Double)); // sit target createCol(prims, "SitTargetOffsetX", typeof (Double)); createCol(prims, "SitTargetOffsetY", typeof (Double)); createCol(prims, "SitTargetOffsetZ", typeof (Double)); createCol(prims, "SitTargetOrientW", typeof (Double)); createCol(prims, "SitTargetOrientX", typeof (Double)); createCol(prims, "SitTargetOrientY", typeof (Double)); createCol(prims, "SitTargetOrientZ", typeof (Double)); createCol(prims, "PayPrice", typeof(Int32)); createCol(prims, "PayButton1", typeof(Int32)); createCol(prims, "PayButton2", typeof(Int32)); createCol(prims, "PayButton3", typeof(Int32)); createCol(prims, "PayButton4", typeof(Int32)); createCol(prims, "LoopedSound", typeof(String)); createCol(prims, "LoopedSoundGain", typeof(Double)); createCol(prims, "TextureAnimation", typeof(String)); createCol(prims, "ParticleSystem", typeof(String)); createCol(prims, "OmegaX", typeof(Double)); createCol(prims, "OmegaY", typeof(Double)); createCol(prims, "OmegaZ", typeof(Double)); createCol(prims, "CameraEyeOffsetX", typeof(Double)); createCol(prims, "CameraEyeOffsetY", typeof(Double)); createCol(prims, "CameraEyeOffsetZ", typeof(Double)); createCol(prims, "CameraAtOffsetX", typeof(Double)); createCol(prims, "CameraAtOffsetY", typeof(Double)); createCol(prims, "CameraAtOffsetZ", typeof(Double)); createCol(prims, "ForceMouselook", typeof(Int16)); createCol(prims, "ScriptAccessPin", typeof(Int32)); createCol(prims, "AllowedDrop", typeof(Int16)); createCol(prims, "DieAtEdge", typeof(Int16)); createCol(prims, "SalePrice", typeof(Int32)); createCol(prims, "SaleType", typeof(Int16)); // click action createCol(prims, "ClickAction", typeof (Byte)); createCol(prims, "Material", typeof(Byte)); createCol(prims, "CollisionSound", typeof(String)); createCol(prims, "CollisionSoundVolume", typeof(Double)); createCol(prims, "VolumeDetect", typeof(Int16)); // Add in contraints prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]}; return prims; } /// <summary> /// Creates "primshapes" table /// </summary> /// <returns>shape table DataTable</returns> private static DataTable createShapeTable() { DataTable shapes = new DataTable("primshapes"); createCol(shapes, "UUID", typeof (String)); // shape is an enum createCol(shapes, "Shape", typeof (Int32)); // vectors createCol(shapes, "ScaleX", typeof (Double)); createCol(shapes, "ScaleY", typeof (Double)); createCol(shapes, "ScaleZ", typeof (Double)); // paths createCol(shapes, "PCode", typeof (Int32)); createCol(shapes, "PathBegin", typeof (Int32)); createCol(shapes, "PathEnd", typeof (Int32)); createCol(shapes, "PathScaleX", typeof (Int32)); createCol(shapes, "PathScaleY", typeof (Int32)); createCol(shapes, "PathShearX", typeof (Int32)); createCol(shapes, "PathShearY", typeof (Int32)); createCol(shapes, "PathSkew", typeof (Int32)); createCol(shapes, "PathCurve", typeof (Int32)); createCol(shapes, "PathRadiusOffset", typeof (Int32)); createCol(shapes, "PathRevolutions", typeof (Int32)); createCol(shapes, "PathTaperX", typeof (Int32)); createCol(shapes, "PathTaperY", typeof (Int32)); createCol(shapes, "PathTwist", typeof (Int32)); createCol(shapes, "PathTwistBegin", typeof (Int32)); // profile createCol(shapes, "ProfileBegin", typeof (Int32)); createCol(shapes, "ProfileEnd", typeof (Int32)); createCol(shapes, "ProfileCurve", typeof (Int32)); createCol(shapes, "ProfileHollow", typeof (Int32)); createCol(shapes, "State", typeof(Int32)); // text TODO: this isn't right, but I'm not sure the right // way to specify this as a blob atm createCol(shapes, "Texture", typeof (Byte[])); createCol(shapes, "ExtraParams", typeof (Byte[])); shapes.PrimaryKey = new DataColumn[] {shapes.Columns["UUID"]}; return shapes; } /// <summary> /// creates "primitems" table /// </summary> /// <returns>item table DataTable</returns> private static DataTable createItemsTable() { DataTable items = new DataTable("primitems"); createCol(items, "itemID", typeof (String)); createCol(items, "primID", typeof (String)); createCol(items, "assetID", typeof (String)); createCol(items, "parentFolderID", typeof (String)); createCol(items, "invType", typeof (Int32)); createCol(items, "assetType", typeof (Int32)); createCol(items, "name", typeof (String)); createCol(items, "description", typeof (String)); createCol(items, "creationDate", typeof (Int64)); createCol(items, "creatorID", typeof (String)); createCol(items, "ownerID", typeof (String)); createCol(items, "lastOwnerID", typeof (String)); createCol(items, "groupID", typeof (String)); createCol(items, "nextPermissions", typeof (UInt32)); createCol(items, "currentPermissions", typeof (UInt32)); createCol(items, "basePermissions", typeof (UInt32)); createCol(items, "everyonePermissions", typeof (UInt32)); createCol(items, "groupPermissions", typeof (UInt32)); createCol(items, "flags", typeof (UInt32)); items.PrimaryKey = new DataColumn[] { items.Columns["itemID"] }; return items; } /// <summary> /// Creates "land" table /// </summary> /// <returns>land table DataTable</returns> private static DataTable createLandTable() { DataTable land = new DataTable("land"); createCol(land, "UUID", typeof (String)); createCol(land, "RegionUUID", typeof (String)); createCol(land, "LocalLandID", typeof (UInt32)); // Bitmap is a byte[512] createCol(land, "Bitmap", typeof (Byte[])); createCol(land, "Name", typeof (String)); createCol(land, "Desc", typeof (String)); createCol(land, "OwnerUUID", typeof (String)); createCol(land, "IsGroupOwned", typeof (Boolean)); createCol(land, "Area", typeof (Int32)); createCol(land, "AuctionID", typeof (Int32)); //Unemplemented createCol(land, "Category", typeof (Int32)); //Enum OpenMetaverse.Parcel.ParcelCategory createCol(land, "ClaimDate", typeof (Int32)); createCol(land, "ClaimPrice", typeof (Int32)); createCol(land, "GroupUUID", typeof (string)); createCol(land, "SalePrice", typeof (Int32)); createCol(land, "LandStatus", typeof (Int32)); //Enum. OpenMetaverse.Parcel.ParcelStatus createCol(land, "LandFlags", typeof (UInt32)); createCol(land, "LandingType", typeof (Byte)); createCol(land, "MediaAutoScale", typeof (Byte)); createCol(land, "MediaTextureUUID", typeof (String)); createCol(land, "MediaURL", typeof (String)); createCol(land, "MusicURL", typeof (String)); createCol(land, "PassHours", typeof (Double)); createCol(land, "PassPrice", typeof (UInt32)); createCol(land, "SnapshotUUID", typeof (String)); createCol(land, "UserLocationX", typeof (Double)); createCol(land, "UserLocationY", typeof (Double)); createCol(land, "UserLocationZ", typeof (Double)); createCol(land, "UserLookAtX", typeof (Double)); createCol(land, "UserLookAtY", typeof (Double)); createCol(land, "UserLookAtZ", typeof (Double)); createCol(land, "AuthbuyerID", typeof(String)); createCol(land, "OtherCleanTime", typeof(Int32)); land.PrimaryKey = new DataColumn[] {land.Columns["UUID"]}; return land; } /// <summary> /// create "landaccesslist" table /// </summary> /// <returns>Landacceslist DataTable</returns> private static DataTable createLandAccessListTable() { DataTable landaccess = new DataTable("landaccesslist"); createCol(landaccess, "LandUUID", typeof (String)); createCol(landaccess, "AccessUUID", typeof (String)); createCol(landaccess, "Flags", typeof (UInt32)); return landaccess; } private static DataTable createRegionSettingsTable() { DataTable regionsettings = new DataTable("regionsettings"); createCol(regionsettings, "regionUUID", typeof(String)); createCol(regionsettings, "block_terraform", typeof (Int32)); createCol(regionsettings, "block_fly", typeof (Int32)); createCol(regionsettings, "allow_damage", typeof (Int32)); createCol(regionsettings, "restrict_pushing", typeof (Int32)); createCol(regionsettings, "allow_land_resell", typeof (Int32)); createCol(regionsettings, "allow_land_join_divide", typeof (Int32)); createCol(regionsettings, "block_show_in_search", typeof (Int32)); createCol(regionsettings, "agent_limit", typeof (Int32)); createCol(regionsettings, "object_bonus", typeof (Double)); createCol(regionsettings, "maturity", typeof (Int32)); createCol(regionsettings, "disable_scripts", typeof (Int32)); createCol(regionsettings, "disable_collisions", typeof (Int32)); createCol(regionsettings, "disable_physics", typeof (Int32)); createCol(regionsettings, "terrain_texture_1", typeof(String)); createCol(regionsettings, "terrain_texture_2", typeof(String)); createCol(regionsettings, "terrain_texture_3", typeof(String)); createCol(regionsettings, "terrain_texture_4", typeof(String)); createCol(regionsettings, "elevation_1_nw", typeof (Double)); createCol(regionsettings, "elevation_2_nw", typeof (Double)); createCol(regionsettings, "elevation_1_ne", typeof (Double)); createCol(regionsettings, "elevation_2_ne", typeof (Double)); createCol(regionsettings, "elevation_1_se", typeof (Double)); createCol(regionsettings, "elevation_2_se", typeof (Double)); createCol(regionsettings, "elevation_1_sw", typeof (Double)); createCol(regionsettings, "elevation_2_sw", typeof (Double)); createCol(regionsettings, "water_height", typeof (Double)); createCol(regionsettings, "terrain_raise_limit", typeof (Double)); createCol(regionsettings, "terrain_lower_limit", typeof (Double)); createCol(regionsettings, "use_estate_sun", typeof (Int32)); createCol(regionsettings, "sandbox", typeof (Int32)); createCol(regionsettings, "sunvectorx",typeof (Double)); createCol(regionsettings, "sunvectory",typeof (Double)); createCol(regionsettings, "sunvectorz",typeof (Double)); createCol(regionsettings, "fixed_sun", typeof (Int32)); createCol(regionsettings, "sun_position", typeof (Double)); createCol(regionsettings, "covenant", typeof(String)); regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; return regionsettings; } /*********************************************************************** * * Convert between ADO.NET <=> OpenSim Objects * * These should be database independant * **********************************************************************/ /// <summary> /// /// </summary> /// <param name="row"></param> /// <returns></returns> private SceneObjectPart buildPrim(DataRow row) { // Code commented. Uncomment to test the unit test inline. // The unit test mentions this commented code for the purposes // of debugging a unit test failure // SceneObjectGroup sog = new SceneObjectGroup(); // SceneObjectPart sop = new SceneObjectPart(); // sop.LocalId = 1; // sop.Name = "object1"; // sop.Description = "object1"; // sop.Text = ""; // sop.SitName = ""; // sop.TouchName = ""; // sop.UUID = UUID.Random(); // sop.Shape = PrimitiveBaseShape.Default; // sog.SetRootPart(sop); // Add breakpoint in above line. Check sop fields. // TODO: this doesn't work yet because something more // interesting has to be done to actually get these values // back out. Not enough time to figure it out yet. SceneObjectPart prim = new SceneObjectPart(); prim.UUID = new UUID((String) row["UUID"]); // explicit conversion of integers is required, which sort // of sucks. No idea if there is a shortcut here or not. prim.CreationDate = Convert.ToInt32(row["CreationDate"]); prim.Name = row["Name"] == DBNull.Value ? string.Empty : (string)row["Name"]; // various text fields prim.Text = (String) row["Text"]; prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]), Convert.ToInt32(row["ColorR"]), Convert.ToInt32(row["ColorG"]), Convert.ToInt32(row["ColorB"])); prim.Description = (String) row["Description"]; prim.SitName = (String) row["SitName"]; prim.TouchName = (String) row["TouchName"]; // permissions prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]); prim.CreatorID = new UUID((String) row["CreatorID"]); prim.OwnerID = new UUID((String) row["OwnerID"]); prim.GroupID = new UUID((String) row["GroupID"]); prim.LastOwnerID = new UUID((String) row["LastOwnerID"]); prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]); prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]); prim.GroupMask = Convert.ToUInt32(row["GroupMask"]); prim.EveryoneMask = Convert.ToUInt32(row["EveryoneMask"]); prim.BaseMask = Convert.ToUInt32(row["BaseMask"]); // vectors prim.OffsetPosition = new Vector3( Convert.ToSingle(row["PositionX"]), Convert.ToSingle(row["PositionY"]), Convert.ToSingle(row["PositionZ"]) ); prim.GroupPosition = new Vector3( Convert.ToSingle(row["GroupPositionX"]), Convert.ToSingle(row["GroupPositionY"]), Convert.ToSingle(row["GroupPositionZ"]) ); prim.Velocity = new Vector3( Convert.ToSingle(row["VelocityX"]), Convert.ToSingle(row["VelocityY"]), Convert.ToSingle(row["VelocityZ"]) ); prim.AngularVelocity = new Vector3( Convert.ToSingle(row["AngularVelocityX"]), Convert.ToSingle(row["AngularVelocityY"]), Convert.ToSingle(row["AngularVelocityZ"]) ); prim.Acceleration = new Vector3( Convert.ToSingle(row["AccelerationX"]), Convert.ToSingle(row["AccelerationY"]), Convert.ToSingle(row["AccelerationZ"]) ); // quaternions prim.RotationOffset = new Quaternion( Convert.ToSingle(row["RotationX"]), Convert.ToSingle(row["RotationY"]), Convert.ToSingle(row["RotationZ"]), Convert.ToSingle(row["RotationW"]) ); prim.SitTargetPositionLL = new Vector3( Convert.ToSingle(row["SitTargetOffsetX"]), Convert.ToSingle(row["SitTargetOffsetY"]), Convert.ToSingle(row["SitTargetOffsetZ"])); prim.SitTargetOrientationLL = new Quaternion( Convert.ToSingle( row["SitTargetOrientX"]), Convert.ToSingle( row["SitTargetOrientY"]), Convert.ToSingle( row["SitTargetOrientZ"]), Convert.ToSingle( row["SitTargetOrientW"])); prim.ClickAction = Convert.ToByte(row["ClickAction"]); prim.PayPrice[0] = Convert.ToInt32(row["PayPrice"]); prim.PayPrice[1] = Convert.ToInt32(row["PayButton1"]); prim.PayPrice[2] = Convert.ToInt32(row["PayButton2"]); prim.PayPrice[3] = Convert.ToInt32(row["PayButton3"]); prim.PayPrice[4] = Convert.ToInt32(row["PayButton4"]); prim.Sound = new UUID(row["LoopedSound"].ToString()); prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); prim.SoundFlags = 1; // If it's persisted at all, it's looped if (!row.IsNull("TextureAnimation")) prim.TextureAnimation = Convert.FromBase64String(row["TextureAnimation"].ToString()); if (!row.IsNull("ParticleSystem")) prim.ParticleSystem = Convert.FromBase64String(row["ParticleSystem"].ToString()); prim.AngularVelocity = new Vector3( Convert.ToSingle(row["OmegaX"]), Convert.ToSingle(row["OmegaY"]), Convert.ToSingle(row["OmegaZ"]) ); prim.SetCameraEyeOffset(new Vector3( Convert.ToSingle(row["CameraEyeOffsetX"]), Convert.ToSingle(row["CameraEyeOffsetY"]), Convert.ToSingle(row["CameraEyeOffsetZ"]) )); prim.SetCameraAtOffset(new Vector3( Convert.ToSingle(row["CameraAtOffsetX"]), Convert.ToSingle(row["CameraAtOffsetY"]), Convert.ToSingle(row["CameraAtOffsetZ"]) )); if (Convert.ToInt16(row["ForceMouselook"]) != 0) prim.SetForceMouselook(true); prim.ScriptAccessPin = Convert.ToInt32(row["ScriptAccessPin"]); if (Convert.ToInt16(row["AllowedDrop"]) != 0) prim.AllowedDrop = true; if (Convert.ToInt16(row["DieAtEdge"]) != 0) prim.DIE_AT_EDGE = true; prim.SalePrice = Convert.ToInt32(row["SalePrice"]); prim.ObjectSaleType = Convert.ToByte(row["SaleType"]); prim.Material = Convert.ToByte(row["Material"]); prim.CollisionSound = new UUID(row["CollisionSound"].ToString()); prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]); if (Convert.ToInt16(row["VolumeDetect"]) != 0) prim.VolumeDetectActive = true; return prim; } /// <summary> /// Build a prim inventory item from the persisted data. /// </summary> /// <param name="row"></param> /// <returns></returns> private static TaskInventoryItem buildItem(DataRow row) { TaskInventoryItem taskItem = new TaskInventoryItem(); taskItem.ItemID = new UUID((String)row["itemID"]); taskItem.ParentPartID = new UUID((String)row["primID"]); taskItem.AssetID = new UUID((String)row["assetID"]); taskItem.ParentID = new UUID((String)row["parentFolderID"]); taskItem.InvType = Convert.ToInt32(row["invType"]); taskItem.Type = Convert.ToInt32(row["assetType"]); taskItem.Name = (String)row["name"]; taskItem.Description = (String)row["description"]; taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); taskItem.CreatorID = new UUID((String)row["creatorID"]); taskItem.OwnerID = new UUID((String)row["ownerID"]); taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]); taskItem.GroupID = new UUID((String)row["groupID"]); taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]); taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]); taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]); taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]); taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]); taskItem.Flags = Convert.ToUInt32(row["flags"]); return taskItem; } /// <summary> /// Build a Land Data from the persisted data. /// </summary> /// <param name="row"></param> /// <returns></returns> private LandData buildLandData(DataRow row) { LandData newData = new LandData(); newData.GlobalID = new UUID((String) row["UUID"]); newData.LocalID = Convert.ToInt32(row["LocalLandID"]); // Bitmap is a byte[512] newData.Bitmap = (Byte[]) row["Bitmap"]; newData.Name = (String) row["Name"]; newData.Description = (String) row["Desc"]; newData.OwnerID = (UUID)(String) row["OwnerUUID"]; newData.IsGroupOwned = (Boolean) row["IsGroupOwned"]; newData.Area = Convert.ToInt32(row["Area"]); newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented newData.Category = (ParcelCategory) Convert.ToInt32(row["Category"]); //Enum OpenMetaverse.Parcel.ParcelCategory newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]); newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]); newData.GroupID = new UUID((String) row["GroupUUID"]); newData.SalePrice = Convert.ToInt32(row["SalePrice"]); newData.Status = (ParcelStatus) Convert.ToInt32(row["LandStatus"]); //Enum. OpenMetaverse.Parcel.ParcelStatus newData.Flags = Convert.ToUInt32(row["LandFlags"]); newData.LandingType = (Byte) row["LandingType"]; newData.MediaAutoScale = (Byte) row["MediaAutoScale"]; newData.MediaID = new UUID((String) row["MediaTextureUUID"]); newData.MediaURL = (String) row["MediaURL"]; newData.MusicURL = (String) row["MusicURL"]; newData.PassHours = Convert.ToSingle(row["PassHours"]); newData.PassPrice = Convert.ToInt32(row["PassPrice"]); newData.SnapshotID = (UUID)(String) row["SnapshotUUID"]; try { newData.UserLocation = new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), Convert.ToSingle(row["UserLocationZ"])); newData.UserLookAt = new Vector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), Convert.ToSingle(row["UserLookAtZ"])); } catch (InvalidCastException) { m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); newData.UserLocation = Vector3.Zero; newData.UserLookAt = Vector3.Zero; } newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); UUID authBuyerID = UUID.Zero; UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID); newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); return newData; } private RegionSettings buildRegionSettings(DataRow row) { RegionSettings newSettings = new RegionSettings(); newSettings.RegionUUID = new UUID((string) row["regionUUID"]); newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]); newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]); newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]); newSettings.RestrictPushing = Convert.ToBoolean(row["restrict_pushing"]); newSettings.AllowLandResell = Convert.ToBoolean(row["allow_land_resell"]); newSettings.AllowLandJoinDivide = Convert.ToBoolean(row["allow_land_join_divide"]); newSettings.BlockShowInSearch = Convert.ToBoolean(row["block_show_in_search"]); newSettings.AgentLimit = Convert.ToInt32(row["agent_limit"]); newSettings.ObjectBonus = Convert.ToDouble(row["object_bonus"]); newSettings.Maturity = Convert.ToInt32(row["maturity"]); newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]); newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]); newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]); newSettings.TerrainTexture1 = new UUID((String) row["terrain_texture_1"]); newSettings.TerrainTexture2 = new UUID((String) row["terrain_texture_2"]); newSettings.TerrainTexture3 = new UUID((String) row["terrain_texture_3"]); newSettings.TerrainTexture4 = new UUID((String) row["terrain_texture_4"]); newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]); newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]); newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]); newSettings.Elevation2NE = Convert.ToDouble(row["elevation_2_ne"]); newSettings.Elevation1SE = Convert.ToDouble(row["elevation_1_se"]); newSettings.Elevation2SE = Convert.ToDouble(row["elevation_2_se"]); newSettings.Elevation1SW = Convert.ToDouble(row["elevation_1_sw"]); newSettings.Elevation2SW = Convert.ToDouble(row["elevation_2_sw"]); newSettings.WaterHeight = Convert.ToDouble(row["water_height"]); newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]); newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); newSettings.SunVector = new Vector3 ( Convert.ToSingle(row["sunvectorx"]), Convert.ToSingle(row["sunvectory"]), Convert.ToSingle(row["sunvectorz"]) ); newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); newSettings.Covenant = new UUID((String) row["covenant"]); return newSettings; } /// <summary> /// Build a land access entry from the persisted data. /// </summary> /// <param name="row"></param> /// <returns></returns> private static ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = new UUID((string) row["AccessUUID"]); entry.Flags = (AccessList) row["Flags"]; entry.Time = new DateTime(); return entry; } /// <summary> /// /// </summary> /// <param name="val"></param> /// <returns></returns> private static Array serializeTerrain(double[,] val) { MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); BinaryWriter bw = new BinaryWriter(str); // TODO: COMPATIBILITY - Add byte-order conversions for (int x = 0; x < (int)Constants.RegionSize; x++) for (int y = 0; y < (int)Constants.RegionSize; y++) bw.Write(val[x, y]); return str.ToArray(); } // private void fillTerrainRow(DataRow row, UUID regionUUID, int rev, double[,] val) // { // row["RegionUUID"] = regionUUID; // row["Revision"] = rev; // MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize)*sizeof (double)); // BinaryWriter bw = new BinaryWriter(str); // // TODO: COMPATIBILITY - Add byte-order conversions // for (int x = 0; x < (int)Constants.RegionSize; x++) // for (int y = 0; y < (int)Constants.RegionSize; y++) // bw.Write(val[x, y]); // row["Heightfield"] = str.ToArray(); // } /// <summary> /// /// </summary> /// <param name="row"></param> /// <param name="prim"></param> /// <param name="sceneGroupID"></param> /// <param name="regionUUID"></param> private static void fillPrimRow(DataRow row, SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) { row["UUID"] = prim.UUID.ToString(); row["RegionUUID"] = regionUUID.ToString(); row["CreationDate"] = prim.CreationDate; row["Name"] = prim.Name; row["SceneGroupID"] = sceneGroupID.ToString(); // the UUID of the root part for this SceneObjectGroup // various text fields row["Text"] = prim.Text; row["Description"] = prim.Description; row["SitName"] = prim.SitName; row["TouchName"] = prim.TouchName; // permissions row["ObjectFlags"] = (uint)prim.Flags; row["CreatorID"] = prim.CreatorID.ToString(); row["OwnerID"] = prim.OwnerID.ToString(); row["GroupID"] = prim.GroupID.ToString(); row["LastOwnerID"] = prim.LastOwnerID.ToString(); row["OwnerMask"] = prim.OwnerMask; row["NextOwnerMask"] = prim.NextOwnerMask; row["GroupMask"] = prim.GroupMask; row["EveryoneMask"] = prim.EveryoneMask; row["BaseMask"] = prim.BaseMask; // vectors row["PositionX"] = prim.OffsetPosition.X; row["PositionY"] = prim.OffsetPosition.Y; row["PositionZ"] = prim.OffsetPosition.Z; row["GroupPositionX"] = prim.GroupPosition.X; row["GroupPositionY"] = prim.GroupPosition.Y; row["GroupPositionZ"] = prim.GroupPosition.Z; row["VelocityX"] = prim.Velocity.X; row["VelocityY"] = prim.Velocity.Y; row["VelocityZ"] = prim.Velocity.Z; row["AngularVelocityX"] = prim.AngularVelocity.X; row["AngularVelocityY"] = prim.AngularVelocity.Y; row["AngularVelocityZ"] = prim.AngularVelocity.Z; row["AccelerationX"] = prim.Acceleration.X; row["AccelerationY"] = prim.Acceleration.Y; row["AccelerationZ"] = prim.Acceleration.Z; // quaternions row["RotationX"] = prim.RotationOffset.X; row["RotationY"] = prim.RotationOffset.Y; row["RotationZ"] = prim.RotationOffset.Z; row["RotationW"] = prim.RotationOffset.W; // Sit target Vector3 sitTargetPos = prim.SitTargetPositionLL; row["SitTargetOffsetX"] = sitTargetPos.X; row["SitTargetOffsetY"] = sitTargetPos.Y; row["SitTargetOffsetZ"] = sitTargetPos.Z; Quaternion sitTargetOrient = prim.SitTargetOrientationLL; row["SitTargetOrientW"] = sitTargetOrient.W; row["SitTargetOrientX"] = sitTargetOrient.X; row["SitTargetOrientY"] = sitTargetOrient.Y; row["SitTargetOrientZ"] = sitTargetOrient.Z; row["ColorR"] = Convert.ToInt32(prim.Color.R); row["ColorG"] = Convert.ToInt32(prim.Color.G); row["ColorB"] = Convert.ToInt32(prim.Color.B); row["ColorA"] = Convert.ToInt32(prim.Color.A); row["PayPrice"] = prim.PayPrice[0]; row["PayButton1"] = prim.PayPrice[1]; row["PayButton2"] = prim.PayPrice[2]; row["PayButton3"] = prim.PayPrice[3]; row["PayButton4"] = prim.PayPrice[4]; row["TextureAnimation"] = Convert.ToBase64String(prim.TextureAnimation); row["ParticleSystem"] = Convert.ToBase64String(prim.ParticleSystem); row["OmegaX"] = prim.AngularVelocity.X; row["OmegaY"] = prim.AngularVelocity.Y; row["OmegaZ"] = prim.AngularVelocity.Z; row["CameraEyeOffsetX"] = prim.GetCameraEyeOffset().X; row["CameraEyeOffsetY"] = prim.GetCameraEyeOffset().Y; row["CameraEyeOffsetZ"] = prim.GetCameraEyeOffset().Z; row["CameraAtOffsetX"] = prim.GetCameraAtOffset().X; row["CameraAtOffsetY"] = prim.GetCameraAtOffset().Y; row["CameraAtOffsetZ"] = prim.GetCameraAtOffset().Z; if ((prim.SoundFlags & 1) != 0) // Looped { row["LoopedSound"] = prim.Sound.ToString(); row["LoopedSoundGain"] = prim.SoundGain; } else { row["LoopedSound"] = UUID.Zero.ToString(); row["LoopedSoundGain"] = 0.0f; } if (prim.GetForceMouselook()) row["ForceMouselook"] = 1; else row["ForceMouselook"] = 0; row["ScriptAccessPin"] = prim.ScriptAccessPin; if (prim.AllowedDrop) row["AllowedDrop"] = 1; else row["AllowedDrop"] = 0; if (prim.DIE_AT_EDGE) row["DieAtEdge"] = 1; else row["DieAtEdge"] = 0; row["SalePrice"] = prim.SalePrice; row["SaleType"] = Convert.ToInt16(prim.ObjectSaleType); // click action row["ClickAction"] = prim.ClickAction; row["SalePrice"] = prim.SalePrice; row["Material"] = prim.Material; row["CollisionSound"] = prim.CollisionSound.ToString(); row["CollisionSoundVolume"] = prim.CollisionSoundVolume; if (prim.VolumeDetectActive) row["VolumeDetect"] = 1; else row["VolumeDetect"] = 0; } /// <summary> /// /// </summary> /// <param name="row"></param> /// <param name="taskItem"></param> private static void fillItemRow(DataRow row, TaskInventoryItem taskItem) { row["itemID"] = taskItem.ItemID.ToString(); row["primID"] = taskItem.ParentPartID.ToString(); row["assetID"] = taskItem.AssetID.ToString(); row["parentFolderID"] = taskItem.ParentID.ToString(); row["invType"] = taskItem.InvType; row["assetType"] = taskItem.Type; row["name"] = taskItem.Name; row["description"] = taskItem.Description; row["creationDate"] = taskItem.CreationDate; row["creatorID"] = taskItem.CreatorID.ToString(); row["ownerID"] = taskItem.OwnerID.ToString(); row["lastOwnerID"] = taskItem.LastOwnerID.ToString(); row["groupID"] = taskItem.GroupID.ToString(); row["nextPermissions"] = taskItem.NextPermissions; row["currentPermissions"] = taskItem.CurrentPermissions; row["basePermissions"] = taskItem.BasePermissions; row["everyonePermissions"] = taskItem.EveryonePermissions; row["groupPermissions"] = taskItem.GroupPermissions; row["flags"] = taskItem.Flags; } /// <summary> /// /// </summary> /// <param name="row"></param> /// <param name="land"></param> /// <param name="regionUUID"></param> private static void fillLandRow(DataRow row, LandData land, UUID regionUUID) { row["UUID"] = land.GlobalID.ToString(); row["RegionUUID"] = regionUUID.ToString(); row["LocalLandID"] = land.LocalID; // Bitmap is a byte[512] row["Bitmap"] = land.Bitmap; row["Name"] = land.Name; row["Desc"] = land.Description; row["OwnerUUID"] = land.OwnerID.ToString(); row["IsGroupOwned"] = land.IsGroupOwned; row["Area"] = land.Area; row["AuctionID"] = land.AuctionID; //Unemplemented row["Category"] = land.Category; //Enum OpenMetaverse.Parcel.ParcelCategory row["ClaimDate"] = land.ClaimDate; row["ClaimPrice"] = land.ClaimPrice; row["GroupUUID"] = land.GroupID.ToString(); row["SalePrice"] = land.SalePrice; row["LandStatus"] = land.Status; //Enum. OpenMetaverse.Parcel.ParcelStatus row["LandFlags"] = land.Flags; row["LandingType"] = land.LandingType; row["MediaAutoScale"] = land.MediaAutoScale; row["MediaTextureUUID"] = land.MediaID.ToString(); row["MediaURL"] = land.MediaURL; row["MusicURL"] = land.MusicURL; row["PassHours"] = land.PassHours; row["PassPrice"] = land.PassPrice; row["SnapshotUUID"] = land.SnapshotID.ToString(); row["UserLocationX"] = land.UserLocation.X; row["UserLocationY"] = land.UserLocation.Y; row["UserLocationZ"] = land.UserLocation.Z; row["UserLookAtX"] = land.UserLookAt.X; row["UserLookAtY"] = land.UserLookAt.Y; row["UserLookAtZ"] = land.UserLookAt.Z; row["AuthbuyerID"] = land.AuthBuyerID.ToString(); row["OtherCleanTime"] = land.OtherCleanTime; } /// <summary> /// /// </summary> /// <param name="row"></param> /// <param name="entry"></param> /// <param name="parcelID"></param> private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, UUID parcelID) { row["LandUUID"] = parcelID.ToString(); row["AccessUUID"] = entry.AgentID.ToString(); row["Flags"] = entry.Flags; } private static void fillRegionSettingsRow(DataRow row, RegionSettings settings) { row["regionUUID"] = settings.RegionUUID.ToString(); row["block_terraform"] = settings.BlockTerraform; row["block_fly"] = settings.BlockFly; row["allow_damage"] = settings.AllowDamage; row["restrict_pushing"] = settings.RestrictPushing; row["allow_land_resell"] = settings.AllowLandResell; row["allow_land_join_divide"] = settings.AllowLandJoinDivide; row["block_show_in_search"] = settings.BlockShowInSearch; row["agent_limit"] = settings.AgentLimit; row["object_bonus"] = settings.ObjectBonus; row["maturity"] = settings.Maturity; row["disable_scripts"] = settings.DisableScripts; row["disable_collisions"] = settings.DisableCollisions; row["disable_physics"] = settings.DisablePhysics; row["terrain_texture_1"] = settings.TerrainTexture1.ToString(); row["terrain_texture_2"] = settings.TerrainTexture2.ToString(); row["terrain_texture_3"] = settings.TerrainTexture3.ToString(); row["terrain_texture_4"] = settings.TerrainTexture4.ToString(); row["elevation_1_nw"] = settings.Elevation1NW; row["elevation_2_nw"] = settings.Elevation2NW; row["elevation_1_ne"] = settings.Elevation1NE; row["elevation_2_ne"] = settings.Elevation2NE; row["elevation_1_se"] = settings.Elevation1SE; row["elevation_2_se"] = settings.Elevation2SE; row["elevation_1_sw"] = settings.Elevation1SW; row["elevation_2_sw"] = settings.Elevation2SW; row["water_height"] = settings.WaterHeight; row["terrain_raise_limit"] = settings.TerrainRaiseLimit; row["terrain_lower_limit"] = settings.TerrainLowerLimit; row["use_estate_sun"] = settings.UseEstateSun; row["Sandbox"] = settings.Sandbox; // database uses upper case S for sandbox row["sunvectorx"] = settings.SunVector.X; row["sunvectory"] = settings.SunVector.Y; row["sunvectorz"] = settings.SunVector.Z; row["fixed_sun"] = settings.FixedSun; row["sun_position"] = settings.SunPosition; row["covenant"] = settings.Covenant.ToString(); } /// <summary> /// /// </summary> /// <param name="row"></param> /// <returns></returns> private PrimitiveBaseShape buildShape(DataRow row) { PrimitiveBaseShape s = new PrimitiveBaseShape(); s.Scale = new Vector3( Convert.ToSingle(row["ScaleX"]), Convert.ToSingle(row["ScaleY"]), Convert.ToSingle(row["ScaleZ"]) ); // paths s.PCode = Convert.ToByte(row["PCode"]); s.PathBegin = Convert.ToUInt16(row["PathBegin"]); s.PathEnd = Convert.ToUInt16(row["PathEnd"]); s.PathScaleX = Convert.ToByte(row["PathScaleX"]); s.PathScaleY = Convert.ToByte(row["PathScaleY"]); s.PathShearX = Convert.ToByte(row["PathShearX"]); s.PathShearY = Convert.ToByte(row["PathShearY"]); s.PathSkew = Convert.ToSByte(row["PathSkew"]); s.PathCurve = Convert.ToByte(row["PathCurve"]); s.PathRadiusOffset = Convert.ToSByte(row["PathRadiusOffset"]); s.PathRevolutions = Convert.ToByte(row["PathRevolutions"]); s.PathTaperX = Convert.ToSByte(row["PathTaperX"]); s.PathTaperY = Convert.ToSByte(row["PathTaperY"]); s.PathTwist = Convert.ToSByte(row["PathTwist"]); s.PathTwistBegin = Convert.ToSByte(row["PathTwistBegin"]); // profile s.ProfileBegin = Convert.ToUInt16(row["ProfileBegin"]); s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); s.State = Convert.ToByte(row["State"]); byte[] textureEntry = (byte[])row["Texture"]; s.TextureEntry = textureEntry; s.ExtraParams = (byte[]) row["ExtraParams"]; return s; } /// <summary> /// /// </summary> /// <param name="row"></param> /// <param name="prim"></param> private static void fillShapeRow(DataRow row, SceneObjectPart prim) { PrimitiveBaseShape s = prim.Shape; row["UUID"] = prim.UUID.ToString(); // shape is an enum row["Shape"] = 0; // vectors row["ScaleX"] = s.Scale.X; row["ScaleY"] = s.Scale.Y; row["ScaleZ"] = s.Scale.Z; // paths row["PCode"] = s.PCode; row["PathBegin"] = s.PathBegin; row["PathEnd"] = s.PathEnd; row["PathScaleX"] = s.PathScaleX; row["PathScaleY"] = s.PathScaleY; row["PathShearX"] = s.PathShearX; row["PathShearY"] = s.PathShearY; row["PathSkew"] = s.PathSkew; row["PathCurve"] = s.PathCurve; row["PathRadiusOffset"] = s.PathRadiusOffset; row["PathRevolutions"] = s.PathRevolutions; row["PathTaperX"] = s.PathTaperX; row["PathTaperY"] = s.PathTaperY; row["PathTwist"] = s.PathTwist; row["PathTwistBegin"] = s.PathTwistBegin; // profile row["ProfileBegin"] = s.ProfileBegin; row["ProfileEnd"] = s.ProfileEnd; row["ProfileCurve"] = s.ProfileCurve; row["ProfileHollow"] = s.ProfileHollow; row["State"] = s.State; row["Texture"] = s.TextureEntry; row["ExtraParams"] = s.ExtraParams; } /// <summary> /// /// </summary> /// <param name="prim"></param> /// <param name="sceneGroupID"></param> /// <param name="regionUUID"></param> private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) { DataTable prims = ds.Tables["prims"]; DataTable shapes = ds.Tables["primshapes"]; DataRow primRow = prims.Rows.Find(prim.UUID.ToString()); if (primRow == null) { primRow = prims.NewRow(); fillPrimRow(primRow, prim, sceneGroupID, regionUUID); prims.Rows.Add(primRow); } else { fillPrimRow(primRow, prim, sceneGroupID, regionUUID); } DataRow shapeRow = shapes.Rows.Find(prim.UUID.ToString()); if (shapeRow == null) { shapeRow = shapes.NewRow(); fillShapeRow(shapeRow, prim); shapes.Rows.Add(shapeRow); } else { fillShapeRow(shapeRow, prim); } } /// <summary> /// </summary> /// <param name="primID"></param> /// <param name="items"></param> public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) { m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID); DataTable dbItems = ds.Tables["primitems"]; // For now, we're just going to crudely remove all the previous inventory items // no matter whether they have changed or not, and replace them with the current set. lock (ds) { RemoveItems(primID); // repalce with current inventory details foreach (TaskInventoryItem newItem in items) { // m_log.InfoFormat( // "[DATASTORE]: ", // "Adding item {0}, {1} to prim ID {2}", // newItem.Name, newItem.ItemID, newItem.ParentPartID); DataRow newItemRow = dbItems.NewRow(); fillItemRow(newItemRow, newItem); dbItems.Rows.Add(newItemRow); } } Commit(); } /*********************************************************************** * * SQL Statement Creation Functions * * These functions create SQL statements for update, insert, and create. * They can probably be factored later to have a db independant * portion and a db specific portion * **********************************************************************/ /// <summary> /// Create an insert command /// </summary> /// <param name="table">table name</param> /// <param name="dt">data table</param> /// <returns>the created command</returns> /// <remarks> /// This is subtle enough to deserve some commentary. /// Instead of doing *lots* and *lots of hardcoded strings /// for database definitions we'll use the fact that /// realistically all insert statements look like "insert /// into A(b, c) values(:b, :c) on the parameterized query /// front. If we just have a list of b, c, etc... we can /// generate these strings instead of typing them out. /// </remarks> private static SqliteCommand createInsertCommand(string table, DataTable dt) { string[] cols = new string[dt.Columns.Count]; for (int i = 0; i < dt.Columns.Count; i++) { DataColumn col = dt.Columns[i]; cols[i] = col.ColumnName; } string sql = "insert into " + table + "("; sql += String.Join(", ", cols); // important, the first ':' needs to be here, the rest get added in the join sql += ") values (:"; sql += String.Join(", :", cols); sql += ")"; SqliteCommand cmd = new SqliteCommand(sql); // this provides the binding for all our parameters, so // much less code than it used to be foreach (DataColumn col in dt.Columns) { cmd.Parameters.Add(createSqliteParameter(col.ColumnName, col.DataType)); } return cmd; } /// <summary> /// create an update command /// </summary> /// <param name="table">table name</param> /// <param name="pk"></param> /// <param name="dt"></param> /// <returns>the created command</returns> private static SqliteCommand createUpdateCommand(string table, string pk, DataTable dt) { string sql = "update " + table + " set "; string subsql = String.Empty; foreach (DataColumn col in dt.Columns) { if (subsql.Length > 0) { // a map function would rock so much here subsql += ", "; } subsql += col.ColumnName + "= :" + col.ColumnName; } sql += subsql; sql += " where " + pk; SqliteCommand cmd = new SqliteCommand(sql); // this provides the binding for all our parameters, so // much less code than it used to be foreach (DataColumn col in dt.Columns) { cmd.Parameters.Add(createSqliteParameter(col.ColumnName, col.DataType)); } return cmd; } /// <summary> /// create an update command /// </summary> /// <param name="table">table name</param> /// <param name="pk"></param> /// <param name="dt"></param> /// <returns>the created command</returns> private static SqliteCommand createUpdateCommand(string table, string pk1, string pk2, DataTable dt) { string sql = "update " + table + " set "; string subsql = String.Empty; foreach (DataColumn col in dt.Columns) { if (subsql.Length > 0) { // a map function would rock so much here subsql += ", "; } subsql += col.ColumnName + "= :" + col.ColumnName; } sql += subsql; sql += " where " + pk1 + " and " + pk2; SqliteCommand cmd = new SqliteCommand(sql); // this provides the binding for all our parameters, so // much less code than it used to be foreach (DataColumn col in dt.Columns) { cmd.Parameters.Add(createSqliteParameter(col.ColumnName, col.DataType)); } return cmd; } /// <summary> /// /// </summary> /// <param name="dt">Data Table</param> /// <returns></returns> // private static string defineTable(DataTable dt) // { // string sql = "create table " + dt.TableName + "("; // string subsql = String.Empty; // foreach (DataColumn col in dt.Columns) // { // if (subsql.Length > 0) // { // // a map function would rock so much here // subsql += ",\n"; // } // subsql += col.ColumnName + " " + sqliteType(col.DataType); // if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0]) // { // subsql += " primary key"; // } // } // sql += subsql; // sql += ")"; // return sql; // } /*********************************************************************** * * Database Binding functions * * These will be db specific due to typing, and minor differences * in databases. * **********************************************************************/ ///<summary> /// This is a convenience function that collapses 5 repetitive /// lines for defining SqliteParameters to 2 parameters: /// column name and database type. /// /// It assumes certain conventions like :param as the param /// name to replace in parametrized queries, and that source /// version is always current version, both of which are fine /// for us. ///</summary> ///<returns>a built sqlite parameter</returns> private static SqliteParameter createSqliteParameter(string name, Type type) { SqliteParameter param = new SqliteParameter(); param.ParameterName = ":" + name; param.DbType = dbtypeFromType(type); param.SourceColumn = name; param.SourceVersion = DataRowVersion.Current; return param; } /// <summary> /// /// </summary> /// <param name="da"></param> /// <param name="conn"></param> private void setupPrimCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("prims", ds.Tables["prims"]); da.InsertCommand.Connection = conn; da.UpdateCommand = createUpdateCommand("prims", "UUID=:UUID", ds.Tables["prims"]); da.UpdateCommand.Connection = conn; SqliteCommand delete = new SqliteCommand("delete from prims where UUID = :UUID"); delete.Parameters.Add(createSqliteParameter("UUID", typeof (String))); delete.Connection = conn; da.DeleteCommand = delete; } /// <summary> /// /// </summary> /// <param name="da"></param> /// <param name="conn"></param> private void setupItemsCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("primitems", ds.Tables["primitems"]); da.InsertCommand.Connection = conn; da.UpdateCommand = createUpdateCommand("primitems", "itemID = :itemID", ds.Tables["primitems"]); da.UpdateCommand.Connection = conn; SqliteCommand delete = new SqliteCommand("delete from primitems where itemID = :itemID"); delete.Parameters.Add(createSqliteParameter("itemID", typeof (String))); delete.Connection = conn; da.DeleteCommand = delete; } /// <summary> /// /// </summary> /// <param name="da"></param> /// <param name="conn"></param> private void setupTerrainCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("terrain", ds.Tables["terrain"]); da.InsertCommand.Connection = conn; } /// <summary> /// /// </summary> /// <param name="da"></param> /// <param name="conn"></param> private void setupLandCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("land", ds.Tables["land"]); da.InsertCommand.Connection = conn; da.UpdateCommand = createUpdateCommand("land", "UUID=:UUID", ds.Tables["land"]); da.UpdateCommand.Connection = conn; SqliteCommand delete = new SqliteCommand("delete from land where UUID=:UUID"); delete.Parameters.Add(createSqliteParameter("UUID", typeof(String))); da.DeleteCommand = delete; da.DeleteCommand.Connection = conn; } /// <summary> /// /// </summary> /// <param name="da"></param> /// <param name="conn"></param> private void setupLandAccessCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("landaccesslist", ds.Tables["landaccesslist"]); da.InsertCommand.Connection = conn; da.UpdateCommand = createUpdateCommand("landaccesslist", "LandUUID=:landUUID", "AccessUUID=:AccessUUID", ds.Tables["landaccesslist"]); da.UpdateCommand.Connection = conn; SqliteCommand delete = new SqliteCommand("delete from landaccesslist where LandUUID= :LandUUID and AccessUUID= :AccessUUID"); delete.Parameters.Add(createSqliteParameter("LandUUID", typeof(String))); delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); da.DeleteCommand = delete; da.DeleteCommand.Connection = conn; } private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("regionsettings", ds.Tables["regionsettings"]); da.InsertCommand.Connection = conn; da.UpdateCommand = createUpdateCommand("regionsettings", "regionUUID=:regionUUID", ds.Tables["regionsettings"]); da.UpdateCommand.Connection = conn; } /// <summary> /// /// </summary> /// <param name="da"></param> /// <param name="conn"></param> private void setupShapeCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("primshapes", ds.Tables["primshapes"]); da.InsertCommand.Connection = conn; da.UpdateCommand = createUpdateCommand("primshapes", "UUID=:UUID", ds.Tables["primshapes"]); da.UpdateCommand.Connection = conn; SqliteCommand delete = new SqliteCommand("delete from primshapes where UUID = :UUID"); delete.Parameters.Add(createSqliteParameter("UUID", typeof (String))); delete.Connection = conn; da.DeleteCommand = delete; } /*********************************************************************** * * Type conversion functions * **********************************************************************/ /// <summary> /// Type conversion function /// </summary> /// <param name="type"></param> /// <returns></returns> private static DbType dbtypeFromType(Type type) { if (type == typeof (String)) { return DbType.String; } else if (type == typeof (Int32)) { return DbType.Int32; } else if (type == typeof (Double)) { return DbType.Double; } else if (type == typeof (Byte)) { return DbType.Byte; } else if (type == typeof (Double)) { return DbType.Double; } else if (type == typeof (Byte[])) { return DbType.Binary; } else { return DbType.String; } } } }
42.847271
521
0.531274
[ "BSD-3-Clause" ]
N3X15/VoxelSim
OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
97,349
C#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. namespace System.Data.Entity.Core.Query.PlanCompiler { using System.Diagnostics.CodeAnalysis; // <summary> // A nested propertyref describes a nested property access - think "a.b.c" // </summary> internal class NestedPropertyRef : PropertyRef { private readonly PropertyRef m_inner; private readonly PropertyRef m_outer; // <summary> // Basic constructor. // Represents the access of property "propertyRef" within property "property" // </summary> // <param name="innerProperty"> the inner property </param> // <param name="outerProperty"> the outer property </param> [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "NestedPropertyRef")] [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "innerProperty")] [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(System.Boolean,System.String)")] internal NestedPropertyRef(PropertyRef innerProperty, PropertyRef outerProperty) { PlanCompiler.Assert(!(innerProperty is NestedPropertyRef), "innerProperty cannot be a NestedPropertyRef"); m_inner = innerProperty; m_outer = outerProperty; } // <summary> // the nested property // </summary> internal PropertyRef OuterProperty { get { return m_outer; } } // <summary> // the parent property // </summary> internal PropertyRef InnerProperty { get { return m_inner; } } // <summary> // Overrides the default equality function. Two NestedPropertyRefs are // equal if the have the same property name, and the types are the same // </summary> public override bool Equals(object obj) { var other = obj as NestedPropertyRef; return (other != null && m_inner.Equals(other.m_inner) && m_outer.Equals(other.m_outer)); } // <summary> // Overrides the default hashcode function. Simply adds the hashcodes // of the "property" and "propertyRef" fields // </summary> public override int GetHashCode() { return m_inner.GetHashCode() ^ m_outer.GetHashCode(); } public override string ToString() { return m_inner + "." + m_outer; } } }
37.333333
132
0.618214
[ "Apache-2.0" ]
CZEMacLeod/EntityFramework6
src/EntityFramework/Core/Query/PlanCompiler/NestedPropertyRef.cs
2,800
C#
using HK.Framework; using UnityEngine; using UnityEngine.Assertions; using UnityEngine.UI; namespace LGW { /// <summary> /// /// </summary> public sealed class CellController : MonoBehaviour { [SerializeField] private SpriteRenderer graphic; private Transform cachedTransform; private Point id; public Point Id { get { return this.id; } set { this.id = value; var size = UserSettings.Instance.CellSize; this.cachedTransform.localPosition = new Vector3(this.id.x * size, this.id.y * size); } } private void Awake() { this.cachedTransform = this.transform; this.cachedTransform.localScale = Vector3.one * UserSettings.Instance.CellSize; } public void SetColor(Color color) { this.graphic.color = color; } public void NextGeneration(CellManager manager) { var min = new Point { x = this.id.x - 1, y = this.id.y - 1 }; var max = new Point { x = this.id.x + 1, y = this.id.y + 1 }; for (var y = min.y; y <= max.y; ++y) { for (var x = min.x; x <= max.x; ++x) { var targetId = new Point { x = x, y = y }; if (manager.ProcessedCells.ContainsKey(targetId)) { continue; } var adjacentNumber = manager.GetAdjacentNumber(targetId); var isAlive = manager.CellDictionary.ContainsKey(targetId); if (isAlive && (adjacentNumber <= 1 || adjacentNumber >= 4)) { manager.DeathCells.Add(targetId); } else if (!isAlive && adjacentNumber == 3) { manager.NewCells.Add(targetId); } manager.ProcessedCells.Add(targetId, false); } } } } }
28.776316
101
0.460905
[ "MIT" ]
hiroki-kitahara/LGW
Assets/LGW/Scripts/CellController.cs
2,189
C#
using ApiGateway.Core.AuthenticationServices; using ApiGateway.Core.HttpServices; using ApiGateway.Core.Models.Enums; using ApiGateway.Core.Models.RequestModels; using ApiGateway.Core.Models.ResponseModels; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace ApiGateway.Core.Services.AutoStoperUIServices { public class AutoStoperService : IAutoStoperService { private readonly IWebAssemblyHttpService webAssemblyHttpService; private readonly IAuthenticationService authenticationService; public AutoStoperService(IWebAssemblyHttpService webAssemblyHttpService, IAuthenticationService authenticationService) { this.webAssemblyHttpService = webAssemblyHttpService; this.authenticationService = authenticationService; } public async Task Insert(Voznja voznja) { await webAssemblyHttpService.Send(Client.ApiGateway, voznja, HttpMethod.Post, $"/novavoznja",authenticationService.User?.Token); } public async Task<List<Voznja>> GetAll() { var response = await webAssemblyHttpService.Fetch<List<Voznja>>(Client.ApiGateway, null, HttpMethod.Get, "/voznje", authenticationService.User?.Token); return response is not null ? response : null; } public async Task<Voznja> GetById(int id) { var response = await webAssemblyHttpService.Fetch<Voznja>(Client.ApiGateway, null, HttpMethod.Get, $"/voznja?id={id}",authenticationService.User?.Token); return response is not null ? response : null; } public async Task Update(Voznja voznja) { await webAssemblyHttpService.Send(Client.ApiGateway, voznja, HttpMethod.Post, $"/azurirajvoznju", authenticationService.User?.Token); } public async Task Delete(Voznja voznja) { await webAssemblyHttpService.Send(Client.ApiGateway, voznja, HttpMethod.Post, $"/obrisivoznju",authenticationService.User?.Token); } public async Task<List<Voznja>> GetByUserId(int userId) { var response = await webAssemblyHttpService.Fetch<List<Voznja>>(Client.ApiGateway, null, HttpMethod.Get, $"/voznjekorisnika?userId={userId}",authenticationService.User?.Token); return response is not null ? response : null; } public async Task InsertPutnik(PrijavaNaVoznjuRequest prijavaNaVoznjuRequest) { await webAssemblyHttpService.Send(Client.ApiGateway, prijavaNaVoznjuRequest, HttpMethod.Post, $"/dodajputnika",authenticationService.User?.Token); } public async Task DeletePutnik(PrijavaNaVoznjuRequest prijavaNaVoznjuRequest) { await webAssemblyHttpService.Send(Client.ApiGateway, prijavaNaVoznjuRequest, HttpMethod.Post, $"/makniputnika",authenticationService.User?.Token); } } }
42.7
188
0.712947
[ "MIT" ]
ASxCRO/Api-Gateway-.NET
ApiGateway/ApiGateway.Core/Services/AutoStoperUIServices/AutoStoperService.cs
2,991
C#
namespace OpenGLBindings { /// <summary> /// Not used directly. /// </summary> public enum ColorMaterialFace { /// <summary> /// Original was GL_FRONT = 0x0404 /// </summary> Front = 1028, /// <summary> /// Original was GL_BACK = 0x0405 /// </summary> Back = 1029, /// <summary> /// Original was GL_FRONT_AND_BACK = 0x0408 /// </summary> FrontAndBack = 1032 } }
22.904762
51
0.492723
[ "MIT" ]
DeKaDeNcE/WoWDatabaseEditor
Rendering/OpenGLBindings/ColorMaterialFace.cs
481
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TransformModifier : MonoBehaviour { public void EjeX(int x) { transform.position = new Vector3(x, transform.position.y, transform.position.z); } public void EjeY(int y) { transform.position = new Vector3(transform.position.x, y, transform.position.z); } public void EjeZ(int z) { transform.position = new Vector3(transform.position.x, transform.position.y, z); } }
39.333333
112
0.75
[ "MIT" ]
HexStar27/cse-investigaciones
SQL game/Assets/Scripts/Otros/TransformModifier.cs
474
C#
using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using System; using System.Collections.Generic; using System.Linq; using System.Net.Mail; using System.Threading.Tasks; namespace AdvertismentPlatform.Handlers { public class EmailHandler : IEmailSender { private IConfiguration Configuration { get; } private SmtpClient client; private MailAddress mailFrom; public EmailHandler(IConfiguration configuration) { Configuration = configuration; string username = Configuration.GetConnectionString("address"); string password = Configuration.GetConnectionString("password"); client = new SmtpClient("smtp.gmail.com"); client.Credentials = new System.Net.NetworkCredential(username, password); client.Port = 587; client.EnableSsl = true; mailFrom = new MailAddress("advertismentplatform@gmail.com"); } public async Task<bool> SendEmail(string receiver, string subject, string message) { MailAddress mailTo = new MailAddress(receiver); MailMessage mailMessage = new MailMessage(mailFrom, mailTo); mailMessage.Body = message; mailMessage.Subject = subject; try { await client.SendMailAsync(mailMessage); } catch(Exception ex) { Console.WriteLine(ex.StackTrace); return false; } return true; } } }
30.150943
90
0.613267
[ "Apache-2.0" ]
GikuMironica/AdvertismentPlatform
Handlers/EmailHandler.cs
1,600
C#
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; #if NET20 using Stimulsoft.Base.Json.Utilities.LinqBridge; #endif using System.Threading; using Stimulsoft.Base.Json.Serialization; namespace Stimulsoft.Base.Json.Utilities { internal class ThreadSafeStore<TKey, TValue> { private readonly object _lock = new object(); private Dictionary<TKey, TValue> _store; private readonly Func<TKey, TValue> _creator; public ThreadSafeStore(Func<TKey, TValue> creator) { if (creator == null) throw new ArgumentNullException("creator"); _creator = creator; _store = new Dictionary<TKey, TValue>(); } public TValue Get(TKey key) { TValue value; if (!_store.TryGetValue(key, out value)) return AddValue(key); return value; } private TValue AddValue(TKey key) { TValue value = _creator(key); lock (_lock) { if (_store == null) { _store = new Dictionary<TKey, TValue>(); _store[key] = value; } else { // double check locking TValue checkValue; if (_store.TryGetValue(key, out checkValue)) return checkValue; Dictionary<TKey, TValue> newStore = new Dictionary<TKey, TValue>(_store); newStore[key] = value; #if !(NETFX_CORE || PORTABLE) Thread.MemoryBarrier(); #endif _store = newStore; } return value; } } } }
32.164835
93
0.607106
[ "MIT" ]
stimulsoft/Stimulsoft.Controls.Net
Stimulsoft.Base/Json/IO/Utilities/ThreadSafeStore.cs
2,929
C#
/* * My API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System; namespace ApiClientProject.Client { /// <summary> /// API Exception /// </summary> public class ApiException : Exception { /// <summary> /// Gets or sets the error code (HTTP status code) /// </summary> /// <value>The error code (HTTP status code).</value> public int ErrorCode { get; set; } /// <summary> /// Gets or sets the error content (body json object) /// </summary> /// <value>The error content (Http response body).</value> public dynamic ErrorContent { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="ApiException"/> class. /// </summary> public ApiException() {} /// <summary> /// Initializes a new instance of the <see cref="ApiException"/> class. /// </summary> /// <param name="errorCode">HTTP status code.</param> /// <param name="message">Error message.</param> public ApiException(int errorCode, string message) : base(message) { this.ErrorCode = errorCode; } /// <summary> /// Initializes a new instance of the <see cref="ApiException"/> class. /// </summary> /// <param name="errorCode">HTTP status code.</param> /// <param name="message">Error message.</param> /// <param name="errorContent">Error content.</param> public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) { this.ErrorCode = errorCode; this.ErrorContent = errorContent; } } }
31.065574
104
0.580475
[ "MIT" ]
gunmaden/TestTask
RestService/ApiClientProject/Client/ApiException.cs
1,895
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TileScript : MonoBehaviour { //public Collider endTrigger; public GameObject ramp; public List<Transform> rampSpawnPoints; //Side Objects // Start is called before the first frame update void Start() { allSpawner(); } // Update is called once per frame void Update() { } private void allSpawner() { rampSpawner(); } private void rampSpawner() { int spawnLimit = rampSpawnPoints.Count; List<bool> isSpawnedList = new List<bool>(new bool[spawnLimit]); int spawned = 0; int numberOfItemToSpawn = Random.Range(0, spawnLimit); //Debug.Log(isSpawnedList[0]); int spawnPos = 0; while(spawned <= numberOfItemToSpawn) { spawnPos = Random.Range(0, spawnLimit); if(isSpawnedList[spawnPos] != true) { Instantiate(ramp, rampSpawnPoints[spawnPos]).SetActive(true); isSpawnedList[spawnPos] = true; spawned++; } else { } } } }
19.888889
77
0.545092
[ "MIT" ]
DibasDebnath/CarBooster
Assets/Scripts/TileScript.cs
1,255
C#
using System; using Microsoft.Extensions.DependencyInjection; using Polly; using Volo.Abp.Http.Client; using Volo.Abp.Http.Client.IdentityModel; using Volo.Abp.Modularity; namespace BookStore.HttpApi.Client.ConsoleTestApp { [DependsOn( typeof(BookStoreHttpApiClientModule), typeof(AbpHttpClientIdentityModelModule) )] public class BookStoreConsoleApiClientModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { PreConfigure<AbpHttpClientBuilderOptions>(options => { options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => { clientBuilder.AddTransientHttpErrorPolicy( policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) ); }); }); } } }
31.933333
118
0.640919
[ "MIT" ]
344089386/abp-samples
DomainTenantResolver/MVC/test/BookStore.HttpApi.Client.ConsoleTestApp/BookStoreConsoleApiClientModule.cs
960
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Week_9.Properties { /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Week_9.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
38.458333
172
0.601661
[ "MIT" ]
masher1/CSE483_Code
ConsoleApp/Week 9/Week 9/Properties/Resources.Designer.cs
2,771
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Media.V20180330Preview.Outputs { [OutputType] public sealed class TrackPropertyConditionResponse { /// <summary> /// Track property condition operation /// </summary> public readonly string Operation; /// <summary> /// Track property type /// </summary> public readonly string Property; /// <summary> /// Track property value /// </summary> public readonly string? Value; [OutputConstructor] private TrackPropertyConditionResponse( string operation, string property, string? value) { Operation = operation; Property = property; Value = value; } } }
25.511628
81
0.605287
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/Media/V20180330Preview/Outputs/TrackPropertyConditionResponse.cs
1,097
C#
namespace Merchello.Web.WebApi { using System; using System.Linq; using System.Web.Http; using Core; using Core.Configuration; using Core.Services; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; /// <summary> /// Schedule Tasks /// </summary> [PluginController("Merchello")] public class ScheduledTasksApiController : UmbracoApiController { /// <summary> /// The <see cref="IAnonymousCustomerService"/>. /// </summary> private readonly IAnonymousCustomerService _anonymousCustomerService; /// <summary> /// Initializes a new instance of the <see cref="ScheduledTasksApiController"/> class. /// </summary> public ScheduledTasksApiController() : this(MerchelloContext.Current) { } /// <summary> /// Initializes a new instance of the <see cref="ScheduledTasksApiController"/> class. /// </summary> /// <param name="merchelloContext"> /// The <see cref="IMerchelloContext"/> /// </param> public ScheduledTasksApiController(IMerchelloContext merchelloContext) { Ensure.ParameterNotNull(merchelloContext, "merchelloContext"); _anonymousCustomerService = ((ServiceContext)merchelloContext.Services).AnonymousCustomerService; } /// <summary> /// Delete all customers older than the date in the setting /// /// GET /umbraco/Merchello/ScheduledTasksApi/RemoveAnonymousCustomers /// /Umbraco/Api/ScheduledTasksApiController/RemoveAnonymousCustomers /// </summary> /// <returns> /// The count of anonymous customers deleted /// </returns> [AcceptVerbs("GET", "POST")] public int RemoveAnonymousCustomers() { int maxDays = MerchelloConfiguration.Current.AnonymousCustomersMaxDays; var anonymousCustomers = _anonymousCustomerService.GetAnonymousCustomersCreatedBefore(DateTime.Today.AddDays(-maxDays)).ToArray(); _anonymousCustomerService.Delete(anonymousCustomers); LogHelper.Info<string>(string.Format("RemoveAnonymousCustomers - Removed Count {0}", anonymousCustomers.Count())); return anonymousCustomers.Count(); } } }
34.342857
142
0.638519
[ "MIT" ]
benjaminhowarth1/Merchello
src/Merchello.Web/WebApi/ScheduledTasksController.cs
2,406
C#
namespace Course_project.Entity { using System; using MongoDB.Bson; public class User { public User(string login, string password, string firstName, string lastName, string timeZone) { this.Login = login; this.Password = password; this.FirstName = firstName; this.LastName = lastName; this.TimeZone = timeZone; } public ObjectId Id { get; private set; } public string Login {get; set;} public string Password {get; set;} public string FirstName {get; set;} public string LastName {get; set;} public string TimeZone {get; set;} } }
19.566667
96
0.684838
[ "MIT" ]
VerkhovtsovPavel/BSUIR_Labs
Course projects/Course_project_taskManager/source/Entity/DB/User.cs
589
C#
//////////////////////////////////////////////////////////////////////////////// //NUnit tests for "EF Core Provider for LCPI OLE DB" // IBProvider and Contributors. 08.05.2021. using System; using System.Data; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using Microsoft.EntityFrameworkCore; using NUnit.Framework; using xdb=lcpi.data.oledb; namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D3.Query.Operators.SET_001.NotEqual.Complete.NullableSByte.NullableSingle{ //////////////////////////////////////////////////////////////////////////////// using T_DATA1 =System.Nullable<System.SByte>; using T_DATA2 =System.Nullable<System.Single>; //////////////////////////////////////////////////////////////////////////////// //class TestSet_504__param__03__NV public static class TestSet_504__param__03__NV { private const string c_NameOf__TABLE ="DUAL"; private sealed class MyContext:TestBaseDbContext { [Table(c_NameOf__TABLE)] public sealed class TEST_RECORD { [Key] [Column("ID")] public System.Int32? TEST_ID { get; set; } };//class TEST_RECORD //---------------------------------------------------------------------- public DbSet<TEST_RECORD> testTable { get; set; } //---------------------------------------------------------------------- public MyContext(xdb.OleDbTransaction tr) :base(tr) { }//MyContext };//class MyContext //----------------------------------------------------------------------- [Test] public static void Test_001() { using(var cn=LocalCnHelper.CreateCn()) { cn.Open(); using(var tr=cn.BeginTransaction()) { //insert new record in external transaction using(var db=new MyContext(tr)) { T_DATA1 vv1=null; T_DATA2 vv2=4; var recs=db.testTable.Where(r => vv1 /*OP{*/ != /*}OP*/ vv2); int nRecs=0; foreach(var r in recs) { Assert.AreEqual (0, nRecs); ++nRecs; Assert.IsTrue (r.TEST_ID.HasValue); Assert.AreEqual (1, r.TEST_ID.Value); }//foreach r db.CheckTextOfLastExecutedCommand (new TestSqlTemplate() .T("SELECT ").N("d","ID").EOL() .T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("d").EOL() .T("WHERE ").P_BOOL("__Exec_V_V_0")); Assert.AreEqual (1, nRecs); }//using db tr.Commit(); }//using tr }//using cn }//Test_001 //----------------------------------------------------------------------- [Test] public static void Test_002() { using(var cn=LocalCnHelper.CreateCn()) { cn.Open(); using(var tr=cn.BeginTransaction()) { //insert new record in external transaction using(var db=new MyContext(tr)) { T_DATA1 vv1=null; T_DATA2 vv2=4; var recs=db.testTable.Where(r => !(vv1 /*OP{*/ != /*}OP*/ vv2)); foreach(var r in recs) { TestServices.ThrowSelectedRow(); }//foreach r db.CheckTextOfLastExecutedCommand (new TestSqlTemplate() .T("SELECT ").N("d","ID").EOL() .T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("d").EOL() .T("WHERE ").P_BOOL("__Exec_V_0")); }//using db tr.Commit(); }//using tr }//using cn }//Test_002 };//class TestSet_504__param__03__NV //////////////////////////////////////////////////////////////////////////////// }//namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D3.Query.Operators.SET_001.NotEqual.Complete.NullableSByte.NullableSingle
26.284672
144
0.530964
[ "MIT" ]
ibprovider/Lcpi.EFCore.LcpiOleDb
Tests/General/Source/Work/DBMS/Firebird/V03_0_0/D3/Query/Operators/SET_001/NotEqual/Complete/NullableSByte/NullableSingle/TestSet_504__param__03__NV.cs
3,603
C#
using LagoVista.Core.Attributes; using LagoVista.Core.Interfaces; using LagoVista.Core.Models; using LagoVista.Core.Validation; using LagoVista.UserAdmin.Models.Resources; using System; using System.Collections.Generic; using System.Text; namespace LagoVista.UserAdmin.Models.Orgs { [EntityDescription(Domains.OrganizationDomain, UserAdminResources.Names.HolidaySet_Title, UserAdminResources.Names.HolidaySet_Help, UserAdminResources.Names.HolidaySet_Description, EntityDescriptionAttribute.EntityTypes.Dto, typeof(UserAdminResources))] public class HolidaySet : UserAdminModelBase, INamedEntity, IValidateable, IOwnedEntity, IDescriptionEntity { public HolidaySet() { Holidays = new List<ScheduledDowntime>(); } [FormField(LabelResource: UserAdminResources.Names.Common_Name, IsRequired: true, FieldType: FieldTypes.Text, ResourceType: typeof(UserAdminResources))] public string Name { get; set; } [FormField(LabelResource: UserAdminResources.Names.Common_Key, HelpResource: UserAdminResources.Names.Common_Key_Help, FieldType: FieldTypes.Key, RegExValidationMessageResource: UserAdminResources.Names.Common_Key_Validation, ResourceType: typeof(UserAdminResources), IsRequired: true)] public string Key { get; set; } [FormField(LabelResource: UserAdminResources.Names.Common_Description, IsRequired: false, FieldType: FieldTypes.MultiLineText, ResourceType: typeof(UserAdminResources))] public string Description { get; set; } [FormField(LabelResource: UserAdminResources.Names.HolidaySet_Culture_Or_Country, FieldType: FieldTypes.Text, IsRequired: true, ResourceType: typeof(UserAdminResources))] public string CultureOrCountry { get; set; } [FormField(LabelResource: UserAdminResources.Names.HolidaySet_Holidays, FieldType: FieldTypes.ChildList, ResourceType: typeof(UserAdminResources), IsUserEditable: true)] public List<ScheduledDowntime> Holidays { get; set; } public bool IsPublic { get; set; } public EntityHeader OwnerOrganization { get; set; } public EntityHeader OwnerUser { get; set; } public HolidaySetSummary CreateSummary() { return new HolidaySetSummary() { Description = Description, Id = Id, Name = Name, IsPublic = IsPublic, Key = Key, CultureOrCountry = CultureOrCountry }; } } public class HolidaySetSummary : SummaryData { public string CultureOrCountry {get; set;} } }
43.836066
178
0.708676
[ "MIT" ]
LagoVista/UserAdmin
src/LagoVista.UserAdmin.Models/Orgs/HolidaySet.cs
2,676
C#
/* _BEGIN_TEMPLATE_ { "id": "DRG_207", "name": [ "深渊召唤者", "Abyssal Summoner" ], "text": [ "<b>战吼:</b>召唤一个属性值等同于你的手牌数量并具有<b>嘲讽</b>的恶魔。", "[x]<b>Battlecry:</b> Summon a\nDemon with <b>Taunt</b> and stats\nequal to your hand size." ], "cardClass": "WARLOCK", "type": "MINION", "cost": 6, "rarity": "COMMON", "set": "DRAGONS", "collectible": true, "dbfId": 54894 } _END_TEMPLATE_ */ namespace HREngine.Bots { class Sim_DRG_207 : SimTemplate //* 深渊召唤者 Abyssal Summoner { //[x]<b>Battlecry:</b> Summon aDemon with <b>Taunt</b> and statsequal to your hand size. //<b>战吼:</b>召唤一个属性值等同于你的手牌数量并具有<b>嘲讽</b>的恶魔。 } }
23.172414
96
0.59375
[ "MIT" ]
chi-rei-den/Silverfish
cards/DRAGONS/DRG/Sim_DRG_207.cs
804
C#
#region Using directives using System; using System.Reflection; using System.Runtime.InteropServices; #endregion // 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("Testing")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Testing")] [assembly: AssemblyCopyright("Copyright 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // This sets the default COM visibility of types in the assembly to invisible. // If you need to expose a type to COM, use [ComVisible(true)] on that type. [assembly: ComVisible(false)] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")]
32.4375
78
0.757225
[ "Apache-2.0" ]
pWnH/CarsonAgainstHumanity
DummyLib/CarsonDummy/Testing/Properties/AssemblyInfo.cs
1,040
C#
public abstract class TerrainRule { private float _terrainHeight; protected TerrainRule(float terrainHeight) { _terrainHeight = terrainHeight; } protected int CountTerrainType<T>(Terrain[] neighbors) where T : TerrainRule { int count = 0; foreach (Terrain terrain in neighbors) { if (terrain != null && terrain.TerrainRule is T) count++; } return count; } public abstract TerrainRule CheckRules(Terrain[] neighbors); public abstract string GetTooltip(); public float TerrainHeight { get => _terrainHeight; } }
22.814815
80
0.642857
[ "MIT" ]
geldoronie/the-azure-lux-game-jam-2021
Assets/Scripts/Terrain/TerrainRule.cs
616
C#
using System; using System.Collections.Generic; using NUnit.Framework; namespace OrigoDB.Core.Test { [Serializable] public class MyModel<T> : Model { internal List<T> Items = new List<T>(); public void Add(T item) { Items.Add(item); } public T ItemAt(int index) { return Items[index]; } } [Serializable] public class MyQuery<T> : Command<MyModel<T>,int> { public override int Execute(MyModel<T> model) { return model.Items.Count; } } [TestFixture] public class GenericModelTest { [Test] public void Test() { var config = new EngineConfiguration().ForIsolatedTest(); var engine = Engine.For<MyModel<String>>(config); var db = engine.GetProxy(); db.Add("Fish"); db.Add("Dog"); var actual = db.ItemAt(1); Assert.AreEqual(actual, "Dog"); int count = engine.Execute(new MyQuery<string>()); Assert.AreEqual(2,count); } } }
22.098039
69
0.525288
[ "MIT" ]
DevrexLabs/OrigoDB
src/OrigoDB.Core.UnitTests/GenericModelTest.cs
1,127
C#
using Demo.SignalR.Server.DTOs; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; namespace Demo.SignalR.Server.Hubs { [Authorize] public class ChatHub : Hub<IChatHub> { private readonly ILogger<ChatHub> _logger; public ChatHub(ILogger<ChatHub> logger) { this._logger = logger; } public override Task OnConnectedAsync() { this._logger.LogInformation($"UserId: {this.Context.UserIdentifier}, ConnectionId: '{this.Context.ConnectionId}' connected"); return base.OnConnectedAsync(); } public override Task OnDisconnectedAsync(Exception exception) { if(string.IsNullOrWhiteSpace(exception?.Message)) { this._logger.LogInformation($"UserId: {this.Context.UserIdentifier}, ConnectionId: '{this.Context.ConnectionId}' disconnected"); } else { this._logger.LogInformation($"UserId: {this.Context.UserIdentifier}, ConnectionId: '{this.Context.ConnectionId}' disconnected > {exception.Message}"); } return base.OnDisconnectedAsync(exception); } public async Task OnMessage(string clientMessage) { this._logger.LogInformation($"UserId: {this.Context.UserIdentifier}, ConnectionId: '{this.Context.ConnectionId}' message: {clientMessage}"); await this.Clients .Client(this.Context.ConnectionId) .OnMessage(new Message(clientMessage)); } } }
33.68
166
0.63361
[ "MIT" ]
NelsonBN/demo-signalr-authentication
src/Demo.SignalR.Server/Hubs/ChatHub.cs
1,686
C#
using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; namespace Abp.Module.Inventory.Controllers { public class HomeController : AbpController { public ActionResult Index() { return Redirect("/swagger"); } } }
19.214286
47
0.639405
[ "MIT" ]
AbpApp/Inventory
host/Abp.Module.Inventory.HttpApi.Host/Controllers/HomeController.cs
271
C#
using System; using System.Text.Json.Serialization; namespace open_court.Models { public class User { // public int Id { get; set; } // public string UserName { get; set; } // public Dictionary<int, string> Favorites { get; set; } // public Dictionary<int, Dictionary<int, string>> Interactions { get; set; } // [JsonIgnore] // public string Password { get; set; } } }
25.3125
82
0.637037
[ "MIT" ]
Tien96ng/open-court
Models/User.cs
405
C#
/************************************************************************** * * * Website: https://github.com/florinleon/ActressMas * * Description: Zeuthen strategy using the ActressMas framework * * Copyright: (c) 2018, Florin Leon * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation. This program is distributed in the * * hope that it will be useful, but WITHOUT ANY WARRANTY; without even * * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * * PURPOSE. See the GNU General Public License for more details. * * * **************************************************************************/ using ActressMas; using System; using System.Threading; namespace Zeuthen { public class BargainingAgent : ConcurrentAgent { private delegate double UtilityFunctionDelegate(double d); private delegate double RiskFunctionDelegate(double d1, double d2); private delegate double NewProposalFunctionDelegate(double d1, double d2); private UtilityFunctionDelegate MyUtilityFunction, OthersUtilityFunction; private RiskFunctionDelegate MyRiskFunction, OthersRiskFunction; private NewProposalFunctionDelegate MyNewProposalFunction; private double _myProposal, _othersProposal; private string _othersName; public override void Setup() { if (this.Name == "agent1") { MyUtilityFunction = SharedKnowledge.Utility1; OthersUtilityFunction = SharedKnowledge.Utility2; MyRiskFunction = SharedKnowledge.Risk1; OthersRiskFunction = SharedKnowledge.Risk2; MyNewProposalFunction = SharedKnowledge.NewProposal1; _othersName = "agent2"; _myProposal = 0.1; Send(_othersName, Utils.Str("propose", _myProposal)); } else { MyUtilityFunction = SharedKnowledge.Utility2; OthersUtilityFunction = SharedKnowledge.Utility1; MyRiskFunction = SharedKnowledge.Risk2; OthersRiskFunction = SharedKnowledge.Risk1; MyNewProposalFunction = SharedKnowledge.NewProposal2; _othersName = "agent1"; _myProposal = 5; } } public override void Act(Message message) { try { Console.WriteLine("\t[{1} -> {0}]: {2}", this.Name, message.Sender, message.Content); string action; string parameters; Utils.ParseMessage(message.Content, out action, out parameters); switch (action) { case "propose": HandlePropose(Convert.ToDouble(parameters)); break; case "continue": HandleContinue(); break; case "accept": HandleAccept(); break; default: break; } Thread.Sleep(Utils.Delay); } catch (Exception ex) { Console.WriteLine(ex.Message); } } private void HandlePropose(double proposal) { _othersProposal = proposal; if (MyUtilityFunction(_othersProposal) >= MyUtilityFunction(_myProposal)) { Send(_othersName, "accept"); return; } if (MyUtilityFunction(_othersProposal) < 0) { Send(_othersName, "continue"); return; } double myRisk = MyRiskFunction(_myProposal, _othersProposal); double otherRisk = OthersRiskFunction(_othersProposal, _myProposal); Console.WriteLine("[{0}]: My risk is {1:F2} and the other's risk is {2:F2}", this.Name, myRisk, otherRisk); if ((myRisk < otherRisk) || (AreEqual(myRisk, otherRisk) && Utils.RandNoGen.NextDouble() < 0.5)) // on equality, concede randomly { _myProposal = MyNewProposalFunction(_myProposal, _othersProposal); Console.WriteLine("[{0}]: I will concede with new proposal {1:F1}", this.Name, _myProposal); Send(_othersName, Utils.Str("propose", _myProposal)); } else { Console.WriteLine("[{0}]: I will not concede", this.Name); Send(_othersName, "continue"); } } private void HandleContinue() { _myProposal = MyNewProposalFunction(_myProposal, _othersProposal); Send(_othersName, Utils.Str("propose", _myProposal)); } private void HandleAccept() { Console.WriteLine("[{0}]: I accept {1:F1}", this.Name, _myProposal); Send(_othersName, "accept"); Stop(); } protected bool AreEqual(double x, double y) { return (Math.Abs(x - y) < 1e-10); } } }
37.844595
141
0.514372
[ "Apache-2.0" ]
dimven/ActressMas
ActressMas Examples/Concurrent Examples/C07 Zeuthen Strategy/BargainingAgent.cs
5,603
C#
namespace MacroMan { /// <summary> /// Source: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes /// </summary> public enum VirtualKey { /// <summary> /// Left mouse button /// </summary> LBUTTON = 0x01, /// <summary> /// Right mouse button /// </summary> RBUTTON = 0x02, /// <summary> /// Control-break processing /// </summary> CANCEL = 0x03, /// <summary> /// Middle mouse button (three-button mouse) /// </summary> MBUTTON = 0x04, /// <summary> /// X1 mouse button /// </summary> XBUTTON1 = 0x05, /// <summary> /// X2 mouse button /// </summary> XBUTTON2 = 0x06, //- 0x07 Undefined /// <summary> /// BACKSPACE key /// </summary> BACK = 0x08, /// <summary> /// TAB key /// </summary> TAB = 0x09, //- 0x0A-0B Reserved /// <summary> /// CLEAR key /// </summary> CLEAR = 0x0C, /// <summary> /// ENTER key /// </summary> RETURN = 0x0D, //- 0x0E-0F Undefined /// <summary> /// SHIFT key /// </summary> SHIFT = 0x10, /// <summary> /// CTRL key /// </summary> CONTROL = 0x11, /// <summary> /// ALT key /// </summary> MENU = 0x12, /// <summary> /// PAUSE key /// </summary> PAUSE = 0x13, /// <summary> /// CAPS LOCK key /// </summary> CAPITAL = 0x14, /// <summary> /// IME Kana mode /// </summary> KANA = 0x15, /// <summary> /// IME Hanguel mode (maintained for compatibility; use VK_HANGUL) /// </summary> HANGUEL = 0x15, /// <summary> /// IME Hangul mode /// </summary> HANGUL = 0x15, /// <summary> /// IME On /// </summary> IME_ON = 0x16, /// <summary> /// IME Junja mode /// </summary> JUNJA = 0x17, /// <summary> /// IME final mode /// </summary> FINAL = 0x18, /// <summary> /// IME Hanja mode /// </summary> HANJA = 0x19, /// <summary> /// IME Kanji mode /// </summary> KANJI = 0x19, /// <summary> /// IME Off /// </summary> IME_OFF = 0x1A, /// <summary> /// ESC key /// </summary> ESCAPE = 0x1B, /// <summary> /// IME convert /// </summary> CONVERT = 0x1C, /// <summary> /// IME nonconvert /// </summary> NONCONVERT = 0x1D, /// <summary> /// IME accept /// </summary> ACCEPT = 0x1E, /// <summary> /// IME mode change request /// </summary> MODECHANGE = 0x1F, /// <summary> /// SPACEBAR /// </summary> SPACE = 0x20, /// <summary> /// PAGE UP key /// </summary> PRIOR = 0x21, /// <summary> /// PAGE DOWN key /// </summary> NEXT = 0x22, /// <summary> /// END key /// </summary> END = 0x23, /// <summary> /// HOME key /// </summary> HOME = 0x24, /// <summary> /// LEFT ARROW key /// </summary> LEFT = 0x25, /// <summary> /// UP ARROW key /// </summary> UP = 0x26, /// <summary> /// RIGHT ARROW key /// </summary> RIGHT = 0x27, /// <summary> /// DOWN ARROW key /// </summary> DOWN = 0x28, /// <summary> /// SELECT key /// </summary> SELECT = 0x29, /// <summary> /// PRINT key /// </summary> PRINT = 0x2A, /// <summary> /// EXECUTE key /// </summary> EXECUTE = 0x2B, /// <summary> /// PRINT SCREEN key /// </summary> SNAPSHOT = 0x2C, /// <summary> /// INS key /// </summary> INSERT = 0x2D, /// <summary> /// DEL key /// </summary> DELETE = 0x2E, /// <summary> /// HELP key /// </summary> HELP = 0x2F, ZERO = 0X30, ONE = 0X31, TWO = 0X32, THREE = 0X33, FOUR = 0X34, FIVE = 0X35, SIX = 0X36, SEVEN = 0X37, EIGHT = 0X38, NINE = 0X39, A = 0X41, B = 0X42, C = 0X43, D = 0X44, E = 0X45, F = 0X46, G = 0X47, H = 0X48, I = 0X49, J = 0X4A, K = 0X4B, L = 0X4C, M = 0X4D, N = 0X4E, O = 0X4F, P = 0X50, Q = 0X51, R = 0X52, S = 0X53, T = 0X54, U = 0X55, V = 0X56, W = 0X57, X = 0X58, Y = 0X59, Z = 0X5A, /// <summary> /// Left Windows key (Natural keyboard) /// </summary> LWIN = 0x5B, /// <summary> /// Right Windows key (Natural keyboard) /// </summary> RWIN = 0x5C, /// <summary> /// Applications key (Natural keyboard) /// </summary> APPS = 0x5D, //- 0x5E Reserved /// <summary> /// Computer Sleep key /// </summary> SLEEP = 0x5F, /// <summary> /// Numeric keypad 0 key /// </summary> NUMPAD0 = 0x60, /// <summary> /// Numeric keypad 1 key /// </summary> NUMPAD1 = 0x61, /// <summary> /// Numeric keypad 2 key /// </summary> NUMPAD2 = 0x62, /// <summary> /// Numeric keypad 3 key /// </summary> NUMPAD3 = 0x63, /// <summary> /// Numeric keypad 4 key /// </summary> NUMPAD4 = 0x64, /// <summary> /// Numeric keypad 5 key /// </summary> NUMPAD5 = 0x65, /// <summary> /// Numeric keypad 6 key /// </summary> NUMPAD6 = 0x66, /// <summary> /// Numeric keypad 7 key /// </summary> NUMPAD7 = 0x67, /// <summary> /// Numeric keypad 8 key /// </summary> NUMPAD8 = 0x68, /// <summary> /// Numeric keypad 9 key /// </summary> NUMPAD9 = 0x69, /// <summary> /// Multiply key /// </summary> MULTIPLY = 0x6A, /// <summary> /// Add key /// </summary> ADD = 0x6B, /// <summary> /// Separator key /// </summary> SEPARATOR = 0x6C, /// <summary> /// Subtract key /// </summary> SUBTRACT = 0x6D, /// <summary> /// Decimal key /// </summary> DECIMAL = 0x6E, /// <summary> /// Divide key /// </summary> DIVIDE = 0x6F, /// <summary> /// F1 key /// </summary> F1 = 0x70, /// <summary> /// F2 key /// </summary> F2 = 0x71, /// <summary> /// F3 key /// </summary> F3 = 0x72, /// <summary> /// F4 key /// </summary> F4 = 0x73, /// <summary> /// F5 key /// </summary> F5 = 0x74, /// <summary> /// F6 key /// </summary> F6 = 0x75, /// <summary> /// F7 key /// </summary> F7 = 0x76, /// <summary> /// F8 key /// </summary> F8 = 0x77, /// <summary> /// F9 key /// </summary> F9 = 0x78, /// <summary> /// F10 key /// </summary> F10 = 0x79, /// <summary> /// F11 key /// </summary> F11 = 0x7A, /// <summary> /// F12 key /// </summary> F12 = 0x7B, /// <summary> /// F13 key /// </summary> F13 = 0x7C, /// <summary> /// F14 key /// </summary> F14 = 0x7D, /// <summary> /// F15 key /// </summary> F15 = 0x7E, /// <summary> /// F16 key /// </summary> F16 = 0x7F, /// <summary> /// F17 key /// </summary> F17 = 0x80, /// <summary> /// F18 key /// </summary> F18 = 0x81, /// <summary> /// F19 key /// </summary> F19 = 0x82, /// <summary> /// F20 key /// </summary> F20 = 0x83, /// <summary> /// F21 key /// </summary> F21 = 0x84, /// <summary> /// F22 key /// </summary> F22 = 0x85, /// <summary> /// F23 key /// </summary> F23 = 0x86, /// <summary> /// F24 key /// </summary> F24 = 0x87, //- 0x88-8F Unassigned /// <summary> /// NUM LOCK key /// </summary> NUMLOCK = 0x90, /// <summary> /// SCROLL LOCK key /// </summary> SCROLL = 0x91, //0x92-96 OEM specific //- 0x97-9F Unassigned /// <summary> /// Left SHIFT key /// </summary> LSHIFT = 0xA0, /// <summary> /// Right SHIFT key /// </summary> RSHIFT = 0xA1, /// <summary> /// Left CONTROL key /// </summary> LCONTROL = 0xA2, /// <summary> /// Right CONTROL key /// </summary> RCONTROL = 0xA3, /// <summary> /// Left MENU key /// </summary> LMENU = 0xA4, /// <summary> /// Right MENU key /// </summary> RMENU = 0xA5, /// <summary> /// Browser Back key /// </summary> BROWSER_BACK = 0xA6, /// <summary> /// Browser Forward key /// </summary> BROWSER_FORWARD = 0xA7, /// <summary> /// Browser Refresh key /// </summary> BROWSER_REFRESH = 0xA8, /// <summary> /// Browser Stop key /// </summary> BROWSER_STOP = 0xA9, /// <summary> /// Browser Search key /// </summary> BROWSER_SEARCH = 0xAA, /// <summary> /// Browser Favorites key /// </summary> BROWSER_FAVORITES = 0xAB, /// <summary> /// Browser Start and Home key /// </summary> BROWSER_HOME = 0xAC, /// <summary> /// Volume Mute key /// </summary> VOLUME_MUTE = 0xAD, /// <summary> /// Volume Down key /// </summary> VOLUME_DOWN = 0xAE, /// <summary> /// Volume Up key /// </summary> VOLUME_UP = 0xAF, /// <summary> /// Next Track key /// </summary> MEDIA_NEXT_TRACK = 0xB0, /// <summary> /// Previous Track key /// </summary> MEDIA_PREV_TRACK = 0xB1, /// <summary> /// Stop Media key /// </summary> MEDIA_STOP = 0xB2, /// <summary> /// Play/Pause Media key /// </summary> MEDIA_PLAY_PAUSE = 0xB3, /// <summary> /// Start Mail key /// </summary> LAUNCH_MAIL = 0xB4, /// <summary> /// Select Media key /// </summary> LAUNCH_MEDIA_SELECT = 0xB5, /// <summary> /// Start Application 1 key /// </summary> LAUNCH_APP1 = 0xB6, /// <summary> /// Start Application 2 key /// </summary> LAUNCH_APP2 = 0xB7, //- 0xB8-B9 Reserved /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ';:' key /// </summary> OEM_1 = 0xBA, /// <summary> /// For any country/region, the '+' key /// </summary> OEM_PLUS = 0xBB, /// <summary> /// For any country/region, the ',' key /// </summary> OEM_COMMA = 0xBC, /// <summary> /// For any country/region, the '-' key /// </summary> OEM_MINUS = 0xBD, /// <summary> /// For any country/region, the '.' key /// </summary> OEM_PERIOD = 0xBE, /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '/?' key /// </summary> OEM_2 = 0xBF, /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '`~' key /// </summary> OEM_3 = 0xC0, //- 0xC1-D7 Reserved //- 0xD8-DA Unassigned /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '[{' key /// </summary> OEM_4 = 0xDB, /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '\|' key /// </summary> OEM_5 = 0xDC, /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ']}' key /// </summary> OEM_6 = 0xDD, /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the 'single-quote/double-quote' key /// </summary> OEM_7 = 0xDE, /// <summary> /// Used for miscellaneous characters; it can vary by keyboard. /// </summary> OEM_8 = 0xDF, //- 0xE0 Reserved //0xE1 OEM specific /// <summary> /// Either the angle bracket key or the backslash key on the RT 102-key keyboard /// </summary> OEM_102 = 0xE2, //0xE3-E4 OEM specific /// <summary> /// IME PROCESS key /// </summary> PROCESSKEY = 0xE5, //0xE6 OEM specific /// <summary> /// Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP /// </summary> PACKET = 0xE7, //- 0xE8 Unassigned //0xE9-F5 OEM specific /// <summary> /// Attn key /// </summary> ATTN = 0xF6, /// <summary> /// CrSel key /// </summary> CRSEL = 0xF7, /// <summary> /// ExSel key /// </summary> EXSEL = 0xF8, /// <summary> /// Erase EOF key /// </summary> EREOF = 0xF9, /// <summary> /// Play key /// </summary> PLAY = 0xFA, /// <summary> /// Zoom key /// </summary> ZOOM = 0xFB, /// <summary> /// Reserved /// </summary> NONAME = 0xFC, /// <summary> /// PA1 key /// </summary> PA1 = 0xFD, /// <summary> /// Clear key /// </summary> OEM_CLEAR = 0xFE, } }
24.053929
256
0.409199
[ "MIT" ]
oxters168/MacroMan
BlenderGISMacro/WindowsValues/VirtualKey.cs
15,613
C#
using CsvHelper; using System; using System.Diagnostics; using System.IO; using System.Threading.Tasks; namespace OpenCsvByExcel { class Program { //App.config internal static Properties.Settings Settings { get; } = Properties.Settings.Default; static void Main(string[] args) { var opener = new Opener(); Parallel.ForEach( args, new ParallelOptions() { MaxDegreeOfParallelism = Settings.ParallelOpen }, path => { void showError(string message) => Trace.Fail($"{path}\n\n{message}"); if (File.Exists(path)) { try { opener.Open(path); } catch (BadDataException e) { showError($"Error: {e.Message}\n{e.ReadingContext.RawRecord}"); } catch (Exception e) { showError(e.ToString()); } } else { showError("File does not exists"); } }); } } }
27.06383
92
0.420597
[ "MIT" ]
mitaken/OpenCsvByExcel
OpenCsvByExcel/Program.cs
1,274
C#
/* // // INTEL CORPORATION PROPRIETARY INFORMATION // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Intel Corporation and may not be copied // or disclosed except in accordance with the terms of that agreement. // Copyright(c) 2003-2010 Intel Corporation. All Rights Reserved. // // Intel(R) Integrated Performance Primitives Using Intel(R) IPP // in Microsoft* C# .NET for Windows* Sample // // By downloading and installing this sample, you hereby agree that the // accompanying Materials are being provided to you under the terms and // conditions of the End User License Agreement for the Intel(R) Integrated // Performance Primitives product previously accepted by you. Please refer // to the file ippEULA.rtf located in the root directory of your Intel(R) IPP // product installation for more information. // */ // generated automatically on Wed Feb 3 16:23:34 2010 using System; using System.Security; using System.Runtime.InteropServices; namespace ipp { // // enums // public enum IppiKernelType { ippKernelSobel = 0, ippKernelScharr = 1, }; public enum IppiInpaintFlag { IPP_INPAINT_TELEA = 0, IPP_INPAINT_NS = 1, }; public enum IppiNorm { ippiNormInf = 0, ippiNormL1 = 1, ippiNormL2 = 2, ippiNormFM = 3, }; // // hidden or own structures // [StructLayout(LayoutKind.Sequential)] public struct IppFGGaussianState_8u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppFGGaussianState_8u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppFGHistogramState_8u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppFGHistogramState_8u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiConvState {}; [StructLayout(LayoutKind.Sequential)] public struct IppiHaarClassifier_32f {}; [StructLayout(LayoutKind.Sequential)] public struct IppiHaarClassifier_32s {}; [StructLayout(LayoutKind.Sequential)] public struct IppiInpaintState_8u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiInpaintState_8u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiMorphAdvState {}; [StructLayout(LayoutKind.Sequential)] public struct IppiMorphGrayState_32f {}; [StructLayout(LayoutKind.Sequential)] public struct IppiMorphGrayState_8u {}; [StructLayout(LayoutKind.Sequential)] public struct IppiMorphState {}; [StructLayout(LayoutKind.Sequential)] public struct IppiOptFlowPyrLK_8u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiOptFlowPyrLK_16u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiOptFlowPyrLK_32f_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidDownState_8u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidDownState_16u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidDownState_32f_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidDownState_8u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidDownState_16u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidDownState_32f_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidUpState_8u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidUpState_16u_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidUpState_32f_C1R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidUpState_8u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidUpState_16u_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiPyramidUpState_32f_C3R {}; [StructLayout(LayoutKind.Sequential)] public struct IppiSRHNSpec_PSF2x2 {}; [StructLayout(LayoutKind.Sequential)] public struct IppiSRHNSpec_PSF3x3 {}; [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)] unsafe public struct IppiPyramid { public byte** pImage; public IppiSize* pRoi; public double* pRate; public int* pStep; public byte* pState; public int level; }; [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)] public struct IppFGGaussianModel { public int numGauss; public float priorBack; public float updBGProb; public int winSize; public int numFrame; public float detectionRate; public float brightnessDistortion; public int shadowBG; public IppFGGaussianModel ( int numGauss, float priorBack, float updBGProb, int winSize, int numFrame, float detectionRate, float brightnessDistortion, int shadowBG ) { this.numGauss = numGauss; this.priorBack = priorBack; this.updBGProb = updBGProb; this.winSize = winSize; this.numFrame = numFrame; this.detectionRate = detectionRate; this.brightnessDistortion = brightnessDistortion; this.shadowBG = shadowBG; }}; [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)] public struct IppiConnectedComp { public double area; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public double[] value; public IppiRect rect; public IppiConnectedComp(double area) { this.area = area; value = new double[3]; rect = new IppiRect(); } }; [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)] public struct IppFGHistogramModel { public int valueQuant; public int changeQuant; public int valueUse; public int valueAll; public int changeUse; public int changeAll; public float updBGChange; public float updBGRef; public int numFrame; public float detectionRate; public float brightnessDistortion; public int shadowBG; public IppFGHistogramModel ( int valueQuant, int changeQuant, int valueUse, int valueAll, int changeUse, int changeAll, float updBGChange, float updBGRef, int numFrame, float detectionRate, float brightnessDistortion, int shadowBG ) { this.valueQuant = valueQuant; this.changeQuant = changeQuant; this.valueUse = valueUse; this.valueAll = valueAll; this.changeUse = changeUse; this.changeAll = changeAll; this.updBGChange = updBGChange; this.updBGRef = updBGRef; this.numFrame = numFrame; this.detectionRate = detectionRate; this.brightnessDistortion = brightnessDistortion; this.shadowBG = shadowBG; }}; unsafe public class cv { internal const string libname = "ippcv-7.0.dll"; [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname,EntryPoint="ippcvGetLibVersion")] public static extern int* xippcvGetLibVersion ( ); public static IppLibraryVersion ippcvGetLibVersion() { return new IppLibraryVersion( xippcvGetLibVersion() ); } [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiffC_16u_C1R ( ushort *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, int value ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiffC_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float value ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiffC_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, int value ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiff_16u_C1R ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, ushort *pDst, int dstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiff_32f_C1R ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, float *pDst, int dstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiff_8u_C1R ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pDst, int dstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAbsDiff_8u_C3R ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pDst, int dstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_16u32f_C1IMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_16u32f_C1IR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_32f_C1IMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_32f_C1IR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_8s32f_C1IMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_8s32f_C1IR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_8u32f_C1IMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddProduct_8u32f_C1IR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_16u32f_C1IMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_16u32f_C1IR ( ushort *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_32f_C1IMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_32f_C1IR ( float *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_8s32f_C1IMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_8s32f_C1IR ( sbyte *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_8u32f_C1IMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddSquare_8u32f_C1IR ( byte *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_16u32f_C1IMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_16u32f_C1IR ( ushort *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_32f_C1IMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_32f_C1IR ( float *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_32f_C1R ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, float *pDst, int dstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_8s32f_C1IMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_8s32f_C1IR ( sbyte *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_8u32f_C1IMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAddWeighted_8u32f_C1IR ( byte *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float alpha ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_16u32f_C1IMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_16u32f_C1IR ( ushort *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_32f_C1IMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_8s32f_C1IMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_8s32f_C1IR ( sbyte *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_8u32f_C1IMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiAdd_8u32f_C1IR ( byte *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiApplyHaarClassifier_32f_C1R ( float *pSrc, int srcStep, float *pNorm, int normStep, byte *pMask, int maskStep, IppiSize roiSize, int *pPositive, float threshold, IppiHaarClassifier_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiApplyHaarClassifier_32s32f_C1R ( int *pSrc, int srcStep, float *pNorm, int normStep, byte *pMask, int maskStep, IppiSize roiSize, int *pPositive, float threshold, IppiHaarClassifier_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiApplyHaarClassifier_32s_C1RSfs ( int *pSrc, int srcStep, int *pNorm, int normStep, byte *pMask, int maskStep, IppiSize roiSize, int *pPositive, int threshold, IppiHaarClassifier_32s *pState, int scaleFactor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiApplyMixedHaarClassifier_32f_C1R ( float *pSrc, int srcStep, float *pTilt, int tiltStep, float *pNorm, int normStep, byte *pMask, int maskStep, IppiSize roiSize, int *pPositive, float threshold, IppiHaarClassifier_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiApplyMixedHaarClassifier_32s32f_C1R ( int *pSrc, int srcStep, int *pTilt, int tiltStep, float *pNorm, int normStep, byte *pMask, int maskStep, IppiSize roiSize, int *pPositive, float threshold, IppiHaarClassifier_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiApplyMixedHaarClassifier_32s_C1RSfs ( int *pSrc, int srcStep, int *pTilt, int tiltStep, int *pNorm, int normStep, byte *pMask, int maskStep, IppiSize roiSize, int *pPositive, int threshold, IppiHaarClassifier_32s *pState, int scaleFactor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiBoundSegments_16u_C1IR ( ushort *pMarker, int markerStep, IppiSize roiSize, ushort val, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiBoundSegments_8u_C1IR ( byte *pMarker, int markerStep, IppiSize roiSize, byte val, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCannyGetSize ( IppiSize roiSize, int *bufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCanny_16s8u_C1R ( short *pSrcDx, int srcDxStep, short *pSrcDy, int srcDyStep, byte *pDstEdges, int dstEdgeStep, IppiSize roiSize, float lowThresh, float highThresh, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCanny_32f8u_C1R ( float *pSrcDx, int srcDxStep, float *pSrcDy, int srcDyStep, byte *pDstEdges, int dstEdgeStep, IppiSize roiSize, float lowThresh, float highThresh, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpixIntersect_16u32f_C1R ( ushort *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPoint_32f point, IppiPoint *pMin, IppiPoint *pMax ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpixIntersect_16u_C1R ( ushort *pSrc, int srcStep, IppiSize srcRoiSize, ushort *pDst, int dstStep, IppiSize dstRoiSize, IppiPoint_32f point, IppiPoint *pMin, IppiPoint *pMax ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpixIntersect_32f_C1R ( float *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPoint_32f point, IppiPoint *pMin, IppiPoint *pMax ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpixIntersect_8u16u_C1R_Sfs ( byte *pSrc, int srcStep, IppiSize srcRoiSize, ushort *pDst, int dstStep, IppiSize dstRoiSize, IppiPoint_32f point, IppiPoint *pMin, IppiPoint *pMax, int scaleFactor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpixIntersect_8u32f_C1R ( byte *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPoint_32f point, IppiPoint *pMin, IppiPoint *pMax ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpixIntersect_8u_C1R ( byte *pSrc, int srcStep, IppiSize srcRoiSize, byte *pDst, int dstStep, IppiSize dstRoiSize, IppiPoint_32f point, IppiPoint *pMin, IppiPoint *pMax ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpix_16u32f_C1R ( ushort *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float dx, float dy ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpix_16u_C1R ( ushort *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, float dx, float dy ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpix_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float dx, float dy ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpix_8u16u_C1R_Sfs ( byte *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, float dx, float dy, int scaleFactor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpix_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float dx, float dy ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCopySubpix_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, float dx, float dy ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiCreateMapCameraUndistort_32f_C1R ( float *pxMap, int xStep, float *pyMap, int yStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, float p1, float p2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDilateBorderReplicate_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDilateBorderReplicate_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDilateBorderReplicate_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDilateBorderReplicate_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDilateBorderReplicate_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDilateBorderReplicate_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_3x3_8u16u_C1R ( byte *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_3x3_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_3x3_8u_C1IR ( byte *pSrcDst, int srcDstStep, IppiSize roiSize, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_3x3_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_5x5_8u16u_C1R ( byte *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_5x5_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_5x5_8u_C1IR ( byte *pSrcDst, int srcDstStep, IppiSize roiSize, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiDistanceTransform_5x5_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiEigenValsVecsGetBufferSize_32f_C1R ( IppiSize roiSize, int apertureSize, int avgWindow, int *bufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiEigenValsVecsGetBufferSize_8u32f_C1R ( IppiSize roiSize, int apertureSize, int avgWindow, int *bufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiEigenValsVecs_32f_C1R ( float *pSrc, int srcStep, float *pEigenVV, int eigStep, IppiSize roiSize, IppiKernelType kernType, int apertureSize, int avgWindow, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiEigenValsVecs_8u32f_C1R ( byte *pSrc, int srcStep, float *pEigenVV, int eigStep, IppiSize roiSize, IppiKernelType kernType, int apertureSize, int avgWindow, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiErodeBorderReplicate_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiErodeBorderReplicate_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiErodeBorderReplicate_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiErodeBorderReplicate_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiErodeBorderReplicate_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiErodeBorderReplicate_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFastMarchingGetBufferSize_8u32f_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFastMarching_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float radius, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_16s8s_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_16s8s_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_16s8u_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_16s8u_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_16s_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_16s_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_32f_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_32f_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_Low_16s_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipelineGetBufferSize_Low_16s_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_16s8s_C1R ( short **ppSrc, sbyte *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_16s8s_C3R ( short **ppSrc, sbyte *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_16s8u_C1R ( short **ppSrc, byte *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_16s8u_C3R ( short **ppSrc, byte *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_16s_C1R ( short **ppSrc, short *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_16s_C3R ( short **ppSrc, short *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_32f_C1R ( float **ppSrc, float *pDst, int dstStep, IppiSize roiSize, float *pKernel, int kernelSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_32f_C3R ( float **ppSrc, float *pDst, int dstStep, IppiSize roiSize, float *pKernel, int kernelSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_Low_16s_C1R ( short **ppSrc, short *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterColumnPipeline_Low_16s_C3R ( short **ppSrc, short *pDst, int dstStep, IppiSize roiSize, short *pKernel, int kernelSize, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterGaussBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, int KernelSize, float sigma, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterGaussGetBufferSize_32f_C1R ( IppiSize roiSize, int KernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLaplacianBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLaplacianBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLaplacianBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLaplacianGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLaplacianGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLaplacianGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLowpassBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLowpassBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLowpassGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterLowpassGetBufferSize_8u_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxBorderReplicate_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxBorderReplicate_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxBorderReplicate_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxBorderReplicate_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxBorderReplicate_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxBorderReplicate_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxGetBufferSize_32f_C1R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxGetBufferSize_32f_C3R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxGetBufferSize_32f_C4R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxGetBufferSize_8u_C1R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxGetBufferSize_8u_C3R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMaxGetBufferSize_8u_C4R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinBorderReplicate_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinBorderReplicate_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinBorderReplicate_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinBorderReplicate_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinBorderReplicate_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinBorderReplicate_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiSize maskSize, IppiPoint anchor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinGetBufferSize_32f_C1R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinGetBufferSize_32f_C3R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinGetBufferSize_32f_C4R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinGetBufferSize_8u_C1R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinGetBufferSize_8u_C3R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterMinGetBufferSize_8u_C4R ( int roiWidth, IppiSize maskSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_16s_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_16s_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_32f_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_32f_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_8u16s_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_8u16s_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_Low_16s_C1R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipelineGetBufferSize_Low_16s_C3R ( IppiSize roiSize, int kernelSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_16s_C1R ( short *pSrc, int srcStep, short **ppDst, IppiSize roiSize, short *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, short borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_16s_C3R ( short *pSrc, int srcStep, short **ppDst, IppiSize roiSize, short *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, short *borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_32f_C1R ( float *pSrc, int srcStep, float **ppDst, IppiSize roiSize, float *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_32f_C3R ( float *pSrc, int srcStep, float **ppDst, IppiSize roiSize, float *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, float *borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_8u16s_C1R ( byte *pSrc, int srcStep, short **ppDst, IppiSize roiSize, short *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_8u16s_C3R ( byte *pSrc, int srcStep, short **ppDst, IppiSize roiSize, short *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, byte *borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_Low_16s_C1R ( short *pSrc, int srcStep, short **ppDst, IppiSize roiSize, short *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, short borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterRowBorderPipeline_Low_16s_C3R ( short *pSrc, int srcStep, short **ppDst, IppiSize roiSize, short *pKernel, int kernelSize, int xAnchor, IppiBorderType borderType, short *borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrHorizBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrHorizBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrHorizBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrHorizGetBufferSize_32f_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrHorizGetBufferSize_8u16s_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrHorizGetBufferSize_8u8s_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrVertBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrVertBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrVertBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrVertGetBufferSize_32f_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrVertGetBufferSize_8u16s_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterScharrVertGetBufferSize_8u8s_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelCrossBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelCrossBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelCrossBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelCrossGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelCrossGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelCrossGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizSecondBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizSecondBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizSecondBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizSecondGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizSecondGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelHorizSecondGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelNegVertBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelNegVertBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelNegVertBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelNegVertGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelNegVertGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelNegVertGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertSecondBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, float borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertSecondBorder_8u16s_C1R ( byte *pSrc, int srcStep, short *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertSecondBorder_8u8s_C1R ( byte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, IppiMaskSize mask, IppiBorderType borderType, byte borderValue, int divisor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertSecondGetBufferSize_32f_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertSecondGetBufferSize_8u16s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFilterSobelVertSecondGetBufferSize_8u8s_C1R ( IppiSize roiSize, IppiMaskSize mask, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFindPeaks3x3GetBufferSize_32f_C1R ( int roiWidth, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFindPeaks3x3GetBufferSize_32s_C1R ( int roiWidth, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFindPeaks3x3_32f_C1R ( float *pSrc, int srcStep, IppiSize roiSize, float threshold, IppiPoint *pPeak, int maxPeakCount, int *pPeakCount, IppiNorm norm, int Border, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFindPeaks3x3_32s_C1R ( int *pSrc, int srcStep, IppiSize roiSize, int threshold, IppiPoint *pPeak, int maxPeakCount, int *pPeakCount, IppiNorm norm, int Border, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFillGetSize ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFillGetSize_Grad ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_4Con_16u_C1IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort newVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_4Con_16u_C3IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort *pNewVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_4Con_32f_C1IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float newVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_4Con_32f_C3IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float *pNewVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_4Con_8u_C1IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte newVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_4Con_8u_C3IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte *pNewVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_8Con_16u_C1IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort newVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_8Con_16u_C3IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort *pNewVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_8Con_32f_C1IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float newVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_8Con_32f_C3IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float *pNewVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_8Con_8u_C1IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte newVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_8Con_8u_C3IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte *pNewVal, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad4Con_16u_C1IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort newVal, ushort minDelta, ushort maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad4Con_16u_C3IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort *pNewVal, ushort *pMinDelta, ushort *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad4Con_32f_C1IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float newVal, float minDelta, float maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad4Con_32f_C3IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float *pNewVal, float *pMinDelta, float *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad4Con_8u_C1IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte newVal, byte minDelta, byte maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad4Con_8u_C3IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte *pNewVal, byte *pMinDelta, byte *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad8Con_16u_C1IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort newVal, ushort minDelta, ushort maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad8Con_16u_C3IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort *pNewVal, ushort *pMinDelta, ushort *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad8Con_32f_C1IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float newVal, float minDelta, float maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad8Con_32f_C3IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float *pNewVal, float *pMinDelta, float *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad8Con_8u_C1IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte newVal, byte minDelta, byte maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Grad8Con_8u_C3IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte *pNewVal, byte *pMinDelta, byte *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range4Con_16u_C1IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort newVal, ushort minDelta, ushort maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range4Con_16u_C3IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort *pNewVal, ushort *pMinDelta, ushort *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range4Con_32f_C1IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float newVal, float minDelta, float maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range4Con_32f_C3IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float *pNewVal, float *pMinDelta, float *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range4Con_8u_C1IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte newVal, byte minDelta, byte maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range4Con_8u_C3IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte *pNewVal, byte *pMinDelta, byte *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range8Con_16u_C1IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort newVal, ushort minDelta, ushort maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range8Con_16u_C3IR ( ushort *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, ushort *pNewVal, ushort *pMinDelta, ushort *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range8Con_32f_C1IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float newVal, float minDelta, float maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range8Con_32f_C3IR ( float *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, float *pNewVal, float *pMinDelta, float *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range8Con_8u_C1IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte newVal, byte minDelta, byte maxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiFloodFill_Range8Con_8u_C3IR ( byte *pImage, int imageStep, IppiSize roiSize, IppiPoint seed, byte *pNewVal, byte *pMinDelta, byte *pMaxDelta, ref IppiConnectedComp pRegion, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundGaussianFree_8u_C1R ( IppFGGaussianState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundGaussianFree_8u_C3R ( IppFGGaussianState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundGaussianInitAlloc_8u_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, IppFGGaussianModel *pModel, IppFGGaussianState_8u_C1R **pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundGaussianInitAlloc_8u_C3R ( byte *pSrc, int srcStep, IppiSize roiSize, IppFGGaussianModel *pModel, IppFGGaussianState_8u_C3R **pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundGaussian_8u_C1R ( byte *pSrc, int srcStep, byte *pRef, int refStep, byte *pDst, int dstStep, IppiSize roiSize, IppFGGaussianState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundGaussian_8u_C3R ( byte *pSrc, int srcStep, byte *pRef, int refStep, byte *pDst, int dstStep, IppiSize roiSize, IppFGGaussianState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogramFree_8u_C1R ( IppFGHistogramState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogramFree_8u_C3R ( IppFGHistogramState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogramInitAlloc_8u_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, IppFGHistogramModel *pModel, IppFGHistogramState_8u_C1R **pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogramInitAlloc_8u_C3R ( byte *pSrc, int srcStep, IppiSize roiSize, IppFGHistogramModel *pModel, IppFGHistogramState_8u_C3R **pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogramUpdate_8u_C1R ( byte *pSrc, int srcStep, byte *pMask, int maskStep, byte *pRef, int refStep, IppiSize roiSize, IppFGHistogramState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogramUpdate_8u_C3R ( byte *pSrc, int srcStep, byte *pMask, int maskStep, byte *pRef, int refStep, IppiSize roiSize, IppFGHistogramState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogram_8u_C1R ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, IppFGHistogramState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiForegroundHistogram_8u_C3R ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, IppFGHistogramState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGenSobelKernel_16s ( short *pDst, int kernelSize, int dx, int sign ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGenSobelKernel_32f ( float *pDst, int kernelSize, int dx, int sign ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetDistanceTransformMask ( int maskType, float *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetDistanceTransformMask_32f ( int kerSize, IppiNorm norm, float *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetDistanceTransformMask_32s ( int kerSize, IppiNorm norm, int *pMetrics ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetHaarClassifierSize_32f ( IppiHaarClassifier_32f *pState, IppiSize *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetHaarClassifierSize_32s ( IppiHaarClassifier_32s *pState, IppiSize *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetPyramidDownROI ( IppiSize srcRoi, IppiSize *pDstRoi, float rate ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGetPyramidUpROI ( IppiSize srcRoi, IppiSize *pDstRoiMin, IppiSize *pDstRoiMax, float rate ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGradientColorToGray_16u_C3C1R ( ushort *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGradientColorToGray_32f_C3C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGradientColorToGray_8u_C3C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGrayDilateBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType border, IppiMorphGrayState_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGrayDilateBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType border, IppiMorphGrayState_8u *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGrayErodeBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType border, IppiMorphGrayState_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiGrayErodeBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType border, IppiMorphGrayState_8u *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHaarClassifierFree_32f ( IppiHaarClassifier_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHaarClassifierFree_32s ( IppiHaarClassifier_32s *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHaarClassifierInitAlloc_32f ( IppiHaarClassifier_32f **pState, IppiRect *pFeature, float *pWeight, float *pThreshold, float *pVal1, float *pVal2, int *pNum, int length ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHaarClassifierInitAlloc_32s ( IppiHaarClassifier_32s **pState, IppiRect *pFeature, int *pWeight, int *pThreshold, int *pVal1, int *pVal2, int *pNum, int length ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHoughLineGetSize_8u_C1R ( IppiSize roiSize, IppPointPolar delta, int maxLineCount, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHoughLine_8u32f_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, IppPointPolar delta, int threshold, IppPointPolar *pLine, int maxLineCount, int *pLineCount, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiHoughLine_Region_8u32f_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, IppPointPolar *pLine, IppPointPolar *dstRoi, int maxLineCount, int *pLineCount, IppPointPolar delta, int threshold, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiInpaintFree_8u_C1R ( IppiInpaintState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiInpaintFree_8u_C3R ( IppiInpaintState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiInpaintInitAlloc_8u_C1R ( IppiInpaintState_8u_C1R **ppState, float *pDist, int distStep, byte *pMask, int maskStep, IppiSize roiSize, float radius, IppiInpaintFlag flags ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiInpaintInitAlloc_8u_C3R ( IppiInpaintState_8u_C3R **ppState, float *pDist, int distStep, byte *pMask, int maskStep, IppiSize roiSize, float radius, IppiInpaintFlag flags ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiInpaint_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiInpaintState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiInpaint_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiInpaintState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiIntegral_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float val ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiIntegral_8u32s_C1R ( byte *pSrc, int srcStep, int *pDst, int dstStep, IppiSize roiSize, int val ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiLabelMarkersGetBufferSize_16u_C1R ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiLabelMarkersGetBufferSize_8u_C1R ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiLabelMarkers_16u_C1IR ( ushort *pMarker, int markerStep, IppiSize roiSize, int minLabel, int maxLabel, IppiNorm norm, int *pNumber, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiLabelMarkers_8u_C1IR ( byte *pMarker, int markerStep, IppiSize roiSize, int minLabel, int maxLabel, IppiNorm norm, int *pNumber, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_16u_C1MR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_16u_C3CMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_32f_C1MR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_32f_C3CMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_8s_C1MR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_8s_C3CMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_8u_C1MR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_8u_C3CMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_16u_C1MR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_16u_C1R ( ushort *pSrc, int srcStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_16u_C3CMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_16u_C3CR ( ushort *pSrc, int srcStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_32f_C1MR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_32f_C1R ( float *pSrc, int srcStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_32f_C3CMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_32f_C3CR ( float *pSrc, int srcStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8s_C1MR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8s_C1R ( sbyte *pSrc, int srcStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8s_C3CMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8s_C3CR ( sbyte *pSrc, int srcStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8u_C1MR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8u_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8u_C3CMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMean_StdDev_8u_C3CR ( byte *pSrc, int srcStep, IppiSize roiSize, int coi, double *pMean, double *pStdDev ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinEigenValGetBufferSize_32f_C1R ( IppiSize roiSize, int apertureSize, int avgWindow, int *bufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinEigenValGetBufferSize_8u32f_C1R ( IppiSize roiSize, int apertureSize, int avgWindow, int *bufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinEigenVal_32f_C1R ( float *pSrc, int srcStep, float *pMinEigenVal, int minValStep, IppiSize roiSize, IppiKernelType kernType, int apertureSize, int avgWindow, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinEigenVal_8u32f_C1R ( byte *pSrc, int srcStep, float *pMinEigenVal, int minValStep, IppiSize roiSize, IppiKernelType kernType, int apertureSize, int avgWindow, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_16u_C1MR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_16u_C1R ( ushort *pSrc, int srcStep, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_16u_C3CMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_16u_C3CR ( ushort *pSrc, int srcStep, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_32f_C1MR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_32f_C1R ( float *pSrc, int step, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_32f_C3CMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_32f_C3CR ( float *pSrc, int step, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8s_C1MR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8s_C1R ( sbyte *pSrc, int step, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8s_C3CMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8s_C3CR ( sbyte *pSrc, int step, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8u_C1MR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8u_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8u_C3CMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMinMaxIndx_8u_C3CR ( byte *pSrc, int srcStep, IppiSize roiSize, int coi, float *pMinVal, float *pMaxVal, IppiPoint *pMinIndex, IppiPoint *pMaxIndex ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvFree ( IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvGetSize_32f_C1R ( IppiSize roiSize, byte *pMask, IppiSize maskSize, int *stateSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvGetSize_32f_C3R ( IppiSize roiSize, byte *pMask, IppiSize maskSize, int *stateSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvGetSize_32f_C4R ( IppiSize roiSize, byte *pMask, IppiSize maskSize, int *stateSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvGetSize_8u_C1R ( IppiSize roiSize, byte *pMask, IppiSize maskSize, int *stateSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvGetSize_8u_C3R ( IppiSize roiSize, byte *pMask, IppiSize maskSize, int *stateSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvGetSize_8u_C4R ( IppiSize roiSize, byte *pMask, IppiSize maskSize, int *stateSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInitAlloc_32f_C1R ( IppiMorphAdvState **morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInitAlloc_32f_C3R ( IppiMorphAdvState **morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInitAlloc_32f_C4R ( IppiMorphAdvState **morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInitAlloc_8u_C1R ( IppiMorphAdvState **morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInitAlloc_8u_C3R ( IppiMorphAdvState **morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInitAlloc_8u_C4R ( IppiMorphAdvState **morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInit_32f_C1R ( IppiMorphAdvState *morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInit_32f_C3R ( IppiMorphAdvState *morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInit_32f_C4R ( IppiMorphAdvState *morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInit_8u_C1R ( IppiMorphAdvState *morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInit_8u_C3R ( IppiMorphAdvState *morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphAdvInit_8u_C4R ( IppiMorphAdvState *morphState, IppiSize roiSize, byte *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphBlackhatBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphBlackhatBorder_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphBlackhatBorder_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphBlackhatBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphBlackhatBorder_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphBlackhatBorder_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphCloseBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphCloseBorder_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphCloseBorder_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphCloseBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphCloseBorder_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphCloseBorder_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGradientBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGradientBorder_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGradientBorder_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGradientBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGradientBorder_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGradientBorder_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayFree_32f_C1R ( IppiMorphGrayState_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayFree_8u_C1R ( IppiMorphGrayState_8u *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayGetSize_32f_C1R ( IppiSize roiSize, float *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayGetSize_8u_C1R ( IppiSize roiSize, int *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayInitAlloc_32f_C1R ( IppiMorphGrayState_32f **ppState, IppiSize roiSize, float *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayInitAlloc_8u_C1R ( IppiMorphGrayState_8u **ppState, IppiSize roiSize, int *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayInit_32f_C1R ( IppiMorphGrayState_32f *pState, IppiSize roiSize, float *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphGrayInit_8u_C1R ( IppiMorphGrayState_8u *pState, IppiSize roiSize, int *pMask, IppiSize maskSize, IppiPoint anchor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphOpenBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphOpenBorder_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphOpenBorder_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphOpenBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphOpenBorder_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphOpenBorder_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructDilate_16u_C1IR ( ushort *pSrc, int srcStep, ushort *pSrcDst, int srcDstStep, IppiSize roiSize, byte *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructDilate_32f_C1IR ( float *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructDilate_64f_C1IR ( double *pSrc, int srcStep, double *pSrcDst, int srcDstStep, IppiSize roiSize, byte *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructDilate_8u_C1IR ( byte *pSrc, int srcStep, byte *pSrcDst, int srcDstStep, IppiSize roiSize, byte *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructErode_16u_C1IR ( ushort *pSrc, int srcStep, ushort *pSrcDst, int srcDstStep, IppiSize roiSize, byte *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructErode_32f_C1IR ( float *pSrc, int srcStep, float *pSrcDst, int srcDstStep, IppiSize roiSize, float *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructErode_64f_C1IR ( double *pSrc, int srcStep, double *pSrcDst, int srcDstStep, IppiSize roiSize, byte *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructErode_8u_C1IR ( byte *pSrc, int srcStep, byte *pSrcDst, int srcDstStep, IppiSize roiSize, byte *pBuf, IppiNorm norm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructGetBufferSize_16u_C1 ( IppiSize roiSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructGetBufferSize_32f_C1 ( IppiSize roiSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructGetBufferSize_64f_C1 ( IppiSize roiSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphReconstructGetBufferSize_8u_C1 ( IppiSize roiSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphTophatBorder_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphTophatBorder_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphTophatBorder_32f_C4R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphTophatBorder_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphTophatBorder_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphTophatBorder_8u_C4R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, IppiBorderType borderType, IppiMorphAdvState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyFree ( IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyGetSize_32f_C1R ( int roiWidth, byte *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyGetSize_32f_C3R ( int roiWidth, byte *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyGetSize_32f_C4R ( int roiWidth, byte *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyGetSize_8u_C1R ( int roiWidth, byte *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyGetSize_8u_C3R ( int roiWidth, byte *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyGetSize_8u_C4R ( int roiWidth, byte *pMask, IppiSize maskSize, int *pSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInitAlloc_32f_C1R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState **ppState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInitAlloc_32f_C3R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState **ppState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInitAlloc_32f_C4R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState **ppState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInitAlloc_8u_C1R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState **ppState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInitAlloc_8u_C3R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState **ppState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInitAlloc_8u_C4R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState **ppState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInit_32f_C1R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInit_32f_C3R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInit_32f_C4R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInit_8u_C1R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInit_8u_C3R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiMorphologyInit_8u_C4R ( int roiWidth, byte *pMask, IppiSize maskSize, IppiPoint anchor, IppiMorphState *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_16u_C1MR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_16u_C3CMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_32f_C1MR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_32f_C3CMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_8s_C1MR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_8s_C3CMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_8u_C1MR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_Inf_8u_C3CMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_16u_C1MR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_16u_C3CMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_32f_C1MR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_32f_C3CMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_8s_C1MR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_8s_C3CMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_8u_C1MR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L1_8u_C3CMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_16u_C1MR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_16u_C3CMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_32f_C1MR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_32f_C3CMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_8s_C1MR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_8s_C3CMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_8u_C1MR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormDiff_L2_8u_C3CMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_16u_C1MR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_16u_C3CMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_32f_C1MR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_32f_C3CMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_8s_C1MR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_8s_C3CMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_8u_C1MR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_Inf_8u_C3CMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_16u_C1MR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_16u_C3CMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_32f_C1MR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_32f_C3CMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_8s_C1MR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_8s_C3CMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_8u_C1MR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L1_8u_C3CMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_16u_C1MR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_16u_C3CMR ( ushort *pSrc1, int src1Step, ushort *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_32f_C1MR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_32f_C3CMR ( float *pSrc1, int src1Step, float *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_8s_C1MR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_8s_C3CMR ( sbyte *pSrc1, int src1Step, sbyte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_8u_C1MR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNormRel_L2_8u_C3CMR ( byte *pSrc1, int src1Step, byte *pSrc2, int src2Step, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_16u_C1MR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_16u_C3CMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_32f_C1MR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_32f_C3CMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_8s_C1MR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_8s_C3CMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_8u_C1MR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_Inf_8u_C3CMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_16u_C1MR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_16u_C3CMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_32f_C1MR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_32f_C3CMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_8s_C1MR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_8s_C3CMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_8u_C1MR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L1_8u_C3CMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_16u_C1MR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_16u_C3CMR ( ushort *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_32f_C1MR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_32f_C3CMR ( float *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_8s_C1MR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_8s_C3CMR ( sbyte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_8u_C1MR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiNorm_L2_8u_C3CMR ( byte *pSrc, int srcStep, byte *pMask, int maskStep, IppiSize roiSize, int coi, double *pNorm ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLKFree_16u_C1R ( IppiOptFlowPyrLK_16u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLKFree_32f_C1R ( IppiOptFlowPyrLK_32f_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLKFree_8u_C1R ( IppiOptFlowPyrLK_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLKInitAlloc_16u_C1R ( IppiOptFlowPyrLK_16u_C1R **ppState, IppiSize roiSize, int winSize, IppHintAlgorithm hint ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLKInitAlloc_32f_C1R ( IppiOptFlowPyrLK_32f_C1R **ppState, IppiSize roiSize, int winSize, IppHintAlgorithm hint ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLKInitAlloc_8u_C1R ( IppiOptFlowPyrLK_8u_C1R **ppState, IppiSize roiSize, int winSize, IppHintAlgorithm hint ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLK_16u_C1R ( IppiPyramid *pPyr1, IppiPyramid *pPyr2, IppiPoint_32f *pPrev, IppiPoint_32f *pNext, sbyte *pStatus, float *pError, int numFeat, int winSize, int maxLev, int maxIter, float threshold, IppiOptFlowPyrLK_16u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLK_32f_C1R ( IppiPyramid *pPyr1, IppiPyramid *pPyr2, IppiPoint_32f *pRrev, IppiPoint_32f *pNext, sbyte *pStatus, float *pError, int numFeat, int winSize, int maxLev, int maxIter, float threshold, IppiOptFlowPyrLK_32f_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiOpticalFlowPyrLK_8u_C1R ( IppiPyramid *pPyr1, IppiPyramid *pPyr2, IppiPoint_32f *pPrev, IppiPoint_32f *pNext, sbyte *pStatus, float *pError, int numFeat, int winSize, int maxLev, int maxIter, float threshold, IppiOptFlowPyrLK_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDownGetBufSize_Gauss5x5 ( int roiWidth, IppDataType dataType, int channels, int *bufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDown_Gauss5x5_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDown_Gauss5x5_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDown_Gauss5x5_8s_C1R ( sbyte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDown_Gauss5x5_8s_C3R ( sbyte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDown_Gauss5x5_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrDown_Gauss5x5_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUpGetBufSize_Gauss5x5 ( int roiWidth, IppDataType dataType, int channels, int *bufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUp_Gauss5x5_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUp_Gauss5x5_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUp_Gauss5x5_8s_C1R ( sbyte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUp_Gauss5x5_8s_C3R ( sbyte *pSrc, int srcStep, sbyte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUp_Gauss5x5_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyrUp_Gauss5x5_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidFree ( IppiPyramid *pPyr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidInitAlloc ( IppiPyramid **ppPyr, int level, IppiSize roiSize, float rate ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownFree_16u_C1R ( IppiPyramidDownState_16u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownFree_16u_C3R ( IppiPyramidDownState_16u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownFree_32f_C1R ( IppiPyramidDownState_32f_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownFree_32f_C3R ( IppiPyramidDownState_32f_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownFree_8u_C1R ( IppiPyramidDownState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownFree_8u_C3R ( IppiPyramidDownState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownInitAlloc_16u_C1R ( IppiPyramidDownState_16u_C1R **ppState, IppiSize srcRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownInitAlloc_16u_C3R ( IppiPyramidDownState_16u_C3R **ppState, IppiSize srcRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownInitAlloc_32f_C1R ( IppiPyramidDownState_32f_C1R **ppState, IppiSize srcRoi, float rate, float *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownInitAlloc_32f_C3R ( IppiPyramidDownState_32f_C3R **ppState, IppiSize srcRoi, float rate, float *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownInitAlloc_8u_C1R ( IppiPyramidDownState_8u_C1R **ppState, IppiSize srcRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDownInitAlloc_8u_C3R ( IppiPyramidDownState_8u_C3R **ppState, IppiSize srcRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDown_16u_C1R ( ushort *pSrc, int srcStep, IppiSize srcRoiSize, ushort *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidDownState_16u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDown_16u_C3R ( ushort *pSrc, int srcStep, IppiSize srcRoiSize, ushort *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidDownState_16u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDown_32f_C1R ( float *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidDownState_32f_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDown_32f_C3R ( float *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidDownState_32f_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDown_8u_C1R ( byte *pSrc, int srcStep, IppiSize srcRoiSize, byte *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidDownState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerDown_8u_C3R ( byte *pSrc, int srcStep, IppiSize srcRoiSize, byte *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidDownState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpFree_16u_C1R ( IppiPyramidUpState_16u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpFree_16u_C3R ( IppiPyramidUpState_16u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpFree_32f_C1R ( IppiPyramidUpState_32f_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpFree_32f_C3R ( IppiPyramidUpState_32f_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpFree_8u_C1R ( IppiPyramidUpState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpFree_8u_C3R ( IppiPyramidUpState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpInitAlloc_16u_C1R ( IppiPyramidUpState_16u_C1R **ppState, IppiSize dstRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpInitAlloc_16u_C3R ( IppiPyramidUpState_16u_C3R **ppState, IppiSize dstRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpInitAlloc_32f_C1R ( IppiPyramidUpState_32f_C1R **ppState, IppiSize dstRoi, float rate, float *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpInitAlloc_32f_C3R ( IppiPyramidUpState_32f_C3R **ppState, IppiSize dstRoi, float rate, float *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpInitAlloc_8u_C1R ( IppiPyramidUpState_8u_C1R **ppState, IppiSize dstRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUpInitAlloc_8u_C3R ( IppiPyramidUpState_8u_C3R **ppState, IppiSize dstRoi, float rate, short *pKernel, int kerSize, int mode ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUp_16u_C1R ( ushort *pSrc, int srcStep, IppiSize srcRoiSize, ushort *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidUpState_16u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUp_16u_C3R ( ushort *pSrc, int srcStep, IppiSize srcRoiSize, ushort *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidUpState_16u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUp_32f_C1R ( float *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidUpState_32f_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUp_32f_C3R ( float *pSrc, int srcStep, IppiSize srcRoiSize, float *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidUpState_32f_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUp_8u_C1R ( byte *pSrc, int srcStep, IppiSize srcRoiSize, byte *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidUpState_8u_C1R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiPyramidLayerUp_8u_C3R ( byte *pSrc, int srcStep, IppiSize srcRoiSize, byte *pDst, int dstStep, IppiSize dstRoiSize, IppiPyramidUpState_8u_C3R *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiRectStdDev_32f_C1R ( float *pSrc, int srcStep, double *pSqr, int sqrStep, float *pDst, int dstStep, IppiSize roiSize, IppiRect rect ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiRectStdDev_32s32f_C1R ( int *pSrc, int srcStep, double *pSqr, int sqrStep, float *pDst, int dstStep, IppiSize roiSize, IppiRect rect ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiRectStdDev_32s_C1RSfs ( int *pSrc, int srcStep, int *pSqr, int sqrStep, int *pDst, int dstStep, IppiSize roi, IppiRect rect, int scaleFactor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNCalcResidual_PSF2x2_16u32f_C1R ( float *pHiRes, int hiResStep, ushort *pLowRes, int *pOfs, ushort *pCoeff, float *pResidual, int len, IppiSRHNSpec_PSF2x2 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNCalcResidual_PSF2x2_8u32f_C1R ( float *pHiRes, int hiResStep, byte *pLowRes, int *pOfs, ushort *pCoeff, float *pResidual, int len, IppiSRHNSpec_PSF2x2 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNCalcResidual_PSF3x3_16u32f_C1R ( float *pHiRes, int hiResStep, ushort *pLowRes, int *pOfs, ushort *pCoeff, float *pResidual, int len, IppiSRHNSpec_PSF3x3 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNCalcResidual_PSF3x3_8u32f_C1R ( float *pHiRes, int hiResStep, byte *pLowRes, int *pOfs, ushort *pCoeff, float *pResidual, int len, IppiSRHNSpec_PSF3x3 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNFree_PSF2x2 ( IppiSRHNSpec_PSF2x2 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNFree_PSF3x3 ( IppiSRHNSpec_PSF3x3 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNInitAlloc_PSF2x2 ( IppiSRHNSpec_PSF2x2 **ppPSF, float *pcTab, int tabSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNInitAlloc_PSF3x3 ( IppiSRHNSpec_PSF3x3 **ppPSF, float *pcTab, int tabSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNUpdateGradient_PSF2x2_32f_C1R ( float *pGrad, int gradStep, int *pOfs, ushort *pCoeff, float *pRob, byte *pWeight, int len, float *pwTab, IppiSRHNSpec_PSF2x2 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSRHNUpdateGradient_PSF3x3_32f_C1R ( float *pGrad, int gradStep, int *pOfs, ushort *pCoeff, float *pRob, byte *pWeight, int len, float *pwTab, IppiSRHNSpec_PSF3x3 *pPSF ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSampleLine_16u_C1R ( ushort *pSrc, int srcStep, IppiSize roiSize, ushort *pDst, IppiPoint pt1, IppiPoint pt2 ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSampleLine_16u_C3R ( ushort *pSrc, int srcStep, IppiSize roiSize, ushort *pDst, IppiPoint pt1, IppiPoint pt2 ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSampleLine_32f_C1R ( float *pSrc, int srcStep, IppiSize roiSize, float *pDst, IppiPoint pt1, IppiPoint pt2 ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSampleLine_32f_C3R ( float *pSrc, int srcStep, IppiSize roiSize, float *pDst, IppiPoint pt1, IppiPoint pt2 ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSampleLine_8u_C1R ( byte *pSrc, int srcStep, IppiSize roiSize, byte *pDst, IppiPoint pt1, IppiPoint pt2 ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSampleLine_8u_C3R ( byte *pSrc, int srcStep, IppiSize roiSize, byte *pDst, IppiPoint pt1, IppiPoint pt2 ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentGradientGetBufferSize_8u_C1R ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentGradientGetBufferSize_8u_C3R ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentGradient_8u_C1IR ( byte *pSrc, int srcStep, byte *pMarker, int markerStep, IppiSize roiSize, IppiNorm norm, int flags, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentGradient_8u_C3IR ( byte *pSrc, int srcStep, byte *pMarker, int markerStep, IppiSize roiSize, IppiNorm norm, int flags, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentWatershedGetBufferSize_8u16u_C1R ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentWatershedGetBufferSize_8u_C1R ( IppiSize roiSize, int *pBufSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentWatershed_8u16u_C1IR ( byte *pSrc, int srcStep, ushort *pMarker, int markerStep, IppiSize roiSize, IppiNorm norm, int flag, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSegmentWatershed_8u_C1IR ( byte *pSrc, int srcStep, byte *pMarker, int markerStep, IppiSize roiSize, IppiNorm norm, int flag, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSqrIntegral_8u32f64f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, double *pSqr, int sqrStep, IppiSize roiSize, float val, double valSqr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSqrIntegral_8u32s64f_C1R ( byte *pSrc, int srcStep, int *pDst, int dstStep, double *pSqr, int sqrStep, IppiSize roiSize, int val, double valSqr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiSqrIntegral_8u32s_C1R ( byte *pSrc, int srcStep, int *pDst, int dstStep, int *pSqr, int sqrStep, IppiSize roi, int val, int valSqr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltHaarFeatures_32f ( byte *pMask, int flag, IppiHaarClassifier_32f *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltHaarFeatures_32s ( byte *pMask, int flag, IppiHaarClassifier_32s *pState ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedHaarClassifierInitAlloc_32f ( IppiHaarClassifier_32f **pState, IppiRect *pFeature, float *pWeight, float *pThreshold, float *pVal1, float *pVal2, int *pNum, int length ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedHaarClassifierInitAlloc_32s ( IppiHaarClassifier_32s **pState, IppiRect *pFeature, int *pWeight, int *pThreshold, int *pVal1, int *pVal2, int *pNum, int length ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedIntegral_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float val ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedIntegral_8u32s_C1R ( byte *pSrc, int srcStep, int *pDst, int dstStep, IppiSize roiSize, int val ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedRectStdDev_32f_C1R ( float *pSrc, int srcStep, double *pSqr, int sqrStep, float *pDst, int dstStep, IppiSize roiSize, IppiRect rect ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedRectStdDev_32s32f_C1R ( int *pSrc, int srcStep, double *pSqr, int sqrStep, float *pDst, int dstStep, IppiSize roiSize, IppiRect rect ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedRectStdDev_32s_C1RSfs ( int *pSrc, int srcStep, int *pSqr, int sqrStep, int *pDst, int dstStep, IppiSize roi, IppiRect rect, int scaleFactor ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedSqrIntegral_8u32f64f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, double *pSqr, int sqrStep, IppiSize roiSize, float val, double valSqr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedSqrIntegral_8u32s64f_C1R ( byte *pSrc, int srcStep, int *pDst, int dstStep, double *pSqr, int sqrStep, IppiSize roiSize, int val, double valSqr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTiltedSqrIntegral_8u32s_C1R ( byte *pSrc, int srcStep, int *pDst, int dstStep, int *pSqr, int sqrStep, IppiSize roi, int val, int valSqr ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTrueDistanceTransformGetBufferSize_8u16u_C1RSfs ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTrueDistanceTransformGetBufferSize_8u32f_C1R ( IppiSize roiSize, int *pBufferSize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTrueDistanceTransform_8u16u_C1RSfs ( byte *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, int scaleFactor, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiTrueDistanceTransform_8u32f_C1R ( byte *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortGetSize ( IppiSize roiSize, int *pBufsize ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortRadial_16u_C1R ( ushort *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortRadial_16u_C3R ( ushort *pSrc, int srcStep, ushort *pDst, int dstStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortRadial_32f_C1R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortRadial_32f_C3R ( float *pSrc, int srcStep, float *pDst, int dstStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortRadial_8u_C1R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUndistortRadial_8u_C3R ( byte *pSrc, int srcStep, byte *pDst, int dstStep, IppiSize roiSize, float fx, float fy, float cx, float cy, float k1, float k2, byte *pBuffer ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUpdateMotionHistory_16u32f_C1IR ( ushort *pSilhouette, int silhStep, float *pMHI, int mhiStep, IppiSize roiSize, float timestamp, float mhiDuration ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUpdateMotionHistory_32f_C1IR ( float *pSilhouette, int silhStep, float *pMHI, int mhiStep, IppiSize roiSize, float timestamp, float mhiDuration ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippiUpdateMotionHistory_8u32f_C1IR ( byte *pSilhouette, int silhStep, float *pMHI, int mhiStep, IppiSize roiSize, float timestamp, float mhiDuration ); [SuppressUnmanagedCodeSecurityAttribute()] [DllImport(ipp.cv.libname)] public static extern IppStatus ippibFastArctan_32f ( float *pSrcY, float *pSrcX, float *pDst, int length ); }; };
59.134819
260
0.809476
[ "MIT" ]
ctddjyds/CSharp-ParallelProgramming
CH11PerformanceLibrary/Listing11_4/ippcv.cs
156,589
C#
using SQLite; using System; using System.Collections.Generic; using System.Text; namespace Hangfire.Storage.SQLite.Entities { [Table(DefaultValues.SetTblName)] public class Set { [PrimaryKey, AutoIncrement] public int Id { get; set; } [MaxLength(DefaultValues.MaxLengthKeyColumn)] [Indexed(Name = "IX_Set_Key", Order = 1, Unique = false)] public string Key { get; set; } public decimal Score { get; set; } [MaxLength(DefaultValues.MaxLengthSetValueColumn)] [Indexed(Name = "IX_Set_Value", Order = 2, Unique = false)] public string Value { get; set; } [Indexed(Name = "IX_Set_ExpireAt", Order = 3, Unique = false)] public DateTime ExpireAt { get; set; } } }
27.392857
70
0.636245
[ "MIT" ]
Yaevh/Hangfire.Storage.SQLite
src/main/Hangfire.Storage.SQLite/Entities/Set.cs
769
C#
namespace CharlieBackend.AdminPanel.Models.Calendar { public class CalendarThemeViewModel { public long Id { get; set; } public string Name { get; set; } } }
18.8
52
0.638298
[ "MIT" ]
ITA-Dnipro/WhatBackend
CharlieBackend.AdminPanel/Models/Calendar/CalendarThemeViewModel.cs
190
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.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.InlineHints { internal interface IInlineHintsService : ILanguageService { Task<ImmutableArray<InlineHint>> GetInlineHintsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); } }
35.473684
136
0.801187
[ "MIT" ]
333fred/roslyn
src/Features/Core/Portable/InlineHints/IInlineHintsService.cs
676
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace CarsIsland.WebAPI { public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); } }
24.52
76
0.694943
[ "Apache-2.0" ]
vijayraavi/Pluralsight-1
CarsIsland/cars-island-web-api/CarsIsland/CarsIsland.WebAPI/Program.cs
615
C#
using OpenTK.Graphics.OpenGL; using ReOsuStoryboardPlayer; using ReOsuStoryboardPlayer.Core.Utils; using ReOsuStoryboardPlayer.Graphics.PostProcesses; using ReOsuStoryboardPlayer.Graphics.PostProcesses.Shaders; using ReOsuStoryboardPlayer.Kernel; using ReOsuStoryboardPlayer.OutputEncoding.Kernel; using ReOsuStoryboardPlayer.Tools; using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Text; using System.Threading.Tasks; using PixelFormat = OpenTK.Graphics.OpenGL.PixelFormat; namespace ReOsuStoryBoardPlayer.OutputEncoding.Graphics.PostProcess { public class CaptureRenderPostProcess : APostProcess { PostProcessFrameBuffer frame_buffer = new PostProcessFrameBuffer(PlayerSetting.FrameWidth, PlayerSetting.FrameHeight); public byte[] RenderPixels { get; } = new byte[PlayerSetting.FrameWidth * 3*PlayerSetting.FrameHeight]; int store_prev_fbo = 0; int[] store_prev_viewport = new int[4]; private Shader _output_shader = new VectialFlipShader(); private Shader _final_shader = new FinalShader(); private EncodingKernel encoding_kernel; public EncodingKernel Kernal => encoding_kernel??(encoding_kernel=ToolManager.GetTool<EncodingKernel>()); public CaptureRenderPostProcess() { _output_shader.Compile(); _final_shader.Compile(); } protected override void OnUseShader() { int tex = PrevFrameBuffer?.ColorTexture??0; GL.BindTexture(TextureTarget.Texture2D, tex); } protected override void OnRender() { _output_shader.Begin(); //backup GL.GetInteger(GetPName.Viewport, store_prev_viewport); store_prev_fbo=GL.GetInteger(GetPName.FramebufferBinding); frame_buffer.Bind(); GL.Viewport(0, 0, PlayerSetting.FrameWidth, PlayerSetting.FrameHeight); GL.DrawArrays(PrimitiveType.TriangleFan, 0, 4); _final_shader.Begin(); GL.BindFramebuffer(FramebufferTarget.Framebuffer, store_prev_fbo); GL.Viewport(store_prev_viewport[0], store_prev_viewport[1], store_prev_viewport[2], store_prev_viewport[3]); GL.DrawArrays(PrimitiveType.TriangleFan, 0, 4); //output GL.BindTexture(TextureTarget.Texture2D, frame_buffer.ColorTexture); GL.GetTexImage(TextureTarget.Texture2D, 0, PixelFormat.Bgr, PixelType.UnsignedByte, RenderPixels); GL.BindTexture(TextureTarget.Texture2D, 0); } public override void OnResize() { base.OnResize(); } } }
34.620253
126
0.695795
[ "MIT" ]
MikiraSora/OsuStoryBoardPlayer
ReOsuStoryboardPlayer/OutputEncoding/Graphics/PostProcess/CaptureRenderPostProcess.cs
2,737
C#
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using Newtonsoft.Json; namespace IO.Ably.Types { /// <summary> /// A message sent and received over the Realtime protocol. /// A ProtocolMessage always relates to a single channel only, but /// can contain multiple individual Messages or PresenceMessages. /// ProtocolMessages are serially numbered on a connection. /// See the Ably client library developer documentation for further /// details on the members of a ProtocolMessage. /// </summary> public class ProtocolMessage { /// <summary> /// Action associated with the message. /// </summary> public enum MessageAction { #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member #pragma warning disable SA1602 // Enumeration items should be documented Heartbeat = 0, Ack = 1, Nack = 2, Connect = 3, Connected = 4, Disconnect = 5, Disconnected = 6, Close = 7, Closed = 8, Error = 9, Attach = 10, Attached = 11, Detach = 12, Detached = 13, Presence = 14, Message = 15, Sync = 16, Auth = 17 #pragma warning restore SA1602 // Enumeration items should be documented #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } /// <summary> /// Message Flag sent by the server. /// </summary> [Flags] public enum Flag { #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member #pragma warning disable SA1602 // Enumeration items should be documented HasPresence = 1 << 0, HasBacklog = 1 << 1, Resumed = 1 << 2, HasLocalPresence = 1 << 3, Transient = 1 << 4, AttachResume = 1 << 5, // Channel modes Presence = 1 << 16, Publish = 1 << 17, Subscribe = 1 << 18, PresenceSubscribe = 1 << 19, #pragma warning restore SA1602 // Enumeration items should be documented #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } /// <summary> /// Helper method to check for the existence of a flag in an integer. /// </summary> /// <param name="value">int value storing the flag.</param> /// <param name="flag">flag we check for.</param> /// <returns>true or false.</returns> public static bool HasFlag(int? value, Flag flag) { if (value == null) { return false; } return (value.Value & (int)flag) != 0; } /// <summary> /// Channel params is a Dictionary&lt;string, string&gt; which is used to pass parameters to the server when /// attaching a channel. Some params include `delta` and `rewind`. The server will also echo the params in the /// ATTACHED message. /// For more information https://www.ably.io/documentation/realtime/channel-params. /// </summary> [JsonProperty("params")] public ChannelParams Params { get; set; } /// <summary> /// Initializes a new instance of the <see cref="ProtocolMessage"/> class. /// </summary> public ProtocolMessage() { Messages = new Message[] { }; Presence = new PresenceMessage[] { }; } internal ProtocolMessage(MessageAction action) : this() { Action = action; } internal ProtocolMessage(MessageAction action, string channel) : this(action) { Channel = channel; } /// <summary> /// Current message action. /// </summary> [JsonProperty("action")] public MessageAction Action { get; set; } /// <summary> /// <see cref="AuthDetails"/> for the current message. /// </summary> [JsonProperty("auth")] public AuthDetails Auth { get; set; } /// <summary> /// Current message flags. /// </summary> [JsonProperty("flags")] public int? Flags { get; set; } /// <summary> /// Count. /// </summary> [JsonProperty("count")] public int? Count { get; set; } /// <summary> /// Error associated with the message. /// </summary> [JsonProperty("error")] public ErrorInfo Error { get; set; } /// <summary> /// Ably generated message id. /// </summary> [JsonProperty("id")] public string Id { get; set; } /// <summary> /// Optional channel for which the message belongs to. /// </summary> [JsonProperty("channel")] public string Channel { get; set; } /// <summary> /// Current channel serial. /// </summary> [JsonProperty("channelSerial")] public string ChannelSerial { get; set; } /// <summary> /// Current connectionId. /// </summary> [JsonProperty("connectionId")] public string ConnectionId { get; set; } /// <summary> /// Current connection serial. /// </summary> [JsonProperty("connectionSerial")] public long? ConnectionSerial { get; set; } /// <summary> /// Current message serial. /// </summary> [JsonProperty("msgSerial")] public long MsgSerial { get; set; } /// <summary> /// Timestamp of the message. /// </summary> [JsonProperty("timestamp")] public DateTimeOffset? Timestamp { get; set; } /// <summary> /// List of messages contained in this protocol message. /// </summary> [JsonProperty("messages")] public Message[] Messages { get; set; } /// <summary> /// List of presence messages contained in this protocol message. /// </summary> [JsonProperty("presence")] public PresenceMessage[] Presence { get; set; } /// <summary> /// Connection details received. <see cref="IO.Ably.ConnectionDetails"/>. /// </summary> [JsonProperty("connectionDetails")] public ConnectionDetails ConnectionDetails { get; set; } [JsonIgnore] internal bool AckRequired => Action == MessageAction.Message || Action == MessageAction.Presence; [OnSerializing] private void OnSerializing(StreamingContext context) { if (Channel == string.Empty) { Channel = null; } // Filter out empty messages if (Messages != null) { Messages = Messages.Where(m => !m.IsEmpty).ToArray(); if (Messages.Length == 0) { Messages = null; } } if (Presence != null && Presence.Length == 0) { Presence = null; } } /// <summary> /// Convenience method to check if the current message contians a flag. /// </summary> /// <param name="flag">Flag we are looking for.</param> /// <returns>true / false.</returns> public bool HasFlag(Flag flag) { return HasFlag(Flags, flag); } /// <summary> /// Convenience method to add <see cref="Flag"/> to the Flags property. /// </summary> /// <param name="flag"><see cref="Flag"/> to be added.</param> public void SetFlag(Flag flag) { var value = Flags.GetValueOrDefault(); value |= (int)flag; Flags = value; } internal void SetModesAsFlags(IEnumerable<ChannelMode> modes) { foreach (var mode in modes) { var flag = mode.ToFlag(); if (flag != null) { SetFlag(flag.Value); } } } /// <inheritdoc/> public override string ToString() { var text = new StringBuilder(); text.Append("{ ") .AppendFormat("action={0}", Action); if (Messages != null && Messages.Length > 0) { text.Append(", mesasages=[ "); foreach (var message in Messages) { text.AppendFormat("{{ name=\"{0}\"", message.Name); if (message.Timestamp.HasValue && message.Timestamp.Value.Ticks > 0) { text.AppendFormat(", timestamp=\"{0}\"}}", message.Timestamp); } text.AppendFormat(", data={0}}}", message.Data); } text.Append(" ]"); } text.Append(" }"); return text.ToString(); } } }
31.276094
118
0.515448
[ "Apache-2.0" ]
dpflucas/ably-dotnet
src/IO.Ably.Shared/Types/ProtocolMessage.cs
9,291
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. */ using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using System.Globalization; #pragma warning disable 1591 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// <summary> /// GetBucketPolicyStatusRequestMarshaller /// </summary> public class GetBucketPolicyStatusRequestMarshaller : IMarshaller<IRequest, GetBucketPolicyStatusRequest>, IMarshaller<IRequest, Amazon.Runtime.AmazonWebServiceRequest> { public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) { return this.Marshall((GetBucketPolicyStatusRequest)input); } public IRequest Marshall(GetBucketPolicyStatusRequest getBucketPolicyStatusRequest) { IRequest request = new DefaultRequest(getBucketPolicyStatusRequest, "AmazonS3"); request.HttpMethod = "GET"; if (string.IsNullOrEmpty(getBucketPolicyStatusRequest.BucketName)) throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "getBucketPolicyStatusRequest.BucketName"); request.MarshallerVersion = 2; request.ResourcePath = string.Concat("/", S3Transforms.ToStringValue(getBucketPolicyStatusRequest.BucketName)); request.AddSubResource("policyStatus"); request.UseQueryString = true; return request; } private static GetBucketPolicyStatusRequestMarshaller _instance; public static GetBucketPolicyStatusRequestMarshaller Instance { get { if (_instance == null) { _instance = new GetBucketPolicyStatusRequestMarshaller(); } return _instance; } } } }
35.910448
172
0.684123
[ "Apache-2.0" ]
orinem/aws-sdk-net
sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketPolicyStatusRequestMarshaller.cs
2,406
C#
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using PhilipDaubmeier.GraphIoT.App.Database; namespace PhilipDaubmeier.GraphIoT.App.Migrations { [DbContext(typeof(PersistenceContext))] [Migration("20200504205036_Sonnen_Charger_v1")] partial class Sonnen_Charger_v1 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.3") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromCircuit", b => { b.Property<string>("Dsuid") .HasColumnType("nvarchar(34)") .HasMaxLength(34); b.HasKey("Dsuid"); b.ToTable("DsCircuits"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromEnergyHighresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<byte[]>("EnergyCurvesEveryMeter") .HasColumnType("varbinary(max)"); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.HasKey("Id"); b.ToTable("DsEnergyHighresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromEnergyLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("CircuitId") .IsRequired() .HasColumnType("nvarchar(34)") .HasMaxLength(34); b.Property<string>("EnergyCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("CircuitId"); b.ToTable("DsEnergyLowresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromEnergyMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("CircuitId") .IsRequired() .HasColumnType("nvarchar(34)") .HasMaxLength(34); b.Property<string>("EnergyCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("CircuitId"); b.ToTable("DsEnergyMidresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromSceneEventData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("EventStreamEncoded") .HasColumnType("nvarchar(max)") .HasMaxLength(10000); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.HasKey("Id"); b.ToTable("DsSceneEventDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZone", b => { b.Property<int>("Id") .HasColumnType("int"); b.Property<int>("Name") .HasColumnType("int") .HasMaxLength(40); b.HasKey("Id"); b.ToTable("DsZones"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZoneSensorLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("HumidityCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("TemperatureCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<int>("ZoneId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ZoneId"); b.ToTable("DsSensorLowresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZoneSensorMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("HumidityCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<string>("TemperatureCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<int>("ZoneId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ZoneId"); b.ToTable("DsSensorDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoMeasureLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("Decimals") .HasColumnType("int"); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("MeasureCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<Guid>("ModuleMeasureId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("ModuleMeasureId"); b.ToTable("NetatmoMeasureLowresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoMeasureMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("Decimals") .HasColumnType("int"); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<string>("MeasureCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<Guid>("ModuleMeasureId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("ModuleMeasureId"); b.ToTable("NetatmoMeasureDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoModuleMeasure", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("Decimals") .HasColumnType("int"); b.Property<string>("DeviceId") .IsRequired() .HasColumnType("nvarchar(17)") .HasMaxLength(17); b.Property<string>("Measure") .IsRequired() .HasColumnType("nvarchar(20)") .HasMaxLength(20); b.Property<string>("ModuleId") .IsRequired() .HasColumnType("nvarchar(17)") .HasMaxLength(17); b.Property<string>("ModuleName") .HasColumnType("nvarchar(30)") .HasMaxLength(30); b.Property<string>("StationName") .HasColumnType("nvarchar(30)") .HasMaxLength(30); b.HasKey("Id"); b.ToTable("NetatmoModuleMeasures"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Sonnen.Database.SonnenChargerLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ActivePowerCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("ChargedEnergyCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("ChargingCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("ConnectedCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("CurrentCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("SmartModeCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.HasKey("Id"); b.ToTable("SonnenChargerLowresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Sonnen.Database.SonnenChargerMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ActivePowerCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("ChargedEnergyCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<double?>("ChargedEnergyTotal") .HasColumnType("float"); b.Property<string>("ChargingCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("ConnectedCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("CurrentCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<string>("SmartModeCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.HasKey("Id"); b.ToTable("SonnenChargerDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Sonnen.Database.SonnenEnergyLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("BatteryChargingCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("BatteryDischargingCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("BatteryUsocCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("ConsumptionPowerCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("DirectUsagePowerCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("GridFeedinCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("GridPurchaseCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("ProductionPowerCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.HasKey("Id"); b.ToTable("SonnenEnergyLowresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Sonnen.Database.SonnenEnergyMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("BatteryChargingCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("BatteryDischargingCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("BatteryUsocCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("ConsumptionPowerCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("DirectUsagePowerCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("GridFeedinCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("GridPurchaseCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<string>("ProductionPowerCurve") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.HasKey("Id"); b.ToTable("SonnenEnergyDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Viessmann.Database.ViessmannHeatingLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("BoilerTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BoilerTempMainCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BurnerActiveCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("BurnerMinutesCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BurnerModulationCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BurnerStartsCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("Circuit0PumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("Circuit0TempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("Circuit1PumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("Circuit1TempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("DhwCirculationPumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("DhwPrimaryPumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("DhwTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("OutsideTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.HasKey("Id"); b.ToTable("ViessmannHeatingLowresTimeseries"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Viessmann.Database.ViessmannHeatingMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("BoilerTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BoilerTempMainCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BurnerActiveCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<double>("BurnerHoursTotal") .HasColumnType("float"); b.Property<string>("BurnerMinutesCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BurnerModulationCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("BurnerStartsCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<int>("BurnerStartsTotal") .HasColumnType("int"); b.Property<string>("Circuit0PumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("Circuit0TempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("Circuit1PumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("Circuit1TempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("DhwCirculationPumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("DhwPrimaryPumpCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("DhwTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<string>("OutsideTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.HasKey("Id"); b.ToTable("ViessmannHeatingTimeseries"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Viessmann.Database.ViessmannSolarLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("SolarCollectorTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("SolarHotwaterTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("SolarPumpStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("SolarSuppressionCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("SolarWhCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.HasKey("Id"); b.ToTable("ViessmannSolarLowresTimeseries"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Viessmann.Database.ViessmannSolarMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<string>("SolarCollectorTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("SolarHotwaterTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("SolarPumpStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("SolarSuppressionCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("SolarWhCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<int?>("SolarWhTotal") .HasColumnType("int"); b.HasKey("Id"); b.ToTable("ViessmannSolarTimeseries"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.WeConnect.Database.WeConnectLowresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("BatterySocCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("ChargingStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("ClimateStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("ClimateTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("DrivenKilometersCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Month") .HasColumnType("datetime2"); b.Property<string>("RemoteHeatingStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("TripAverageConsumptionCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripAverageSpeedCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripConsumedKwhCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripDurationCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripLengthKmCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("Vin") .IsRequired() .HasColumnType("nvarchar(20)") .HasMaxLength(20); b.Property<string>("WindowMeltStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.HasKey("Id"); b.ToTable("WeConnectLowresDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.WeConnect.Database.WeConnectMidresData", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("BatterySocCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("ChargingStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("ClimateStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("ClimateTempCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("DrivenKilometersCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<DateTime>("Key") .HasColumnName("Day") .HasColumnType("datetime2"); b.Property<int?>("Mileage") .HasColumnType("int"); b.Property<string>("RemoteHeatingStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<string>("TripAverageConsumptionCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripAverageSpeedCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripConsumedKwhCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripDurationCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("TripLengthKmCurve") .HasColumnType("nvarchar(800)") .HasMaxLength(800); b.Property<string>("Vin") .IsRequired() .HasColumnType("nvarchar(20)") .HasMaxLength(20); b.Property<string>("WindowMeltStateCurve") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.HasKey("Id"); b.ToTable("WeConnectDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.TokenStore.Database.AuthData", b => { b.Property<string>("AuthDataId") .HasColumnType("nvarchar(450)"); b.Property<string>("DataContent") .HasColumnType("nvarchar(max)"); b.HasKey("AuthDataId"); b.ToTable("AuthDataSet"); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromEnergyLowresData", b => { b.HasOne("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromCircuit", "Circuit") .WithMany() .HasForeignKey("CircuitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromEnergyMidresData", b => { b.HasOne("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromCircuit", "Circuit") .WithMany() .HasForeignKey("CircuitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZoneSensorLowresData", b => { b.HasOne("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZone", "Zone") .WithMany() .HasForeignKey("ZoneId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZoneSensorMidresData", b => { b.HasOne("PhilipDaubmeier.GraphIoT.Digitalstrom.Database.DigitalstromZone", "Zone") .WithMany() .HasForeignKey("ZoneId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoMeasureLowresData", b => { b.HasOne("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoModuleMeasure", "ModuleMeasure") .WithMany() .HasForeignKey("ModuleMeasureId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoMeasureMidresData", b => { b.HasOne("PhilipDaubmeier.GraphIoT.Netatmo.Database.NetatmoModuleMeasure", "ModuleMeasure") .WithMany() .HasForeignKey("ModuleMeasureId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }
38.623596
119
0.456262
[ "MIT" ]
philipdaubmeier/GraphIoT
src/GraphIoT.App/Migrations/20200504205036_Sonnen_Charger_v1.Designer.cs
34,377
C#
using System; using System.Collections.Generic; namespace OpenMagic.Collections.Generic { /// <summary> /// Represents a cache for <typeparamref name="TKey" />. /// </summary> /// <typeparam name="TKey">The type of the keys in the cache.</typeparam> /// <typeparam name="TValue">The type of the values in the cache.</typeparam> /// <remarks> /// <see cref="Cache /// /// <TKey, TValue> /// "/> extends <see cref="Dictionary /// /// <TKey, TValue>"/> with the <see cref="Cache<TKey, TValue>.Get(Func<TValue> valueFactory)"/> method. /// </remarks> public class Cache<TKey, TValue> : Dictionary<TKey, TValue> { /// <summary> /// Gets the value for <typeparamref name="TKey" /> from the cache. If <typeparamref name="TKey" /> is not in cache /// then the result of <paramref name="valueFactory" /> is added to the cache and returned. /// </summary> /// <param name="valueFactory">The function to invoke if <typeparamref name="TKey" /> is not in the cache.</param> public TValue Get(TKey key, Func<TValue> valueFactory) { TValue value; if (TryGetValue(key, out value)) { return value; } value = valueFactory(); Add(key, value); return value; } } }
34.780488
127
0.551192
[ "MIT" ]
OpenMagic/OpenMagic
source/OpenMagic/Collections/Generic/Cache`1.cs
1,428
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Threading.Tasks; namespace BTM.Models { public class User// : IdentityUser<int> { [Key] public int Id { get; set; } public string Username { get; set; } public string Email { get; set; } public string PasswordSalt { get; set; } public string PasswordHash { get; set; } public string FirstName { get; set; } public string MiddleName { get; set; } public string LastName { get; set; } [Column(TypeName = "date")] public DateTime DateOfBirth { get; set; } public DateTime JoinDate { get; set; } public string FBLink { get; set; } public string TwitterLink { get; set; } public string LinkedInLink { get; set; } public string InstagramLink { get; set; } public string Avatar { get; set; } //[ForeignKey("Login")] //public int LoginID { get; set; } //public Login Login { get; set; } public ICollection<UsersRoles> Roles { get; set; } //public ICollection<MediaUser> Votes { get; set; } //public ICollection<List> Lists { get; set; } } }
30.55814
59
0.612633
[ "MIT" ]
TheDoomKing/BTM
BTM.Models/User.cs
1,316
C#
/** * Copyright 2017 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Diagnostics; using System.Text; namespace ApiAiSDK.Util { public class VoiceActivityDetector { private readonly string TAG = typeof(VoiceActivityDetector).Name; private readonly int sampleRate; /// <summary> /// 160 samples * 2 bytes per sample /// </summary> private const int REQUIRED_BUFFER_SIZE = 320; private const double frameLengthMillis = REQUIRED_BUFFER_SIZE / 2 / 16; private const int minCZ = (int)(5 * frameLengthMillis / 10); private const int maxCZ = minCZ * 3; private double averageNoiseEnergy = 0.0; private double lastActiveTime = -1.0; private double lastSequenceTime = 0.0; private int sequenceCounter = 0; private double time = 0.0; private readonly double sequenceLengthMilis = 30.0; private readonly int minSpeechSequenceCount = 3; private const double energyFactor = 3.1; private const double maxSilenceLengthMilis = 3.5 * 1000; private const double minSilenceLengthMilis = 0.8 * 1000; private double silenceLengthMilis = maxSilenceLengthMilis; private bool speechActive = false; private const int startNoiseInterval = 150; public bool Enabled { get; set; } public event Action SpeechBegin; public event Action SpeechEnd; public event Action SpeechNotDetected; public event Action<float> AudioLevelChange; public double SpeechBeginTime { get; private set; } public double SpeechEndTime { get; private set; } private readonly byte[] bufferToProcess = new byte[REQUIRED_BUFFER_SIZE]; private byte[] tempBuffer = null; public VoiceActivityDetector(int sampleRate) { this.sampleRate = sampleRate; Enabled = true; // default value } public void ProcessBufferEx(byte[] buffer, int bytesRead) { if (bytesRead > 0) { byte[] sourceBuffer; if (tempBuffer == null) { sourceBuffer = buffer; } else { sourceBuffer = new byte[tempBuffer.Length + buffer.Length]; Array.Copy(tempBuffer, 0, sourceBuffer, 0, tempBuffer.Length); Array.Copy(buffer, 0, sourceBuffer, tempBuffer.Length, bytesRead); } var currentIndex = 0; while (currentIndex + REQUIRED_BUFFER_SIZE < sourceBuffer.Length) { Array.Copy(sourceBuffer, currentIndex, bufferToProcess, 0, REQUIRED_BUFFER_SIZE); ProcessBuffer(bufferToProcess, bufferToProcess.Length); currentIndex += REQUIRED_BUFFER_SIZE; } var bytesToSave = sourceBuffer.Length - currentIndex; if (bytesToSave > 0) { tempBuffer = new byte[bytesToSave]; Array.Copy(sourceBuffer, currentIndex, tempBuffer, 0, bytesToSave); } else { tempBuffer = null; } } } public void ProcessBuffer(byte[] buffer, int bytesRead) { var byteBuffer = new ByteBuffer(buffer, bytesRead); var active = IsFrameActive(byteBuffer); int frameSize = bytesRead / 2; // 16 bit encoding time = time + (frameSize * 1000) / sampleRate; // because of sampleRate given for seconds if (active) { if (lastActiveTime >= 0 && time - lastActiveTime < sequenceLengthMilis) { sequenceCounter++; if (sequenceCounter >= minSpeechSequenceCount) { if (!speechActive) { Debug.WriteLine("SPEECH BEGIN " + time); OnSpeechBegin(); speechActive = true; } lastSequenceTime = time; silenceLengthMilis = Math.Max(minSilenceLengthMilis, silenceLengthMilis - (maxSilenceLengthMilis - minSilenceLengthMilis) / 4); } } else { sequenceCounter = 1; } lastActiveTime = time; } else { if (time - lastSequenceTime > silenceLengthMilis) { if (lastSequenceTime > 0) { Debug.WriteLine("SPEECH END: " + time); if (speechActive) { speechActive = false; OnSpeechEnd(); } } else { Debug.WriteLine("NOSPEECH: " + time); OnSpeechNotDetected(); } } } } private bool IsFrameActive(ByteBuffer frame) { var lastSign = 0; var czCount = 0; var energy = 0.0; var frameSize = frame.ShortArrayLength; short[] shorts = frame.ShortArray; for (int i = 0; i < frameSize; i++) { var amplitudeValue = shorts[i] / (float)short.MaxValue; energy += amplitudeValue * amplitudeValue / (float)frameSize; int sign; if (amplitudeValue > 0) { sign = 1; } else { sign = -1; } if (lastSign != 0 && sign != lastSign) { czCount += 1; } lastSign = sign; } if (Math.Abs(time % 100) < 1) // level feedback every 100 ms { var audioLevel = Math.Sqrt(energy) * 3; if (audioLevel > 1) { audioLevel = 1; } OnAudioLevelChange(Convert.ToSingle(audioLevel)); } var result = false; if (time < startNoiseInterval) { averageNoiseEnergy = averageNoiseEnergy + energy / (startNoiseInterval/frameLengthMillis); } else { if (czCount >= minCZ && czCount <= maxCZ) { if (energy > Math.Max(averageNoiseEnergy, 0.001818) * energyFactor) { result = true; } } } return result; } public void Reset() { time = 0.0; averageNoiseEnergy = 0.0; lastActiveTime = -1.0; lastSequenceTime = 0.0; sequenceCounter = 0; silenceLengthMilis = maxSilenceLengthMilis; speechActive = false; SpeechBeginTime = 0; SpeechEndTime = 0; tempBuffer = null; } protected void OnSpeechBegin() { SpeechBeginTime = time; SpeechBegin.InvokeSafely(); } protected void OnSpeechEnd() { SpeechEndTime = time; if (Enabled) { SpeechEnd.InvokeSafely(); } } protected void OnSpeechNotDetected() { SpeechNotDetected?.Invoke(); } protected void OnAudioLevelChange(float level) { AudioLevelChange.InvokeSafely(level); } } }
31.742308
151
0.512783
[ "Apache-2.0" ]
Revmaker/dialogflow-dotnet-client
ApiAiSDK/Util/VoiceActivityDetector.cs
8,255
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace King_of_Thieves.Map { class ComponentFactory : Gears.Playable.UnitTypeFactory { public ComponentFactory(King_of_Thieves.Actors.CComponent[] components) { base.Register(components); } public void addComponent(Actors.CComponent component) { AddUnit(component); } public void removeComponent(Actors.CComponent component) { RemoveUnit(component); } //public Actors.CComponent components //{ // get // { // return base.units; // } //} } }
21.382353
79
0.568088
[ "MIT" ]
MGZero/king-of-thieves-mono
King of Thieves/Map/ComponentFactory.cs
729
C#
using BulletSharp.Math; using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; namespace BulletSharp { public class ConvexHullShape : PolyhedralConvexAabbCachingShape { private Vector3Array _points; private Vector3Array _unscaledPoints; public ConvexHullShape() : base(btConvexHullShape_new()) { } public ConvexHullShape(float[] points) : this(points, points.Length / 3, 3 * sizeof(float)) { } public ConvexHullShape(float[] points, int numPoints) : this(points, numPoints, 3 * sizeof(float)) { } public ConvexHullShape(float[] points, int numPoints, int stride) : base(btConvexHullShape_new4(points, numPoints, stride)) { } public ConvexHullShape(IEnumerable<Vector3> points, int numPoints) : base(btConvexHullShape_new()) { int i = 0; foreach (Vector3 v in points) { Vector3 viter = v; btConvexHullShape_addPoint(_native, ref viter); i++; if (i == numPoints) { break; } } RecalcLocalAabb(); } public ConvexHullShape(IEnumerable<Vector3> points) : base(btConvexHullShape_new()) { foreach (Vector3 v in points) { Vector3 viter = v; btConvexHullShape_addPoint(_native, ref viter); } RecalcLocalAabb(); } public void AddPointRef(ref Vector3 point) { btConvexHullShape_addPoint(_native, ref point); } public void AddPoint(Vector3 point) { btConvexHullShape_addPoint(_native, ref point); } public void AddPointRef(ref Vector3 point, bool recalculateLocalAabb) { btConvexHullShape_addPoint2(_native, ref point, recalculateLocalAabb); } public void AddPoint(Vector3 point, bool recalculateLocalAabb) { btConvexHullShape_addPoint2(_native, ref point, recalculateLocalAabb); } public void GetScaledPoint(int i, out Vector3 value) { btConvexHullShape_getScaledPoint(_native, i, out value); } public Vector3 GetScaledPoint(int i) { Vector3 value; btConvexHullShape_getScaledPoint(_native, i, out value); return value; } /* public void OptimizeConvexHull() { btConvexHullShape_optimizeConvexHull(_native); }*/ /* public void Project(ref Matrix trans, ref Vector3 dir, out float minProj, out float maxProj, out Vector3 witnesPtMin, out Vector3 witnesPtMax) { btConvexHullShape_project(_native, ref trans, ref dir, out minProj, out maxProj, out witnesPtMin, out witnesPtMax); } */ public int NumPoints { get { return btConvexHullShape_getNumPoints(_native); } } public Vector3Array Points { get { if (_points == null || _points.Count != NumPoints) { _points = new Vector3Array(btConvexHullShape_getPoints(_native), NumPoints); } return _points; } } public Vector3Array UnscaledPoints { get { if (_unscaledPoints == null || _unscaledPoints.Count != NumPoints) { _unscaledPoints = new Vector3Array(btConvexHullShape_getUnscaledPoints(_native), NumPoints); } return _unscaledPoints; } } [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern IntPtr btConvexHullShape_new(); //[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] //static extern IntPtr btConvexHullShape_new2(Vector3[] points); //[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] //static extern IntPtr btConvexHullShape_new3(Vector3[] points, int numPoints); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern IntPtr btConvexHullShape_new4(float[] points, int numPoints, int stride); //[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] //static extern IntPtr btConvexHullShape_new4(Vector3[] points, int numPoints, int stride); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern void btConvexHullShape_addPoint(IntPtr obj, [In] ref Vector3 point); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern void btConvexHullShape_addPoint2(IntPtr obj, [In] ref Vector3 point, bool recalculateLocalAabb); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern int btConvexHullShape_getNumPoints(IntPtr obj); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern IntPtr btConvexHullShape_getPoints(IntPtr obj); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern void btConvexHullShape_getScaledPoint(IntPtr obj, int i, [Out] out Vector3 value); [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] static extern IntPtr btConvexHullShape_getUnscaledPoints(IntPtr obj); //[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] //static extern void btConvexHullShape_optimizeConvexHull(IntPtr obj); // [DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity] // static extern void btConvexHullShape_project(IntPtr obj, [In] ref Matrix trans, [In] ref Vector3 dir, [Out] out float minProj, [Out] out float maxProj, [Out] out Vector3 witnesPtMin, [Out] out Vector3 witnesPtMax); } [StructLayout(LayoutKind.Sequential)] internal struct ConvexHullShapeFloatData { public ConvexInternalShapeFloatData ConvexInternalShapeData; public IntPtr UnscaledPointsFloatPtr; public IntPtr UnscaledPointsDoublePtr; public int NumUnscaledPoints; public int Padding; public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(ConvexHullShapeFloatData), fieldName).ToInt32(); } } }
39.699422
228
0.639051
[ "Apache-2.0" ]
xtom0369/BulletPhysicsForUnity
Unity/Assets/Plugins/BulletUnity/BulletSharp/Collision/ConvexHullShape.cs
6,868
C#
using System; using Bunit; using FluentAssertions; using LinkDotNet.Blog.Web.Shared.Admin.Dashboard; using Xunit; namespace LinkDotNet.Blog.UnitTests.Web.Shared.Admin.Dashboard; public class DateRangeSelectorTests : TestContext { [Fact] public void ShouldSetBeginDateWhenSet() { Filter filter = null; var cut = RenderComponent<DateRangeSelector>(p => p.Add(s => s.FilterChanged, f => { filter = f; })); cut.Find("#startDate").Change(new DateTime(2020, 1, 1)); filter.Should().NotBeNull(); filter.StartDate.Should().Be(new DateTime(2020, 1, 1)); filter.EndDate.Should().BeNull(); } [Fact] public void ShouldSetEndDateWhenSet() { Filter filter = null; var cut = RenderComponent<DateRangeSelector>(p => p.Add(s => s.FilterChanged, f => { filter = f; })); cut.Find("#endDate").Change(new DateTime(2020, 1, 1)); filter.Should().NotBeNull(); filter.EndDate.Should().Be(new DateTime(2020, 1, 1)); filter.StartDate.Should().BeNull(); } [Fact] public void ShouldReset() { Filter filter = null; var cut = RenderComponent<DateRangeSelector>(p => p.Add(s => s.FilterChanged, f => { filter = f; })); cut.Find("#startDate").Change(new DateTime(2020, 1, 1)); cut.Find("#endDate").Change(new DateTime(2020, 1, 1)); cut.Find("#startDate").Change(string.Empty); cut.Find("#endDate").Change(string.Empty); filter.StartDate.Should().BeNull(); filter.EndDate.Should().BeNull(); } }
27.278689
90
0.588942
[ "MIT" ]
linkdotnet/Blog
tests/LinkDotNet.Blog.UnitTests/Web/Shared/Admin/Dashboard/DateRangeSelectorTests.cs
1,666
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using VkBot.Core.Commands; using VkBot.Core.Structures; using VkNet.Enums.SafetyEnums; using VkNet.Model.Keyboard; namespace VkBot.Keyboards { public class KeyboardBackButton : MessageKeyboardButton { public KeyboardBackButton() { var newKeyBoard = new GetKeyboard(); Action = new MessageKeyboardButtonAction() { Label = newKeyBoard.ButtonLabel, Type = KeyboardButtonActionType.Text, Payload = new Payload() { Command = newKeyBoard.KeyWord }.Serialize(), }; Color = KeyboardButtonColor.Default; } } }
25.709677
59
0.598494
[ "MIT" ]
ufa3110/vkchatbotnew
VkBot/Keyboards/KeyboardBackButton.cs
799
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using BuildXL.Cache.Monitor.App.Scheduling; using BuildXL.Cache.Monitor.Library.Rules; using Kusto.Data.Common; using static BuildXL.Cache.Monitor.App.Analysis.Utilities; namespace BuildXL.Cache.Monitor.App.Rules.Kusto { internal class OperationPerformanceOutliersRule : MultipleStampRuleBase { public class DynamicCheck { public TimeSpan LookbackPeriod { get; set; } public TimeSpan DetectionPeriod { get; set; } public string Match { get; set; } = string.Empty; private string? _name = null; public string Name { get => _name ?? Match; set => _name = value; } /// <summary> /// Helps query performance in very high frequency scenarios /// </summary> public long? MaximumLookbackOperations { get; set; } /// <summary> /// Number of machines to produce different levels of alerts /// </summary> public Thresholds<long> MachineThresholds { get; set; } = new Thresholds<long>() { Info = 1, Warning = 5, Error = 20, }; /// <summary> /// Number of failed operations to produce different levels of alerts /// </summary> public Thresholds<long> FailureThresholds { get; set; } = new Thresholds<long>() { Info = 10, Warning = 50, Error = 1000, }; /// <summary> /// Must be a valid KQL string that can be put right after a /// /// | where {string here} /// /// Certain descriptive statistics are provided. See the actual query for more information. /// </summary> /// <remarks> /// The constraint check and statistics provided are on a per-machine basis. /// </remarks> public string Constraint { get; set; } = "true"; } public class Configuration : MultiStampRuleConfiguration { public Configuration(MultiStampRuleConfiguration kustoRuleConfiguration, DynamicCheck check) : base(kustoRuleConfiguration) { Check = check; } public DynamicCheck Check { get; } } private readonly Configuration _configuration; /// <inheritdoc /> public override string Identifier => $"{nameof(OperationPerformanceOutliersRule)};{_configuration.Check.Name}:{_configuration.Environment}"; public OperationPerformanceOutliersRule(Configuration configuration) : base(configuration) { _configuration = configuration; } #pragma warning disable CS0649 internal class Result { public DateTime PreciseTimeStamp; public string Machine = string.Empty; public string CorrelationId = string.Empty; public TimeSpan Duration; public string Stamp = string.Empty; } #pragma warning restore CS0649 public override async Task Run(RuleContext context) { var now = _configuration.Clock.UtcNow; var perhapsLookbackFilter = _configuration.Check.MaximumLookbackOperations is null ? "" : $"\n| sample {CslLongLiteral.AsCslString(_configuration.Check.MaximumLookbackOperations)}\n"; var query = $@" let end = now(); let start = end - {CslTimeSpanLiteral.AsCslString(_configuration.Check.LookbackPeriod)}; let detection = end - {CslTimeSpanLiteral.AsCslString(_configuration.Check.DetectionPeriod)}; let Events = materialize(CloudCacheLogEvent | where PreciseTimeStamp between (start .. end) | where Message has '{_configuration.Check.Match}' and isnotempty(Duration) | where Result != '{Constants.ResultCode.Success}' | project PreciseTimeStamp, Machine, CorrelationId, Duration, Stamp); let DetectionEvents = Events | where PreciseTimeStamp between (detection .. end); let DescriptiveStatistics = Events | where PreciseTimeStamp between (start .. detection){perhapsLookbackFilter} | summarize hint.shufflekey=Machine hint.num_partitions=64 (P50, P95)=percentiles(Duration, 50, 95) by Machine, Stamp | where not(isnull(Machine)); DescriptiveStatistics | join kind=rightouter hint.strategy=broadcast hint.num_partitions=64 DetectionEvents on Machine | where {_configuration.Check.Constraint ?? "true"} | extend Machine = iif(isnull(Machine) or isempty(Machine), Machine1, Machine) | extend Stamp = iif(isnull(Stamp) or isempty(Stamp), Stamp1, Stamp) | project PreciseTimeStamp, Machine, CorrelationId, Duration, Stamp | where not(isnull(Machine));"; var results = (await QueryKustoAsync<Result>(context, query)).ToList(); GroupByStampAndCallHelper<Result>(results, result => result.Stamp, operationPerformanceOutliersHelper); void operationPerformanceOutliersHelper(string stamp, List<Result> results) { if (results.Count == 0) { return; } var reports = results .AsParallel() .GroupBy(result => result.Machine) .Select(group => ( Machine: group.Key, Operations: group .OrderByDescending(result => result.PreciseTimeStamp) .ToList())) .OrderByDescending(entry => entry.Operations.Count) .ToList(); var eventTimeUtc = reports.Max(report => report.Operations[0].PreciseTimeStamp); var numberOfMachines = reports.Count; var numberOfFailures = reports.Sum(entry => entry.Operations.Count); BiThreshold(numberOfMachines, numberOfFailures, _configuration.Check.MachineThresholds, _configuration.Check.FailureThresholds, (severity, machineThreshold, failureThreshold) => { var examples = string.Join(".\r\n", reports .Select(entry => { var failures = string.Join(", ", entry.Operations .Take(5) .Select(f => $"`{f.CorrelationId}` (`{f.Duration}`)")); return $"`{entry.Machine}` (total `{entry.Operations.Count}`): {failures}"; })); var summaryExamples = string.Join(".\r\n", reports .Take(3) .Select(entry => { var failures = string.Join(", ", entry.Operations .Take(2) .Select(f => $"`{f.CorrelationId}` (`{f.Duration}`)")); return $"\t`{entry.Machine}` (total `{entry.Operations.Count}`): {failures}"; })); Emit(context, $"Performance_{_configuration.Check.Name}", severity, $"Operation `{_configuration.Check.Name}` has taken too long `{numberOfFailures}` time(s) across `{numberOfMachines}` machine(s) in the last `{_configuration.Check.DetectionPeriod}`. Examples:\r\n{examples}", stamp, $"Operation `{_configuration.Check.Name}` has taken too long `{numberOfFailures}` time(s) across `{numberOfMachines}` machine(s) in the last `{_configuration.Check.DetectionPeriod}`. Examples:\r\n{summaryExamples}", eventTimeUtc: eventTimeUtc); }); } } } }
44.664921
240
0.540968
[ "MIT" ]
BearerPipelineTest/BuildXL
Public/Src/Cache/Monitor/Library/Rules/Kusto/OperationPerformanceOutliersRule.cs
8,533
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Telegraphy.IO.Exceptions; using Telegraphy.Net; namespace Telegraphy.IO { public class RecieveFileInfo : FileActionBase, IActor { private string folderName; public RecieveFileInfo(string folderName) { this.folderName = folderName; } bool IActor.OnMessageRecieved<T>(T msg) { if (!(msg as IActorMessage).Message.GetType().Name.Equals("String")) throw new CannotDeleteFilesInFolderFileNameIsNotAStringException(); string finalPath = this.GetFilePath((msg.Message as string), folderName); msg.ProcessingResult = new System.IO.FileInfo(finalPath); return true; } } }
26.59375
85
0.661575
[ "MIT" ]
Mossharbor/Telegraphy
Telegraphy.IO/Actors/RecieveFileInfo.cs
853
C#
using namasdev.Templates; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace namasdev.Net.UnitTests._TestUtils { public class GeneradorDeContenidoSinLogica : IGeneradorDeContenido { public string GenerarContenido<TModelo>(Plantilla plantilla, TModelo modelo = null) where TModelo : class { return plantilla.Contenido; } } }
25.888889
114
0.703863
[ "MIT" ]
MatiasALopez/namasdev
Source/namasdev.Net.UnitTests/_TestUtils/GeneradorDeContenidoSinLogica.cs
468
C#
namespace foodtruacker.Authentication.Exceptions { class InvalidAuthenticationException : AuthenticationException { public InvalidAuthenticationException() : base("Wrong Username or Password.") { } } }
27.875
89
0.744395
[ "MIT" ]
hiiammalte/foodtruacker
foodtruacker.Framework/Authentication/Exceptions/InvalidAuthenticationException.cs
225
C#
/* * Copyright (c) 2016, Furore (info@furore.com) and contributors * Copyright (c) 2021, Incendi (info@incendi.no) and contributors * See the file CONTRIBUTORS for details. * * This file is licensed under the BSD 3-Clause license * available at https://raw.githubusercontent.com/FirelyTeam/spark/stu3/master/LICENSE */ namespace Spark.Engine.Service.FhirServiceExtensions { using System.Collections.Generic; using System.Threading.Tasks; using Core; public interface IResourceStorageService { Task<bool> Exists(IKey key); Task<Entry> Get(IKey key); Task<Entry> Add(Entry entry); Task<IList<Entry>> Get(IEnumerable<string> localIdentifiers, string sortBy = null); } }
29.44
91
0.706522
[ "BSD-3-Clause" ]
jjrdk/spark
src/Spark.Engine/Service/FhirServiceExtensions/IResourceStorageService.cs
738
C#
// This software is open source software available under the BSD-3 license. // // Copyright (c) 2018, Triad National Security, LLC // All rights reserved. // // Copyright 2018. Triad National Security, LLC. This software was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy. The U.S. Government has rights to use, reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR TRIAD NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to produce derivative works, such modified software should be clearly marked, so as not to confuse it with the version available from LANL. // // Additionally, 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 Triad National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, 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 TRIAD NATIONAL SECURITY, LLC 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 TRIAD NATIONAL SECURITY, LLC 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; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Omniscient { public class OmniscientCore { /// <summary> /// Version of Omniscient /// </summary> public const string VERSION = "0.4.2"; public event EventHandler ViewChanged; CacheManager Cache; /// <summary> /// Contains all of the Sites in the instance of Omniscient /// </summary> public SiteManager SiteManager { get; set; } /// <summary> /// Contains all activated Instruments /// </summary> public List<Instrument> ActiveInstruments { get; private set; } /// <summary> /// Contains all activated EventGenerators /// </summary> public List<EventGenerator> ActiveEventGenerators { get; private set; } public List<Event> Events { get; private set; } /// <summary> /// The earliest time off any data that is active /// </summary> public DateTime GlobalStart { get; set; } /// <summary> /// The latest time off any data that is active /// </summary> public DateTime GlobalEnd { get; set; } private DateTime _viewStart; /// <summary> /// The start time of the current view - i.e. data being dsiplayed. /// </summary> public DateTime ViewStart { get { return _viewStart; } set { ChangeView(value, ViewEnd); } } private DateTime _viewEnd; /// <summary> /// The end time of the current view - i.e. data being dsiplayed. /// </summary> public DateTime ViewEnd { get { return _viewEnd; } set { ChangeView(ViewStart, value); } } /// <summary> /// If any errors occur, a message is put in ErrorMessage /// </summary> public string ErrorMessage { get; private set; } private bool changingView; /// <summary> /// Constructor /// </summary> public OmniscientCore() { ErrorMessage = ""; changingView = false; SiteManager = new SiteManager("SiteManager.xml", VERSION); ReturnCode returnCode = SiteManager.Reload(); if (returnCode == ReturnCode.FILE_DOESNT_EXIST) { SiteManager.WriteBlank(); } else if (returnCode != ReturnCode.SUCCESS) { ErrorMessage = "Warning: Bad trouble loading the site manager!"; } Cache = new CacheManager(); //Cache.Start(); ActiveInstruments = new List<Instrument>(); ActiveEventGenerators = new List<EventGenerator>(); Events = new List<Event>(); GlobalStart = DateTime.Today.AddDays(-1); GlobalEnd = DateTime.Today; ChangeView(GlobalStart, GlobalEnd); } public void ActivateInstrument(Instrument instrument) { ActiveInstruments.Add(instrument); instrument.ScanDataFolder(); //instrument.LoadData(ChannelCompartment.View, new DateTime(1900, 1, 1), new DateTime(2100, 1, 1)); Cache.AddInstrumentCache(instrument.Cache); UpdateGlobalStartEnd(); instrument.LoadData(ChannelCompartment.View, _viewStart, _viewEnd); } public void DeactivateInstrument(Instrument instrument) { ActiveInstruments.Remove(instrument); instrument.ClearData(ChannelCompartment.View); Cache.RemoveInstrumentCache(instrument.Cache); UpdateGlobalStartEnd(); } /// <summary> /// Adds an EventGenerator to the list of ActiveEventGenerators /// </summary> /// <param name="eventGenerator"></param> public void ActivateEventGenerator(EventGenerator eventGenerator) { ActiveEventGenerators.Add(eventGenerator); } /// <summary> /// Removes an EventGenerator from the list of ActiveEventGenerators /// </summary> /// <param name="eventGenerator"></param> public void DeactivateEventGenerator(EventGenerator eventGenerator) { ActiveEventGenerators.Remove(eventGenerator); } /// <summary> /// Generate events with active event generators /// </summary> /// <param name="start"></param> /// <param name="end"></param> public void GenerateEvents(DateTime start, DateTime end) { Events = new List<Event>(); foreach (EventGenerator eg in ActiveEventGenerators) { Events.AddRange(eg.GenerateEvents(start, end)); eg.RunActions(); } Events.Sort((x, y) => x.StartTime.CompareTo(y.StartTime)); } /// <summary> /// Change ViewStart and ViewEnd by an equal amount /// </summary> /// <param name="shift"></param> public void ShiftView(TimeSpan shift) { if (shift == TimeSpan.Zero) return; ChangeView(ViewStart + shift, ViewEnd + shift, true); } /// <summary> /// Change the time range of data to be dsiplayed. /// </summary> /// <param name="start"></param> /// <param name="end"></param> public void ChangeView(DateTime start, DateTime end, bool holdRange=false) { if (!changingView) { changingView = true; if (start > end) throw new DatesOutOfOrderException(); bool newStart = start != ViewStart; bool newEnd = end != ViewEnd; // Keep start in global range if (newStart) { if (start < GlobalStart) { start = GlobalStart; } else if (start > GlobalEnd) { start = GlobalEnd; } newStart = start != ViewStart; _viewStart = start; } // Keep end in global range if (newEnd) { if (end < GlobalStart) { end = GlobalStart; } else if (end > GlobalEnd) { end = GlobalEnd; } newEnd = end != ViewEnd; _viewEnd = end; } if (newStart || newEnd) { if (!holdRange) { // Try to align the view to be sensible bool reRanged = false; long startT = _viewStart.Ticks; long endT = _viewEnd.Ticks; long range = endT - startT; long newRange; if (range > 6 * TimeSpan.TicksPerDay) { newRange = (range / TimeSpan.TicksPerDay) * TimeSpan.TicksPerDay; startT = startT - (startT % TimeSpan.TicksPerDay); if (startT < GlobalStart.Ticks) startT = GlobalStart.Ticks; endT = startT + newRange; if (endT <= GlobalEnd.Ticks) { reRanged = true; } else reRanged = false; } if (!reRanged && range > 6 * TimeSpan.TicksPerHour) { newRange = (range / TimeSpan.TicksPerHour) * TimeSpan.TicksPerHour; startT = startT - (startT % TimeSpan.TicksPerHour); if (startT < GlobalStart.Ticks) startT = GlobalStart.Ticks; endT = startT + newRange; if (endT <= GlobalEnd.Ticks) { reRanged = true; } else reRanged = false; } if (!reRanged && range > 6 * TimeSpan.TicksPerMinute) { newRange = (range / TimeSpan.TicksPerMinute) * TimeSpan.TicksPerMinute; startT = startT - (startT % TimeSpan.TicksPerMinute); if (startT < GlobalStart.Ticks) startT = GlobalStart.Ticks; endT = startT + newRange; if (endT <= GlobalEnd.Ticks) { reRanged = true; } else reRanged = false; } if (reRanged) { _viewStart = new DateTime(startT); _viewEnd = new DateTime(endT); } } foreach (Instrument instrument in ActiveInstruments) { instrument.LoadData(ChannelCompartment.View, _viewStart, _viewEnd); } // Invoke event handlers (i.e. update UI) ViewChanged?.Invoke(this, EventArgs.Empty); } changingView = false; } } /// <summary> /// Updates the global start and stop based on the active instruments. /// </summary> private void UpdateGlobalStartEnd() { DateTime ABSOLUTE_EARLIST = new DateTime(3000, 1, 1); DateTime earliest = ABSOLUTE_EARLIST; DateTime ABSOLUTE_LATEST = new DateTime(1000, 1, 1); DateTime latest = ABSOLUTE_LATEST; DateTime chStart; DateTime chEnd; if (ActiveInstruments.Count == 0) return; // Figure out the earliest and latest data point foreach (Instrument inst in ActiveInstruments) { /* foreach (Channel ch in inst.GetChannels()) { if (ch.GetTimeStamps(ChannelCompartment.View).Count > 0) { chStart = ch.GetTimeStamps(ChannelCompartment.View)[0]; chEnd = ch.GetTimeStamps(ChannelCompartment.View)[ch.GetTimeStamps(ChannelCompartment.View).Count - 1]; if (ch.GetChannelType() == Channel.ChannelType.DURATION_VALUE) chEnd += ch.GetDurations(ChannelCompartment.View)[ch.GetDurations(ChannelCompartment.View).Count - 1]; if (chStart < earliest) earliest = chStart; if (chEnd > latest) latest = chEnd; } } */ DateTimeRange range = inst.Cache.GetDataFilesTimeRange(); if (earliest > DateTime.MinValue && range.Start < earliest) earliest = range.Start; if (latest < DateTime.MaxValue && range.End > latest) latest = range.End; } if (earliest > latest) return; if (earliest == ABSOLUTE_EARLIST || latest == ABSOLUTE_LATEST) return; // Update global start and end GlobalStart = earliest; GlobalEnd = latest; DateTime tempViewStart = ViewStart; DateTime tempViewEnd = ViewEnd; bool changedRange = false; if (tempViewStart < GlobalStart || tempViewStart > GlobalEnd) { tempViewStart = GlobalStart; changedRange = true; } if (tempViewEnd > GlobalEnd || tempViewEnd < GlobalStart) { tempViewEnd = GlobalEnd; changedRange = true; } if (changedRange) { if (TimeSpan.FromTicks(tempViewEnd.Ticks - tempViewStart.Ticks).TotalDays > 1) { tempViewStart = tempViewEnd.AddDays(-1); } else if (TimeSpan.FromTicks(tempViewEnd.Ticks - tempViewStart.Ticks).TotalHours > 1) { tempViewStart = tempViewEnd.AddHours(-1); } else if (TimeSpan.FromTicks(tempViewEnd.Ticks - tempViewStart.Ticks).TotalMinutes > 1) { tempViewStart = tempViewEnd.AddMinutes(-1); } else if (TimeSpan.FromTicks(tempViewEnd.Ticks - tempViewStart.Ticks).TotalSeconds > 1) { tempViewStart = tempViewEnd.AddSeconds(-1); } ChangeView(tempViewStart, tempViewEnd); } } public void Shutdown() { //Cache.Stop(); } } public class DatesOutOfOrderException : Exception { } }
40.21608
773
0.521867
[ "MIT", "Unlicense", "BSD-3-Clause" ]
lanl/Omniscient
Omniscient/OmniscientCore.cs
16,008
C#
using System.Collections.Generic; using System.Threading.Tasks; using Dapper; using Microsoft.Extensions.Configuration; using Monitoring.Business.Abstract.Repository; using Monitoring.Business.Model; namespace Monitoring.Data.Repository { public class MeasurementRepository : IMeasurementRepository { private readonly IConfiguration _configuration; public MeasurementRepository(IConfiguration configuration) { _configuration = configuration; } public async Task CreateMeasurements(IEnumerable<Measurement> measurements) { await using var connection = ConnectionHelper.GetConnection(_configuration); foreach (var measurement in measurements) { const string getDeviceIdQuery = @"SELECT id FROM devices WHERE uuid=@DeviceUuid"; var deviceId = await connection.QuerySingleAsync<int>(getDeviceIdQuery, new {DeviceUuid = measurement.DeviceUuid}); const string query = @" INSERT INTO measurements(humidity, temperature, time_stamp, device_id) VALUES (@Humidity, @Temperature, @TimeStamp, @DeviceId)"; await connection.ExecuteAsync(query, new { measurement.Humidity, measurement.Temperature, measurement.TimeStamp, DeviceId = deviceId }); } } public async Task<Measurement> GetLatestMeasurement(string deviceUuid) { await using var connection = ConnectionHelper.GetConnection(_configuration); const string query = @" SELECT devices.uuid AS DeviceUuid, measurements.humidity AS Humidity, measurements.temperature AS Temperature, measurements.time_stamp AS TimeStamp FROM measurements INNER JOIN devices ON devices.id=measurements.device_id WHERE devices.uuid=@DeviceUuid ORDER BY measurements.id DESC LIMIT 1"; return await connection.QueryFirstOrDefaultAsync<Measurement>(query, new {DeviceUuid = deviceUuid}); } public async Task<IEnumerable<Measurement>> GetMeasurements(string deviceUuid, int hours) { await using var connection = ConnectionHelper.GetConnection(_configuration); const string query = @" SELECT devices.uuid AS DeviceUuid, measurements.humidity AS Humidity, measurements.temperature AS Temperature, measurements.time_stamp AS TimeStamp FROM measurements INNER JOIN devices ON devices.id=measurements.device_id WHERE devices.uuid=@DeviceUuid AND measurements.time_stamp > DATE_SUB(CURRENT_TIMESTAMP(),INTERVAL @Hours HOUR) ORDER BY measurements.time_stamp DESC"; return await connection.QueryAsync<Measurement>(query, new {DeviceUuid = deviceUuid, Hours = hours}); } } }
42.302632
130
0.613686
[ "MIT" ]
Saifanl/home-temperature-monitoring
src/Monitoring.Web/Monitoring.Data/Repository/MeasurementRepository.cs
3,215
C#
using System; using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Text; namespace AiCodo.Data { public static class DbProviderFactories { static Dictionary<string, IDbProvider> _Items = new Dictionary<string, IDbProvider>(); static DbProviderFactories() { //SetFactory("mysql", MySqlProvider.Instance); //SetFactory("MySql.Data.MySqlClient", MySqlProvider.Instance); //SetFactory("sqlite", SqliteProvider.Instance); //SetFactory("sql", MSSqlProvider.Instance); } public static IEnumerable<string> GetProviderNames() { return _Items.Keys.ToList(); } public static IDbProvider GetProvider(string name) { if (_Items.TryGetValue(name, out IDbProvider provider)) { return provider; } return null; } public static DbProviderFactory GetFactory(string name) { if (_Items.TryGetValue(name, out IDbProvider provider)) { return provider.Factory; } return null; } public static void SetFactory(string name, IDbProvider provider) { lock (_Items) { _Items[name] = provider; "DbProviderFactories".Log($"Add [{name}]={provider.GetType()}"); } } } }
27.072727
80
0.558093
[ "MIT" ]
singbaX/aicodo
src/AiCodo.Data/Provider/DbProviderFactories.cs
1,491
C#
using CppMemoryVisualizer.ViewModels; using System.Diagnostics; using System.Linq; namespace CppMemoryVisualizer.Commands { class MemorySegmentPointerValueClickCommand : MemorySegmentClickCommand { public MemorySegmentPointerValueClickCommand(MainViewModel mainViewModel) : base(mainViewModel) { } public override void Execute(object parameter) { var vm = (MemorySegmentViewModel)parameter; Debug.Assert(vm != null); Debug.Assert(vm.Memory != null); if (null != vm.TypeName && vm.TypeName.Contains('*') && vm.Memory.Count == 4) { uint targetAddress = (uint)vm.Memory.Array[vm.Memory.Offset] | (uint)vm.Memory.Array[vm.Memory.Offset + 1] << 8 | (uint)vm.Memory.Array[vm.Memory.Offset + 2] << 16 | (uint)vm.Memory.Array[vm.Memory.Offset + 3] << 24; base.Execute(targetAddress); } } } }
32.03125
89
0.582439
[ "MIT" ]
jubin-park/CppMemoryVisualizer
Commands/MemorySegmentPointerValueClickCommand.cs
1,027
C#
using System; namespace LoRDeckCodes { /* * Derived from https://github.com/google/google-authenticator-android/blob/master/AuthenticatorApp/src/main/java/com/google/android/apps/authenticator/Base32String.java * * Copyright (C) 2016 BravoTango86 * * 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.Text; using System.Text.RegularExpressions; public static class Base32 { private static readonly char[] DIGITS; private static readonly int MASK; private static readonly int SHIFT; private static Dictionary<char, int> CHAR_MAP = new Dictionary<char, int>(); private const string SEPARATOR = "-"; static Base32() { DIGITS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".ToCharArray(); MASK = DIGITS.Length - 1; SHIFT = numberOfTrailingZeros(DIGITS.Length); for (int i = 0; i < DIGITS.Length; i++) CHAR_MAP[DIGITS[i]] = i; } private static int numberOfTrailingZeros(int i) { // HD, Figure 5-14 int y; if (i == 0) return 32; int n = 31; y = i << 16; if (y != 0) { n = n - 16; i = y; } y = i << 8; if (y != 0) { n = n - 8; i = y; } y = i << 4; if (y != 0) { n = n - 4; i = y; } y = i << 2; if (y != 0) { n = n - 2; i = y; } return n - (int)((uint)(i << 1) >> 31); } public static byte[] Decode(string encoded) { // Remove whitespace and separators encoded = encoded.Trim().Replace(SEPARATOR, ""); // Remove padding. Note: the padding is used as hint to determine how many // bits to decode from the last incomplete chunk (which is commented out // below, so this may have been wrong to start with). encoded = Regex.Replace(encoded, "[=]*$", ""); // Canonicalize to all upper case encoded = encoded.ToUpper(); if (encoded.Length == 0) { return new byte[0]; } int encodedLength = encoded.Length; int outLength = encodedLength * SHIFT / 8; byte[] result = new byte[outLength]; int buffer = 0; int next = 0; int bitsLeft = 0; foreach (char c in encoded.ToCharArray()) { if (!CHAR_MAP.ContainsKey(c)) { throw new DecodingException("Illegal character: " + c); } buffer <<= SHIFT; buffer |= CHAR_MAP[c] & MASK; bitsLeft += SHIFT; if (bitsLeft >= 8) { result[next++] = (byte)(buffer >> (bitsLeft - 8)); bitsLeft -= 8; } } // We'll ignore leftover bits for now. // // if (next != outLength || bitsLeft >= SHIFT) { // throw new DecodingException("Bits left: " + bitsLeft); // } return result; } public static string Encode(byte[] data, bool padOutput = false) { if (data.Length == 0) { return ""; } // SHIFT is the number of bits per output character, so the length of the // output is the length of the input multiplied by 8/SHIFT, rounded up. if (data.Length >= (1 << 28)) { // The computation below will fail, so don't do it. throw new ArgumentOutOfRangeException("data"); } int outputLength = (data.Length * 8 + SHIFT - 1) / SHIFT; StringBuilder result = new StringBuilder(outputLength); int buffer = data[0]; int next = 1; int bitsLeft = 8; while (bitsLeft > 0 || next < data.Length) { if (bitsLeft < SHIFT) { if (next < data.Length) { buffer <<= 8; buffer |= (data[next++] & 0xff); bitsLeft += 8; } else { int pad = SHIFT - bitsLeft; buffer <<= pad; bitsLeft += pad; } } int index = MASK & (buffer >> (bitsLeft - SHIFT)); bitsLeft -= SHIFT; result.Append(DIGITS[index]); } if (padOutput) { int padding = 8 - (result.Length % 8); if (padding > 0) result.Append(new string('=', padding == 8 ? 0 : padding)); } return result.ToString(); } private class DecodingException : Exception { public DecodingException(string message) : base(message) { } } } }
34.679012
169
0.487896
[ "Apache-2.0" ]
Bamiji/LoRDeckCodes
LoRDeckCodes/Base32.cs
5,620
C#
/** * Copyright 2017-2020 Plexus Interop Deutsche Bank AG * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.Collections.Generic; namespace Plexus.Interop.Protocol.Common { public struct ErrorHeader { public ErrorHeader(string message, string details) { Message = message; Details = details; } public string Message { get; } public string Details { get; } public override bool Equals(object obj) { if (!(obj is ErrorHeader)) { return false; } var header = (ErrorHeader)obj; return Message == header.Message && Details == header.Details; } public override int GetHashCode() { var hashCode = 707783785; hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Message); hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Details); return hashCode; } public override string ToString() { return $"{{{nameof(Message)}: {Message}}}"; } } }
30.516667
102
0.614965
[ "ECL-2.0", "Apache-2.0" ]
brntbeer/plexus-interop
desktop/src/Plexus.Interop.Protocol.Common.Contracts/ErrorHeader.cs
1,833
C#
using System; using Source.DataServices.EFCore.DataContext; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Source.EFCore.Setup { public class EntityFrameworkCoreInitializer { public static EntityFrameworkCoreInitializer Factory(IServiceCollection services, IConfiguration configuration) { return new EntityFrameworkCoreInitializer(services, configuration); } private readonly IServiceCollection _services; private readonly IConfiguration _configuration; private readonly IHostingEnvironment _hostingEnvironment; public EntityFrameworkCoreInitializer(IServiceCollection services, IConfiguration configuration) { _services = services; _configuration = configuration; IServiceProvider serviceProvider = _services.BuildServiceProvider(); _hostingEnvironment = serviceProvider.GetService<IHostingEnvironment>(); } public void AddDbContext() { if (_hostingEnvironment.IsDevelopment()) _services.AddScoped<AppDbContext, InMemoryDbContext>(); else _services.AddScoped<AppDbContext>(x => new SqlServerDbContext(_configuration)); } public static void AddSeedDataToDbContext(IHostingEnvironment hostingEnvironment, IConfiguration configuration) { if (hostingEnvironment.IsDevelopment()) DbContextDataInitializer.Initialize(new InMemoryDbContext()); else DbContextDataInitializer.Initialize(new SqlServerDbContext(configuration)); } } }
38.311111
119
0.707077
[ "MIT" ]
JDavidBC/DDDSample
Infrastructure.EFCore/Source.EFCore.Setup/EntityFrameworkCoreInitializer.cs
1,726
C#
using Autodesk.AdvanceSteel.CADAccess; using Autodesk.AdvanceSteel.ConstructionTypes; using Autodesk.AdvanceSteel.Geometry; using Autodesk.AdvanceSteel.Modeler; using Autodesk.AdvanceSteel.Modelling; using Autodesk.DesignScript.Runtime; using System; using System.Collections.Generic; using System.Linq; using SteelServices = Dynamo.Applications.AdvanceSteel.Services; namespace AdvanceSteel.Nodes.Util { /// <summary> /// Geometric functions to work with Beams - Straight Beams, Bend Beams.... /// </summary> public class Beam { internal Beam() { } /// <summary> /// Set Advance Steel Beam Insert Reference Axis /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="refAxis"> Input Beam reference axis UpperLeft = 0, UpperSys = 1, UpperRight = 2, MidLeft = 3, SysSys = 4, MidRight = 5, LowerLeft = 6, LowerSys = 7, LowerRight = 8, ContourCenter = 9</param> public static void SetBeamReferenceAxis(AdvanceSteel.Nodes.SteelDbObject steelObject, int refAxis) { if (Enum.IsDefined(typeof(Autodesk.AdvanceSteel.Modelling.Beam.eRefAxis), refAxis) == false) throw new System.Exception("Invalid Reference axis"); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; selectedObj.RefAxis = (Autodesk.AdvanceSteel.Modelling.Beam.eRefAxis)refAxis; } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } } /// <summary> /// Set Beam Cross Section to be Mirrored - i.e. Channels with toe pointing in the opposite direction /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="crossSectionMirrored"> Input True or False Value</param> public static void SetBeamCrossSectionMirrored(AdvanceSteel.Nodes.SteelDbObject steelObject, [DefaultArgument("true")] bool crossSectionMirrored) { using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; selectedObj.SetCrossSectionMirrored(crossSectionMirrored); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } } /// <summary> /// Set Beam System Line Start Point /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="point"> Input Dynamo Point</param> public static void SetSystemLineStartPoint(AdvanceSteel.Nodes.SteelDbObject steelObject, Autodesk.DesignScript.Geometry.Point point) { using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; selectedObj.SetSysStart(Utils.ToAstPoint(point, true)); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } } /// <summary> /// Set Beam System Line End Point /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="point"> Input Dynamo Point</param> public static void SetSystemLineEndPoint(AdvanceSteel.Nodes.SteelDbObject steelObject, Autodesk.DesignScript.Geometry.Point point) { using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; selectedObj.SetSysEnd(Utils.ToAstPoint(point, true)); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } } /// <summary> /// Get closest point on the system line relative to a point /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="pointOnSystemLine"> Dynamo point</param> /// <param name="unBounded">TRUE = Ignore ends of system line, FALSE = (Default) Use physical length of System line as limitation</param> /// <returns name="point"> closest point of the system line either restricted or not the physical system line</returns> public static Autodesk.DesignScript.Geometry.Point GetClosestPointToSystemline(AdvanceSteel.Nodes.SteelDbObject steelObject, Autodesk.DesignScript.Geometry.Point pointOnSystemLine, [DefaultArgument("False")] bool unBounded) { Autodesk.DesignScript.Geometry.Point ret = Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0); Point3d point = Utils.ToAstPoint(pointOnSystemLine, true); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null || point != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; Point3d foundPoint = selectedObj.GetClosestPointToSystemline(point, unBounded); if (foundPoint != null) { ret = Utils.ToDynPoint(foundPoint, true); } else throw new System.Exception("No Point was returned from Function"); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } return ret; } /// <summary> /// Return Dynamo Line object from the Beam System Line. Supports Straight Beam, Tapered Beam, Unfolded Beam or Compound Beam /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <returns name="line"> beam system line as line object</returns> public static Autodesk.DesignScript.Geometry.Line GetBeamLine(AdvanceSteel.Nodes.SteelDbObject steelObject) { Autodesk.DesignScript.Geometry.Line ret = null; using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kStraightBeam) || filerObj.IsKindOf(FilerObject.eObjectType.kBeamTapered) || filerObj.IsKindOf(FilerObject.eObjectType.kUnfoldedStraightBeam) || filerObj.IsKindOf(FilerObject.eObjectType.kCompoundStraightBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; Point3d foundStartPoint = selectedObj.GetPointAtStart(); Point3d foundEndPoint = selectedObj.GetPointAtEnd(); if (foundStartPoint != null || foundEndPoint != null) { ret = Autodesk.DesignScript.Geometry.Line.ByStartPointEndPoint(Utils.ToDynPoint(foundStartPoint, true), Utils.ToDynPoint(foundEndPoint, true)); } else throw new System.Exception("No Points wer returned from the Object"); } else throw new System.Exception("Not a Straight Beam, Tapered Beam, Unfolded Beam or Compound Beam Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } return ret; } /// <summary> /// Get Point at a distance from the END of the Beam /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="distance"> Distance from end point</param> /// <returns name="point"> from beam object end point return a point by the distance value</returns> public static Autodesk.DesignScript.Geometry.Point GetPointFromEnd(AdvanceSteel.Nodes.SteelDbObject steelObject, [DefaultArgument("0")] double distance) { Autodesk.DesignScript.Geometry.Point ret = Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; Point3d foundPoint = selectedObj.GetPointAtEnd(distance); if (foundPoint != null) { ret = Utils.ToDynPoint(foundPoint, true); } else throw new System.Exception("No Point was returned from Function"); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } return ret; } /// <summary> /// Get Point at a distance from the START of the Beam /// </summary> /// <param name="steelObject">Advance Steel element</param> /// <param name="distance"> Distance from start point</param> /// <returns name="point"> from beam object start point return a point by the distance value</returns> public static Autodesk.DesignScript.Geometry.Point GetPointFromStart(AdvanceSteel.Nodes.SteelDbObject steelObject, [DefaultArgument("0")] double distance) { Autodesk.DesignScript.Geometry.Point ret = Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; Point3d foundPoint = selectedObj.GetPointAtStart(distance); if (foundPoint != null) { ret = Utils.ToDynPoint(foundPoint, true); } else throw new System.Exception("No Point was returned from Function"); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } return ret; } /// <summary> /// Get Coordinate System at point on System line /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="pointOnSystemLine"> Dynamo Point on System line</param> /// <returns name="coordinateSystem"> return coordinate system on beam at a specifc point</returns> public static Autodesk.DesignScript.Geometry.CoordinateSystem GetCoordinateSystemAtPoint(AdvanceSteel.Nodes.SteelDbObject steelObject, Autodesk.DesignScript.Geometry.Point pointOnSystemLine) { Autodesk.DesignScript.Geometry.CoordinateSystem ret = Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0); Point3d point = Utils.ToAstPoint(pointOnSystemLine, true); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null || point != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; Matrix3d cs = selectedObj.GetCSAtPoint(point); if (cs != null) { ret = Utils.ToDynCoordinateSys(cs, true); } else throw new System.Exception("Not Cordinate System was returned from Point"); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object or Point is null"); } return ret; } /// <summary> /// Get Saw Cut information from Beam Objects /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <returns name="SawLength"> The Saw Length, Flange Angle At Start, Web Angle At Start, Flange Angle At End and Web Angle At End </returns> [MultiReturn(new[] { "SawLength", "FlangeAngleAtStart", "WebAngleAtStart", "FlangeAngleAtEnd", "WebAngleAtEnd" })] public static Dictionary<string, double> GetBeamSawInformation(AdvanceSteel.Nodes.SteelDbObject steelObject) { Dictionary<string, double> ret = new Dictionary<string, double>(); double sawLength = 0; double flangeAngleAtStart = 0; double webAngleAtStart = 0; double flangeAngleAtEnd = 0; double webAngleAtEnd = 0; ret.Add("SawLength", Utils.FromInternalDistanceUnits(sawLength, true)); ret.Add("FlangeAngleAtStart", flangeAngleAtStart); ret.Add("WebAngleAtStart", webAngleAtStart); ret.Add("FlangeAngleAtEnd", flangeAngleAtEnd); ret.Add("WebAngleAtEnd", webAngleAtEnd); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; int executed = selectedObj.GetSawInformation(out sawLength, out flangeAngleAtStart, out webAngleAtStart, out flangeAngleAtEnd, out webAngleAtEnd); if (executed > 0) { ret["SawLength"] = Utils.FromInternalDistanceUnits(sawLength, true); ret["FlangeAngleAtStart"] = Utils.FromInternalAngleUnits(Utils.DegreeToRad(flangeAngleAtStart), true); ret["WebAngleAtStart"] = Utils.FromInternalAngleUnits(Utils.DegreeToRad(webAngleAtStart), true); ret["FlangeAngleAtEnd"] = Utils.FromInternalAngleUnits(Utils.DegreeToRad(flangeAngleAtEnd), true); ret["WebAngleAtEnd"] = Utils.FromInternalAngleUnits(Utils.DegreeToRad(webAngleAtEnd), true); } else throw new System.Exception("No Values were found for Steel Beam from Function"); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object is null"); } return ret; } /// <summary> /// Get BEAM data /// </summary> /// <param name="steelObject"> Advance Steel element</param> /// <param name="bodyResolutionForLength"> Set Steel body display resolution</param> /// <returns name="Length"> The beam Length, PaintArea, Exact Weight, Weight Per Unit, Profile Type and Profile Type Code</returns> [MultiReturn(new[] { "Length", "PaintArea", "ExactWeight", "WeightPerUnit", "ProfileType", "ProfileTypeCode" })] public static Dictionary<string, object> GetBeamData(AdvanceSteel.Nodes.SteelDbObject steelObject, [DefaultArgument("0")] int bodyResolutionForLength) { Dictionary<string, object> ret = new Dictionary<string, object>(); double length = 0; double paintArea = 0; double weight = 0; double weightPerUnit = 0; int profileType = 0; string profileTypeCode = "No Code"; ret.Add("Length", length); ret.Add("PaintArea", paintArea); ret.Add("ExactWeight", weight); ret.Add("WeightPerUnit", weightPerUnit); ret.Add("ProfileType", profileType); ret.Add("ProfileTypeCode", profileTypeCode); using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; length = selectedObj.GetLength((BodyContext.eBodyContext)bodyResolutionForLength); paintArea = selectedObj.GetPaintArea(); weight = selectedObj.GetWeight(2); weightPerUnit = selectedObj.GetWeightPerMeter(); profileTypeCode = selectedObj.GetProfType().GetDSTVValues().GetProfileTypeString(); profileType = (int)selectedObj.GetProfType().GetDSTVValues().DSTVType; ret["Length"] = Utils.FromInternalDistanceUnits(length, true); ret["PaintArea"] = Utils.FromInternalAreaUnits(paintArea, true); ret["ExactWeight"] = Utils.FromInternalWeightUnits(weight, true); ret["WeightPerUnit"] = Utils.FromInternalWeightPerDistanceUnits(weightPerUnit, true); ret["ProfileType"] = profileType; ret["ProfileTypeCode"] = profileTypeCode; } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("No AS Steel Object is null"); } else throw new System.Exception("No Steel Object or Point is null"); } return ret; } /// <summary> /// Get Beam Insert Reference Axis /// </summary> /// <param name="steelObject">Advance Steel element</param> /// <returns name="beamReferenceAxis"> Integer value for beam reference axis</returns> public static int GetBeamReferenceAxis(AdvanceSteel.Nodes.SteelDbObject steelObject) { int ret = -1; using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; ret = (int)selectedObj.RefAxis; } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object or Point is null"); } return ret; } /// <summary> /// Get Beam Length /// </summary> /// <param name="steelObject">Advance Steel element</param> /// <returns name="beamLenth"> The beam length value</returns> public static double GetLength(AdvanceSteel.Nodes.SteelDbObject steelObject) { double ret = 0; using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; ret = (double)selectedObj.GetLength(); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object or Point is null"); } return Utils.FromInternalDistanceUnits(ret, true); } /// <summary> /// Get Beam Length relative to object display /// </summary> /// <param name="steelObject">Advance Steel element</param> /// <param name="bodyResolutionForLength"> Set Steel body display resolution</param> /// <returns name="beamLength"> The beam length value based on a particular beam display mode / resolution</returns> public static double GetLength(AdvanceSteel.Nodes.SteelDbObject steelObject, [DefaultArgument("0")] int bodyResolutionForLength) { double ret = 0; using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; ret = (double)selectedObj.GetLength((BodyContext.eBodyContext)bodyResolutionForLength); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object or Point is null"); } return Utils.FromInternalDistanceUnits(ret, true); } /// <summary> /// Get Beam Weight Per Meter /// </summary> /// <param name="steelObject">Advance Steel element</param> /// <returns name="beamWeightPerMeter"> The beam weight per meter</returns> public static double GetWeightPerMeter(AdvanceSteel.Nodes.SteelDbObject steelObject) { double ret = 0; using (var ctx = new SteelServices.DocContext()) { if (steelObject != null) { FilerObject filerObj = Utils.GetObject(steelObject.Handle); if (filerObj != null) { if (filerObj.IsKindOf(FilerObject.eObjectType.kBeam)) { Autodesk.AdvanceSteel.Modelling.Beam selectedObj = filerObj as Autodesk.AdvanceSteel.Modelling.Beam; ret = (double)selectedObj.GetWeightPerMeter(); } else throw new System.Exception("Not a BEAM Object"); } else throw new System.Exception("AS Object is null"); } else throw new System.Exception("Steel Object or Point is null"); } return Utils.FromInternalWeightPerDistanceUnits(ret, true); } /// <summary> /// This node can set the Section for Advance Steel beams from Dynamo. /// For the Section use the following format: "HEA DIN18800-1#@§@#HEA100" /// </summary> /// <param name="beamElement">Advance Steel beam</param> /// <param name="sectionName">Section</param> public static void SetSection(AdvanceSteel.Nodes.SteelDbObject beamElement, string sectionName) { using (var ctx = new SteelServices.DocContext()) { string handle = beamElement.Handle; FilerObject obj = Utils.GetObject(handle); if (obj != null && obj.IsKindOf(FilerObject.eObjectType.kBeam)) { string sectionType = Utils.SplitSectionName(sectionName)[0]; string sectionSize = Utils.SplitSectionName(sectionName)[1]; Autodesk.AdvanceSteel.Modelling.Beam beam = obj as Autodesk.AdvanceSteel.Modelling.Beam; if (obj.IsKindOf(FilerObject.eObjectType.kCompoundBeam) && !Utils.CompareCompoundSectionTypes(beam.ProfSectionType, sectionType)) { throw new System.Exception("Failed to change section as compound section type is different"); } beam.ChangeProfile(sectionType, sectionSize); } else throw new System.Exception("Failed to change section"); } } /// <summary> /// Returns a concatenated string containing the SectionType, a fixed string separator "#@§@#" and the SectionSize. /// </summary> /// <param name="sectionType">SectionType for a beam section</param> /// <param name="sectionSize">SectionSize for a beam section</param> /// <returns name="sectionName">Beam section name</returns> public static string CreateSectionString(string sectionType, string sectionSize) { return sectionType + Utils.Separator + sectionSize; } } }
42.11094
211
0.602452
[ "Apache-2.0" ]
DynamoDS/Dynamo-Advance-Steel
src/AdvanceSteelNodes/Util/Beam.cs
27,334
C#
// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved. using UnityEngine; namespace HutongGames.PlayMaker.Actions { [ActionCategory(ActionCategory.Input)] [Tooltip("Gets the pressed state of a Key.")] public class GetKey : FsmStateAction { [RequiredField] [Tooltip("The key to test.")] public KeyCode key; [RequiredField] [UIHint(UIHint.Variable)] [Tooltip("Store if the key is down (True) or up (False).")] public FsmBool storeResult; [Tooltip("Repeat every frame. Useful if you're waiting for a key press/release.")] public bool everyFrame; public override void Reset() { key = KeyCode.None; storeResult = null; everyFrame = false; } public override void OnEnter() { DoGetKey(); if (!everyFrame) { Finish(); } } public override void OnUpdate() { DoGetKey(); } void DoGetKey() { storeResult.Value = Input.GetKey(key); } } }
18.096154
84
0.655685
[ "MIT" ]
517752548/UnityFramework
GameFrameWork/ThirdParty/PlayMaker/Actions/Input/GetKey.cs
941
C#
using System; namespace Application.Models { public class ErrorViewModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } }
17.5
70
0.666667
[ "MIT" ]
OmarThinks/.NET-MVC-Project
src/Models/ErrorViewModel.cs
210
C#
// *********************************************************************** // Copyright (c) 2008-2014 Charlie Poole, Rob Prouse // // 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. // *********************************************************************** #nullable enable using System.Collections.Generic; using System.Linq; using NUnit.Framework.Interfaces; namespace NUnit.Framework.Internal.Builders { /// <summary> /// Class to build ether a parameterized or a normal NUnitTestMethod. /// There are four cases that the builder must deal with: /// 1. The method needs no params and none are provided /// 2. The method needs params and they are provided /// 3. The method needs no params but they are provided in error /// 4. The method needs params but they are not provided /// This could have been done using two different builders, but it /// turned out to be simpler to have just one. The BuildFrom method /// takes a different branch depending on whether any parameters are /// provided, but all four cases are dealt with in lower-level methods /// </summary> public class DefaultTestCaseBuilder : ITestCaseBuilder { private readonly NUnitTestCaseBuilder _nunitTestCaseBuilder = new NUnitTestCaseBuilder(); /// <summary> /// Determines if the method can be used to build an NUnit test /// test method of some kind. The method must normally be marked /// with an identifying attribute for this to be true. /// /// Note that this method does not check that the signature /// of the method for validity. If we did that here, any /// test methods with invalid signatures would be passed /// over in silence in the test run. Since we want such /// methods to be reported, the check for validity is made /// in BuildFrom rather than here. /// </summary> /// <param name="method">An IMethodInfo for the method being used as a test method</param> public bool CanBuildFrom(IMethodInfo method) { return method.IsDefined<ITestBuilder>(false) || method.IsDefined<ISimpleTestBuilder>(false); } /// <summary> /// Builds a single test from the specified method and context, /// possibly containing child test cases. /// </summary> /// <param name="method">The method for which a test is to be built</param> public Test BuildFrom(IMethodInfo method) { return BuildFrom(method, null); } #region ITestCaseBuilder Members /// <summary> /// Determines if the method can be used to build an NUnit test /// test method of some kind. The method must normally be marked /// with an identifying attribute for this to be true. /// /// Note that this method does not check that the signature /// of the method for validity. If we did that here, any /// test methods with invalid signatures would be passed /// over in silence in the test run. Since we want such /// methods to be reported, the check for validity is made /// in BuildFrom rather than here. /// </summary> /// <param name="method">An IMethodInfo for the method being used as a test method</param> /// <param name="parentSuite">The test suite being built, to which the new test would be added</param> public bool CanBuildFrom(IMethodInfo method, Test? parentSuite) { return CanBuildFrom(method); } /// <summary> /// Builds a single test from the specified method and context, /// possibly containing child test cases. /// </summary> /// <param name="method">The method for which a test is to be built</param> /// <param name="parentSuite">The test fixture being populated, or null</param> public Test BuildFrom(IMethodInfo method, Test? parentSuite) { var tests = new List<TestMethod>(); List<ITestBuilder> builders = new List<ITestBuilder>( method.GetCustomAttributes<ITestBuilder>(false)); // See if we need to add a CombinatorialAttribute for parameterized data if (method.MethodInfo.GetParameters().Any(param => param.HasAttribute<IParameterDataSource>(false)) && !builders.Any(builder => builder is CombiningStrategyAttribute)) builders.Add(new CombinatorialAttribute()); foreach (var attr in builders) { foreach (var test in attr.BuildFrom(method, parentSuite)) tests.Add(test); } return builders.Count > 0 && method.GetParameters().Length > 0 || tests.Count > 0 ? BuildParameterizedMethodSuite(method, tests) : BuildSingleTestMethod(method, parentSuite); } #endregion #region Helper Methods /// <summary> /// Builds a ParameterizedMethodSuite containing individual test cases. /// </summary> /// <param name="method">The method for which a test is to be built.</param> /// <param name="tests">The list of test cases to include.</param> private Test BuildParameterizedMethodSuite(IMethodInfo method, IEnumerable<TestMethod> tests) { ParameterizedMethodSuite methodSuite = new ParameterizedMethodSuite(method); methodSuite.ApplyAttributesToTest(method.MethodInfo); foreach (TestMethod test in tests) methodSuite.Add(test); return methodSuite; } /// <summary> /// Build a simple, non-parameterized TestMethod for this method. /// </summary> /// <param name="method">The MethodInfo for which a test is to be built</param> /// <param name="suite">The test suite for which the method is being built</param> private Test BuildSingleTestMethod(IMethodInfo method, Test? suite) { var builders = method.GetCustomAttributes<ISimpleTestBuilder>(false); return builders.Length > 0 ? builders[0].BuildFrom(method, suite) : _nunitTestCaseBuilder.BuildTestMethod(method, suite, null); } #endregion } }
45.417178
111
0.637985
[ "MIT" ]
Antash/nun
src/NUnitFramework/framework/Internal/Builders/DefaultTestCaseBuilder.cs
7,403
C#
#nullable enable using System; using Robust.Shared.Serialization; namespace Content.Shared.GameObjects.Components.Trigger { [NetSerializable] [Serializable] public enum TriggerVisuals { VisualState, } [NetSerializable] [Serializable] public enum TriggerVisualState { Primed, Unprimed, } }
16.181818
55
0.662921
[ "MIT" ]
BingoJohnson/space-station-14
Content.Shared/GameObjects/Components/Trigger/TriggerVisuals.cs
358
C#
/* https://www.decentlab.com/support */ using System; using System.IO; using System.Collections.Generic; public class DecentlabDecoder { private delegate double conversion(double[] x); public const int PROTOCOL_VERSION = 2; private class Sensor { internal int length { get; set; } internal List<SensorValue> values { get; set; } internal Sensor(int length, List<SensorValue> values) { this.length = length; this.values = values; } } private class SensorValue { internal string name { get; set; } internal string unit { get; set; } internal conversion convert; internal SensorValue(string name, string unit, conversion convert) { this.name = name; this.unit = unit; this.convert = convert; } } private static readonly List<Sensor> SENSORS = new List<Sensor>() { new Sensor(1, new List<SensorValue>() { new SensorValue("Raw sensor reading", "mV", x => 3 * (x[0] - 32768) / 32768 * 1000), new SensorValue("Volumetric water content", "m³⋅m⁻³", x => 2.97*Math.Pow(10, -9) * Math.Pow(3000*(x[0]-32768)/32768, 3) - 7.37*Math.Pow(10, -6) * Math.Pow(3000*(x[0]-32768)/32768, 2) + 6.69*Math.Pow(10, -3) * (3000*(x[0]-32768)/32768) - 1.92) }), new Sensor(1, new List<SensorValue>() { new SensorValue("Battery voltage", "V", x => x[0] / 1000) }) }; private static int ReadInt(Stream stream) { return (stream.ReadByte() << 8) + stream.ReadByte(); } public static Dictionary<string, Tuple<double, string>> Decode(byte[] msg) { return Decode(new MemoryStream(msg)); } public static Dictionary<string, Tuple<double, string>> Decode(String msg) { byte[] output = new byte[msg.Length / 2]; for (int i = 0, j = 0; i < msg.Length; i += 2, j++) { output[j] = (byte)int.Parse(msg.Substring(i, 2), System.Globalization.NumberStyles.HexNumber); } return Decode(output); } public static Dictionary<string, Tuple<double, string>> Decode(Stream msg) { var version = msg.ReadByte(); if (version != PROTOCOL_VERSION) { throw new InvalidDataException("protocol version " + version + " doesn't match v2"); } var result = new Dictionary<string, Tuple<double, string>>(); result["Protocol version"] = new Tuple<double, string>(version, null); var deviceId = ReadInt(msg); result["Device ID"] = new Tuple<double, string>(deviceId, null); var flags = ReadInt(msg); foreach (var sensor in SENSORS) { if ((flags & 1) == 1) { double[] x = new double[sensor.length]; for (int i = 0; i < sensor.length; i++) { x[i] = ReadInt(msg); } foreach (var val in sensor.values) { if (val.convert != null) { result[val.name] = new Tuple<double, string>(val.convert(x), val.unit); } } } flags >>= 1; } return result; } } public class Program { public static void Main() { var payloads = new string[] { "0202df000393710c60", "0202df00020c60" }; foreach (var pl in payloads) { var decoded = DecentlabDecoder.Decode(pl); foreach (var k in decoded.Keys) { Console.WriteLine(k + ": " + decoded[k]); } Console.WriteLine(); } } }
26.5
248
0.596286
[ "MIT" ]
Realscrat/decentlab-decoders
DL-10HS/DL-10HS.cs
3,345
C#
using System; namespace Neo.SmartContract.Native { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false)] internal class ContractMethodAttribute : Attribute { public string Name { get; set; } public long Price { get; } public CallFlags RequiredCallFlags { get; } public ContractMethodAttribute(long price, CallFlags requiredCallFlags) { this.Price = price; this.RequiredCallFlags = requiredCallFlags; } } }
28.157895
96
0.665421
[ "MIT" ]
Qiao-Jin/neo
src/neo/SmartContract/Native/ContractMethodAttribute.cs
535
C#
/************************************************************************************* Extended WPF Toolkit Copyright (C) 2007-2013 Xceed Software Inc. This program is provided to you under the terms of the Microsoft Public License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license For more features, controls, and fast professional support, pick up the Plus Edition at http://xceed.com/wpf_toolkit Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids ***********************************************************************************/ using System; using System.Diagnostics; using System.Globalization; using System.Text; using System.Linq.Expressions; namespace Xceed.Wpf.DataGrid.FilterCriteria { [CriterionDescriptor( "<@", FilterOperatorPrecedence.RelationalOperator, FilterTokenPriority.RelationalOperator )] [DebuggerDisplay( "LessThan( {Value} )" )] public class LessThanFilterCriterion : RelationalFilterCriterion { public LessThanFilterCriterion() : base() { } public LessThanFilterCriterion( object value ) : base( value ) { } public override string ToExpression( CultureInfo culture ) { string strValue = this.GetValueForExpression( culture ); return ( strValue == null ) ? "" : "<" + strValue; } public override System.Linq.Expressions.Expression ToLinqExpression( System.Linq.IQueryable queryable, ParameterExpression parameterExpression, string propertyName ) { if( queryable == null ) throw new ArgumentNullException( "queryable" ); if( parameterExpression == null ) throw new ArgumentNullException( "parameterExpression" ); if( String.IsNullOrEmpty( propertyName ) ) { if( propertyName == null ) throw new ArgumentNullException( "propertyName" ); throw new ArgumentException( "PropertyName must not be empty.", "propertyName" ); } return queryable.CreateLesserThanExpression( parameterExpression, propertyName, this.Value ); } public override bool IsMatch( object value ) { return ( this.Compare( value ) == CompareResult.LessThan ); } #if DEBUG public override string ToString() { StringBuilder stringBuilder = new StringBuilder( "LessThan( " ); stringBuilder.Append( ( this.Value == null ) ? "#NULL#" : this.Value.ToString() ); stringBuilder.Append( " )" ); return stringBuilder.ToString(); } #endif } }
31.135802
169
0.645519
[ "MIT" ]
DavosLi0bnip/daranguizu
Others/Xceed.Wpf/Xceed.Wpf.DataGrid/FilterCriteria/LessThanFilterCriterion.cs
2,524
C#
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System; using System.Runtime.InteropServices; namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty { // P/Invoke and marshalling attribute tests public class PInvoke { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 2)] public struct MarshalAsTest { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] FixedArray; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.Bool)] public int[] FixedBoolArray; [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] public string[] SafeBStrArray; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] public string FixedString; } [StructLayout(LayoutKind.Explicit)] public struct Rect { [FieldOffset(0)] public int left; [FieldOffset(4)] public int top; [FieldOffset(8)] public int right; [FieldOffset(12)] public int bottom; } public static decimal MarshalAttributesOnPropertyAccessors { [return: MarshalAs(UnmanagedType.Currency)] get { throw new NotImplementedException(); } [param: MarshalAs(UnmanagedType.Currency)] set { } } [DllImport("xyz.dll", CharSet = CharSet.Auto)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool Method([MarshalAs(UnmanagedType.LPStr)] string input); [DllImport("xyz.dll")] private static extern void New1(int ElemCnt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] int[] ar); [DllImport("xyz.dll")] private static extern void New2([MarshalAs(UnmanagedType.LPArray, SizeConst = 128)] int[] ar); [DllImport("xyz.dll")] private static extern void New3([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Bool, SizeConst = 64, SizeParamIndex = 1)] int[] ar); [DllImport("xyz.dll")] private static extern void New4([MarshalAs(UnmanagedType.LPArray)] int[] ar); public void CustomMarshal1([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "MyCompany.MyMarshaler")] object o) { } public void CustomMarshal2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "MyCompany.MyMarshaler", MarshalCookie = "Cookie")] object o) { } [DllImport("ws2_32.dll", SetLastError = true)] internal static extern IntPtr ioctlsocket([In] IntPtr socketHandle, [In] int cmd, [In] [Out] ref int argp); public void CallMethodWithInOutParameter() { int num = 0; PInvoke.ioctlsocket(IntPtr.Zero, 0, ref num); } } }
35.91
150
0.741576
[ "MIT" ]
nguyenthiennam1992/Decompiler
ILSpy-master/ICSharpCode.Decompiler.Tests/TestCases/Pretty/PInvoke.cs
3,593
C#
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using GitHub.Models; using GitHub.VisualStudio; using Microsoft.Win32; using System.IO; namespace GitHub.TeamFoundation { internal class RegistryHelper { const string TEGitKey = @"Software\Microsoft\VisualStudio\14.0\TeamFoundation\GitSourceControl"; static RegistryKey OpenGitKey(string path) { return Microsoft.Win32.Registry.CurrentUser.OpenSubKey(TEGitKey + "\\" + path, true); } internal static IEnumerable<ILocalRepositoryModel> PokeTheRegistryForRepositoryList() { using (var key = OpenGitKey("Repositories")) { return key.GetSubKeyNames().Select(x => { using (var subkey = key.OpenSubKey(x)) { try { var path = subkey?.GetValue("Path") as string; if (path != null && Directory.Exists(path)) return new LocalRepositoryModel(path); } catch (Exception) { // no sense spamming the log, the registry might have ton of stale things we don't care about } return null; } }) .Where(x => x != null) .ToList(); } } internal static string PokeTheRegistryForLocalClonePath() { using (var key = OpenGitKey("General")) { return (string)key?.GetValue("DefaultRepositoryPath", string.Empty, RegistryValueOptions.DoNotExpandEnvironmentNames); } } const string NewProjectDialogKeyPath = @"Software\Microsoft\VisualStudio\14.0\NewProjectDialog"; const string MRUKeyPath = "MRUSettingsLocalProjectLocationEntries"; internal static string SetDefaultProjectPath(string path) { var old = String.Empty; try { var newProjectKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(NewProjectDialogKeyPath, true) ?? Microsoft.Win32.Registry.CurrentUser.CreateSubKey(NewProjectDialogKeyPath); Debug.Assert(newProjectKey != null, string.Format(CultureInfo.CurrentCulture, "Could not open or create registry key '{0}'", NewProjectDialogKeyPath)); using (newProjectKey) { var mruKey = newProjectKey.OpenSubKey(MRUKeyPath, true) ?? Microsoft.Win32.Registry.CurrentUser.CreateSubKey(MRUKeyPath); Debug.Assert(mruKey != null, string.Format(CultureInfo.CurrentCulture, "Could not open or create registry key '{0}'", MRUKeyPath)); using (mruKey) { // is this already the default path? bail old = (string)mruKey.GetValue("Value0", string.Empty, RegistryValueOptions.DoNotExpandEnvironmentNames); if (String.Equals(path.TrimEnd('\\'), old.TrimEnd('\\'), StringComparison.CurrentCultureIgnoreCase)) return old; // grab the existing list of recent paths, throwing away the last one var numEntries = (int)mruKey.GetValue("MaximumEntries", 5); var entries = new List<string>(numEntries); for (int i = 0; i < numEntries - 1; i++) { var val = (string)mruKey.GetValue("Value" + i, String.Empty, RegistryValueOptions.DoNotExpandEnvironmentNames); if (!String.IsNullOrEmpty(val)) entries.Add(val); } newProjectKey.SetValue("LastUsedNewProjectPath", path); mruKey.SetValue("Value0", path); // bump list of recent paths one entry down for (int i = 0; i < entries.Count; i++) mruKey.SetValue("Value" + (i + 1), entries[i]); } } } catch (Exception ex) { VsOutputLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, "Error setting the create project path in the registry '{0}'", ex)); } return old; } } }
44.074766
167
0.53011
[ "MIT" ]
karimkkanji/VisualStudio
src/GitHub.TeamFoundation.14/RegistryHelper.cs
4,718
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- namespace Microsoft.WindowsAzure.Management.Store.Test.UnitTests.Cmdlet { using System; using System.Collections.Generic; using System.Management.Automation; using Microsoft.WindowsAzure.Management.Store.Cmdlet; using Microsoft.WindowsAzure.Management.Store.MarketplaceServiceReference; using Microsoft.WindowsAzure.Management.Store.Model; using Microsoft.WindowsAzure.Management.Store.Model.ResourceModel; using Microsoft.WindowsAzure.Management.Test.Stubs; using Microsoft.WindowsAzure.Management.Test.Tests.Utilities; using Microsoft.WindowsAzure.ServiceManagement; using Moq; using VisualStudio.TestTools.UnitTesting; [TestClass] public class GetAzureStoreAddOnTests : TestBase { Mock<ICommandRuntime> mockCommandRuntime; Mock<StoreClient> mockStoreClient; Mock<IServiceManagement> mockServiceManagementChannel; Mock<MarketplaceClient> mockMarketplaceClient; GetAzureStoreAddOnCommand cmdlet; [TestInitialize] public void SetupTest() { Management.Extensions.CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager(); new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings(); mockCommandRuntime = new Mock<ICommandRuntime>(); mockStoreClient = new Mock<StoreClient>(); mockMarketplaceClient = new Mock<MarketplaceClient>(); mockServiceManagementChannel = new Mock<IServiceManagement>(); cmdlet = new GetAzureStoreAddOnCommand() { StoreClient = mockStoreClient.Object, CommandRuntime = mockCommandRuntime.Object, Channel = mockServiceManagementChannel.Object, MarketplaceClient = mockMarketplaceClient.Object }; } [TestMethod] public void GetAzureStoreAddOnAvailableAddOnsSuccessfull() { // Setup List<WindowsAzureOffer> actualWindowsAzureOffers = new List<WindowsAzureOffer>(); mockCommandRuntime.Setup(f => f.WriteObject(It.IsAny<object>(), true)) .Callback<object, bool>((o, b) => actualWindowsAzureOffers = (List<WindowsAzureOffer>)o); List<Plan> plans = new List<Plan>(); plans.Add(new Plan() { PlanIdentifier = "Bronze" }); plans.Add(new Plan() { PlanIdentifier = "Silver" }); plans.Add(new Plan() { PlanIdentifier = "Gold" }); plans.Add(new Plan() { PlanIdentifier = "Silver" }); plans.Add(new Plan() { PlanIdentifier = "Gold" }); List<Offer> expectedOffers = new List<Offer>() { new Offer() { ProviderIdentifier = "Microsoft", OfferIdentifier = "Bing Translate", ProviderId = new Guid("f8ede0df-591f-4722-b646-e5eb86f0ae52") }, new Offer() { ProviderIdentifier = "NotExistingCompany", OfferIdentifier = "Not Existing Name", ProviderId = new Guid("723138c2-0676-4bf6-80d4-0af31479dac4")}, new Offer() { ProviderIdentifier = "OneSDKCompany", OfferIdentifier = "Windows Azure PowerShell", ProviderId = new Guid("1441f7f7-33a1-4dcf-aeea-8ed8bc1b2e3d") } }; List<WindowsAzureOffer> expectedWindowsAzureOffers = new List<WindowsAzureOffer>(); expectedOffers.ForEach(o => expectedWindowsAzureOffers.Add(new WindowsAzureOffer( o, plans, new List<string>() { "West US", "East US" }))); mockMarketplaceClient.Setup(f => f.GetAvailableWindowsAzureOffers(It.IsAny<string>())) .Returns(expectedWindowsAzureOffers); mockMarketplaceClient.Setup(f => f.IsKnownProvider(It.IsAny<Guid>())).Returns(true); mockServiceManagementChannel.Setup( f => f.BeginListLocations(It.IsAny<string>(), It.IsAny<AsyncCallback>(), It.IsAny<object>())); mockServiceManagementChannel.Setup(f => f.EndListLocations(It.IsAny<IAsyncResult>())) .Returns(new LocationList() { new Location() { Name = "West US" }, new Location() { Name = "East US" } }); cmdlet.ListAvailable = true; // Test cmdlet.ExecuteCmdlet(); // Assert mockMarketplaceClient.Verify(f => f.GetAvailableWindowsAzureOffers(null), Times.Once()); CollectionAssert.AreEquivalent(expectedWindowsAzureOffers, actualWindowsAzureOffers); } [TestMethod] public void GetAzureStoreAddOnWithEmptyCloudService() { // Setup List<WindowsAzureAddOn> expected = new List<WindowsAzureAddOn>(); mockStoreClient.Setup(f => f.GetAddOn(It.IsAny<AddOnSearchOptions>())).Returns(expected); // Test cmdlet.ExecuteCmdlet(); // Assert mockStoreClient.Verify(f => f.GetAddOn(new AddOnSearchOptions(null, null, null)), Times.Once()); mockCommandRuntime.Verify(f => f.WriteObject(expected, true), Times.Once()); } [TestMethod] public void GetAzureStoreAddOnWithoutSearchOptions() { // Setup List<WindowsAzureAddOn> expected = new List<WindowsAzureAddOn>() { new WindowsAzureAddOn(new Resource() { Name = "BingSearchAddOn" }, "West US", "StoreCloudService"), new WindowsAzureAddOn(new Resource() { Name = "BingTranslateAddOn" }, "West US", "StoreCloudService") }; mockCommandRuntime.Setup(f => f.WriteObject(It.IsAny<object>(), true)); mockStoreClient.Setup(f => f.GetAddOn(It.IsAny<AddOnSearchOptions>())).Returns(expected); // Test cmdlet.ExecuteCmdlet(); // Assert mockStoreClient.Verify(f => f.GetAddOn(new AddOnSearchOptions(null, null, null)), Times.Once()); mockCommandRuntime.Verify(f => f.WriteObject(expected, true), Times.Once()); } [TestMethod] public void GetAzureStoreAddOnWithNameFilter() { // Setup List<WindowsAzureAddOn> expected = new List<WindowsAzureAddOn>() { new WindowsAzureAddOn(new Resource() { Name = "BingTranslateAddOn" }, "West US", "StoreCloudService") }; mockCommandRuntime.Setup(f => f.WriteObject(It.IsAny<object>(), true)); mockStoreClient.Setup(f => f.GetAddOn(new AddOnSearchOptions("BingTranslateAddOn", null, null))) .Returns(expected); cmdlet.Name = "BingTranslateAddOn"; // Test cmdlet.ExecuteCmdlet(); // Assert mockStoreClient.Verify( f => f.GetAddOn(new AddOnSearchOptions("BingTranslateAddOn", null, null)), Times.Once()); mockCommandRuntime.Verify(f => f.WriteObject(expected, true), Times.Once()); } } }
46.223529
117
0.614787
[ "Apache-2.0" ]
OctopusDeploy/azure-sdk-tools
WindowsAzurePowershell/src/Management.Store.Test/UnitTests/Cmdlet/GetAzureStoreAddOnTest.cs
7,860
C#
using Heimdall.Core.Commands; using Heimdall.Mongo.Infrastructure; using LibCore.CQRS.Validation; using System; using System.Linq; using System.Threading.Tasks; namespace Heimdall.Mongo.Commands.Validation { public class AddEndpointValidator : Validator<AddEndpoint> { private IDbContext _db; public AddEndpointValidator(IDbContext db) { _db = db ?? throw new ArgumentNullException(nameof(db)); } protected override async Task RunAsync(AddEndpoint command) { var service = await _db.Services.FindOneAsync(s => s.Id == command.ServiceId); if (null == service) { base.AddError(new ValidationError("service", $"Unable to load service by id: '{command.ServiceId}'")); return; } if (null == service.Endpoints || !service.Endpoints.Any()) return; if (service.Endpoints.Any(e => e.Id == command.EndpointId)) base.AddError(new ValidationError("endpoint", $"endpoint with Id '{command.EndpointId}' already exists on service '{command.ServiceId}'")); if (service.Endpoints.Any(e => e.Address == command.Address && e.Protocol == command.Protocol)) base.AddError(new ValidationError("endpoint", $"endpoint '{command.Address}' already exists on service '{command.ServiceId}'")); } } }
36.538462
156
0.625965
[ "MIT" ]
mizrael/heimdall
Heimdall.Mongo/Commands/Validation/AddEndpointValidator.cs
1,427
C#
using System; using System.IO; using System.Collections; using ILRuntime.Reflection; #if FEAT_IKVM using Type = IKVM.Reflection.Type; using IKVM.Reflection; #else using System.Reflection; #endif namespace ProtoBuf.Meta { /// <summary> /// Provides protobuf serialization support for a number of types /// </summary> public abstract class TypeModel { #if WINRT || COREFX internal TypeInfo MapType(TypeInfo type) { return type; } #endif /// <summary> /// Should the <c>Kind</c> be included on date/time values? /// </summary> protected internal virtual bool SerializeDateTimeKind() { return false; } /// <summary> /// Resolve a System.Type to the compiler-specific type /// </summary> protected internal Type MapType(System.Type type) { return MapType(type, true); } /// <summary> /// Resolve a System.Type to the compiler-specific type /// </summary> protected internal virtual Type MapType(System.Type type, bool demand) { #if FEAT_IKVM throw new NotSupportedException(); // this should come from RuntimeTypeModel! #else return type; #endif } private WireType GetWireType(ProtoTypeCode code, DataFormat format, ref Type type, out int modelKey) { modelKey = -1; if (Helpers.IsEnum(type)) { modelKey = GetKey(ref type); return WireType.Variant; } switch (code) { case ProtoTypeCode.Int64: case ProtoTypeCode.UInt64: return format == DataFormat.FixedSize ? WireType.Fixed64 : WireType.Variant; case ProtoTypeCode.Int16: case ProtoTypeCode.Int32: case ProtoTypeCode.UInt16: case ProtoTypeCode.UInt32: case ProtoTypeCode.Boolean: case ProtoTypeCode.SByte: case ProtoTypeCode.Byte: case ProtoTypeCode.Char: return format == DataFormat.FixedSize ? WireType.Fixed32 : WireType.Variant; case ProtoTypeCode.Double: return WireType.Fixed64; case ProtoTypeCode.Single: return WireType.Fixed32; case ProtoTypeCode.String: case ProtoTypeCode.DateTime: case ProtoTypeCode.Decimal: case ProtoTypeCode.ByteArray: case ProtoTypeCode.TimeSpan: case ProtoTypeCode.Guid: case ProtoTypeCode.Uri: return WireType.String; } if ((modelKey = GetKey(ref type)) >= 0) { return WireType.String; } return WireType.None; } #if !FEAT_IKVM /// <summary> /// This is the more "complete" version of Serialize, which handles single instances of mapped types. /// The value is written as a complete field, including field-header and (for sub-objects) a /// length-prefix /// In addition to that, this provides support for: /// - basic values; individual int / string / Guid / etc /// - IEnumerable sequences of any type handled by TrySerializeAuxiliaryType /// /// </summary> internal bool TrySerializeAuxiliaryType(ProtoWriter writer, Type type, DataFormat format, int tag, object value, bool isInsideList, object parentList) { if (type == null) { type = value.GetType(); } ProtoTypeCode typecode = Helpers.GetTypeCode(type); // note the "ref type" here normalizes against proxies int modelKey; WireType wireType = GetWireType(typecode, format, ref type, out modelKey); if (modelKey >= 0) { // write the header, but defer to the model if (Helpers.IsEnum(type)) { // no header Serialize(modelKey, value, writer); return true; } else { ProtoWriter.WriteFieldHeader(tag, wireType, writer); switch (wireType) { case WireType.None: throw ProtoWriter.CreateException(writer); case WireType.StartGroup: case WireType.String: // needs a wrapping length etc SubItemToken token = ProtoWriter.StartSubItem(value, writer); Serialize(modelKey, value, writer); ProtoWriter.EndSubItem(token, writer); return true; default: Serialize(modelKey, value, writer); return true; } } } if(wireType != WireType.None) { ProtoWriter.WriteFieldHeader(tag, wireType, writer); } switch(typecode) { case ProtoTypeCode.Int16: ProtoWriter.WriteInt16((short)value, writer); return true; case ProtoTypeCode.Int32: ProtoWriter.WriteInt32((int)value, writer); return true; case ProtoTypeCode.Int64: ProtoWriter.WriteInt64((long)value, writer); return true; case ProtoTypeCode.UInt16: ProtoWriter.WriteUInt16((ushort)value, writer); return true; case ProtoTypeCode.UInt32: ProtoWriter.WriteUInt32((uint)value, writer); return true; case ProtoTypeCode.UInt64: ProtoWriter.WriteUInt64((ulong)value, writer); return true; case ProtoTypeCode.Boolean: ProtoWriter.WriteBoolean((bool)value, writer); return true; case ProtoTypeCode.SByte: ProtoWriter.WriteSByte((sbyte)value, writer); return true; case ProtoTypeCode.Byte: ProtoWriter.WriteByte((byte)value, writer); return true; case ProtoTypeCode.Char: ProtoWriter.WriteUInt16((ushort)(char)value, writer); return true; case ProtoTypeCode.Double: ProtoWriter.WriteDouble((double)value, writer); return true; case ProtoTypeCode.Single: ProtoWriter.WriteSingle((float)value, writer); return true; case ProtoTypeCode.DateTime: if (SerializeDateTimeKind()) BclHelpers.WriteDateTimeWithKind((DateTime)value, writer); else BclHelpers.WriteDateTime((DateTime)value, writer); return true; case ProtoTypeCode.Decimal: BclHelpers.WriteDecimal((decimal)value, writer); return true; case ProtoTypeCode.String: ProtoWriter.WriteString((string)value, writer); return true; case ProtoTypeCode.ByteArray: ProtoWriter.WriteBytes((byte[])value, writer); return true; case ProtoTypeCode.TimeSpan: BclHelpers.WriteTimeSpan((TimeSpan)value, writer); return true; case ProtoTypeCode.Guid: BclHelpers.WriteGuid((Guid)value, writer); return true; case ProtoTypeCode.Uri: ProtoWriter.WriteString(((Uri)value).OriginalString, writer); return true; } // by now, we should have covered all the simple cases; if we wrote a field-header, we have // forgotten something! Helpers.DebugAssert(wireType == WireType.None); // now attempt to handle sequences (including arrays and lists) if (value is IEnumerable) { var sequence = value as IEnumerable; if (isInsideList) throw CreateNestedListsNotSupported(parentList?.GetType()); foreach (object item in sequence) { if (item == null) { throw new NullReferenceException(); } if (!TrySerializeAuxiliaryType(writer, null, format, tag, item, true, sequence)) { ThrowUnexpectedType(item.GetType()); } } return true; } return false; } private void SerializeCore(ProtoWriter writer, object value) { SerializeCore(writer, PType.GetPType(value), value); } private void SerializeCore(ProtoWriter writer, Type type, object value) { if (value == null) throw new ArgumentNullException("value"); int key = GetKey(ref type); if (key >= 0) { Serialize(key, value, writer); } else if (!TrySerializeAuxiliaryType(writer, type, DataFormat.Default, Serializer.ListItemTag, value, false, null)) { ThrowUnexpectedType(type); } } #endif /// <summary> /// Writes a protocol-buffer representation of the given instance to the supplied stream. /// </summary> /// <param name="value">The existing instance to be serialized (cannot be null).</param> /// <param name="dest">The destination stream to write to.</param> public void Serialize(Stream dest, object value) { Serialize(dest, value, null); } /// <summary> /// Writes a protocol-buffer representation of the given instance to the supplied stream. /// </summary> /// <param name="value">The existing instance to be serialized (cannot be null).</param> /// <param name="dest">The destination stream to write to.</param> /// <param name="context">Additional information about this serialization operation.</param> public void Serialize(Stream dest, object value, SerializationContext context) { #if FEAT_IKVM throw new NotSupportedException(); #else using (ProtoWriter writer = new ProtoWriter(dest, this, context)) { writer.SetRootObject(value); SerializeCore(writer, value); writer.Close(); } #endif } /// <summary> /// Writes a protocol-buffer representation of the given instance to the supplied writer. /// </summary> /// <param name="value">The existing instance to be serialized (cannot be null).</param> /// <param name="dest">The destination writer to write to.</param> public void Serialize(ProtoWriter dest, object value) { #if FEAT_IKVM throw new NotSupportedException(); #else if (dest == null) throw new ArgumentNullException("dest"); dest.CheckDepthFlushlock(); dest.SetRootObject(value); SerializeCore(dest, value); dest.CheckDepthFlushlock(); ProtoWriter.Flush(dest); #endif } /// <summary> /// Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed /// data - useful with network IO. /// </summary> /// <param name="type">The type being merged.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="style">How to encode the length prefix.</param> /// <param name="fieldNumber">The tag used as a prefix to each record (only used with base-128 style prefixes).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object DeserializeWithLengthPrefix(Stream source, object value, Type type, PrefixStyle style, int fieldNumber){ long bytesRead; return DeserializeWithLengthPrefix(source, value, type, style, fieldNumber, null, out bytesRead); } /// <summary> /// Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed /// data - useful with network IO. /// </summary> /// <param name="type">The type being merged.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="style">How to encode the length prefix.</param> /// <param name="expectedField">The tag used as a prefix to each record (only used with base-128 style prefixes).</param> /// <param name="resolver">Used to resolve types on a per-field basis.</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object DeserializeWithLengthPrefix(Stream source, object value, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver){ long bytesRead; return DeserializeWithLengthPrefix(source, value, type, style, expectedField, resolver, out bytesRead); } /// <summary> /// Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed /// data - useful with network IO. /// </summary> /// <param name="type">The type being merged.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="style">How to encode the length prefix.</param> /// <param name="expectedField">The tag used as a prefix to each record (only used with base-128 style prefixes).</param> /// <param name="resolver">Used to resolve types on a per-field basis.</param> /// <param name="bytesRead">Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object DeserializeWithLengthPrefix(Stream source, object value, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, out int bytesRead) { long bytesRead64; bool haveObject; object result = DeserializeWithLengthPrefix(source, value, type, style, expectedField, resolver, out bytesRead64, out haveObject, null); bytesRead = checked((int)bytesRead64); return result; } /// <summary> /// Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed /// data - useful with network IO. /// </summary> /// <param name="type">The type being merged.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="style">How to encode the length prefix.</param> /// <param name="expectedField">The tag used as a prefix to each record (only used with base-128 style prefixes).</param> /// <param name="resolver">Used to resolve types on a per-field basis.</param> /// <param name="bytesRead">Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object DeserializeWithLengthPrefix(Stream source, object value, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, out long bytesRead) { bool haveObject; return DeserializeWithLengthPrefix(source, value, type, style, expectedField, resolver, out bytesRead, out haveObject, null); } private object DeserializeWithLengthPrefix(Stream source, object value, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, out long bytesRead, out bool haveObject, SerializationContext context) { #if FEAT_IKVM throw new NotSupportedException(); #else haveObject = false; bool skip; long len; bytesRead = 0; if (type == null && (style != PrefixStyle.Base128 || resolver == null)) { throw new InvalidOperationException("A type must be provided unless base-128 prefixing is being used in combination with a resolver"); } do { bool expectPrefix = expectedField > 0 || resolver != null; int actualField; int tmpBytesRead; len = ProtoReader.ReadLongLengthPrefix(source, expectPrefix, style, out actualField, out tmpBytesRead); if (tmpBytesRead == 0) return value; bytesRead += tmpBytesRead; if (len < 0) return value; switch (style) { case PrefixStyle.Base128: if (expectPrefix && expectedField == 0 && type == null && resolver != null) { type = resolver(actualField); skip = type == null; } else { skip = expectedField != actualField; } break; default: skip = false; break; } if (skip) { if (len == long.MaxValue) throw new InvalidOperationException(); ProtoReader.Seek(source, len, null); bytesRead += len; } } while (skip); ProtoReader reader = null; try { reader = ProtoReader.Create(source, this, context, len); int key = GetKey(ref type); if (key >= 0 && !Helpers.IsEnum(type)) { value = Deserialize(key, value, reader); } else { if (!(TryDeserializeAuxiliaryType(reader, DataFormat.Default, Serializer.ListItemTag, type, ref value, true, false, true, false, null) || len == 0)) { TypeModel.ThrowUnexpectedType(type); // throws } } bytesRead += reader.LongPosition; haveObject = true; return value; } finally { ProtoReader.Recycle(reader); } #endif } /// <summary> /// Reads a sequence of consecutive length-prefixed items from a stream, using /// either base-128 or fixed-length prefixes. Base-128 prefixes with a tag /// are directly comparable to serializing multiple items in succession /// (use the <see cref="Serializer.ListItemTag"/> tag to emulate the implicit behavior /// when serializing a list/array). When a tag is /// specified, any records with different tags are silently omitted. The /// tag is ignored. The tag is ignores for fixed-length prefixes. /// </summary> /// <param name="source">The binary stream containing the serialized records.</param> /// <param name="style">The prefix style used in the data.</param> /// <param name="expectedField">The tag of records to return (if non-positive, then no tag is /// expected and all records are returned).</param> /// <param name="resolver">On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). </param> /// <param name="type">The type of object to deserialize (can be null if "resolver" is specified).</param> /// <returns>The sequence of deserialized objects.</returns> public System.Collections.IEnumerable DeserializeItems(System.IO.Stream source, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver) { return DeserializeItems(source, type, style, expectedField, resolver, null); } /// <summary> /// Reads a sequence of consecutive length-prefixed items from a stream, using /// either base-128 or fixed-length prefixes. Base-128 prefixes with a tag /// are directly comparable to serializing multiple items in succession /// (use the <see cref="Serializer.ListItemTag"/> tag to emulate the implicit behavior /// when serializing a list/array). When a tag is /// specified, any records with different tags are silently omitted. The /// tag is ignored. The tag is ignores for fixed-length prefixes. /// </summary> /// <param name="source">The binary stream containing the serialized records.</param> /// <param name="style">The prefix style used in the data.</param> /// <param name="expectedField">The tag of records to return (if non-positive, then no tag is /// expected and all records are returned).</param> /// <param name="resolver">On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). </param> /// <param name="type">The type of object to deserialize (can be null if "resolver" is specified).</param> /// <returns>The sequence of deserialized objects.</returns> /// <param name="context">Additional information about this serialization operation.</param> public System.Collections.IEnumerable DeserializeItems(System.IO.Stream source, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, SerializationContext context) { return new DeserializeItemsIterator(this, source, type, style, expectedField, resolver, context); } #if !NO_GENERICS /// <summary> /// Reads a sequence of consecutive length-prefixed items from a stream, using /// either base-128 or fixed-length prefixes. Base-128 prefixes with a tag /// are directly comparable to serializing multiple items in succession /// (use the <see cref="Serializer.ListItemTag"/> tag to emulate the implicit behavior /// when serializing a list/array). When a tag is /// specified, any records with different tags are silently omitted. The /// tag is ignored. The tag is ignores for fixed-length prefixes. /// </summary> /// <typeparam name="T">The type of object to deserialize.</typeparam> /// <param name="source">The binary stream containing the serialized records.</param> /// <param name="style">The prefix style used in the data.</param> /// <param name="expectedField">The tag of records to return (if non-positive, then no tag is /// expected and all records are returned).</param> /// <returns>The sequence of deserialized objects.</returns> public System.Collections.Generic.IEnumerable<T> DeserializeItems<T>(Stream source, PrefixStyle style, int expectedField) { return DeserializeItems<T>(source, style, expectedField, null); } /// <summary> /// Reads a sequence of consecutive length-prefixed items from a stream, using /// either base-128 or fixed-length prefixes. Base-128 prefixes with a tag /// are directly comparable to serializing multiple items in succession /// (use the <see cref="Serializer.ListItemTag"/> tag to emulate the implicit behavior /// when serializing a list/array). When a tag is /// specified, any records with different tags are silently omitted. The /// tag is ignored. The tag is ignores for fixed-length prefixes. /// </summary> /// <typeparam name="T">The type of object to deserialize.</typeparam> /// <param name="source">The binary stream containing the serialized records.</param> /// <param name="style">The prefix style used in the data.</param> /// <param name="expectedField">The tag of records to return (if non-positive, then no tag is /// expected and all records are returned).</param> /// <returns>The sequence of deserialized objects.</returns> /// <param name="context">Additional information about this serialization operation.</param> public System.Collections.Generic.IEnumerable<T> DeserializeItems<T>(Stream source, PrefixStyle style, int expectedField, SerializationContext context) { return new DeserializeItemsIterator<T>(this, source, style, expectedField, context); } private sealed class DeserializeItemsIterator<T> : DeserializeItemsIterator, System.Collections.Generic.IEnumerator<T>, System.Collections.Generic.IEnumerable<T> { System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { return this; } public new T Current { get { return (T)base.Current; } } void IDisposable.Dispose() { } public DeserializeItemsIterator(TypeModel model, Stream source, PrefixStyle style, int expectedField, SerializationContext context) : base(model, source, model.MapType(typeof(T)), style, expectedField, null, context) { } } #endif private class DeserializeItemsIterator : IEnumerator, IEnumerable { IEnumerator IEnumerable.GetEnumerator() { return this; } private bool haveObject; private object current; public bool MoveNext() { if (haveObject) { long bytesRead; current = model.DeserializeWithLengthPrefix(source, null, type, style, expectedField, resolver, out bytesRead, out haveObject, context); } return haveObject; } void IEnumerator.Reset() { throw new NotSupportedException(); } public object Current { get { return current; } } private readonly Stream source; private readonly Type type; private readonly PrefixStyle style; private readonly int expectedField; private readonly Serializer.TypeResolver resolver; private readonly TypeModel model; private readonly SerializationContext context; public DeserializeItemsIterator(TypeModel model, Stream source, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, SerializationContext context) { haveObject = true; this.source = source; this.type = type; this.style = style; this.expectedField = expectedField; this.resolver = resolver; this.model = model; this.context = context; } } /// <summary> /// Writes a protocol-buffer representation of the given instance to the supplied stream, /// with a length-prefix. This is useful for socket programming, /// as DeserializeWithLengthPrefix can be used to read the single object back /// from an ongoing stream. /// </summary> /// <param name="type">The type being serialized.</param> /// <param name="value">The existing instance to be serialized (cannot be null).</param> /// <param name="style">How to encode the length prefix.</param> /// <param name="dest">The destination stream to write to.</param> /// <param name="fieldNumber">The tag used as a prefix to each record (only used with base-128 style prefixes).</param> public void SerializeWithLengthPrefix(Stream dest, object value, Type type, PrefixStyle style, int fieldNumber) { SerializeWithLengthPrefix(dest, value, type, style, fieldNumber, null); } /// <summary> /// Writes a protocol-buffer representation of the given instance to the supplied stream, /// with a length-prefix. This is useful for socket programming, /// as DeserializeWithLengthPrefix can be used to read the single object back /// from an ongoing stream. /// </summary> /// <param name="type">The type being serialized.</param> /// <param name="value">The existing instance to be serialized (cannot be null).</param> /// <param name="style">How to encode the length prefix.</param> /// <param name="dest">The destination stream to write to.</param> /// <param name="fieldNumber">The tag used as a prefix to each record (only used with base-128 style prefixes).</param> /// <param name="context">Additional information about this serialization operation.</param> public void SerializeWithLengthPrefix(Stream dest, object value, Type type, PrefixStyle style, int fieldNumber, SerializationContext context) { if (type == null) { if(value == null) throw new ArgumentNullException("value"); type = MapType(value.GetType()); } int key = GetKey(ref type); using (ProtoWriter writer = new ProtoWriter(dest, this, context)) { switch (style) { case PrefixStyle.None: Serialize(key, value, writer); break; case PrefixStyle.Base128: case PrefixStyle.Fixed32: case PrefixStyle.Fixed32BigEndian: ProtoWriter.WriteObject(value, key, writer, style, fieldNumber); break; default: throw new ArgumentOutOfRangeException("style"); } writer.Close(); } } /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object Deserialize(Stream source, object value, System.Type type) { return Deserialize(source, value, type, null); } /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> /// <param name="context">Additional information about this serialization operation.</param> public object Deserialize(Stream source, object value, System.Type type, SerializationContext context) { #if FEAT_IKVM throw new NotSupportedException(); #else bool autoCreate = PrepareDeserialize(value, ref type); ProtoReader reader = null; try { reader = ProtoReader.Create(source, this, context, ProtoReader.TO_EOF); if (value != null) reader.SetRootObject(value); object obj = DeserializeCore(reader, type, value, autoCreate); reader.CheckFullyConsumed(); return obj; } finally { ProtoReader.Recycle(reader); } #endif } private bool PrepareDeserialize(object value, ref Type type) { if (type == null) { if (value == null) { throw new ArgumentNullException("type"); } else { type = MapType(value.GetType()); } } bool autoCreate = true; #if !NO_GENERICS Type underlyingType = Helpers.GetUnderlyingType(type); if (underlyingType != null) { type = underlyingType; autoCreate = false; } #endif return autoCreate; } /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="length">The number of bytes to consume.</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object Deserialize(Stream source, object value, System.Type type, int length) => Deserialize(source, value, type, length, null); /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="length">The number of bytes to consume.</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object Deserialize(Stream source, object value, System.Type type, long length) => Deserialize(source, value, type, length, null); /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="length">The number of bytes to consume (or -1 to read to the end of the stream).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> /// <param name="context">Additional information about this serialization operation.</param> public object Deserialize(Stream source, object value, System.Type type, int length, SerializationContext context) => Deserialize(source, value, type, length == int.MaxValue ? long.MaxValue : (long)length, context); /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <param name="length">The number of bytes to consume (or -1 to read to the end of the stream).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> /// <param name="context">Additional information about this serialization operation.</param> public object Deserialize(Stream source, object value, System.Type type, long length, SerializationContext context) { #if FEAT_IKVM throw new NotSupportedException(); #else bool autoCreate = PrepareDeserialize(value, ref type); ProtoReader reader = null; try { reader = ProtoReader.Create(source, this, context, length); if (value != null) reader.SetRootObject(value); object obj = DeserializeCore(reader, type, value, autoCreate); reader.CheckFullyConsumed(); return obj; } finally { ProtoReader.Recycle(reader); } #endif } /// <summary> /// Applies a protocol-buffer reader to an existing instance (which may be null). /// </summary> /// <param name="type">The type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The reader to apply to the instance (cannot be null).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> public object Deserialize(ProtoReader source, object value, System.Type type) { #if FEAT_IKVM throw new NotSupportedException(); #else if (source == null) throw new ArgumentNullException("source"); bool autoCreate = PrepareDeserialize(value, ref type); if (value != null) source.SetRootObject(value); object obj = DeserializeCore(source, type, value, autoCreate); source.CheckFullyConsumed(); return obj; #endif } #if !FEAT_IKVM private object DeserializeCore(ProtoReader reader, Type type, object value, bool noAutoCreate) { int key = GetKey(ref type); if (key >= 0 && !Helpers.IsEnum(type)) { return Deserialize(key, value, reader); } // this returns true to say we actively found something, but a value is assigned either way (or throws) TryDeserializeAuxiliaryType(reader, DataFormat.Default, Serializer.ListItemTag, type, ref value, true, false, noAutoCreate, false, null); return value; } #endif #if WINRT || COREFX private static readonly System.Reflection.TypeInfo ilist = typeof(IList).GetTypeInfo(); #else private static readonly System.Type ilist = typeof(IList); #endif internal static MethodInfo ResolveListAdd(TypeModel model, Type listType, Type itemType, out bool isList) { #if WINRT || COREFX TypeInfo listTypeInfo = listType.GetTypeInfo(); #else Type listTypeInfo = listType; #endif isList = model.MapType(ilist).IsAssignableFrom(listTypeInfo); Type[] types = { itemType }; MethodInfo add = Helpers.GetInstanceMethod(listTypeInfo, "Add", types); #if !NO_GENERICS if (add == null) { // fallback: look for ICollection<T>'s Add(typedObject) method bool forceList = listTypeInfo.IsInterface && listTypeInfo == model.MapType(typeof(System.Collections.Generic.IEnumerable<>)).MakeGenericType(types) #if WINRT || COREFX .GetTypeInfo() #endif ; #if WINRT || COREFX TypeInfo constuctedListType = typeof(System.Collections.Generic.ICollection<>).MakeGenericType(types).GetTypeInfo(); #else Type constuctedListType = model.MapType(typeof(System.Collections.Generic.ICollection<>)).MakeGenericType(types); #endif if (forceList || constuctedListType.IsAssignableFrom(listTypeInfo)) { add = Helpers.GetInstanceMethod(constuctedListType, "Add", types); } } if (add == null) { #if WINRT || COREFX foreach (Type tmpType in listTypeInfo.ImplementedInterfaces) #else foreach (Type interfaceType in listTypeInfo.GetInterfaces()) #endif { #if WINRT || COREFX TypeInfo interfaceType = tmpType.GetTypeInfo(); #endif if (interfaceType.Name == "IProducerConsumerCollection`1" && interfaceType.IsGenericType && interfaceType.GetGenericTypeDefinition().FullName == "System.Collections.Concurrent.IProducerConsumerCollection`1") { add = Helpers.GetInstanceMethod(interfaceType, "TryAdd", types); if (add != null) break; } } } #endif if (add == null) { // fallback: look for a public list.Add(object) method types[0] = model.MapType(typeof(object)); add = Helpers.GetInstanceMethod(listTypeInfo, "Add", types); } if (add == null && isList) { // fallback: look for IList's Add(object) method add = Helpers.GetInstanceMethod(model.MapType(ilist), "Add", types); } return add; } internal static Type GetListItemType(TypeModel model, Type listType) { Helpers.DebugAssert(listType != null); #if WINRT TypeInfo listTypeInfo = listType.GetTypeInfo(); if (listType == typeof(string) || listType.IsArray || !typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(listTypeInfo)) return null; #else if (listType == model.MapType(typeof(string)) || listType.IsArray || !model.MapType(typeof(IEnumerable)).IsAssignableFrom(listType)) return null; if (listType.FullName == "System.String") return null; #endif if (listType is ILRuntimeWrapperType) { return ((ILRuntimeWrapperType)listType).CLRType.GenericArguments[0].Value.ReflectionType; } BasicList candidates = new BasicList(); #if WINRT foreach (MethodInfo method in listType.GetRuntimeMethods()) #else foreach (MethodInfo method in listType.GetMethods()) #endif { if (method.IsStatic || method.Name != "Add") continue; ParameterInfo[] parameters = method.GetParameters(); Type paramType; if (parameters.Length == 1 && !candidates.Contains(paramType = parameters[0].ParameterType)) { candidates.Add(paramType); } } string name = listType.Name; bool isQueueStack = name != null && (name.IndexOf("Queue") >= 0 || name.IndexOf("Stack") >= 0); #if !NO_GENERICS if(!isQueueStack) { TestEnumerableListPatterns(model, candidates, listType); #if WINRT foreach (Type iType in listTypeInfo.ImplementedInterfaces) { TestEnumerableListPatterns(model, candidates, iType); } #else foreach (Type iType in listType.GetInterfaces()) { TestEnumerableListPatterns(model, candidates, iType); } #endif } #endif #if WINRT // more convenient GetProperty overload not supported on all platforms foreach (PropertyInfo indexer in listType.GetRuntimeProperties()) { if (indexer.Name != "Item" || candidates.Contains(indexer.PropertyType)) continue; ParameterInfo[] args = indexer.GetIndexParameters(); if (args.Length != 1 || args[0].ParameterType != typeof(int)) continue; MethodInfo getter = indexer.GetMethod; if (getter == null || getter.IsStatic) continue; candidates.Add(indexer.PropertyType); } #else // more convenient GetProperty overload not supported on all platforms foreach (PropertyInfo indexer in listType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { if (indexer.Name != "Item" || candidates.Contains(indexer.PropertyType)) continue; ParameterInfo[] args = indexer.GetIndexParameters(); if (args.Length != 1 || args[0].ParameterType != model.MapType(typeof(int))) continue; candidates.Add(indexer.PropertyType); } #endif switch (candidates.Count) { case 0: return null; case 1: if ((Type)candidates[0] == listType) return null; // recursive return (Type)candidates[0]; case 2: if ((Type)candidates[0] != listType && CheckDictionaryAccessors(model, (Type)candidates[0], (Type)candidates[1])) return (Type)candidates[0]; if ((Type)candidates[1] != listType && CheckDictionaryAccessors(model, (Type)candidates[1], (Type)candidates[0])) return (Type)candidates[1]; break; } return null; } private static void TestEnumerableListPatterns(TypeModel model, BasicList candidates, Type iType) { #if WINRT || COREFX TypeInfo iTypeInfo = iType.GetTypeInfo(); if (iTypeInfo.IsGenericType) { Type typeDef = iTypeInfo.GetGenericTypeDefinition(); if( typeDef == model.MapType(typeof(System.Collections.Generic.IEnumerable<>)) || typeDef == model.MapType(typeof(System.Collections.Generic.ICollection<>)) || typeDef.GetTypeInfo().FullName == "System.Collections.Concurrent.IProducerConsumerCollection`1") { Type[] iTypeArgs = iTypeInfo.GenericTypeArguments; if (!candidates.Contains(iTypeArgs[0])) { candidates.Add(iTypeArgs[0]); } } } #elif !NO_GENERICS if (iType.IsGenericType) { Type typeDef = iType.GetGenericTypeDefinition(); if (typeDef == model.MapType(typeof(System.Collections.Generic.IEnumerable<>)) || typeDef == model.MapType(typeof(System.Collections.Generic.ICollection<>)) || typeDef.FullName == "System.Collections.Concurrent.IProducerConsumerCollection`1") { Type[] iTypeArgs = iType.GetGenericArguments(); if (!candidates.Contains(iTypeArgs[0])) { candidates.Add(iTypeArgs[0]); } } } #endif } private static bool CheckDictionaryAccessors(TypeModel model, Type pair, Type value) { #if NO_GENERICS return false; #elif WINRT || COREFX TypeInfo finalType = pair.GetTypeInfo(); return finalType.IsGenericType && finalType.GetGenericTypeDefinition() == typeof(System.Collections.Generic.KeyValuePair<,>) && finalType.GenericTypeArguments[1] == value; #else return pair.IsGenericType && pair.GetGenericTypeDefinition() == model.MapType(typeof(System.Collections.Generic.KeyValuePair<,>)) && pair.GetGenericArguments()[1] == value; #endif } #if !FEAT_IKVM private bool TryDeserializeList(TypeModel model, ProtoReader reader, DataFormat format, int tag, Type listType, Type itemType, ref object value) { bool isList; MethodInfo addMethod = TypeModel.ResolveListAdd(model, listType, itemType, out isList); if (addMethod == null) throw new NotSupportedException("Unknown list variant: " + listType.FullName); bool found = false; object nextItem = null; IList list = value as IList; object[] args = isList ? null : new object[1]; BasicList arraySurrogate = listType.IsArray ? new BasicList() : null; while (TryDeserializeAuxiliaryType(reader, format, tag, itemType, ref nextItem, true, true, true, true, value ?? listType)) { found = true; if (value == null && arraySurrogate == null) { value = CreateListInstance(listType, itemType); list = value as IList; } if (list != null) { list.Add(nextItem); } else if (arraySurrogate != null) { arraySurrogate.Add(nextItem); } else { args[0] = nextItem; addMethod.Invoke(value, args); } nextItem = null; } if (arraySurrogate != null) { Array newArray; if (value != null) { if (arraySurrogate.Count == 0) { // we'll stay with what we had, thanks } else { Array existing = (Array)value; newArray = Array.CreateInstance(itemType, existing.Length + arraySurrogate.Count); Array.Copy(existing, newArray, existing.Length); arraySurrogate.CopyTo(newArray, existing.Length); value = newArray; } } else { newArray = Array.CreateInstance(itemType, arraySurrogate.Count); arraySurrogate.CopyTo(newArray, 0); value = newArray; } } return found; } private static object CreateListInstance(Type listType, Type itemType) { Type concreteListType = listType; if (listType.IsArray) { return Array.CreateInstance(itemType, 0); } #if WINRT || COREFX TypeInfo listTypeInfo = listType.GetTypeInfo(); if (!listTypeInfo.IsClass || listTypeInfo.IsAbstract || Helpers.GetConstructor(listTypeInfo, Helpers.EmptyTypes, true) == null) #else if (!listType.IsClass || listType.IsAbstract || Helpers.GetConstructor(listType, Helpers.EmptyTypes, true) == null) #endif { string fullName; bool handled = false; #if WINRT || COREFX if (listTypeInfo.IsInterface && #else if (listType.IsInterface && #endif (fullName = listType.FullName) != null && fullName.IndexOf("Dictionary") >= 0) // have to try to be frugal here... { #if !NO_GENERICS #if WINRT || COREFX TypeInfo finalType = listType.GetTypeInfo(); if (finalType.IsGenericType && finalType.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IDictionary<,>)) { Type[] genericTypes = listType.GenericTypeArguments; concreteListType = typeof(System.Collections.Generic.Dictionary<,>).MakeGenericType(genericTypes); handled = true; } #else if (listType.IsGenericType && listType.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IDictionary<,>)) { Type[] genericTypes = listType.GetGenericArguments(); concreteListType = typeof(System.Collections.Generic.Dictionary<,>).MakeGenericType(genericTypes); handled = true; } #endif #endif #if !SILVERLIGHT && !WINRT && !PORTABLE && ! COREFX if (!handled && listType == typeof(IDictionary)) { concreteListType = typeof(Hashtable); handled = true; } #endif } #if !NO_GENERICS if (!handled) { concreteListType = typeof(System.Collections.Generic.List<>).MakeGenericType(itemType); handled = true; } #endif #if !SILVERLIGHT && !WINRT && !PORTABLE && ! COREFX if (!handled) { concreteListType = typeof(ArrayList); handled = true; } #endif } return Activator.CreateInstance(concreteListType); } /// <summary> /// This is the more "complete" version of Deserialize, which handles single instances of mapped types. /// The value is read as a complete field, including field-header and (for sub-objects) a /// length-prefix..kmc /// /// In addition to that, this provides support for: /// - basic values; individual int / string / Guid / etc /// - IList sets of any type handled by TryDeserializeAuxiliaryType /// </summary> internal bool TryDeserializeAuxiliaryType(ProtoReader reader, DataFormat format, int tag, Type type, ref object value, bool skipOtherFields, bool asListItem, bool autoCreate, bool insideList, object parentListOrType) { if (type == null) throw new ArgumentNullException("type"); Type itemType = null; ProtoTypeCode typecode = Helpers.GetTypeCode(type); int modelKey; WireType wiretype = GetWireType(typecode, format, ref type, out modelKey); bool found = false; if (wiretype == WireType.None) { itemType = GetListItemType(this, type); if (itemType == null && type.IsArray && type.GetArrayRank() == 1 && type != typeof(byte[])) { itemType = type.GetElementType(); } if (itemType != null) { if (insideList) throw TypeModel.CreateNestedListsNotSupported((parentListOrType as Type) ?? (parentListOrType?.GetType())); found = TryDeserializeList(this, reader, format, tag, type, itemType, ref value); if (!found && autoCreate) { value = CreateListInstance(type, itemType); } return found; } // otherwise, not a happy bunny... ThrowUnexpectedType(type); } // to treat correctly, should read all values while (true) { // for convenience (re complex exit conditions), additional exit test here: // if we've got the value, are only looking for one, and we aren't a list - then exit if (found && asListItem) break; // read the next item int fieldNumber = reader.ReadFieldHeader(); if (fieldNumber <= 0) break; if (fieldNumber != tag) { if (skipOtherFields) { reader.SkipField(); continue; } throw ProtoReader.AddErrorData(new InvalidOperationException( "Expected field " + tag.ToString() + ", but found " + fieldNumber.ToString()), reader); } found = true; reader.Hint(wiretype); // handle signed data etc if (modelKey >= 0) { switch (wiretype) { case WireType.String: case WireType.StartGroup: SubItemToken token = ProtoReader.StartSubItem(reader); value = Deserialize(modelKey, value, reader); ProtoReader.EndSubItem(token, reader); continue; default: value = Deserialize(modelKey, value, reader); continue; } } switch (typecode) { case ProtoTypeCode.Int16: value = reader.ReadInt16(); continue; case ProtoTypeCode.Int32: value = reader.ReadInt32(); continue; case ProtoTypeCode.Int64: value = reader.ReadInt64(); continue; case ProtoTypeCode.UInt16: value = reader.ReadUInt16(); continue; case ProtoTypeCode.UInt32: value = reader.ReadUInt32(); continue; case ProtoTypeCode.UInt64: value = reader.ReadUInt64(); continue; case ProtoTypeCode.Boolean: value = reader.ReadBoolean(); continue; case ProtoTypeCode.SByte: value = reader.ReadSByte(); continue; case ProtoTypeCode.Byte: value = reader.ReadByte(); continue; case ProtoTypeCode.Char: value = (char)reader.ReadUInt16(); continue; case ProtoTypeCode.Double: value = reader.ReadDouble(); continue; case ProtoTypeCode.Single: value = reader.ReadSingle(); continue; case ProtoTypeCode.DateTime: value = BclHelpers.ReadDateTime(reader); continue; case ProtoTypeCode.Decimal: value = BclHelpers.ReadDecimal(reader); continue; case ProtoTypeCode.String: value = reader.ReadString(); continue; case ProtoTypeCode.ByteArray: value = ProtoReader.AppendBytes((byte[])value, reader); continue; case ProtoTypeCode.TimeSpan: value = BclHelpers.ReadTimeSpan(reader); continue; case ProtoTypeCode.Guid: value = BclHelpers.ReadGuid(reader); continue; case ProtoTypeCode.Uri: value = new Uri(reader.ReadString(), UriKind.RelativeOrAbsolute); continue; } } if (!found && !asListItem && autoCreate) { if (type != typeof(string)) { value = Activator.CreateInstance(type); } } return found; } #endif #if !NO_RUNTIME /// <summary> /// Creates a new runtime model, to which the caller /// can add support for a range of types. A model /// can be used "as is", or can be compiled for /// optimal performance. /// </summary> public static RuntimeTypeModel Create() { return new RuntimeTypeModel(false); } #endif /// <summary> /// Applies common proxy scenarios, resolving the actual type to consider /// </summary> protected internal static Type ResolveProxies(Type type) { if (type == null) return null; #if !NO_GENERICS if (type.IsGenericParameter) return null; // Nullable<T> Type tmp = Helpers.GetUnderlyingType(type); if (tmp != null) return tmp; #endif #if !(WINRT || CF) // EF POCO string fullName = type.FullName; if (fullName != null && fullName.StartsWith("System.Data.Entity.DynamicProxies.")) { #if COREFX return type.GetTypeInfo().BaseType; #else return type.BaseType; #endif } // NHibernate Type[] interfaces = type.GetInterfaces(); for(int i = 0 ; i < interfaces.Length ; i++) { switch(interfaces[i].FullName) { case "NHibernate.Proxy.INHibernateProxy": case "NHibernate.Proxy.DynamicProxy.IProxy": case "NHibernate.Intercept.IFieldInterceptorAccessor": #if COREFX return type.GetTypeInfo().BaseType; #else return type.BaseType; #endif } } #endif return null; } /// <summary> /// Indicates whether the supplied type is explicitly modelled by the model /// </summary> public bool IsDefined(Type type) { return GetKey(ref type) >= 0; } /// <summary> /// Provides the key that represents a given type in the current model. /// The type is also normalized for proxies at the same time. /// </summary> protected internal int GetKey(ref Type type) { if (type == null) return -1; int key = GetKeyImpl(type); if (key < 0) { Type normalized = ResolveProxies(type); if (normalized != null) { type = normalized; // hence ref key = GetKeyImpl(type); } } return key; } /// <summary> /// Provides the key that represents a given type in the current model. /// </summary> protected abstract int GetKeyImpl(Type type); /// <summary> /// Writes a protocol-buffer representation of the given instance to the supplied stream. /// </summary> /// <param name="key">Represents the type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be serialized (cannot be null).</param> /// <param name="dest">The destination stream to write to.</param> protected internal abstract void Serialize(int key, object value, ProtoWriter dest); /// <summary> /// Applies a protocol-buffer stream to an existing instance (which may be null). /// </summary> /// <param name="key">Represents the type (including inheritance) to consider.</param> /// <param name="value">The existing instance to be modified (can be null).</param> /// <param name="source">The binary stream to apply to the instance (cannot be null).</param> /// <returns>The updated instance; this may be different to the instance argument if /// either the original instance was null, or the stream defines a known sub-type of the /// original instance.</returns> protected internal abstract object Deserialize(int key, object value, ProtoReader source); //internal ProtoSerializer Create(IProtoSerializer head) //{ // return new RuntimeSerializer(head, this); //} //internal ProtoSerializer Compile /// <summary> /// Indicates the type of callback to be used /// </summary> protected internal enum CallbackType { /// <summary> /// Invoked before an object is serialized /// </summary> BeforeSerialize, /// <summary> /// Invoked after an object is serialized /// </summary> AfterSerialize, /// <summary> /// Invoked before an object is deserialized (or when a new instance is created) /// </summary> BeforeDeserialize, /// <summary> /// Invoked after an object is deserialized /// </summary> AfterDeserialize } /// <summary> /// Create a deep clone of the supplied instance; any sub-items are also cloned. /// </summary> public object DeepClone(object value) { #if FEAT_IKVM throw new NotSupportedException(); #else if (value == null) return null; Type type = value.GetType(); int key = GetKey(ref type); if (key >= 0 && !Helpers.IsEnum(type)) { using (MemoryStream ms = new MemoryStream()) { using(ProtoWriter writer = new ProtoWriter(ms, this, null)) { writer.SetRootObject(value); Serialize(key, value, writer); writer.Close(); } ms.Position = 0; ProtoReader reader = null; try { reader = ProtoReader.Create(ms, this, null, ProtoReader.TO_EOF); return Deserialize(key, null, reader); } finally { ProtoReader.Recycle(reader); } } } int modelKey; if (type == typeof(byte[])) { byte[] orig = (byte[])value, clone = new byte[orig.Length]; Helpers.BlockCopy(orig, 0, clone, 0, orig.Length); return clone; } else if (GetWireType(Helpers.GetTypeCode(type), DataFormat.Default, ref type, out modelKey) != WireType.None && modelKey < 0) { // immutable; just return the original value return value; } using (MemoryStream ms = new MemoryStream()) { using (ProtoWriter writer = new ProtoWriter(ms, this, null)) { if (!TrySerializeAuxiliaryType(writer, type, DataFormat.Default, Serializer.ListItemTag, value, false, null)) ThrowUnexpectedType(type); writer.Close(); } ms.Position = 0; ProtoReader reader = null; try { reader = ProtoReader.Create(ms, this, null, ProtoReader.TO_EOF); value = null; // start from scratch! TryDeserializeAuxiliaryType(reader, DataFormat.Default, Serializer.ListItemTag, type, ref value, true, false, true, false, null); return value; } finally { ProtoReader.Recycle(reader); } } #endif } /// <summary> /// Indicates that while an inheritance tree exists, the exact type encountered was not /// specified in that hierarchy and cannot be processed. /// </summary> protected internal static void ThrowUnexpectedSubtype(Type expected, Type actual) { if (expected != TypeModel.ResolveProxies(actual)) { throw new InvalidOperationException("Unexpected sub-type: " + actual.FullName); } } /// <summary> /// Indicates that the given type was not expected, and cannot be processed. /// </summary> protected internal static void ThrowUnexpectedType(Type type) { string fullName = type == null ? "(unknown)" : type.FullName; #if !NO_GENERICS && !WINRT if (type != null) { Type baseType = type #if COREFX .GetTypeInfo() #endif .BaseType; if (baseType != null && baseType #if COREFX .GetTypeInfo() #endif .IsGenericType && baseType.GetGenericTypeDefinition().Name == "GeneratedMessage`2") { throw new InvalidOperationException( "Are you mixing protobuf-net and protobuf-csharp-port? See http://stackoverflow.com/q/11564914; type: " + fullName); } } #endif throw new InvalidOperationException("Type is not expected, and no contract can be inferred: " + fullName); } internal static Exception CreateNestedListsNotSupported(Type type) { return new NotSupportedException("Nested or jagged lists and arrays are not supported: " + (type?.FullName ?? "(null)")); } /// <summary> /// Indicates that the given type cannot be constructed; it may still be possible to /// deserialize into existing instances. /// </summary> public static void ThrowCannotCreateInstance(Type type) { throw new ProtoException("No parameterless constructor found for " + (type?.FullName ?? "(null)")); } internal static string SerializeType(TypeModel model, System.Type type) { if (model != null) { TypeFormatEventHandler handler = model.DynamicTypeFormatting; if (handler != null) { TypeFormatEventArgs args = new TypeFormatEventArgs(type); handler(model, args); if (!Helpers.IsNullOrEmpty(args.FormattedName)) return args.FormattedName; } } return type.AssemblyQualifiedName; } internal static System.Type DeserializeType(TypeModel model, string value) { if (model != null) { TypeFormatEventHandler handler = model.DynamicTypeFormatting; if (handler != null) { TypeFormatEventArgs args = new TypeFormatEventArgs(value); handler(model, args); if (args.Type != null) return args.Type; } } return System.Type.GetType(value); } /// <summary> /// Returns true if the type supplied is either a recognised contract type, /// or a *list* of a recognised contract type. /// </summary> /// <remarks>Note that primitives always return false, even though the engine /// will, if forced, try to serialize such</remarks> /// <returns>True if this type is recognised as a serializable entity, else false</returns> public bool CanSerializeContractType(Type type) { return CanSerialize(type, false, true, true); } /// <summary> /// Returns true if the type supplied is a basic type with inbuilt handling, /// a recognised contract type, or a *list* of a basic / contract type. /// </summary> public bool CanSerialize(Type type) { return CanSerialize(type, true, true, true); } /// <summary> /// Returns true if the type supplied is a basic type with inbuilt handling, /// or a *list* of a basic type with inbuilt handling /// </summary> public bool CanSerializeBasicType(Type type) { return CanSerialize(type, true, false, true); } private bool CanSerialize(Type type, bool allowBasic, bool allowContract, bool allowLists) { if (type == null) throw new ArgumentNullException("type"); Type tmp = Helpers.GetUnderlyingType(type); if (tmp != null) type = tmp; // is it a basic type? ProtoTypeCode typeCode = Helpers.GetTypeCode(type); switch(typeCode) { case ProtoTypeCode.Empty: case ProtoTypeCode.Unknown: break; default: return allowBasic; // well-known basic type } int modelKey = GetKey(ref type); if (modelKey >= 0) return allowContract; // known contract type // is it a list? if (allowLists) { Type itemType = null; if (type.IsArray) { // note we don't need to exclude byte[], as that is handled by GetTypeCode already if (type.GetArrayRank() == 1) itemType = type.GetElementType(); } else { itemType = GetListItemType(this, type); } if (itemType != null) return CanSerialize(itemType, allowBasic, allowContract, false); } return false; } /// <summary> /// Suggest a .proto definition for the given type /// </summary> /// <param name="type">The type to generate a .proto definition for, or <c>null</c> to generate a .proto that represents the entire model</param> /// <returns>The .proto definition as a string</returns> public virtual string GetSchema(Type type) => GetSchema(type, ProtoSyntax.Proto2); /// <summary> /// Suggest a .proto definition for the given type /// </summary> /// <param name="type">The type to generate a .proto definition for, or <c>null</c> to generate a .proto that represents the entire model</param> /// <returns>The .proto definition as a string</returns> /// <param name="syntax">The .proto syntax to use for the operation</param> public virtual string GetSchema(Type type, ProtoSyntax syntax) { throw new NotSupportedException(); } /// <summary> /// Used to provide custom services for writing and parsing type names when using dynamic types. Both parsing and formatting /// are provided on a single API as it is essential that both are mapped identically at all times. /// </summary> public event TypeFormatEventHandler DynamicTypeFormatting; #if PLAT_BINARYFORMATTER && !(WINRT || PHONE8 || COREFX) /// <summary> /// Creates a new IFormatter that uses protocol-buffer [de]serialization. /// </summary> /// <returns>A new IFormatter to be used during [de]serialization.</returns> /// <param name="type">The type of object to be [de]deserialized by the formatter.</param> public System.Runtime.Serialization.IFormatter CreateFormatter(Type type) { return new Formatter(this, type); } internal sealed class Formatter : System.Runtime.Serialization.IFormatter { private readonly TypeModel model; private readonly Type type; internal Formatter(TypeModel model, Type type) { this.model = model ?? throw new ArgumentNullException("model"); this.type = type ?? throw new ArgumentNullException("type"); } private System.Runtime.Serialization.SerializationBinder binder; public System.Runtime.Serialization.SerializationBinder Binder { get { return binder; } set { binder = value; } } private System.Runtime.Serialization.StreamingContext context; public System.Runtime.Serialization.StreamingContext Context { get { return context; } set { context = value; } } public object Deserialize(Stream source) { #if FEAT_IKVM throw new NotSupportedException(); #else return model.Deserialize(source, null, type, (long)-1, Context); #endif } public void Serialize(Stream destination, object graph) { model.Serialize(destination, graph, Context); } private System.Runtime.Serialization.ISurrogateSelector surrogateSelector; public System.Runtime.Serialization.ISurrogateSelector SurrogateSelector { get { return surrogateSelector; } set { surrogateSelector = value; } } } #endif #if DEBUG // this is used by some unit tests only, to ensure no buffering when buffering is disabled private bool forwardsOnly; /// <summary> /// If true, buffering of nested objects is disabled /// </summary> public bool ForwardsOnly { get { return forwardsOnly; } set { forwardsOnly = value; } } #endif internal virtual Type GetType(string fullName, Assembly context) { #if FEAT_IKVM throw new NotSupportedException(); #else return ResolveKnownType(fullName, this, context); #endif } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal static Type ResolveKnownType(string name, TypeModel model, Assembly assembly) { if (Helpers.IsNullOrEmpty(name)) return null; try { #if FEAT_IKVM // looks like a NullReferenceException, but this should call into RuntimeTypeModel's version Type type = model == null ? null : model.GetType(name, assembly); #else Type type = Type.GetType(name); #endif if (type != null) return type; } catch { } try { int i = name.IndexOf(','); string fullName = (i > 0 ? name.Substring(0, i) : name).Trim(); #if !(WINRT || FEAT_IKVM || COREFX) if (assembly == null) assembly = Assembly.GetCallingAssembly(); #endif Type type = assembly?.GetType(fullName); if (type != null) return type; } catch { } return null; } } }
45.799074
233
0.570542
[ "MIT" ]
306739889/guessGame
Unity/Assets/ThirdParty/protobuf-net/Meta/TypeModel.cs
79,097
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("AStar")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Hewlett-Packard")] [assembly: AssemblyProduct("AStar")] [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("303f3310-2d49-4304-a505-a72cdc289651")] // 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.189189
84
0.746638
[ "MIT" ]
MThornell256/SimpleAStar
AStar/Properties/AssemblyInfo.cs
1,416
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace TaskManagement.Resources { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Controllers_TaskController_en { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Controllers_TaskController_en() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TaskManagement.Resources.Controllers.TaskController.en", typeof(Controllers_TaskController_en).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to An error occurred while adding!. /// </summary> internal static string ControllerAddTaskError { get { return ResourceManager.GetString("ControllerAddTaskError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unable to get object!. /// </summary> internal static string ControllerGetTaskError { get { return ResourceManager.GetString("ControllerGetTaskError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to An error occurred while changin. /// </summary> internal static string ControllerUpdateTaskError { get { return ResourceManager.GetString("ControllerUpdateTaskError", resourceCulture); } } } }
42.395604
219
0.606532
[ "Apache-2.0" ]
Xorsiphus/TaskManagement
TaskManagement/Resources/Controllers.TaskController.en.Designer.cs
3,860
C#
using Microsoft.EntityFrameworkCore.Migrations; namespace BaseModels.Migrations { public partial class UpdateItemIconToNullable : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn<string>( name: "IconURL", table: "Items", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn<string>( name: "IconURL", table: "Items", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); } } }
28.84375
71
0.516793
[ "Apache-2.0" ]
DeKuczma/GW2-Trader
backend/Db_Models/Migrations/20210106131333_UpdateItemIconToNullable.cs
925
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Discord { /// <summary> /// A class used to build Message commands. /// </summary> public class MessageCommandBuilder { /// <summary> /// Returns the maximun length a commands name allowed by Discord /// </summary> public const int MaxNameLength = 32; /// <summary> /// The name of this Message command. /// </summary> public string Name { get { return _name; } set { Preconditions.NotNullOrEmpty(value, nameof(Name)); Preconditions.AtLeast(value.Length, 3, nameof(Name)); Preconditions.AtMost(value.Length, MaxNameLength, nameof(Name)); _name = value; } } /// <summary> /// Whether the command is enabled by default when the app is added to a guild /// </summary> public bool DefaultPermission { get; set; } = true; private string _name { get; set; } /// <summary> /// Build the current builder into a <see cref="MessageCommandProperties"/> class. /// </summary> /// <returns> /// A <see cref="MessageCommandProperties"/> that can be used to create message commands. /// </returns> public MessageCommandProperties Build() { MessageCommandProperties props = new MessageCommandProperties() { Name = Name, DefaultPermission = DefaultPermission }; return props; } /// <summary> /// Sets the field name. /// </summary> /// <param name="name">The value to set the field name to.</param> /// <returns> /// The current builder. /// </returns> public MessageCommandBuilder WithName(string name) { Name = name; return this; } /// <summary> /// Sets the default permission of the current command. /// </summary> /// <param name="value">The default permission value to set.</param> /// <returns>The current builder.</returns> public MessageCommandBuilder WithDefaultPermission (bool value) { DefaultPermission = value; return this; } } }
28.966292
101
0.531808
[ "MIT" ]
envyvox/Discord.Net-Labs
src/Discord.Net.Core/Entities/Interactions/Context Menus/MessageCommandBuilder.cs
2,578
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Azure.ContainerService.Outputs { [OutputType] public sealed class KubernetesClusterIdentity { /// <summary> /// The principal id of the system assigned identity which is used by master components. /// </summary> public readonly string? PrincipalId; /// <summary> /// The Tenant ID used for Azure Active Directory Application. If this isn't specified the Tenant ID of the current Subscription is used. /// </summary> public readonly string? TenantId; /// <summary> /// The type of identity used for the managed cluster. At this time the only supported value is `SystemAssigned`. /// </summary> public readonly string Type; [OutputConstructor] private KubernetesClusterIdentity( string? principalId, string? tenantId, string type) { PrincipalId = principalId; TenantId = tenantId; Type = type; } } }
31.395349
145
0.637037
[ "ECL-2.0", "Apache-2.0" ]
AdminTurnedDevOps/pulumi-azure
sdk/dotnet/ContainerService/Outputs/KubernetesClusterIdentity.cs
1,350
C#
using System; namespace HttpServer.Controllers { /// <summary> /// Methods marked with BeforeFilter will be invoked before each request. /// </summary> /// <remarks> /// BeforeFilters should take no arguments and return false /// if controller method should not be invoked. /// </remarks> /// <seealso cref="FilterPosition"/> public class BeforeFilterAttribute : Attribute { private readonly FilterPosition _position; /// <summary> /// Initializes a new instance of the <see cref="BeforeFilterAttribute"/> class. /// </summary> /// <remarks> /// BeforeFilters should take no arguments and return false /// if controller method should not be invoked. /// </remarks> public BeforeFilterAttribute() { _position = FilterPosition.Between; } /// <summary> /// Initializes a new instance of the <see cref="BeforeFilterAttribute"/> class. /// </summary> /// <param name="position">Specify if the filter should be invoked among the first filters, in between or among the last.</param> /// <remarks> /// BeforeFilters should take no arguments and return false /// if controller method should not be invoked. /// </remarks> public BeforeFilterAttribute(FilterPosition position) { _position = position; } /// <summary> /// Filters position in before filter queue /// </summary> public FilterPosition Position { get { return _position; } } } /// <summary> /// Determins when a before filter is executed. /// </summary> /// <seealso cref="BeforeFilterAttribute"/> public enum FilterPosition { /// <summary> /// Filter will be invoked first (unless another filter is added after this one with the First position) /// </summary> First, /// <summary> /// Invoke after all first filters, and before the last filters. /// </summary> Between, /// <summary> /// Filter will be invoked last (unless another filter is added after this one with the Last position) /// </summary> Last } }
32.8
137
0.58885
[ "BSD-3-Clause" ]
Ana-Green/halcyon-1
ThirdParty/HttpServer/HttpServer/Controllers/BeforeFilter.cs
2,296
C#
using Sandbox; [Library( "heist_pistol", Title = "Pistol" )] partial class Pistol : BaseHeistWeapon { public override string ViewModelPath => "weapons/rust_pistol/v_rust_pistol.vmdl"; public override float PrimaryRate => 15.0f; public override float SecondaryRate => 1.0f; public override float ReloadTime => 3.0f; public override bool Automatic => false; public override FiringParams FiringParams => new FiringParams(20f, 8f, 200f, 1000f, 0.01f, 0.04f, 0.02f); public override string FiringSound => "rust_pistol.shoot"; public override int Bucket => 1; public override void Spawn() { base.Spawn(); SetModel( "weapons/rust_pistol/rust_pistol.vmdl" ); } /* public override void AttackPrimary() { TimeSincePrimaryAttack = 0; TimeSinceSecondaryAttack = 0; if ( !TakeAmmo( 1 ) ) { if ( CanReload() ) { Reload(); } else { DryFire(); } return; } // // Tell the clients to play the shoot effects // ShootEffects(); PlaySound( "rust_pistol.shoot" ); // // Shoot the bullets // ShootBullet( 0.05f, 1.5f, 25.0f, 3.0f ); } */ }
18.745763
106
0.664557
[ "MIT" ]
yoranmandema/sbox-heist
code/weapons/Pistol.cs
1,108
C#
using System.Collections.Generic; using System.Linq; using CppSharp.AST; namespace CppSharp.Passes { /// <summary> /// This pass generates internal classes that implement abstract classes. /// When the return type of a function is abstract, these internal /// classes provide since the real type cannot be resolved while binding /// an allocatable class that supports proper polymorphism. /// </summary> public class GenerateAbstractImplementationsPass : TranslationUnitPass { public GenerateAbstractImplementationsPass() { VisitOptions.VisitClassBases = false; VisitOptions.VisitClassFields = false; VisitOptions.VisitClassProperties = false; VisitOptions.VisitClassTemplateSpecializations = false; VisitOptions.VisitEventParameters = false; VisitOptions.VisitFunctionParameters = false; VisitOptions.VisitFunctionReturnType = false; VisitOptions.VisitNamespaceEnums = false; VisitOptions.VisitNamespaceEvents = false; VisitOptions.VisitNamespaceTemplates = false; VisitOptions.VisitNamespaceTypedefs = false; VisitOptions.VisitNamespaceVariables = false; VisitOptions.VisitTemplateArguments = false; } /// <summary> /// Collects all internal implementations in a unit to be added at /// the end because the unit cannot be changed while it's being /// iterated though. /// </summary> private readonly List<Class> internalImpls = new List<Class>(); public override bool VisitTranslationUnit(TranslationUnit unit) { var result = base.VisitTranslationUnit(unit); foreach (var internalImpl in internalImpls) if (internalImpl.Namespace != null) internalImpl.Namespace.Declarations.Add(internalImpl); else unit.Declarations.AddRange(internalImpls); internalImpls.Clear(); return result; } public override bool VisitClassDecl(Class @class) { if (!base.VisitClassDecl(@class) || @class.Ignore) return false; if (@class.CompleteDeclaration != null) return VisitClassDecl(@class.CompleteDeclaration as Class); if (@class.IsAbstract) { foreach (var ctor in from ctor in @class.Constructors where ctor.Access == AccessSpecifier.Public select ctor) ctor.Access = AccessSpecifier.Protected; internalImpls.Add(AddInternalImplementation(@class)); } return @class.IsAbstract; } private static Class AddInternalImplementation(Class @class) { var internalImpl = GetInternalImpl(@class); var abstractMethods = GetRelevantAbstractMethods(@class); foreach (var abstractMethod in abstractMethods) { var impl = new Method(abstractMethod) { Namespace = internalImpl, OriginalFunction = abstractMethod, IsPure = false, SynthKind = abstractMethod.SynthKind == FunctionSynthKind.DefaultValueOverload ? FunctionSynthKind.DefaultValueOverload : FunctionSynthKind.AbstractImplCall }; impl.OverriddenMethods.Clear(); impl.OverriddenMethods.Add(abstractMethod); internalImpl.Methods.Add(impl); } internalImpl.Layout = @class.Layout; return internalImpl; } private static Class GetInternalImpl(Declaration @class) { var internalImpl = new Class { Name = @class.Name + "Internal", Access = AccessSpecifier.Private, Namespace = @class.Namespace }; var @base = new BaseClassSpecifier { Type = new TagType(@class) }; internalImpl.Bases.Add(@base); return internalImpl; } private static IEnumerable<Method> GetRelevantAbstractMethods(Class @class) { var abstractMethods = GetAbstractMethods(@class); var overriddenMethods = GetOverriddenMethods(@class); for (var i = abstractMethods.Count - 1; i >= 0; i--) { var @abstract = abstractMethods[i]; var @override = overriddenMethods.Find(m => m.Name == @abstract.Name && m.ReturnType == @abstract.ReturnType && m.Parameters.SequenceEqual(@abstract.Parameters, ParameterTypeComparer.Instance)); if (@override != null) { if (@abstract.IsOverride) { var abstractMethod = abstractMethods[i]; bool found; var rootBaseMethod = abstractMethod; do { rootBaseMethod = rootBaseMethod.BaseMethod; if (found = (rootBaseMethod == @override)) break; } while (rootBaseMethod != null); if (!found) abstractMethods.RemoveAt(i); } else { abstractMethods.RemoveAt(i); } } } return abstractMethods; } private static List<Method> GetAbstractMethods(Class @class) { var abstractMethods = @class.Methods.Where(m => m.IsPure).ToList(); var abstractOverrides = abstractMethods.Where(a => a.IsOverride).ToList(); foreach (var baseAbstractMethods in @class.Bases.Select(b => GetAbstractMethods(b.Class))) { for (var i = baseAbstractMethods.Count - 1; i >= 0; i--) if (abstractOverrides.Any(a => a.CanOverride(baseAbstractMethods[i]))) baseAbstractMethods.RemoveAt(i); abstractMethods.AddRange(baseAbstractMethods); } return abstractMethods; } private static List<Method> GetOverriddenMethods(Class @class) { var overriddenMethods = @class.Methods.Where(m => m.IsOverride && !m.IsPure).ToList(); foreach (var @base in @class.Bases) overriddenMethods.AddRange(GetOverriddenMethods(@base.Class)); return overriddenMethods; } } }
40.034483
104
0.545937
[ "MIT" ]
doc22940/cppsharp
src/Generator/Passes/GenerateAbstractImplementationsPass.cs
6,968
C#
namespace School.Domain.Students { public class StudentBuilder { private Student _student; public StudentBuilder WithCpfNameEmailPasswordHash(string cpf, string name, string email, string passwordHash) { _student = new Student(new Cpf(cpf), name, new Email(email), passwordHash); return this; } public StudentBuilder WithPhone(string ddd, string number) { _student.AddPhone(ddd, number); return this; } public Student Build() { return _student; } } }
22.518519
118
0.583882
[ "MIT" ]
flaviogf/Cursos
alura/java_e_clean_architecture/src/School.Domain/Students/StudentBuilder.cs
608
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.Windows.Forms.DataVisualization.Charting; namespace TestSetControlLibrary { public partial class TimeSeriesChartForm : Form { private Timer t1 = new System.Windows.Forms.Timer(); Series series; Random r = new Random(); public TimeSeriesChartForm() { InitializeComponent(); series = this.chart1.Series.Add("series 1"); series.XValueType = ChartValueType.Double; series.YValueType = ChartValueType.Double; series.ChartType = SeriesChartType.Spline; t1.Tick += new EventHandler(t1_Tick); t1.Interval = 1000; t1.Start(); } void t1_Tick(object sender, EventArgs e) { series.Points.AddXY(DateTime.Now, r.NextDouble()); } private void TimeSeriesChartForm_FormClosing(object sender, FormClosingEventArgs e) { this.t1.Stop(); } } }
26.733333
91
0.605154
[ "ECL-2.0", "Apache-2.0" ]
meaw/dnp3
windows/TestSetControlLibrary/TimeSeriesChartForm.cs
1,205
C#
using Couchbase.Search.Sort; using Newtonsoft.Json; using NUnit.Framework; namespace Couchbase.UnitTests.Search { [TestFixture] public class IdSearchSortTests { [Test] public void Outputs_Valid_Json() { var sort = new IdSearchSort(true); var result = sort.Export().ToString(Formatting.None); var expected = JsonConvert.SerializeObject(new { by = "id", decending = true }, Formatting.None); Assert.AreEqual(expected, result); } [Test] public void Omits_Decending_If_False() { var sort = new IdSearchSort(); var result = sort.Export().ToString(Formatting.None); var expected = JsonConvert.SerializeObject(new { by = "id" }, Formatting.None); Assert.AreEqual(expected, result); } } }
24
65
0.540625
[ "Apache-2.0" ]
4thOffice/couchbase-net-client
Src/Couchbase.UnitTests/Search/IdSearchSortTests.cs
962
C#
using AnnoSavegameViewer.Serialization.Core; using System.Collections.Generic; namespace AnnoSavegameViewer.Structures.Savegame.Generated { public class BudgetValue { } }
19.666667
60
0.819209
[ "MIT" ]
brumiros/AnnoSavegameViewer
AnnoSavegameViewer/Structures/Savegame/Generated/Empty/BudgetValue.cs
177
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.Diagnostics; using Microsoft.CSharp.RuntimeBinder.Syntax; namespace Microsoft.CSharp.RuntimeBinder.Semantics { internal sealed partial class ExpressionBinder { private class UnaOpSig { protected UnaOpSig() { } public UnaOpSig(PredefinedType pt, UnaOpMask grfuom, int cuosSkip, PfnBindUnaOp pfn, UnaOpFuncKind fnkind) { this.pt = pt; this.grfuom = grfuom; this.cuosSkip = cuosSkip; this.pfn = pfn; this.fnkind = fnkind; } public PredefinedType pt; public UnaOpMask grfuom; public int cuosSkip; public PfnBindUnaOp pfn; public UnaOpFuncKind fnkind; } private sealed class UnaOpFullSig : UnaOpSig { private readonly LiftFlags _grflt; private readonly CType _type; public UnaOpFullSig(CType type, PfnBindUnaOp pfn, LiftFlags grflt, UnaOpFuncKind fnkind) { this.pt = PredefinedType.PT_UNDEFINEDINDEX; this.grfuom = UnaOpMask.None; this.cuosSkip = 0; this.pfn = pfn; _type = type; _grflt = grflt; this.fnkind = fnkind; } /*************************************************************************************************** Set the values of the UnaOpFullSig from the given UnaOpSig. The ExpressionBinder is needed to get the predefined type. Returns true iff the predef type is found. ***************************************************************************************************/ public UnaOpFullSig(ExpressionBinder fnc, UnaOpSig uos) { this.pt = uos.pt; this.grfuom = uos.grfuom; this.cuosSkip = uos.cuosSkip; this.pfn = uos.pfn; this.fnkind = uos.fnkind; _type = pt != PredefinedType.PT_UNDEFINEDINDEX ? fnc.GetOptPDT(pt) : null; _grflt = LiftFlags.None; } public bool FPreDef() { return pt != PredefinedType.PT_UNDEFINEDINDEX; } public bool isLifted() { // This is a unary operator, so the second argument should be neither lifted nor converted. Debug.Assert((_grflt & LiftFlags.Lift2) == 0); Debug.Assert((_grflt & LiftFlags.Convert2) == 0); if (_grflt == LiftFlags.None) { return false; } // We can't both convert and lift. Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0)); return true; } public bool Convert() { return (_grflt & LiftFlags.Convert1) != 0; } public new CType GetType() { return _type; } } } }
37.131868
118
0.488014
[ "MIT" ]
Acidburn0zzz/corefx
src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/UnaOpSig.cs
3,379
C#
namespace ImproHound { public static class DefaultTieringConstants { public const int DefaultTierNumber = 1; public static WellKnownADObject[] WellKnownADObjects = { // Well-known Tier 0 SIDs new WellKnownADObject("S-1-5-17", "IUSR", "0"), new WellKnownADObject("S-1-5-18", "Local System", "0"), new WellKnownADObject("S-1-5-32-544", "Administrators", "0"), new WellKnownADObject("S-1-5-32-547", "Power Users", "0"), new WellKnownADObject("S-1-5-32-548", "Account Operators", "0"), new WellKnownADObject("S-1-5-32-549", "Server Operators", "0"), new WellKnownADObject("S-1-5-32-550", "Print Operators", "0"), new WellKnownADObject("S-1-5-32-551", "Backup Operators", "0"), new WellKnownADObject("S-1-5-32-552", "Replicator", "0"), new WellKnownADObject("S-1-5-32-555", "Remote Desktop Users", "0"), new WellKnownADObject("S-1-5-32-556", "Network Configuration Operators", "0"), new WellKnownADObject("S-1-5-32-557", "Incoming Forest Trust Builders", "0"), new WellKnownADObject("S-1-5-32-562", "Distributed COM Users", "0"), new WellKnownADObject("S-1-5-32-568", "IIS_IUSRS", "0"), new WellKnownADObject("S-1-5-32-569", "Cryptographic Operators", "0"), new WellKnownADObject("S-1-5-32-574", "Certificate Service DCOM Access", "0"), new WellKnownADObject("S-1-5-32-577", "RDS Management Servers", "0"), new WellKnownADObject("S-1-5-32-578", "Hyper-V Administrators", "0"), new WellKnownADObject("S-1-5-32-580", "Remote Management Users", "0"), new WellKnownADObject("S-1-5-32-582", "Storage Replica Administrators", "0"), new WellKnownADObject("S-1-5-9", "Enterprise Domain Controllers", "0"), // Well-known Tier 1 SIDs new WellKnownADObject("S-1-5-32-558", "Performance Monitor Users", "1"), new WellKnownADObject("S-1-5-32-559", "Performance Log Users", "1"), new WellKnownADObject("S-1-5-32-560", "Windows Authorization Access Group", "1"), new WellKnownADObject("S-1-5-32-561", "Terminal Server License Servers", "1"), new WellKnownADObject("S-1-5-32-573", "Event Log Readers", "1"), new WellKnownADObject("S-1-5-32-575", "RDS Remote Access Servers", "1"), new WellKnownADObject("S-1-5-32-576", "RDS Endpoint Servers", "1"), // Well-known Tier 2 SIDs new WellKnownADObject("S-1-0", "Null Authority", "2"), new WellKnownADObject("S-1-0-0", "Nobody", "2"), new WellKnownADObject("S-1-1", "World Authority", "2"), new WellKnownADObject("S-1-1-0", "Everyone", "2"), new WellKnownADObject("S-1-10", "Passport Authority", "2"), new WellKnownADObject("S-1-15-2-1", "All App Packages", "2"), new WellKnownADObject("S-1-16-0", "Untrusted Mandatory Level", "2"), new WellKnownADObject("S-1-16-12288", "High Mandatory Level", "2"), new WellKnownADObject("S-1-16-16384", "System Mandatory Level", "2"), new WellKnownADObject("S-1-16-20480", "Protected Process Mandatory Level", "2"), new WellKnownADObject("S-1-16-28672", "Secure Process Mandatory Level", "2"), new WellKnownADObject("S-1-16-4096", "Low Mandatory Level", "2"), new WellKnownADObject("S-1-16-8192", "Medium Mandatory Level", "2"), new WellKnownADObject("S-1-16-8448", "Medium Plus Mandatory Level", "2"), new WellKnownADObject("S-1-18-1", "Authentication Authority Asserted Identity", "2"), new WellKnownADObject("S-1-18-2", "Service Asserted Identity", "2"), new WellKnownADObject("S-1-18-3", "Fresh public key identity", "2"), new WellKnownADObject("S-1-18-4", "Key Trust", "2"), new WellKnownADObject("S-1-18-5", "MFA Key Property", "2"), new WellKnownADObject("S-1-18-6", "Attested Key Property", "2"), new WellKnownADObject("S-1-2", "Local Authority", "2"), new WellKnownADObject("S-1-2-0", "Local", "2"), new WellKnownADObject("S-1-2-1", "Console Logon", "2"), new WellKnownADObject("S-1-3", "Creator Authority", "2"), new WellKnownADObject("S-1-3-0", "Creator Owner", "2"), new WellKnownADObject("S-1-3-1", "Creator Group", "2"), new WellKnownADObject("S-1-3-2", "Creator Owner Server", "2"), new WellKnownADObject("S-1-3-3", "Creator Group Server", "2"), new WellKnownADObject("S-1-3-4", "Owner Rights", "2"), new WellKnownADObject("S-1-4", "Non-unique Authority", "2"), new WellKnownADObject("S-1-5", "NT Authority", "2"), new WellKnownADObject("S-1-5-1", "Dialup", "2"), new WellKnownADObject("S-1-5-10", "Principal Self", "2"), new WellKnownADObject("S-1-5-11", "Authenticated Users", "2"), new WellKnownADObject("S-1-5-113", "Local Account", "2"), new WellKnownADObject("S-1-5-114", "Local Account And Members Of Administrators Group", "2"), new WellKnownADObject("S-1-5-12", "Restricted Code", "2"), new WellKnownADObject("S-1-5-13", "Terminal Server Users", "2"), new WellKnownADObject("S-1-5-14", "Remote Interactive Logon", "2"), new WellKnownADObject("S-1-5-15", "This Organization", "2"), new WellKnownADObject("S-1-5-19", "Local Service", "2"), new WellKnownADObject("S-1-5-2", "Network", "2"), new WellKnownADObject("S-1-5-20", "Network Service", "2"), new WellKnownADObject("S-1-5-21-0-0-0-496", "Compounded Authentication", "2"), new WellKnownADObject("S-1-5-21-0-0-0-497", "Claims Valid", "2"), new WellKnownADObject("S-1-5-3", "Batch", "2"), new WellKnownADObject("S-1-5-32-545", "Users", "2"), new WellKnownADObject("S-1-5-32-546", "Guests", "2"), new WellKnownADObject("S-1-5-32-554", "Pre-Windows 2000 Compatible Access", "2"), new WellKnownADObject("S-1-5-32-579", "Access Control Assistance Operators", "2"), new WellKnownADObject("S-1-5-32-581", "System Managed Accounts Group", "2"), new WellKnownADObject("S-1-5-32-583", "Device Owners", "2"), new WellKnownADObject("S-1-5-33", "Write Restricted Code", "2"), new WellKnownADObject("S-1-5-4", "Interactive", "2"), new WellKnownADObject("S-1-5-6", "Service", "2"), new WellKnownADObject("S-1-5-64-10", "NTLM Authentication", "2"), new WellKnownADObject("S-1-5-64-14", "SChannel Authentication", "2"), new WellKnownADObject("S-1-5-64-21", "Digest Authentication", "2"), new WellKnownADObject("S-1-5-65-1", "This Organization Certificate", "2"), new WellKnownADObject("S-1-5-7", "Anonymous", "2"), new WellKnownADObject("S-1-5-8", "Proxy", "2"), new WellKnownADObject("S-1-5-80", "NT Service", "2"), new WellKnownADObject("S-1-5-80-0", "All Services", "2"), new WellKnownADObject("S-1-5-83-0", "NT Virtual Machine\\Virtual Machines", "2"), new WellKnownADObject("S-1-5-84-0-0-0-0-0", "User Mode Drivers", "2"), new WellKnownADObject("S-1-5-90-0", "Window Manager\\Window Manager Group", "2"), new WellKnownADObject("S-1-6", "Site Server Authority", "2"), new WellKnownADObject("S-1-7", "Internet Site Authority", "2"), new WellKnownADObject("S-1-8", "Exchange Authority", "2"), new WellKnownADObject("S-1-9", "Resource Manager Authority", "2"), // Well-known Tier 0 RIDs new WellKnownADObject("-498", "Enterprise Read-only Domain Controllers", "0"), new WellKnownADObject("-500", "Administrator", "0"), new WellKnownADObject("-502", "KRBTGT", "0"), new WellKnownADObject("-512", "Domain Admins", "0"), new WellKnownADObject("-516", "Domain Controllers", "0"), new WellKnownADObject("-517", "Cert Publishers", "0"), new WellKnownADObject("-520", "Group Policy Creator Owners", "0"), new WellKnownADObject("-521", "Read-only Domain Controllers", "0"), new WellKnownADObject("-522", "Cloneable Domain Controllers", "0"), new WellKnownADObject("-526", "Key Admins", "0"), new WellKnownADObject("-527", "Enterprise Key Admins", "0"), new WellKnownADObject("-518", "Schema Admins", "0"), new WellKnownADObject("-519", "Enterprise Admins", "0"), // Well-known Tier 1 RIDs new WellKnownADObject("-553", "RAS and IAS Servers", "1"), new WellKnownADObject("-572", "Denied RODC Password Replication Group", "1"), // Well-known Tier 2 RIDs new WellKnownADObject("-501", "Guest", "2"), new WellKnownADObject("-513", "Domain Users", "2"), new WellKnownADObject("-514", "Domain Guests", "2"), new WellKnownADObject("-515", "Domain Computers", "2"), new WellKnownADObject("-525", "Protected Users", "2"), new WellKnownADObject("-571", "Allowed RODC Password Replication Group", "2"), // These groups do not always have the same RID. Some sources say they do, but they don't new WellKnownADObject(null, "DnsAdmins", "0"), new WellKnownADObject(null, "DnsUpdateProxy", "0"), new WellKnownADObject(null, "WinRMRemoteWMIUsers__", "0"), }; } }
66.333333
105
0.582812
[ "Apache-2.0" ]
improsec/ImproHound
src/classes/static/DefaultTieringConstants.cs
9,753
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\EntityCollectionReferencesRequest.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; /// <summary> /// The type ServicePrincipalCreatedObjectsCollectionReferencesRequest. /// </summary> public partial class ServicePrincipalCreatedObjectsCollectionReferencesRequest : BaseRequest, IServicePrincipalCreatedObjectsCollectionReferencesRequest { /// <summary> /// Constructs a new ServicePrincipalCreatedObjectsCollectionReferencesRequest. /// </summary> /// <param name="requestUrl">The URL for the built request.</param> /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param> /// <param name="options">Query and header option name value pairs for the request.</param> public ServicePrincipalCreatedObjectsCollectionReferencesRequest( string requestUrl, IBaseClient client, IEnumerable<Option> options) : base(requestUrl, client, options) { } /// <summary> /// Adds the specified DirectoryObject to the collection via POST. /// </summary> /// <param name="directoryObject">The DirectoryObject to add.</param> /// <returns>The task to await.</returns> public System.Threading.Tasks.Task AddAsync(DirectoryObject directoryObject) { return this.AddAsync(directoryObject, CancellationToken.None); } /// <summary> /// Adds the specified DirectoryObject to the collection via POST. /// </summary> /// <param name="directoryObject">The DirectoryObject to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await.</returns> public System.Threading.Tasks.Task AddAsync(DirectoryObject directoryObject, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; if (string.IsNullOrEmpty(directoryObject.Id)) { throw new ServiceException(new Error { Code = "invalidRequest", Message = "ID is required to add a reference." }); } var requestBody = new ReferenceRequestBody { ODataId = string.Format("{0}/directoryObjects/{1}", this.Client.BaseUrl, directoryObject.Id) }; return this.SendAsync(requestBody, cancellationToken); } } }
44.735294
156
0.627548
[ "MIT" ]
OfficeGlobal/msgraph-beta-sdk-dotnet
src/Microsoft.Graph/Requests/Generated/ServicePrincipalCreatedObjectsCollectionReferencesRequest.cs
3,042
C#
using System.Threading; using PostgresTraining.V1.UseCase; using Bogus; using FluentAssertions; using Microsoft.Extensions.HealthChecks; using Moq; using NUnit.Framework; using Xunit; namespace PostgresTraining.Tests.V1.UseCase { public class DbHealthCheckUseCaseTests { private Mock<IHealthCheckService> _mockHealthCheckService; private DbHealthCheckUseCase _classUnderTest; private readonly Faker _faker = new Faker(); private string _description; public DbHealthCheckUseCaseTests() { _description = _faker.Random.Words(); _mockHealthCheckService = new Mock<IHealthCheckService>(); CompositeHealthCheckResult compositeHealthCheckResult = new CompositeHealthCheckResult(CheckStatus.Healthy); compositeHealthCheckResult.Add("test", CheckStatus.Healthy, _description); _mockHealthCheckService.Setup(s => s.CheckHealthAsync(It.IsAny<CancellationToken>())) .ReturnsAsync(compositeHealthCheckResult); _classUnderTest = new DbHealthCheckUseCase(_mockHealthCheckService.Object); } [Fact] public void ReturnsResponseWithStatus() { var response = _classUnderTest.Execute(); response.Should().NotBeNull(); response.Success.Should().BeTrue(); response.Message.Should().BeEquivalentTo("test: " + _description); } } }
30.666667
120
0.680707
[ "MIT" ]
LBHackney-IT/postgres-training
PostgresTraining.Tests/V1/UseCase/DbHealthCheckUseCaseTests.cs
1,472
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Ocr.V20181119.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class VehicleRegCertOCRRequest : AbstractModel { /// <summary> /// 图片的 Base64 值。 /// 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 /// 支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。 /// 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。 /// </summary> [JsonProperty("ImageBase64")] public string ImageBase64{ get; set; } /// <summary> /// 图片的 Url 地址。 /// 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 /// 支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。 /// 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 /// 非腾讯云存储的 Url 速度和稳定性可能受一定影响。 /// </summary> [JsonProperty("ImageUrl")] public string ImageUrl{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "ImageBase64", this.ImageBase64); this.SetParamSimple(map, prefix + "ImageUrl", this.ImageUrl); } } }
32.724138
81
0.638567
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet
TencentCloud/Ocr/V20181119/Models/VehicleRegCertOCRRequest.cs
2,274
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Cme.V20191029.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class StorageNewFileCreatedEvent : AbstractModel { /// <summary> /// 云点播文件 Id。 /// </summary> [JsonProperty("FileId")] public string FileId{ get; set; } /// <summary> /// 媒体 Id。 /// </summary> [JsonProperty("MaterialId")] public string MaterialId{ get; set; } /// <summary> /// 操作者 Id。(废弃,请勿使用) /// </summary> [JsonProperty("Operator")] public string Operator{ get; set; } /// <summary> /// 操作类型,可取值有: /// <li>Upload:本地上传;</li> /// <li>PullUpload:拉取上传;</li> /// <li>VideoEdit:视频剪辑;</li> /// <li>LiveStreamClip:直播流剪辑;</li> /// <li>LiveStreamRecord:直播流录制。</li> /// </summary> [JsonProperty("OperationType")] public string OperationType{ get; set; } /// <summary> /// 媒体归属。 /// </summary> [JsonProperty("Owner")] public Entity Owner{ get; set; } /// <summary> /// 媒体分类路径。 /// </summary> [JsonProperty("ClassPath")] public string ClassPath{ get; set; } /// <summary> /// 生成文件的任务 Id。当生成新文件是拉取上传、视频剪辑、直播流剪辑时为任务 Id。 /// </summary> [JsonProperty("TaskId")] public string TaskId{ get; set; } /// <summary> /// 来源上下文信息。视频剪辑生成新文件时此字段为项目 Id;直播流剪辑或者直播流录制生成新文件则为原始流地址。 /// </summary> [JsonProperty("SourceContext")] public string SourceContext{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "FileId", this.FileId); this.SetParamSimple(map, prefix + "MaterialId", this.MaterialId); this.SetParamSimple(map, prefix + "Operator", this.Operator); this.SetParamSimple(map, prefix + "OperationType", this.OperationType); this.SetParamObj(map, prefix + "Owner.", this.Owner); this.SetParamSimple(map, prefix + "ClassPath", this.ClassPath); this.SetParamSimple(map, prefix + "TaskId", this.TaskId); this.SetParamSimple(map, prefix + "SourceContext", this.SourceContext); } } }
32.030612
83
0.585218
[ "Apache-2.0" ]
tencentcloudapi-test/tencentcloud-sdk-dotnet
TencentCloud/Cme/V20191029/Models/StorageNewFileCreatedEvent.cs
3,461
C#
using Abp.Domain.Repositories; using Abp.Domain.Uow; using Abp.Events.Bus; using Abp.Events.Bus.Entities; using Abp.NHibernate.Tests.Entities; using Shouldly; using System.Linq; using Xunit; namespace Abp.NHibernate.Tests { public class Basic_Repository_Tests : NHibernateTestBase { private readonly IRepository<Person> _personRepository; private readonly IRepository<Book> _booksRepository; private readonly IUnitOfWorkManager _unitOfWorkManager; public Basic_Repository_Tests() { _personRepository = Resolve<IRepository<Person>>(); _booksRepository = Resolve<IRepository<Book>>(); _unitOfWorkManager = Resolve<IUnitOfWorkManager>(); UsingSession(session => session.Save(new Person() { Name = "emre" })); UsingSession(session => session.Save(new Book { Name = "Hitchhikers Guide to the Galaxy" })); UsingSession(session => session.Save(new Book { Name = "My First ABCs", IsDeleted = true })); } [Fact] public void Should_Insert_People() { _personRepository.Insert(new Person() { Name = "halil" }); var insertedPerson = UsingSession(session => session.Query<Person>().FirstOrDefault(p => p.Name == "halil")); insertedPerson.ShouldNotBe(null); insertedPerson.IsTransient().ShouldBe(false); insertedPerson.Name.ShouldBe("halil"); } [Fact] public void Should_Filter_SoftDelete() { var books = _booksRepository.GetAllList(); books.All(p => !p.IsDeleted).ShouldBeTrue(); } [Fact] public void Should_Get_SoftDeleted_Entities_If_Filter_Is_Disabled() { using (_unitOfWorkManager.Begin()) using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete)) { var books = _booksRepository.GetAllList(); books.Any(x => x.IsDeleted).ShouldBe(true); } } [Fact] public void Update_With_Action_Test() { var userBefore = UsingSession(session => session.Query<Person>().Single(p => p.Name == "emre")); var updatedUser = _personRepository.Update(userBefore.Id, user => user.Name = "yunus"); updatedUser.Id.ShouldBe(userBefore.Id); updatedUser.Name.ShouldBe("yunus"); var userAfter = UsingSession(session => session.Get<Person>(userBefore.Id)); userAfter.Name.ShouldBe("yunus"); } [Fact] public void Should_Trigger_Event_On_Insert() { var triggerCount = 0; Resolve<IEventBus>().Register<EntityCreatedEventData<Person>>( eventData => { eventData.Entity.Name.ShouldBe("halil"); eventData.Entity.IsTransient().ShouldBe(false); triggerCount++; }); _personRepository.Insert(new Person { Name = "halil" }); triggerCount.ShouldBe(1); } [Fact] public void Should_Trigger_Event_On_Update() { var triggerCount = 0; Resolve<IEventBus>().Register<EntityUpdatedEventData<Person>>( eventData => { eventData.Entity.Name.ShouldBe("emre2"); triggerCount++; }); var emrePeson = _personRepository.Single(p => p.Name == "emre"); emrePeson.Name = "emre2"; _personRepository.Update(emrePeson); triggerCount.ShouldBe(1); } [Fact] public void Should_Trigger_Event_On_Delete() { var triggerCount = 0; Resolve<IEventBus>().Register<EntityDeletedEventData<Person>>( eventData => { eventData.Entity.Name.ShouldBe("emre"); triggerCount++; }); var emrePeson = _personRepository.Single(p => p.Name == "emre"); _personRepository.Delete(emrePeson.Id); triggerCount.ShouldBe(1); _personRepository.FirstOrDefault(p => p.Name == "emre").ShouldBe(null); } } }
33.874016
121
0.573919
[ "MIT" ]
380086154/aspnetboilerplate
test/Abp.NHibernate.Tests/Basic_Repository_Tests.cs
4,304
C#