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
// FastNoise.cs // // MIT License // // Copyright(c) 2017 Jordan Peck // // 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. // // The developer's email is jorzixdan.me2@gzixmail.com (for great email, take // off every 'zix'.) // // Uncomment the line below to swap all the inputs/outputs/calculations of FastNoise to doubles instead of floats //#define FN_USE_DOUBLES #if FN_USE_DOUBLES using FN_DECIMAL = System.Double; #else using FN_DECIMAL = System.Single; #endif using System; using System.Runtime.CompilerServices; namespace Uncoal.MapGenerating { public class FastNoise { private const Int16 FN_INLINE = 256; //(Int16)MethodImplOptions.AggressiveInlining; private const int FN_CELLULAR_INDEX_MAX = 3; public enum NoiseType { Value, ValueFractal, Perlin, PerlinFractal, Simplex, SimplexFractal, Cellular, WhiteNoise, Cubic, CubicFractal }; public enum Interp { Linear, Hermite, Quintic }; public enum FractalType { FBM, Billow, RigidMulti }; public enum CellularDistanceFunction { Euclidean, Manhattan, Natural }; public enum CellularReturnType { CellValue, NoiseLookup, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div }; private int m_seed = 1337; private FN_DECIMAL m_frequency = (FN_DECIMAL)0.01; private Interp m_interp = Interp.Quintic; private NoiseType m_noiseType = NoiseType.Simplex; private int m_octaves = 3; private FN_DECIMAL m_lacunarity = (FN_DECIMAL)2.0; private FN_DECIMAL m_gain = (FN_DECIMAL)0.5; private FractalType m_fractalType = FractalType.FBM; private FN_DECIMAL m_fractalBounding; private CellularDistanceFunction m_cellularDistanceFunction = CellularDistanceFunction.Euclidean; private CellularReturnType m_cellularReturnType = CellularReturnType.CellValue; private FastNoise m_cellularNoiseLookup = null; private int m_cellularDistanceIndex0 = 0; private int m_cellularDistanceIndex1 = 1; private float m_cellularJitter = 0.45f; private FN_DECIMAL m_gradientPerturbAmp = (FN_DECIMAL)1.0; public FastNoise(int seed = 1337) { m_seed = seed; CalculateFractalBounding(); } // Returns a 0 float/double public static FN_DECIMAL GetDecimalType() { return 0; } // Returns the seed used by this object public int GetSeed() { return m_seed; } // Sets seed used for all noise types // Default: 1337 public void SetSeed(int seed) { m_seed = seed; } // Sets frequency for all noise types // Default: 0.01 public void SetFrequency(FN_DECIMAL frequency) { m_frequency = frequency; } // Changes the interpolation method used to smooth between noise values // Possible interpolation methods (lowest to highest quality) : // - Linear // - Hermite // - Quintic // Used in Value, Gradient Noise and Position Perturbing // Default: Quintic public void SetInterp(Interp interp) { m_interp = interp; } // Sets noise return type of GetNoise(...) // Default: Simplex public void SetNoiseType(NoiseType noiseType) { m_noiseType = noiseType; } // Sets octave count for all fractal noise types // Default: 3 public void SetFractalOctaves(int octaves) { m_octaves = octaves; CalculateFractalBounding(); } // Sets octave lacunarity for all fractal noise types // Default: 2.0 public void SetFractalLacunarity(FN_DECIMAL lacunarity) { m_lacunarity = lacunarity; } // Sets octave gain for all fractal noise types // Default: 0.5 public void SetFractalGain(FN_DECIMAL gain) { m_gain = gain; CalculateFractalBounding(); } // Sets method for combining octaves in all fractal noise types // Default: FBM public void SetFractalType(FractalType fractalType) { m_fractalType = fractalType; } // Sets return type from cellular noise calculations // Note: NoiseLookup requires another FastNoise object be set with SetCellularNoiseLookup() to function // Default: CellValue public void SetCellularDistanceFunction(CellularDistanceFunction cellularDistanceFunction) { m_cellularDistanceFunction = cellularDistanceFunction; } // Sets distance function used in cellular noise calculations // Default: Euclidean public void SetCellularReturnType(CellularReturnType cellularReturnType) { m_cellularReturnType = cellularReturnType; } // Sets the 2 distance indicies used for distance2 return types // Default: 0, 1 // Note: index0 should be lower than index1 // Both indicies must be >= 0, index1 must be < 4 public void SetCellularDistance2Indicies(int cellularDistanceIndex0, int cellularDistanceIndex1) { m_cellularDistanceIndex0 = Math.Min(cellularDistanceIndex0, cellularDistanceIndex1); m_cellularDistanceIndex1 = Math.Max(cellularDistanceIndex0, cellularDistanceIndex1); m_cellularDistanceIndex0 = Math.Min(Math.Max(m_cellularDistanceIndex0, 0), FN_CELLULAR_INDEX_MAX); m_cellularDistanceIndex1 = Math.Min(Math.Max(m_cellularDistanceIndex1, 0), FN_CELLULAR_INDEX_MAX); } // Sets the maximum distance a cellular point can move from it's grid position // Setting this high will make artifacts more common // Default: 0.45 public void SetCellularJitter(float cellularJitter) { m_cellularJitter = cellularJitter; } // Noise used to calculate a cell value if cellular return type is NoiseLookup // The lookup value is acquired through GetNoise() so ensure you SetNoiseType() on the noise lookup, value, gradient or simplex is recommended public void SetCellularNoiseLookup(FastNoise noise) { m_cellularNoiseLookup = noise; } // Sets the maximum perturb distance from original location when using GradientPerturb{Fractal}(...) // Default: 1.0 public void SetGradientPerturbAmp(FN_DECIMAL gradientPerturbAmp) { m_gradientPerturbAmp = gradientPerturbAmp; } private struct Float2 { public readonly FN_DECIMAL x, y; public Float2(FN_DECIMAL x, FN_DECIMAL y) { this.x = x; this.y = y; } } private struct Float3 { public readonly FN_DECIMAL x, y, z; public Float3(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { this.x = x; this.y = y; this.z = z; } } // TODO private static readonly Float2[] GRAD_2D = { new Float2(-1,-1), new Float2( 1,-1), new Float2(-1, 1), new Float2( 1, 1), new Float2( 0,-1), new Float2(-1, 0), new Float2( 0, 1), new Float2( 1, 0), }; private static readonly Float3[] GRAD_3D = { new Float3( 1, 1, 0), new Float3(-1, 1, 0), new Float3( 1,-1, 0), new Float3(-1,-1, 0), new Float3( 1, 0, 1), new Float3(-1, 0, 1), new Float3( 1, 0,-1), new Float3(-1, 0,-1), new Float3( 0, 1, 1), new Float3( 0,-1, 1), new Float3( 0, 1,-1), new Float3( 0,-1,-1), new Float3( 1, 1, 0), new Float3( 0,-1, 1), new Float3(-1, 1, 0), new Float3( 0,-1,-1), }; private static readonly Float2[] CELL_2D = { new Float2(-0.2700222198f, -0.9628540911f), new Float2(0.3863092627f, -0.9223693152f), new Float2(0.04444859006f, -0.999011673f), new Float2(-0.5992523158f, -0.8005602176f), new Float2(-0.7819280288f, 0.6233687174f), new Float2(0.9464672271f, 0.3227999196f), new Float2(-0.6514146797f, -0.7587218957f), new Float2(0.9378472289f, 0.347048376f), new Float2(-0.8497875957f, -0.5271252623f), new Float2(-0.879042592f, 0.4767432447f), new Float2(-0.892300288f, -0.4514423508f), new Float2(-0.379844434f, -0.9250503802f), new Float2(-0.9951650832f, 0.0982163789f), new Float2(0.7724397808f, -0.6350880136f), new Float2(0.7573283322f, -0.6530343002f), new Float2(-0.9928004525f, -0.119780055f), new Float2(-0.0532665713f, 0.9985803285f), new Float2(0.9754253726f, -0.2203300762f), new Float2(-0.7665018163f, 0.6422421394f), new Float2(0.991636706f, 0.1290606184f), new Float2(-0.994696838f, 0.1028503788f), new Float2(-0.5379205513f, -0.84299554f), new Float2(0.5022815471f, -0.8647041387f), new Float2(0.4559821461f, -0.8899889226f), new Float2(-0.8659131224f, -0.5001944266f), new Float2(0.0879458407f, -0.9961252577f), new Float2(-0.5051684983f, 0.8630207346f), new Float2(0.7753185226f, -0.6315704146f), new Float2(-0.6921944612f, 0.7217110418f), new Float2(-0.5191659449f, -0.8546734591f), new Float2(0.8978622882f, -0.4402764035f), new Float2(-0.1706774107f, 0.9853269617f), new Float2(-0.9353430106f, -0.3537420705f), new Float2(-0.9992404798f, 0.03896746794f), new Float2(-0.2882064021f, -0.9575683108f), new Float2(-0.9663811329f, 0.2571137995f), new Float2(-0.8759714238f, -0.4823630009f), new Float2(-0.8303123018f, -0.5572983775f), new Float2(0.05110133755f, -0.9986934731f), new Float2(-0.8558373281f, -0.5172450752f), new Float2(0.09887025282f, 0.9951003332f), new Float2(0.9189016087f, 0.3944867976f), new Float2(-0.2439375892f, -0.9697909324f), new Float2(-0.8121409387f, -0.5834613061f), new Float2(-0.9910431363f, 0.1335421355f), new Float2(0.8492423985f, -0.5280031709f), new Float2(-0.9717838994f, -0.2358729591f), new Float2(0.9949457207f, 0.1004142068f), new Float2(0.6241065508f, -0.7813392434f), new Float2(0.662910307f, 0.7486988212f), new Float2(-0.7197418176f, 0.6942418282f), new Float2(-0.8143370775f, -0.5803922158f), new Float2(0.104521054f, -0.9945226741f), new Float2(-0.1065926113f, -0.9943027784f), new Float2(0.445799684f, -0.8951327509f), new Float2(0.105547406f, 0.9944142724f), new Float2(-0.992790267f, 0.1198644477f), new Float2(-0.8334366408f, 0.552615025f), new Float2(0.9115561563f, -0.4111755999f), new Float2(0.8285544909f, -0.5599084351f), new Float2(0.7217097654f, -0.6921957921f), new Float2(0.4940492677f, -0.8694339084f), new Float2(-0.3652321272f, -0.9309164803f), new Float2(-0.9696606758f, 0.2444548501f), new Float2(0.08925509731f, -0.996008799f), new Float2(0.5354071276f, -0.8445941083f), new Float2(-0.1053576186f, 0.9944343981f), new Float2(-0.9890284586f, 0.1477251101f), new Float2(0.004856104961f, 0.9999882091f), new Float2(0.9885598478f, 0.1508291331f), new Float2(0.9286129562f, -0.3710498316f), new Float2(-0.5832393863f, -0.8123003252f), new Float2(0.3015207509f, 0.9534596146f), new Float2(-0.9575110528f, 0.2883965738f), new Float2(0.9715802154f, -0.2367105511f), new Float2(0.229981792f, 0.9731949318f), new Float2(0.955763816f, -0.2941352207f), new Float2(0.740956116f, 0.6715534485f), new Float2(-0.9971513787f, -0.07542630764f), new Float2(0.6905710663f, -0.7232645452f), new Float2(-0.290713703f, -0.9568100872f), new Float2(0.5912777791f, -0.8064679708f), new Float2(-0.9454592212f, -0.325740481f), new Float2(0.6664455681f, 0.74555369f), new Float2(0.6236134912f, 0.7817328275f), new Float2(0.9126993851f, -0.4086316587f), new Float2(-0.8191762011f, 0.5735419353f), new Float2(-0.8812745759f, -0.4726046147f), new Float2(0.9953313627f, 0.09651672651f), new Float2(0.9855650846f, -0.1692969699f), new Float2(-0.8495980887f, 0.5274306472f), new Float2(0.6174853946f, -0.7865823463f), new Float2(0.8508156371f, 0.52546432f), new Float2(0.9985032451f, -0.05469249926f), new Float2(0.1971371563f, -0.9803759185f), new Float2(0.6607855748f, -0.7505747292f), new Float2(-0.03097494063f, 0.9995201614f), new Float2(-0.6731660801f, 0.739491331f), new Float2(-0.7195018362f, -0.6944905383f), new Float2(0.9727511689f, 0.2318515979f), new Float2(0.9997059088f, -0.0242506907f), new Float2(0.4421787429f, -0.8969269532f), new Float2(0.9981350961f, -0.061043673f), new Float2(-0.9173660799f, -0.3980445648f), new Float2(-0.8150056635f, -0.5794529907f), new Float2(-0.8789331304f, 0.4769450202f), new Float2(0.0158605829f, 0.999874213f), new Float2(-0.8095464474f, 0.5870558317f), new Float2(-0.9165898907f, -0.3998286786f), new Float2(-0.8023542565f, 0.5968480938f), new Float2(-0.5176737917f, 0.8555780767f), new Float2(-0.8154407307f, -0.5788405779f), new Float2(0.4022010347f, -0.9155513791f), new Float2(-0.9052556868f, -0.4248672045f), new Float2(0.7317445619f, 0.6815789728f), new Float2(-0.5647632201f, -0.8252529947f), new Float2(-0.8403276335f, -0.5420788397f), new Float2(-0.9314281527f, 0.363925262f), new Float2(0.5238198472f, 0.8518290719f), new Float2(0.7432803869f, -0.6689800195f), new Float2(-0.985371561f, -0.1704197369f), new Float2(0.4601468731f, 0.88784281f), new Float2(0.825855404f, 0.5638819483f), new Float2(0.6182366099f, 0.7859920446f), new Float2(0.8331502863f, -0.553046653f), new Float2(0.1500307506f, 0.9886813308f), new Float2(-0.662330369f, -0.7492119075f), new Float2(-0.668598664f, 0.743623444f), new Float2(0.7025606278f, 0.7116238924f), new Float2(-0.5419389763f, -0.8404178401f), new Float2(-0.3388616456f, 0.9408362159f), new Float2(0.8331530315f, 0.5530425174f), new Float2(-0.2989720662f, -0.9542618632f), new Float2(0.2638522993f, 0.9645630949f), new Float2(0.124108739f, -0.9922686234f), new Float2(-0.7282649308f, -0.6852956957f), new Float2(0.6962500149f, 0.7177993569f), new Float2(-0.9183535368f, 0.3957610156f), new Float2(-0.6326102274f, -0.7744703352f), new Float2(-0.9331891859f, -0.359385508f), new Float2(-0.1153779357f, -0.9933216659f), new Float2(0.9514974788f, -0.3076565421f), new Float2(-0.08987977445f, -0.9959526224f), new Float2(0.6678496916f, 0.7442961705f), new Float2(0.7952400393f, -0.6062947138f), new Float2(-0.6462007402f, -0.7631674805f), new Float2(-0.2733598753f, 0.9619118351f), new Float2(0.9669590226f, -0.254931851f), new Float2(-0.9792894595f, 0.2024651934f), new Float2(-0.5369502995f, -0.8436138784f), new Float2(-0.270036471f, -0.9628500944f), new Float2(-0.6400277131f, 0.7683518247f), new Float2(-0.7854537493f, -0.6189203566f), new Float2(0.06005905383f, -0.9981948257f), new Float2(-0.02455770378f, 0.9996984141f), new Float2(-0.65983623f, 0.751409442f), new Float2(-0.6253894466f, -0.7803127835f), new Float2(-0.6210408851f, -0.7837781695f), new Float2(0.8348888491f, 0.5504185768f), new Float2(-0.1592275245f, 0.9872419133f), new Float2(0.8367622488f, 0.5475663786f), new Float2(-0.8675753916f, -0.4973056806f), new Float2(-0.2022662628f, -0.9793305667f), new Float2(0.9399189937f, 0.3413975472f), new Float2(0.9877404807f, -0.1561049093f), new Float2(-0.9034455656f, 0.4287028224f), new Float2(0.1269804218f, -0.9919052235f), new Float2(-0.3819600854f, 0.924178821f), new Float2(0.9754625894f, 0.2201652486f), new Float2(-0.3204015856f, -0.9472818081f), new Float2(-0.9874760884f, 0.1577687387f), new Float2(0.02535348474f, -0.9996785487f), new Float2(0.4835130794f, -0.8753371362f), new Float2(-0.2850799925f, -0.9585037287f), new Float2(-0.06805516006f, -0.99768156f), new Float2(-0.7885244045f, -0.6150034663f), new Float2(0.3185392127f, -0.9479096845f), new Float2(0.8880043089f, 0.4598351306f), new Float2(0.6476921488f, -0.7619021462f), new Float2(0.9820241299f, 0.1887554194f), new Float2(0.9357275128f, -0.3527237187f), new Float2(-0.8894895414f, 0.4569555293f), new Float2(0.7922791302f, 0.6101588153f), new Float2(0.7483818261f, 0.6632681526f), new Float2(-0.7288929755f, -0.6846276581f), new Float2(0.8729032783f, -0.4878932944f), new Float2(0.8288345784f, 0.5594937369f), new Float2(0.08074567077f, 0.9967347374f), new Float2(0.9799148216f, -0.1994165048f), new Float2(-0.580730673f, -0.8140957471f), new Float2(-0.4700049791f, -0.8826637636f), new Float2(0.2409492979f, 0.9705377045f), new Float2(0.9437816757f, -0.3305694308f), new Float2(-0.8927998638f, -0.4504535528f), new Float2(-0.8069622304f, 0.5906030467f), new Float2(0.06258973166f, 0.9980393407f), new Float2(-0.9312597469f, 0.3643559849f), new Float2(0.5777449785f, 0.8162173362f), new Float2(-0.3360095855f, -0.941858566f), new Float2(0.697932075f, -0.7161639607f), new Float2(-0.002008157227f, -0.9999979837f), new Float2(-0.1827294312f, -0.9831632392f), new Float2(-0.6523911722f, 0.7578824173f), new Float2(-0.4302626911f, -0.9027037258f), new Float2(-0.9985126289f, -0.05452091251f), new Float2(-0.01028102172f, -0.9999471489f), new Float2(-0.4946071129f, 0.8691166802f), new Float2(-0.2999350194f, 0.9539596344f), new Float2(0.8165471961f, 0.5772786819f), new Float2(0.2697460475f, 0.962931498f), new Float2(-0.7306287391f, -0.6827749597f), new Float2(-0.7590952064f, -0.6509796216f), new Float2(-0.907053853f, 0.4210146171f), new Float2(-0.5104861064f, -0.8598860013f), new Float2(0.8613350597f, 0.5080373165f), new Float2(0.5007881595f, -0.8655698812f), new Float2(-0.654158152f, 0.7563577938f), new Float2(-0.8382755311f, -0.545246856f), new Float2(0.6940070834f, 0.7199681717f), new Float2(0.06950936031f, 0.9975812994f), new Float2(0.1702942185f, -0.9853932612f), new Float2(0.2695973274f, 0.9629731466f), new Float2(0.5519612192f, -0.8338697815f), new Float2(0.225657487f, -0.9742067022f), new Float2(0.4215262855f, -0.9068161835f), new Float2(0.4881873305f, -0.8727388672f), new Float2(-0.3683854996f, -0.9296731273f), new Float2(-0.9825390578f, 0.1860564427f), new Float2(0.81256471f, 0.5828709909f), new Float2(0.3196460933f, -0.9475370046f), new Float2(0.9570913859f, 0.2897862643f), new Float2(-0.6876655497f, -0.7260276109f), new Float2(-0.9988770922f, -0.047376731f), new Float2(-0.1250179027f, 0.992154486f), new Float2(-0.8280133617f, 0.560708367f), new Float2(0.9324863769f, -0.3612051451f), new Float2(0.6394653183f, 0.7688199442f), new Float2(-0.01623847064f, -0.9998681473f), new Float2(-0.9955014666f, -0.09474613458f), new Float2(-0.81453315f, 0.580117012f), new Float2(0.4037327978f, -0.9148769469f), new Float2(0.9944263371f, 0.1054336766f), new Float2(-0.1624711654f, 0.9867132919f), new Float2(-0.9949487814f, -0.100383875f), new Float2(-0.6995302564f, 0.7146029809f), new Float2(0.5263414922f, -0.85027327f), new Float2(-0.5395221479f, 0.841971408f), new Float2(0.6579370318f, 0.7530729462f), new Float2(0.01426758847f, -0.9998982128f), new Float2(-0.6734383991f, 0.7392433447f), new Float2(0.639412098f, -0.7688642071f), new Float2(0.9211571421f, 0.3891908523f), new Float2(-0.146637214f, -0.9891903394f), new Float2(-0.782318098f, 0.6228791163f), new Float2(-0.5039610839f, -0.8637263605f), new Float2(-0.7743120191f, -0.6328039957f), }; private static readonly Float3[] CELL_3D = { new Float3(-0.7292736885f, -0.6618439697f, 0.1735581948f), new Float3(0.790292081f, -0.5480887466f, -0.2739291014f), new Float3(0.7217578935f, 0.6226212466f, -0.3023380997f), new Float3(0.565683137f, -0.8208298145f, -0.0790000257f), new Float3(0.760049034f, -0.5555979497f, -0.3370999617f), new Float3(0.3713945616f, 0.5011264475f, 0.7816254623f), new Float3(-0.1277062463f, -0.4254438999f, -0.8959289049f), new Float3(-0.2881560924f, -0.5815838982f, 0.7607405838f), new Float3(0.5849561111f, -0.662820239f, -0.4674352136f), new Float3(0.3307171178f, 0.0391653737f, 0.94291689f), new Float3(0.8712121778f, -0.4113374369f, -0.2679381538f), new Float3(0.580981015f, 0.7021915846f, 0.4115677815f), new Float3(0.503756873f, 0.6330056931f, -0.5878203852f), new Float3(0.4493712205f, 0.601390195f, 0.6606022552f), new Float3(-0.6878403724f, 0.09018890807f, -0.7202371714f), new Float3(-0.5958956522f, -0.6469350577f, 0.475797649f), new Float3(-0.5127052122f, 0.1946921978f, -0.8361987284f), new Float3(-0.9911507142f, -0.05410276466f, -0.1212153153f), new Float3(-0.2149721042f, 0.9720882117f, -0.09397607749f), new Float3(-0.7518650936f, -0.5428057603f, 0.3742469607f), new Float3(0.5237068895f, 0.8516377189f, -0.02107817834f), new Float3(0.6333504779f, 0.1926167129f, -0.7495104896f), new Float3(-0.06788241606f, 0.3998305789f, 0.9140719259f), new Float3(-0.5538628599f, -0.4729896695f, -0.6852128902f), new Float3(-0.7261455366f, -0.5911990757f, 0.3509933228f), new Float3(-0.9229274737f, -0.1782808786f, 0.3412049336f), new Float3(-0.6968815002f, 0.6511274338f, 0.3006480328f), new Float3(0.9608044783f, -0.2098363234f, -0.1811724921f), new Float3(0.06817146062f, -0.9743405129f, 0.2145069156f), new Float3(-0.3577285196f, -0.6697087264f, -0.6507845481f), new Float3(-0.1868621131f, 0.7648617052f, -0.6164974636f), new Float3(-0.6541697588f, 0.3967914832f, 0.6439087246f), new Float3(0.6993340405f, -0.6164538506f, 0.3618239211f), new Float3(-0.1546665739f, 0.6291283928f, 0.7617583057f), new Float3(-0.6841612949f, -0.2580482182f, -0.6821542638f), new Float3(0.5383980957f, 0.4258654885f, 0.7271630328f), new Float3(-0.5026987823f, -0.7939832935f, -0.3418836993f), new Float3(0.3202971715f, 0.2834415347f, 0.9039195862f), new Float3(0.8683227101f, -0.0003762656404f, -0.4959995258f), new Float3(0.791120031f, -0.08511045745f, 0.6057105799f), new Float3(-0.04011016052f, -0.4397248749f, 0.8972364289f), new Float3(0.9145119872f, 0.3579346169f, -0.1885487608f), new Float3(-0.9612039066f, -0.2756484276f, 0.01024666929f), new Float3(0.6510361721f, -0.2877799159f, -0.7023778346f), new Float3(-0.2041786351f, 0.7365237271f, 0.644859585f), new Float3(-0.7718263711f, 0.3790626912f, 0.5104855816f), new Float3(-0.3060082741f, -0.7692987727f, 0.5608371729f), new Float3(0.454007341f, -0.5024843065f, 0.7357899537f), new Float3(0.4816795475f, 0.6021208291f, -0.6367380315f), new Float3(0.6961980369f, -0.3222197429f, 0.641469197f), new Float3(-0.6532160499f, -0.6781148932f, 0.3368515753f), new Float3(0.5089301236f, -0.6154662304f, -0.6018234363f), new Float3(-0.1635919754f, -0.9133604627f, -0.372840892f), new Float3(0.52408019f, -0.8437664109f, 0.1157505864f), new Float3(0.5902587356f, 0.4983817807f, -0.6349883666f), new Float3(0.5863227872f, 0.494764745f, 0.6414307729f), new Float3(0.6779335087f, 0.2341345225f, 0.6968408593f), new Float3(0.7177054546f, -0.6858979348f, 0.120178631f), new Float3(-0.5328819713f, -0.5205125012f, 0.6671608058f), new Float3(-0.8654874251f, -0.0700727088f, -0.4960053754f), new Float3(-0.2861810166f, 0.7952089234f, 0.5345495242f), new Float3(-0.04849529634f, 0.9810836427f, -0.1874115585f), new Float3(-0.6358521667f, 0.6058348682f, 0.4781800233f), new Float3(0.6254794696f, -0.2861619734f, 0.7258696564f), new Float3(-0.2585259868f, 0.5061949264f, -0.8227581726f), new Float3(0.02136306781f, 0.5064016808f, -0.8620330371f), new Float3(0.200111773f, 0.8599263484f, 0.4695550591f), new Float3(0.4743561372f, 0.6014985084f, -0.6427953014f), new Float3(0.6622993731f, -0.5202474575f, -0.5391679918f), new Float3(0.08084972818f, -0.6532720452f, 0.7527940996f), new Float3(-0.6893687501f, 0.0592860349f, 0.7219805347f), new Float3(-0.1121887082f, -0.9673185067f, 0.2273952515f), new Float3(0.7344116094f, 0.5979668656f, -0.3210532909f), new Float3(0.5789393465f, -0.2488849713f, 0.7764570201f), new Float3(0.6988182827f, 0.3557169806f, -0.6205791146f), new Float3(-0.8636845529f, -0.2748771249f, -0.4224826141f), new Float3(-0.4247027957f, -0.4640880967f, 0.777335046f), new Float3(0.5257722489f, -0.8427017621f, 0.1158329937f), new Float3(0.9343830603f, 0.316302472f, -0.1639543925f), new Float3(-0.1016836419f, -0.8057303073f, -0.5834887393f), new Float3(-0.6529238969f, 0.50602126f, -0.5635892736f), new Float3(-0.2465286165f, -0.9668205684f, -0.06694497494f), new Float3(-0.9776897119f, -0.2099250524f, -0.007368825344f), new Float3(0.7736893337f, 0.5734244712f, 0.2694238123f), new Float3(-0.6095087895f, 0.4995678998f, 0.6155736747f), new Float3(0.5794535482f, 0.7434546771f, 0.3339292269f), new Float3(-0.8226211154f, 0.08142581855f, 0.5627293636f), new Float3(-0.510385483f, 0.4703667658f, 0.7199039967f), new Float3(-0.5764971849f, -0.07231656274f, -0.8138926898f), new Float3(0.7250628871f, 0.3949971505f, -0.5641463116f), new Float3(-0.1525424005f, 0.4860840828f, -0.8604958341f), new Float3(-0.5550976208f, -0.4957820792f, 0.667882296f), new Float3(-0.1883614327f, 0.9145869398f, 0.357841725f), new Float3(0.7625556724f, -0.5414408243f, -0.3540489801f), new Float3(-0.5870231946f, -0.3226498013f, -0.7424963803f), new Float3(0.3051124198f, 0.2262544068f, -0.9250488391f), new Float3(0.6379576059f, 0.577242424f, -0.5097070502f), new Float3(-0.5966775796f, 0.1454852398f, -0.7891830656f), new Float3(-0.658330573f, 0.6555487542f, -0.3699414651f), new Float3(0.7434892426f, 0.2351084581f, 0.6260573129f), new Float3(0.5562114096f, 0.8264360377f, -0.0873632843f), new Float3(-0.3028940016f, -0.8251527185f, 0.4768419182f), new Float3(0.1129343818f, -0.985888439f, -0.1235710781f), new Float3(0.5937652891f, -0.5896813806f, 0.5474656618f), new Float3(0.6757964092f, -0.5835758614f, -0.4502648413f), new Float3(0.7242302609f, -0.1152719764f, 0.6798550586f), new Float3(-0.9511914166f, 0.0753623979f, -0.2992580792f), new Float3(0.2539470961f, -0.1886339355f, 0.9486454084f), new Float3(0.571433621f, -0.1679450851f, -0.8032795685f), new Float3(-0.06778234979f, 0.3978269256f, 0.9149531629f), new Float3(0.6074972649f, 0.733060024f, -0.3058922593f), new Float3(-0.5435478392f, 0.1675822484f, 0.8224791405f), new Float3(-0.5876678086f, -0.3380045064f, -0.7351186982f), new Float3(-0.7967562402f, 0.04097822706f, -0.6029098428f), new Float3(-0.1996350917f, 0.8706294745f, 0.4496111079f), new Float3(-0.02787660336f, -0.9106232682f, -0.4122962022f), new Float3(-0.7797625996f, -0.6257634692f, 0.01975775581f), new Float3(-0.5211232846f, 0.7401644346f, -0.4249554471f), new Float3(0.8575424857f, 0.4053272873f, -0.3167501783f), new Float3(0.1045223322f, 0.8390195772f, -0.5339674439f), new Float3(0.3501822831f, 0.9242524096f, -0.1520850155f), new Float3(0.1987849858f, 0.07647613266f, 0.9770547224f), new Float3(0.7845996363f, 0.6066256811f, -0.1280964233f), new Float3(0.09006737436f, -0.9750989929f, -0.2026569073f), new Float3(-0.8274343547f, -0.542299559f, 0.1458203587f), new Float3(-0.3485797732f, -0.415802277f, 0.840000362f), new Float3(-0.2471778936f, -0.7304819962f, -0.6366310879f), new Float3(-0.3700154943f, 0.8577948156f, 0.3567584454f), new Float3(0.5913394901f, -0.548311967f, -0.5913303597f), new Float3(0.1204873514f, -0.7626472379f, -0.6354935001f), new Float3(0.616959265f, 0.03079647928f, 0.7863922953f), new Float3(0.1258156836f, -0.6640829889f, -0.7369967419f), new Float3(-0.6477565124f, -0.1740147258f, -0.7417077429f), new Float3(0.6217889313f, -0.7804430448f, -0.06547655076f), new Float3(0.6589943422f, -0.6096987708f, 0.4404473475f), new Float3(-0.2689837504f, -0.6732403169f, -0.6887635427f), new Float3(-0.3849775103f, 0.5676542638f, 0.7277093879f), new Float3(0.5754444408f, 0.8110471154f, -0.1051963504f), new Float3(0.9141593684f, 0.3832947817f, 0.131900567f), new Float3(-0.107925319f, 0.9245493968f, 0.3654593525f), new Float3(0.377977089f, 0.3043148782f, 0.8743716458f), new Float3(-0.2142885215f, -0.8259286236f, 0.5214617324f), new Float3(0.5802544474f, 0.4148098596f, -0.7008834116f), new Float3(-0.1982660881f, 0.8567161266f, -0.4761596756f), new Float3(-0.03381553704f, 0.3773180787f, -0.9254661404f), new Float3(-0.6867922841f, -0.6656597827f, 0.2919133642f), new Float3(0.7731742607f, -0.2875793547f, -0.5652430251f), new Float3(-0.09655941928f, 0.9193708367f, -0.3813575004f), new Float3(0.2715702457f, -0.9577909544f, -0.09426605581f), new Float3(0.2451015704f, -0.6917998565f, -0.6792188003f), new Float3(0.977700782f, -0.1753855374f, 0.1155036542f), new Float3(-0.5224739938f, 0.8521606816f, 0.02903615945f), new Float3(-0.7734880599f, -0.5261292347f, 0.3534179531f), new Float3(-0.7134492443f, -0.269547243f, 0.6467878011f), new Float3(0.1644037271f, 0.5105846203f, -0.8439637196f), new Float3(0.6494635788f, 0.05585611296f, 0.7583384168f), new Float3(-0.4711970882f, 0.5017280509f, -0.7254255765f), new Float3(-0.6335764307f, -0.2381686273f, -0.7361091029f), new Float3(-0.9021533097f, -0.270947803f, -0.3357181763f), new Float3(-0.3793711033f, 0.872258117f, 0.3086152025f), new Float3(-0.6855598966f, -0.3250143309f, 0.6514394162f), new Float3(0.2900942212f, -0.7799057743f, -0.5546100667f), new Float3(-0.2098319339f, 0.85037073f, 0.4825351604f), new Float3(-0.4592603758f, 0.6598504336f, -0.5947077538f), new Float3(0.8715945488f, 0.09616365406f, -0.4807031248f), new Float3(-0.6776666319f, 0.7118504878f, -0.1844907016f), new Float3(0.7044377633f, 0.312427597f, 0.637304036f), new Float3(-0.7052318886f, -0.2401093292f, -0.6670798253f), new Float3(0.081921007f, -0.7207336136f, -0.6883545647f), new Float3(-0.6993680906f, -0.5875763221f, -0.4069869034f), new Float3(-0.1281454481f, 0.6419895885f, 0.7559286424f), new Float3(-0.6337388239f, -0.6785471501f, -0.3714146849f), new Float3(0.5565051903f, -0.2168887573f, -0.8020356851f), new Float3(-0.5791554484f, 0.7244372011f, -0.3738578718f), new Float3(0.1175779076f, -0.7096451073f, 0.6946792478f), new Float3(-0.6134619607f, 0.1323631078f, 0.7785527795f), new Float3(0.6984635305f, -0.02980516237f, -0.715024719f), new Float3(0.8318082963f, -0.3930171956f, 0.3919597455f), new Float3(0.1469576422f, 0.05541651717f, -0.9875892167f), new Float3(0.708868575f, -0.2690503865f, 0.6520101478f), new Float3(0.2726053183f, 0.67369766f, -0.68688995f), new Float3(-0.6591295371f, 0.3035458599f, -0.6880466294f), new Float3(0.4815131379f, -0.7528270071f, 0.4487723203f), new Float3(0.9430009463f, 0.1675647412f, -0.2875261255f), new Float3(0.434802957f, 0.7695304522f, -0.4677277752f), new Float3(0.3931996188f, 0.594473625f, 0.7014236729f), new Float3(0.7254336655f, -0.603925654f, 0.3301814672f), new Float3(0.7590235227f, -0.6506083235f, 0.02433313207f), new Float3(-0.8552768592f, -0.3430042733f, 0.3883935666f), new Float3(-0.6139746835f, 0.6981725247f, 0.3682257648f), new Float3(-0.7465905486f, -0.5752009504f, 0.3342849376f), new Float3(0.5730065677f, 0.810555537f, -0.1210916791f), new Float3(-0.9225877367f, -0.3475211012f, -0.167514036f), new Float3(-0.7105816789f, -0.4719692027f, -0.5218416899f), new Float3(-0.08564609717f, 0.3583001386f, 0.929669703f), new Float3(-0.8279697606f, -0.2043157126f, 0.5222271202f), new Float3(0.427944023f, 0.278165994f, 0.8599346446f), new Float3(0.5399079671f, -0.7857120652f, -0.3019204161f), new Float3(0.5678404253f, -0.5495413974f, -0.6128307303f), new Float3(-0.9896071041f, 0.1365639107f, -0.04503418428f), new Float3(-0.6154342638f, -0.6440875597f, 0.4543037336f), new Float3(0.1074204368f, -0.7946340692f, 0.5975094525f), new Float3(-0.3595449969f, -0.8885529948f, 0.28495784f), new Float3(-0.2180405296f, 0.1529888965f, 0.9638738118f), new Float3(-0.7277432317f, -0.6164050508f, -0.3007234646f), new Float3(0.7249729114f, -0.00669719484f, 0.6887448187f), new Float3(-0.5553659455f, -0.5336586252f, 0.6377908264f), new Float3(0.5137558015f, 0.7976208196f, -0.3160000073f), new Float3(-0.3794024848f, 0.9245608561f, -0.03522751494f), new Float3(0.8229248658f, 0.2745365933f, -0.4974176556f), new Float3(-0.5404114394f, 0.6091141441f, 0.5804613989f), new Float3(0.8036581901f, -0.2703029469f, 0.5301601931f), new Float3(0.6044318879f, 0.6832968393f, 0.4095943388f), new Float3(0.06389988817f, 0.9658208605f, -0.2512108074f), new Float3(0.1087113286f, 0.7402471173f, -0.6634877936f), new Float3(-0.713427712f, -0.6926784018f, 0.1059128479f), new Float3(0.6458897819f, -0.5724548511f, -0.5050958653f), new Float3(-0.6553931414f, 0.7381471625f, 0.159995615f), new Float3(0.3910961323f, 0.9188871375f, -0.05186755998f), new Float3(-0.4879022471f, -0.5904376907f, 0.6429111375f), new Float3(0.6014790094f, 0.7707441366f, -0.2101820095f), new Float3(-0.5677173047f, 0.7511360995f, 0.3368851762f), new Float3(0.7858573506f, 0.226674665f, 0.5753666838f), new Float3(-0.4520345543f, -0.604222686f, -0.6561857263f), new Float3(0.002272116345f, 0.4132844051f, -0.9105991643f), new Float3(-0.5815751419f, -0.5162925989f, 0.6286591339f), new Float3(-0.03703704785f, 0.8273785755f, 0.5604221175f), new Float3(-0.5119692504f, 0.7953543429f, -0.3244980058f), new Float3(-0.2682417366f, -0.9572290247f, -0.1084387619f), new Float3(-0.2322482736f, -0.9679131102f, -0.09594243324f), new Float3(0.3554328906f, -0.8881505545f, 0.2913006227f), new Float3(0.7346520519f, -0.4371373164f, 0.5188422971f), new Float3(0.9985120116f, 0.04659011161f, -0.02833944577f), new Float3(-0.3727687496f, -0.9082481361f, 0.1900757285f), new Float3(0.91737377f, -0.3483642108f, 0.1925298489f), new Float3(0.2714911074f, 0.4147529736f, -0.8684886582f), new Float3(0.5131763485f, -0.7116334161f, 0.4798207128f), new Float3(-0.8737353606f, 0.18886992f, -0.4482350644f), new Float3(0.8460043821f, -0.3725217914f, 0.3814499973f), new Float3(0.8978727456f, -0.1780209141f, -0.4026575304f), new Float3(0.2178065647f, -0.9698322841f, -0.1094789531f), new Float3(-0.1518031304f, -0.7788918132f, -0.6085091231f), new Float3(-0.2600384876f, -0.4755398075f, -0.8403819825f), new Float3(0.572313509f, -0.7474340931f, -0.3373418503f), new Float3(-0.7174141009f, 0.1699017182f, -0.6756111411f), new Float3(-0.684180784f, 0.02145707593f, -0.7289967412f), new Float3(-0.2007447902f, 0.06555605789f, -0.9774476623f), new Float3(-0.1148803697f, -0.8044887315f, 0.5827524187f), new Float3(-0.7870349638f, 0.03447489231f, 0.6159443543f), new Float3(-0.2015596421f, 0.6859872284f, 0.6991389226f), new Float3(-0.08581082512f, -0.10920836f, -0.9903080513f), new Float3(0.5532693395f, 0.7325250401f, -0.396610771f), new Float3(-0.1842489331f, -0.9777375055f, -0.1004076743f), new Float3(0.0775473789f, -0.9111505856f, 0.4047110257f), new Float3(0.1399838409f, 0.7601631212f, -0.6344734459f), new Float3(0.4484419361f, -0.845289248f, 0.2904925424f), }; [MethodImplAttribute(FN_INLINE)] private static int FastFloor(FN_DECIMAL f) { return (f >= 0 ? (int)f : (int)f - 1); } [MethodImplAttribute(FN_INLINE)] private static int FastRound(FN_DECIMAL f) { return (f >= 0) ? (int)(f + (FN_DECIMAL)0.5) : (int)(f - (FN_DECIMAL)0.5); } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL Lerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL t) { return a + t * (b - a); } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL InterpHermiteFunc(FN_DECIMAL t) { return t * t * (3 - 2 * t); } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL InterpQuinticFunc(FN_DECIMAL t) { return t * t * t * (t * (t * 6 - 15) + 10); } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL CubicLerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL c, FN_DECIMAL d, FN_DECIMAL t) { FN_DECIMAL p = (d - c) - (a - b); return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; } private void CalculateFractalBounding() { FN_DECIMAL amp = m_gain; FN_DECIMAL ampFractal = 1; for (int i = 1; i < m_octaves; i++) { ampFractal += amp; amp *= m_gain; } m_fractalBounding = 1 / ampFractal; } // Hashing private const int X_PRIME = 1619; private const int Y_PRIME = 31337; private const int Z_PRIME = 6971; private const int W_PRIME = 1013; [MethodImplAttribute(FN_INLINE)] private static int Hash2D(int seed, int x, int y) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; return hash; } [MethodImplAttribute(FN_INLINE)] private static int Hash3D(int seed, int x, int y, int z) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash ^= Z_PRIME * z; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; return hash; } [MethodImplAttribute(FN_INLINE)] private static int Hash4D(int seed, int x, int y, int z, int w) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash ^= Z_PRIME * z; hash ^= W_PRIME * w; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; return hash; } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL ValCoord2D(int seed, int x, int y) { int n = seed; n ^= X_PRIME * x; n ^= Y_PRIME * y; return (n * n * n * 60493) / (FN_DECIMAL)2147483648.0; } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL ValCoord3D(int seed, int x, int y, int z) { int n = seed; n ^= X_PRIME * x; n ^= Y_PRIME * y; n ^= Z_PRIME * z; return (n * n * n * 60493) / (FN_DECIMAL)2147483648.0; } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL ValCoord4D(int seed, int x, int y, int z, int w) { int n = seed; n ^= X_PRIME * x; n ^= Y_PRIME * y; n ^= Z_PRIME * z; n ^= W_PRIME * w; return (n * n * n * 60493) / (FN_DECIMAL)2147483648.0; } // TODO grad2cord [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL GradCoord2D(int seed, int x, int y, FN_DECIMAL xd, FN_DECIMAL yd) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; Float2 g = GRAD_2D[hash & 7]; return xd * g.x + yd * g.y; } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL GradCoord3D(int seed, int x, int y, int z, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash ^= Z_PRIME * z; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; Float3 g = GRAD_3D[hash & 15]; return xd * g.x + yd * g.y + zd * g.z; } [MethodImplAttribute(FN_INLINE)] private static FN_DECIMAL GradCoord4D(int seed, int x, int y, int z, int w, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd, FN_DECIMAL wd) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash ^= Z_PRIME * z; hash ^= W_PRIME * w; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; hash &= 31; FN_DECIMAL a = yd, b = zd, c = wd; // X,Y,Z switch (hash >> 3) { // OR, DEPENDING ON HIGH ORDER 2 BITS: case 1: a = wd; b = xd; c = yd; break; // W,X,Y case 2: a = zd; b = wd; c = xd; break; // Z,W,X case 3: a = yd; b = zd; c = wd; break; // Y,Z,W } return ((hash & 4) == 0 ? -a : a) + ((hash & 2) == 0 ? -b : b) + ((hash & 1) == 0 ? -c : c); } public FN_DECIMAL GetNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { x *= m_frequency; y *= m_frequency; z *= m_frequency; switch (m_noiseType) { case NoiseType.Value: return SingleValue(m_seed, x, y, z); case NoiseType.ValueFractal: switch (m_fractalType) { case FractalType.FBM: return SingleValueFractalFBM(x, y, z); case FractalType.Billow: return SingleValueFractalBillow(x, y, z); case FractalType.RigidMulti: return SingleValueFractalRigidMulti(x, y, z); default: return 0; } case NoiseType.Perlin: return SinglePerlin(m_seed, x, y, z); case NoiseType.PerlinFractal: switch (m_fractalType) { case FractalType.FBM: return SinglePerlinFractalFBM(x, y, z); case FractalType.Billow: return SinglePerlinFractalBillow(x, y, z); case FractalType.RigidMulti: return SinglePerlinFractalRigidMulti(x, y, z); default: return 0; } case NoiseType.Simplex: return SingleSimplex(m_seed, x, y, z); case NoiseType.SimplexFractal: switch (m_fractalType) { case FractalType.FBM: return SingleSimplexFractalFBM(x, y, z); case FractalType.Billow: return SingleSimplexFractalBillow(x, y, z); case FractalType.RigidMulti: return SingleSimplexFractalRigidMulti(x, y, z); default: return 0; } case NoiseType.Cellular: switch (m_cellularReturnType) { case CellularReturnType.CellValue: case CellularReturnType.NoiseLookup: case CellularReturnType.Distance: return SingleCellular(x, y, z); default: return SingleCellular2Edge(x, y, z); } case NoiseType.WhiteNoise: return GetWhiteNoise(x, y, z); case NoiseType.Cubic: return SingleCubic(m_seed, x, y, z); case NoiseType.CubicFractal: switch (m_fractalType) { case FractalType.FBM: return SingleCubicFractalFBM(x, y, z); case FractalType.Billow: return SingleCubicFractalBillow(x, y, z); case FractalType.RigidMulti: return SingleCubicFractalRigidMulti(x, y, z); default: return 0; } default: return 0; } } public FN_DECIMAL GetNoise(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; switch (m_noiseType) { case NoiseType.Value: return SingleValue(m_seed, x, y); case NoiseType.ValueFractal: switch (m_fractalType) { case FractalType.FBM: return SingleValueFractalFBM(x, y); case FractalType.Billow: return SingleValueFractalBillow(x, y); case FractalType.RigidMulti: return SingleValueFractalRigidMulti(x, y); default: return 0; } case NoiseType.Perlin: return SinglePerlin(m_seed, x, y); case NoiseType.PerlinFractal: switch (m_fractalType) { case FractalType.FBM: return SinglePerlinFractalFBM(x, y); case FractalType.Billow: return SinglePerlinFractalBillow(x, y); case FractalType.RigidMulti: return SinglePerlinFractalRigidMulti(x, y); default: return 0; } case NoiseType.Simplex: return SingleSimplex(m_seed, x, y); case NoiseType.SimplexFractal: switch (m_fractalType) { case FractalType.FBM: return SingleSimplexFractalFBM(x, y); case FractalType.Billow: return SingleSimplexFractalBillow(x, y); case FractalType.RigidMulti: return SingleSimplexFractalRigidMulti(x, y); default: return 0; } case NoiseType.Cellular: switch (m_cellularReturnType) { case CellularReturnType.CellValue: case CellularReturnType.NoiseLookup: case CellularReturnType.Distance: return SingleCellular(x, y); default: return SingleCellular2Edge(x, y); } case NoiseType.WhiteNoise: return GetWhiteNoise(x, y); case NoiseType.Cubic: return SingleCubic(m_seed, x, y); case NoiseType.CubicFractal: switch (m_fractalType) { case FractalType.FBM: return SingleCubicFractalFBM(x, y); case FractalType.Billow: return SingleCubicFractalBillow(x, y); case FractalType.RigidMulti: return SingleCubicFractalRigidMulti(x, y); default: return 0; } default: return 0; } } // White Noise [MethodImplAttribute(FN_INLINE)] private int FloatCast2Int(FN_DECIMAL f) { var i = BitConverter.DoubleToInt64Bits(f); return (int)(i ^ (i >> 32)); } public FN_DECIMAL GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) { int xi = FloatCast2Int(x); int yi = FloatCast2Int(y); int zi = FloatCast2Int(z); int wi = FloatCast2Int(w); return ValCoord4D(m_seed, xi, yi, zi, wi); } public FN_DECIMAL GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int xi = FloatCast2Int(x); int yi = FloatCast2Int(y); int zi = FloatCast2Int(z); return ValCoord3D(m_seed, xi, yi, zi); } public FN_DECIMAL GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y) { int xi = FloatCast2Int(x); int yi = FloatCast2Int(y); return ValCoord2D(m_seed, xi, yi); } public FN_DECIMAL GetWhiteNoiseInt(int x, int y, int z, int w) { return ValCoord4D(m_seed, x, y, z, w); } public FN_DECIMAL GetWhiteNoiseInt(int x, int y, int z) { return ValCoord3D(m_seed, x, y, z); } public FN_DECIMAL GetWhiteNoiseInt(int x, int y) { return ValCoord2D(m_seed, x, y); } // Value Noise public FN_DECIMAL GetValueFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { x *= m_frequency; y *= m_frequency; z *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SingleValueFractalFBM(x, y, z); case FractalType.Billow: return SingleValueFractalBillow(x, y, z); case FractalType.RigidMulti: return SingleValueFractalRigidMulti(x, y, z); default: return 0; } } private FN_DECIMAL SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = SingleValue(seed, x, y, z); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += SingleValue(++seed, x, y, z) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SingleValue(seed, x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SingleValue(++seed, x, y, z)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SingleValue(seed, x, y, z)); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SingleValue(++seed, x, y, z))) * amp; } return sum; } public FN_DECIMAL GetValue(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { return SingleValue(m_seed, x * m_frequency, y * m_frequency, z * m_frequency); } private FN_DECIMAL SingleValue(int seed, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int x0 = FastFloor(x); int y0 = FastFloor(y); int z0 = FastFloor(z); int x1 = x0 + 1; int y1 = y0 + 1; int z1 = z0 + 1; FN_DECIMAL xs, ys, zs; switch (m_interp) { default: case Interp.Linear: xs = x - x0; ys = y - y0; zs = z - z0; break; case Interp.Hermite: xs = InterpHermiteFunc(x - x0); ys = InterpHermiteFunc(y - y0); zs = InterpHermiteFunc(z - z0); break; case Interp.Quintic: xs = InterpQuinticFunc(x - x0); ys = InterpQuinticFunc(y - y0); zs = InterpQuinticFunc(z - z0); break; } FN_DECIMAL xf00 = Lerp(ValCoord3D(seed, x0, y0, z0), ValCoord3D(seed, x1, y0, z0), xs); FN_DECIMAL xf10 = Lerp(ValCoord3D(seed, x0, y1, z0), ValCoord3D(seed, x1, y1, z0), xs); FN_DECIMAL xf01 = Lerp(ValCoord3D(seed, x0, y0, z1), ValCoord3D(seed, x1, y0, z1), xs); FN_DECIMAL xf11 = Lerp(ValCoord3D(seed, x0, y1, z1), ValCoord3D(seed, x1, y1, z1), xs); FN_DECIMAL yf0 = Lerp(xf00, xf10, ys); FN_DECIMAL yf1 = Lerp(xf01, xf11, ys); return Lerp(yf0, yf1, zs); } public FN_DECIMAL GetValueFractal(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SingleValueFractalFBM(x, y); case FractalType.Billow: return SingleValueFractalBillow(x, y); case FractalType.RigidMulti: return SingleValueFractalRigidMulti(x, y); default: return 0; } } private FN_DECIMAL SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = SingleValue(seed, x, y); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += SingleValue(++seed, x, y) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SingleValue(seed, x, y)) * 2 - 1; FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SingleValue(++seed, x, y)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SingleValue(seed, x, y)); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SingleValue(++seed, x, y))) * amp; } return sum; } public FN_DECIMAL GetValue(FN_DECIMAL x, FN_DECIMAL y) { return SingleValue(m_seed, x * m_frequency, y * m_frequency); } private FN_DECIMAL SingleValue(int seed, FN_DECIMAL x, FN_DECIMAL y) { int x0 = FastFloor(x); int y0 = FastFloor(y); int x1 = x0 + 1; int y1 = y0 + 1; FN_DECIMAL xs, ys; switch (m_interp) { default: case Interp.Linear: xs = x - x0; ys = y - y0; break; case Interp.Hermite: xs = InterpHermiteFunc(x - x0); ys = InterpHermiteFunc(y - y0); break; case Interp.Quintic: xs = InterpQuinticFunc(x - x0); ys = InterpQuinticFunc(y - y0); break; } FN_DECIMAL xf0 = Lerp(ValCoord2D(seed, x0, y0), ValCoord2D(seed, x1, y0), xs); FN_DECIMAL xf1 = Lerp(ValCoord2D(seed, x0, y1), ValCoord2D(seed, x1, y1), xs); return Lerp(xf0, xf1, ys); } // Gradient Noise public FN_DECIMAL GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { x *= m_frequency; y *= m_frequency; z *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SinglePerlinFractalFBM(x, y, z); case FractalType.Billow: return SinglePerlinFractalBillow(x, y, z); case FractalType.RigidMulti: return SinglePerlinFractalRigidMulti(x, y, z); default: return 0; } } private FN_DECIMAL SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = SinglePerlin(seed, x, y, z); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += SinglePerlin(++seed, x, y, z) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SinglePerlin(seed, x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SinglePerlin(++seed, x, y, z)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SinglePerlin(seed, x, y, z)); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SinglePerlin(++seed, x, y, z))) * amp; } return sum; } public FN_DECIMAL GetPerlin(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { return SinglePerlin(m_seed, x * m_frequency, y * m_frequency, z * m_frequency); } private FN_DECIMAL SinglePerlin(int seed, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int x0 = FastFloor(x); int y0 = FastFloor(y); int z0 = FastFloor(z); int x1 = x0 + 1; int y1 = y0 + 1; int z1 = z0 + 1; FN_DECIMAL xs, ys, zs; switch (m_interp) { default: case Interp.Linear: xs = x - x0; ys = y - y0; zs = z - z0; break; case Interp.Hermite: xs = InterpHermiteFunc(x - x0); ys = InterpHermiteFunc(y - y0); zs = InterpHermiteFunc(z - z0); break; case Interp.Quintic: xs = InterpQuinticFunc(x - x0); ys = InterpQuinticFunc(y - y0); zs = InterpQuinticFunc(z - z0); break; } FN_DECIMAL xd0 = x - x0; FN_DECIMAL yd0 = y - y0; FN_DECIMAL zd0 = z - z0; FN_DECIMAL xd1 = xd0 - 1; FN_DECIMAL yd1 = yd0 - 1; FN_DECIMAL zd1 = zd0 - 1; FN_DECIMAL xf00 = Lerp(GradCoord3D(seed, x0, y0, z0, xd0, yd0, zd0), GradCoord3D(seed, x1, y0, z0, xd1, yd0, zd0), xs); FN_DECIMAL xf10 = Lerp(GradCoord3D(seed, x0, y1, z0, xd0, yd1, zd0), GradCoord3D(seed, x1, y1, z0, xd1, yd1, zd0), xs); FN_DECIMAL xf01 = Lerp(GradCoord3D(seed, x0, y0, z1, xd0, yd0, zd1), GradCoord3D(seed, x1, y0, z1, xd1, yd0, zd1), xs); FN_DECIMAL xf11 = Lerp(GradCoord3D(seed, x0, y1, z1, xd0, yd1, zd1), GradCoord3D(seed, x1, y1, z1, xd1, yd1, zd1), xs); FN_DECIMAL yf0 = Lerp(xf00, xf10, ys); FN_DECIMAL yf1 = Lerp(xf01, xf11, ys); return Lerp(yf0, yf1, zs); } public FN_DECIMAL GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SinglePerlinFractalFBM(x, y); case FractalType.Billow: return SinglePerlinFractalBillow(x, y); case FractalType.RigidMulti: return SinglePerlinFractalRigidMulti(x, y); default: return 0; } } private FN_DECIMAL SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = SinglePerlin(seed, x, y); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += SinglePerlin(++seed, x, y) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SinglePerlin(seed, x, y)) * 2 - 1; FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SinglePerlin(++seed, x, y)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SinglePerlin(seed, x, y)); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SinglePerlin(++seed, x, y))) * amp; } return sum; } // TODO public FN_DECIMAL GetPerlin(FN_DECIMAL x, FN_DECIMAL y) { return SinglePerlin(m_seed, x * m_frequency, y * m_frequency); } private FN_DECIMAL SinglePerlin(int seed, FN_DECIMAL x, FN_DECIMAL y) { int x0 = FastFloor(x); int y0 = FastFloor(y); int x1 = x0 + 1; int y1 = y0 + 1; FN_DECIMAL xs, ys; switch (m_interp) { default: case Interp.Linear: xs = x - x0; ys = y - y0; break; case Interp.Hermite: xs = InterpHermiteFunc(x - x0); ys = InterpHermiteFunc(y - y0); break; case Interp.Quintic: xs = InterpQuinticFunc(x - x0); ys = InterpQuinticFunc(y - y0); break; } FN_DECIMAL xd0 = x - x0; FN_DECIMAL yd0 = y - y0; FN_DECIMAL xd1 = xd0 - 1; FN_DECIMAL yd1 = yd0 - 1; FN_DECIMAL xf0 = Lerp(GradCoord2D(seed, x0, y0, xd0, yd0), GradCoord2D(seed, x1, y0, xd1, yd0), xs); FN_DECIMAL xf1 = Lerp(GradCoord2D(seed, x0, y1, xd0, yd1), GradCoord2D(seed, x1, y1, xd1, yd1), xs); return Lerp(xf0, xf1, ys); } // Simplex Noise public FN_DECIMAL GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { x *= m_frequency; y *= m_frequency; z *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SingleSimplexFractalFBM(x, y, z); case FractalType.Billow: return SingleSimplexFractalBillow(x, y, z); case FractalType.RigidMulti: return SingleSimplexFractalRigidMulti(x, y, z); default: return 0; } } private FN_DECIMAL SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = SingleSimplex(seed, x, y, z); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += SingleSimplex(++seed, x, y, z) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SingleSimplex(seed, x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SingleSimplex(++seed, x, y, z)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SingleSimplex(seed, x, y, z)); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SingleSimplex(++seed, x, y, z))) * amp; } return sum; } public FN_DECIMAL GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { return SingleSimplex(m_seed, x * m_frequency, y * m_frequency, z * m_frequency); } private const FN_DECIMAL F3 = (FN_DECIMAL)(1.0 / 3.0); private const FN_DECIMAL G3 = (FN_DECIMAL)(1.0 / 6.0); private const FN_DECIMAL G33 = G3 * 3 - 1; private FN_DECIMAL SingleSimplex(int seed, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { FN_DECIMAL t = (x + y + z) * F3; int i = FastFloor(x + t); int j = FastFloor(y + t); int k = FastFloor(z + t); t = (i + j + k) * G3; FN_DECIMAL x0 = x - (i - t); FN_DECIMAL y0 = y - (j - t); FN_DECIMAL z0 = z - (k - t); int i1, j1, k1; int i2, j2, k2; if (x0 >= y0) { if (y0 >= z0) { i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 1; k2 = 0; } else if (x0 >= z0) { i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 0; k2 = 1; } else // x0 < z0 { i1 = 0; j1 = 0; k1 = 1; i2 = 1; j2 = 0; k2 = 1; } } else // x0 < y0 { if (y0 < z0) { i1 = 0; j1 = 0; k1 = 1; i2 = 0; j2 = 1; k2 = 1; } else if (x0 < z0) { i1 = 0; j1 = 1; k1 = 0; i2 = 0; j2 = 1; k2 = 1; } else // x0 >= z0 { i1 = 0; j1 = 1; k1 = 0; i2 = 1; j2 = 1; k2 = 0; } } FN_DECIMAL x1 = x0 - i1 + G3; FN_DECIMAL y1 = y0 - j1 + G3; FN_DECIMAL z1 = z0 - k1 + G3; FN_DECIMAL x2 = x0 - i2 + F3; FN_DECIMAL y2 = y0 - j2 + F3; FN_DECIMAL z2 = z0 - k2 + F3; FN_DECIMAL x3 = x0 + G33; FN_DECIMAL y3 = y0 + G33; FN_DECIMAL z3 = z0 + G33; FN_DECIMAL n0, n1, n2, n3; t = (FN_DECIMAL)0.6 - x0 * x0 - y0 * y0 - z0 * z0; if (t < 0) n0 = 0; else { t *= t; n0 = t * t * GradCoord3D(seed, i, j, k, x0, y0, z0); } t = (FN_DECIMAL)0.6 - x1 * x1 - y1 * y1 - z1 * z1; if (t < 0) n1 = 0; else { t *= t; n1 = t * t * GradCoord3D(seed, i + i1, j + j1, k + k1, x1, y1, z1); } t = (FN_DECIMAL)0.6 - x2 * x2 - y2 * y2 - z2 * z2; if (t < 0) n2 = 0; else { t *= t; n2 = t * t * GradCoord3D(seed, i + i2, j + j2, k + k2, x2, y2, z2); } t = (FN_DECIMAL)0.6 - x3 * x3 - y3 * y3 - z3 * z3; if (t < 0) n3 = 0; else { t *= t; n3 = t * t * GradCoord3D(seed, i + 1, j + 1, k + 1, x3, y3, z3); } return 32 * (n0 + n1 + n2 + n3); } public FN_DECIMAL GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SingleSimplexFractalFBM(x, y); case FractalType.Billow: return SingleSimplexFractalBillow(x, y); case FractalType.RigidMulti: return SingleSimplexFractalRigidMulti(x, y); default: return 0; } } private FN_DECIMAL SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = SingleSimplex(seed, x, y); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += SingleSimplex(++seed, x, y) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SingleSimplex(seed, x, y)) * 2 - 1; FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SingleSimplex(++seed, x, y)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SingleSimplex(seed, x, y)); FN_DECIMAL amp = 1; for (int i = 1; i < m_octaves; i++) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SingleSimplex(++seed, x, y))) * amp; } return sum; } public FN_DECIMAL GetSimplex(FN_DECIMAL x, FN_DECIMAL y) { return SingleSimplex(m_seed, x * m_frequency, y * m_frequency); } private const FN_DECIMAL F2 = (FN_DECIMAL)(1.0 / 2.0); private const FN_DECIMAL G2 = (FN_DECIMAL)(1.0 / 4.0); private FN_DECIMAL SingleSimplex(int seed, FN_DECIMAL x, FN_DECIMAL y) { FN_DECIMAL t = (x + y) * F2; int i = FastFloor(x + t); int j = FastFloor(y + t); t = (i + j) * G2; FN_DECIMAL X0 = i - t; FN_DECIMAL Y0 = j - t; FN_DECIMAL x0 = x - X0; FN_DECIMAL y0 = y - Y0; int i1, j1; if (x0 > y0) { i1 = 1; j1 = 0; } else { i1 = 0; j1 = 1; } FN_DECIMAL x1 = x0 - i1 + G2; FN_DECIMAL y1 = y0 - j1 + G2; FN_DECIMAL x2 = x0 - 1 + F2; FN_DECIMAL y2 = y0 - 1 + F2; FN_DECIMAL n0, n1, n2; t = (FN_DECIMAL)0.5 - x0 * x0 - y0 * y0; if (t < 0) n0 = 0; else { t *= t; n0 = t * t * GradCoord2D(seed, i, j, x0, y0); } t = (FN_DECIMAL)0.5 - x1 * x1 - y1 * y1; if (t < 0) n1 = 0; else { t *= t; n1 = t * t * GradCoord2D(seed, i + i1, j + j1, x1, y1); } t = (FN_DECIMAL)0.5 - x2 * x2 - y2 * y2; if (t < 0) n2 = 0; else { t *= t; n2 = t * t * GradCoord2D(seed, i + 1, j + 1, x2, y2); } return 50 * (n0 + n1 + n2); } public FN_DECIMAL GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) { return SingleSimplex(m_seed, x * m_frequency, y * m_frequency, z * m_frequency, w * m_frequency); } private static readonly byte[] SIMPLEX_4D = { 0,1,2,3,0,1,3,2,0,0,0,0,0,2,3,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,0, 0,2,1,3,0,0,0,0,0,3,1,2,0,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,2,0,3,0,0,0,0,1,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,1,2,3,1,0, 1,0,2,3,1,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,1,0,0,0,0,2,1,3,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2,0,1,3,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,2,3,0,2,1,0,0,0,0,3,1,2,0, 2,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,3,1,0,2,0,0,0,0,3,2,0,1,3,2,1,0 }; private const FN_DECIMAL F4 = (FN_DECIMAL)((2.23606797 - 1.0) / 4.0); private const FN_DECIMAL G4 = (FN_DECIMAL)((5.0 - 2.23606797) / 20.0); private FN_DECIMAL SingleSimplex(int seed, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) { FN_DECIMAL n0, n1, n2, n3, n4; FN_DECIMAL t = (x + y + z + w) * F4; int i = FastFloor(x + t); int j = FastFloor(y + t); int k = FastFloor(z + t); int l = FastFloor(w + t); t = (i + j + k + l) * G4; FN_DECIMAL X0 = i - t; FN_DECIMAL Y0 = j - t; FN_DECIMAL Z0 = k - t; FN_DECIMAL W0 = l - t; FN_DECIMAL x0 = x - X0; FN_DECIMAL y0 = y - Y0; FN_DECIMAL z0 = z - Z0; FN_DECIMAL w0 = w - W0; int c = (x0 > y0) ? 32 : 0; c += (x0 > z0) ? 16 : 0; c += (y0 > z0) ? 8 : 0; c += (x0 > w0) ? 4 : 0; c += (y0 > w0) ? 2 : 0; c += (z0 > w0) ? 1 : 0; c <<= 2; int i1 = SIMPLEX_4D[c] >= 3 ? 1 : 0; int i2 = SIMPLEX_4D[c] >= 2 ? 1 : 0; int i3 = SIMPLEX_4D[c++] >= 1 ? 1 : 0; int j1 = SIMPLEX_4D[c] >= 3 ? 1 : 0; int j2 = SIMPLEX_4D[c] >= 2 ? 1 : 0; int j3 = SIMPLEX_4D[c++] >= 1 ? 1 : 0; int k1 = SIMPLEX_4D[c] >= 3 ? 1 : 0; int k2 = SIMPLEX_4D[c] >= 2 ? 1 : 0; int k3 = SIMPLEX_4D[c++] >= 1 ? 1 : 0; int l1 = SIMPLEX_4D[c] >= 3 ? 1 : 0; int l2 = SIMPLEX_4D[c] >= 2 ? 1 : 0; int l3 = SIMPLEX_4D[c] >= 1 ? 1 : 0; FN_DECIMAL x1 = x0 - i1 + G4; FN_DECIMAL y1 = y0 - j1 + G4; FN_DECIMAL z1 = z0 - k1 + G4; FN_DECIMAL w1 = w0 - l1 + G4; FN_DECIMAL x2 = x0 - i2 + 2 * G4; FN_DECIMAL y2 = y0 - j2 + 2 * G4; FN_DECIMAL z2 = z0 - k2 + 2 * G4; FN_DECIMAL w2 = w0 - l2 + 2 * G4; FN_DECIMAL x3 = x0 - i3 + 3 * G4; FN_DECIMAL y3 = y0 - j3 + 3 * G4; FN_DECIMAL z3 = z0 - k3 + 3 * G4; FN_DECIMAL w3 = w0 - l3 + 3 * G4; FN_DECIMAL x4 = x0 - 1 + 4 * G4; FN_DECIMAL y4 = y0 - 1 + 4 * G4; FN_DECIMAL z4 = z0 - 1 + 4 * G4; FN_DECIMAL w4 = w0 - 1 + 4 * G4; t = (FN_DECIMAL)0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; if (t < 0) n0 = 0; else { t *= t; n0 = t * t * GradCoord4D(seed, i, j, k, l, x0, y0, z0, w0); } t = (FN_DECIMAL)0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1; if (t < 0) n1 = 0; else { t *= t; n1 = t * t * GradCoord4D(seed, i + i1, j + j1, k + k1, l + l1, x1, y1, z1, w1); } t = (FN_DECIMAL)0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2; if (t < 0) n2 = 0; else { t *= t; n2 = t * t * GradCoord4D(seed, i + i2, j + j2, k + k2, l + l2, x2, y2, z2, w2); } t = (FN_DECIMAL)0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3; if (t < 0) n3 = 0; else { t *= t; n3 = t * t * GradCoord4D(seed, i + i3, j + j3, k + k3, l + l3, x3, y3, z3, w3); } t = (FN_DECIMAL)0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4; if (t < 0) n4 = 0; else { t *= t; n4 = t * t * GradCoord4D(seed, i + 1, j + 1, k + 1, l + 1, x4, y4, z4, w4); } return 27 * (n0 + n1 + n2 + n3 + n4); } // Cubic Noise public FN_DECIMAL GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { x *= m_frequency; y *= m_frequency; z *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SingleCubicFractalFBM(x, y, z); case FractalType.Billow: return SingleCubicFractalBillow(x, y, z); case FractalType.RigidMulti: return SingleCubicFractalRigidMulti(x, y, z); default: return 0; } } private FN_DECIMAL SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = SingleCubic(seed, x, y, z); FN_DECIMAL amp = 1; int i = 0; while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += SingleCubic(++seed, x, y, z) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SingleCubic(seed, x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SingleCubic(++seed, x, y, z)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SingleCubic(seed, x, y, z)); FN_DECIMAL amp = 1; int i = 0; while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SingleCubic(++seed, x, y, z))) * amp; } return sum; } public FN_DECIMAL GetCubic(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { return SingleCubic(m_seed, x * m_frequency, y * m_frequency, z * m_frequency); } private const FN_DECIMAL CUBIC_3D_BOUNDING = 1 / (FN_DECIMAL)(1.5 * 1.5 * 1.5); private FN_DECIMAL SingleCubic(int seed, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int x1 = FastFloor(x); int y1 = FastFloor(y); int z1 = FastFloor(z); int x0 = x1 - 1; int y0 = y1 - 1; int z0 = z1 - 1; int x2 = x1 + 1; int y2 = y1 + 1; int z2 = z1 + 1; int x3 = x1 + 2; int y3 = y1 + 2; int z3 = z1 + 2; FN_DECIMAL xs = x - x1; FN_DECIMAL ys = y - y1; FN_DECIMAL zs = z - z1; return CubicLerp( CubicLerp( CubicLerp(ValCoord3D(seed, x0, y0, z0), ValCoord3D(seed, x1, y0, z0), ValCoord3D(seed, x2, y0, z0), ValCoord3D(seed, x3, y0, z0), xs), CubicLerp(ValCoord3D(seed, x0, y1, z0), ValCoord3D(seed, x1, y1, z0), ValCoord3D(seed, x2, y1, z0), ValCoord3D(seed, x3, y1, z0), xs), CubicLerp(ValCoord3D(seed, x0, y2, z0), ValCoord3D(seed, x1, y2, z0), ValCoord3D(seed, x2, y2, z0), ValCoord3D(seed, x3, y2, z0), xs), CubicLerp(ValCoord3D(seed, x0, y3, z0), ValCoord3D(seed, x1, y3, z0), ValCoord3D(seed, x2, y3, z0), ValCoord3D(seed, x3, y3, z0), xs), ys), CubicLerp( CubicLerp(ValCoord3D(seed, x0, y0, z1), ValCoord3D(seed, x1, y0, z1), ValCoord3D(seed, x2, y0, z1), ValCoord3D(seed, x3, y0, z1), xs), CubicLerp(ValCoord3D(seed, x0, y1, z1), ValCoord3D(seed, x1, y1, z1), ValCoord3D(seed, x2, y1, z1), ValCoord3D(seed, x3, y1, z1), xs), CubicLerp(ValCoord3D(seed, x0, y2, z1), ValCoord3D(seed, x1, y2, z1), ValCoord3D(seed, x2, y2, z1), ValCoord3D(seed, x3, y2, z1), xs), CubicLerp(ValCoord3D(seed, x0, y3, z1), ValCoord3D(seed, x1, y3, z1), ValCoord3D(seed, x2, y3, z1), ValCoord3D(seed, x3, y3, z1), xs), ys), CubicLerp( CubicLerp(ValCoord3D(seed, x0, y0, z2), ValCoord3D(seed, x1, y0, z2), ValCoord3D(seed, x2, y0, z2), ValCoord3D(seed, x3, y0, z2), xs), CubicLerp(ValCoord3D(seed, x0, y1, z2), ValCoord3D(seed, x1, y1, z2), ValCoord3D(seed, x2, y1, z2), ValCoord3D(seed, x3, y1, z2), xs), CubicLerp(ValCoord3D(seed, x0, y2, z2), ValCoord3D(seed, x1, y2, z2), ValCoord3D(seed, x2, y2, z2), ValCoord3D(seed, x3, y2, z2), xs), CubicLerp(ValCoord3D(seed, x0, y3, z2), ValCoord3D(seed, x1, y3, z2), ValCoord3D(seed, x2, y3, z2), ValCoord3D(seed, x3, y3, z2), xs), ys), CubicLerp( CubicLerp(ValCoord3D(seed, x0, y0, z3), ValCoord3D(seed, x1, y0, z3), ValCoord3D(seed, x2, y0, z3), ValCoord3D(seed, x3, y0, z3), xs), CubicLerp(ValCoord3D(seed, x0, y1, z3), ValCoord3D(seed, x1, y1, z3), ValCoord3D(seed, x2, y1, z3), ValCoord3D(seed, x3, y1, z3), xs), CubicLerp(ValCoord3D(seed, x0, y2, z3), ValCoord3D(seed, x1, y2, z3), ValCoord3D(seed, x2, y2, z3), ValCoord3D(seed, x3, y2, z3), xs), CubicLerp(ValCoord3D(seed, x0, y3, z3), ValCoord3D(seed, x1, y3, z3), ValCoord3D(seed, x2, y3, z3), ValCoord3D(seed, x3, y3, z3), xs), ys), zs) * CUBIC_3D_BOUNDING; } public FN_DECIMAL GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; switch (m_fractalType) { case FractalType.FBM: return SingleCubicFractalFBM(x, y); case FractalType.Billow: return SingleCubicFractalBillow(x, y); case FractalType.RigidMulti: return SingleCubicFractalRigidMulti(x, y); default: return 0; } } private FN_DECIMAL SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = SingleCubic(seed, x, y); FN_DECIMAL amp = 1; int i = 0; while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += SingleCubic(++seed, x, y) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = Math.Abs(SingleCubic(seed, x, y)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum += (Math.Abs(SingleCubic(++seed, x, y)) * 2 - 1) * amp; } return sum * m_fractalBounding; } private FN_DECIMAL SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL sum = 1 - Math.Abs(SingleCubic(seed, x, y)); FN_DECIMAL amp = 1; int i = 0; while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; sum -= (1 - Math.Abs(SingleCubic(++seed, x, y))) * amp; } return sum; } public FN_DECIMAL GetCubic(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; return SingleCubic(0, x, y); } private const FN_DECIMAL CUBIC_2D_BOUNDING = 1 / (FN_DECIMAL)(1.5 * 1.5); private FN_DECIMAL SingleCubic(int seed, FN_DECIMAL x, FN_DECIMAL y) { int x1 = FastFloor(x); int y1 = FastFloor(y); int x0 = x1 - 1; int y0 = y1 - 1; int x2 = x1 + 1; int y2 = y1 + 1; int x3 = x1 + 2; int y3 = y1 + 2; FN_DECIMAL xs = x - x1; FN_DECIMAL ys = y - y1; return CubicLerp( CubicLerp(ValCoord2D(seed, x0, y0), ValCoord2D(seed, x1, y0), ValCoord2D(seed, x2, y0), ValCoord2D(seed, x3, y0), xs), CubicLerp(ValCoord2D(seed, x0, y1), ValCoord2D(seed, x1, y1), ValCoord2D(seed, x2, y1), ValCoord2D(seed, x3, y1), xs), CubicLerp(ValCoord2D(seed, x0, y2), ValCoord2D(seed, x1, y2), ValCoord2D(seed, x2, y2), ValCoord2D(seed, x3, y2), xs), CubicLerp(ValCoord2D(seed, x0, y3), ValCoord2D(seed, x1, y3), ValCoord2D(seed, x2, y3), ValCoord2D(seed, x3, y3), xs), ys) * CUBIC_2D_BOUNDING; } // Cellular Noise public FN_DECIMAL GetCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { x *= m_frequency; y *= m_frequency; z *= m_frequency; switch (m_cellularReturnType) { case CellularReturnType.CellValue: case CellularReturnType.NoiseLookup: case CellularReturnType.Distance: return SingleCellular(x, y, z); default: return SingleCellular2Edge(x, y, z); } } private FN_DECIMAL SingleCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int xr = FastRound(x); int yr = FastRound(y); int zr = FastRound(z); FN_DECIMAL distance = 999999; int xc = 0, yc = 0, zc = 0; switch (m_cellularDistanceFunction) { case CellularDistanceFunction.Euclidean: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { for (int zi = zr - 1; zi <= zr + 1; zi++) { Float3 vec = CELL_3D[Hash3D(m_seed, xi, yi, zi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL vecZ = zi - z + vec.z * m_cellularJitter; FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; if (newDistance < distance) { distance = newDistance; xc = xi; yc = yi; zc = zi; } } } } break; case CellularDistanceFunction.Manhattan: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { for (int zi = zr - 1; zi <= zr + 1; zi++) { Float3 vec = CELL_3D[Hash3D(m_seed, xi, yi, zi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL vecZ = zi - z + vec.z * m_cellularJitter; FN_DECIMAL newDistance = Math.Abs(vecX) + Math.Abs(vecY) + Math.Abs(vecZ); if (newDistance < distance) { distance = newDistance; xc = xi; yc = yi; zc = zi; } } } } break; case CellularDistanceFunction.Natural: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { for (int zi = zr - 1; zi <= zr + 1; zi++) { Float3 vec = CELL_3D[Hash3D(m_seed, xi, yi, zi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL vecZ = zi - z + vec.z * m_cellularJitter; FN_DECIMAL newDistance = (Math.Abs(vecX) + Math.Abs(vecY) + Math.Abs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); if (newDistance < distance) { distance = newDistance; xc = xi; yc = yi; zc = zi; } } } } break; } switch (m_cellularReturnType) { case CellularReturnType.CellValue: return ValCoord3D(m_seed, xc, yc, zc); case CellularReturnType.NoiseLookup: Float3 vec = CELL_3D[Hash3D(m_seed, xc, yc, zc) & 255]; return m_cellularNoiseLookup.GetNoise(xc + vec.x * m_cellularJitter, yc + vec.y * m_cellularJitter, zc + vec.z * m_cellularJitter); case CellularReturnType.Distance: return distance; default: return 0; } } private FN_DECIMAL SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) { int xr = FastRound(x); int yr = FastRound(y); int zr = FastRound(z); FN_DECIMAL[] distance = { 999999, 999999, 999999, 999999 }; switch (m_cellularDistanceFunction) { case CellularDistanceFunction.Euclidean: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { for (int zi = zr - 1; zi <= zr + 1; zi++) { Float3 vec = CELL_3D[Hash3D(m_seed, xi, yi, zi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL vecZ = zi - z + vec.z * m_cellularJitter; FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; for (int i = m_cellularDistanceIndex1; i > 0; i--) distance[i] = Math.Max(Math.Min(distance[i], newDistance), distance[i - 1]); distance[0] = Math.Min(distance[0], newDistance); } } } break; case CellularDistanceFunction.Manhattan: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { for (int zi = zr - 1; zi <= zr + 1; zi++) { Float3 vec = CELL_3D[Hash3D(m_seed, xi, yi, zi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL vecZ = zi - z + vec.z * m_cellularJitter; FN_DECIMAL newDistance = Math.Abs(vecX) + Math.Abs(vecY) + Math.Abs(vecZ); for (int i = m_cellularDistanceIndex1; i > 0; i--) distance[i] = Math.Max(Math.Min(distance[i], newDistance), distance[i - 1]); distance[0] = Math.Min(distance[0], newDistance); } } } break; case CellularDistanceFunction.Natural: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { for (int zi = zr - 1; zi <= zr + 1; zi++) { Float3 vec = CELL_3D[Hash3D(m_seed, xi, yi, zi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL vecZ = zi - z + vec.z * m_cellularJitter; FN_DECIMAL newDistance = (Math.Abs(vecX) + Math.Abs(vecY) + Math.Abs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); for (int i = m_cellularDistanceIndex1; i > 0; i--) distance[i] = Math.Max(Math.Min(distance[i], newDistance), distance[i - 1]); distance[0] = Math.Min(distance[0], newDistance); } } } break; default: break; } switch (m_cellularReturnType) { case CellularReturnType.Distance2: return distance[m_cellularDistanceIndex1]; case CellularReturnType.Distance2Add: return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; case CellularReturnType.Distance2Sub: return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; case CellularReturnType.Distance2Mul: return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; case CellularReturnType.Distance2Div: return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; default: return 0; } } public FN_DECIMAL GetCellular(FN_DECIMAL x, FN_DECIMAL y) { x *= m_frequency; y *= m_frequency; switch (m_cellularReturnType) { case CellularReturnType.CellValue: case CellularReturnType.NoiseLookup: case CellularReturnType.Distance: return SingleCellular(x, y); default: return SingleCellular2Edge(x, y); } } private FN_DECIMAL SingleCellular(FN_DECIMAL x, FN_DECIMAL y) { int xr = FastRound(x); int yr = FastRound(y); FN_DECIMAL distance = 999999; int xc = 0, yc = 0; switch (m_cellularDistanceFunction) { default: case CellularDistanceFunction.Euclidean: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { Float2 vec = CELL_2D[Hash2D(m_seed, xi, yi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; if (newDistance < distance) { distance = newDistance; xc = xi; yc = yi; } } } break; case CellularDistanceFunction.Manhattan: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { Float2 vec = CELL_2D[Hash2D(m_seed, xi, yi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL newDistance = (Math.Abs(vecX) + Math.Abs(vecY)); if (newDistance < distance) { distance = newDistance; xc = xi; yc = yi; } } } break; case CellularDistanceFunction.Natural: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { Float2 vec = CELL_2D[Hash2D(m_seed, xi, yi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL newDistance = (Math.Abs(vecX) + Math.Abs(vecY)) + (vecX * vecX + vecY * vecY); if (newDistance < distance) { distance = newDistance; xc = xi; yc = yi; } } } break; } switch (m_cellularReturnType) { case CellularReturnType.CellValue: return ValCoord2D(m_seed, xc, yc); case CellularReturnType.NoiseLookup: Float2 vec = CELL_2D[Hash2D(m_seed, xc, yc) & 255]; return m_cellularNoiseLookup.GetNoise(xc + vec.x * m_cellularJitter, yc + vec.y * m_cellularJitter); case CellularReturnType.Distance: return distance; default: return 0; } } private FN_DECIMAL SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y) { int xr = FastRound(x); int yr = FastRound(y); FN_DECIMAL[] distance = { 999999, 999999, 999999, 999999 }; switch (m_cellularDistanceFunction) { default: case CellularDistanceFunction.Euclidean: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { Float2 vec = CELL_2D[Hash2D(m_seed, xi, yi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; for (int i = m_cellularDistanceIndex1; i > 0; i--) distance[i] = Math.Max(Math.Min(distance[i], newDistance), distance[i - 1]); distance[0] = Math.Min(distance[0], newDistance); } } break; case CellularDistanceFunction.Manhattan: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { Float2 vec = CELL_2D[Hash2D(m_seed, xi, yi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL newDistance = Math.Abs(vecX) + Math.Abs(vecY); for (int i = m_cellularDistanceIndex1; i > 0; i--) distance[i] = Math.Max(Math.Min(distance[i], newDistance), distance[i - 1]); distance[0] = Math.Min(distance[0], newDistance); } } break; case CellularDistanceFunction.Natural: for (int xi = xr - 1; xi <= xr + 1; xi++) { for (int yi = yr - 1; yi <= yr + 1; yi++) { Float2 vec = CELL_2D[Hash2D(m_seed, xi, yi) & 255]; FN_DECIMAL vecX = xi - x + vec.x * m_cellularJitter; FN_DECIMAL vecY = yi - y + vec.y * m_cellularJitter; FN_DECIMAL newDistance = (Math.Abs(vecX) + Math.Abs(vecY)) + (vecX * vecX + vecY * vecY); for (int i = m_cellularDistanceIndex1; i > 0; i--) distance[i] = Math.Max(Math.Min(distance[i], newDistance), distance[i - 1]); distance[0] = Math.Min(distance[0], newDistance); } } break; } switch (m_cellularReturnType) { case CellularReturnType.Distance2: return distance[m_cellularDistanceIndex1]; case CellularReturnType.Distance2Add: return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; case CellularReturnType.Distance2Sub: return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; case CellularReturnType.Distance2Mul: return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; case CellularReturnType.Distance2Div: return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; default: return 0; } } public void GradientPerturb(ref FN_DECIMAL x, ref FN_DECIMAL y, ref FN_DECIMAL z) { SingleGradientPerturb(m_seed, m_gradientPerturbAmp, m_frequency, ref x, ref y, ref z); } public void GradientPerturbFractal(ref FN_DECIMAL x, ref FN_DECIMAL y, ref FN_DECIMAL z) { int seed = m_seed; FN_DECIMAL amp = m_gradientPerturbAmp * m_fractalBounding; FN_DECIMAL freq = m_frequency; SingleGradientPerturb(seed, amp, m_frequency, ref x, ref y, ref z); for (int i = 1; i < m_octaves; i++) { freq *= m_lacunarity; amp *= m_gain; SingleGradientPerturb(++seed, amp, freq, ref x, ref y, ref z); } } private void SingleGradientPerturb(int seed, FN_DECIMAL perturbAmp, FN_DECIMAL frequency, ref FN_DECIMAL x, ref FN_DECIMAL y, ref FN_DECIMAL z) { FN_DECIMAL xf = x * frequency; FN_DECIMAL yf = y * frequency; FN_DECIMAL zf = z * frequency; int x0 = FastFloor(xf); int y0 = FastFloor(yf); int z0 = FastFloor(zf); int x1 = x0 + 1; int y1 = y0 + 1; int z1 = z0 + 1; FN_DECIMAL xs, ys, zs; switch (m_interp) { default: case Interp.Linear: xs = xf - x0; ys = yf - y0; zs = zf - z0; break; case Interp.Hermite: xs = InterpHermiteFunc(xf - x0); ys = InterpHermiteFunc(yf - y0); zs = InterpHermiteFunc(zf - z0); break; case Interp.Quintic: xs = InterpQuinticFunc(xf - x0); ys = InterpQuinticFunc(yf - y0); zs = InterpQuinticFunc(zf - z0); break; } Float3 vec0 = CELL_3D[Hash3D(seed, x0, y0, z0) & 255]; Float3 vec1 = CELL_3D[Hash3D(seed, x1, y0, z0) & 255]; FN_DECIMAL lx0x = Lerp(vec0.x, vec1.x, xs); FN_DECIMAL ly0x = Lerp(vec0.y, vec1.y, xs); FN_DECIMAL lz0x = Lerp(vec0.z, vec1.z, xs); vec0 = CELL_3D[Hash3D(seed, x0, y1, z0) & 255]; vec1 = CELL_3D[Hash3D(seed, x1, y1, z0) & 255]; FN_DECIMAL lx1x = Lerp(vec0.x, vec1.x, xs); FN_DECIMAL ly1x = Lerp(vec0.y, vec1.y, xs); FN_DECIMAL lz1x = Lerp(vec0.z, vec1.z, xs); FN_DECIMAL lx0y = Lerp(lx0x, lx1x, ys); FN_DECIMAL ly0y = Lerp(ly0x, ly1x, ys); FN_DECIMAL lz0y = Lerp(lz0x, lz1x, ys); vec0 = CELL_3D[Hash3D(seed, x0, y0, z1) & 255]; vec1 = CELL_3D[Hash3D(seed, x1, y0, z1) & 255]; lx0x = Lerp(vec0.x, vec1.x, xs); ly0x = Lerp(vec0.y, vec1.y, xs); lz0x = Lerp(vec0.z, vec1.z, xs); vec0 = CELL_3D[Hash3D(seed, x0, y1, z1) & 255]; vec1 = CELL_3D[Hash3D(seed, x1, y1, z1) & 255]; lx1x = Lerp(vec0.x, vec1.x, xs); ly1x = Lerp(vec0.y, vec1.y, xs); lz1x = Lerp(vec0.z, vec1.z, xs); x += Lerp(lx0y, Lerp(lx0x, lx1x, ys), zs) * perturbAmp; y += Lerp(ly0y, Lerp(ly0x, ly1x, ys), zs) * perturbAmp; z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * perturbAmp; } public void GradientPerturb(ref FN_DECIMAL x, ref FN_DECIMAL y) { SingleGradientPerturb(m_seed, m_gradientPerturbAmp, m_frequency, ref x, ref y); } public void GradientPerturbFractal(ref FN_DECIMAL x, ref FN_DECIMAL y) { int seed = m_seed; FN_DECIMAL amp = m_gradientPerturbAmp * m_fractalBounding; FN_DECIMAL freq = m_frequency; SingleGradientPerturb(seed, amp, m_frequency, ref x, ref y); for (int i = 1; i < m_octaves; i++) { freq *= m_lacunarity; amp *= m_gain; SingleGradientPerturb(++seed, amp, freq, ref x, ref y); } } private void SingleGradientPerturb(int seed, FN_DECIMAL perturbAmp, FN_DECIMAL frequency, ref FN_DECIMAL x, ref FN_DECIMAL y) { FN_DECIMAL xf = x * frequency; FN_DECIMAL yf = y * frequency; int x0 = FastFloor(xf); int y0 = FastFloor(yf); int x1 = x0 + 1; int y1 = y0 + 1; FN_DECIMAL xs, ys; switch (m_interp) { default: case Interp.Linear: xs = xf - x0; ys = yf - y0; break; case Interp.Hermite: xs = InterpHermiteFunc(xf - x0); ys = InterpHermiteFunc(yf - y0); break; case Interp.Quintic: xs = InterpQuinticFunc(xf - x0); ys = InterpQuinticFunc(yf - y0); break; } Float2 vec0 = CELL_2D[Hash2D(seed, x0, y0) & 255]; Float2 vec1 = CELL_2D[Hash2D(seed, x1, y0) & 255]; FN_DECIMAL lx0x = Lerp(vec0.x, vec1.x, xs); FN_DECIMAL ly0x = Lerp(vec0.y, vec1.y, xs); vec0 = CELL_2D[Hash2D(seed, x0, y1) & 255]; vec1 = CELL_2D[Hash2D(seed, x1, y1) & 255]; FN_DECIMAL lx1x = Lerp(vec0.x, vec1.x, xs); FN_DECIMAL ly1x = Lerp(vec0.y, vec1.y, xs); x += Lerp(lx0x, lx1x, ys) * perturbAmp; y += Lerp(ly0x, ly1x, ys) * perturbAmp; } } }
38.08681
476
0.654758
[ "MIT" ]
Matistjati/Console-game-engine-game
UncoalEngine/Uncoal/Map generating/Fastnoise.cs
90,382
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.ReverseProxy.Signals { /// <summary> /// Dummy value which can be used as a type parameter with <see cref="Signal{T}"/> /// to create a value-less signal, useful to propagate notification events. /// </summary> internal sealed class Unit { /// <summary> /// Gets the singleton instance of <see cref="Unit"/>. /// </summary> public static readonly Unit Instance = new Unit(); private Unit() { } } }
26.318182
86
0.601036
[ "MIT" ]
JasonCoombs/reverse-proxy
src/ReverseProxy/Signals/Unit.cs
579
C#
namespace DankInventory.Data { public class License : DankDynamicObject { public int Id { get; set; } public string Name { get; set; } public string Uri { get; set; } public decimal Cost { get; set; } } }
18.071429
44
0.56917
[ "Apache-2.0" ]
nerdymishka/gainz
dotnet/src/Apps/DankInventory.Data/Data/License.cs
253
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Gitdate; using System.Diagnostics; using System.Text.RegularExpressions; using YoutubeExtractor; using Google.Apis.Services; using Google.Apis.YouTube.v3; using Google.Apis.YouTube.v3.Data; namespace Plync { struct YTVideo { public string Link; public string Title; public YTVideo(PlaylistItemSnippet Snippet) { Link = "www.youtube.com/watch?v=" + Snippet.ResourceId.VideoId; Title = Snippet.Title; while (Title.Contains(" ")) Title = Title.Replace(" ", " "); } public static implicit operator YTVideo(PlaylistItemSnippet Snippet) { return new YTVideo(Snippet); } public override string ToString() { return string.Format("{0} - {1}", Link, Title); } } class Program { const string PercFmt = "{0}%"; static YouTubeService YTS = new YouTubeService(new BaseClientService.Initializer() { ApiKey = "AIzaSyB2yemY5kS-VuClwDoSvi1zCg0jkmD5wpA", // I don't care ApplicationName = "Plync" }); static int Top, Left; static bool Video; static string Ext; static T[] Concat<T>(T[] A, T[] B) { T[] Ret = new T[A.Length + B.Length]; A.CopyTo(Ret, 0); B.CopyTo(Ret, A.Length); return Ret; } static string NormalizeTitle(string Title) { if (Title == null) return null; string Name = ""; for (int i = 0; i < Title.Length; i++) { if (!Path.GetInvalidPathChars().Contains(Title[i]) && Title[i] != '\\' && Title[i] != '/') { if (Title[i] == ':') Name += '='; else Name += Title[i]; } } if (!char.IsUpper(Name[0])) Name = char.ToUpper(Name[0]) + Name.Substring(1); Name = Regex.Replace(Name, @"\(([^\)]*)\)", ""); Name = Regex.Replace(Name, @"\[([^\]]*)\]", ""); Name = Name.Replace("=", "-"); while (Name.Contains("--")) Name = Name.Replace("--", "-"); Name = Name.Replace("-", " - "); while (Name.Contains(" ")) Name = Name.Replace(" ", " "); Name = Regex.Replace(Name, @"\s+", " "); return Name.Trim(); } static void Download(string Path, string Dir = null, string Name = null) { Download(DownloadUrlResolver.GetDownloadUrls(Path, false).ToArray(), Dir, Name); } static void Download(VideoInfo[] Vids, string Dir, string Name) { VideoInfo Vid = Vids.Where(I => I.CanExtractAudio && I.AudioType == AudioType.Mp3) .OrderByDescending(I => I.AudioBitrate) .First(); if (Vid.RequiresDecryption) DownloadUrlResolver.DecryptDownloadUrl(Vid); if (string.IsNullOrEmpty(Dir)) Dir = Environment.CurrentDirectory; if (string.IsNullOrEmpty(Name)) Name = Vid.Title; Name = NormalizeTitle(Name); Downloader DLoader = null; string SavePath = Path.Combine(Dir, Name + Ext); if (Video) { VideoDownloader DL = new VideoDownloader(Vid, SavePath); DLoader = DL; DL.DownloadProgressChanged += (S, A) => { LoadCursor(); Console.Write(PercFmt, Math.Round(A.ProgressPercentage)); }; } else { AudioDownloader DL = new AudioDownloader(Vid, SavePath); DLoader = DL; DL.DownloadProgressChanged += (S, A) => { LoadCursor(); Console.Write(PercFmt, Math.Round(A.ProgressPercentage * 0.85)); }; DL.AudioExtractionProgressChanged += (S, A) => { LoadCursor(); Console.Write(PercFmt, Math.Round(85 + A.ProgressPercentage * 0.15)); }; } DLoader.Execute(); } static YTVideo[] GetPlaylistItems(string Playlist, ref int DeletedVideos, string NextPageToken = null) { PlaylistItemsResource.ListRequest List = YTS.PlaylistItems.List("snippet"); List.PlaylistId = Playlist; List.MaxResults = 50; if (NextPageToken != null) List.PageToken = NextPageToken; PlaylistItemListResponse Res = List.Execute(); List<YTVideo> VideoIDs = new List<YTVideo>(); for (int i = 0; i < Res.Items.Count; i++) { PlaylistItemSnippet Snippet = Res.Items[i].Snippet; if (Snippet.Thumbnails == null && Snippet.Title == "Deleted video") { DeletedVideos++; continue; } VideoIDs.Add(Snippet); } YTVideo[] Ret = VideoIDs.ToArray(); if (Res.NextPageToken != null) return Concat(Ret, GetPlaylistItems(Playlist, ref DeletedVideos, Res.NextPageToken)); return Ret; } static YTVideo[] GetPlaylistItems(string Playlist) { int Del = 0; return GetPlaylistItems(Playlist, ref Del); } static Tuple<string, string>[] GetPlaylists(string Channel, string NextPageToken = null) { PlaylistsResource.ListRequest List = YTS.Playlists.List("snippet"); List.ChannelId = Channel; List.MaxResults = 50; if (NextPageToken != null) List.PageToken = NextPageToken; PlaylistListResponse Res = List.Execute(); List<Tuple<string, string>> PlaylistIDs = new List<Tuple<string, string>>(); for (int i = 0; i < Res.Items.Count; i++) PlaylistIDs.Add(new Tuple<string, string>(Res.Items[i].Snippet.Title, Res.Items[i].Id)); Tuple<string, string>[] Ret = PlaylistIDs.ToArray(); if (Res.NextPageToken != null) return Concat(Ret, GetPlaylists(Channel, Res.NextPageToken)); return Ret; } static string GetPlaylistID(string Link) { if (Link.Contains("list=")) Link = Link.Substring(Link.IndexOf("list=") + 5).Split('&')[0]; return Link; } static void WriteLineCol(string Str, ConsoleColor Clr) { LoadCursor(); ConsoleColor Old = Console.ForegroundColor; Console.ForegroundColor = Clr; Console.WriteLine(Str); Console.ForegroundColor = Old; } static void SaveCursor() { Top = Console.CursorTop; Left = Console.CursorLeft; } static void LoadCursor() { Console.SetCursorPosition(Left, Top); } static int Main(string[] args) { Console.Title = "Plync"; int Downloaded = 0; int Failed = 0; int Skipped = 0; int Invalid = 0; int Removed = 0; Updater.Username = "cartman300"; Updater.Repository = "Plync"; /*Console.WriteLine("Version: {0}", Updater.Version); Console.WriteLine("Checking for updates");*/ Updater.CheckAndUpdate((L) => { Console.WriteLine("Downloading version {0}", L.tag_name); Console.WriteLine("The program will automatically update after it closes"); }, false); if (!(args.Length == 2 || (args.Length == 3 && args[2] == "/vid"))) { Console.WriteLine("Usage:"); Console.WriteLine("plync playlist directory [/vid]"); Console.WriteLine("plync /playlists channel"); Environment.Exit(-1); } if (args.Length == 2 && args[0] == "/playlists") { string Channel = args[1]; Tuple<string, string>[] Playlists = GetPlaylists(Channel); for (int i = 0; i < Playlists.Length; i++) { Console.WriteLine("{0} - {1} items", Playlists[i].Item1, GetPlaylistItems(Playlists[i].Item2).Length); Console.Error.WriteLine("plync {0} \"{1}\"", Playlists[i].Item2, NormalizeTitle(Playlists[i].Item1)); } Environment.Exit(0); } Video = (args.Length == 3 && args[2] == "/vid"); if (Video) { Ext = ".mp4"; //Console.WriteLine("Fetching audio and video"); } else { Ext = ".mp3"; //Console.WriteLine("Fetching audio only"); } string PlaylistID = GetPlaylistID(args[0]); Console.Write("Fetching items [audio"); if (Video) Console.Write(" and video"); Console.Write("] from playlist ... ", PlaylistID); SaveCursor(); YTVideo[] Videos = null; try { Videos = GetPlaylistItems(PlaylistID, ref Invalid); WriteLineCol("OKAY", ConsoleColor.Green); } catch (Exception E) { WriteLineCol("FAIL", ConsoleColor.Red); Console.WriteLine(E.Message); SaveCursor(); WriteLineCol("Make sure the playlist is either public or unlisted", ConsoleColor.Cyan); Environment.Exit(-1); } string Dir = Path.GetFullPath(args[1]); if (!Directory.Exists(Dir)) Directory.CreateDirectory(Dir); string[] ExistingFiles = Directory.GetFiles(Dir, "*" + Ext); Console.WriteLine("Found {0} valid items in playlist", Videos.Length); Console.WriteLine("Found {0} existing items", ExistingFiles.Length); List<string> NormalizedNames = new List<string>(); for (int i = 0; i < Videos.Length; i++) { string Normalized = NormalizeTitle(Videos[i].Title); if (NormalizedNames.Contains(Normalized)) WriteLineCol(string.Format("Collision found \"{0}\"", Normalized), ConsoleColor.Magenta); NormalizedNames.Add(Normalized); } for (int i = 0; i < ExistingFiles.Length; i++) { bool Exists = false; for (int j = 0; j < Videos.Length; j++) if (NormalizeTitle(Videos[j].Title) == Path.GetFileNameWithoutExtension(ExistingFiles[i])) Exists = true; if (!Exists) { Console.Write("Removing \"{0}\" ... ", Path.GetFileNameWithoutExtension(ExistingFiles[i])); SaveCursor(); File.Delete(ExistingFiles[i]); WriteLineCol("OKAY", ConsoleColor.DarkYellow); Removed++; } } for (int i = 0; i < Videos.Length; i++) { if (File.Exists(Path.Combine(Dir, NormalizeTitle(Videos[i].Title + Ext)))) Skipped++; else { try { Console.Write("Fetching \"{0}\" ... ", NormalizeTitle(Videos[i].Title)); SaveCursor(); Download(Videos[i].Link, args[1], Videos[i].Title); WriteLineCol("OKAY", ConsoleColor.Green); Downloaded++; } catch (Exception E) { WriteLineCol("FAIL", ConsoleColor.Red); Failed++; Console.Write("REASON: "); if (E is YoutubeParseException) Console.WriteLine("Failed to parse"); else if (E is NotSupportedException) Console.WriteLine(E.Message); else Console.WriteLine("Unknown, {0}\n{1}", E.GetType().Name, E.Message); } } } Console.WriteLine("INV {0} REM {1} FCH {2} SKP {3} FLR {4}", Invalid, Removed, Downloaded, Skipped, Failed); Console.WriteLine("Total: {0}", Skipped + Downloaded); return Failed; } } }
30.328221
111
0.64428
[ "Unlicense" ]
cartman300/Plync
Plync/Program.cs
9,889
C#
using BFF.ViewModel.ViewModels.ForModels; using GongSolutions.Wpf.DragDrop; using System; using System.Threading; using System.Windows; namespace BFF.View.Wpf.DropHandler { public class MergingPayeeViewModelsDropHandler : IDropTarget { private static readonly Lazy<MergingPayeeViewModelsDropHandler> Lazy = new(() => new MergingPayeeViewModelsDropHandler(), LazyThreadSafetyMode.ExecutionAndPublication); public static IDropTarget Instance => Lazy.Value; public void DragOver(IDropInfo dropInfo) { if (dropInfo.Data is IPayeeViewModel sourceItem && dropInfo.TargetItem is IPayeeViewModel targetItem && targetItem != sourceItem && sourceItem.CanMergeTo(targetItem)) { dropInfo.DropTargetAdorner = DropTargetAdorners.Highlight; dropInfo.Effects = DragDropEffects.Move; } } public void Drop(IDropInfo dropInfo) { if (dropInfo.Data is IPayeeViewModel sourceItem && dropInfo.TargetItem is IPayeeViewModel targetItem) sourceItem.MergeTo(targetItem); } } }
34.114286
176
0.656616
[ "MIT" ]
Yeah69/BFF
View.Wpf/DropHandler/MergingPayeeViewModelsDropHandler.cs
1,196
C#
using Restaurant.Abstractions.ViewModels; namespace Restaurant.Abstractions.Subscribers { /// <summary> /// Subscriber for IBasketItemViewModel /// </summary> public interface IBasketItemViewModelSubscriber : ISubscriber<IBasketItemViewModel> { } }
24.818182
87
0.739927
[ "MIT" ]
nhatphuongb1/Restaurant-App
src/Client/Restaurant.Client/Restaurant.Abstractions/Subscribers/IBasketItemViewModelSubscriber.cs
273
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace Corium3DGI.Utils { public class RadToDegConverter : IValueConverter { public object Convert(object val, Type targetType, object arg, System.Globalization.CultureInfo culture) { return (double)val / Math.PI * 180.0f; } public object ConvertBack(object val, Type targetType, object arg, System.Globalization.CultureInfo culture) { return (double)val / 180.0f * Math.PI; } } }
26.695652
116
0.677524
[ "BSD-3-Clause" ]
Synergy91/Corium3D
Corium3DGI/Utils/RadToDegConverter.cs
616
C#
using Managers; using UnityEngine; using UnityEngine.UI; namespace Components { /// <summary> /// A simple description of what is chapter (a name, and a yarn script) /// </summary> [System.Serializable] public class Chapter { /// <summary> /// The name of this chapter. /// </summary> public string Name; /// <summary> /// The yarn script asset of this chapter. /// </summary> public TextAsset YarnAsset; /// <summary> /// Converts a <see cref="Chapter"/> to a string. /// </summary> /// <returns>The name of the chapter.</returns> public override string ToString() { return this.Name; } } /// <inheritdoc /> /// <summary> /// A game object component that manages given chapters. /// It will take a panel to populate with a given prefab <see cref="UIChapterEntryPrefab"/>. /// </summary> public class ChapterManager : MonoBehaviour { /// <summary> /// The list of chapters to render. /// </summary> public Chapter[] ListOfChapters; /// <summary> /// The container panel that will get populated by the instanced chapter prefabs. /// </summary> public RectTransform ContainerContentPanel; /// <summary> /// A prefab to multiply and populate over the gaven panel. /// This prefab, must contain: /// <list type="bullet"> /// <item>A button component (at the root);</item> /// <item>A image component (at the root);</item> /// <item>A text game object (as child).</item> /// </list> /// </summary> public GameObject UIChapterEntryPrefab; // noqa /// <summary> /// The background color of an uncompleted's chapter button. /// </summary> public Color UnCompletedColor = new Color(0.3f, 0.3f, 0.3f, 0.5f); /// <summary> /// The text color of an uncompleted chapter's button. /// </summary> public Color UnCompletedTextColor = Color.black; /// <summary> /// The background color of a completed chapter's button. /// </summary> public Color CompletedColor = new Color(0.5f, 0.5f, 0.5f, 0.1f); /// <summary> /// The text color of a completed chapter button. /// </summary> public Color CompletedTextColor = Color.black; /// <summary> /// This will, on a given <seealso cref="Chapter">chapter</seealso>: /// <list type="bullet"> /// <item>Instance a given prefab and set it to be the parent of the given panel.</item> /// <item>Set the text and background color depending on if the chapter has been completed or not.</item> /// <item>Register a listener that will load the yarn asset whenever the user clicks on the button.</item> /// </list> /// </summary> /// <param name="id">The said position of this chapter;</param> /// <param name="chapter">The chapter object;</param> /// <param name="isCompleted">Was the chapter completed or not.</param> private void AddChapter(int id, Chapter chapter, bool isCompleted) { var newChapterEntry = Instantiate(this.UIChapterEntryPrefab); var image = newChapterEntry.GetComponent<Image>(); var button = newChapterEntry.GetComponent<Button>(); var text = newChapterEntry.GetComponentInChildren<Text>(); // Set the parent of the chapter game object to be the content panel. newChapterEntry.transform.SetParent(this.ContainerContentPanel); // Set the button text to be: `<chapter_id>: <chapter_name>`. text.text = string.Format("{0}: {1}", id, chapter); // Set the background and text color with the given ones. // ...Here is for a completed chapter. if (isCompleted) { image.color = this.CompletedColor; text.color = this.CompletedTextColor; } // Set the colors of a non-completed chapter. else { image.color = this.UnCompletedColor; text.color = this.UnCompletedTextColor; } // Register a 'on click' event to the button, // that will load the yarn script whenever the user clicks on the button. button.onClick.AddListener(() => { YarnSceneManager.LoadYarn(chapter.YarnAsset); }); } /// <summary> /// When the component awakes, it populates the container panel with given chapters. /// </summary> private void Awake() { // The (said) starting point ID, we are guessing data is ordered. var id = 1; // Retrieve the saved played chapters. var playedChapters = SaveGameManager.GetCurrentGame().PlayedChapters; // Note that the previous chapter was not completed // if there are completed chapters. // That will allow us to hide every chapter after the next one to be completed. var previousWasCompleted = playedChapters.Count < 1; // Populate the container panel with chapters foreach (var chapter in this.ListOfChapters) { // Flag the chapter as completed if it is in the list of completed chapters. var isCompleted = playedChapters.Contains(chapter.YarnAsset.name); // Add the chapter on the container panel this.AddChapter(id++, chapter, isCompleted); // If the previous chapter was completed and the current one wasn't, // don't show the next chapters. if (previousWasCompleted && !isCompleted) { break; } // If the chapter was completed, flag that the previous chapter (this one) was completed. if (isCompleted) { previousWasCompleted = true; } } } } }
39.589744
118
0.57351
[ "MIT" ]
Urbanotopus/urbanotopus
Assets/Scripts/Components/ChapterManager.cs
6,176
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Linq; namespace Library { public partial class MaintainBooksForm : Library.ParentForm { LibraryEntity context = new LibraryEntity(); public MaintainBooksForm() { InitializeComponent(); } private void btnSearchBooks_Click(object sender, EventArgs e) { SearchBooksDialogue searchBooksDialogue = new SearchBooksDialogue(); searchBooksDialogue.ShowDialog(); if (searchBooksDialogue.DialogResult == DialogResult.OK) { Books books = context.Books.Where(x => x.BookID == searchBooksDialogue.booksid).First(); tbBooksID.Text = books.BookID.ToString(); tbTitle.Text = books.Title.ToString(); tbAuthor.Text = books.Author.ToString(); tbCallNumber.Text = books.CallNumber.ToString(); cmbGenre.Text = books.Genre.ToString(); } } private void btnUpdate_Click(object sender, EventArgs e) { try { int booksID = Convert.ToInt32(tbBooksID.Text); Books books = context.Books.Where(x => x.BookID == booksID).First(); books.Title = tbTitle.Text; books.Author = tbAuthor.Text; books.CallNumber = tbCallNumber.Text; books.Genre = cmbGenre.Text; context.SaveChanges(); MessageBox.Show("Update successfully"); } catch (Exception) { MessageBox.Show("fill in the all the details"); } } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void tbBooksID_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar)) { e.Handled = true; } } } }
31.632353
104
0.558345
[ "MIT" ]
GuoHM/Library
library/MaintainBooksForm.cs
2,153
C#
#if !NETSTANDARD13 /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the devicefarm-2015-06-23.normal.json service model. */ using System; using System.Collections.Generic; using System.Text; using System.Collections; using System.Threading; using System.Threading.Tasks; using Amazon.Runtime; namespace Amazon.DeviceFarm.Model { /// <summary> /// Base class for ListArtifacts paginators. /// </summary> internal sealed partial class ListArtifactsPaginator : IPaginator<ListArtifactsResponse>, IListArtifactsPaginator { private readonly IAmazonDeviceFarm _client; private readonly ListArtifactsRequest _request; private int _isPaginatorInUse = 0; /// <summary> /// Enumerable containing all full responses for the operation /// </summary> public IPaginatedEnumerable<ListArtifactsResponse> Responses => new PaginatedResponse<ListArtifactsResponse>(this); /// <summary> /// Enumerable containing all of the Artifacts /// </summary> public IPaginatedEnumerable<Artifact> Artifacts => new PaginatedResultKeyResponse<ListArtifactsResponse, Artifact>(this, (i) => i.Artifacts); internal ListArtifactsPaginator(IAmazonDeviceFarm client, ListArtifactsRequest request) { this._client = client; this._request = request; } #if BCL IEnumerable<ListArtifactsResponse> IPaginator<ListArtifactsResponse>.Paginate() { if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0) { throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance."); } var nextToken = _request.NextToken; ListArtifactsResponse response; do { _request.NextToken = nextToken; response = _client.ListArtifacts(_request); nextToken = response.NextToken; yield return response; } while (nextToken != null); } #endif #if AWS_ASYNC_ENUMERABLES_API async IAsyncEnumerable<ListArtifactsResponse> IPaginator<ListArtifactsResponse>.PaginateAsync(CancellationToken cancellationToken = default) { if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0) { throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance."); } var nextToken = _request.NextToken; ListArtifactsResponse response; do { _request.NextToken = nextToken; response = await _client.ListArtifactsAsync(_request, cancellationToken).ConfigureAwait(false); nextToken = response.NextToken; cancellationToken.ThrowIfCancellationRequested(); yield return response; } while (nextToken != null); } #endif } } #endif
37.938144
150
0.65625
[ "Apache-2.0" ]
orinem/aws-sdk-net
sdk/src/Services/DeviceFarm/Generated/Model/_bcl45+netstandard/ListArtifactsPaginator.cs
3,680
C#
using System.Collections; using System.Collections.Generic; using System.Text; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; using Unity.Netcode.RuntimeTests; using Unity.Netcode; using Debug = UnityEngine.Debug; namespace TestProject.RuntimeTests { public class MultiClientConnectionApproval { private string m_ConnectionToken; private uint m_SuccessfulConnections; private uint m_FailedConnections; private uint m_PrefabOverrideGlobalObjectIdHash; private GameObject m_PlayerPrefab; private GameObject m_PlayerPrefabOverride; /// <summary> /// Tests connection approval and connection approval failure /// </summary> /// <returns></returns> [UnityTest] public IEnumerator ConnectionApproval() { m_ConnectionToken = "ThisIsTheRightPassword"; return ConnectionApprovalHandler(3, 1); } /// <summary> /// Tests player prefab overriding, connection approval, and connection approval failure /// </summary> /// <returns></returns> [UnityTest] public IEnumerator ConnectionApprovalPrefabOverride() { m_ConnectionToken = "PrefabOverrideCorrectPassword"; return ConnectionApprovalHandler(3, 1, true); } /// <summary> /// Allows for several connection approval related configurations /// </summary> /// <param name="numClients">total number of clients (excluding the host)</param> /// <param name="failureTestCount">how many clients are expected to fail</param> /// <param name="prefabOverride">if we are also testing player prefab overrides</param> /// <returns></returns> private IEnumerator ConnectionApprovalHandler(int numClients, int failureTestCount = 1, bool prefabOverride = false) { var startFrameCount = Time.frameCount; var startTime = Time.realtimeSinceStartup; m_SuccessfulConnections = 0; m_FailedConnections = 0; Assert.IsTrue(numClients >= failureTestCount); // Create Host and (numClients) clients Assert.True(MultiInstanceHelpers.Create(numClients, out NetworkManager server, out NetworkManager[] clients)); // Create a default player GameObject to use m_PlayerPrefab = new GameObject("Player"); var networkObject = m_PlayerPrefab.AddComponent<NetworkObject>(); // Make it a prefab MultiInstanceHelpers.MakeNetworkObjectTestPrefab(networkObject); // Create the player prefab override if set if (prefabOverride) { // Create a default player GameObject to use m_PlayerPrefabOverride = new GameObject("PlayerPrefabOverride"); var networkObjectOverride = m_PlayerPrefabOverride.AddComponent<NetworkObject>(); MultiInstanceHelpers.MakeNetworkObjectTestPrefab(networkObjectOverride); m_PrefabOverrideGlobalObjectIdHash = networkObjectOverride.GlobalObjectIdHash; server.NetworkConfig.NetworkPrefabs.Add(new NetworkPrefab { Prefab = m_PlayerPrefabOverride }); foreach (var client in clients) { client.NetworkConfig.NetworkPrefabs.Add(new NetworkPrefab { Prefab = m_PlayerPrefabOverride }); } } else { m_PrefabOverrideGlobalObjectIdHash = 0; } // [Host-Side] Set the player prefab server.NetworkConfig.PlayerPrefab = m_PlayerPrefab; server.NetworkConfig.ConnectionApproval = true; server.ConnectionApprovalCallback += ConnectionApprovalCallback; server.NetworkConfig.ConnectionData = Encoding.ASCII.GetBytes(m_ConnectionToken); // [Client-Side] Get all of the RpcQueueManualTests instances relative to each client var clientsAdjustedList = new List<NetworkManager>(); var clientsToClean = new List<NetworkManager>(); var markedForFailure = 0; foreach (var client in clients) { client.NetworkConfig.PlayerPrefab = m_PlayerPrefab; client.NetworkConfig.ConnectionApproval = true; if (markedForFailure < failureTestCount) { client.NetworkConfig.ConnectionData = Encoding.ASCII.GetBytes("ThisIsTheWrongPassword"); markedForFailure++; clientsToClean.Add(client); } else { client.NetworkConfig.ConnectionData = Encoding.ASCII.GetBytes(m_ConnectionToken); clientsAdjustedList.Add(client); } } // Start the instances if (!MultiInstanceHelpers.Start(true, server, clients)) { Assert.Fail("Failed to start instances"); } // [Client-Side] Wait for a connection to the server yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.WaitForClientsConnected(clientsAdjustedList.ToArray(), null, 512)); // [Host-Side] Check to make sure all clients are connected yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.WaitForClientsConnectedToServer(server, clientsAdjustedList.Count + 1, null, 512)); // Validate the number of failed connections is the same as expected Assert.IsTrue(m_FailedConnections == failureTestCount); // Validate the number of successful connections is the total number of expected clients minus the failed client count Assert.IsTrue(m_SuccessfulConnections == (numClients + 1) - failureTestCount); // If we are doing player prefab overrides, then check all of the players to make sure they spawned the appropriate NetworkObject if (prefabOverride) { foreach (var networkClient in server.ConnectedClientsList) { Assert.IsNotNull(networkClient.PlayerObject); Assert.AreEqual(networkClient.PlayerObject.GlobalObjectIdHash, m_PrefabOverrideGlobalObjectIdHash); } } foreach (var client in clients) { client.Shutdown(); } server.ConnectionApprovalCallback -= ConnectionApprovalCallback; server.Shutdown(); Debug.Log($"Total frames updated = {Time.frameCount - startFrameCount} within {Time.realtimeSinceStartup - startTime} seconds."); } /// <summary> /// Delegate handler for the connection approval callback /// </summary> /// <param name="connectionData">the NetworkConfig.ConnectionData sent from the client being approved</param> /// <param name="clientId">the client id being approved</param> /// <param name="callback">the callback invoked to handle approval</param> private void ConnectionApprovalCallback(byte[] connectionData, ulong clientId, NetworkManager.ConnectionApprovedDelegate callback) { string approvalToken = Encoding.ASCII.GetString(connectionData); var isApproved = approvalToken == m_ConnectionToken; if (isApproved) { m_SuccessfulConnections++; } else { m_FailedConnections++; } if (m_PrefabOverrideGlobalObjectIdHash == 0) { callback.Invoke(true, null, isApproved, null, null); } else { callback.Invoke(true, m_PrefabOverrideGlobalObjectIdHash, isApproved, null, null); } } private int m_ServerClientConnectedInvocations; private int m_ClientConnectedInvocations; /// <summary> /// Tests that the OnClientConnectedCallback is invoked when scene management is enabled and disabled /// </summary> /// <returns></returns> [UnityTest] public IEnumerator ClientConnectedCallbackTest([Values(true, false)] bool enableSceneManagement) { m_ServerClientConnectedInvocations = 0; m_ClientConnectedInvocations = 0; // Create Host and (numClients) clients Assert.True(MultiInstanceHelpers.Create(3, out NetworkManager server, out NetworkManager[] clients)); server.NetworkConfig.EnableSceneManagement = enableSceneManagement; server.OnClientConnectedCallback += Server_OnClientConnectedCallback; foreach (var client in clients) { client.NetworkConfig.EnableSceneManagement = enableSceneManagement; client.OnClientConnectedCallback += Client_OnClientConnectedCallback; } // Start the instances if (!MultiInstanceHelpers.Start(true, server, clients)) { Assert.Fail("Failed to start instances"); } // [Client-Side] Wait for a connection to the server yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.WaitForClientsConnected(clients, null, 512)); // [Host-Side] Check to make sure all clients are connected yield return MultiInstanceHelpers.Run(MultiInstanceHelpers.WaitForClientsConnectedToServer(server, clients.Length + 1, null, 512)); Assert.AreEqual(3, m_ClientConnectedInvocations); Assert.AreEqual(4, m_ServerClientConnectedInvocations); } private void Client_OnClientConnectedCallback(ulong clientId) { m_ClientConnectedInvocations++; } private void Server_OnClientConnectedCallback(ulong clientId) { m_ServerClientConnectedInvocations++; } private int m_ServerClientDisconnectedInvocations; /// <summary> /// Tests that clients are disconnected when their ConnectionApproval setting is mismatched with the host-server /// and when scene management is enabled and disabled /// </summary> /// <returns></returns> [UnityTest] public IEnumerator ConnectionApprovalMismatchTest([Values(true, false)] bool enableSceneManagement, [Values(true, false)] bool connectionApproval) { m_ServerClientDisconnectedInvocations = 0; // Create Host and (numClients) clients Assert.True(MultiInstanceHelpers.Create(3, out NetworkManager server, out NetworkManager[] clients)); server.NetworkConfig.EnableSceneManagement = enableSceneManagement; server.OnClientDisconnectCallback += Server_OnClientDisconnectedCallback; server.NetworkConfig.ConnectionApproval = connectionApproval; foreach (var client in clients) { client.NetworkConfig.EnableSceneManagement = enableSceneManagement; client.NetworkConfig.ConnectionApproval = !connectionApproval; } // Start the instances if (!MultiInstanceHelpers.Start(true, server, clients)) { Assert.Fail("Failed to start instances"); } var nextFrameNumber = Time.frameCount + 5; yield return new WaitUntil(() => Time.frameCount >= nextFrameNumber); Assert.AreEqual(3, m_ServerClientDisconnectedInvocations); } private void Server_OnClientDisconnectedCallback(ulong clientId) { m_ServerClientDisconnectedInvocations++; } [TearDown] public void TearDown() { if (m_PlayerPrefab != null) { Object.Destroy(m_PlayerPrefab); m_PlayerPrefab = null; } if (m_PlayerPrefabOverride != null) { Object.Destroy(m_PlayerPrefabOverride); m_PlayerPrefabOverride = null; } // Shutdown and clean up both of our NetworkManager instances MultiInstanceHelpers.Destroy(); } } }
40.12013
154
0.627499
[ "MIT" ]
Briancoughlin/com.unity.netcode.gameobjects
testproject/Assets/Tests/Runtime/MultiClientConnectionApproval.cs
12,357
C#
using System; using System.ComponentModel; using System.IO; using System.Runtime.InteropServices; using System.Security.Cryptography; namespace SharpDPAPI { public class Crypto { public static string KerberosPasswordHash(Interop.KERB_ETYPE etype, string password, string salt = "", int count = 4096) { // use the internal KERB_ECRYPT HashPassword() function to calculate a password hash of a given etype // adapted from @gentilkiwi's Mimikatz "kerberos::hash" implementation Interop.KERB_ECRYPT pCSystem; IntPtr pCSystemPtr; // locate the crypto system for the hash type we want var status = Interop.CDLocateCSystem(etype, out pCSystemPtr); pCSystem = (Interop.KERB_ECRYPT)Marshal.PtrToStructure(pCSystemPtr, typeof(Interop.KERB_ECRYPT)); if (status != 0) throw new Win32Exception(status, "Error on CDLocateCSystem"); // get the delegate for the password hash function var pCSystemHashPassword = (Interop.KERB_ECRYPT_HashPassword)Marshal.GetDelegateForFunctionPointer(pCSystem.HashPassword, typeof(Interop.KERB_ECRYPT_HashPassword)); var passwordUnicode = new Interop.UNICODE_STRING(password); var saltUnicode = new Interop.UNICODE_STRING(salt); var output = new byte[pCSystem.KeySize]; status = pCSystemHashPassword(passwordUnicode, saltUnicode, count, output); if (status != 0) throw new Win32Exception(status); return BitConverter.ToString(output).Replace("-", ""); } public static byte[] DecryptBlob(byte[] ciphertext, byte[] key, int algCrypt, PaddingMode padding = PaddingMode.Zeros) { // decrypts a DPAPI blob using 3DES or AES // reference: https://docs.microsoft.com/en-us/windows/desktop/seccrypto/alg-id switch (algCrypt) { case 26115: // 26115 == CALG_3DES { // takes a byte array of ciphertext bytes and a key array, decrypt the blob with 3DES var desCryptoProvider = new TripleDESCryptoServiceProvider(); var ivBytes = new byte[8]; desCryptoProvider.Key = key; desCryptoProvider.IV = ivBytes; desCryptoProvider.Mode = CipherMode.CBC; desCryptoProvider.Padding = padding; try { var plaintextBytes = desCryptoProvider.CreateDecryptor() .TransformFinalBlock(ciphertext, 0, ciphertext.Length); return plaintextBytes; } catch (Exception e) { Console.WriteLine("[x] An exception occured: {0}", e); } return new byte[0]; } case 26128: // 26128 == CALG_AES_256 { // takes a byte array of ciphertext bytes and a key array, decrypt the blob with AES256 var aesCryptoProvider = new AesManaged(); var ivBytes = new byte[16]; aesCryptoProvider.Key = key; aesCryptoProvider.IV = ivBytes; aesCryptoProvider.Mode = CipherMode.CBC; aesCryptoProvider.Padding = padding; var plaintextBytes = aesCryptoProvider.CreateDecryptor() .TransformFinalBlock(ciphertext, 0, ciphertext.Length); return plaintextBytes; } default: throw new Exception($"Could not decrypt blob. Unsupported algorithm: {algCrypt}"); } } public static byte[] DeriveKey(byte[] keyBytes, byte[] saltBytes, int algHash) { // derives a dpapi session key using Microsoft crypto "magic" // calculate the session key -> HMAC(salt) where the sha1(masterkey) is the key if (algHash == 32782) { // 32782 == CALG_SHA_512 return HMACSha512(keyBytes, saltBytes); } else if (algHash == 32772) { // 32772 == CALG_SHA1 var hmac = new HMACSHA1(keyBytes); var sessionKeyBytes = hmac.ComputeHash(saltBytes); var ipad = new byte[64]; var opad = new byte[64]; // "...wut" - anyone reading Microsoft crypto for (var i = 0; i < 64; i++) { ipad[i] = Convert.ToByte('6'); opad[i] = Convert.ToByte('\\'); } for (var i = 0; i < keyBytes.Length; i++) { ipad[i] ^= sessionKeyBytes[i]; opad[i] ^= sessionKeyBytes[i]; } using (var sha1 = new SHA1Managed()) { var ipadSHA1bytes = sha1.ComputeHash(ipad); var opadSHA1bytes = sha1.ComputeHash(opad); var combined = Helpers.Combine(ipadSHA1bytes, opadSHA1bytes); return combined; } } else { return new byte[0]; } } private static byte[] HMACSha512(byte[] keyBytes, byte[] saltBytes) { var hmac = new HMACSHA512(keyBytes); var sessionKeyBytes = hmac.ComputeHash(saltBytes); return sessionKeyBytes; } public static string ExportPrivateKey(RSACryptoServiceProvider csp) { //https://stackoverflow.com/questions/23734792/c-sharp-export-private-public-rsa-key-from-rsacryptoserviceprovider-to-pem-strin var outputStream = new StringWriter(); if (csp.PublicOnly) throw new ArgumentException("CSP does not contain a private key", "csp"); var parameters = csp.ExportParameters(true); using (var stream = new MemoryStream()) { var writer = new BinaryWriter(stream); writer.Write((byte)0x30); // Sequence using (var innerStream = new MemoryStream()) { var innerWriter = new BinaryWriter(innerStream); Helpers.EncodeIntegerBigEndian(innerWriter, new byte[] { 0x00 }); // Version Helpers.EncodeIntegerBigEndian(innerWriter, parameters.Modulus); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.Exponent); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.D); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.P); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.Q); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.DP); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.DQ); Helpers.EncodeIntegerBigEndian(innerWriter, parameters.InverseQ); var length = (int)innerStream.Length; Helpers.EncodeLength(writer, length); writer.Write(innerStream.GetBuffer(), 0, length); } var base64 = Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length).ToCharArray(); outputStream.Write("-----BEGIN RSA PRIVATE KEY-----\n"); for (var i = 0; i < base64.Length; i += 64) { outputStream.Write(base64, i, Math.Min(64, base64.Length - i)); outputStream.Write("\n"); } outputStream.Write("-----END RSA PRIVATE KEY-----"); } return outputStream.ToString(); } public static byte[] AESDecrypt(byte[] key, byte[] IV, byte[] data) { // helper to AES decrypt a given blob with optional IV var aesCryptoProvider = new AesManaged(); aesCryptoProvider.Key = key; if (IV.Length != 0) { aesCryptoProvider.IV = IV; } aesCryptoProvider.Mode = CipherMode.CBC; var plaintextBytes = aesCryptoProvider.CreateDecryptor().TransformFinalBlock(data, 0, data.Length); return plaintextBytes; } public static byte[] LSAAESDecrypt(byte[] key, byte[] data) { var aesCryptoProvider = new AesManaged(); aesCryptoProvider.Key = key; aesCryptoProvider.IV = new byte[16]; aesCryptoProvider.Mode = CipherMode.CBC; aesCryptoProvider.BlockSize = 128; aesCryptoProvider.Padding = PaddingMode.Zeros; var transform = aesCryptoProvider.CreateDecryptor(); var chunks = Decimal.ToInt32(Math.Ceiling((decimal)data.Length / (decimal)16)); var plaintext = new byte[chunks * 16]; for (var i = 0; i < chunks; ++i) { var offset = i * 16; var chunk = new byte[16]; Array.Copy(data, offset, chunk, 0, 16); var chunkPlaintextBytes = transform.TransformFinalBlock(chunk, 0, chunk.Length); Array.Copy(chunkPlaintextBytes, 0, plaintext, i * 16, 16); } return plaintext; } public static byte[] RSADecrypt(byte[] privateKey, byte[] dataToDecrypt) { // helper to RSA decrypt a given blob // PROV_RSA_AES == 24 var cspParameters = new CspParameters(24); using (var rsaProvider = new RSACryptoServiceProvider(cspParameters)) { try { rsaProvider.PersistKeyInCsp = false; rsaProvider.ImportCspBlob(privateKey); var dataToDecryptRev = new byte[256]; Buffer.BlockCopy(dataToDecrypt, 0, dataToDecryptRev, 0, dataToDecrypt.Length); // ... Array.Copy? naw... :( Array.Reverse(dataToDecryptRev); // ... don't ask me how long it took to realize this :( var dec = rsaProvider.Decrypt(dataToDecryptRev, false); // no padding return dec; } catch (Exception e) { Console.WriteLine("Error decryption domain key: {0}", e.Message); } finally { rsaProvider.PersistKeyInCsp = false; rsaProvider.Clear(); } } return new byte[0]; } public static byte[] LSASHA256Hash(byte[] key, byte[] rawData) { // yay using (var sha256Hash = SHA256.Create()) { var buffer = new byte[key.Length + (rawData.Length * 1000)]; Array.Copy(key, 0, buffer, 0, key.Length); for (var i = 0; i < 1000; ++i) { Array.Copy(rawData, 0, buffer, key.Length + (i * rawData.Length), rawData.Length); } return sha256Hash.ComputeHash(buffer); } } } }
39.64726
176
0.527166
[ "BSD-3-Clause" ]
Bl4d3666/SharpMapExec
SharpMapExec/Projects/SharpDPAPI/lib/Crypto.cs
11,579
C#
namespace Light.Data { internal class LightConditionDataFieldInfo : LightDataFieldInfo, ISupportNotDefine, IDataFieldInfoConvert { private readonly object _ifTrue; private readonly object _ifFalse; private readonly QueryExpression _query; private bool _isNot; public LightConditionDataFieldInfo (QueryExpression query, object ifTrue, object ifFalse) : base (query.TableMapping) { _query = query; _ifTrue = ifTrue; _ifFalse = ifFalse; } public void SetNot () { _isNot = !_isNot; } internal override string CreateSqlString (CommandFactory factory, bool isFullName, CreateSqlState state) { var sql = state.GetDataSql (this, isFullName); if (sql != null) { return sql; } var query = _query.CreateSqlString (factory, isFullName, state); object ifTrue; object ifFalse; var ifTrueInfo = _ifTrue as DataFieldInfo; var ifFalseInfo = _ifFalse as DataFieldInfo; if (!Equals (ifTrueInfo, null) && !Equals (ifFalseInfo, null)) { ifTrue = ifTrueInfo.CreateSqlString (factory, isFullName, state); ifFalse = ifFalseInfo.CreateSqlString (factory, isFullName, state); } else if (!Equals (ifTrueInfo, null)) { ifTrue = ifTrueInfo.CreateSqlString (factory, isFullName, state); var ifFalseObject = LambdaExpressionExtend.ConvertLambdaObject (_ifFalse).AdjustValue(); ifFalse = state.AddDataParameter (factory, ifFalseObject); } else if (!Equals (ifFalseInfo, null)) { ifFalse = ifFalseInfo.CreateSqlString (factory, isFullName, state); var ifTrueObject = LambdaExpressionExtend.ConvertLambdaObject (_ifTrue).AdjustValue(); ifTrue = state.AddDataParameter (factory, ifTrueObject); } else { var ifTrueObject = LambdaExpressionExtend.ConvertLambdaObject (_ifTrue).AdjustValue(); var ifFalseObject = LambdaExpressionExtend.ConvertLambdaObject (_ifFalse).AdjustValue(); ifTrue = state.AddDataParameter (factory, ifTrueObject); ifFalse = state.AddDataParameter (factory, ifFalseObject); } sql = factory.CreateConditionSql (query, ifTrue, ifFalse); state.SetDataSql (this, isFullName, sql); return sql; } public QueryExpression ConvertToExpression () { return new LightConditionQueryExpression (this); } } }
31.305556
106
0.73425
[ "MIT" ]
aquilahkj/Light.Data2
src/Light.Data/DataField/LightConditionDataFieldInfo.cs
2,256
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Markdig.Renderers.Normalize; using Markdig.Syntax.Inlines; namespace NuGet.Services.Messaging.Email.Internal { /// <summary> /// A Plain Text renderer for an <see cref="EmphasisInline"/>. /// </summary> internal class PlainTextEmphasisInlineRenderer : NormalizeObjectRenderer<EmphasisInline> { protected override void Write(NormalizeRenderer renderer, EmphasisInline obj) { renderer.WriteChildren(obj); } } }
32.25
111
0.710078
[ "Apache-2.0" ]
DalavanCloud/ServerCommon
src/NuGet.Services.Messaging.Email/Internal/PlainTextEmphasisInlineRenderer.cs
647
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel.Composition.Primitives; namespace System.ComponentModel.Composition.Hosting { public static class CompositionConstants { private const string CompositionNamespace = "System.ComponentModel.Composition"; public const string PartCreationPolicyMetadataName = CompositionNamespace + ".CreationPolicy"; public const string ImportSourceMetadataName = CompositionNamespace + ".ImportSource"; public const string IsGenericPartMetadataName = CompositionNamespace + ".IsGenericPart"; public const string GenericContractMetadataName = CompositionNamespace + ".GenericContractName"; public const string GenericParametersMetadataName = CompositionNamespace + ".GenericParameters"; public const string ExportTypeIdentityMetadataName = "ExportTypeIdentity"; internal const string GenericImportParametersOrderMetadataName = CompositionNamespace + ".GenericImportParametersOrderMetadataName"; internal const string GenericExportParametersOrderMetadataName = CompositionNamespace + ".GenericExportParametersOrderMetadataName"; internal const string GenericPartArityMetadataName = CompositionNamespace + ".GenericPartArity"; internal const string GenericParameterConstraintsMetadataName = CompositionNamespace + ".GenericParameterConstraints"; internal const string GenericParameterAttributesMetadataName = CompositionNamespace + ".GenericParameterAttributes"; internal const string ProductDefinitionMetadataName = "ProductDefinition"; internal const string PartCreatorContractName = CompositionNamespace + ".Contracts.ExportFactory"; internal static readonly string PartCreatorTypeIdentity = AttributedModelServices.GetTypeIdentity(typeof(ComposablePartDefinition)); } }
50.609756
96
0.752289
[ "MIT" ]
belav/runtime
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionConstants.cs
2,075
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Text; using UnityEngine; using System.Text.RegularExpressions; using System.Linq; namespace Stratus { /// <summary> /// Encloses a string. For example, "dog" -> "<dog>" /// </summary> public enum StratusStringEnclosure { /// <summary> /// foo /// </summary> None, /// <summary> /// (foo) /// </summary> Parenthesis, /// <summary> /// 'foo' /// </summary> Quote, /// <summary> /// "foo" /// </summary> DoubleQuote, /// <summary> /// [foo] /// </summary> SquareBracket, /// <summary> /// {foo} /// </summary> CurlyBracket, /// <summary> /// <foo> /// </summary> AngleBracket } public static class StringExtensions { //--------------------------------------------------------------------/ // Fields //--------------------------------------------------------------------/ public const char newlineChar = '\n'; public const string newlineString = "\n"; public static readonly string[] newlineSeparators = new string[] { "\r\n", "\n", "\r", }; public const char whitespace = ' '; public const char underscore = '_'; private static StringBuilder stringBuilder = new StringBuilder(); //--------------------------------------------------------------------/ // Methods //--------------------------------------------------------------------/ /// <summary> /// Encloses the given string. For example, with <see cref="StratusStringEnclosure.SquareBracket"/>: "foo" -> "[foo]" /// </summary> /// <param name="input"></param> /// <param name="enclosure"></param> /// <param name="escape">Whether the enclosure should be escaped by <see cref="Regex.Escape(string)"/></param> /// <returns></returns> public static string Enclose(this string input, StratusStringEnclosure enclosure, bool escape = false) { switch (enclosure) { case StratusStringEnclosure.Parenthesis: return escape ? $"{Regex.Escape("(")}{input}{Regex.Escape(")")}" : $"({input})"; case StratusStringEnclosure.Quote: return escape ? $"{Regex.Escape("'")}{input}{Regex.Escape("'")}" : $"'{input}'"; case StratusStringEnclosure.DoubleQuote: return escape ? $"{Regex.Escape("\"")}{input}{Regex.Escape("\"")}" : $"\"{input}\""; case StratusStringEnclosure.SquareBracket: return escape ? $"{Regex.Escape("[")}{input}{Regex.Escape("]")}" : $"[{input}]"; case StratusStringEnclosure.CurlyBracket: return escape ? $"{Regex.Escape("{")}{input}{Regex.Escape("}")}" : $"{{{input}}}"; case StratusStringEnclosure.AngleBracket: return escape ? $"{Regex.Escape("<")}{input}{Regex.Escape(">")}" : $"<{input}>"; } return input; } /// <summary> /// Given a string and a dictionary of replacements, replaces all instances of each replacement found in the string /// </summary> /// <param name="input"></param> /// <param name="replacements"></param> /// <returns></returns> public static string Replace(this string input, Dictionary<string, string> replacements) { stringBuilder.Clear(); stringBuilder.Append(input); foreach(var replacement in replacements) { stringBuilder.Replace(replacement.Key, replacement.Value); } return stringBuilder.ToString(); } /// <summary> /// Returns true if the string is null or empty /// </summary> public static bool IsNullOrEmpty(this string str) { return string.IsNullOrEmpty(str); } /// <summary> /// Returns true if the rich text is null or empty /// </summary> public static bool IsNullOrEmpty(this StratusRichText richText) { return richText == null || string.IsNullOrEmpty(richText.text); } /// <summary> /// Returns true if the string is neither null or empty /// </summary> /// <param name="str"></param> /// <returns></returns> public static bool IsValid(this string str) { return !str.IsNullOrEmpty(); } /// <summary> /// Returns true if the richtext is neither null or empty /// </summary> /// <param name="str"></param> /// <returns></returns> public static bool IsValid(this StratusRichText str) { return !str.IsNullOrEmpty(); } /// <summary> /// Appends a sequence of strings to the end of this string /// </summary> /// <param name="str"></param> /// <param name="sequence"></param> /// <returns></returns> public static string Append(this string str, IEnumerable<string> sequence) { StringBuilder builder = new StringBuilder(str); foreach (string item in sequence) { builder.Append(item); } return builder.ToString(); } /// <summary> /// Appends the sequence to the given string /// </summary> /// <param name="str"></param> /// <param name="sequence"></param> /// <returns></returns> public static string Append(this string str, params string[] sequence) { return str.Append((IEnumerable<string>)sequence); } /// <summary> /// Appends all the lines to the given string /// </summary> /// <param name="str"></param> /// <param name="lines"></param> /// <returns></returns> public static string AppendLines(this string str, params string[] lines) { stringBuilder.Clear(); stringBuilder.Append(str); if (lines.Length > 0) { lines.ForEach(x => stringBuilder.Append($"{Environment.NewLine}{x}")); } return stringBuilder.ToString(); } /// <summary> /// Sorts the array using the default <see cref="Array.Sort(Array)"/> /// </summary> public static string[] ToSorted(this string[] source) { string[] destination = new string[source.Length]; Array.Copy(source, destination, source.Length); Array.Sort(destination); return destination; } /// <summary> /// Strips all newlines in the string, replacing them with spaces /// </summary> /// <param name="str"></param> /// <returns></returns> public static string ReplaceNewLines(this string str, string replacement) { return str.Replace("\n", replacement); } public static string[] SplitNewlines(this string input, StringSplitOptions options = StringSplitOptions.None) { if (input.IsNullOrEmpty()) { return new string[] { }; } return input.Split(newlineSeparators, options); } public static IEnumerable<string> ReadNewlines(this string input) { if (input == null) { yield break; } using (System.IO.StringReader reader = new System.IO.StringReader(input)) { string line; while ((line = reader.ReadLine()) != null) { yield return line; } } } /// <summary> /// Counts the number of lines in this string (by splitting it) /// </summary> /// <param name="str"></param> /// <returns></returns> public static int CountLines(this string str, StringSplitOptions options = StringSplitOptions.None) { return str.Count(x => x == newlineChar) + 1; } /// <summary> /// Uppercases the first character of this string /// </summary> public static string UpperFirst(this string input) { switch (input) { case null: throw new ArgumentNullException(nameof(input)); case "": throw new ArgumentException($"{nameof(input)} cannot be empty", nameof(input)); default: return input.First().ToString().ToUpper() + input.Substring(1); } } /// <summary> /// Concatenates the elements of a specified array or the members of a collection, /// using the specified separator between each element or member. /// </summary> public static string Join(this IEnumerable<string> str, string separator) { return string.Join(separator, str); } /// <summary> /// Concatenates the elements of a specified array or the members of a collection, /// using the specified separator between each element or member. /// </summary> public static string Join(this IEnumerable<string> str, char separator) { return string.Join(separator.ToString(), str); } public static string Join(this string str, IEnumerable<string> values) { return string.Join(str, values); } public static string Join(this string str, params string[] values) { return string.Join(str, values); } /// <summary> /// Concatenates the elements of a specified array or the members of a collection, /// using the newline separator between each element or member. /// </summary> public static string JoinLines(this IEnumerable<string> str) { return string.Join(newlineString, str); } /// <summary> /// Converts a string to camel case. eg: "Hello There" -> "helloThere" /// </summary> /// <param name="str"></param> /// <returns></returns> public static string ToCamelCase(this string str) { if (!string.IsNullOrEmpty(str) && str.Length > 1) { return char.ToLowerInvariant(str[0]) + str.Substring(1); } return str; } /// <summary> /// Converts a string to title case. eg: "HelloThere" -> "Hello There") /// </summary> /// <param name="input"></param> /// <returns></returns> public static string ToTitleCase(this string input) { StringBuilder builder = new StringBuilder(); bool previouslyUppercase = false; for (int i = 0; i < input.Length; i++) { char current = input[i]; if ((current == underscore || current == whitespace) && (i + 1 < input.Length)) { if (i > 0) { builder.Append(whitespace); } char next = input[i + 1]; if (char.IsLower(next)) { next = char.ToUpper(next, CultureInfo.InvariantCulture); } builder.Append(next); i++; } else { // Special case for first char if (i == 0) { builder.Append(current.ToUpper()); previouslyUppercase = true; } // Upper else if (current.IsUpper()) { if (previouslyUppercase) { builder.Append(current.ToLower()); } else { builder.Append(whitespace); builder.Append(current); previouslyUppercase = true; } } // Lower else { builder.Append(current); previouslyUppercase = false; } } } return builder.ToString(); } public static string ToRichText(this string input, StratusRichTextOptions options) { StringBuilder builder = new StringBuilder(); switch (options.style) { case FontStyle.Normal: break; case FontStyle.Bold: builder.Append("<b>"); break; case FontStyle.Italic: builder.Append("<i>"); break; case FontStyle.BoldAndItalic: builder.Append("<b><i>"); break; } bool applyColor = options.hexColor.IsValid(); bool applySize = options.size > 0; if (applyColor) { builder.Append($"<color=#{options.hexColor}>"); } if (applySize) { builder.Append($"<size={options.size}>"); } builder.Append(input); if (applyColor) { builder.Append("</color>"); } if (applySize) { builder.Append("</size>"); } switch (options.style) { case FontStyle.Normal: break; case FontStyle.Bold: builder.Append("</b>"); break; case FontStyle.Italic: builder.Append("</i>"); break; case FontStyle.BoldAndItalic: builder.Append("</i></b>"); break; } return builder.ToString(); } /// <summary> /// Formats this string, applying rich text formatting to it /// </summary> public static string ToRichText(this string input, FontStyle style, string hexColor, int size = 0) => input.ToRichText(new StratusRichTextOptions(style, hexColor, size)); /// <summary> /// Formats this string, applying rich text formatting to it /// </summary> public static string ToRichText(this string input, FontStyle style, Color color, int size = 0) => input.ToRichText(style, color.ToHex(), size); /// <summary> /// Formats this string, applying rich text formatting to it /// </summary> public static string ToRichText(this string input, int size) => input.ToRichText(FontStyle.Normal, null, size); /// <summary> /// Formats this string, applying rich text formatting to it /// </summary> /// <param name="input"></param> /// <returns></returns> public static string ToRichText(this string input, FontStyle style) => input.ToRichText(style, null, 0); /// <summary> /// Formats this string, applying rich text formatting to it /// </summary> public static string ToRichText(this string input, Color color) => input.ToRichText(FontStyle.Normal, color); /// <summary> /// Strips Unity's rich text from the given string /// </summary> /// <param name="str"></param> /// <returns></returns> public static string StripRichText(this string input) { const string pattern = @"</?(b|i|size(=?.*?)|color(=?.*?))>"; return Regex.Replace(input, pattern, string.Empty); } /// <summary> /// If the string exceeds the given length, truncates any characters at the cutoff length, /// appending the replacement string to the end instead /// </summary> /// <param name="input"></param> /// <param name="length"></param> /// <param name="replacement"></param> /// <returns></returns> public static string Truncate(this string input, int length, string replacement = "...") { if (input.Length > length) { input = $"{input.Substring(0, length)}{replacement}"; } return input; } /// <summary> /// Removes null or empty strings from the sequence /// </summary> public static IEnumerable<string> TrimNullOrEmpty(this IEnumerable<string> sequence) => sequence.TrimNullOrEmpty(null); /// <summary> /// Removes strings that are null, empty or that fail the predicate from the sequence /// </summary> public static IEnumerable<string> TrimNullOrEmpty(this IEnumerable<string> sequence, Predicate<string> predicate) { foreach (var item in sequence) { if (item.IsValid()) { if (predicate != null && !predicate.Invoke(item)) { continue; } yield return item; } } } /// <summary> /// Removes null or empty strings from the sequence /// </summary> public static string[] TrimNullOrEmpty(this string[] sequence) => ((IEnumerable<string>)sequence).TrimNullOrEmpty().ToArray(); /// <summary> /// Removes strings that are null, empty or that fail the predicate from the sequence /// </summary> public static string[] TrimNullOrEmpty(this string[] sequence, Predicate<string> predicate) => ((IEnumerable<string>)sequence).TrimNullOrEmpty(predicate).ToArray(); } }
27.444234
166
0.625982
[ "MIT" ]
Azurelol/Stratus-Core
Runtime/Extensions/StratusStringExtensions.cs
14,518
C#
using RedisBlue.Interfaces; using RedisBlue.Models; using StackExchange.Redis; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace RedisBlue.Services { internal class ConstantResolver : IExpressionResolver { public ConstantResolver() { } public ExpressionType[] NodeTypes => new ExpressionType[] { ExpressionType.Constant, }; public async Task<ResolverResult> Resolve(ExpressionContext context, Expression expression) { if (expression is not ConstantExpression) throw new NotImplementedException(); var constant = (ConstantExpression)expression; return new ValueResult(constant.Value); } } }
25
99
0.668889
[ "MIT" ]
danielgerlag/redisblue
RedisBlue/Services/ExpressionResolvers/ConstantResolver.cs
902
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview { using Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.PowerShell; /// <summary>The properties for a group information object</summary> [System.ComponentModel.TypeConverter(typeof(GroupIdInformationPropertiesTypeConverter))] public partial class GroupIdInformationProperties { /// <summary> /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the /// object before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); /// <summary> /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); /// <summary> /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); /// <summary> /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// <summary> /// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param> /// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param> partial void OverrideToString(ref string stringResult, ref bool returnNow); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.GroupIdInformationProperties" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationProperties" /// />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GroupIdInformationProperties(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.GroupIdInformationProperties" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationProperties" /// />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GroupIdInformationProperties(content); } /// <summary> /// Creates a new instance of <see cref="GroupIdInformationProperties" />, deserializing the content from a json string. /// </summary> /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param> /// <returns>an instance of the <see cref="className" /> model class.</returns> public static Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.Json.JsonNode.Parse(jsonText)); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.GroupIdInformationProperties" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> internal GroupIdInformationProperties(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize if (content.Contains("GroupId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { ((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { ((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.GroupIdInformationProperties" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> internal GroupIdInformationProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize if (content.Contains("GroupId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { ((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { ((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20210401Preview.IGroupIdInformationPropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// <summary>Serializes this instance to a json string.</summary> /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns> public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.SerializationMode.IncludeAll)?.ToString(); public override string ToString() { var returnNow = false; var result = global::System.String.Empty; OverrideToString(ref result, ref returnNow); if (returnNow) { return result; } return ToJsonString(); } } /// The properties for a group information object [System.ComponentModel.TypeConverter(typeof(GroupIdInformationPropertiesTypeConverter))] public partial interface IGroupIdInformationProperties { } }
65.733333
440
0.694388
[ "MIT" ]
Agazoth/azure-powershell
src/Databricks/generated/api/Models/Api20210401Preview/GroupIdInformationProperties.PowerShell.cs
11,653
C#
/*=================================\ * ArduinoFileBrowser\Program.cs * * The Coestaris licenses this file to you under the MIT license. * See the LICENSE file in the project root for more information. * * Created: 06.08.2017 20:09 * Last Edited: 09.09.2017 21:10:45 *=================================*/ using System; using System.Windows.Forms; namespace FileBrowser { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new SelectPortForm()); } } }
23.703704
65
0.5875
[ "MIT" ]
Coestaris/PlotterControl
Tools/ArduinoFileBrowser/Program.cs
640
C#
using System; using System.ComponentModel; using DotNetVault.Attributes; using JetBrains.Annotations; namespace LaundryMachine.LaundryCode { [VaultSafe] public readonly struct ErrorRegistrationStatus : IEquatable<ErrorRegistrationStatus>, IComparable<ErrorRegistrationStatus> { #region Static Initial Value public static ErrorRegistrationStatus NilStatus { get; } = default; #endregion #region Public Data public readonly Guid ErrorIdentifier; public readonly ErrorRegistrationStatusCode StatusCode; public readonly DateTime? RegisteredTimeStamp; public readonly bool IsLogicError; [NotNull] public string Explanation => _errorExplanation ?? string.Empty; #endregion #region Public Methods [Pure] public ErrorRegistrationStatus AsRegistered(DateTime registeredAt, [NotNull] string explanation, bool isLogicError) { Guid id = Guid.NewGuid(); return new ErrorRegistrationStatus(ErrorRegistrationStatusCode.Registered, id, registeredAt, explanation ?? throw new ArgumentNullException(nameof(explanation)), isLogicError); } [Pure] public ErrorRegistrationStatus AsProcessed(DateTime processed, [NotNull] string processInfo) { if (processInfo == null) throw new ArgumentNullException(nameof(processInfo)); if (StatusCode != ErrorRegistrationStatusCode.Registered) throw new InvalidOperationException("Cannot process an item not in registered state."); return new ErrorRegistrationStatus(ErrorRegistrationStatusCode.Processed, ErrorIdentifier, RegisteredTimeStamp, string.Concat($"Reg Info: [{Explanation}]{Environment.NewLine}", $"Proc Info: [{processInfo}]{Environment.NewLine}"), IsLogicError); } [Pure] public ErrorRegistrationStatus AsCleared(DateTime processed, [NotNull] string clearInfo) { if (clearInfo == null) throw new ArgumentNullException(nameof(clearInfo)); if (StatusCode != ErrorRegistrationStatusCode.Processed) throw new InvalidOperationException("Cannot clear an item not in processed state."); return new ErrorRegistrationStatus(ErrorRegistrationStatusCode.Cleared, ErrorIdentifier, RegisteredTimeStamp, string.Concat(Explanation, Environment.NewLine, "CLEARED: " + clearInfo), IsLogicError); } [Pure] public ErrorRegistrationStatus Reset() => default; public override string ToString() => StatusCode == ErrorRegistrationStatusCode.Nil ? "NIL ERROR STATUS" : $"Error registered at [{RegisteredTimeStamp?.ToString("O") ?? "UNKNOWN"}], Identifier: [{ErrorIdentifier}], Info: [{Explanation}]"; #endregion #region Equatable / Comparble Methods and Operators public static bool operator ==(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) => lhs.ErrorIdentifier == rhs.ErrorIdentifier && TheEnumComparer.Equals(lhs.StatusCode, rhs.StatusCode) && lhs.IsLogicError == rhs.IsLogicError && lhs.RegisteredTimeStamp == rhs.RegisteredTimeStamp; public static bool operator !=(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) => !(lhs == rhs); public static bool operator >(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) => Compare(in lhs, in rhs) > 0; public static bool operator <(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) => Compare(in lhs, in rhs) < 0; public static bool operator >=(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) => !(lhs < rhs); public static bool operator <=(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) => !(lhs > rhs); public override bool Equals(object obj) => (obj as ErrorRegistrationStatus?) == this; public bool Equals(ErrorRegistrationStatus other) => other == this; public override int GetHashCode() => ErrorIdentifier.GetHashCode(); public int CompareTo(ErrorRegistrationStatus other) => Compare(in this, in other); #endregion #region Private CTOR and Methods private ErrorRegistrationStatus(ErrorRegistrationStatusCode code, Guid errorIdentifier, DateTime? regTs, string explanation, bool isLogicError) { StatusCode = code.IsValueDefined() ? code : throw new InvalidEnumArgumentException(nameof(code), (int) code, typeof(ErrorRegistrationStatusCode)); RegisteredTimeStamp = regTs; _errorExplanation = explanation ?? string.Empty; ErrorIdentifier = errorIdentifier; IsLogicError = isLogicError; } private static int Compare(in ErrorRegistrationStatus lhs, in ErrorRegistrationStatus rhs) { int ret; int tsComp = NullableTsHelper.CompareNullableTimeStamps(lhs.RegisteredTimeStamp, rhs.RegisteredTimeStamp); if (tsComp == 0) { int guidComp = lhs.ErrorIdentifier.CompareTo(rhs.ErrorIdentifier); if (guidComp == 0) { int logicComp = lhs.IsLogicError.CompareTo(rhs.IsLogicError); ret= logicComp == 0 ? TheEnumComparer.Compare(lhs.StatusCode, rhs.StatusCode) : logicComp; } else { ret = guidComp; } } else //tsComp != 0 { ret = tsComp; } return ret; } #endregion #region Private Data private readonly string _errorExplanation; private static readonly EnumComparer<ErrorRegistrationStatusCode> TheEnumComparer = new EnumComparer<ErrorRegistrationStatusCode>(); #endregion } }
47.539063
155
0.650616
[ "MIT-0", "MIT" ]
JTOne123/DotNetVault
ExampleLaundryMachine/LaundryMachine/LaundryCode/ErrorRegistrationStatus.cs
6,087
C#
// <auto-generated> - Template:SqliteModelData, Version:1.1, Id:c5caad15-b3be-4443-87d8-7cabde59f7b0 using SQLite; namespace MSC.CM.Xam.ModelData.CM { [Table("SessionLike")] public partial class SessionLike { public string CreatedBy { get; set; } public System.DateTime CreatedUtcDate { get; set; } public int DataVersion { get; set; } public bool IsDeleted { get; set; } public string ModifiedBy { get; set; } public System.DateTime ModifiedUtcDate { get; set; } // Mutiple primary keys - composite PK used instead [Indexed(Name = "SessionLike", Order = 1, Unique = true)] public int SessionId { get; set; } // Mutiple primary keys - composite PK used instead [Indexed(Name = "SessionLike", Order = 2, Unique = true)] public int UserProfileId { get; set; } [PrimaryKey] public string SessionIdUserProfileId { get; set; } } }
31.814815
111
0.7078
[ "Apache-2.0" ]
MSCTek/ConferenceMate
src/MSC.CM.Xam/ModelData/SessionLike.cs
859
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the customer-profiles-2020-08-15.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.CustomerProfiles.Model { /// <summary> /// Workflow step details for <code>APPFLOW_INTEGRATION</code> workflow. /// </summary> public partial class AppflowIntegrationWorkflowStep { private string _batchRecordsEndTime; private string _batchRecordsStartTime; private DateTime? _createdAt; private string _executionMessage; private string _flowName; private DateTime? _lastUpdatedAt; private long? _recordsProcessed; private Status _status; /// <summary> /// Gets and sets the property BatchRecordsEndTime. /// <para> /// End datetime of records pulled in batch during execution of workflow step for <code>APPFLOW_INTEGRATION</code> /// workflow. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=255)] public string BatchRecordsEndTime { get { return this._batchRecordsEndTime; } set { this._batchRecordsEndTime = value; } } // Check to see if BatchRecordsEndTime property is set internal bool IsSetBatchRecordsEndTime() { return this._batchRecordsEndTime != null; } /// <summary> /// Gets and sets the property BatchRecordsStartTime. /// <para> /// Start datetime of records pulled in batch during execution of workflow step for <code>APPFLOW_INTEGRATION</code> /// workflow. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=255)] public string BatchRecordsStartTime { get { return this._batchRecordsStartTime; } set { this._batchRecordsStartTime = value; } } // Check to see if BatchRecordsStartTime property is set internal bool IsSetBatchRecordsStartTime() { return this._batchRecordsStartTime != null; } /// <summary> /// Gets and sets the property CreatedAt. /// <para> /// Creation timestamp of workflow step for <code>APPFLOW_INTEGRATION</code> workflow. /// </para> /// </summary> [AWSProperty(Required=true)] public DateTime CreatedAt { get { return this._createdAt.GetValueOrDefault(); } set { this._createdAt = value; } } // Check to see if CreatedAt property is set internal bool IsSetCreatedAt() { return this._createdAt.HasValue; } /// <summary> /// Gets and sets the property ExecutionMessage. /// <para> /// Message indicating execution of workflow step for <code>APPFLOW_INTEGRATION</code> /// workflow. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=255)] public string ExecutionMessage { get { return this._executionMessage; } set { this._executionMessage = value; } } // Check to see if ExecutionMessage property is set internal bool IsSetExecutionMessage() { return this._executionMessage != null; } /// <summary> /// Gets and sets the property FlowName. /// <para> /// Name of the flow created during execution of workflow step. <code>APPFLOW_INTEGRATION</code> /// workflow type creates an appflow flow during workflow step execution on the customers /// behalf. /// </para> /// </summary> [AWSProperty(Required=true, Max=256)] public string FlowName { get { return this._flowName; } set { this._flowName = value; } } // Check to see if FlowName property is set internal bool IsSetFlowName() { return this._flowName != null; } /// <summary> /// Gets and sets the property LastUpdatedAt. /// <para> /// Last updated timestamp for workflow step for <code>APPFLOW_INTEGRATION</code> workflow. /// </para> /// </summary> [AWSProperty(Required=true)] public DateTime LastUpdatedAt { get { return this._lastUpdatedAt.GetValueOrDefault(); } set { this._lastUpdatedAt = value; } } // Check to see if LastUpdatedAt property is set internal bool IsSetLastUpdatedAt() { return this._lastUpdatedAt.HasValue; } /// <summary> /// Gets and sets the property RecordsProcessed. /// <para> /// Total number of records processed during execution of workflow step for <code>APPFLOW_INTEGRATION</code> /// workflow. /// </para> /// </summary> [AWSProperty(Required=true)] public long RecordsProcessed { get { return this._recordsProcessed.GetValueOrDefault(); } set { this._recordsProcessed = value; } } // Check to see if RecordsProcessed property is set internal bool IsSetRecordsProcessed() { return this._recordsProcessed.HasValue; } /// <summary> /// Gets and sets the property Status. /// <para> /// Workflow step status for <code>APPFLOW_INTEGRATION</code> workflow. /// </para> /// </summary> [AWSProperty(Required=true)] public Status Status { get { return this._status; } set { this._status = value; } } // Check to see if Status property is set internal bool IsSetStatus() { return this._status != null; } } }
32.495098
124
0.593151
[ "Apache-2.0" ]
Hazy87/aws-sdk-net
sdk/src/Services/CustomerProfiles/Generated/Model/AppflowIntegrationWorkflowStep.cs
6,629
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: Templates\CSharp\Requests\EntityCollectionRequestBuilder.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; /// <summary> /// The type CalendarEventsCollectionRequestBuilder. /// </summary> public partial class CalendarEventsCollectionRequestBuilder : BaseRequestBuilder, ICalendarEventsCollectionRequestBuilder { /// <summary> /// Constructs a new CalendarEventsCollectionRequestBuilder. /// </summary> /// <param name="requestUrl">The URL for the built request.</param> /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param> public CalendarEventsCollectionRequestBuilder( string requestUrl, IBaseClient client) : base(requestUrl, client) { } /// <summary> /// Builds the request. /// </summary> /// <returns>The built request.</returns> public ICalendarEventsCollectionRequest Request() { return this.Request(null); } /// <summary> /// Builds the request. /// </summary> /// <param name="options">The query and header options for the request.</param> /// <returns>The built request.</returns> public ICalendarEventsCollectionRequest Request(IEnumerable<Option> options) { return new CalendarEventsCollectionRequest(this.RequestUrl, this.Client, options); } /// <summary> /// Gets an <see cref="IEventRequestBuilder"/> for the specified CalendarEvent. /// </summary> /// <param name="id">The ID for the CalendarEvent.</param> /// <returns>The <see cref="IEventRequestBuilder"/>.</returns> public IEventRequestBuilder this[string id] { get { return new EventRequestBuilder(this.AppendSegmentToRequestUrl(id), this.Client); } } /// <summary> /// Gets the request builder for EventDelta. /// </summary> /// <returns>The <see cref="IEventDeltaRequestBuilder"/>.</returns> public IEventDeltaRequestBuilder Delta() { return new EventDeltaRequestBuilder( this.AppendSegmentToRequestUrl("microsoft.graph.delta"), this.Client); } } }
37.72
153
0.581831
[ "MIT" ]
OfficeGlobal/msgraph-beta-sdk-dotnet
src/Microsoft.Graph/Requests/Generated/CalendarEventsCollectionRequestBuilder.cs
2,829
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System.Text.Json; using Azure.Core; namespace Affinda.API.Models { public partial class Components7CqvqpSchemasInvoicedataPropertiesInvoicenumberAllof2 { internal static Components7CqvqpSchemasInvoicedataPropertiesInvoicenumberAllof2 DeserializeComponents7CqvqpSchemasInvoicedataPropertiesInvoicenumberAllof2(JsonElement element) { Optional<string> raw = default; Optional<string> parsed = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("raw")) { if (property.Value.ValueKind == JsonValueKind.Null) { raw = null; continue; } raw = property.Value.GetString(); continue; } if (property.NameEquals("parsed")) { if (property.Value.ValueKind == JsonValueKind.Null) { parsed = null; continue; } parsed = property.Value.GetString(); continue; } } return new Components7CqvqpSchemasInvoicedataPropertiesInvoicenumberAllof2(raw.Value, parsed.Value); } } }
33.304348
183
0.539164
[ "MIT" ]
affinda/affinda-dotnet
AffindaAPI/AffindaAPI/Models/Components7CqvqpSchemasInvoicedataPropertiesInvoicenumberAllof2.Serialization.cs
1,532
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ICSharpCode.CodeConverter.Tests.TestRunners; using Xunit; namespace ICSharpCode.CodeConverter.Tests.CSharp.MissingSemanticModelInfo { public class StatementTests : ConverterTestBase { [Fact] public async Task MissingLoopTypeAsync() { await TestConversionVisualBasicToCSharpAsync(@"Class MissingLoopType Public Sub Test() Dim x As Asadf = Nothing For i = 1 To x.SomeInteger Next End Sub End Class", @" internal partial class MissingLoopType { public void Test() { Asadf x = default; for (int i = 1, loopTo = x.SomeInteger; i <= loopTo; i++) { } } } 1 source compilation errors: BC30002: Type 'Asadf' is not defined. 1 target compilation errors: CS0246: The type or namespace name 'Asadf' could not be found (are you missing a using directive or an assembly reference?)", missingSemanticInfo: true); } [Fact] public async Task RedimOfUnknownVariableAsync() { await TestConversionVisualBasicToCSharpAsync(@"ReDim Preserve UnknownArray(unknownIntIdentifer)", @"{ Array.Resize(ref UnknownArray, unknownIntIdentifer + 1); } 2 source compilation errors: BC30451: 'UnknownArray' is not declared. It may be inaccessible due to its protection level. BC30451: 'unknownIntIdentifer' is not declared. It may be inaccessible due to its protection level. 2 target compilation errors: CS0103: The name 'UnknownArray' does not exist in the current context CS0103: The name 'unknownIntIdentifer' does not exist in the current context", missingSemanticInfo: true); } } }
31.859649
154
0.686123
[ "MIT" ]
BrianFreemanAtlanta/CodeConverter
Tests/CSharp/MissingSemanticModelInfo/StatementTests.cs
1,762
C#
// ReSharper disable once CheckNamespace namespace Fluxera.Utilities.Extensions { using System.IO; using System.Reflection; using System.Threading.Tasks; using Guards; using JetBrains.Annotations; [PublicAPI] public static partial class AssemblyExtensions { /// <summary> /// Gets the content of the given embedded resource location as string. /// </summary> /// <param name="assembly">The assembly to use.</param> /// <param name="resourceLocation">The location of the resource.</param> /// <returns>The content of the resource.</returns> public static async Task<string> GetResourceAsStringAsync(this Assembly assembly, string resourceLocation) { Guard.Against.Null(assembly, nameof(assembly)); string result = string.Empty; await using (Stream? stream = assembly.GetManifestResourceStream(resourceLocation)) { if (stream != null && stream.CanRead) { using (StreamReader reader = new StreamReader(stream)) { result = await reader.ReadToEndAsync(); } } } return result; } } }
25.97561
108
0.705164
[ "MIT" ]
fluxera/Fluxera.Utilities
src/Fluxera.Utilities/Extensions/Assembly/GetResourceAsStringAsync.cs
1,067
C#
using System; using System.Runtime.InteropServices; using System.Text; namespace PhysicalResolvePoC.Interop { class Win32Api { [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] public static extern int FormatMessage( Win32Const.FormatMessageFlags dwFlags, IntPtr lpSource, int dwMessageId, int dwLanguageId, StringBuilder lpBuffer, int nSize, IntPtr Arguments); [DllImport("kernel32.dll", SetLastError = true)] public static extern bool FreeLibrary(IntPtr hLibModule); [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] public static extern IntPtr LoadLibrary(string lpFileName); } }
30
83
0.652564
[ "BSD-3-Clause" ]
daem0nc0re/AtomicSyscall
SyscallPoCs/PhysicalResolvePoC/Interop/Win32Api.cs
782
C#
using System; using System.Threading; using System.Threading.Tasks; using NewLife.Log; using NewLife.Threading; namespace NewLife.Net.Handlers { /// <summary>消息匹配队列接口。用于把响应数据包配对到请求包</summary> public interface IMatchQueue { /// <summary>加入请求队列</summary> /// <param name="owner">拥有者</param> /// <param name="request">请求消息</param> /// <param name="msTimeout">超时取消时间</param> /// <param name="source">任务源</param> Task<Object> Add(Object owner, Object request, Int32 msTimeout, TaskCompletionSource<Object> source); /// <summary>检查请求队列是否有匹配该响应的请求</summary> /// <param name="owner">拥有者</param> /// <param name="response">响应消息</param> /// <param name="result">任务结果</param> /// <param name="callback">用于检查匹配的回调</param> /// <returns></returns> Boolean Match(Object owner, Object response, Object result, Func<Object, Object, Boolean> callback); /// <summary>清空队列</summary> void Clear(); } /// <summary>消息匹配队列。子类可重载以自定义请求响应匹配逻辑</summary> public class DefaultMatchQueue : IMatchQueue { private readonly ItemWrap[] Items = new ItemWrap[256]; private Int32 _Count; private TimerX _Timer; /// <summary>加入请求队列</summary> /// <param name="owner">拥有者</param> /// <param name="request">请求的数据</param> /// <param name="msTimeout">超时取消时间</param> /// <param name="source">任务源</param> public virtual Task<Object> Add(Object owner, Object request, Int32 msTimeout, TaskCompletionSource<Object> source) { var now = DateTime.Now; // 控制超时时间,默认15秒 if (msTimeout <= 10) msTimeout = 15_000; var qi = new Item { Owner = owner, Request = request, EndTime = now.AddMilliseconds(msTimeout), Source = source, }; // 加入队列 var items = Items; var i = 0; for (i = 0; i < items.Length; ++i) { if (Interlocked.CompareExchange(ref items[i].Value, qi, null) == null) break; } if (i >= items.Length) throw new XException("匹配队列已满[{0}]", items.Length); Interlocked.Increment(ref _Count); if (_Timer == null) { lock (this) { if (_Timer == null) { _Timer = new TimerX(Check, null, 1000, 1000, "Match") { Async = true, CanExecute = () => _Count > 0 }; } } } return source?.Task; } /// <summary>检查请求队列是否有匹配该响应的请求</summary> /// <param name="owner">拥有者</param> /// <param name="response">响应消息</param> /// <param name="result">任务结果</param> /// <param name="callback">用于检查匹配的回调</param> /// <returns></returns> public virtual Boolean Match(Object owner, Object response, Object result, Func<Object, Object, Boolean> callback) { if (_Count <= 0) return false; // 直接遍历,队列不会很长 var qs = Items; for (var i = 0; i < qs.Length; i++) { var qi = qs[i].Value; if (qi == null) continue; var src = qi.Source; if (src != null && qi.Owner == owner && callback(qi.Request, response)) { qs[i].Value = null; Interlocked.Decrement(ref _Count); // 异步设置完成结果,否则可能会在当前线程恢复上层await,导致堵塞当前任务 if (!src.Task.IsCompleted) Task.Factory.StartNew(() => src.TrySetResult(result)); //if (!src.Task.IsCompleted) src.TrySetResult(result); return true; } } if (Setting.Current.Debug) XTrace.WriteLine("MatchQueue.Check 失败 [{0}] result={1} Items={2}", response, result, _Count); return false; } /// <summary>定时检查发送队列,超时未收到响应则重发</summary> /// <param name="state"></param> void Check(Object state) { if (_Count <= 0) return; var now = DateTime.Now; // 直接遍历,队列不会很长 var qs = Items; for (var i = 0; i < qs.Length; i++) { var qi = qs[i].Value; if (qi == null) continue; // 过期取消 var src = qi.Source; if (src != null && qi.EndTime <= now) { qs[i].Value = null; Interlocked.Decrement(ref _Count); // 当前在线程池里面 if (!src.Task.IsCompleted) src.TrySetCanceled(); //if (!src.Task.IsCompleted) Task.Factory.StartNew(() => src.TrySetCanceled()); } } } /// <summary>清空队列</summary> public virtual void Clear() { var qs = Items; for (var i = 0; i < qs.Length; ++i) { var qi = qs[i].Value; if (qi == null) continue; qs[i].Value = null; // 过期取消 var src = qi.Source; if (src != null) { Interlocked.Decrement(ref _Count); // 当前在线程池里面 if (!src.Task.IsCompleted) src.TrySetCanceled(); //if (!src.Task.IsCompleted) Task.Factory.StartNew(() => src.TrySetCanceled()); } } _Count = 0; } class Item { public Object Owner { get; set; } public Object Request { get; set; } public DateTime EndTime { get; set; } public TaskCompletionSource<Object> Source { get; set; } } struct ItemWrap { public Item Value; } } }
33.417989
124
0.457251
[ "MIT" ]
NewLifeX/X
NewLife.Core/Net/Handlers/IMatchQueue.cs
6,904
C#
using Uno.Extensions; using Uno.MsBuildTasks.Utils; using Uno.MsBuildTasks.Utils.XamlPathParser; using Uno.UI.SourceGenerators.XamlGenerator.Utils; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Text.RegularExpressions; using Microsoft.CodeAnalysis; using Uno.Roslyn; using Microsoft.CodeAnalysis.CSharp.Formatting; using Microsoft.CodeAnalysis.MSBuild; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Formatting; using System.Threading; using Uno; using Uno.Logging; using Uno.UI.SourceGenerators.XamlGenerator.XamlRedirection; namespace Uno.UI.SourceGenerators.XamlGenerator { internal partial class XamlFileGenerator { private Func<string, INamedTypeSymbol> _findType; private Func<XamlType, INamedTypeSymbol> _findTypeByXamlType; private Func<string, string, INamedTypeSymbol> _findPropertyTypeByName; private Func<XamlMember, INamedTypeSymbol> _findPropertyTypeByXamlMember; private Func<XamlMember, IEventSymbol> _findEventType; private Func<INamedTypeSymbol, Dictionary<string, IEventSymbol>> _getEventsForType; private (string ns, string className) _className; private bool _hasLiteralEventsRegistration = false; private string[] _clrNamespaces; private readonly static Func<INamedTypeSymbol, IPropertySymbol> _findContentProperty; private readonly static Func<INamedTypeSymbol, string, bool> _isAttachedProperty; private void InitCaches() { _findType = Funcs.Create<string, INamedTypeSymbol>(SourceFindType).AsLockedMemoized(); _findPropertyTypeByXamlMember = Funcs.Create<XamlMember, INamedTypeSymbol>(SourceFindPropertyType).AsLockedMemoized(); _findEventType = Funcs.Create<XamlMember, IEventSymbol>(SourceFindEventType).AsLockedMemoized(); _findPropertyTypeByName = Funcs.Create<string, string, INamedTypeSymbol>(SourceFindPropertyType).AsLockedMemoized(); _findTypeByXamlType = Funcs.Create<XamlType, INamedTypeSymbol>(SourceFindTypeByXamlType).AsLockedMemoized(); _getEventsForType = Funcs.Create<INamedTypeSymbol, Dictionary<string, IEventSymbol>>(SourceGetEventsForType).AsLockedMemoized(); var defaultXmlNamespace = _fileDefinition .Namespaces .Where(n => n.Prefix.None()) .FirstOrDefault() .SelectOrDefault(n => n.Namespace); _clrNamespaces = _knownNamespaces.UnoGetValueOrDefault(defaultXmlNamespace, new string[0]); } /// <summary> /// Gets the full target type, ensuring it is prefixed by "global::" /// to avoid namespace conflicts /// </summary> private string GetGlobalizedTypeName(string fullTargetType) { // Only prefix if it isn't already prefixed and if the type is fully qualified with a namespace // as opposed to, for instance, "double" or "Style" if (!fullTargetType.StartsWith(GlobalPrefix) && fullTargetType.Contains(QualifiedNamespaceMarker)) { return string.Format(CultureInfo.InvariantCulture, "{0}{1}", GlobalPrefix, fullTargetType); } return fullTargetType; } private bool IsType(XamlType xamlType, XamlType baseType) { if (xamlType == baseType) { return true; } if (baseType == null || xamlType == null) { return false; } var clrBaseType = FindType(baseType); if (clrBaseType != null) { return IsType(xamlType, clrBaseType.ToDisplayString()); } else { return false; } } private bool IsType(XamlType xamlType, string typeName) { var type = FindType(xamlType); if (type != null) { do { if (type.ToDisplayString() == typeName) { return true; } type = type.BaseType; if (type == null) { break; } } while (type.Name != "Object"); } return false; } public bool HasProperty(XamlType xamlType, string propertyName) { var type = FindType(xamlType); if (type != null) { do { if (type.GetAllProperties().Any(property => property.Name == propertyName)) { return true; } type = type.BaseType; if (type == null) { break; } } while (type.Name != "Object"); } return false; } private bool IsRun(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.Run); } private bool IsSpan(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.Span); } private bool IsImplementingInterface(INamedTypeSymbol symbol, INamedTypeSymbol interfaceName) { bool isSameType(INamedTypeSymbol source, INamedTypeSymbol iface) => source == iface || source.OriginalDefinition == iface; if (symbol != null) { if (isSameType(symbol, interfaceName)) { return true; } do { if (symbol.Interfaces.Any(i => isSameType(i, interfaceName))) { return true; } symbol = symbol.BaseType; if (symbol == null) { break; } } while (symbol.Name != "Object"); } return false; } private bool IsBorder(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.Border); } private bool IsUserControl(XamlType xamlType, bool checkInheritance = true) { return checkInheritance ? IsType(xamlType, XamlConstants.Types.UserControl) : FindType(xamlType)?.ToDisplayString().Equals(XamlConstants.Types.UserControl) ?? false; } private bool IsContentControl(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.ContentControl); } private bool IsPanel(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.Panel); } private bool IsLinearGradientBrush(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.LinearGradientBrush); } private bool IsFrameworkElement(XamlType xamlType) { return IsImplementingInterface(FindType(xamlType), _iFrameworkElementSymbol); } private bool IsAndroidView(XamlType xamlType) { return IsType(xamlType, "Android.Views.View"); } private bool IsIOSUIView(XamlType xamlType) { return IsType(xamlType, "UIKit.UIView"); } private bool IsTransform(XamlType xamlType) { return IsType(xamlType, XamlConstants.Types.Transform); } private bool IsDependencyProperty(XamlMember member) { string name = member.Name; var propertyOwner = FindType(member.DeclaringType); return IsDependencyProperty(propertyOwner, name); } private static bool IsDependencyProperty(INamedTypeSymbol propertyOwner, string name) { if (propertyOwner != null) { var propertyDependencyPropertyQuery = propertyOwner.GetAllProperties().Where(p => p.Name == name + "Property"); var fieldDependencyPropertyQuery = propertyOwner.GetAllFields().Where(p => p.Name == name + "Property"); return propertyDependencyPropertyQuery.Any() || fieldDependencyPropertyQuery.Any(); } else { return false; } } private Accessibility FindObjectFieldAccessibility(XamlObjectDefinition objectDefinition) { if ( FindMember(objectDefinition, "FieldModifier") is XamlMemberDefinition fieldModifierMember && Enum.TryParse<Accessibility>(fieldModifierMember.Value?.ToString(), true, out var modifierValue) ) { return modifierValue; } return Accessibility.Private; } private string FormatAccessibility(Accessibility accessibility) { switch (accessibility) { case Accessibility.Private: return "private"; case Accessibility.Internal: return "internal"; case Accessibility.Public: return "public"; default: throw new NotSupportedException($"Field modifier {accessibility} is not supported"); } } private INamedTypeSymbol GetPropertyType(XamlMember xamlMember) { var definition = FindPropertyType(xamlMember); if (definition == null) { throw new Exception($"The property {xamlMember.Type?.Name}.{xamlMember.Name} is unknown"); } return definition; } private INamedTypeSymbol GetPropertyType(string ownerType, string propertyName) { var definition = FindPropertyType(ownerType, propertyName); if (definition == null) { throw new Exception("The property {0}.{1} is unknown".InvariantCultureFormat(ownerType, propertyName)); } return definition; } private INamedTypeSymbol FindPropertyType(XamlMember xamlMember) => _findPropertyTypeByXamlMember(xamlMember); private INamedTypeSymbol SourceFindPropertyType(XamlMember xamlMember) { // Search for the type the clr namespaces registered with the xml namespace if (xamlMember.DeclaringType != null) { var clrNamespaces = _knownNamespaces.UnoGetValueOrDefault(xamlMember.DeclaringType.PreferredXamlNamespace, new string[0]); foreach (var clrNamespace in clrNamespaces) { string declaringTypeName = xamlMember.DeclaringType.Name; var propertyType = FindPropertyType(clrNamespace + "." + declaringTypeName, xamlMember.Name); if (propertyType != null) { return propertyType; } } } var type = FindType(xamlMember.DeclaringType); // If not, try to find the closest match using the name only. return FindPropertyType(type.SelectOrDefault(t => t.ToDisplayString(), "$$unknown"), xamlMember.Name); } private INamedTypeSymbol FindPropertyType(string ownerType, string propertyName) => _findPropertyTypeByName(ownerType, propertyName); private INamedTypeSymbol SourceFindPropertyType(string ownerType, string propertyName) { var type = FindType(ownerType); if (type != null) { do { ThrowOnErrorSymbol(type); var resolvedType = type; var property = resolvedType.GetAllProperties().FirstOrDefault(p => p.Name == propertyName); var setMethod = resolvedType.GetMethods().FirstOrDefault(p => p.Name == "Set" + propertyName); if (property != null) { if (property.Type.OriginalDefinition != null && property.Type.OriginalDefinition?.ToDisplayString() == "System.Nullable<T>") { //TODO return (property.Type as INamedTypeSymbol).TypeArguments.First() as INamedTypeSymbol; } else { var finalType = property.Type as INamedTypeSymbol; if (finalType == null) { return FindType(property.Type.ToDisplayString()); } return finalType; } } else { if (setMethod != null) { return setMethod.Parameters.ElementAt(1).Type as INamedTypeSymbol; } else { var baseType = type.BaseType; if (baseType == null) { baseType = FindType(type.BaseType.ToDisplayString()); } type = baseType; if (type == null || type.Name == "Object") { return null; } } } } while (true); } else { return null; } } private IEventSymbol FindEventType(XamlMember xamlMember) => _findEventType(xamlMember); private IEventSymbol SourceFindEventType(XamlMember xamlMember) { var ownerType = FindType(xamlMember.DeclaringType); if (ownerType != null) { ThrowOnErrorSymbol(ownerType); if (GetEventsForType(ownerType).TryGetValue(xamlMember.Name, out var eventSymbol)) { return eventSymbol; } } return null; } private Dictionary<string, IEventSymbol> GetEventsForType(INamedTypeSymbol symbol) => _getEventsForType(symbol); private Dictionary<string, IEventSymbol> SourceGetEventsForType(INamedTypeSymbol symbol) { var output = new Dictionary<string, IEventSymbol>(); foreach(var evt in symbol.GetAllEvents()) { if (!output.ContainsKey(evt.Name)) { output.Add(evt.Name, evt); } } return output; } private bool IsAttachedProperty(XamlMemberDefinition member) { if (member.Member.DeclaringType != null) { var type = FindType(member.Member.DeclaringType); if (type != null) { return _isAttachedProperty(type, member.Member.Name); } } return false; } private bool IsRelevantNamespace(string xamlNamespace) { if (XamlConstants.XmlXmlNamespace.Equals(xamlNamespace, StringComparison.OrdinalIgnoreCase)) { return false; } return true; } private bool IsRelevantProperty(XamlMember member) { if (member?.Name == "Phase") // Phase is not relevant as it's not an actual property { return false; } return true; } private static bool SourceIsAttachedProperty(INamedTypeSymbol type, string name) { do { var property = type.GetAllProperties().FirstOrDefault(p => p.Name == name); var setMethod = type.GetMethods().FirstOrDefault(p => p.Name == "Set" + name); if (property != null && property.GetMethod.IsStatic) { return true; } if (setMethod != null && setMethod.IsStatic) { return true; } type = type.BaseType; if (type == null || type.Name == "Object") { return false; } } while (true); } /// <summary> /// Determines if the provided member is an C# initializable list (where the collection already exists, and no set property is present) /// </summary> /// <param name="xamlMember"></param> /// <returns></returns> private bool IsInitializableCollection(XamlMember xamlMember) { var declaringType = xamlMember.DeclaringType; var propertyName = xamlMember.Name; return IsInitializableCollection(declaringType, propertyName); } /// <summary> /// Determines if the provided member is an C# initializable list (where the collection already exists, and no set property is present) /// </summary> private bool IsInitializableCollection(XamlType declaringType, string propertyName) { var property = GetPropertyByName(declaringType, propertyName); if (property != null && IsInitializableProperty(property)) { return IsCollectionOrListType(property.Type as INamedTypeSymbol); } return false; } /// <summary> /// Returns true if the property does not have a accessible setter /// </summary> private bool IsInitializableProperty(IPropertySymbol property) { return !property.SetMethod.SelectOrDefault(m => m.DeclaredAccessibility == Accessibility.Public, false); } /// <summary> /// Returns true if the property has an accessible public setter and has a parameterless constructor /// </summary> private bool IsNewableProperty(IPropertySymbol property, out string newableTypeName) { var namedType = property.Type as INamedTypeSymbol; var isNewable = property.SetMethod.SelectOrDefault(m => m.DeclaredAccessibility == Accessibility.Public, false) && namedType.SelectOrDefault(nts => nts.Constructors.Any(ms => ms.Parameters.Length == 0), false); newableTypeName = isNewable ? GetFullGenericTypeName(namedType) : null; return isNewable; } /// <summary> /// Returns true if the type implements either ICollection, IList or one of their generics /// </summary> private bool IsCollectionOrListType(INamedTypeSymbol propertyType) => IsImplementingInterface(propertyType, _iCollectionSymbol) || IsImplementingInterface(propertyType, _iCollectionOfTSymbol) || IsImplementingInterface(propertyType, _iListSymbol) || IsImplementingInterface(propertyType, _iListOfTSymbol); /// <summary> /// Returns true if the type implements <see cref="IDictionary{TKey, TValue}"/> /// </summary> private bool IsDictionary(INamedTypeSymbol propertyType) => IsImplementingInterface(propertyType, _iDictionaryOfTKeySymbol); /// <summary> /// Returns true if the type exactly implements either ICollection, IList or one of their generics /// </summary> private bool IsExactlyCollectionOrListType(INamedTypeSymbol type) { return type == _iCollectionSymbol || type.OriginalDefinition == _iCollectionOfTSymbol || type == _iListSymbol || type.OriginalDefinition == _iListOfTSymbol; } /// <summary> /// Determines if the provided object definition is of a C# initializable list /// </summary> private bool IsInitializableCollection(XamlObjectDefinition definition) { if (definition.Members.Any(m => m.Member.Name != "_UnknownContent")) { return false; } var type = FindType(definition.Type); if (type == null) { return false; } return IsImplementingInterface(type, _iCollectionSymbol) || IsImplementingInterface(type, _iCollectionOfTSymbol); } /// <summary> /// Gets the /// </summary> private IPropertySymbol GetPropertyByName(XamlType declaringType, string propertyName) { var type = FindType(declaringType); return type?.GetAllProperties().FirstOrDefault(p => p.Name == propertyName); } private static bool IsDouble(string typeName) { // handles cases where name is "Java.Lang.Double" // TODO: Fix type resolution return typeName.Equals("double", StringComparison.InvariantCultureIgnoreCase) || typeName.EndsWith(".double", StringComparison.InvariantCultureIgnoreCase); } private bool IsString(XamlObjectDefinition xamlObjectDefinition) { return xamlObjectDefinition.Type.Name == "String"; } private bool IsPrimitive(XamlObjectDefinition xamlObjectDefinition) { switch (xamlObjectDefinition.Type.Name) { case "Byte": case "Int16": case "Int32": case "Int64": case "UInt16": case "UInt32": case "UInt64": case "Single": case "Double": case "Boolean": return true; } return false; } private bool HasInitializer(XamlObjectDefinition objectDefinition) { return objectDefinition.Members.Any(m => m.Member.Name == "_Initialization"); } private static void ThrowOnErrorSymbol(ISymbol symbol) { if (symbol is IErrorTypeSymbol errorTypeSymbol) { var candidates = string.Join(";", errorTypeSymbol.CandidateSymbols); var location = symbol.Locations.FirstOrDefault()?.ToString() ?? "Unknown"; throw new InvalidOperationException( $"Unable to resolve {symbol} (Reason: {errorTypeSymbol.CandidateReason}, Location:{location}, Candidates: {candidates})" ); } } private INamedTypeSymbol FindType(string name) => _findType(name); private INamedTypeSymbol FindType(XamlType type) => type != null ? _findTypeByXamlType(type) : null; private INamedTypeSymbol SourceFindTypeByXamlType(XamlType type) { if (type != null) { var ns = _fileDefinition.Namespaces.FirstOrDefault(n => n.Namespace == type.PreferredXamlNamespace); var isKnownNamespace = ns?.Prefix?.HasValue() ?? false; if ( type.PreferredXamlNamespace == XamlConstants.XamlXmlNamespace && type.Name == "Bind" ) { return _findType(XamlConstants.Namespaces.Data + ".Binding"); } var fullName = isKnownNamespace ? ns.Prefix + ":" + type.Name : type.Name; return _findType(fullName); } else { return null; } } private INamedTypeSymbol GetType(string name) { var type = _findType(name); if (type == null) { throw new InvalidOperationException("The type {0} could not be found".InvariantCultureFormat(name)); } return type; } private INamedTypeSymbol GetType(XamlType type) { var clrType = FindType(type); if (clrType == null) { throw new InvalidOperationException("The type {0} could not be found".InvariantCultureFormat(type)); } return clrType; } private INamedTypeSymbol SourceFindType(string name) { var originalName = name; if (name.StartsWith(GlobalPrefix)) { name = name.TrimStart(GlobalPrefix); } else if (name.Contains(":")) { var fields = name.Split(':'); var ns = _fileDefinition.Namespaces.FirstOrDefault(n => n.Prefix == fields[0]); if (ns != null) { var nsName = ns.Namespace.TrimStart("using:"); if (nsName.StartsWith("clr-namespace:")) { nsName = nsName.Split(';')[0].TrimStart("clr-namespace:"); } name = nsName + "." + fields[1]; } } else { // Search first using the default namespace foreach (var clrNamespace in _clrNamespaces) { var type = _medataHelper.FindTypeByFullName(clrNamespace + "." + name) as INamedTypeSymbol; if (type != null) { return type; } } } var resolvers = new Func<INamedTypeSymbol>[] { // The sanitized name () => _medataHelper.FindTypeByName(name) as INamedTypeSymbol, // As a full name () => _medataHelper.FindTypeByFullName(name) as INamedTypeSymbol, // As a partial name using the original type () => _medataHelper.FindTypeByName(originalName) as INamedTypeSymbol, // As a partial name using the non-qualified name () => _medataHelper.FindTypeByName(originalName.Split(':').ElementAtOrDefault(1)) as INamedTypeSymbol, }; return resolvers .Select(m => m()) .Trim() .FirstOrDefault(); } } }
26.38403
137
0.698131
[ "Apache-2.0" ]
dansiegel/Uno
src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.Reflection.cs
20,819
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the waf-regional-2016-11-28.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.WAFRegional.Model { /// <summary> /// Container for the parameters to the GetRegexPatternSet operation. /// Returns the <a>RegexPatternSet</a> specified by <code>RegexPatternSetId</code>. /// </summary> public partial class GetRegexPatternSetRequest : AmazonWAFRegionalRequest { private string _regexPatternSetId; /// <summary> /// Gets and sets the property RegexPatternSetId. /// <para> /// The <code>RegexPatternSetId</code> of the <a>RegexPatternSet</a> that you want to /// get. <code>RegexPatternSetId</code> is returned by <a>CreateRegexPatternSet</a> and /// by <a>ListRegexPatternSets</a>. /// </para> /// </summary> public string RegexPatternSetId { get { return this._regexPatternSetId; } set { this._regexPatternSetId = value; } } // Check to see if RegexPatternSetId property is set internal bool IsSetRegexPatternSetId() { return this._regexPatternSetId != null; } } }
33.440678
110
0.673594
[ "Apache-2.0" ]
Bio2hazard/aws-sdk-net
sdk/src/Services/WAFRegional/Generated/Model/GetRegexPatternSetRequest.cs
1,973
C#
using System; using System.Collections.Generic; using System.Text; namespace SvgToPng.Config { public class ConversionProfile { public ColorConversion[] ColorConversions { get; set; } public Output[] Output { get; set; } public string OutputDirectory { get; set; } public string[] Input { get; set; } public bool Overwrite { get; set; } } }
24.6875
63
0.643038
[ "MIT" ]
Inrego/SvgToPng
SvgToPng/Config/ConversionProfile.cs
397
C#
// Copyright © 2017, Meta Company. All rights reserved. // // Redistribution and use of this software (the "Software") in binary form, without modification, is // permitted provided that the following conditions are met: // // 1. Redistributions of the unmodified Software 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. // 2. The name of Meta Company (“Meta”) may not be used to endorse or promote products derived // from this Software without specific prior written permission from Meta. // 3. LIMITATION TO META PLATFORM: Use of the Software is limited to use on or in connection // with Meta-branded devices or Meta-branded software development kits. For example, a bona // fide recipient of the Software may incorporate an unmodified binary version of the // Software into an application limited to use on or in connection with a Meta-branded // device, while he or she may not incorporate an unmodified binary version of the Software // into an application designed or offered for use on a non-Meta-branded device. // // For the sake of clarity, the Software may not be redistributed under any circumstances in source // code form, or in the form of modified binary code – and nothing in this License shall be construed // to permit such redistribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 META COMPANY BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using UnityEngine; using System.IO; namespace Meta.Mouse { internal class PlaybackInputWrapper : IInputWrapper { private int _framesRead; private int _totalFrames; private float _mouseSensitivity; private Vector2 _mouseScrollDelta = new Vector2(); private float _mouseXAxis; private float _mouseYAxis; private bool _getMouseButton; private bool _getMouseButtonUp; private bool _getMouseButtonDown; private float _screenHeight; private float _screenWidth; private BinaryReader _reader; public int framesRead { get { return _framesRead; } } public int numFrames { get { return _totalFrames; } } public float MouseSensitivity { get { return _mouseSensitivity; } } public PlaybackInputWrapper(BinaryReader reader) { _reader = reader; _totalFrames = _reader.ReadInt32(); _mouseSensitivity = _reader.ReadSingle(); ReadFrame(); } public void ReadFrame() { _screenWidth = _reader.ReadSingle(); _screenHeight = _reader.ReadSingle(); Vector2 screenSizeRatio = new Vector2(Screen.width / _screenWidth, Screen.height / _screenHeight); _mouseXAxis = _reader.ReadSingle() * screenSizeRatio.x; _mouseYAxis = _reader.ReadSingle() * screenSizeRatio.y; _getMouseButton = _reader.ReadBoolean(); _getMouseButtonUp = _reader.ReadBoolean(); _getMouseButtonDown = _reader.ReadBoolean(); _framesRead++; } public CursorLockMode LockState { get; set; } public bool Visible { get; set; } public Vector3 GetMousePosition() { // TODO: this should almost CERTAINLY be // return _mousePosition; //#warning returning _mouseScrollDelta instead of _mousePosition return _mouseScrollDelta; } public Vector2 GetMouseScrollDelta() { return Input.mouseScrollDelta; } public float GetAxis(string axisName) { if (axisName == "Mouse X") { return _mouseXAxis; } else if (axisName == "Mouse Y") { return _mouseYAxis; } return 0f; } public bool GetMouseButton(int button) { return _getMouseButton; } public bool GetMouseButtonUp(int button) { return _getMouseButtonUp; } public bool GetMouseButtonDown(int button) { return _getMouseButtonDown; } public Rect GetScreenRect() { return new Rect(0, 0, _screenWidth, _screenHeight); } public void CloseFile() { _reader.Close(); } } }
37.347518
110
0.638245
[ "MIT" ]
jerryMeng100/Masquerade-Meta
MetaTesting/Assets/MetaSDK/Meta/Mouse/Scripts/PlaybackInputWrapper.cs
5,275
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("6. stringsAndObjects")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("6. stringsAndObjects")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d15de82a-be07-4764-b3ce-3cad574d906b")] // 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.054054
84
0.747869
[ "MIT" ]
boggroZZdev/SoftUniHomeWork
TechModule/ProgrammingFundamentals/4.Programming-Fundamentals-Data-types-and-Variables/6. stringsAndObjects/Properties/AssemblyInfo.cs
1,411
C#
/*using System; using System.Collections.Generic; using System.Net; using System.Net.Http; using PactNet.Mocks.MockHttpService; using PactNet.Mocks.MockHttpService.Models; using System.Threading.Tasks; using Xunit; namespace PactNet.Tests.IntegrationTests { public class PactBuilderFailureIntegrationTests : IClassFixture<FailureIntegrationTestsMyApiPact> { private readonly IMockProviderService _mockProviderService; private readonly Uri _mockProviderServiceBaseUri; public PactBuilderFailureIntegrationTests(FailureIntegrationTestsMyApiPact data) { _mockProviderService = data.MockProviderService; _mockProviderServiceBaseUri = data.MockProviderServiceBaseUri; _mockProviderService.ClearInteractions(); } [Fact] public void WhenRegisteringAnInteractionThatIsNeverSent_ThenPactFailureExceptionIsThrown() { _mockProviderService .UponReceiving("A POST request to create a new thing") .With(new ProviderServiceRequest { Method = HttpVerb.Post, Path = "/things", Headers = new Dictionary<string, object> { { "Content-Type", "application/json; charset=utf-8" } }, Body = new { thingId = 1234, type = "Awesome" } }) .WillRespondWith(new ProviderServiceResponse { Status = 201 }); Assert.Throws<PactFailureException>(() => _mockProviderService.VerifyInteractions()); } [Fact] public async Task WhenRegisteringAnInteractionThatIsSentMultipleTimes_ThenNoExceptionIsThrown() { _mockProviderService .UponReceiving("A GET request to retrieve a thing") .With(new ProviderServiceRequest { Method = HttpVerb.Get, Path = "/things/1234" }) .WillRespondWith(new ProviderServiceResponse { Status = 200 }); var httpClient = new HttpClient { BaseAddress = _mockProviderServiceBaseUri }; var request1 = new HttpRequestMessage(HttpMethod.Get, "/things/1234"); var request2 = new HttpRequestMessage(HttpMethod.Get, "/things/1234"); var response1 = await httpClient.SendAsync(request1); var response2 = await httpClient.SendAsync(request2); if (response1.StatusCode != HttpStatusCode.OK || response2.StatusCode != HttpStatusCode.OK) { throw new Exception(string.Format("Wrong status code '{0} and {1}' was returned", response1.StatusCode, response2.StatusCode)); } _mockProviderService.VerifyInteractions(); } [Fact] public async Task WhenRegisteringAnInteractionWhereTheRequestDoesNotExactlyMatchTheActualRequest_ThenStatusCodeReturnedIs500AndPactFailureExceptionIsThrown() { _mockProviderService .UponReceiving("A GET request to retrieve things by type") .With(new ProviderServiceRequest { Method = HttpVerb.Get, Path = "/things", Query = "type=awesome", Headers = new Dictionary<string, object> { { "Accept", "application/json; charset=utf-8" } }, }) .WillRespondWith(new ProviderServiceResponse { Status = 200 }); var httpClient = new HttpClient { BaseAddress = _mockProviderServiceBaseUri }; var request = new HttpRequestMessage(HttpMethod.Get, "/things?type=awesome"); var response = await httpClient.SendAsync(request); if (response.StatusCode != HttpStatusCode.InternalServerError) { throw new Exception(string.Format("Wrong status code '{0}' was returned", response.StatusCode)); } Assert.Throws<PactFailureException>(() => _mockProviderService.VerifyInteractions()); } } }*/
37.677966
165
0.573549
[ "MIT" ]
chad-tw/pact-net
tests/PactNet.Abstractions.Tests/IntegrationTests/PactBuilderFailureIntegrationTests.cs
4,446
C#
using System; using System.IO; using System.Threading.Tasks; namespace AtroFree.Services { public interface IEasyBluetoothService { /// <summary> /// Indica si el dispositivo soporta conexión por Bluetooth. /// </summary> bool IsSupported { get; } /// <summary> /// Indica si el bluetooth está habilitado en el dispositivo. /// </summary> bool IsEnabled { get; } /// <summary> /// Solicita al usuario que habilite el Bluetooth si lo ha desactivado. /// </summary> /// <returns>Devuelve verdadero si el usuario aceptó habilitar el Bluetooth.</returns> Task<bool> RequestEnable(); /// <summary> /// Conecta al dispositivo (previamente emparejado) con la dirección MAC indicada y devuelve una instancia para controlar la conexión del dispositivo. /// </summary> /// <param name="mac">La dirección MAC del dispositivo.</param> /// <returns>Instancia para controlar la conexión del dispositivo, devuelve nulo si no hay un dispositivo emparejado con la MAC indicada.</returns> /// <exception cref="IOException">Si la conexión falla con el dispositivo existente, se arrojará esta excepción.</exception> Task<IEasyBluetoothConnection> Connect(string mac); /// <summary> /// Devuelve la lista de dispositivos sincronizados activos en la red bluetooth. /// </summary> /// <returns></returns> EasyBluetoothDeviceInfo[] GetPairedDevices(); } public class EasyBluetoothDeviceInfo { public string Name { get; } public string MAC { get; } public string FirstUUID { get; } public EasyBluetoothDeviceInfo(string name, string mac, string uuid) { Name = name; MAC = mac; FirstUUID = uuid; } } public interface IEasyBluetoothConnection { EasyBluetoothDeviceInfo Device { get; } bool IsConnected { get; } event Action<string> NewMessage; event Action<IOException> Disconnected; void Disconnect(); /// <summary> /// Envía un mensaje a través del canal de la conexión bluetooth. /// </summary> /// <param name="message"></param> /// <exception cref="IOException">Devuelve esta excepción si se ha perdido la conexión bluetooth.</exception> Task<bool> Send(string message); } }
35.797101
158
0.624291
[ "MIT" ]
JafetMeza/AtroFree
Sciodesk.AtroFree/AtroFree/AtroFree/Services/IEasyBluetoothService.cs
2,487
C#
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. using System; using System.Collections.Generic; using System.Threading.Tasks; namespace ServiceStack.Authentication.IdentityServer.Clients { using IdentityModel.Client; using Interfaces; using Logging; internal class RefreshTokenClient : IRefreshTokenClient { private static readonly ILog Log = LogManager.GetLogger(typeof(RefreshTokenClient)); private readonly IIdentityServerAuthProviderSettings appSettings; public RefreshTokenClient(IIdentityServerAuthProviderSettings appSettings) { this.appSettings = appSettings; } public async Task<TokenRefreshResult> RefreshToken(string refreshToken) { var client = new TokenClient(appSettings.RequestTokenUrl, appSettings.ClientId, appSettings.ClientSecret); var result = await client.RequestAsync(new Dictionary<string, string> { {"grant_type", "refresh_token"}, {"refresh_token", refreshToken} }).ConfigureAwait(false); if (result.IsError) { Log.Error($"An error occurred while refreshing the access token - {result.Error}"); return new TokenRefreshResult(); } return new TokenRefreshResult { AccessToken = result.AccessToken, RefreshToken = result.RefreshToken, ExpiresAt = DateTime.UtcNow.AddSeconds(result.ExpiresIn) }; } } }
35.040816
118
0.647059
[ "MPL-2.0" ]
MacLeanElectrical/servicestack-authentication-identityserver
src/ServiceStack.Authentication.IdentityServer/Clients/RefreshTokenClient.cs
1,719
C#
#region Copyright & License // Copyright © 2012 - 2021 François Chabot // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #endregion using System.ServiceModel; using Be.Stateless.BizTalk.Dsl.Binding.ServiceModel.Configuration; using Be.Stateless.BizTalk.Dsl.Binding.Xml.Serialization.Extensions; using Be.Stateless.BizTalk.Explorer; using FluentAssertions; using Xunit; using static Be.Stateless.Unit.DelegateFactory; namespace Be.Stateless.BizTalk.Dsl.Binding.Adapter { public class WcfNetTcpAdapterInboundFixture { [SkippableFact] public void SerializeToXml() { Skip.IfNot(BizTalkServerGroup.IsConfigured); var nta = new WcfNetTcpAdapter.Inbound( a => { a.Address = new EndpointAddress("net.tcp://localhost/biztalk.factory/service.svc"); a.Identity = EndpointIdentityFactory.CreateSpnIdentity("service_spn"); a.SecurityMode = SecurityMode.Message; a.MessageClientCredentialType = MessageCredentialType.Windows; }); var xml = nta.GetAdapterBindingInfoSerializer().Serialize(); xml.Should().Be( "<CustomProps>" + "<MaxReceivedMessageSize vt=\"3\">65535</MaxReceivedMessageSize>" + "<EnableTransaction vt=\"11\">0</EnableTransaction>" + "<TransactionProtocol vt=\"8\">OleTransactions</TransactionProtocol>" + "<SecurityMode vt=\"8\">Message</SecurityMode>" + "<MessageClientCredentialType vt=\"8\">Windows</MessageClientCredentialType>" + "<AlgorithmSuite vt=\"8\">Basic256</AlgorithmSuite>" + "<TransportClientCredentialType vt=\"8\">Windows</TransportClientCredentialType>" + "<TransportProtectionLevel vt=\"8\">EncryptAndSign</TransportProtectionLevel>" + "<UseSSO vt=\"11\">0</UseSSO>" + "<MaxConcurrentCalls vt=\"3\">200</MaxConcurrentCalls>" + "<LeaseTimeout vt=\"8\">00:05:00</LeaseTimeout>" + "<InboundBodyLocation vt=\"8\">UseBodyElement</InboundBodyLocation>" + "<InboundNodeEncoding vt=\"8\">Xml</InboundNodeEncoding>" + "<OutboundBodyLocation vt=\"8\">UseBodyElement</OutboundBodyLocation>" + "<OutboundXmlTemplate vt=\"8\">&lt;bts-msg-body xmlns=\"http://www.microsoft.com/schemas/bts2007\" encoding=\"xml\"/&gt;</OutboundXmlTemplate>" + "<SuspendMessageOnFailure vt=\"11\">-1</SuspendMessageOnFailure>" + "<IncludeExceptionDetailInFaults vt=\"11\">-1</IncludeExceptionDetailInFaults>" + "<OpenTimeout vt=\"8\">00:01:00</OpenTimeout>" + "<SendTimeout vt=\"8\">00:01:00</SendTimeout>" + "<CloseTimeout vt=\"8\">00:01:00</CloseTimeout>" + "<Identity vt=\"8\">&lt;identity&gt;\r\n &lt;servicePrincipalName value=\"service_spn\" /&gt;\r\n&lt;/identity&gt;</Identity>" + "</CustomProps>"); } [Fact(Skip = "TODO")] public void Validate() { // TODO Validate() } [SkippableFact] public void ValidateDoesNotThrow() { Skip.IfNot(BizTalkServerGroup.IsConfigured); var nta = new WcfNetTcpAdapter.Inbound( a => { a.Address = new EndpointAddress("net.tcp://localhost/biztalk.factory/service.svc"); a.Identity = EndpointIdentityFactory.CreateSpnIdentity("service_spn"); a.SecurityMode = SecurityMode.Message; a.MessageClientCredentialType = MessageCredentialType.Windows; }); Action(() => ((ISupportValidation) nta).Validate()).Should().NotThrow(); } } }
40.516129
149
0.715499
[ "Apache-2.0" ]
emmanuelbenitez/Be.Stateless.BizTalk.Dsl.Binding
src/Be.Stateless.BizTalk.Dsl.Binding.Tests/Dsl/Binding/Adapter/WcfNetTcpAdapter.InboundFixture.cs
3,772
C#
using System; using UILayouTaro; using UnityEngine; using UnityEngine.UI; public class AsyncButtonElement : LTAsyncElement, ILayoutableRect { public override LTElementType GetLTElementType() { return LTElementType.AsyncButton; } public Image Image; public Action OnTapped; public static AsyncButtonElement GO(Image image, Action onTapped) { // prefab名を固定してGOを作ってしまおう var prefabName = "LayouTaroPrefabs/AsyncButton"; var res = Resources.Load(prefabName) as GameObject; var r = Instantiate(res).AddComponent<AsyncButtonElement>(); r.Image = image; r.OnTapped = onTapped; // このへんでレシーバセットする var button = r.GetComponent<Button>(); button.onClick.AddListener(() => r.OnTapped()); return r; } public Vector2 RectSize() { // ここで、最低でもこのサイズ、とか、ロード失敗したらこのサイズ、とかができる。 var imageRect = this.GetComponent<RectTransform>().sizeDelta; return imageRect; } }
25.075
69
0.662014
[ "MIT" ]
sassembla/LayouTaro
Assets/LayouTaro/LayouTaroElements/AsyncButtonElement.cs
1,135
C#
using System; using MikhailKhalizev.Processor.x86.BinToCSharp; namespace MikhailKhalizev.Max.Program { public partial class RawProgram { [MethodInfo("0x85d4-613b4c55")] public void Method_0000_85d4() { ii(0x85d4, 4); mov(memw[ds, 0xd66], gs); /* mov [0xd66], gs */ ii(0x85d8, 4); mov(memw[ds, 0xd64], fs); /* mov [0xd64], fs */ ii(0x85dc, 4); mov(fs, memw[ds, 0xd60]); /* mov fs, [0xd60] */ ii(0x85e0, 4); mov(gs, memw[ds, 0xd62]); /* mov gs, [0xd62] */ ii(0x85e4, 2); xor(ax, ax); /* xor ax, ax */ ii(0x85e6, 4); cmp(memb[ds, 0x35], al); /* cmp [0x35], al */ ii(0x85ea, 2); if(jnz(0x85ef, 3)) goto l_0x85ef; /* jnz 0x85ef */ ii(0x85ec, 3); call(0x6999, -0x1c56); /* call 0x6999 */ l_0x85ef: ii(0x85ef, 5); cmp(memb[ds, 0x11f0], 0); /* cmp byte [0x11f0], 0x0 */ ii(0x85f4, 2); if(jnz(0x85fb, 5)) goto l_0x85fb; /* jnz 0x85fb */ ii(0x85f6, 2); mov(cl, 9); /* mov cl, 0x9 */ ii(0x85f8, 3); if(jmp_func(0x6672, -0x1f89)) return; /* jmp 0x6672 */ l_0x85fb: ii(0x85fb, 1); ret(); /* ret */ } } }
51.448276
100
0.41689
[ "Apache-2.0" ]
mikhail-khalizev/max
source/MikhailKhalizev.Max/source/Program/Auto/z-0000-85d4.cs
1,492
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace quieropizza.web { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); } } }
21.526316
60
0.689487
[ "MIT" ]
karolyn1998/quieropizza
quieropizza/quieropizza.web/Global.asax.cs
411
C#
using System; using System.Collections; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using AutoMapper; using PhotoMSK.Data; using PhotoMSK.Data.Enums; using PhotoMSK.Data.Models; using PhotoMSK.Data.Models.Attachments; using PhotoMSK.ViewModels.Attachments; using PhotoMSK.ViewModels.Interfaces; using PhotoMSK.ViewModels.Route; using PhotoMSK.ViewModels.Social; namespace PhotoMSK.ViewModels.Realisation { class WallService : AbstractService, IDisposable, IWallService, IWall { private readonly Guid _routeID; private readonly IUrlBuilder _urlBuilder; public WallService(IUrlBuilder urlBuilder) { _urlBuilder = urlBuilder; } public WallService(Guid routeID, IUrlBuilder urlBuilder) { _routeID = routeID; _urlBuilder = urlBuilder; } public IEnumerable<WallPostViewModel.Details> GetWallForRoute(Guid routeID) { var posts = Context.Viewses.Where(x => x.EntityID == routeID).OrderBy(x => x.Date).Take(10).Select(x => x.WallPost).Include(x => x.Referers).ToList(); var listpost = Mapper.Map<IList<WallPostViewModel.Details>>(posts).ToList(); LoadReferers(posts, listpost); LoadAttachments(listpost); listpost.ForEach(x => x.AuthorShortcut = _urlBuilder.GetShortcutUrl(x.AuthorShortcut)); return listpost; } public IEnumerable<MainWallViewModel> GetMainWall(Guid? userID = null) { DateTime sdate = DateTime.Now.AddDays(-3); IList<IEnumerable<WallPost>> news = Context.Newses .Include(x => x.Referers) .Where(x => x.Date > sdate) .GroupBy(x => x.Date.Day) .Select(x => x .OrderByDescending(y => y.LikeStatus.Likes) .ThenBy(z => Guid.NewGuid()) .Take(3)) .ToList(); var board = Mapper.Map<IList<IList<WallPostViewModel.Details>>>(news); IList<WallPost> posts = news.SelectMany(@new => @new).ToList(); var listpost = board.SelectMany(x => x).ToList(); LoadReferers(posts, listpost); LoadAttachments(listpost); listpost.ForEach(x => x.AuthorShortcut = _urlBuilder.GetShortcutUrl(x.AuthorShortcut)); var ids = news.SelectMany(x => x.Select(y => y.ID)).ToList(); Context.WallPostAddView(ids); return board.Select(item => new MainWallViewModel { Items = item }); } public WallPostViewModel.Details GetDetails(Guid id) { var posts = Context.Newses.Where(x => x.ID == id).ToList(); var listpost = Mapper.Map<IList<WallPostViewModel.Details>>(posts).ToList(); LoadReferers(posts, listpost); LoadAttachments(listpost); listpost.ForEach(x => x.AuthorShortcut = _urlBuilder.GetShortcutUrl(x.AuthorShortcut)); return listpost.First(); } private void LoadReferers(IList<WallPost> model, IList<WallPostViewModel.Details> detailses) { var elems = model.Select(x => x.ID).ToList(); var views = Context.Viewses.Where(x => elems.Contains(x.WallPost.ID)).Include(x => x.Entity).ToList(); foreach (var viewse in views) { var ppost = detailses.Single(x => x.ID == viewse.WallPost.ID); if (viewse.ParticipationType == ParticipationType.Owner) { ppost.AuthorShortcut = viewse.Entity.Shortcut; ppost.AuthorImage = viewse.Entity.ImageUrl; ppost.AuthorUrl = _urlBuilder.GetShortcutUrl(viewse.Entity.Shortcut); ppost.Name = viewse.Entity.GetName(); } if (viewse.ParticipationType == ParticipationType.СoAuthor) { if (ppost.Participants == null) ppost.Participants = new List<RoutePreviewViewModel>(); ppost.Participants.Add(Mapper.Map<RoutePreviewViewModel>(viewse.Entity)); } } } private void LoadAttachments(IList<WallPostViewModel.Details> model) { var idlist = model.Select(x => x.ID).ToList(); foreach (var detailse in model) { detailse.Attacments = new List<AttachmentViewModel.Summary>(); } var attachments = Context.Attachments.Where(x => idlist.Contains(x.WallPostID.Value)).ToList(); foreach (var attachment in attachments) { var ppost = model.Single(x => x.ID == attachment.WallPostID); if (attachment is Photo) ppost.Attacments.Add(Mapper.Map<PhotoViewModel.Summary>(attachment)); if (attachment is Video) ppost.Attacments.Add(Mapper.Map<VideoViewModel.Summary>(attachment)); } } public IEnumerator<WallPostViewModel.Details> GetEnumerator() { var list = GetWallForRoute(_routeID); return list.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
34.877419
162
0.585646
[ "MIT" ]
MarkusMokler/photomsmsk-by
PhotoMSK/Core/PhotoMSK.ViewModels/Realisation/WallService.cs
5,409
C#
using System.Diagnostics; namespace ThirdPartyLibraries.Repository.Template { [DebuggerDisplay("{Name}")] public sealed class RootReadMePackageContext { public string Source { get; set; } public string Name { get; set; } public string Version { get; set; } public string License { get; set; } public string LicenseLocalHRef { get; set; } public string LicenseMarkdownExpression { get; set; } public bool IsApproved { get; set; } public string LocalHRef { get; set; } public string SourceHRef { get; set; } public string UsedBy { get; set; } } }
23.25
61
0.623656
[ "MIT" ]
max-ieremenko/ThirdPartyLibraries
Sources/ThirdPartyLibraries.Repository/Template/RootReadMePackageContext.cs
653
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace FirstViewerWebApp { /// <summary> /// Model class required to deserialize the JSON response /// </summary> public class Models { public class AccessToken { public string token_type { get; set; } public int expires_in { get; set; } public string access_token { get; set; } } public class UploadBucket { public string bucket_key { get; set; } public List<UploadItem> objects { get; set; } } public class UploadItem { public string id { get; set; } public string key { get; set; } public string sha_1 { get; set; } public string size { get; set; } public string contentType { get; set; } public string location { get; set; } } } }
24.305556
60
0.597714
[ "MIT" ]
GetSomeRest/view.and.data-simplest-aspnet
FirstViewerWebApp/FirstViewerWebApp/Models.cs
877
C#
using System; using System.Reactive.Disposables; using System.Reactive.Linq; using Avalonia; using Avalonia.VisualTree; using Avalonia.Controls; using ReactiveUI; namespace Avalonia.ReactiveUI { /// <summary> /// A ReactiveUI <see cref="UserControl"/> that implements the <see cref="IViewFor{TViewModel}"/> interface and /// will activate your ViewModel automatically if the view model implements <see cref="IActivatableViewModel"/>. /// When the DataContext property changes, this class will update the ViewModel property with the new DataContext /// value, and vice versa. /// </summary> /// <typeparam name="TViewModel">ViewModel type.</typeparam> public class ReactiveUserControl<TViewModel> : UserControl, IViewFor<TViewModel> where TViewModel : class { public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty .Register<ReactiveUserControl<TViewModel>, TViewModel?>(nameof(ViewModel)); /// <summary> /// Initializes a new instance of the <see cref="ReactiveUserControl{TViewModel}"/> class. /// </summary> public ReactiveUserControl() { // This WhenActivated block calls ViewModel's WhenActivated // block if the ViewModel implements IActivatableViewModel. this.WhenActivated(disposables => { }); this.GetObservable(ViewModelProperty).Subscribe(OnViewModelChanged); } /// <summary> /// The ViewModel. /// </summary> public TViewModel? ViewModel { get => GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TViewModel?)value; } protected override void OnDataContextChanged(EventArgs e) { ViewModel = DataContext as TViewModel; } private void OnViewModelChanged(object? value) { if (value == null) { ClearValue(DataContextProperty); } else if (DataContext != value) { DataContext = value; } } } }
33.835821
117
0.619762
[ "MIT" ]
0x90d/Avalonia
src/Avalonia.ReactiveUI/ReactiveUserControl.cs
2,267
C#
using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace aws { [JsiiClass(nativeType: typeof(aws.DataAwsWafregionalRateBasedRule), fullyQualifiedName: "aws.DataAwsWafregionalRateBasedRule", parametersJson: "[{\"name\":\"scope\",\"type\":{\"fqn\":\"constructs.Construct\"}},{\"name\":\"id\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"config\",\"type\":{\"fqn\":\"aws.DataAwsWafregionalRateBasedRuleConfig\"}}]")] public class DataAwsWafregionalRateBasedRule : HashiCorp.Cdktf.TerraformDataSource { public DataAwsWafregionalRateBasedRule(Constructs.Construct scope, string id, aws.IDataAwsWafregionalRateBasedRuleConfig config): base(new DeputyProps(new object?[]{scope, id, config})) { } /// <summary>Used by jsii to construct an instance of this class from a Javascript-owned object reference</summary> /// <param name="reference">The Javascript-owned object reference</param> [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] protected DataAwsWafregionalRateBasedRule(ByRefValue reference): base(reference) { } /// <summary>Used by jsii to construct an instance of this class from DeputyProps</summary> /// <param name="props">The deputy props</param> [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] protected DataAwsWafregionalRateBasedRule(DeputyProps props): base(props) { } [JsiiMethod(name: "synthesizeAttributes", returnsJson: "{\"type\":{\"collection\":{\"elementtype\":{\"primitive\":\"any\"},\"kind\":\"map\"}}}", isOverride: true)] protected override System.Collections.Generic.IDictionary<string, object> SynthesizeAttributes() { return InvokeInstanceMethod<System.Collections.Generic.IDictionary<string, object>>(new System.Type[]{}, new object[]{})!; } [JsiiProperty(name: "id", typeJson: "{\"primitive\":\"string\"}")] public virtual string Id { get => GetInstanceProperty<string>()!; } [JsiiProperty(name: "nameInput", typeJson: "{\"primitive\":\"string\"}")] public virtual string NameInput { get => GetInstanceProperty<string>()!; } [JsiiProperty(name: "name", typeJson: "{\"primitive\":\"string\"}")] public virtual string Name { get => GetInstanceProperty<string>()!; set => SetInstanceProperty(value); } } }
47.796296
358
0.65711
[ "MIT" ]
scottenriquez/cdktf-alpha-csharp-testing
resources/.gen/aws/aws/DataAwsWafregionalRateBasedRule.cs
2,581
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 JSSoft.Fonts.ConsoleHost.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JSSoft.Fonts.ConsoleHost.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)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
43.84375
190
0.614754
[ "MIT" ]
s2quake/JSSoft.Font
JSSoft.Fonts.ConsoleHost/Properties/Resources.Designer.cs
2,808
C#
using System.Numerics; namespace GameSpec.Cry.Formats.Core.Chunks { /// <summary> /// Geometry info contains all the vertex, color, normal, UV, tangent, index, etc. Basically if you have a Node chunk with a Mesh and Submesh, this will contain the summary of all /// the datastream chunks that contain geometry info. /// </summary> public class GeometryInfo { /// <summary> /// The MeshSubset chunk that contains this geometry. /// </summary> public ChunkMeshSubsets GeometrySubset { get; set; } public Vector3[] Vertices { get; set; } // For dataStreamType of 0, length is NumElements. public Vector3[] Normals { get; set; } // For dataStreamType of 1, length is NumElements. public Vector2[] UVs { get; set; } // for datastreamType of 2, length is NumElements. public IRGBA[] Colors { get; set; } // for dataStreamType of 4, length is NumElements. Bytes per element of 4 public uint[] Indices { get; set; } // for dataStreamType of 5, length is NumElements. // For Tangents on down, this may be a 2 element array. See line 846+ in cgf.xml public Tangent[,] Tangents { get; set; } // for dataStreamType of 6, length is NumElements, 2. public byte[,] ShCoeffs { get; set; } // for dataStreamType of 7, length is NumElement,BytesPerElements. public byte[,] ShapeDeformation { get; set; } // for dataStreamType of 8, length is NumElements,BytesPerElement. public byte[,] BoneMap { get; set; } // for dataStreamType of 9, length is NumElements,BytesPerElement, 2. public byte[,] FaceMap { get; set; } // for dataStreamType of 10, length is NumElements,BytesPerElement. public byte[,] VertMats { get; set; } // for dataStreamType of 11, length is NumElements,BytesPerElement. } }
68.892857
185
0.636599
[ "MIT" ]
bclnet/GameSpec
Cry/GameSpec.Cry/Formats/Core/Chunks/GeometryInfo.cs
1,931
C#
using Cosmos.Domain.ChangeTracking; using Cosmos.Domain.EntityDescriptors; namespace Cosmos.Domain.Core { /// <summary> /// Interface for entity /// </summary> public interface IEntity : IDomainObject { /// <summary> /// Init /// </summary> void Init(); } /// <summary> /// Interface for entity /// </summary> /// <typeparam name="TKey"></typeparam> public interface IEntity<out TKey> : IKey<TKey>, IEntity { } /// <summary> /// Interface for entity /// </summary> /// <typeparam name="TEntity"></typeparam> /// <typeparam name="TKey"></typeparam> public interface IEntity<in TEntity, out TKey> : IChangeTrackable<TEntity>, IEntity<TKey> where TEntity : IEntity { } }
25.833333
93
0.597419
[ "MIT" ]
alexinea/Cosmos.Standard
src/Cosmos.Extensions.Domain/Cosmos/Domain/Core/IEntity.cs
777
C#
using System.Text.RegularExpressions; using NUnit.Framework; using SharpTestsEx; using Toggle.Net.Configuration; using Toggle.Net.Providers.TextFile; using Toggle.Net.Specifications; using Toggle.Net.Tests.Stubs; namespace Toggle.Net.Tests.TextFile { public class RegExTest { [Test] public void ShouldHandleMatch() { const string wordToMatch = "the toggle"; var content = new[] { "sometoggle=myRegex", "sometoggle.myRegex.pattern=" + wordToMatch }; var mappings = new DefaultSpecificationMappings(); mappings.AddMapping("myRegex", new RegExSpecification(new Regex("^" + wordToMatch + "$"))); var toggleChecker = new ToggleConfiguration(new FileParser(new FileReaderStub(content), mappings)) .Create(); toggleChecker.IsEnabled("sometoggle") .Should().Be.True(); } [Test] public void ShouldHandleMiss() { const string wordToMatch = "the toggle"; var content = new[] { "sometoggle=myRegex", "sometoggle.myRegex.pattern=" + wordToMatch }; var mappings = new DefaultSpecificationMappings(); mappings.AddMapping("myRegex", new RegExSpecification(new Regex("^somethingelse$"))); var toggleChecker = new ToggleConfiguration(new FileParser(new FileReaderStub(content), mappings)) .Create(); toggleChecker.IsEnabled("sometoggle") .Should().Be.False(); } [Test] public void ShouldThrowIfRegExIsMissing() { const string wordToMatch = "the toggle"; var content = new[] { "sometoggle=myRegex" }; var mappings = new DefaultSpecificationMappings(); mappings.AddMapping("myRegex", new RegExSpecification(new Regex("^" + wordToMatch + "$"))); Assert.Throws<IncorrectTextFileException>(() => new ToggleConfiguration(new FileParser(new FileReaderStub(content), mappings)) .Create()).ToString() .Should().Contain(string.Format(RegExSpecification.MustDeclareRegexPattern, "sometoggle")); } } }
27.140845
101
0.71095
[ "MIT" ]
JTOne123/Toggle.Net
code/Toggle.Net.Tests/TextFile/RegExTest.cs
1,929
C#
/* Copyright (C) 2014 Alexandros Andre Chaaraoui 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.Linq; using System.Text; using System.Collections; namespace Util { /// <summary> /// Interface which simplifies the distance function between DTW elements. /// This way unnecessary traspassing of parameters can be avoided (as TrainConfig) /// </summary> /// <typeparam name="U"></typeparam> public interface DTWComparison<U> { double Distance(U x, U y); double Correlation(U x, U y); } /// <summary> /// Simple template-based Dynamic-Time-Warping implementation. /// </summary> /// <typeparam name="T"></typeparam> public class SimpleDTW<T> { List<T> x; List<T> y; double[,] distance; double[,] f; ArrayList pathX; ArrayList pathY; ArrayList distanceList; double sum; public SimpleDTW(List<T> _x, List<T> _y) { x = _x; y = _y; distance = new double[x.Count, y.Count]; f = new double[x.Count + 1, y.Count + 1]; pathX = new ArrayList(); pathY = new ArrayList(); distanceList = new ArrayList(); } public ArrayList GetPathX() { return pathX; } public ArrayList GetPathY() { return pathY; } public double GetSum() { return sum; } public double[,] GetFMatrix() { return f; } public ArrayList GetDistanceList() { return distanceList; } public void ComputeDTW(DTWComparison<T> comparison) { for (int i = 0; i < x.Count; ++i) { for (int j = 0; j < y.Count; ++j) { distance[i, j] = comparison.Distance(x[i], y[j]); } } for (int i = 0; i <= x.Count; ++i) { for (int j = 0; j <= y.Count; ++j) { f[i, j] = -1.0; } } f[0, 0] = 0.0; sum = 0.0; // Hack, so that the function can always consider i-1, j-1 for (int i = 1; i <= x.Count; ++i) { f[i, 0] = double.PositiveInfinity; } for (int j = 1; j <= y.Count; ++j) { f[0, j] = double.PositiveInfinity; } sum = ComputeForward(); } private double ComputeForward() { for (int i = 1; i <= x.Count; ++i) { for (int j = 1; j <= y.Count; ++j) { if (f[i - 1, j] <= f[i - 1, j - 1] && f[i - 1, j] <= f[i, j - 1]) { f[i, j] = distance[i - 1, j - 1] + f[i - 1, j]; } else if (f[i, j - 1] <= f[i - 1, j - 1] && f[i, j - 1] <= f[i - 1, j]) { f[i, j] = distance[i - 1, j - 1] + f[i, j - 1]; } else if (f[i - 1, j - 1] <= f[i, j - 1] && f[i - 1, j - 1] <= f[i - 1, j]) { f[i, j] = distance[i - 1, j - 1] + f[i - 1, j - 1]; } } } return f[x.Count, y.Count]; } /// <summary> /// This version of DTW considers overlapping subsequences. The beginning of the reference sequence Y may be ignored, and the end of /// both sequences X and Y may be ignored in the alignment. /// The similarity of the best alignment is returned considering these differences. /// BASED ON: Michelet, S., Karp, K., Delaherche, E., Achard, C., & Chetouani, M. (2012). /// Automatic imitation assessment in interaction. In Human Behavior Understanding (pp. 161-173). /// Springer Berlin Heidelberg. /// </summary> /// <param name="comparison"></param> /// <param name="minDistance"></param> public void ComputeOverlapDTW(DTWComparison<T> comparison = null, double minDistance = double.MaxValue) { // Set first column to 0 => Which means that the beginning of the X sequence can be aligned at any point for (int i = 1; i <= x.Count; ++i) f[i, 0] = 0; // Set first row to 0 => Which means that the beginning of the Y sequence can be aligned at any point for (int i = 1; i <= y.Count; ++i) f[0, i] = 0; // Needleman Similarity DTW for (int i = 1; i <= x.Count; ++i) { for (int j = 1; j <= y.Count; ++j) { double first = 0, second = 0, third = 0; if (i >= 2) first = f[i - 1, j] - (1 - comparison.Correlation(x[i - 2], x[i - 1])); if (j >= 2) second = f[i, j - 1] - (1 - comparison.Correlation(y[j - 2], y[j - 1])); third = f[i - 1, j - 1] + comparison.Correlation(x[i - 1], y[j - 1]); f[i, j] = Math.Max(first, Math.Max(second, third)); } } // Look for the best alignment, without considering that the last frames need to be aligned // therefore both the last row and column need to be checked double best = double.MinValue; // Last row => The end of y could be ignored for (int i = 1; i < y.Count; ++i) if (f[x.Count, i] > best) best = f[x.Count, i]; // Last column => The end of x could be ignored for (int i = 1; i < x.Count; ++i) if (f[i, y.Count] > best) best = f[i, y.Count]; //best = f[x.Count, y.Count]; sum = best; } } }
32.551724
141
0.464588
[ "Apache-2.0" ]
Marechal-L/BagOfKeyPoses
BagOfKeyPoses_Library/Util/SimpleDTW.cs
6,610
C#
// Copyright (c) 2018, Rene Lergner - wpinternals.net - @Heathcliff74xda // // 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.IO; using System.Linq; using System.Security.Cryptography; using WPinternals; namespace Patcher { public static class MainPatcher { // TargetFilePath is relative to the root of the PatchDefinition // OutputFilePath can be null public static void AddPatch(string InputFilePath, string OutputFilePath, string PatchDefinitionName, string TargetVersionDescription, string TargetFilePath, string PathToVisualStudioWithWP8SDK, UInt32 VirtualAddress, CodeType CodeType, string ArmCodeFragment, string PatchDefintionsXmlPath) { SHA1Managed SHA = new SHA1Managed(); // Compile ARM code byte[] CompiledCode = null; if (VirtualAddress != 0) CompiledCode = ArmCompiler.Compile(PathToVisualStudioWithWP8SDK, VirtualAddress, CodeType, ArmCodeFragment); // Read original binary byte[] Binary = File.ReadAllBytes(InputFilePath); // Backup original checksum UInt32 ChecksumOffset = GetChecksumOffset(Binary); UInt32 OriginalChecksum = ByteOperations.ReadUInt32(Binary, ChecksumOffset); // Determine Raw Offset PeFile PeFile = new PeFile(Binary); UInt32 RawOffset = 0; if (VirtualAddress != 0) RawOffset = PeFile.ConvertVirtualAddressToRawOffset(VirtualAddress); // Add or replace patch string PatchDefintionsXml = File.ReadAllText(PatchDefintionsXmlPath); PatchEngine PatchEngine = new PatchEngine(PatchDefintionsXml); PatchDefinition PatchDefinition = PatchEngine.PatchDefinitions.Where(d => (string.Compare(d.Name, PatchDefinitionName, true) == 0)).FirstOrDefault(); if (PatchDefinition == null) { PatchDefinition = new PatchDefinition(); PatchDefinition.Name = PatchDefinitionName; PatchEngine.PatchDefinitions.Add(PatchDefinition); } TargetVersion TargetVersion = PatchDefinition.TargetVersions.Where(v => (string.Compare(v.Description, TargetVersionDescription, true) == 0)).FirstOrDefault(); if (TargetVersion == null) { TargetVersion = new TargetVersion(); TargetVersion.Description = TargetVersionDescription; PatchDefinition.TargetVersions.Add(TargetVersion); } TargetFile TargetFile = TargetVersion.TargetFiles.Where(f => ((f.Path != null) && (string.Compare(f.Path.TrimStart(new char[] { '\\' }), TargetFilePath.TrimStart(new char[] { '\\' }), true) == 0))).FirstOrDefault(); if (TargetFile == null) { TargetFile = new TargetFile(); TargetVersion.TargetFiles.Add(TargetFile); } TargetFile.Path = TargetFilePath; TargetFile.HashOriginal = SHA.ComputeHash(Binary); Patch Patch; if (VirtualAddress != 0) { Patch = TargetFile.Patches.Where(p => p.Address == RawOffset).FirstOrDefault(); if (Patch == null) { Patch = new Patch(); Patch.Address = RawOffset; TargetFile.Patches.Add(Patch); } Patch.OriginalBytes = new byte[CompiledCode.Length]; Buffer.BlockCopy(Binary, (int)RawOffset, Patch.OriginalBytes, 0, CompiledCode.Length); Patch.PatchedBytes = CompiledCode; } // Apply all patches foreach (Patch CurrentPatch in TargetFile.Patches) { Buffer.BlockCopy(CurrentPatch.PatchedBytes, 0, Binary, (int)CurrentPatch.Address, CurrentPatch.PatchedBytes.Length); } // Calculate checksum // This also modifies the binary // Original checksum is already backed up UInt32 Checksum = CalculateChecksum(Binary); // Add or replace checksum patch Patch = TargetFile.Patches.Where(p => p.Address == ChecksumOffset).FirstOrDefault(); if (Patch == null) { Patch = new Patch(); Patch.Address = ChecksumOffset; TargetFile.Patches.Add(Patch); } Patch.OriginalBytes = new byte[4]; ByteOperations.WriteUInt32(Patch.OriginalBytes, 0, OriginalChecksum); Patch.PatchedBytes = new byte[4]; ByteOperations.WriteUInt32(Patch.PatchedBytes, 0, Checksum); // Calculate hash for patched target file TargetFile.HashPatched = SHA.ComputeHash(Binary); // Write patched file if (OutputFilePath != null) File.WriteAllBytes(OutputFilePath, Binary); // Write PatchDefintions PatchEngine.WriteDefinitions(PatchDefintionsXmlPath); } private static UInt32 CalculateChecksum(byte[] PEFile) { UInt32 Checksum = 0; UInt32 Hi; // Clear file checksum ByteOperations.WriteUInt32(PEFile, GetChecksumOffset(PEFile), 0); for (UInt32 i = 0; i < ((UInt32)PEFile.Length & 0xfffffffe); i += 2) { Checksum += ByteOperations.ReadUInt16(PEFile, i); Hi = Checksum >> 16; if (Hi != 0) { Checksum = Hi + (Checksum & 0xFFFF); } } if ((PEFile.Length % 2) != 0) { Checksum += (UInt32)ByteOperations.ReadUInt8(PEFile, (UInt32)PEFile.Length - 1); Hi = Checksum >> 16; if (Hi != 0) { Checksum = Hi + (Checksum & 0xFFFF); } } Checksum += (UInt32)PEFile.Length; // Write file checksum ByteOperations.WriteUInt32(PEFile, GetChecksumOffset(PEFile), Checksum); return Checksum; } private static UInt32 GetChecksumOffset(byte[] PEFile) { return ByteOperations.ReadUInt32(PEFile, 0x3C) + +0x58; } } }
44.458824
299
0.59394
[ "MIT" ]
dung11112003/Patcher
Patcher/MainPatcher.cs
7,560
C#
namespace CTA.Rules.Models.Tokens { public class UsingDirectiveToken : NodeToken { public override bool Equals(object obj) { var token = (UsingDirectiveToken)obj; return token.Key == this.Key; } public override int GetHashCode() { return 23 * Key.GetHashCode(); } } }
22.8125
49
0.553425
[ "Apache-2.0" ]
QPC-database/cta
src/CTA.Rules.Models/Tokens/Usingdirectivetoken.cs
367
C#
extern alias legacy; using System; using System.Web.DynamicData; using System.Web.Hosting; using System.Web.Routing; using Gcpe.Hub.Properties; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Blob; namespace Gcpe.Hub { public class Global : System.Web.HttpApplication { private static MetaModel s_defaultModel = new MetaModel(); public static MetaModel DefaultModel { get { return s_defaultModel; } } #if DEBUG public static bool IsDebugBuild = true; #else public static bool IsDebugBuild = false; #endif protected void Application_Start(object sender, EventArgs e) { Environment.SetEnvironmentVariable("DbServer", Settings.Default.DbServer); // for the 3 db Contexts // IMPORTANT: DATA MODEL REGISTRATION // Uncomment this line to register a LINQ to SQL model for ASP.NET Dynamic Data. // Set ScaffoldAllTables = true only if you are sure that you want all tables in the // data model to support a scaffold (i.e. templates) view. To control scaffolding for // individual tables, create a partial class for the table and apply the // [ScaffoldTable(true)] attribute to the partial class. // Note: Make sure that you change "YourDataContextType" to the name of the data context // class in your application. DefaultModel.RegisterContext(typeof(CorporateCalendar.Data.CorporateCalendarDataContext), new ContextConfiguration() { ScaffoldAllTables = true }); //Additional information: The table 'Activities' does not have a column named 'CommunicationContact'. DefaultModel.DynamicDataFolderVirtualPath = "~/Calendar/Admin/DynamicData"; // The following statements support combined-page mode, where the List, Detail, Insert, and // Update tasks are performed by using the same page. To enable this mode, uncomment the // following routes and comment out the route definition in the separate-page mode section above. RouteTable.Routes.Add(new DynamicDataRoute("Calendar/Admin/{table}/ListDetails.aspx") { Action = PageAction.List, ViewName = "ListDetails", Model = DefaultModel }); RouteTable.Routes.Add(new DynamicDataRoute("Calendar/Admin/{table}/ListDetails.aspx") { Action = PageAction.Details, ViewName = "ListDetails", Model = DefaultModel }); News.RouteConfig.RegisterRoutes(RouteTable.Routes); // Must be after the DynamicDataRoutes HostingEnvironment.QueueBackgroundWorkItem(applicationShutdownToken => ReleasePublisher.NewsReleasePublishTask(applicationShutdownToken)); } public static Uri ReadContainerWithSharedAccessSignature(string containerName, DateTimeOffset expiryTime) { return ContainerWithSharedAccessSignature(containerName, SharedAccessBlobPermissions.Read, expiryTime); } public static Uri ListContainerWithSharedAccessSignature(string containerName, DateTimeOffset expiryTime) { return ContainerWithSharedAccessSignature(containerName, SharedAccessBlobPermissions.Read | SharedAccessBlobPermissions.List, expiryTime); } public static Uri ModifyContainerWithSharedAccessSignature(string containerName, DateTimeOffset? expiryTime = null) { return ContainerWithSharedAccessSignature(containerName, SharedAccessBlobPermissions.Read | SharedAccessBlobPermissions.List | SharedAccessBlobPermissions.Write | SharedAccessBlobPermissions.Delete); } public static Uri ContainerWithSharedAccessSignature(string containerName, SharedAccessBlobPermissions permissions, DateTimeOffset? expiryTime = null) { //TODO: This method should be moved out-of-process (for instance, to the Gcpe.Hub.Services project). var connectionString = string.Format("DefaultEndpointsProtocol={0};AccountName={1};AccountKey={2};EndpointSuffix={3}", Settings.Default.CloudEndpointsProtocol, Settings.Default.CloudAccountName, Settings.Default.CloudAccountKey, Settings.Default.CloudEndpointSuffix); var account = CloudStorageAccount.Parse(connectionString); var client = account.CreateCloudBlobClient(); var container = client.GetContainerReference(containerName); SharedAccessBlobPolicy sharedPolicy = new SharedAccessBlobPolicy() { SharedAccessExpiryTime = expiryTime ?? DateTimeOffset.UtcNow.AddHours(1), Permissions = permissions }; return new Uri(container.Uri + container.GetSharedAccessSignature(sharedPolicy)); } protected void Application_BeginRequest(object sender, EventArgs e) { } /// <summary> /// This is called just before the user credentials are authenticated. /// We can specify our own authentication logic here to provide custom authentication. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Application_AuthenticateRequest(object sender, EventArgs e) { Authentication.GlobalAuthenticateRequest(Request, Response); } /// <summary> /// This is called after successful completion of authentication with user’s credentials. /// This event is used to determine user permissions. /// You can use this method to give authorization rights to user. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Application_AuthorizeRequest(object sender, EventArgs e) { Authentication.GlobalAuthorizeRequest(Request, Response); } protected void Application_AcquireRequestState(object sender, EventArgs e) { //Authentication.GlobalAcquireRequestState(((HttpApplication)sender).Context, Request); } protected void Session_Start(object sender, EventArgs e) { } protected void Session_End(object sender, EventArgs e) { } protected void Application_End(object sender, EventArgs e) { } #if LOCAL_MEDIA_STORAGE public static void QueueBackgroundWorkItemWithRetry(Action action) { System.Threading.Tasks.Task.Run(async () => { while (true) { try { action(); break; } catch (System.Exception ex) { try { //LogError(ex.ToString()); } catch{} } await System.Threading.Tasks.Task.Delay(60 * 1000); } }); } #endif } }
41.261364
211
0.633572
[ "Apache-2.0" ]
AlessiaYChen/gcpe-hub
Hub.Legacy/Gcpe.Hub.Legacy.Website/Global.asax.cs
7,266
C#
// c:\program files (x86)\windows kits\10\include\10.0.22000.0\shared\ksmedia.h(1507,9) using System; using System.Runtime.InteropServices; namespace DirectN { [StructLayout(LayoutKind.Sequential)] public partial struct KSRTAUDIO_HWREGISTER { public IntPtr Register; public uint Width; public ulong Numerator; public ulong Denominator; public uint Accuracy; } }
25.647059
89
0.665138
[ "MIT" ]
Steph55/DirectN
DirectN/DirectN/Generated/KSRTAUDIO_HWREGISTER.cs
438
C#
using Json.Logic.Rules; using NUnit.Framework; namespace Json.Logic.Tests { public class MultiplyTests { [Test] public void MultiplyNumbersReturnsSum() { var rule = new MultiplyRule(4, 5); var actual = rule.Apply(); JsonAssert.AreEquivalent(20, actual); } [Test] public void MultiplyNonNumberThrowsError() { var rule = new MultiplyRule("test", 5); Assert.Throws<JsonLogicException>(() => rule.Apply()); } } }
17.84
57
0.683857
[ "MIT" ]
ConnectionMaster/json-everything
JsonLogic.Tests/MultiplyTests.cs
446
C#
/* * Overture API * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Yaksa.OrckestraCommerce.Client.Client.OpenAPIDateConverter; namespace Yaksa.OrckestraCommerce.Client.Model { /// <summary> /// MembershipConfiguration /// </summary> [DataContract(Name = "MembershipConfiguration")] public partial class MembershipConfiguration : IEquatable<MembershipConfiguration>, IValidatableObject { /// <summary> /// The strategy used to store the password MembershipPasswordStrategy /// </summary> /// <value>The strategy used to store the password MembershipPasswordStrategy</value> [JsonConverter(typeof(StringEnumConverter))] public enum PasswordStrategyEnum { /// <summary> /// Enum Clear for value: Clear /// </summary> [EnumMember(Value = "Clear")] Clear = 1, /// <summary> /// Enum Hashed for value: Hashed /// </summary> [EnumMember(Value = "Hashed")] Hashed = 2, /// <summary> /// Enum Encrypted for value: Encrypted /// </summary> [EnumMember(Value = "Encrypted")] Encrypted = 3 } /// <summary> /// The strategy used to store the password MembershipPasswordStrategy /// </summary> /// <value>The strategy used to store the password MembershipPasswordStrategy</value> [DataMember(Name = "passwordStrategy", EmitDefaultValue = false)] public PasswordStrategyEnum? PasswordStrategy { get; set; } /// <summary> /// Initializes a new instance of the <see cref="MembershipConfiguration" /> class. /// </summary> /// <param name="accountLockDownMinutes">The account lock down time (in minutes).</param> /// <param name="enablePasswordReset">Indicates whether the current membership provider is configured to allow customers to reset their passwords.</param> /// <param name="enablePasswordRetrieval">Indicates whether the current membership provider is configured to allow users to retrieve their passwords.</param> /// <param name="maxInvalidPasswordAttempts">The number of invalid password or password-answer attempts allowed before the membership user is locked out.</param> /// <param name="minRequiredNonAlphanumericCharacters">The minimum number of special characters that must be present in a valid password.</param> /// <param name="minRequiredPasswordLength">The minimum required length for a password.</param> /// <param name="passwordAttemptWindow">The time window (in minutes) between which consecutive failed attempts to provide a valid password or password answer are tracked.</param> /// <param name="passwordFailedAttemptDelaySeconds">The delay to apply on a failed login attempt.</param> /// <param name="passwordStrategy">The strategy used to store the password MembershipPasswordStrategy.</param> /// <param name="passwordStrengthRegularExpression">The regular expression used to validate the strength level of a password.</param> /// <param name="requiresQuestionAndAnswer">Indicates whether the default membership provider requires the user to answer a password question (and answer) for password reset and retrieval.</param> /// <param name="requiresUniqueEmail">Indicating whether the customer email addresses should be unique across the system.</param> /// <param name="tokenExpirationMinutes">The expiration time of reset password ticket (in minutes).</param> public MembershipConfiguration(int accountLockDownMinutes = default(int), bool enablePasswordReset = default(bool), bool enablePasswordRetrieval = default(bool), int maxInvalidPasswordAttempts = default(int), int minRequiredNonAlphanumericCharacters = default(int), int minRequiredPasswordLength = default(int), int passwordAttemptWindow = default(int), double passwordFailedAttemptDelaySeconds = default(double), PasswordStrategyEnum? passwordStrategy = default(PasswordStrategyEnum?), string passwordStrengthRegularExpression = default(string), bool requiresQuestionAndAnswer = default(bool), bool requiresUniqueEmail = default(bool), int tokenExpirationMinutes = default(int)) { this.AccountLockDownMinutes = accountLockDownMinutes; this.EnablePasswordReset = enablePasswordReset; this.EnablePasswordRetrieval = enablePasswordRetrieval; this.MaxInvalidPasswordAttempts = maxInvalidPasswordAttempts; this.MinRequiredNonAlphanumericCharacters = minRequiredNonAlphanumericCharacters; this.MinRequiredPasswordLength = minRequiredPasswordLength; this.PasswordAttemptWindow = passwordAttemptWindow; this.PasswordFailedAttemptDelaySeconds = passwordFailedAttemptDelaySeconds; this.PasswordStrategy = passwordStrategy; this.PasswordStrengthRegularExpression = passwordStrengthRegularExpression; this.RequiresQuestionAndAnswer = requiresQuestionAndAnswer; this.RequiresUniqueEmail = requiresUniqueEmail; this.TokenExpirationMinutes = tokenExpirationMinutes; } /// <summary> /// The account lock down time (in minutes) /// </summary> /// <value>The account lock down time (in minutes)</value> [DataMember(Name = "accountLockDownMinutes", EmitDefaultValue = false)] public int AccountLockDownMinutes { get; set; } /// <summary> /// Indicates whether the current membership provider is configured to allow customers to reset their passwords /// </summary> /// <value>Indicates whether the current membership provider is configured to allow customers to reset their passwords</value> [DataMember(Name = "enablePasswordReset", EmitDefaultValue = true)] public bool EnablePasswordReset { get; set; } /// <summary> /// Indicates whether the current membership provider is configured to allow users to retrieve their passwords /// </summary> /// <value>Indicates whether the current membership provider is configured to allow users to retrieve their passwords</value> [DataMember(Name = "enablePasswordRetrieval", EmitDefaultValue = true)] public bool EnablePasswordRetrieval { get; set; } /// <summary> /// The number of invalid password or password-answer attempts allowed before the membership user is locked out /// </summary> /// <value>The number of invalid password or password-answer attempts allowed before the membership user is locked out</value> [DataMember(Name = "maxInvalidPasswordAttempts", EmitDefaultValue = false)] public int MaxInvalidPasswordAttempts { get; set; } /// <summary> /// The minimum number of special characters that must be present in a valid password /// </summary> /// <value>The minimum number of special characters that must be present in a valid password</value> [DataMember(Name = "minRequiredNonAlphanumericCharacters", EmitDefaultValue = false)] public int MinRequiredNonAlphanumericCharacters { get; set; } /// <summary> /// The minimum required length for a password /// </summary> /// <value>The minimum required length for a password</value> [DataMember(Name = "minRequiredPasswordLength", EmitDefaultValue = false)] public int MinRequiredPasswordLength { get; set; } /// <summary> /// The time window (in minutes) between which consecutive failed attempts to provide a valid password or password answer are tracked /// </summary> /// <value>The time window (in minutes) between which consecutive failed attempts to provide a valid password or password answer are tracked</value> [DataMember(Name = "passwordAttemptWindow", EmitDefaultValue = false)] public int PasswordAttemptWindow { get; set; } /// <summary> /// The delay to apply on a failed login attempt /// </summary> /// <value>The delay to apply on a failed login attempt</value> [DataMember(Name = "passwordFailedAttemptDelaySeconds", EmitDefaultValue = false)] public double PasswordFailedAttemptDelaySeconds { get; set; } /// <summary> /// The regular expression used to validate the strength level of a password /// </summary> /// <value>The regular expression used to validate the strength level of a password</value> [DataMember(Name = "passwordStrengthRegularExpression", EmitDefaultValue = false)] public string PasswordStrengthRegularExpression { get; set; } /// <summary> /// Indicates whether the default membership provider requires the user to answer a password question (and answer) for password reset and retrieval /// </summary> /// <value>Indicates whether the default membership provider requires the user to answer a password question (and answer) for password reset and retrieval</value> [DataMember(Name = "requiresQuestionAndAnswer", EmitDefaultValue = true)] public bool RequiresQuestionAndAnswer { get; set; } /// <summary> /// Indicating whether the customer email addresses should be unique across the system /// </summary> /// <value>Indicating whether the customer email addresses should be unique across the system</value> [DataMember(Name = "requiresUniqueEmail", EmitDefaultValue = true)] public bool RequiresUniqueEmail { get; set; } /// <summary> /// The expiration time of reset password ticket (in minutes) /// </summary> /// <value>The expiration time of reset password ticket (in minutes)</value> [DataMember(Name = "tokenExpirationMinutes", EmitDefaultValue = false)] public int TokenExpirationMinutes { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class MembershipConfiguration {\n"); sb.Append(" AccountLockDownMinutes: ").Append(AccountLockDownMinutes).Append("\n"); sb.Append(" EnablePasswordReset: ").Append(EnablePasswordReset).Append("\n"); sb.Append(" EnablePasswordRetrieval: ").Append(EnablePasswordRetrieval).Append("\n"); sb.Append(" MaxInvalidPasswordAttempts: ").Append(MaxInvalidPasswordAttempts).Append("\n"); sb.Append(" MinRequiredNonAlphanumericCharacters: ").Append(MinRequiredNonAlphanumericCharacters).Append("\n"); sb.Append(" MinRequiredPasswordLength: ").Append(MinRequiredPasswordLength).Append("\n"); sb.Append(" PasswordAttemptWindow: ").Append(PasswordAttemptWindow).Append("\n"); sb.Append(" PasswordFailedAttemptDelaySeconds: ").Append(PasswordFailedAttemptDelaySeconds).Append("\n"); sb.Append(" PasswordStrategy: ").Append(PasswordStrategy).Append("\n"); sb.Append(" PasswordStrengthRegularExpression: ").Append(PasswordStrengthRegularExpression).Append("\n"); sb.Append(" RequiresQuestionAndAnswer: ").Append(RequiresQuestionAndAnswer).Append("\n"); sb.Append(" RequiresUniqueEmail: ").Append(RequiresUniqueEmail).Append("\n"); sb.Append(" TokenExpirationMinutes: ").Append(TokenExpirationMinutes).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="input">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object input) { return this.Equals(input as MembershipConfiguration); } /// <summary> /// Returns true if MembershipConfiguration instances are equal /// </summary> /// <param name="input">Instance of MembershipConfiguration to be compared</param> /// <returns>Boolean</returns> public bool Equals(MembershipConfiguration input) { if (input == null) return false; return ( this.AccountLockDownMinutes == input.AccountLockDownMinutes || this.AccountLockDownMinutes.Equals(input.AccountLockDownMinutes) ) && ( this.EnablePasswordReset == input.EnablePasswordReset || this.EnablePasswordReset.Equals(input.EnablePasswordReset) ) && ( this.EnablePasswordRetrieval == input.EnablePasswordRetrieval || this.EnablePasswordRetrieval.Equals(input.EnablePasswordRetrieval) ) && ( this.MaxInvalidPasswordAttempts == input.MaxInvalidPasswordAttempts || this.MaxInvalidPasswordAttempts.Equals(input.MaxInvalidPasswordAttempts) ) && ( this.MinRequiredNonAlphanumericCharacters == input.MinRequiredNonAlphanumericCharacters || this.MinRequiredNonAlphanumericCharacters.Equals(input.MinRequiredNonAlphanumericCharacters) ) && ( this.MinRequiredPasswordLength == input.MinRequiredPasswordLength || this.MinRequiredPasswordLength.Equals(input.MinRequiredPasswordLength) ) && ( this.PasswordAttemptWindow == input.PasswordAttemptWindow || this.PasswordAttemptWindow.Equals(input.PasswordAttemptWindow) ) && ( this.PasswordFailedAttemptDelaySeconds == input.PasswordFailedAttemptDelaySeconds || this.PasswordFailedAttemptDelaySeconds.Equals(input.PasswordFailedAttemptDelaySeconds) ) && ( this.PasswordStrategy == input.PasswordStrategy || this.PasswordStrategy.Equals(input.PasswordStrategy) ) && ( this.PasswordStrengthRegularExpression == input.PasswordStrengthRegularExpression || (this.PasswordStrengthRegularExpression != null && this.PasswordStrengthRegularExpression.Equals(input.PasswordStrengthRegularExpression)) ) && ( this.RequiresQuestionAndAnswer == input.RequiresQuestionAndAnswer || this.RequiresQuestionAndAnswer.Equals(input.RequiresQuestionAndAnswer) ) && ( this.RequiresUniqueEmail == input.RequiresUniqueEmail || this.RequiresUniqueEmail.Equals(input.RequiresUniqueEmail) ) && ( this.TokenExpirationMinutes == input.TokenExpirationMinutes || this.TokenExpirationMinutes.Equals(input.TokenExpirationMinutes) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = hashCode * 59 + this.AccountLockDownMinutes.GetHashCode(); hashCode = hashCode * 59 + this.EnablePasswordReset.GetHashCode(); hashCode = hashCode * 59 + this.EnablePasswordRetrieval.GetHashCode(); hashCode = hashCode * 59 + this.MaxInvalidPasswordAttempts.GetHashCode(); hashCode = hashCode * 59 + this.MinRequiredNonAlphanumericCharacters.GetHashCode(); hashCode = hashCode * 59 + this.MinRequiredPasswordLength.GetHashCode(); hashCode = hashCode * 59 + this.PasswordAttemptWindow.GetHashCode(); hashCode = hashCode * 59 + this.PasswordFailedAttemptDelaySeconds.GetHashCode(); hashCode = hashCode * 59 + this.PasswordStrategy.GetHashCode(); if (this.PasswordStrengthRegularExpression != null) hashCode = hashCode * 59 + this.PasswordStrengthRegularExpression.GetHashCode(); hashCode = hashCode * 59 + this.RequiresQuestionAndAnswer.GetHashCode(); hashCode = hashCode * 59 + this.RequiresUniqueEmail.GetHashCode(); hashCode = hashCode * 59 + this.TokenExpirationMinutes.GetHashCode(); return hashCode; } } /// <summary> /// To validate all properties of the instance /// </summary> /// <param name="validationContext">Validation context</param> /// <returns>Validation Result</returns> IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } }
54.844311
687
0.653783
[ "MIT" ]
Yaksa-ca/eShopOnWeb
src/Yaksa.OrckestraCommerce.Client/Model/MembershipConfiguration.cs
18,318
C#
using Newtonsoft.Json; using System; using System.IO; namespace DevilDaggersAssetEditor.User { [JsonObject(MemberSerialization.OptIn)] public class UserSettings { public const string PathDefault = @"C:\Program Files (x86)\Steam\steamapps\common\devildaggers"; private const string _fileName = "settings.json"; public static string FileDirectory => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DevilDaggersAssetEditor"); public static string FilePath => Path.Combine(FileDirectory, _fileName); [JsonProperty] public string DevilDaggersRootFolder { get; set; } = PathDefault; [JsonProperty] public bool EnableDevilDaggersRootFolder { get; set; } [JsonProperty] public string ModsRootFolder { get; set; } = PathDefault; [JsonProperty] public bool EnableModsRootFolder { get; set; } [JsonProperty] public string AssetsRootFolder { get; set; } = PathDefault; [JsonProperty] public bool EnableAssetsRootFolder { get; set; } [JsonProperty] public bool OpenModFolderAfterExtracting { get; set; } [JsonProperty] public uint TextureSizeLimit { get; set; } = 512; } }
29.564103
155
0.75889
[ "Unlicense" ]
NoahStolk/DevilDaggersAssetEditor
DevilDaggersAssetEditor/User/UserSettings.cs
1,153
C#
#pragma checksum "C:\Users\Matt\Documents\GitHub\SpartaHack2016-Windows\SpartaHack\SpartaHack\HomePage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "7C0BBD6C8B5E8B6B602CD08A3CA804A0" //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace SpartaHack { partial class HomePage : global::Windows.UI.Xaml.Controls.Page, global::Windows.UI.Xaml.Markup.IComponentConnector, global::Windows.UI.Xaml.Markup.IComponentConnector2 { /// <summary> /// Connect() /// </summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 14.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public void Connect(int connectionId, object target) { switch(connectionId) { case 1: { this.Data = (global::Windows.UI.Xaml.Data.CollectionViewSource)(target); } break; case 2: { this.lsvHeader = (global::Windows.UI.Xaml.DataTemplate)(target); } break; case 3: { global::PullToRefresh.UWP.PullToRefreshBox element3 = (global::PullToRefresh.UWP.PullToRefreshBox)(target); #line 23 "..\..\..\HomePage.xaml" ((global::PullToRefresh.UWP.PullToRefreshBox)element3).RefreshInvoked += this.PullToRefreshBox_RefreshInvoked; #line default } break; case 4: { this.pgrRing = (global::Windows.UI.Xaml.Controls.ProgressRing)(target); } break; case 5: { this.listAnnouncements = (global::Windows.UI.Xaml.Controls.ListView)(target); #line 45 "..\..\..\HomePage.xaml" ((global::Windows.UI.Xaml.Controls.ListView)this.listAnnouncements).ItemClick += this.listAnnouncements_ItemClick; #line default } break; default: break; } this._contentLoaded = true; } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 14.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public global::Windows.UI.Xaml.Markup.IComponentConnector GetBindingConnector(int connectionId, object target) { global::Windows.UI.Xaml.Markup.IComponentConnector returnValue = null; return returnValue; } } }
40.986486
185
0.534784
[ "MIT" ]
SpartaHack/SpartaHack-Windows
2016/SpartaHack/SpartaHack/obj/ARM/Debug/HomePage.g.cs
3,035
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Data; using System.Windows.Media; namespace ExerciceMultiplications.MVVM { public class NullableBooleanToColorConverter : IValueConverter { /// <summary> /// Convertir un boolean nullable en une couleur (null -> Noir, Vrai -> Vert, Faux -> Rouge) /// </summary> /// <param name="value">La valeur</param> /// <param name="targetType"></param> /// <param name="parameter"></param> /// <param name="culture"></param> /// <returns></returns> public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { switch ((bool?)value) { case true: return Brushes.Green; case false: return Brushes.Red; case null: default: return Brushes.Black; } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { switch (((SolidColorBrush)value).ToString()) { case "Green": return true; case "Red": return false; default: return null; } } } }
27.924528
124
0.525
[ "MIT" ]
nmariot/Multiplications
ExerciceMultiplications.MVVM/NullableBooleanToColorConverter.cs
1,482
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("EnvarEditor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MBulli")] [assembly: AssemblyProduct("EnvarEditor")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bfcd847e-21f1-4f4f-bb9f-3b1c436ad1c9")] // 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("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0.0")]
38.837838
85
0.727209
[ "MIT" ]
MBulli/Envar-Editor
EnvarEditor/Properties/AssemblyInfo.cs
1,440
C#
 namespace SrkCsv { using SrkCsv.Internals; using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Text; /// <summary> /// Basic CSV reader. /// </summary> public class CsvReader : CsvReader<Nothing> { public CsvReader() : base() { } public CsvReader(Table table) : base(table) { } } /// <summary> /// CSV reader with support for a target object type. /// </summary> /// <typeparam name="T">the target object type</typeparam> public class CsvReader<T> : ICsvReader<T> { private readonly Table<T> table; private CultureInfo culture = CultureInfo.InvariantCulture; /// <summary> /// Initializes a new instance of the <see cref="CsvReader{T}"/> class. /// </summary> public CsvReader() { } /// <summary> /// Initializes a new instance of the <see cref="CsvReader{T}"/> class. /// </summary> /// <param name="table">The table.</param> public CsvReader(Table<T> table) { this.table = table; } /// <summary> /// Gets or sets the cell separator. /// </summary> public char CellSeparator { get; set; } /// <summary> /// Gets or sets a value indicating whether [has header line]. /// </summary> public bool HasHeaderLine { get; set; } /// <summary> /// Gets or sets whether to keep a copy of the line in the row objects. /// </summary> public bool KeepLines { get; set; } /// <summary> /// Gets or sets the culture. /// </summary> public CultureInfo Culture { get { return this.culture; } set { this.culture = value; } } /// <summary> /// Gets or sets whether some columns can be missing. An exception is usually thrown when a column is absent. /// </summary> public bool AllowMissingColumns { get; set; } /// <summary> /// Reads to end. /// </summary> /// <param name="reader">The reader.</param> /// <returns></returns> public Table<T> ReadToEnd(TextReader reader) { var data = new List<List<string>>(); var errors = new List<string>(); this.ParseToEnd(reader, data, errors); var table = this.table.Clone(false); table.Rows = new List<Row<T>>(data.Count); this.Transform(data, errors, table); return table; } private void ParseToEnd(TextReader reader, List<List<string>> data, List<string> errors) { errors = new List<string>(); var err = new Action<int, string>((int lineIndex1, string error) => { errors.Add("CSV:" + lineIndex1 + " Error: " + error); }); var warnings = new List<string>(); var warn = new Action<int, string>((int lineIndex1, string error) => { warnings.Add("CSV:" + lineIndex1 + " Warning: " + error); }); var separator = this.CellSeparator; string line; int lineIndex = -1; bool inCell = false, inQuotes = false; StringBuilder cellBuilder = null; int startOfCell = 0; while ((line = reader.ReadLine()) != null) { lineIndex++; if (string.IsNullOrEmpty(line)) { warn(lineIndex, "Line is empty"); continue; } var dataList = new List<string>(); data.Add(dataList); inCell = false; inQuotes = false; startOfCell = 0; for (int i = 0; i < line.Length; i++) { var c = line[i]; if (!inCell) { if (c == separator) { inCell = false; startOfCell = i; } else { startOfCell = i; if (c == '"') { startOfCell = i + 1; inQuotes = true; cellBuilder = new StringBuilder(line.Length - i); } inCell = true; } } else if (inQuotes) { if (c == '"' && line.Length > (i + 1) && line[i + 1] == '"') { // escaped quote => ignore i++; cellBuilder.Append(c); } else if (c == '"' && line.Length > (i + 1) && line[i + 1] == separator) { // end of quoted cell i++; inQuotes = false; inCell = false; } else { cellBuilder.Append(c); } } if (c == separator) { if (inQuotes) { // do nothing here } else if (inCell) { inCell = false; } else { startOfCell = i; } } if (!inCell) { // end of cell => capture if (cellBuilder != null) { // when the line is quoted, we use a StringBuilder to skip some chars Debug.Assert(c == '"', "CsvUserImport at end of cell: cellBuilder is set but in unquoted cell"); dataList.Add(cellBuilder.ToString()); cellBuilder = null; } else { dataList.Add(line.Substring(startOfCell, i - startOfCell)); } } if ((i + 1) == line.Length) { // end of line => capture if (inCell) { dataList.Add(line.Substring(startOfCell, i - startOfCell + 1)); } else { // when last entry is empty dataList.Add(string.Empty); } cellBuilder = null; } } } int colCount = -1; for (int i = 0; i < data.Count; i++) { if (i == 0) { colCount = data[i].Count; } else if (data[i].Count < colCount && this.AllowMissingColumns) { ////err(i, "Invalid cell count '" + data[i].Count + "'; expected '" + colCount + "'"); } else if (data[i].Count != colCount) { err(i, "Invalid cell count '" + data[i].Count + "'; expected '" + colCount + "'"); } } if (errors.Count > 0) { throw new CsvParseException("Parse failed with " + errors.Count + " errors.", errors); } } private void Transform(List<List<string>> data, List<string> errors, Table<T> table) { var err = new Action<int, string>((int line, string error) => { errors.Add("CSV:" + line + " " + error); }); for (int i = 0; i < data.Count; i++) { var line = data[i]; try { var row = this.table.CreateRow(i, culture, this.HasHeaderLine && i == 0); table.Rows.Add(row); if (this.KeepLines) { ////row.Line = lines[i]; } var cells = new List<Cell<T>>(table.Columns.Count); for (int c = 0; c < table.Columns.Count; c++) { var col = table.Columns[c]; var cell = line.Count >= (col.Index + 1) ? line[col.Index] : null; if (cell == null && !this.AllowMissingColumns) { err(i, "CSV row " + i + " does not contain column '" + col.Name + "' because index " + col.Index + " does not exist"); } var cellObj = this.table.CreateCell(col, row, cell); row.Target = cellObj.Target; if (!row.IsHeader && col.Transform != null && !col.Transform(cellObj)) { errors.Add("Parse failed at row:" + i + " col:" + c); } cells.Add(cellObj); } ////for (int c = 0; c < cells.Count; c++) ////{ //// var cell = cells[c]; //// cell.Column.Parse(cell); //// cell.Dispose(); ////} row.Cells = cells; } catch (Exception ex) { err(i, "Internal error: " + ex.Message); } } if (errors.Count == 1) { throw new CsvParseException(errors[0], errors); } else if (errors.Count > 1) { throw new CsvParseException("Parse failed with " + errors.Count + " errors.", errors); } } private void EnsureTable() { if (this.table == null) throw new InvalidOperationException("Table definition not set"); } } }
33.097264
146
0.377078
[ "Unlicense" ]
JTOne123/SrkCsv
src/SrkCsv/CsvReader.cs
10,891
C#
namespace XPuzzleCP.Data; public class XPuzzleSpaceInfo : IBasicSpace { public Vector Vector { get; set; } public string Text { get; set; } = ""; public string Color { get; set; } = cs.Transparent; public void ClearSpace() { Color = cs.Transparent; Text = ""; } public bool IsFilled() { return !string.IsNullOrWhiteSpace(Text); } }
24.5
55
0.602041
[ "MIT" ]
musictopia2/GamingPackXV3
CP/Games/XPuzzleCP/Data/XPuzzleSpaceInfo.cs
394
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.Lb { public static class GetBackendAddressPool { /// <summary> /// Use this data source to access information about an existing Load Balancer's Backend Address Pool. /// /// {{% examples %}} /// {{% /examples %}} /// </summary> public static Task<GetBackendAddressPoolResult> InvokeAsync(GetBackendAddressPoolArgs args, InvokeOptions? options = null) => Pulumi.Deployment.Instance.InvokeAsync<GetBackendAddressPoolResult>("azure:lb/getBackendAddressPool:getBackendAddressPool", args ?? new GetBackendAddressPoolArgs(), options.WithVersion()); } public sealed class GetBackendAddressPoolArgs : Pulumi.InvokeArgs { /// <summary> /// The ID of the Load Balancer in which the Backend Address Pool exists. /// </summary> [Input("loadbalancerId", required: true)] public string LoadbalancerId { get; set; } = null!; /// <summary> /// Specifies the name of the Backend Address Pool. /// </summary> [Input("name", required: true)] public string Name { get; set; } = null!; public GetBackendAddressPoolArgs() { } } [OutputType] public sealed class GetBackendAddressPoolResult { /// <summary> /// An array of references to IP addresses defined in network interfaces. /// </summary> public readonly ImmutableArray<Outputs.GetBackendAddressPoolBackendIpConfigurationResult> BackendIpConfigurations; /// <summary> /// The provider-assigned unique ID for this managed resource. /// </summary> public readonly string Id; public readonly string LoadbalancerId; /// <summary> /// The name of the Backend Address Pool. /// </summary> public readonly string Name; [OutputConstructor] private GetBackendAddressPoolResult( ImmutableArray<Outputs.GetBackendAddressPoolBackendIpConfigurationResult> backendIpConfigurations, string id, string loadbalancerId, string name) { BackendIpConfigurations = backendIpConfigurations; Id = id; LoadbalancerId = loadbalancerId; Name = name; } } }
33.607595
203
0.636911
[ "ECL-2.0", "Apache-2.0" ]
adnang/pulumi-azure
sdk/dotnet/Lb/GetBackendAddressPool.cs
2,655
C#
namespace Toggl.Core.Interactors { public enum PushNotificationSyncSourceState { Foreground, Background } }
15.111111
47
0.661765
[ "BSD-3-Clause" ]
MULXCODE/mobileapp
Toggl.Core/Interactors/Sync/PushNotificationSyncSourceState.cs
136
C#
// Project: Aguafrommars/TheIdServer // Copyright (c) 2021 @Olivier Lefebvre using Aguacongas.IdentityServer.Abstractions; using Aguacongas.IdentityServer.Store; using Aguacongas.IdentityServer.Store.Entity; using System; namespace Aguacongas.IdentityServer.Admin.Services { /// <summary> /// Gets a one time token and burn it /// </summary> /// <seealso cref="IRetrieveOneTimeToken" /> public class OneTimeTokenService : IRetrieveOneTimeToken { private readonly IAdminStore<OneTimeToken> _store; /// <summary> /// Initializes a new instance of the <see cref="OneTimeTokenService"/> class. /// </summary> /// <param name="store">The store.</param> /// <exception cref="ArgumentNullException">store</exception> public OneTimeTokenService(IAdminStore<OneTimeToken> store) { _store = store ?? throw new ArgumentNullException(nameof(store)); } /// <summary> /// Gets the one time token. /// </summary> /// <param name="id">The identifier.</param> /// <returns></returns> public string GetOneTimeToken(string id) { var token = _store.GetAsync(id, new GetRequest()).GetAwaiter().GetResult(); if (token == null) { return null; } _store.DeleteAsync(id).GetAwaiter().GetResult(); return token.Data; } } }
32.533333
87
0.608607
[ "Apache-2.0" ]
Magicianred/TheIdServer
src/IdentityServer/Aguacongas.IdentityServer.Admin/Services/OneTimeTokenService.cs
1,466
C#
using System.Collections.ObjectModel; using Prism.Events; using CodeMovement.EbcdicCompare.Models.Constant; using CodeMovement.EbcdicCompare.Models.Request; using CodeMovement.EbcdicCompare.Models.Result; using CodeMovement.EbcdicCompare.Models.ViewModel; using CodeMovement.EbcdicCompare.Services; using CodeMovement.EbcdicCompare.Presentation.Event; namespace CodeMovement.EbcdicCompare.Presentation.Controller { public class EbcdicFileContentRegionController { private readonly ICompareEbcdicFilesService _compareEbcdicFilesService; private readonly IEventAggregator _eventAggregator; private readonly UpdateEbcdicFileGridEvent _updateGridEvent; public EbcdicFileContentRegionController( IEventAggregator eventAggregator, ICompareEbcdicFilesService compareEbcdicFilesService) { _compareEbcdicFilesService = compareEbcdicFilesService; _eventAggregator = eventAggregator; _updateGridEvent = _eventAggregator.GetEvent<UpdateEbcdicFileGridEvent>(); _eventAggregator.GetEvent<ViewEbcdicFileRequestEvent>().Subscribe(OnViewEbcdicFile, ThreadOption.BackgroundThread, true, null); _eventAggregator.GetEvent<CompareEbcdicFilesRequestEvent>().Subscribe(OnCompareEbcdicFiles, ThreadOption.BackgroundThread, true); } #region "Event Handlers" private void OnViewEbcdicFile(ViewEbcdicFileRequest request) { var finishReadEbcdicFile = new FinishReadEbcdicFile { EventType = ReadEbcdicFileEventType.ViewEbcdicFile }; UpdateEbcdicFileGrid(RegionNames.ViewEbcdicFileContentRegion, new ObservableCollection<EbcdicFileRecordModel>()); // Read in the EBCDIC file var results = _compareEbcdicFilesService.Compare(new CompareEbcdicFilesRequest { FirstEbcdicFilePath = request.EbcdicFilePath, SecondEbcdicFilePath = null, CopybookFilePath = request.CopybookFilePath }); if (results.Messages.Count == 0) { // Update grid view with results UpdateEbcdicFileGrid(RegionNames.ViewEbcdicFileContentRegion, results.Result.FirstEbcdicFile.EbcdicFileRecords); } else { finishReadEbcdicFile.ErrorMessage = results.Messages[0]; } // Notify the view of any errors that occurred during the reading of the // EBCDIC file _eventAggregator.GetEvent<FinishReadEbcdicFileEvent>().Publish(finishReadEbcdicFile); } private void OnCompareEbcdicFiles(CompareEbcdicFilesRequest request) { var finishedReadingEvent = _eventAggregator.GetEvent<FinishReadEbcdicFileEvent>(); var finishReadEbcdicFile = new FinishReadEbcdicFile { EventType = ReadEbcdicFileEventType.CompareEbcdicFiles }; UpdateEbcdicFileGrid(RegionNames.FirstEbcdicFileContentRegion, new ObservableCollection<EbcdicFileRecordModel>()); UpdateEbcdicFileGrid(RegionNames.SecondEbcdicFileContentRegion, new ObservableCollection<EbcdicFileRecordModel>()); var comparisonResults = _compareEbcdicFilesService.Compare(request); if (comparisonResults.Messages.Count > 0) finishReadEbcdicFile.ErrorMessage = comparisonResults.Messages[0]; UpdateEbcdicFileGrid(RegionNames.FirstEbcdicFileContentRegion, comparisonResults.Result.FirstEbcdicFile.EbcdicFileRecords); UpdateEbcdicFileGrid(RegionNames.SecondEbcdicFileContentRegion, comparisonResults.Result.SecondEbcdicFile.EbcdicFileRecords); finishReadEbcdicFile.CompareEbcdicFileResult = comparisonResults.Result; finishedReadingEvent.Publish(finishReadEbcdicFile); } #endregion #region "Helper Methods" private void UpdateEbcdicFileGrid(string regionName, ObservableCollection<EbcdicFileRecordModel> allModels, ObservableCollection<EbcdicFileRecordModel> visibleModels = null) { visibleModels = visibleModels ?? allModels; _updateGridEvent.Publish(new UpdateEbcdicFileGridResult { Region = regionName, AllEbcdicFileRecordModels = allModels, VisibleEbcdicFileRecords = visibleModels }); } #endregion } }
40.215517
115
0.681029
[ "Apache-2.0" ]
cmoresid/ebcdic-compare-tool
CodeMovement.EbcdicCompare.Presentation/Controller/EbcdicFileContentRegionController.cs
4,667
C#
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ namespace Microsoft.ServiceFabric.Actors.Runtime.Migration { internal class MigrationTelemetryConstants { internal static readonly string MigrationStartEvent = "TelemetryEvents.MigrationStartOrResumeEvent"; internal static readonly string MigrationEndEvent = "TelemetryEvents.MigrationEndEvent"; internal static readonly string MigrationPhaseStartEvent = "TelemetryEvents.MigrationPhaseStartOrResumeEvent"; internal static readonly string MigrationPhaseEndEvent = "TelemetryEvents.MigrationPhaseEndEvent"; internal static readonly string MigrationFailureEvent = "TelemetryEvents.MigrationFailureEvent"; internal static readonly string MigrationAbortEvent = "TelemetryEvents.MigrationAbortEvent"; } }
58.277778
118
0.699714
[ "MIT" ]
Microsoft/service-fabric-services-and-actors-dotnet
src/Microsoft.ServiceFabric.Actors/Runtime/Migration/MigrationTelemetryConstants.cs
1,049
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; using AutherizationAuthentication.Data; namespace AutherizationAuthentication.Pages.Account.Manage { public class Disable2faModel : PageModel { private readonly UserManager<ApplicationUser> _userManager; private readonly ILogger<Disable2faModel> _logger; public Disable2faModel( UserManager<ApplicationUser> userManager, ILogger<Disable2faModel> logger) { _userManager = userManager; _logger = logger; } public async Task<IActionResult> OnGet() { var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } if (!await _userManager.GetTwoFactorEnabledAsync(user)) { throw new ApplicationException($"Cannot disable 2FA for user with ID '{_userManager.GetUserId(User)}' as it's not currently enabled."); } return Page(); } public async Task<IActionResult> OnPostAsync() { var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } var disable2faResult = await _userManager.SetTwoFactorEnabledAsync(user, false); if (!disable2faResult.Succeeded) { throw new ApplicationException($"Unexpected error occurred disabling 2FA for user with ID '{_userManager.GetUserId(User)}'."); } _logger.LogInformation("User with ID '{UserId}' has disabled 2fa.", _userManager.GetUserId(User)); return RedirectToPage("./TwoFactorAuthentication"); } } }
34.95082
151
0.634146
[ "MIT" ]
sofani/sofani_codeNET
WebApplication70-486/AutherizationAuthentication/Pages/Account/Manage/Disable2fa.cshtml.cs
2,132
C#
// MonoGame - Copyright (C) The MonoGame Team // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. using MonoGame.Utilities; using System; namespace Microsoft.Xna.Framework.Content { internal class MultiArrayReader<T> : ContentTypeReader<Array> { ContentTypeReader elementReader; public MultiArrayReader() { } protected internal override void Initialize(ContentTypeReaderManager manager) { Type readerType = typeof(T); elementReader = manager.GetTypeReader(readerType); } protected internal override Array Read(ContentReader input, Array existingInstance) { var rank = input.ReadInt32(); if(rank < 1) throw new RankException(); var dimensions = new int[rank]; var count = 1; for(int d = 0; d < dimensions.Length; d++) count *= dimensions[d] = input.ReadInt32(); var array = existingInstance; if(array == null) array = Array.CreateInstance(typeof(T), dimensions);//new T[count]; else if(dimensions.Length != array.Rank) throw new RankException(nameof(existingInstance)); var indices = new int[rank]; for(int i = 0; i < count; i++) { T value; if(ReflectionHelpers.IsValueType(typeof(T))) value = input.ReadObject<T>(elementReader); else { var readerType = input.Read7BitEncodedInt(); if(readerType > 0) value = input.ReadObject<T>(input.TypeReaders[readerType - 1]); else value = default(T); } CalcIndices(array, i, indices); array.SetValue(value, indices); } return array; } static void CalcIndices(Array array, int index, int[] indices) { if(array.Rank != indices.Length) throw new Exception(nameof(indices)); for(int d = 0; d < indices.Length; d++) { if(index == 0) indices[d] = 0; else { indices[d] = index % array.GetLength(d); index /= array.GetLength(d); } } if(index != 0) throw new ArgumentOutOfRangeException(nameof(index)); } } }
31.321429
91
0.511593
[ "MIT" ]
sl8rw/CS581_MonoGame_Addons
MonoGame.Framework/Content/ContentReaders/MultiArrayReader.cs
2,633
C#
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Xml; using System.Xml.Serialization; using System.Xml.XPath; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; using Umbraco.Web.Models; namespace Umbraco.Web.PublishedCache.XmlPublishedCache { /// <summary> /// Represents an IPublishedContent which is created based on an Xml structure. /// </summary> [Serializable] [XmlType(Namespace = "http://umbraco.org/webservices/")] internal class XmlPublishedContent : PublishedContentBase { /// <summary> /// Initializes a new instance of the <c>XmlPublishedContent</c> class with an Xml node. /// </summary> /// <param name="xmlNode">The Xml node.</param> /// <param name="isPreviewing">A value indicating whether the published content is being previewed.</param> public XmlPublishedContent(XmlNode xmlNode, bool isPreviewing) { _xmlNode = xmlNode; _isPreviewing = isPreviewing; InitializeStructure(); Initialize(); InitializeChildren(); } /// <summary> /// Initializes a new instance of the <c>XmlPublishedContent</c> class with an Xml node, /// and a value indicating whether to lazy-initialize the instance. /// </summary> /// <param name="xmlNode">The Xml node.</param> /// <param name="isPreviewing">A value indicating whether the published content is being previewed.</param> /// <param name="lazyInitialize">A value indicating whether to lazy-initialize the instance.</param> /// <remarks>Lazy-initializationg is NOT thread-safe.</remarks> internal XmlPublishedContent(XmlNode xmlNode, bool isPreviewing, bool lazyInitialize) { _xmlNode = xmlNode; _isPreviewing = isPreviewing; InitializeStructure(); if (lazyInitialize == false) { Initialize(); InitializeChildren(); } } private readonly XmlNode _xmlNode; private bool _initialized; private bool _childrenInitialized; private readonly ICollection<IPublishedContent> _children = new Collection<IPublishedContent>(); private IPublishedContent _parent; private int _id; private int _template; private string _name; private string _docTypeAlias; private int _docTypeId; private string _writerName; private string _creatorName; private int _writerId; private int _creatorId; private string _urlName; private string _path; private DateTime _createDate; private DateTime _updateDate; private Guid _version; private IPublishedProperty[] _properties; private int _sortOrder; private int _level; private bool _isDraft; private readonly bool _isPreviewing; private PublishedContentType _contentType; public override IEnumerable<IPublishedContent> Children { get { if (_initialized == false) Initialize(); if (_childrenInitialized == false) InitializeChildren(); return _children.OrderBy(x => x.SortOrder); } } public override IPublishedProperty GetProperty(string alias) { return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); } // override to implement cache // cache at context level, ie once for the whole request // but cache is not shared by requests because we wouldn't know how to clear it public override IPublishedProperty GetProperty(string alias, bool recurse) { if (recurse == false) return GetProperty(alias); var cache = UmbracoContextCache.Current; if (cache == null) return base.GetProperty(alias, true); var key = string.Format("RECURSIVE_PROPERTY::{0}::{1}", Id, alias.ToLowerInvariant()); var value = cache.GetOrAdd(key, k => base.GetProperty(alias, true)); if (value == null) return null; var property = value as IPublishedProperty; if (property == null) throw new InvalidOperationException("Corrupted cache."); return property; } public override PublishedItemType ItemType { get { return PublishedItemType.Content; } } public override IPublishedContent Parent { get { if (_initialized == false) Initialize(); return _parent; } } public override int Id { get { if (_initialized == false) Initialize(); return _id; } } public override int TemplateId { get { if (_initialized == false) Initialize(); return _template; } } public override int SortOrder { get { if (_initialized == false) Initialize(); return _sortOrder; } } public override string Name { get { if (_initialized == false) Initialize(); return _name; } } public override string DocumentTypeAlias { get { if (_initialized == false) Initialize(); return _docTypeAlias; } } public override int DocumentTypeId { get { if (_initialized == false) Initialize(); return _docTypeId; } } public override string WriterName { get { if (_initialized == false) Initialize(); return _writerName; } } public override string CreatorName { get { if (_initialized == false) Initialize(); return _creatorName; } } public override int WriterId { get { if (_initialized == false) Initialize(); return _writerId; } } public override int CreatorId { get { if (_initialized == false) Initialize(); return _creatorId; } } public override string Path { get { if (_initialized == false) Initialize(); return _path; } } public override DateTime CreateDate { get { if (_initialized == false) Initialize(); return _createDate; } } public override DateTime UpdateDate { get { if (_initialized == false) Initialize(); return _updateDate; } } public override Guid Version { get { if (_initialized == false) Initialize(); return _version; } } public override string UrlName { get { if (_initialized == false) Initialize(); return _urlName; } } public override int Level { get { if (_initialized == false) Initialize(); return _level; } } public override bool IsDraft { get { if (_initialized == false) Initialize(); return _isDraft; } } public override ICollection<IPublishedProperty> Properties { get { if (_initialized == false) Initialize(); return _properties; } } public override PublishedContentType ContentType { get { if (_initialized == false) Initialize(); return _contentType; } } private void InitializeStructure() { // load parent if it exists and is a node var parent = _xmlNode == null ? null : _xmlNode.ParentNode; if (parent == null) return; if (parent.Name == "node" || (parent.Attributes != null && parent.Attributes.GetNamedItem("isDoc") != null)) _parent = PublishedContentModelFactory.CreateModel(new XmlPublishedContent(parent, _isPreviewing, true)); } private void Initialize() { if (_xmlNode == null) return; if (_xmlNode.Attributes != null) { _id = int.Parse(_xmlNode.Attributes.GetNamedItem("id").Value); if (_xmlNode.Attributes.GetNamedItem("template") != null) _template = int.Parse(_xmlNode.Attributes.GetNamedItem("template").Value); if (_xmlNode.Attributes.GetNamedItem("sortOrder") != null) _sortOrder = int.Parse(_xmlNode.Attributes.GetNamedItem("sortOrder").Value); if (_xmlNode.Attributes.GetNamedItem("nodeName") != null) _name = _xmlNode.Attributes.GetNamedItem("nodeName").Value; if (_xmlNode.Attributes.GetNamedItem("writerName") != null) _writerName = _xmlNode.Attributes.GetNamedItem("writerName").Value; if (_xmlNode.Attributes.GetNamedItem("urlName") != null) _urlName = _xmlNode.Attributes.GetNamedItem("urlName").Value; // Creatorname is new in 2.1, so published xml might not have it! try { _creatorName = _xmlNode.Attributes.GetNamedItem("creatorName").Value; } catch { _creatorName = _writerName; } //Added the actual userID, as a user cannot be looked up via full name only... if (_xmlNode.Attributes.GetNamedItem("creatorID") != null) _creatorId = int.Parse(_xmlNode.Attributes.GetNamedItem("creatorID").Value); if (_xmlNode.Attributes.GetNamedItem("writerID") != null) _writerId = int.Parse(_xmlNode.Attributes.GetNamedItem("writerID").Value); if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { if (_xmlNode.Attributes.GetNamedItem("nodeTypeAlias") != null) _docTypeAlias = _xmlNode.Attributes.GetNamedItem("nodeTypeAlias").Value; } else { _docTypeAlias = _xmlNode.Name; } if (_xmlNode.Attributes.GetNamedItem("nodeType") != null) _docTypeId = int.Parse(_xmlNode.Attributes.GetNamedItem("nodeType").Value); if (_xmlNode.Attributes.GetNamedItem("path") != null) _path = _xmlNode.Attributes.GetNamedItem("path").Value; if (_xmlNode.Attributes.GetNamedItem("version") != null) _version = new Guid(_xmlNode.Attributes.GetNamedItem("version").Value); if (_xmlNode.Attributes.GetNamedItem("createDate") != null) _createDate = DateTime.Parse(_xmlNode.Attributes.GetNamedItem("createDate").Value); if (_xmlNode.Attributes.GetNamedItem("updateDate") != null) _updateDate = DateTime.Parse(_xmlNode.Attributes.GetNamedItem("updateDate").Value); if (_xmlNode.Attributes.GetNamedItem("level") != null) _level = int.Parse(_xmlNode.Attributes.GetNamedItem("level").Value); _isDraft = (_xmlNode.Attributes.GetNamedItem("isDraft") != null); } // load data var dataXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; var nodes = _xmlNode.SelectNodes(dataXPath); _contentType = PublishedContentType.Get(PublishedItemType.Content, _docTypeAlias); var propertyNodes = new Dictionary<string, XmlNode>(); if (nodes != null) foreach (XmlNode n in nodes) { var alias = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? n.Attributes.GetNamedItem("alias").Value : n.Name; propertyNodes[alias.ToLowerInvariant()] = n; } _properties = _contentType.PropertyTypes.Select(p => { XmlNode n; return propertyNodes.TryGetValue(p.PropertyTypeAlias.ToLowerInvariant(), out n) ? new XmlPublishedProperty(p, _isPreviewing, n) : new XmlPublishedProperty(p, _isPreviewing); }).Cast<IPublishedProperty>().ToArray(); // warn: this is not thread-safe... _initialized = true; } private void InitializeChildren() { if (_xmlNode == null) return; // load children var childXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; var nav = _xmlNode.CreateNavigator(); var expr = nav.Compile(childXPath); expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number); var iterator = nav.Select(expr); while (iterator.MoveNext()) _children.Add(PublishedContentModelFactory.CreateModel( new XmlPublishedContent(((IHasXmlNode)iterator.Current).GetNode(), _isPreviewing, true))); // warn: this is not thread-safe _childrenInitialized = true; } } }
29.249443
121
0.594685
[ "MIT" ]
ConnectionMaster/Umbraco-CMS
src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs
13,133
C#
namespace Bitbucket.Net.Models.Core.Projects { public enum PullRequestFromTypes { Comment, Activity } }
14.777778
45
0.631579
[ "MIT" ]
ADHUI/Bitbucket.Net
src/Bitbucket.Net/Models/Core/Projects/PullRequestFromTypes.cs
135
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.DirectConnect { /// <summary> /// Provides a Direct Connect transit virtual interface resource. /// A transit virtual interface is a VLAN that transports traffic from a Direct Connect gateway to one or more transit gateways. /// /// ## Example Usage /// /// ```csharp /// using Pulumi; /// using Aws = Pulumi.Aws; /// /// class MyStack : Stack /// { /// public MyStack() /// { /// var exampleGateway = new Aws.DirectConnect.Gateway("exampleGateway", new Aws.DirectConnect.GatewayArgs /// { /// AmazonSideAsn = "64512", /// }); /// var exampleTransitVirtualInterface = new Aws.DirectConnect.TransitVirtualInterface("exampleTransitVirtualInterface", new Aws.DirectConnect.TransitVirtualInterfaceArgs /// { /// ConnectionId = aws_dx_connection.Example.Id, /// DxGatewayId = exampleGateway.Id, /// Vlan = 4094, /// AddressFamily = "ipv4", /// BgpAsn = 65352, /// }); /// } /// /// } /// ``` /// /// ## Import /// /// Direct Connect transit virtual interfaces can be imported using the `vif id`, e.g., /// /// ```sh /// $ pulumi import aws:directconnect/transitVirtualInterface:TransitVirtualInterface test dxvif-33cc44dd /// ``` /// </summary> [AwsResourceType("aws:directconnect/transitVirtualInterface:TransitVirtualInterface")] public partial class TransitVirtualInterface : Pulumi.CustomResource { /// <summary> /// The address family for the BGP peer. `ipv4 ` or `ipv6`. /// </summary> [Output("addressFamily")] public Output<string> AddressFamily { get; private set; } = null!; /// <summary> /// The IPv4 CIDR address to use to send traffic to Amazon. Required for IPv4 BGP peers. /// </summary> [Output("amazonAddress")] public Output<string> AmazonAddress { get; private set; } = null!; [Output("amazonSideAsn")] public Output<string> AmazonSideAsn { get; private set; } = null!; /// <summary> /// The ARN of the virtual interface. /// </summary> [Output("arn")] public Output<string> Arn { get; private set; } = null!; /// <summary> /// The Direct Connect endpoint on which the virtual interface terminates. /// </summary> [Output("awsDevice")] public Output<string> AwsDevice { get; private set; } = null!; /// <summary> /// The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. /// </summary> [Output("bgpAsn")] public Output<int> BgpAsn { get; private set; } = null!; /// <summary> /// The authentication key for BGP configuration. /// </summary> [Output("bgpAuthKey")] public Output<string> BgpAuthKey { get; private set; } = null!; /// <summary> /// The ID of the Direct Connect connection (or LAG) on which to create the virtual interface. /// </summary> [Output("connectionId")] public Output<string> ConnectionId { get; private set; } = null!; /// <summary> /// The IPv4 CIDR destination address to which Amazon should send traffic. Required for IPv4 BGP peers. /// </summary> [Output("customerAddress")] public Output<string> CustomerAddress { get; private set; } = null!; /// <summary> /// The ID of the Direct Connect gateway to which to connect the virtual interface. /// </summary> [Output("dxGatewayId")] public Output<string> DxGatewayId { get; private set; } = null!; /// <summary> /// Indicates whether jumbo frames (8500 MTU) are supported. /// </summary> [Output("jumboFrameCapable")] public Output<bool> JumboFrameCapable { get; private set; } = null!; /// <summary> /// The maximum transmission unit (MTU) is the size, in bytes, of the largest permissible packet that can be passed over the connection. /// The MTU of a virtual transit interface can be either `1500` or `8500` (jumbo frames). Default is `1500`. /// </summary> [Output("mtu")] public Output<int?> Mtu { get; private set; } = null!; /// <summary> /// The name for the virtual interface. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. /// </summary> [Output("tags")] public Output<ImmutableDictionary<string, string>?> Tags { get; private set; } = null!; /// <summary> /// A map of tags assigned to the resource, including those inherited from the provider . /// </summary> [Output("tagsAll")] public Output<ImmutableDictionary<string, string>> TagsAll { get; private set; } = null!; /// <summary> /// The VLAN ID. /// </summary> [Output("vlan")] public Output<int> Vlan { get; private set; } = null!; /// <summary> /// Create a TransitVirtualInterface resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public TransitVirtualInterface(string name, TransitVirtualInterfaceArgs args, CustomResourceOptions? options = null) : base("aws:directconnect/transitVirtualInterface:TransitVirtualInterface", name, args ?? new TransitVirtualInterfaceArgs(), MakeResourceOptions(options, "")) { } private TransitVirtualInterface(string name, Input<string> id, TransitVirtualInterfaceState? state = null, CustomResourceOptions? options = null) : base("aws:directconnect/transitVirtualInterface:TransitVirtualInterface", name, state, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing TransitVirtualInterface resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="state">Any extra arguments used during the lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static TransitVirtualInterface Get(string name, Input<string> id, TransitVirtualInterfaceState? state = null, CustomResourceOptions? options = null) { return new TransitVirtualInterface(name, id, state, options); } } public sealed class TransitVirtualInterfaceArgs : Pulumi.ResourceArgs { /// <summary> /// The address family for the BGP peer. `ipv4 ` or `ipv6`. /// </summary> [Input("addressFamily", required: true)] public Input<string> AddressFamily { get; set; } = null!; /// <summary> /// The IPv4 CIDR address to use to send traffic to Amazon. Required for IPv4 BGP peers. /// </summary> [Input("amazonAddress")] public Input<string>? AmazonAddress { get; set; } /// <summary> /// The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. /// </summary> [Input("bgpAsn", required: true)] public Input<int> BgpAsn { get; set; } = null!; /// <summary> /// The authentication key for BGP configuration. /// </summary> [Input("bgpAuthKey")] public Input<string>? BgpAuthKey { get; set; } /// <summary> /// The ID of the Direct Connect connection (or LAG) on which to create the virtual interface. /// </summary> [Input("connectionId", required: true)] public Input<string> ConnectionId { get; set; } = null!; /// <summary> /// The IPv4 CIDR destination address to which Amazon should send traffic. Required for IPv4 BGP peers. /// </summary> [Input("customerAddress")] public Input<string>? CustomerAddress { get; set; } /// <summary> /// The ID of the Direct Connect gateway to which to connect the virtual interface. /// </summary> [Input("dxGatewayId", required: true)] public Input<string> DxGatewayId { get; set; } = null!; /// <summary> /// The maximum transmission unit (MTU) is the size, in bytes, of the largest permissible packet that can be passed over the connection. /// The MTU of a virtual transit interface can be either `1500` or `8500` (jumbo frames). Default is `1500`. /// </summary> [Input("mtu")] public Input<int>? Mtu { get; set; } /// <summary> /// The name for the virtual interface. /// </summary> [Input("name")] public Input<string>? Name { get; set; } [Input("tags")] private InputMap<string>? _tags; /// <summary> /// A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. /// </summary> public InputMap<string> Tags { get => _tags ?? (_tags = new InputMap<string>()); set => _tags = value; } /// <summary> /// The VLAN ID. /// </summary> [Input("vlan", required: true)] public Input<int> Vlan { get; set; } = null!; public TransitVirtualInterfaceArgs() { } } public sealed class TransitVirtualInterfaceState : Pulumi.ResourceArgs { /// <summary> /// The address family for the BGP peer. `ipv4 ` or `ipv6`. /// </summary> [Input("addressFamily")] public Input<string>? AddressFamily { get; set; } /// <summary> /// The IPv4 CIDR address to use to send traffic to Amazon. Required for IPv4 BGP peers. /// </summary> [Input("amazonAddress")] public Input<string>? AmazonAddress { get; set; } [Input("amazonSideAsn")] public Input<string>? AmazonSideAsn { get; set; } /// <summary> /// The ARN of the virtual interface. /// </summary> [Input("arn")] public Input<string>? Arn { get; set; } /// <summary> /// The Direct Connect endpoint on which the virtual interface terminates. /// </summary> [Input("awsDevice")] public Input<string>? AwsDevice { get; set; } /// <summary> /// The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. /// </summary> [Input("bgpAsn")] public Input<int>? BgpAsn { get; set; } /// <summary> /// The authentication key for BGP configuration. /// </summary> [Input("bgpAuthKey")] public Input<string>? BgpAuthKey { get; set; } /// <summary> /// The ID of the Direct Connect connection (or LAG) on which to create the virtual interface. /// </summary> [Input("connectionId")] public Input<string>? ConnectionId { get; set; } /// <summary> /// The IPv4 CIDR destination address to which Amazon should send traffic. Required for IPv4 BGP peers. /// </summary> [Input("customerAddress")] public Input<string>? CustomerAddress { get; set; } /// <summary> /// The ID of the Direct Connect gateway to which to connect the virtual interface. /// </summary> [Input("dxGatewayId")] public Input<string>? DxGatewayId { get; set; } /// <summary> /// Indicates whether jumbo frames (8500 MTU) are supported. /// </summary> [Input("jumboFrameCapable")] public Input<bool>? JumboFrameCapable { get; set; } /// <summary> /// The maximum transmission unit (MTU) is the size, in bytes, of the largest permissible packet that can be passed over the connection. /// The MTU of a virtual transit interface can be either `1500` or `8500` (jumbo frames). Default is `1500`. /// </summary> [Input("mtu")] public Input<int>? Mtu { get; set; } /// <summary> /// The name for the virtual interface. /// </summary> [Input("name")] public Input<string>? Name { get; set; } [Input("tags")] private InputMap<string>? _tags; /// <summary> /// A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. /// </summary> public InputMap<string> Tags { get => _tags ?? (_tags = new InputMap<string>()); set => _tags = value; } [Input("tagsAll")] private InputMap<string>? _tagsAll; /// <summary> /// A map of tags assigned to the resource, including those inherited from the provider . /// </summary> public InputMap<string> TagsAll { get => _tagsAll ?? (_tagsAll = new InputMap<string>()); set => _tagsAll = value; } /// <summary> /// The VLAN ID. /// </summary> [Input("vlan")] public Input<int>? Vlan { get; set; } public TransitVirtualInterfaceState() { } } }
39.145455
203
0.585893
[ "ECL-2.0", "Apache-2.0" ]
RafalSumislawski/pulumi-aws
sdk/dotnet/DirectConnect/TransitVirtualInterface.cs
15,071
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { //code was edited remotely //vs update //code to call feature1 //code to call feature 3 } } }
17.666667
39
0.58221
[ "MIT" ]
4thworldsoldier/Gitest
ConsoleApp1/ConsoleApp1/Program.cs
373
C#
using Excalibur.Cross.ViewModels; using System; namespace MyThaiStar.Core.ViewModels { public class BookTableViewModel : BaseViewModel { #region private private DateTime _startDate; private DateTime _minStartDate; private DateTime _bookingTime; private int _assistants; #endregion #region public public DateTime StartDate { get => _startDate; set => SetProperty(ref _startDate, value); } public DateTime BookingTime { get => _bookingTime; set => SetProperty(ref _bookingTime, value); } public DateTime MinStartDate { get => DateTime.Today; } public int Assistants { get => _assistants; set => SetProperty(ref _assistants, value); } #endregion } }
20.911111
56
0.540914
[ "Apache-2.0" ]
devonfw/devon4x
Samples/Standard/MyThaiStar/Excalibur/Excalibur/ViewModels/BookTableViewModel.cs
943
C#
using System; using System.Collections.Generic; using System.Text; #if IOS || MACCATALYST using PlatformView = UIKit.UIMenu; #elif MONOANDROID using PlatformView = Android.Views.View; #elif WINDOWS using PlatformView = Microsoft.UI.Xaml.Controls.MenuFlyoutSubItem; #elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID) using PlatformView = System.Object; #endif namespace Microsoft.Maui.Handlers { public partial class MenuFlyoutSubItemHandler : ElementHandler<IMenuFlyoutSubItem, PlatformView>, IMenuFlyoutSubItemHandler { public static IPropertyMapper<IMenuFlyoutSubItem, IMenuFlyoutSubItemHandler> Mapper = new PropertyMapper<IMenuFlyoutSubItem, IMenuFlyoutSubItemHandler>(ElementMapper) { #if WINDOWS [nameof(IMenuFlyoutSubItem.Text)] = MapText, [nameof(IMenuFlyoutSubItem.Source)] = MapSource #endif }; public static CommandMapper<IMenuFlyoutSubItem, IMenuFlyoutSubItemHandler> CommandMapper = new(ElementCommandMapper) { [nameof(IMenuFlyoutSubItemHandler.Add)] = MapAdd, [nameof(IMenuFlyoutSubItemHandler.Remove)] = MapRemove, [nameof(IMenuFlyoutSubItemHandler.Clear)] = MapClear, [nameof(IMenuFlyoutSubItemHandler.Insert)] = MapInsert, }; public MenuFlyoutSubItemHandler() : this(Mapper, CommandMapper) { } public MenuFlyoutSubItemHandler(IPropertyMapper mapper, CommandMapper? commandMapper = null) : base(mapper, commandMapper) { } public static void MapAdd(IMenuFlyoutSubItemHandler handler, IMenuElement layout, object? arg) { if (arg is MenuFlyoutSubItemHandlerUpdate args) { handler.Add(args.MenuElement); } } public static void MapRemove(IMenuFlyoutSubItemHandler handler, IMenuElement layout, object? arg) { if (arg is MenuFlyoutSubItemHandlerUpdate args) { handler.Remove(args.MenuElement); } } public static void MapInsert(IMenuFlyoutSubItemHandler handler, IMenuElement layout, object? arg) { if (arg is MenuFlyoutSubItemHandlerUpdate args) { handler.Insert(args.Index, args.MenuElement); } } public static void MapClear(IMenuFlyoutSubItemHandler handler, IMenuElement layout, object? arg) { handler.Clear(); } IMenuFlyoutSubItem IMenuFlyoutSubItemHandler.VirtualView => VirtualView; PlatformView IMenuFlyoutSubItemHandler.PlatformView => PlatformView; private protected override void OnDisconnectHandler(object platformView) { base.OnDisconnectHandler(platformView); foreach (var item in VirtualView) item?.Handler?.DisconnectHandler(); } } }
29.116279
168
0.771965
[ "MIT" ]
GabrieleMessina/maui
src/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.cs
2,506
C#
namespace CoAPnet.Client { public enum CoapResponseStatusCode { Empty = 0, Created = 201, Deleted = 202, Valid = 203, Changed = 204, Content = 205, BadRequest = 400, Unauthorized = 401, BadOption = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, PreconditionFailed = 412, RequestEntityTooLarge = 413, UnsupportedContentFormat = 415, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, ProxyingNotSupported = 505 } }
21.424242
39
0.553041
[ "MIT" ]
SeppPenner/CoAPnet
Source/CoAPnet/Client/CoapResponseStatusCode.cs
709
C#
namespace IupMetadata { public enum NumberedAttribute : int { No = 0, OneID = 1, TwoIDs = 2 } }
11.666667
36
0.628571
[ "Unlicense" ]
batiati/IUPMetadata
src/IupMetadata/NumberedAttribute.cs
107
C#
#if (UNITY_STANDALONE_WIN && !UNITY_EDITOR) || UNITY_EDITOR_WIN //------------------------------------------------------------------------------ // <auto-generated /> // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ class AkSoundEnginePINVOKE { static AkSoundEnginePINVOKE() { } [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_SOUNDBANK_VERSION_get")] public static extern uint CSharp_AK_SOUNDBANK_VERSION_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioSettings_uNumSamplesPerFrame_set")] public static extern void CSharp_AkAudioSettings_uNumSamplesPerFrame_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioSettings_uNumSamplesPerFrame_get")] public static extern uint CSharp_AkAudioSettings_uNumSamplesPerFrame_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioSettings_uNumSamplesPerSecond_set")] public static extern void CSharp_AkAudioSettings_uNumSamplesPerSecond_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioSettings_uNumSamplesPerSecond_get")] public static extern uint CSharp_AkAudioSettings_uNumSamplesPerSecond_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkAudioSettings")] public static extern global::System.IntPtr CSharp_new_AkAudioSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkAudioSettings")] public static extern void CSharp_delete_AkAudioSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_Zero")] public static extern void CSharp_AkVector_Zero(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_X_set")] public static extern void CSharp_AkVector_X_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_X_get")] public static extern float CSharp_AkVector_X_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_Y_set")] public static extern void CSharp_AkVector_Y_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_Y_get")] public static extern float CSharp_AkVector_Y_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_Z_set")] public static extern void CSharp_AkVector_Z_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVector_Z_get")] public static extern float CSharp_AkVector_Z_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkVector")] public static extern global::System.IntPtr CSharp_new_AkVector(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkVector")] public static extern void CSharp_delete_AkVector(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_Position")] public static extern global::System.IntPtr CSharp_AkTransform_Position(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_OrientationFront")] public static extern global::System.IntPtr CSharp_AkTransform_OrientationFront(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_OrientationTop")] public static extern global::System.IntPtr CSharp_AkTransform_OrientationTop(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_Set__SWIG_0")] public static extern void CSharp_AkTransform_Set__SWIG_0(global::System.IntPtr jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_Set__SWIG_1")] public static extern void CSharp_AkTransform_Set__SWIG_1(global::System.IntPtr jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_SetPosition__SWIG_0")] public static extern void CSharp_AkTransform_SetPosition__SWIG_0(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_SetPosition__SWIG_1")] public static extern void CSharp_AkTransform_SetPosition__SWIG_1(global::System.IntPtr jarg1, float jarg2, float jarg3, float jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_SetOrientation__SWIG_0")] public static extern void CSharp_AkTransform_SetOrientation__SWIG_0(global::System.IntPtr jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTransform_SetOrientation__SWIG_1")] public static extern void CSharp_AkTransform_SetOrientation__SWIG_1(global::System.IntPtr jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkTransform")] public static extern global::System.IntPtr CSharp_new_AkTransform(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkTransform")] public static extern void CSharp_delete_AkTransform(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_occlusion_set")] public static extern void CSharp_AkObstructionOcclusionValues_occlusion_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_occlusion_get")] public static extern float CSharp_AkObstructionOcclusionValues_occlusion_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_obstruction_set")] public static extern void CSharp_AkObstructionOcclusionValues_obstruction_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_obstruction_get")] public static extern float CSharp_AkObstructionOcclusionValues_obstruction_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_Clear")] public static extern void CSharp_AkObstructionOcclusionValues_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_GetSizeOf")] public static extern int CSharp_AkObstructionOcclusionValues_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObstructionOcclusionValues_Clone")] public static extern void CSharp_AkObstructionOcclusionValues_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkObstructionOcclusionValues")] public static extern global::System.IntPtr CSharp_new_AkObstructionOcclusionValues(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkObstructionOcclusionValues")] public static extern void CSharp_delete_AkObstructionOcclusionValues(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelEmitter_position_set")] public static extern void CSharp_AkChannelEmitter_position_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelEmitter_position_get")] public static extern global::System.IntPtr CSharp_AkChannelEmitter_position_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelEmitter_uInputChannels_set")] public static extern void CSharp_AkChannelEmitter_uInputChannels_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelEmitter_uInputChannels_get")] public static extern uint CSharp_AkChannelEmitter_uInputChannels_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkChannelEmitter")] public static extern void CSharp_delete_AkChannelEmitter(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_listenerID_set")] public static extern void CSharp_AkAuxSendValue_listenerID_set(global::System.IntPtr jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_listenerID_get")] public static extern ulong CSharp_AkAuxSendValue_listenerID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_auxBusID_set")] public static extern void CSharp_AkAuxSendValue_auxBusID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_auxBusID_get")] public static extern uint CSharp_AkAuxSendValue_auxBusID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_fControlValue_set")] public static extern void CSharp_AkAuxSendValue_fControlValue_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_fControlValue_get")] public static extern float CSharp_AkAuxSendValue_fControlValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_Set")] public static extern void CSharp_AkAuxSendValue_Set(global::System.IntPtr jarg1, ulong jarg2, uint jarg3, float jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_IsSame")] public static extern bool CSharp_AkAuxSendValue_IsSame(global::System.IntPtr jarg1, ulong jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAuxSendValue_GetSizeOf")] public static extern int CSharp_AkAuxSendValue_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkAuxSendValue")] public static extern void CSharp_delete_AkAuxSendValue(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkRamp__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkRamp__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkRamp__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkRamp__SWIG_1(float jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRamp_fPrev_set")] public static extern void CSharp_AkRamp_fPrev_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRamp_fPrev_get")] public static extern float CSharp_AkRamp_fPrev_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRamp_fNext_set")] public static extern void CSharp_AkRamp_fNext_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRamp_fNext_get")] public static extern float CSharp_AkRamp_fNext_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkRamp")] public static extern void CSharp_delete_AkRamp(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_INT_get")] public static extern ushort CSharp_AK_INT_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_FLOAT_get")] public static extern ushort CSharp_AK_FLOAT_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_INTERLEAVED_get")] public static extern byte CSharp_AK_INTERLEAVED_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_NONINTERLEAVED_get")] public static extern byte CSharp_AK_NONINTERLEAVED_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_LE_NATIVE_BITSPERSAMPLE_get")] public static extern uint CSharp_AK_LE_NATIVE_BITSPERSAMPLE_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_LE_NATIVE_SAMPLETYPE_get")] public static extern uint CSharp_AK_LE_NATIVE_SAMPLETYPE_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_LE_NATIVE_INTERLEAVE_get")] public static extern uint CSharp_AK_LE_NATIVE_INTERLEAVE_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uSampleRate_set")] public static extern void CSharp_AkAudioFormat_uSampleRate_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uSampleRate_get")] public static extern uint CSharp_AkAudioFormat_uSampleRate_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_channelConfig_set")] public static extern void CSharp_AkAudioFormat_channelConfig_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_channelConfig_get")] public static extern global::System.IntPtr CSharp_AkAudioFormat_channelConfig_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uBitsPerSample_set")] public static extern void CSharp_AkAudioFormat_uBitsPerSample_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uBitsPerSample_get")] public static extern uint CSharp_AkAudioFormat_uBitsPerSample_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uBlockAlign_set")] public static extern void CSharp_AkAudioFormat_uBlockAlign_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uBlockAlign_get")] public static extern uint CSharp_AkAudioFormat_uBlockAlign_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uTypeID_set")] public static extern void CSharp_AkAudioFormat_uTypeID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uTypeID_get")] public static extern uint CSharp_AkAudioFormat_uTypeID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uInterleaveID_set")] public static extern void CSharp_AkAudioFormat_uInterleaveID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_uInterleaveID_get")] public static extern uint CSharp_AkAudioFormat_uInterleaveID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_GetNumChannels")] public static extern uint CSharp_AkAudioFormat_GetNumChannels(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_GetBitsPerSample")] public static extern uint CSharp_AkAudioFormat_GetBitsPerSample(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_GetBlockAlign")] public static extern uint CSharp_AkAudioFormat_GetBlockAlign(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_GetTypeID")] public static extern uint CSharp_AkAudioFormat_GetTypeID(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_GetInterleaveID")] public static extern uint CSharp_AkAudioFormat_GetInterleaveID(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_SetAll")] public static extern void CSharp_AkAudioFormat_SetAll(global::System.IntPtr jarg1, uint jarg2, global::System.IntPtr jarg3, uint jarg4, uint jarg5, uint jarg6, uint jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioFormat_IsChannelConfigSupported")] public static extern bool CSharp_AkAudioFormat_IsChannelConfigSupported(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkAudioFormat")] public static extern global::System.IntPtr CSharp_new_AkAudioFormat(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkAudioFormat")] public static extern void CSharp_delete_AkAudioFormat(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_pItem_set")] public static extern void CSharp_AkIterator_pItem_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_pItem_get")] public static extern global::System.IntPtr CSharp_AkIterator_pItem_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_NextIter")] public static extern global::System.IntPtr CSharp_AkIterator_NextIter(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_PrevIter")] public static extern global::System.IntPtr CSharp_AkIterator_PrevIter(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_GetItem")] public static extern global::System.IntPtr CSharp_AkIterator_GetItem(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_IsEqualTo")] public static extern bool CSharp_AkIterator_IsEqualTo(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkIterator_IsDifferentFrom")] public static extern bool CSharp_AkIterator_IsDifferentFrom(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkIterator")] public static extern global::System.IntPtr CSharp_new_AkIterator(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkIterator")] public static extern void CSharp_delete_AkIterator(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp__ArrayPoolDefault_Get")] public static extern int CSharp__ArrayPoolDefault_Get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new__ArrayPoolDefault")] public static extern global::System.IntPtr CSharp_new__ArrayPoolDefault(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete__ArrayPoolDefault")] public static extern void CSharp_delete__ArrayPoolDefault(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp__ArrayPoolLEngineDefault_Get")] public static extern int CSharp__ArrayPoolLEngineDefault_Get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new__ArrayPoolLEngineDefault")] public static extern global::System.IntPtr CSharp_new__ArrayPoolLEngineDefault(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete__ArrayPoolLEngineDefault")] public static extern void CSharp_delete__ArrayPoolLEngineDefault(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPlaylistItem__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkPlaylistItem__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPlaylistItem__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkPlaylistItem__SWIG_1(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkPlaylistItem")] public static extern void CSharp_delete_AkPlaylistItem(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_Assign")] public static extern global::System.IntPtr CSharp_AkPlaylistItem_Assign(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_IsEqualTo")] public static extern bool CSharp_AkPlaylistItem_IsEqualTo(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_SetExternalSources")] public static extern int CSharp_AkPlaylistItem_SetExternalSources(global::System.IntPtr jarg1, uint jarg2, global::System.IntPtr jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_audioNodeID_set")] public static extern void CSharp_AkPlaylistItem_audioNodeID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_audioNodeID_get")] public static extern uint CSharp_AkPlaylistItem_audioNodeID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_msDelay_set")] public static extern void CSharp_AkPlaylistItem_msDelay_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_msDelay_get")] public static extern int CSharp_AkPlaylistItem_msDelay_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_pCustomInfo_set")] public static extern void CSharp_AkPlaylistItem_pCustomInfo_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistItem_pCustomInfo_get")] public static extern global::System.IntPtr CSharp_AkPlaylistItem_pCustomInfo_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPlaylistArray")] public static extern global::System.IntPtr CSharp_new_AkPlaylistArray(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkPlaylistArray")] public static extern void CSharp_delete_AkPlaylistArray(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Begin")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_Begin(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_End")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_End(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_FindEx")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_FindEx(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Erase__SWIG_0")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_Erase__SWIG_0(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Erase__SWIG_1")] public static extern void CSharp_AkPlaylistArray_Erase__SWIG_1(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_EraseSwap")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_EraseSwap(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Reserve")] public static extern int CSharp_AkPlaylistArray_Reserve(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Reserved")] public static extern uint CSharp_AkPlaylistArray_Reserved(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Term")] public static extern void CSharp_AkPlaylistArray_Term(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Length")] public static extern uint CSharp_AkPlaylistArray_Length(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Data")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_Data(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_IsEmpty")] public static extern bool CSharp_AkPlaylistArray_IsEmpty(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Exists")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_Exists(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_AddLast__SWIG_0")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_AddLast__SWIG_0(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_AddLast__SWIG_1")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_AddLast__SWIG_1(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Last")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_Last(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_RemoveLast")] public static extern void CSharp_AkPlaylistArray_RemoveLast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Remove")] public static extern int CSharp_AkPlaylistArray_Remove(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_RemoveSwap")] public static extern int CSharp_AkPlaylistArray_RemoveSwap(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_RemoveAll")] public static extern void CSharp_AkPlaylistArray_RemoveAll(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_ItemAtIndex")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_ItemAtIndex(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Insert")] public static extern global::System.IntPtr CSharp_AkPlaylistArray_Insert(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_GrowArray__SWIG_0")] public static extern bool CSharp_AkPlaylistArray_GrowArray__SWIG_0(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_GrowArray__SWIG_1")] public static extern bool CSharp_AkPlaylistArray_GrowArray__SWIG_1(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Resize")] public static extern bool CSharp_AkPlaylistArray_Resize(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Transfer")] public static extern void CSharp_AkPlaylistArray_Transfer(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylistArray_Copy")] public static extern int CSharp_AkPlaylistArray_Copy(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylist_Enqueue__SWIG_0")] public static extern int CSharp_AkPlaylist_Enqueue__SWIG_0(global::System.IntPtr jarg1, uint jarg2, int jarg3, global::System.IntPtr jarg4, uint jarg5, global::System.IntPtr jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylist_Enqueue__SWIG_1")] public static extern int CSharp_AkPlaylist_Enqueue__SWIG_1(global::System.IntPtr jarg1, uint jarg2, int jarg3, global::System.IntPtr jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylist_Enqueue__SWIG_2")] public static extern int CSharp_AkPlaylist_Enqueue__SWIG_2(global::System.IntPtr jarg1, uint jarg2, int jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylist_Enqueue__SWIG_3")] public static extern int CSharp_AkPlaylist_Enqueue__SWIG_3(global::System.IntPtr jarg1, uint jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylist_Enqueue__SWIG_4")] public static extern int CSharp_AkPlaylist_Enqueue__SWIG_4(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPlaylist")] public static extern global::System.IntPtr CSharp_new_AkPlaylist(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkPlaylist")] public static extern void CSharp_delete_AkPlaylist(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceOpen__SWIG_0")] public static extern uint CSharp_DynamicSequenceOpen__SWIG_0(ulong jarg1, uint jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceOpen__SWIG_1")] public static extern uint CSharp_DynamicSequenceOpen__SWIG_1(ulong jarg1, uint jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceOpen__SWIG_2")] public static extern uint CSharp_DynamicSequenceOpen__SWIG_2(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceClose")] public static extern int CSharp_DynamicSequenceClose(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequencePlay__SWIG_0")] public static extern int CSharp_DynamicSequencePlay__SWIG_0(uint jarg1, int jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequencePlay__SWIG_1")] public static extern int CSharp_DynamicSequencePlay__SWIG_1(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequencePlay__SWIG_2")] public static extern int CSharp_DynamicSequencePlay__SWIG_2(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequencePause__SWIG_0")] public static extern int CSharp_DynamicSequencePause__SWIG_0(uint jarg1, int jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequencePause__SWIG_1")] public static extern int CSharp_DynamicSequencePause__SWIG_1(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequencePause__SWIG_2")] public static extern int CSharp_DynamicSequencePause__SWIG_2(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceResume__SWIG_0")] public static extern int CSharp_DynamicSequenceResume__SWIG_0(uint jarg1, int jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceResume__SWIG_1")] public static extern int CSharp_DynamicSequenceResume__SWIG_1(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceResume__SWIG_2")] public static extern int CSharp_DynamicSequenceResume__SWIG_2(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceStop__SWIG_0")] public static extern int CSharp_DynamicSequenceStop__SWIG_0(uint jarg1, int jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceStop__SWIG_1")] public static extern int CSharp_DynamicSequenceStop__SWIG_1(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceStop__SWIG_2")] public static extern int CSharp_DynamicSequenceStop__SWIG_2(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceBreak")] public static extern int CSharp_DynamicSequenceBreak(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceGetPauseTimes")] public static extern int CSharp_DynamicSequenceGetPauseTimes(uint jarg1, out uint jarg2, out uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceLockPlaylist")] public static extern global::System.IntPtr CSharp_DynamicSequenceLockPlaylist(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_DynamicSequenceUnlockPlaylist")] public static extern int CSharp_DynamicSequenceUnlockPlaylist(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkOutputSettings__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkOutputSettings__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkOutputSettings__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkOutputSettings__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1, uint jarg2, global::System.IntPtr jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkOutputSettings__SWIG_2")] public static extern global::System.IntPtr CSharp_new_AkOutputSettings__SWIG_2([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1, uint jarg2, global::System.IntPtr jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkOutputSettings__SWIG_3")] public static extern global::System.IntPtr CSharp_new_AkOutputSettings__SWIG_3([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkOutputSettings__SWIG_4")] public static extern global::System.IntPtr CSharp_new_AkOutputSettings__SWIG_4([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_audioDeviceShareset_set")] public static extern void CSharp_AkOutputSettings_audioDeviceShareset_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_audioDeviceShareset_get")] public static extern uint CSharp_AkOutputSettings_audioDeviceShareset_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_idDevice_set")] public static extern void CSharp_AkOutputSettings_idDevice_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_idDevice_get")] public static extern uint CSharp_AkOutputSettings_idDevice_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_ePanningRule_set")] public static extern void CSharp_AkOutputSettings_ePanningRule_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_ePanningRule_get")] public static extern int CSharp_AkOutputSettings_ePanningRule_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_channelConfig_set")] public static extern void CSharp_AkOutputSettings_channelConfig_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkOutputSettings_channelConfig_get")] public static extern global::System.IntPtr CSharp_AkOutputSettings_channelConfig_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkOutputSettings")] public static extern void CSharp_delete_AkOutputSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTaskContext_uIdxThread_set")] public static extern void CSharp_AkTaskContext_uIdxThread_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTaskContext_uIdxThread_get")] public static extern uint CSharp_AkTaskContext_uIdxThread_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkTaskContext")] public static extern global::System.IntPtr CSharp_new_AkTaskContext(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkTaskContext")] public static extern void CSharp_delete_AkTaskContext(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMaxNumPaths_set")] public static extern void CSharp_AkInitSettings_uMaxNumPaths_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMaxNumPaths_get")] public static extern uint CSharp_AkInitSettings_uMaxNumPaths_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uDefaultPoolSize_set")] public static extern void CSharp_AkInitSettings_uDefaultPoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uDefaultPoolSize_get")] public static extern uint CSharp_AkInitSettings_uDefaultPoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_fDefaultPoolRatioThreshold_set")] public static extern void CSharp_AkInitSettings_fDefaultPoolRatioThreshold_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_fDefaultPoolRatioThreshold_get")] public static extern float CSharp_AkInitSettings_fDefaultPoolRatioThreshold_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uCommandQueueSize_set")] public static extern void CSharp_AkInitSettings_uCommandQueueSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uCommandQueueSize_get")] public static extern uint CSharp_AkInitSettings_uCommandQueueSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uPrepareEventMemoryPoolID_set")] public static extern void CSharp_AkInitSettings_uPrepareEventMemoryPoolID_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uPrepareEventMemoryPoolID_get")] public static extern int CSharp_AkInitSettings_uPrepareEventMemoryPoolID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bEnableGameSyncPreparation_set")] public static extern void CSharp_AkInitSettings_bEnableGameSyncPreparation_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bEnableGameSyncPreparation_get")] public static extern bool CSharp_AkInitSettings_bEnableGameSyncPreparation_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uContinuousPlaybackLookAhead_set")] public static extern void CSharp_AkInitSettings_uContinuousPlaybackLookAhead_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uContinuousPlaybackLookAhead_get")] public static extern uint CSharp_AkInitSettings_uContinuousPlaybackLookAhead_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uNumSamplesPerFrame_set")] public static extern void CSharp_AkInitSettings_uNumSamplesPerFrame_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uNumSamplesPerFrame_get")] public static extern uint CSharp_AkInitSettings_uNumSamplesPerFrame_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMonitorPoolSize_set")] public static extern void CSharp_AkInitSettings_uMonitorPoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMonitorPoolSize_get")] public static extern uint CSharp_AkInitSettings_uMonitorPoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMonitorQueuePoolSize_set")] public static extern void CSharp_AkInitSettings_uMonitorQueuePoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMonitorQueuePoolSize_get")] public static extern uint CSharp_AkInitSettings_uMonitorQueuePoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_settingsMainOutput_set")] public static extern void CSharp_AkInitSettings_settingsMainOutput_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_settingsMainOutput_get")] public static extern global::System.IntPtr CSharp_AkInitSettings_settingsMainOutput_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMaxHardwareTimeoutMs_set")] public static extern void CSharp_AkInitSettings_uMaxHardwareTimeoutMs_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_uMaxHardwareTimeoutMs_get")] public static extern uint CSharp_AkInitSettings_uMaxHardwareTimeoutMs_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bUseSoundBankMgrThread_set")] public static extern void CSharp_AkInitSettings_bUseSoundBankMgrThread_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bUseSoundBankMgrThread_get")] public static extern bool CSharp_AkInitSettings_bUseSoundBankMgrThread_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bUseLEngineThread_set")] public static extern void CSharp_AkInitSettings_bUseLEngineThread_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bUseLEngineThread_get")] public static extern bool CSharp_AkInitSettings_bUseLEngineThread_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_szPluginDLLPath_set")] public static extern void CSharp_AkInitSettings_szPluginDLLPath_set(global::System.IntPtr jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_szPluginDLLPath_get")] public static extern global::System.IntPtr CSharp_AkInitSettings_szPluginDLLPath_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_eFloorPlane_set")] public static extern void CSharp_AkInitSettings_eFloorPlane_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_eFloorPlane_get")] public static extern int CSharp_AkInitSettings_eFloorPlane_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_fDebugOutOfRangeLimit_set")] public static extern void CSharp_AkInitSettings_fDebugOutOfRangeLimit_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_fDebugOutOfRangeLimit_get")] public static extern float CSharp_AkInitSettings_fDebugOutOfRangeLimit_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bDebugOutOfRangeCheckEnabled_set")] public static extern void CSharp_AkInitSettings_bDebugOutOfRangeCheckEnabled_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitSettings_bDebugOutOfRangeCheckEnabled_get")] public static extern bool CSharp_AkInitSettings_bDebugOutOfRangeCheckEnabled_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkInitSettings")] public static extern global::System.IntPtr CSharp_new_AkInitSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkInitSettings")] public static extern void CSharp_delete_AkInitSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_sourceID_set")] public static extern void CSharp_AkSourceSettings_sourceID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_sourceID_get")] public static extern uint CSharp_AkSourceSettings_sourceID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_pMediaMemory_set")] public static extern void CSharp_AkSourceSettings_pMediaMemory_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_pMediaMemory_get")] public static extern global::System.IntPtr CSharp_AkSourceSettings_pMediaMemory_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_uMediaSize_set")] public static extern void CSharp_AkSourceSettings_uMediaSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_uMediaSize_get")] public static extern uint CSharp_AkSourceSettings_uMediaSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_Clear")] public static extern void CSharp_AkSourceSettings_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_GetSizeOf")] public static extern int CSharp_AkSourceSettings_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSourceSettings_Clone")] public static extern void CSharp_AkSourceSettings_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkSourceSettings")] public static extern global::System.IntPtr CSharp_new_AkSourceSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkSourceSettings")] public static extern void CSharp_delete_AkSourceSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_IsInitialized")] public static extern bool CSharp_IsInitialized(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetAudioSettings")] public static extern int CSharp_GetAudioSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSpeakerConfiguration__SWIG_0")] public static extern global::System.IntPtr CSharp_GetSpeakerConfiguration__SWIG_0(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSpeakerConfiguration__SWIG_1")] public static extern global::System.IntPtr CSharp_GetSpeakerConfiguration__SWIG_1(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPanningRule__SWIG_0")] public static extern int CSharp_GetPanningRule__SWIG_0(out int jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPanningRule__SWIG_1")] public static extern int CSharp_GetPanningRule__SWIG_1(out int jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetPanningRule__SWIG_0")] public static extern int CSharp_SetPanningRule__SWIG_0(int jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetPanningRule__SWIG_1")] public static extern int CSharp_SetPanningRule__SWIG_1(int jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSpeakerAngles__SWIG_0")] public static extern int CSharp_GetSpeakerAngles__SWIG_0([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1, ref uint jarg2, out float jarg3, ulong jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSpeakerAngles__SWIG_1")] public static extern int CSharp_GetSpeakerAngles__SWIG_1([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1, ref uint jarg2, out float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetSpeakerAngles__SWIG_0")] public static extern int CSharp_SetSpeakerAngles__SWIG_0([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1, uint jarg2, float jarg3, ulong jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetSpeakerAngles__SWIG_1")] public static extern int CSharp_SetSpeakerAngles__SWIG_1([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1, uint jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetVolumeThreshold")] public static extern int CSharp_SetVolumeThreshold(float jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMaxNumVoicesLimit")] public static extern int CSharp_SetMaxNumVoicesLimit(ushort jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RenderAudio__SWIG_0")] public static extern int CSharp_RenderAudio__SWIG_0(bool jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RenderAudio__SWIG_1")] public static extern int CSharp_RenderAudio__SWIG_1(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RegisterPluginDLL__SWIG_0")] public static extern int CSharp_RegisterPluginDLL__SWIG_0([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RegisterPluginDLL__SWIG_1")] public static extern int CSharp_RegisterPluginDLL__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetIDFromString__SWIG_0")] public static extern uint CSharp_GetIDFromString__SWIG_0([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_0")] public static extern uint CSharp_PostEvent__SWIG_0(uint jarg1, ulong jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5, uint jarg6, global::System.IntPtr jarg7, uint jarg8); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_1")] public static extern uint CSharp_PostEvent__SWIG_1(uint jarg1, ulong jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5, uint jarg6, global::System.IntPtr jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_2")] public static extern uint CSharp_PostEvent__SWIG_2(uint jarg1, ulong jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_3")] public static extern uint CSharp_PostEvent__SWIG_3(uint jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_4")] public static extern uint CSharp_PostEvent__SWIG_4([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5, uint jarg6, global::System.IntPtr jarg7, uint jarg8); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_5")] public static extern uint CSharp_PostEvent__SWIG_5([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5, uint jarg6, global::System.IntPtr jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_6")] public static extern uint CSharp_PostEvent__SWIG_6([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostEvent__SWIG_7")] public static extern uint CSharp_PostEvent__SWIG_7([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_0")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_0(uint jarg1, int jarg2, ulong jarg3, int jarg4, int jarg5, uint jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_1")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_1(uint jarg1, int jarg2, ulong jarg3, int jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_2")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_2(uint jarg1, int jarg2, ulong jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_3")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_3(uint jarg1, int jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_4")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_4(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_5")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_5([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, ulong jarg3, int jarg4, int jarg5, uint jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_6")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_6([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, ulong jarg3, int jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_7")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_7([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, ulong jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_8")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_8([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnEvent__SWIG_9")] public static extern int CSharp_ExecuteActionOnEvent__SWIG_9([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostMIDIOnEvent")] public static extern int CSharp_PostMIDIOnEvent(uint jarg1, ulong jarg2, global::System.IntPtr jarg3, ushort jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopMIDIOnEvent__SWIG_0")] public static extern int CSharp_StopMIDIOnEvent__SWIG_0(uint jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopMIDIOnEvent__SWIG_1")] public static extern int CSharp_StopMIDIOnEvent__SWIG_1(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopMIDIOnEvent__SWIG_2")] public static extern int CSharp_StopMIDIOnEvent__SWIG_2(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PinEventInStreamCache__SWIG_0")] public static extern int CSharp_PinEventInStreamCache__SWIG_0(uint jarg1, char jarg2, char jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PinEventInStreamCache__SWIG_1")] public static extern int CSharp_PinEventInStreamCache__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, char jarg2, char jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnpinEventInStreamCache__SWIG_0")] public static extern int CSharp_UnpinEventInStreamCache__SWIG_0(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnpinEventInStreamCache__SWIG_1")] public static extern int CSharp_UnpinEventInStreamCache__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetBufferStatusForPinnedEvent__SWIG_0")] public static extern int CSharp_GetBufferStatusForPinnedEvent__SWIG_0(uint jarg1, out float jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetBufferStatusForPinnedEvent__SWIG_1")] public static extern int CSharp_GetBufferStatusForPinnedEvent__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1, out float jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_0")] public static extern int CSharp_SeekOnEvent__SWIG_0(uint jarg1, ulong jarg2, int jarg3, bool jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_1")] public static extern int CSharp_SeekOnEvent__SWIG_1(uint jarg1, ulong jarg2, int jarg3, bool jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_2")] public static extern int CSharp_SeekOnEvent__SWIG_2(uint jarg1, ulong jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_3")] public static extern int CSharp_SeekOnEvent__SWIG_3([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, int jarg3, bool jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_4")] public static extern int CSharp_SeekOnEvent__SWIG_4([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, int jarg3, bool jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_5")] public static extern int CSharp_SeekOnEvent__SWIG_5([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_9")] public static extern int CSharp_SeekOnEvent__SWIG_9(uint jarg1, ulong jarg2, float jarg3, bool jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_10")] public static extern int CSharp_SeekOnEvent__SWIG_10(uint jarg1, ulong jarg2, float jarg3, bool jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_11")] public static extern int CSharp_SeekOnEvent__SWIG_11(uint jarg1, ulong jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_12")] public static extern int CSharp_SeekOnEvent__SWIG_12([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, float jarg3, bool jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_13")] public static extern int CSharp_SeekOnEvent__SWIG_13([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, float jarg3, bool jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SeekOnEvent__SWIG_14")] public static extern int CSharp_SeekOnEvent__SWIG_14([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_CancelEventCallbackCookie")] public static extern void CSharp_CancelEventCallbackCookie(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_CancelEventCallbackGameObject")] public static extern void CSharp_CancelEventCallbackGameObject(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_CancelEventCallback")] public static extern void CSharp_CancelEventCallback(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSourcePlayPosition__SWIG_0")] public static extern int CSharp_GetSourcePlayPosition__SWIG_0(uint jarg1, out int jarg2, bool jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSourcePlayPosition__SWIG_1")] public static extern int CSharp_GetSourcePlayPosition__SWIG_1(uint jarg1, out int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSourceStreamBuffering")] public static extern int CSharp_GetSourceStreamBuffering(uint jarg1, out int jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopAll__SWIG_0")] public static extern void CSharp_StopAll__SWIG_0(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopAll__SWIG_1")] public static extern void CSharp_StopAll__SWIG_1(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopPlayingID__SWIG_0")] public static extern void CSharp_StopPlayingID__SWIG_0(uint jarg1, int jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopPlayingID__SWIG_1")] public static extern void CSharp_StopPlayingID__SWIG_1(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopPlayingID__SWIG_2")] public static extern void CSharp_StopPlayingID__SWIG_2(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnPlayingID__SWIG_0")] public static extern void CSharp_ExecuteActionOnPlayingID__SWIG_0(int jarg1, uint jarg2, int jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnPlayingID__SWIG_1")] public static extern void CSharp_ExecuteActionOnPlayingID__SWIG_1(int jarg1, uint jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ExecuteActionOnPlayingID__SWIG_2")] public static extern void CSharp_ExecuteActionOnPlayingID__SWIG_2(int jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRandomSeed")] public static extern void CSharp_SetRandomSeed(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_MuteBackgroundMusic")] public static extern void CSharp_MuteBackgroundMusic(bool jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetBackgroundMusicMute")] public static extern bool CSharp_GetBackgroundMusicMute(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SendPluginCustomGameData")] public static extern int CSharp_SendPluginCustomGameData(uint jarg1, ulong jarg2, int jarg3, uint jarg4, uint jarg5, global::System.IntPtr jarg6, uint jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnregisterAllGameObj")] public static extern int CSharp_UnregisterAllGameObj(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMultiplePositions__SWIG_0")] public static extern int CSharp_SetMultiplePositions__SWIG_0(ulong jarg1, global::System.IntPtr jarg2, ushort jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMultiplePositions__SWIG_1")] public static extern int CSharp_SetMultiplePositions__SWIG_1(ulong jarg1, global::System.IntPtr jarg2, ushort jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMultiplePositions__SWIG_2")] public static extern int CSharp_SetMultiplePositions__SWIG_2(ulong jarg1, global::System.IntPtr jarg2, ushort jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMultiplePositions__SWIG_3")] public static extern int CSharp_SetMultiplePositions__SWIG_3(ulong jarg1, global::System.IntPtr jarg2, ushort jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetScalingFactor")] public static extern int CSharp_SetScalingFactor(ulong jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ClearBanks")] public static extern int CSharp_ClearBanks(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBankLoadIOSettings")] public static extern int CSharp_SetBankLoadIOSettings(float jarg1, char jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_0")] public static extern int CSharp_LoadBank__SWIG_0([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, out uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_1")] public static extern int CSharp_LoadBank__SWIG_1(uint jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_2")] public static extern int CSharp_LoadBank__SWIG_2(global::System.IntPtr jarg1, uint jarg2, out uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_3")] public static extern int CSharp_LoadBank__SWIG_3(global::System.IntPtr jarg1, uint jarg2, int jarg3, out uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_4")] public static extern int CSharp_LoadBank__SWIG_4([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, int jarg4, out uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_5")] public static extern int CSharp_LoadBank__SWIG_5(uint jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_6")] public static extern int CSharp_LoadBank__SWIG_6(global::System.IntPtr jarg1, uint jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4, out uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadBank__SWIG_7")] public static extern int CSharp_LoadBank__SWIG_7(global::System.IntPtr jarg1, uint jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4, int jarg5, out uint jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadBank__SWIG_0")] public static extern int CSharp_UnloadBank__SWIG_0([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, global::System.IntPtr jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadBank__SWIG_1")] public static extern int CSharp_UnloadBank__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadBank__SWIG_4")] public static extern int CSharp_UnloadBank__SWIG_4(uint jarg1, global::System.IntPtr jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadBank__SWIG_5")] public static extern int CSharp_UnloadBank__SWIG_5(uint jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadBank__SWIG_6")] public static extern int CSharp_UnloadBank__SWIG_6([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadBank__SWIG_8")] public static extern int CSharp_UnloadBank__SWIG_8(uint jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_CancelBankCallbackCookie")] public static extern void CSharp_CancelBankCallbackCookie(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_0")] public static extern int CSharp_PrepareBank__SWIG_0(int jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_1")] public static extern int CSharp_PrepareBank__SWIG_1(int jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_4")] public static extern int CSharp_PrepareBank__SWIG_4(int jarg1, uint jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_5")] public static extern int CSharp_PrepareBank__SWIG_5(int jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_6")] public static extern int CSharp_PrepareBank__SWIG_6(int jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_7")] public static extern int CSharp_PrepareBank__SWIG_7(int jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_10")] public static extern int CSharp_PrepareBank__SWIG_10(int jarg1, uint jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareBank__SWIG_11")] public static extern int CSharp_PrepareBank__SWIG_11(int jarg1, uint jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ClearPreparedEvents")] public static extern int CSharp_ClearPreparedEvents(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareEvent__SWIG_0")] public static extern int CSharp_PrepareEvent__SWIG_0(int jarg1, global::System.IntPtr jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareEvent__SWIG_1")] public static extern int CSharp_PrepareEvent__SWIG_1(int jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareEvent__SWIG_2")] public static extern int CSharp_PrepareEvent__SWIG_2(int jarg1, global::System.IntPtr jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareEvent__SWIG_3")] public static extern int CSharp_PrepareEvent__SWIG_3(int jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg2, uint jarg3, global::System.IntPtr jarg4, global::System.IntPtr jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMedia")] public static extern int CSharp_SetMedia(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnsetMedia")] public static extern int CSharp_UnsetMedia(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareGameSyncs__SWIG_0")] public static extern int CSharp_PrepareGameSyncs__SWIG_0(int jarg1, int jarg2, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg3, global::System.IntPtr jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareGameSyncs__SWIG_1")] public static extern int CSharp_PrepareGameSyncs__SWIG_1(int jarg1, int jarg2, uint jarg3, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareGameSyncs__SWIG_2")] public static extern int CSharp_PrepareGameSyncs__SWIG_2(int jarg1, int jarg2, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg3, global::System.IntPtr jarg4, uint jarg5, global::System.IntPtr jarg6, global::System.IntPtr jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PrepareGameSyncs__SWIG_3")] public static extern int CSharp_PrepareGameSyncs__SWIG_3(int jarg1, int jarg2, uint jarg3, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg4, uint jarg5, global::System.IntPtr jarg6, global::System.IntPtr jarg7); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AddListener")] public static extern int CSharp_AddListener(ulong jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveListener")] public static extern int CSharp_RemoveListener(ulong jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AddDefaultListener")] public static extern int CSharp_AddDefaultListener(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveDefaultListener")] public static extern int CSharp_RemoveDefaultListener(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetListenersToDefault")] public static extern int CSharp_ResetListenersToDefault(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetListenerSpatialization__SWIG_0")] public static extern int CSharp_SetListenerSpatialization__SWIG_0(ulong jarg1, bool jarg2, global::System.IntPtr jarg3, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetListenerSpatialization__SWIG_1")] public static extern int CSharp_SetListenerSpatialization__SWIG_1(ulong jarg1, bool jarg2, global::System.IntPtr jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_0")] public static extern int CSharp_SetRTPCValue__SWIG_0(uint jarg1, float jarg2, ulong jarg3, int jarg4, int jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_1")] public static extern int CSharp_SetRTPCValue__SWIG_1(uint jarg1, float jarg2, ulong jarg3, int jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_2")] public static extern int CSharp_SetRTPCValue__SWIG_2(uint jarg1, float jarg2, ulong jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_3")] public static extern int CSharp_SetRTPCValue__SWIG_3(uint jarg1, float jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_4")] public static extern int CSharp_SetRTPCValue__SWIG_4(uint jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_5")] public static extern int CSharp_SetRTPCValue__SWIG_5([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, ulong jarg3, int jarg4, int jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_6")] public static extern int CSharp_SetRTPCValue__SWIG_6([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, ulong jarg3, int jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_7")] public static extern int CSharp_SetRTPCValue__SWIG_7([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, ulong jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_8")] public static extern int CSharp_SetRTPCValue__SWIG_8([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValue__SWIG_9")] public static extern int CSharp_SetRTPCValue__SWIG_9([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_0")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_0(uint jarg1, float jarg2, uint jarg3, int jarg4, int jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_1")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_1(uint jarg1, float jarg2, uint jarg3, int jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_2")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_2(uint jarg1, float jarg2, uint jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_3")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_3(uint jarg1, float jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_4")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_4([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3, int jarg4, int jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_5")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_5([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3, int jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_6")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_6([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRTPCValueByPlayingID__SWIG_7")] public static extern int CSharp_SetRTPCValueByPlayingID__SWIG_7([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_0")] public static extern int CSharp_ResetRTPCValue__SWIG_0(uint jarg1, ulong jarg2, int jarg3, int jarg4, bool jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_1")] public static extern int CSharp_ResetRTPCValue__SWIG_1(uint jarg1, ulong jarg2, int jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_2")] public static extern int CSharp_ResetRTPCValue__SWIG_2(uint jarg1, ulong jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_3")] public static extern int CSharp_ResetRTPCValue__SWIG_3(uint jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_4")] public static extern int CSharp_ResetRTPCValue__SWIG_4(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_5")] public static extern int CSharp_ResetRTPCValue__SWIG_5([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, int jarg3, int jarg4, bool jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_6")] public static extern int CSharp_ResetRTPCValue__SWIG_6([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, int jarg3, int jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_7")] public static extern int CSharp_ResetRTPCValue__SWIG_7([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_8")] public static extern int CSharp_ResetRTPCValue__SWIG_8([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResetRTPCValue__SWIG_9")] public static extern int CSharp_ResetRTPCValue__SWIG_9([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetSwitch__SWIG_0")] public static extern int CSharp_SetSwitch__SWIG_0(uint jarg1, uint jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetSwitch__SWIG_1")] public static extern int CSharp_SetSwitch__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostTrigger__SWIG_0")] public static extern int CSharp_PostTrigger__SWIG_0(uint jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostTrigger__SWIG_1")] public static extern int CSharp_PostTrigger__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetState__SWIG_0")] public static extern int CSharp_SetState__SWIG_0(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetState__SWIG_1")] public static extern int CSharp_SetState__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetGameObjectAuxSendValues")] public static extern int CSharp_SetGameObjectAuxSendValues(ulong jarg1, global::System.IntPtr jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetGameObjectOutputBusVolume")] public static extern int CSharp_SetGameObjectOutputBusVolume(ulong jarg1, ulong jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetActorMixerEffect")] public static extern int CSharp_SetActorMixerEffect(uint jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBusEffect__SWIG_0")] public static extern int CSharp_SetBusEffect__SWIG_0(uint jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBusEffect__SWIG_1")] public static extern int CSharp_SetBusEffect__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMixer__SWIG_0")] public static extern int CSharp_SetMixer__SWIG_0(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMixer__SWIG_1")] public static extern int CSharp_SetMixer__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBusConfig__SWIG_0")] public static extern int CSharp_SetBusConfig__SWIG_0(uint jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBusConfig__SWIG_1")] public static extern int CSharp_SetBusConfig__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetObjectObstructionAndOcclusion")] public static extern int CSharp_SetObjectObstructionAndOcclusion(ulong jarg1, ulong jarg2, float jarg3, float jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetMultipleObstructionAndOcclusion")] public static extern int CSharp_SetMultipleObstructionAndOcclusion(ulong jarg1, ulong jarg2, global::System.IntPtr jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StartOutputCapture")] public static extern int CSharp_StartOutputCapture([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopOutputCapture")] public static extern int CSharp_StopOutputCapture(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AddOutputCaptureMarker")] public static extern int CSharp_AddOutputCaptureMarker([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StartProfilerCapture")] public static extern int CSharp_StartProfilerCapture([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StopProfilerCapture")] public static extern int CSharp_StopProfilerCapture(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveOutput")] public static extern int CSharp_RemoveOutput(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ReplaceOutput__SWIG_0")] public static extern int CSharp_ReplaceOutput__SWIG_0(global::System.IntPtr jarg1, ulong jarg2, out ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ReplaceOutput__SWIG_1")] public static extern int CSharp_ReplaceOutput__SWIG_1(global::System.IntPtr jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetOutputID__SWIG_0")] public static extern ulong CSharp_GetOutputID__SWIG_0(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetOutputID__SWIG_1")] public static extern ulong CSharp_GetOutputID__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBusDevice__SWIG_0")] public static extern int CSharp_SetBusDevice__SWIG_0(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBusDevice__SWIG_1")] public static extern int CSharp_SetBusDevice__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetOutputVolume")] public static extern int CSharp_SetOutputVolume(ulong jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDeviceSpatialAudioSupport")] public static extern int CSharp_GetDeviceSpatialAudioSupport(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_Suspend__SWIG_0")] public static extern int CSharp_Suspend__SWIG_0(bool jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_Suspend__SWIG_1")] public static extern int CSharp_Suspend__SWIG_1(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_WakeupFromSuspend")] public static extern int CSharp_WakeupFromSuspend(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetBufferTick")] public static extern uint CSharp_GetBufferTick(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iCurrentPosition_set")] public static extern void CSharp_AkSegmentInfo_iCurrentPosition_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iCurrentPosition_get")] public static extern int CSharp_AkSegmentInfo_iCurrentPosition_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iPreEntryDuration_set")] public static extern void CSharp_AkSegmentInfo_iPreEntryDuration_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iPreEntryDuration_get")] public static extern int CSharp_AkSegmentInfo_iPreEntryDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iActiveDuration_set")] public static extern void CSharp_AkSegmentInfo_iActiveDuration_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iActiveDuration_get")] public static extern int CSharp_AkSegmentInfo_iActiveDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iPostExitDuration_set")] public static extern void CSharp_AkSegmentInfo_iPostExitDuration_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iPostExitDuration_get")] public static extern int CSharp_AkSegmentInfo_iPostExitDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iRemainingLookAheadTime_set")] public static extern void CSharp_AkSegmentInfo_iRemainingLookAheadTime_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_iRemainingLookAheadTime_get")] public static extern int CSharp_AkSegmentInfo_iRemainingLookAheadTime_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fBeatDuration_set")] public static extern void CSharp_AkSegmentInfo_fBeatDuration_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fBeatDuration_get")] public static extern float CSharp_AkSegmentInfo_fBeatDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fBarDuration_set")] public static extern void CSharp_AkSegmentInfo_fBarDuration_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fBarDuration_get")] public static extern float CSharp_AkSegmentInfo_fBarDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fGridDuration_set")] public static extern void CSharp_AkSegmentInfo_fGridDuration_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fGridDuration_get")] public static extern float CSharp_AkSegmentInfo_fGridDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fGridOffset_set")] public static extern void CSharp_AkSegmentInfo_fGridOffset_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSegmentInfo_fGridOffset_get")] public static extern float CSharp_AkSegmentInfo_fGridOffset_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkSegmentInfo")] public static extern global::System.IntPtr CSharp_new_AkSegmentInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkSegmentInfo")] public static extern void CSharp_delete_AkSegmentInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_INVALID_MIDI_CHANNEL_get")] public static extern byte CSharp_AK_INVALID_MIDI_CHANNEL_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_INVALID_MIDI_NOTE_get")] public static extern byte CSharp_AK_INVALID_MIDI_NOTE_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byChan_set")] public static extern void CSharp_AkMIDIEvent_byChan_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byChan_get")] public static extern byte CSharp_AkMIDIEvent_byChan_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tGen_byParam1_set")] public static extern void CSharp_AkMIDIEvent_tGen_byParam1_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tGen_byParam1_get")] public static extern byte CSharp_AkMIDIEvent_tGen_byParam1_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tGen_byParam2_set")] public static extern void CSharp_AkMIDIEvent_tGen_byParam2_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tGen_byParam2_get")] public static extern byte CSharp_AkMIDIEvent_tGen_byParam2_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tGen")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tGen(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tGen")] public static extern void CSharp_delete_AkMIDIEvent_tGen(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteOnOff_byNote_set")] public static extern void CSharp_AkMIDIEvent_tNoteOnOff_byNote_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteOnOff_byNote_get")] public static extern byte CSharp_AkMIDIEvent_tNoteOnOff_byNote_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteOnOff_byVelocity_set")] public static extern void CSharp_AkMIDIEvent_tNoteOnOff_byVelocity_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteOnOff_byVelocity_get")] public static extern byte CSharp_AkMIDIEvent_tNoteOnOff_byVelocity_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tNoteOnOff")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tNoteOnOff(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tNoteOnOff")] public static extern void CSharp_delete_AkMIDIEvent_tNoteOnOff(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tCc_byCc_set")] public static extern void CSharp_AkMIDIEvent_tCc_byCc_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tCc_byCc_get")] public static extern byte CSharp_AkMIDIEvent_tCc_byCc_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tCc_byValue_set")] public static extern void CSharp_AkMIDIEvent_tCc_byValue_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tCc_byValue_get")] public static extern byte CSharp_AkMIDIEvent_tCc_byValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tCc")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tCc(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tCc")] public static extern void CSharp_delete_AkMIDIEvent_tCc(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tPitchBend_byValueLsb_set")] public static extern void CSharp_AkMIDIEvent_tPitchBend_byValueLsb_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tPitchBend_byValueLsb_get")] public static extern byte CSharp_AkMIDIEvent_tPitchBend_byValueLsb_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tPitchBend_byValueMsb_set")] public static extern void CSharp_AkMIDIEvent_tPitchBend_byValueMsb_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tPitchBend_byValueMsb_get")] public static extern byte CSharp_AkMIDIEvent_tPitchBend_byValueMsb_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tPitchBend")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tPitchBend(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tPitchBend")] public static extern void CSharp_delete_AkMIDIEvent_tPitchBend(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteAftertouch_byNote_set")] public static extern void CSharp_AkMIDIEvent_tNoteAftertouch_byNote_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteAftertouch_byNote_get")] public static extern byte CSharp_AkMIDIEvent_tNoteAftertouch_byNote_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteAftertouch_byValue_set")] public static extern void CSharp_AkMIDIEvent_tNoteAftertouch_byValue_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tNoteAftertouch_byValue_get")] public static extern byte CSharp_AkMIDIEvent_tNoteAftertouch_byValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tNoteAftertouch")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tNoteAftertouch(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tNoteAftertouch")] public static extern void CSharp_delete_AkMIDIEvent_tNoteAftertouch(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tChanAftertouch_byValue_set")] public static extern void CSharp_AkMIDIEvent_tChanAftertouch_byValue_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tChanAftertouch_byValue_get")] public static extern byte CSharp_AkMIDIEvent_tChanAftertouch_byValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tChanAftertouch")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tChanAftertouch(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tChanAftertouch")] public static extern void CSharp_delete_AkMIDIEvent_tChanAftertouch(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tProgramChange_byProgramNum_set")] public static extern void CSharp_AkMIDIEvent_tProgramChange_byProgramNum_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_tProgramChange_byProgramNum_get")] public static extern byte CSharp_AkMIDIEvent_tProgramChange_byProgramNum_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent_tProgramChange")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent_tProgramChange(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent_tProgramChange")] public static extern void CSharp_delete_AkMIDIEvent_tProgramChange(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_Gen_set")] public static extern void CSharp_AkMIDIEvent_Gen_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_Gen_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_Gen_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_Cc_set")] public static extern void CSharp_AkMIDIEvent_Cc_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_Cc_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_Cc_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_NoteOnOff_set")] public static extern void CSharp_AkMIDIEvent_NoteOnOff_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_NoteOnOff_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_NoteOnOff_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_PitchBend_set")] public static extern void CSharp_AkMIDIEvent_PitchBend_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_PitchBend_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_PitchBend_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_NoteAftertouch_set")] public static extern void CSharp_AkMIDIEvent_NoteAftertouch_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_NoteAftertouch_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_NoteAftertouch_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_ChanAftertouch_set")] public static extern void CSharp_AkMIDIEvent_ChanAftertouch_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_ChanAftertouch_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_ChanAftertouch_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_ProgramChange_set")] public static extern void CSharp_AkMIDIEvent_ProgramChange_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_ProgramChange_get")] public static extern global::System.IntPtr CSharp_AkMIDIEvent_ProgramChange_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byType_set")] public static extern void CSharp_AkMIDIEvent_byType_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byType_get")] public static extern int CSharp_AkMIDIEvent_byType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byOnOffNote_set")] public static extern void CSharp_AkMIDIEvent_byOnOffNote_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byOnOffNote_get")] public static extern byte CSharp_AkMIDIEvent_byOnOffNote_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byVelocity_set")] public static extern void CSharp_AkMIDIEvent_byVelocity_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byVelocity_get")] public static extern byte CSharp_AkMIDIEvent_byVelocity_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byCc_set")] public static extern void CSharp_AkMIDIEvent_byCc_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byCc_get")] public static extern int CSharp_AkMIDIEvent_byCc_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byCcValue_set")] public static extern void CSharp_AkMIDIEvent_byCcValue_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byCcValue_get")] public static extern byte CSharp_AkMIDIEvent_byCcValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byValueLsb_set")] public static extern void CSharp_AkMIDIEvent_byValueLsb_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byValueLsb_get")] public static extern byte CSharp_AkMIDIEvent_byValueLsb_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byValueMsb_set")] public static extern void CSharp_AkMIDIEvent_byValueMsb_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byValueMsb_get")] public static extern byte CSharp_AkMIDIEvent_byValueMsb_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byAftertouchNote_set")] public static extern void CSharp_AkMIDIEvent_byAftertouchNote_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byAftertouchNote_get")] public static extern byte CSharp_AkMIDIEvent_byAftertouchNote_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byNoteAftertouchValue_set")] public static extern void CSharp_AkMIDIEvent_byNoteAftertouchValue_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byNoteAftertouchValue_get")] public static extern byte CSharp_AkMIDIEvent_byNoteAftertouchValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byChanAftertouchValue_set")] public static extern void CSharp_AkMIDIEvent_byChanAftertouchValue_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byChanAftertouchValue_get")] public static extern byte CSharp_AkMIDIEvent_byChanAftertouchValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byProgramNum_set")] public static extern void CSharp_AkMIDIEvent_byProgramNum_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEvent_byProgramNum_get")] public static extern byte CSharp_AkMIDIEvent_byProgramNum_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEvent")] public static extern global::System.IntPtr CSharp_new_AkMIDIEvent(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEvent")] public static extern void CSharp_delete_AkMIDIEvent(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIPost_uOffset_set")] public static extern void CSharp_AkMIDIPost_uOffset_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIPost_uOffset_get")] public static extern uint CSharp_AkMIDIPost_uOffset_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIPost_PostOnEvent")] public static extern int CSharp_AkMIDIPost_PostOnEvent(global::System.IntPtr jarg1, uint jarg2, ulong jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIPost_Clone")] public static extern void CSharp_AkMIDIPost_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIPost_GetSizeOf")] public static extern int CSharp_AkMIDIPost_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIPost")] public static extern global::System.IntPtr CSharp_new_AkMIDIPost(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIPost")] public static extern void CSharp_delete_AkMIDIPost(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMemSettings")] public static extern global::System.IntPtr CSharp_new_AkMemSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMemSettings_uMaxNumPools_set")] public static extern void CSharp_AkMemSettings_uMaxNumPools_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMemSettings_uMaxNumPools_get")] public static extern uint CSharp_AkMemSettings_uMaxNumPools_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMemSettings_uDebugFlags_set")] public static extern void CSharp_AkMemSettings_uDebugFlags_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMemSettings_uDebugFlags_get")] public static extern uint CSharp_AkMemSettings_uDebugFlags_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMemSettings")] public static extern void CSharp_delete_AkMemSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSettings_fStreamingLookAheadRatio_set")] public static extern void CSharp_AkMusicSettings_fStreamingLookAheadRatio_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSettings_fStreamingLookAheadRatio_get")] public static extern float CSharp_AkMusicSettings_fStreamingLookAheadRatio_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMusicSettings")] public static extern global::System.IntPtr CSharp_new_AkMusicSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMusicSettings")] public static extern void CSharp_delete_AkMusicSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPlayingSegmentInfo__SWIG_0")] public static extern int CSharp_GetPlayingSegmentInfo__SWIG_0(uint jarg1, global::System.IntPtr jarg2, bool jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPlayingSegmentInfo__SWIG_1")] public static extern int CSharp_GetPlayingSegmentInfo__SWIG_1(uint jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSerializedCallbackHeader_pPackage_get")] public static extern global::System.IntPtr CSharp_AkSerializedCallbackHeader_pPackage_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSerializedCallbackHeader_pNext_get")] public static extern global::System.IntPtr CSharp_AkSerializedCallbackHeader_pNext_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSerializedCallbackHeader_eType_get")] public static extern int CSharp_AkSerializedCallbackHeader_eType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSerializedCallbackHeader_GetData")] public static extern global::System.IntPtr CSharp_AkSerializedCallbackHeader_GetData(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkSerializedCallbackHeader")] public static extern global::System.IntPtr CSharp_new_AkSerializedCallbackHeader(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkSerializedCallbackHeader")] public static extern void CSharp_delete_AkSerializedCallbackHeader(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackInfo_pCookie_get")] public static extern global::System.IntPtr CSharp_AkCallbackInfo_pCookie_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackInfo_gameObjID_get")] public static extern ulong CSharp_AkCallbackInfo_gameObjID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkCallbackInfo")] public static extern void CSharp_delete_AkCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEventCallbackInfo_playingID_get")] public static extern uint CSharp_AkEventCallbackInfo_playingID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEventCallbackInfo_eventID_get")] public static extern uint CSharp_AkEventCallbackInfo_eventID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkEventCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkEventCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkEventCallbackInfo")] public static extern void CSharp_delete_AkEventCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byChan_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byChan_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byParam1_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byParam1_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byParam2_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byParam2_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byType_get")] public static extern int CSharp_AkMIDIEventCallbackInfo_byType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byOnOffNote_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byOnOffNote_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byVelocity_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byVelocity_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byCc_get")] public static extern int CSharp_AkMIDIEventCallbackInfo_byCc_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byCcValue_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byCcValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byValueLsb_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byValueLsb_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byValueMsb_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byValueMsb_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byAftertouchNote_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byAftertouchNote_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byNoteAftertouchValue_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byNoteAftertouchValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byChanAftertouchValue_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byChanAftertouchValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_byProgramNum_get")] public static extern byte CSharp_AkMIDIEventCallbackInfo_byProgramNum_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMIDIEventCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkMIDIEventCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMIDIEventCallbackInfo")] public static extern void CSharp_delete_AkMIDIEventCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMarkerCallbackInfo_uIdentifier_get")] public static extern uint CSharp_AkMarkerCallbackInfo_uIdentifier_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMarkerCallbackInfo_uPosition_get")] public static extern uint CSharp_AkMarkerCallbackInfo_uPosition_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMarkerCallbackInfo_strLabel_get")] public static extern global::System.IntPtr CSharp_AkMarkerCallbackInfo_strLabel_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMarkerCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkMarkerCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMarkerCallbackInfo")] public static extern void CSharp_delete_AkMarkerCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDurationCallbackInfo_fDuration_get")] public static extern float CSharp_AkDurationCallbackInfo_fDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDurationCallbackInfo_fEstimatedDuration_get")] public static extern float CSharp_AkDurationCallbackInfo_fEstimatedDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDurationCallbackInfo_audioNodeID_get")] public static extern uint CSharp_AkDurationCallbackInfo_audioNodeID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDurationCallbackInfo_mediaID_get")] public static extern uint CSharp_AkDurationCallbackInfo_mediaID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDurationCallbackInfo_bStreaming_get")] public static extern bool CSharp_AkDurationCallbackInfo_bStreaming_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkDurationCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkDurationCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkDurationCallbackInfo")] public static extern void CSharp_delete_AkDurationCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDynamicSequenceItemCallbackInfo_playingID_get")] public static extern uint CSharp_AkDynamicSequenceItemCallbackInfo_playingID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDynamicSequenceItemCallbackInfo_audioNodeID_get")] public static extern uint CSharp_AkDynamicSequenceItemCallbackInfo_audioNodeID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDynamicSequenceItemCallbackInfo_pCustomInfo_get")] public static extern global::System.IntPtr CSharp_AkDynamicSequenceItemCallbackInfo_pCustomInfo_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkDynamicSequenceItemCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkDynamicSequenceItemCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkDynamicSequenceItemCallbackInfo")] public static extern void CSharp_delete_AkDynamicSequenceItemCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_playingID_get")] public static extern uint CSharp_AkMusicSyncCallbackInfo_playingID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_iCurrentPosition_get")] public static extern int CSharp_AkMusicSyncCallbackInfo_segmentInfo_iCurrentPosition_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_iPreEntryDuration_get")] public static extern int CSharp_AkMusicSyncCallbackInfo_segmentInfo_iPreEntryDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_iActiveDuration_get")] public static extern int CSharp_AkMusicSyncCallbackInfo_segmentInfo_iActiveDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_iPostExitDuration_get")] public static extern int CSharp_AkMusicSyncCallbackInfo_segmentInfo_iPostExitDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_iRemainingLookAheadTime_get")] public static extern int CSharp_AkMusicSyncCallbackInfo_segmentInfo_iRemainingLookAheadTime_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_fBeatDuration_get")] public static extern float CSharp_AkMusicSyncCallbackInfo_segmentInfo_fBeatDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_fBarDuration_get")] public static extern float CSharp_AkMusicSyncCallbackInfo_segmentInfo_fBarDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_fGridDuration_get")] public static extern float CSharp_AkMusicSyncCallbackInfo_segmentInfo_fGridDuration_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_segmentInfo_fGridOffset_get")] public static extern float CSharp_AkMusicSyncCallbackInfo_segmentInfo_fGridOffset_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_musicSyncType_get")] public static extern int CSharp_AkMusicSyncCallbackInfo_musicSyncType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_userCueName_get")] public static extern global::System.IntPtr CSharp_AkMusicSyncCallbackInfo_userCueName_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMusicSyncCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkMusicSyncCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMusicSyncCallbackInfo")] public static extern void CSharp_delete_AkMusicSyncCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicPlaylistCallbackInfo_playlistID_get")] public static extern uint CSharp_AkMusicPlaylistCallbackInfo_playlistID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_get")] public static extern uint CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_get")] public static extern uint CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_get")] public static extern uint CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMusicPlaylistCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkMusicPlaylistCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMusicPlaylistCallbackInfo")] public static extern void CSharp_delete_AkMusicPlaylistCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkBankCallbackInfo_bankID_get")] public static extern uint CSharp_AkBankCallbackInfo_bankID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkBankCallbackInfo_inMemoryBankPtr_get")] public static extern global::System.IntPtr CSharp_AkBankCallbackInfo_inMemoryBankPtr_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkBankCallbackInfo_loadResult_get")] public static extern int CSharp_AkBankCallbackInfo_loadResult_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkBankCallbackInfo_memPoolId_get")] public static extern int CSharp_AkBankCallbackInfo_memPoolId_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkBankCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkBankCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkBankCallbackInfo")] public static extern void CSharp_delete_AkBankCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMonitoringCallbackInfo_errorCode_get")] public static extern int CSharp_AkMonitoringCallbackInfo_errorCode_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMonitoringCallbackInfo_errorLevel_get")] public static extern int CSharp_AkMonitoringCallbackInfo_errorLevel_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMonitoringCallbackInfo_playingID_get")] public static extern uint CSharp_AkMonitoringCallbackInfo_playingID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMonitoringCallbackInfo_gameObjID_get")] public static extern ulong CSharp_AkMonitoringCallbackInfo_gameObjID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMonitoringCallbackInfo_message_get")] public static extern global::System.IntPtr CSharp_AkMonitoringCallbackInfo_message_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkMonitoringCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkMonitoringCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkMonitoringCallbackInfo")] public static extern void CSharp_delete_AkMonitoringCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioInterruptionCallbackInfo_bEnterInterruption_get")] public static extern bool CSharp_AkAudioInterruptionCallbackInfo_bEnterInterruption_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkAudioInterruptionCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkAudioInterruptionCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkAudioInterruptionCallbackInfo")] public static extern void CSharp_delete_AkAudioInterruptionCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAudioSourceChangeCallbackInfo_bOtherAudioPlaying_get")] public static extern bool CSharp_AkAudioSourceChangeCallbackInfo_bOtherAudioPlaying_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkAudioSourceChangeCallbackInfo")] public static extern global::System.IntPtr CSharp_new_AkAudioSourceChangeCallbackInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkAudioSourceChangeCallbackInfo")] public static extern void CSharp_delete_AkAudioSourceChangeCallbackInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackSerializer_Init")] public static extern int CSharp_AkCallbackSerializer_Init(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackSerializer_Term")] public static extern void CSharp_AkCallbackSerializer_Term(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackSerializer_Lock")] public static extern global::System.IntPtr CSharp_AkCallbackSerializer_Lock(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackSerializer_SetLocalOutput")] public static extern void CSharp_AkCallbackSerializer_SetLocalOutput(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackSerializer_Unlock")] public static extern void CSharp_AkCallbackSerializer_Unlock(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCallbackSerializer_AudioSourceChangeCallbackFunc")] public static extern int CSharp_AkCallbackSerializer_AudioSourceChangeCallbackFunc(bool jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkCallbackSerializer")] public static extern global::System.IntPtr CSharp_new_AkCallbackSerializer(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkCallbackSerializer")] public static extern void CSharp_delete_AkCallbackSerializer(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostCode__SWIG_0")] public static extern int CSharp_PostCode__SWIG_0(int jarg1, int jarg2, uint jarg3, ulong jarg4, uint jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostCode__SWIG_1")] public static extern int CSharp_PostCode__SWIG_1(int jarg1, int jarg2, uint jarg3, ulong jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostCode__SWIG_2")] public static extern int CSharp_PostCode__SWIG_2(int jarg1, int jarg2, uint jarg3, ulong jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostCode__SWIG_3")] public static extern int CSharp_PostCode__SWIG_3(int jarg1, int jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostCode__SWIG_4")] public static extern int CSharp_PostCode__SWIG_4(int jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostString__SWIG_0")] public static extern int CSharp_PostString__SWIG_0([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3, ulong jarg4, uint jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostString__SWIG_1")] public static extern int CSharp_PostString__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3, ulong jarg4, uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostString__SWIG_2")] public static extern int CSharp_PostString__SWIG_2([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3, ulong jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostString__SWIG_3")] public static extern int CSharp_PostString__SWIG_3([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_PostString__SWIG_4")] public static extern int CSharp_PostString__SWIG_4([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetTimeStamp")] public static extern int CSharp_GetTimeStamp(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetNumNonZeroBits")] public static extern uint CSharp_GetNumNonZeroBits(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkGetDefaultHighPriorityThreadProperties")] public static extern void CSharp_AkGetDefaultHighPriorityThreadProperties(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResolveDialogueEvent__SWIG_0")] public static extern uint CSharp_ResolveDialogueEvent__SWIG_0(uint jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg2, uint jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ResolveDialogueEvent__SWIG_1")] public static extern uint CSharp_ResolveDialogueEvent__SWIG_1(uint jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDialogueEventCustomPropertyValue__SWIG_0")] public static extern int CSharp_GetDialogueEventCustomPropertyValue__SWIG_0(uint jarg1, uint jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDialogueEventCustomPropertyValue__SWIG_1")] public static extern int CSharp_GetDialogueEventCustomPropertyValue__SWIG_1(uint jarg1, uint jarg2, out float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fCenterPct_set")] public static extern void CSharp_AkPositioningInfo_fCenterPct_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fCenterPct_get")] public static extern float CSharp_AkPositioningInfo_fCenterPct_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_pannerType_set")] public static extern void CSharp_AkPositioningInfo_pannerType_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_pannerType_get")] public static extern int CSharp_AkPositioningInfo_pannerType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_e3dPositioningType_set")] public static extern void CSharp_AkPositioningInfo_e3dPositioningType_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_e3dPositioningType_get")] public static extern int CSharp_AkPositioningInfo_e3dPositioningType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_bHoldEmitterPosAndOrient_set")] public static extern void CSharp_AkPositioningInfo_bHoldEmitterPosAndOrient_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_bHoldEmitterPosAndOrient_get")] public static extern bool CSharp_AkPositioningInfo_bHoldEmitterPosAndOrient_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_e3DSpatializationMode_set")] public static extern void CSharp_AkPositioningInfo_e3DSpatializationMode_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_e3DSpatializationMode_get")] public static extern int CSharp_AkPositioningInfo_e3DSpatializationMode_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_bEnableAttenuation_set")] public static extern void CSharp_AkPositioningInfo_bEnableAttenuation_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_bEnableAttenuation_get")] public static extern bool CSharp_AkPositioningInfo_bEnableAttenuation_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_bUseConeAttenuation_set")] public static extern void CSharp_AkPositioningInfo_bUseConeAttenuation_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_bUseConeAttenuation_get")] public static extern bool CSharp_AkPositioningInfo_bUseConeAttenuation_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fInnerAngle_set")] public static extern void CSharp_AkPositioningInfo_fInnerAngle_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fInnerAngle_get")] public static extern float CSharp_AkPositioningInfo_fInnerAngle_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fOuterAngle_set")] public static extern void CSharp_AkPositioningInfo_fOuterAngle_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fOuterAngle_get")] public static extern float CSharp_AkPositioningInfo_fOuterAngle_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fConeMaxAttenuation_set")] public static extern void CSharp_AkPositioningInfo_fConeMaxAttenuation_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fConeMaxAttenuation_get")] public static extern float CSharp_AkPositioningInfo_fConeMaxAttenuation_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_LPFCone_set")] public static extern void CSharp_AkPositioningInfo_LPFCone_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_LPFCone_get")] public static extern float CSharp_AkPositioningInfo_LPFCone_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_HPFCone_set")] public static extern void CSharp_AkPositioningInfo_HPFCone_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_HPFCone_get")] public static extern float CSharp_AkPositioningInfo_HPFCone_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fMaxDistance_set")] public static extern void CSharp_AkPositioningInfo_fMaxDistance_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fMaxDistance_get")] public static extern float CSharp_AkPositioningInfo_fMaxDistance_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fVolDryAtMaxDist_set")] public static extern void CSharp_AkPositioningInfo_fVolDryAtMaxDist_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fVolDryAtMaxDist_get")] public static extern float CSharp_AkPositioningInfo_fVolDryAtMaxDist_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_set")] public static extern void CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_get")] public static extern float CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_set")] public static extern void CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_get")] public static extern float CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_LPFValueAtMaxDist_set")] public static extern void CSharp_AkPositioningInfo_LPFValueAtMaxDist_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_LPFValueAtMaxDist_get")] public static extern float CSharp_AkPositioningInfo_LPFValueAtMaxDist_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_HPFValueAtMaxDist_set")] public static extern void CSharp_AkPositioningInfo_HPFValueAtMaxDist_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPositioningInfo_HPFValueAtMaxDist_get")] public static extern float CSharp_AkPositioningInfo_HPFValueAtMaxDist_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPositioningInfo")] public static extern global::System.IntPtr CSharp_new_AkPositioningInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkPositioningInfo")] public static extern void CSharp_delete_AkPositioningInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_objID_set")] public static extern void CSharp_AkObjectInfo_objID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_objID_get")] public static extern uint CSharp_AkObjectInfo_objID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_parentID_set")] public static extern void CSharp_AkObjectInfo_parentID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_parentID_get")] public static extern uint CSharp_AkObjectInfo_parentID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_iDepth_set")] public static extern void CSharp_AkObjectInfo_iDepth_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_iDepth_get")] public static extern int CSharp_AkObjectInfo_iDepth_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_Clear")] public static extern void CSharp_AkObjectInfo_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_GetSizeOf")] public static extern int CSharp_AkObjectInfo_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkObjectInfo_Clone")] public static extern void CSharp_AkObjectInfo_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkObjectInfo")] public static extern global::System.IntPtr CSharp_new_AkObjectInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkObjectInfo")] public static extern void CSharp_delete_AkObjectInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPosition")] public static extern int CSharp_GetPosition(ulong jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetListenerPosition")] public static extern int CSharp_GetListenerPosition(ulong jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetRTPCValue__SWIG_0")] public static extern int CSharp_GetRTPCValue__SWIG_0(uint jarg1, ulong jarg2, uint jarg3, out float jarg4, ref int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetRTPCValue__SWIG_1")] public static extern int CSharp_GetRTPCValue__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, uint jarg3, out float jarg4, ref int jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSwitch__SWIG_0")] public static extern int CSharp_GetSwitch__SWIG_0(uint jarg1, ulong jarg2, out uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSwitch__SWIG_1")] public static extern int CSharp_GetSwitch__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ulong jarg2, out uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetState__SWIG_0")] public static extern int CSharp_GetState__SWIG_0(uint jarg1, out uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetState__SWIG_1")] public static extern int CSharp_GetState__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, out uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetGameObjectAuxSendValues")] public static extern int CSharp_GetGameObjectAuxSendValues(ulong jarg1, global::System.IntPtr jarg2, ref uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetGameObjectDryLevelValue")] public static extern int CSharp_GetGameObjectDryLevelValue(ulong jarg1, ulong jarg2, out float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetObjectObstructionAndOcclusion")] public static extern int CSharp_GetObjectObstructionAndOcclusion(ulong jarg1, ulong jarg2, out float jarg3, out float jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_QueryAudioObjectIDs__SWIG_0")] public static extern int CSharp_QueryAudioObjectIDs__SWIG_0(uint jarg1, ref uint jarg2, global::System.IntPtr jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_QueryAudioObjectIDs__SWIG_1")] public static extern int CSharp_QueryAudioObjectIDs__SWIG_1([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, ref uint jarg2, global::System.IntPtr jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPositioningInfo")] public static extern int CSharp_GetPositioningInfo(uint jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetIsGameObjectActive")] public static extern bool CSharp_GetIsGameObjectActive(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetMaxRadius")] public static extern float CSharp_GetMaxRadius(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetEventIDFromPlayingID")] public static extern uint CSharp_GetEventIDFromPlayingID(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetGameObjectFromPlayingID")] public static extern ulong CSharp_GetGameObjectFromPlayingID(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPlayingIDsFromGameObject")] public static extern int CSharp_GetPlayingIDsFromGameObject(ulong jarg1, ref uint jarg2, [global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetCustomPropertyValue__SWIG_0")] public static extern int CSharp_GetCustomPropertyValue__SWIG_0(uint jarg1, uint jarg2, out int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetCustomPropertyValue__SWIG_1")] public static extern int CSharp_GetCustomPropertyValue__SWIG_1(uint jarg1, uint jarg2, out float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER")] public static extern void CSharp_AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER(ref uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE")] public static extern void CSharp_AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE(ref uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED")] public static extern void CSharp_AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED(ref uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ChannelMaskToNumChannels")] public static extern byte CSharp_ChannelMaskToNumChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ChannelMaskFromNumChannels")] public static extern uint CSharp_ChannelMaskFromNumChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_ChannelBitToIndex")] public static extern byte CSharp_ChannelBitToIndex(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_HasSurroundChannels")] public static extern bool CSharp_HasSurroundChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_HasStrictlyOnePairOfSurroundChannels")] public static extern bool CSharp_HasStrictlyOnePairOfSurroundChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_HasSideAndRearChannels")] public static extern bool CSharp_HasSideAndRearChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_HasHeightChannels")] public static extern bool CSharp_HasHeightChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_BackToSideChannels")] public static extern uint CSharp_BackToSideChannels(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_StdChannelIndexToDisplayIndex")] public static extern uint CSharp_StdChannelIndexToDisplayIndex(int jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_uNumChannels_set")] public static extern void CSharp_AkChannelConfig_uNumChannels_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_uNumChannels_get")] public static extern uint CSharp_AkChannelConfig_uNumChannels_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_eConfigType_set")] public static extern void CSharp_AkChannelConfig_eConfigType_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_eConfigType_get")] public static extern uint CSharp_AkChannelConfig_eConfigType_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_uChannelMask_set")] public static extern void CSharp_AkChannelConfig_uChannelMask_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_uChannelMask_get")] public static extern uint CSharp_AkChannelConfig_uChannelMask_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkChannelConfig__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkChannelConfig__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkChannelConfig__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkChannelConfig__SWIG_1(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_Clear")] public static extern void CSharp_AkChannelConfig_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_SetStandard")] public static extern void CSharp_AkChannelConfig_SetStandard(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_SetStandardOrAnonymous")] public static extern void CSharp_AkChannelConfig_SetStandardOrAnonymous(global::System.IntPtr jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_SetAnonymous")] public static extern void CSharp_AkChannelConfig_SetAnonymous(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_SetAmbisonic")] public static extern void CSharp_AkChannelConfig_SetAmbisonic(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_IsValid")] public static extern bool CSharp_AkChannelConfig_IsValid(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_Serialize")] public static extern uint CSharp_AkChannelConfig_Serialize(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_Deserialize")] public static extern void CSharp_AkChannelConfig_Deserialize(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_RemoveLFE")] public static extern global::System.IntPtr CSharp_AkChannelConfig_RemoveLFE(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_RemoveCenter")] public static extern global::System.IntPtr CSharp_AkChannelConfig_RemoveCenter(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkChannelConfig_IsChannelConfigSupported")] public static extern bool CSharp_AkChannelConfig_IsChannelConfigSupported(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkChannelConfig")] public static extern void CSharp_delete_AkChannelConfig(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkImageSourceParams__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkImageSourceParams__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkImageSourceParams__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkImageSourceParams__SWIG_1(global::System.IntPtr jarg1, float jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_sourcePosition_set")] public static extern void CSharp_AkImageSourceParams_sourcePosition_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_sourcePosition_get")] public static extern global::System.IntPtr CSharp_AkImageSourceParams_sourcePosition_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_fDistanceScalingFactor_set")] public static extern void CSharp_AkImageSourceParams_fDistanceScalingFactor_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_fDistanceScalingFactor_get")] public static extern float CSharp_AkImageSourceParams_fDistanceScalingFactor_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_fLevel_set")] public static extern void CSharp_AkImageSourceParams_fLevel_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_fLevel_get")] public static extern float CSharp_AkImageSourceParams_fLevel_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_fDiffraction_set")] public static extern void CSharp_AkImageSourceParams_fDiffraction_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_fDiffraction_get")] public static extern float CSharp_AkImageSourceParams_fDiffraction_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_uDiffractionEmitterSide_set")] public static extern void CSharp_AkImageSourceParams_uDiffractionEmitterSide_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_uDiffractionEmitterSide_get")] public static extern byte CSharp_AkImageSourceParams_uDiffractionEmitterSide_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_uDiffractionListenerSide_set")] public static extern void CSharp_AkImageSourceParams_uDiffractionListenerSide_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceParams_uDiffractionListenerSide_get")] public static extern byte CSharp_AkImageSourceParams_uDiffractionListenerSide_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkImageSourceParams")] public static extern void CSharp_delete_AkImageSourceParams(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kDefaultMaxPathLength_get")] public static extern float CSharp_kDefaultMaxPathLength_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kDefaultDiffractionMaxEdges_get")] public static extern uint CSharp_kDefaultDiffractionMaxEdges_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kDefaultDiffractionMaxPaths_get")] public static extern uint CSharp_kDefaultDiffractionMaxPaths_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kMaxDiffraction_get")] public static extern float CSharp_kMaxDiffraction_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kListenerDiffractionMaxEdges_get")] public static extern uint CSharp_kListenerDiffractionMaxEdges_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kListenerDiffractionMaxPaths_get")] public static extern uint CSharp_kListenerDiffractionMaxPaths_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_kPortalToPortalDiffractionMaxPaths_get")] public static extern uint CSharp_kPortalToPortalDiffractionMaxPaths_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_g_SpatialAudioPoolId_set")] public static extern void CSharp_g_SpatialAudioPoolId_set(int jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_g_SpatialAudioPoolId_get")] public static extern int CSharp_g_SpatialAudioPoolId_get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp__ArrayPoolSpatialAudio_Get")] public static extern int CSharp__ArrayPoolSpatialAudio_Get(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new__ArrayPoolSpatialAudio")] public static extern global::System.IntPtr CSharp_new__ArrayPoolSpatialAudio(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete__ArrayPoolSpatialAudio")] public static extern void CSharp_delete__ArrayPoolSpatialAudio(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkSpatialAudioInitSettings")] public static extern global::System.IntPtr CSharp_new_AkSpatialAudioInitSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uPoolID_set")] public static extern void CSharp_AkSpatialAudioInitSettings_uPoolID_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uPoolID_get")] public static extern int CSharp_AkSpatialAudioInitSettings_uPoolID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uPoolSize_set")] public static extern void CSharp_AkSpatialAudioInitSettings_uPoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uPoolSize_get")] public static extern uint CSharp_AkSpatialAudioInitSettings_uPoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uMaxSoundPropagationDepth_set")] public static extern void CSharp_AkSpatialAudioInitSettings_uMaxSoundPropagationDepth_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uMaxSoundPropagationDepth_get")] public static extern uint CSharp_AkSpatialAudioInitSettings_uMaxSoundPropagationDepth_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uDiffractionFlags_set")] public static extern void CSharp_AkSpatialAudioInitSettings_uDiffractionFlags_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_uDiffractionFlags_get")] public static extern uint CSharp_AkSpatialAudioInitSettings_uDiffractionFlags_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_fDiffractionShadowAttenFactor_set")] public static extern void CSharp_AkSpatialAudioInitSettings_fDiffractionShadowAttenFactor_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_fDiffractionShadowAttenFactor_get")] public static extern float CSharp_AkSpatialAudioInitSettings_fDiffractionShadowAttenFactor_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_fDiffractionShadowDegrees_set")] public static extern void CSharp_AkSpatialAudioInitSettings_fDiffractionShadowDegrees_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_fDiffractionShadowDegrees_get")] public static extern float CSharp_AkSpatialAudioInitSettings_fDiffractionShadowDegrees_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_fMovementThreshold_set")] public static extern void CSharp_AkSpatialAudioInitSettings_fMovementThreshold_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkSpatialAudioInitSettings_fMovementThreshold_get")] public static extern float CSharp_AkSpatialAudioInitSettings_fMovementThreshold_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkSpatialAudioInitSettings")] public static extern void CSharp_delete_AkSpatialAudioInitSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkImageSourceSettings__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkImageSourceSettings__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkImageSourceSettings__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkImageSourceSettings__SWIG_1(global::System.IntPtr jarg1, float jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkImageSourceSettings")] public static extern void CSharp_delete_AkImageSourceSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceSettings_SetOneTexture")] public static extern void CSharp_AkImageSourceSettings_SetOneTexture(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceSettings_SetName")] public static extern void CSharp_AkImageSourceSettings_SetName(global::System.IntPtr jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceSettings_params__set")] public static extern void CSharp_AkImageSourceSettings_params__set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkImageSourceSettings_params__get")] public static extern global::System.IntPtr CSharp_AkImageSourceSettings_params__get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkEmitterSettings")] public static extern global::System.IntPtr CSharp_new_AkEmitterSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectAuxBusID_set")] public static extern void CSharp_AkEmitterSettings_reflectAuxBusID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectAuxBusID_get")] public static extern uint CSharp_AkEmitterSettings_reflectAuxBusID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectionMaxPathLength_set")] public static extern void CSharp_AkEmitterSettings_reflectionMaxPathLength_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectionMaxPathLength_get")] public static extern float CSharp_AkEmitterSettings_reflectionMaxPathLength_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectionsAuxBusGain_set")] public static extern void CSharp_AkEmitterSettings_reflectionsAuxBusGain_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectionsAuxBusGain_get")] public static extern float CSharp_AkEmitterSettings_reflectionsAuxBusGain_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectionsOrder_set")] public static extern void CSharp_AkEmitterSettings_reflectionsOrder_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectionsOrder_get")] public static extern uint CSharp_AkEmitterSettings_reflectionsOrder_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectorFilterMask_set")] public static extern void CSharp_AkEmitterSettings_reflectorFilterMask_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_reflectorFilterMask_get")] public static extern uint CSharp_AkEmitterSettings_reflectorFilterMask_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_roomReverbAuxBusGain_set")] public static extern void CSharp_AkEmitterSettings_roomReverbAuxBusGain_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_roomReverbAuxBusGain_get")] public static extern float CSharp_AkEmitterSettings_roomReverbAuxBusGain_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_diffractionMaxEdges_set")] public static extern void CSharp_AkEmitterSettings_diffractionMaxEdges_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_diffractionMaxEdges_get")] public static extern uint CSharp_AkEmitterSettings_diffractionMaxEdges_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_diffractionMaxPaths_set")] public static extern void CSharp_AkEmitterSettings_diffractionMaxPaths_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_diffractionMaxPaths_get")] public static extern uint CSharp_AkEmitterSettings_diffractionMaxPaths_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_diffractionMaxPathLength_set")] public static extern void CSharp_AkEmitterSettings_diffractionMaxPathLength_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_diffractionMaxPathLength_get")] public static extern float CSharp_AkEmitterSettings_diffractionMaxPathLength_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_useImageSources_set")] public static extern void CSharp_AkEmitterSettings_useImageSources_set(global::System.IntPtr jarg1, byte jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEmitterSettings_useImageSources_get")] public static extern byte CSharp_AkEmitterSettings_useImageSources_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkEmitterSettings")] public static extern void CSharp_delete_AkEmitterSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkVertex__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkVertex__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkVertex__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkVertex__SWIG_1(float jarg1, float jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_X_set")] public static extern void CSharp_AkVertex_X_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_X_get")] public static extern float CSharp_AkVertex_X_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_Y_set")] public static extern void CSharp_AkVertex_Y_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_Y_get")] public static extern float CSharp_AkVertex_Y_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_Z_set")] public static extern void CSharp_AkVertex_Z_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_Z_get")] public static extern float CSharp_AkVertex_Z_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_Clear")] public static extern void CSharp_AkVertex_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_GetSizeOf")] public static extern int CSharp_AkVertex_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkVertex_Clone")] public static extern void CSharp_AkVertex_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkVertex")] public static extern void CSharp_delete_AkVertex(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkTriangle__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkTriangle__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkTriangle__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkTriangle__SWIG_1(ushort jarg1, ushort jarg2, ushort jarg3, ushort jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_point0_set")] public static extern void CSharp_AkTriangle_point0_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_point0_get")] public static extern ushort CSharp_AkTriangle_point0_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_point1_set")] public static extern void CSharp_AkTriangle_point1_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_point1_get")] public static extern ushort CSharp_AkTriangle_point1_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_point2_set")] public static extern void CSharp_AkTriangle_point2_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_point2_get")] public static extern ushort CSharp_AkTriangle_point2_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_surface_set")] public static extern void CSharp_AkTriangle_surface_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_surface_get")] public static extern ushort CSharp_AkTriangle_surface_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_Clear")] public static extern void CSharp_AkTriangle_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_GetSizeOf")] public static extern int CSharp_AkTriangle_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkTriangle_Clone")] public static extern void CSharp_AkTriangle_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkTriangle")] public static extern void CSharp_delete_AkTriangle(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkAcousticSurface")] public static extern global::System.IntPtr CSharp_new_AkAcousticSurface(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_textureID_set")] public static extern void CSharp_AkAcousticSurface_textureID_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_textureID_get")] public static extern uint CSharp_AkAcousticSurface_textureID_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_reflectorChannelMask_set")] public static extern void CSharp_AkAcousticSurface_reflectorChannelMask_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_reflectorChannelMask_get")] public static extern uint CSharp_AkAcousticSurface_reflectorChannelMask_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_strName_set")] public static extern void CSharp_AkAcousticSurface_strName_set(global::System.IntPtr jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_strName_get")] public static extern global::System.IntPtr CSharp_AkAcousticSurface_strName_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_Clear")] public static extern void CSharp_AkAcousticSurface_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_DeleteName")] public static extern void CSharp_AkAcousticSurface_DeleteName(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_GetSizeOf")] public static extern int CSharp_AkAcousticSurface_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkAcousticSurface_Clone")] public static extern void CSharp_AkAcousticSurface_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkAcousticSurface")] public static extern void CSharp_delete_AkAcousticSurface(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_imageSource_set")] public static extern void CSharp_AkReflectionPathInfo_imageSource_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_imageSource_get")] public static extern global::System.IntPtr CSharp_AkReflectionPathInfo_imageSource_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_numPathPoints_set")] public static extern void CSharp_AkReflectionPathInfo_numPathPoints_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_numPathPoints_get")] public static extern uint CSharp_AkReflectionPathInfo_numPathPoints_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_numReflections_set")] public static extern void CSharp_AkReflectionPathInfo_numReflections_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_numReflections_get")] public static extern uint CSharp_AkReflectionPathInfo_numReflections_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_level_set")] public static extern void CSharp_AkReflectionPathInfo_level_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_level_get")] public static extern float CSharp_AkReflectionPathInfo_level_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_isOccluded_set")] public static extern void CSharp_AkReflectionPathInfo_isOccluded_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_isOccluded_get")] public static extern bool CSharp_AkReflectionPathInfo_isOccluded_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_GetSizeOf")] public static extern int CSharp_AkReflectionPathInfo_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_GetPathPoint")] public static extern global::System.IntPtr CSharp_AkReflectionPathInfo_GetPathPoint(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_GetAcousticSurface")] public static extern global::System.IntPtr CSharp_AkReflectionPathInfo_GetAcousticSurface(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_GetDiffraction")] public static extern float CSharp_AkReflectionPathInfo_GetDiffraction(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkReflectionPathInfo_Clone")] public static extern void CSharp_AkReflectionPathInfo_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkReflectionPathInfo")] public static extern global::System.IntPtr CSharp_new_AkReflectionPathInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkReflectionPathInfo")] public static extern void CSharp_delete_AkReflectionPathInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_virtualPos_set")] public static extern void CSharp_AkDiffractionPathInfo_virtualPos_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_virtualPos_get")] public static extern global::System.IntPtr CSharp_AkDiffractionPathInfo_virtualPos_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_nodeCount_set")] public static extern void CSharp_AkDiffractionPathInfo_nodeCount_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_nodeCount_get")] public static extern uint CSharp_AkDiffractionPathInfo_nodeCount_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_diffraction_set")] public static extern void CSharp_AkDiffractionPathInfo_diffraction_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_diffraction_get")] public static extern float CSharp_AkDiffractionPathInfo_diffraction_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_totLength_set")] public static extern void CSharp_AkDiffractionPathInfo_totLength_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_totLength_get")] public static extern float CSharp_AkDiffractionPathInfo_totLength_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_obstructionValue_set")] public static extern void CSharp_AkDiffractionPathInfo_obstructionValue_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_obstructionValue_get")] public static extern float CSharp_AkDiffractionPathInfo_obstructionValue_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_GetSizeOf")] public static extern int CSharp_AkDiffractionPathInfo_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_GetNodes")] public static extern global::System.IntPtr CSharp_AkDiffractionPathInfo_GetNodes(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_GetAngles")] public static extern float CSharp_AkDiffractionPathInfo_GetAngles(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_GetPortals")] public static extern ulong CSharp_AkDiffractionPathInfo_GetPortals(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_GetRooms")] public static extern ulong CSharp_AkDiffractionPathInfo_GetRooms(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDiffractionPathInfo_Clone")] public static extern void CSharp_AkDiffractionPathInfo_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkDiffractionPathInfo")] public static extern global::System.IntPtr CSharp_new_AkDiffractionPathInfo(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkDiffractionPathInfo")] public static extern void CSharp_delete_AkDiffractionPathInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkRoomParams")] public static extern global::System.IntPtr CSharp_new_AkRoomParams(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_Up_set")] public static extern void CSharp_AkRoomParams_Up_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_Up_get")] public static extern global::System.IntPtr CSharp_AkRoomParams_Up_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_Front_set")] public static extern void CSharp_AkRoomParams_Front_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_Front_get")] public static extern global::System.IntPtr CSharp_AkRoomParams_Front_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_ReverbAuxBus_set")] public static extern void CSharp_AkRoomParams_ReverbAuxBus_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_ReverbAuxBus_get")] public static extern uint CSharp_AkRoomParams_ReverbAuxBus_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_ReverbLevel_set")] public static extern void CSharp_AkRoomParams_ReverbLevel_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_ReverbLevel_get")] public static extern float CSharp_AkRoomParams_ReverbLevel_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_WallOcclusion_set")] public static extern void CSharp_AkRoomParams_WallOcclusion_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_WallOcclusion_get")] public static extern float CSharp_AkRoomParams_WallOcclusion_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_RoomGameObj_AuxSendLevelToSelf_set")] public static extern void CSharp_AkRoomParams_RoomGameObj_AuxSendLevelToSelf_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_RoomGameObj_AuxSendLevelToSelf_get")] public static extern float CSharp_AkRoomParams_RoomGameObj_AuxSendLevelToSelf_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_RoomGameObj_KeepRegistered_set")] public static extern void CSharp_AkRoomParams_RoomGameObj_KeepRegistered_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkRoomParams_RoomGameObj_KeepRegistered_get")] public static extern bool CSharp_AkRoomParams_RoomGameObj_KeepRegistered_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkRoomParams")] public static extern void CSharp_delete_AkRoomParams(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetPoolID")] public static extern int CSharp_GetPoolID(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RegisterEmitter")] public static extern int CSharp_RegisterEmitter(ulong jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnregisterEmitter")] public static extern int CSharp_UnregisterEmitter(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetEmitterAuxSendValues")] public static extern int CSharp_SetEmitterAuxSendValues(ulong jarg1, global::System.IntPtr jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetImageSource__SWIG_0")] public static extern int CSharp_SetImageSource__SWIG_0(uint jarg1, global::System.IntPtr jarg2, uint jarg3, ulong jarg4, ulong jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetImageSource__SWIG_1")] public static extern int CSharp_SetImageSource__SWIG_1(uint jarg1, global::System.IntPtr jarg2, uint jarg3, ulong jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveImageSource__SWIG_0")] public static extern int CSharp_RemoveImageSource__SWIG_0(uint jarg1, uint jarg2, ulong jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveImageSource__SWIG_1")] public static extern int CSharp_RemoveImageSource__SWIG_1(uint jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveGeometry")] public static extern int CSharp_RemoveGeometry(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_QueryReflectionPaths")] public static extern int CSharp_QueryReflectionPaths(ulong jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, global::System.IntPtr jarg4, out uint jarg5); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemoveRoom")] public static extern int CSharp_RemoveRoom(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RemovePortal")] public static extern int CSharp_RemovePortal(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetGameObjectInRoom")] public static extern int CSharp_SetGameObjectInRoom(ulong jarg1, ulong jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetEmitterObstructionAndOcclusion")] public static extern int CSharp_SetEmitterObstructionAndOcclusion(ulong jarg1, float jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetPortalObstructionAndOcclusion")] public static extern int CSharp_SetPortalObstructionAndOcclusion(ulong jarg1, float jarg2, float jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_QueryWetDiffraction")] public static extern int CSharp_QueryWetDiffraction(ulong jarg1, out float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadLEngine_set")] public static extern void CSharp_AkPlatformInitSettings_threadLEngine_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadLEngine_get")] public static extern global::System.IntPtr CSharp_AkPlatformInitSettings_threadLEngine_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadOutputMgr_set")] public static extern void CSharp_AkPlatformInitSettings_threadOutputMgr_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadOutputMgr_get")] public static extern global::System.IntPtr CSharp_AkPlatformInitSettings_threadOutputMgr_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadBankManager_set")] public static extern void CSharp_AkPlatformInitSettings_threadBankManager_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadBankManager_get")] public static extern global::System.IntPtr CSharp_AkPlatformInitSettings_threadBankManager_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadMonitor_set")] public static extern void CSharp_AkPlatformInitSettings_threadMonitor_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_threadMonitor_get")] public static extern global::System.IntPtr CSharp_AkPlatformInitSettings_threadMonitor_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_set")] public static extern void CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_get")] public static extern uint CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_set")] public static extern void CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_get")] public static extern float CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_uNumRefillsInVoice_set")] public static extern void CSharp_AkPlatformInitSettings_uNumRefillsInVoice_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_uNumRefillsInVoice_get")] public static extern ushort CSharp_AkPlatformInitSettings_uNumRefillsInVoice_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_uSampleRate_set")] public static extern void CSharp_AkPlatformInitSettings_uSampleRate_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_uSampleRate_get")] public static extern uint CSharp_AkPlatformInitSettings_uSampleRate_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_eAudioAPI_set")] public static extern void CSharp_AkPlatformInitSettings_eAudioAPI_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_eAudioAPI_get")] public static extern int CSharp_AkPlatformInitSettings_eAudioAPI_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_bGlobalFocus_set")] public static extern void CSharp_AkPlatformInitSettings_bGlobalFocus_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlatformInitSettings_bGlobalFocus_get")] public static extern bool CSharp_AkPlatformInitSettings_bGlobalFocus_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPlatformInitSettings")] public static extern global::System.IntPtr CSharp_new_AkPlatformInitSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkPlatformInitSettings")] public static extern void CSharp_delete_AkPlatformInitSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDeviceIDFromName")] public static extern uint CSharp_GetDeviceIDFromName([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetWindowsDeviceName__SWIG_0")] public static extern global::System.IntPtr CSharp_GetWindowsDeviceName__SWIG_0(int jarg1, out uint jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetWindowsDeviceName__SWIG_1")] public static extern global::System.IntPtr CSharp_GetWindowsDeviceName__SWIG_1(int jarg1, out uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetWindowsDeviceCount__SWIG_0")] public static extern uint CSharp_GetWindowsDeviceCount__SWIG_0(int jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetWindowsDeviceCount__SWIG_1")] public static extern uint CSharp_GetWindowsDeviceCount__SWIG_1(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkStreamMgrSettings_uMemorySize_set")] public static extern void CSharp_AkStreamMgrSettings_uMemorySize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkStreamMgrSettings_uMemorySize_get")] public static extern uint CSharp_AkStreamMgrSettings_uMemorySize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkStreamMgrSettings")] public static extern global::System.IntPtr CSharp_new_AkStreamMgrSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkStreamMgrSettings")] public static extern void CSharp_delete_AkStreamMgrSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_pIOMemory_set")] public static extern void CSharp_AkDeviceSettings_pIOMemory_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_pIOMemory_get")] public static extern global::System.IntPtr CSharp_AkDeviceSettings_pIOMemory_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uIOMemorySize_set")] public static extern void CSharp_AkDeviceSettings_uIOMemorySize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uIOMemorySize_get")] public static extern uint CSharp_AkDeviceSettings_uIOMemorySize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uIOMemoryAlignment_set")] public static extern void CSharp_AkDeviceSettings_uIOMemoryAlignment_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uIOMemoryAlignment_get")] public static extern uint CSharp_AkDeviceSettings_uIOMemoryAlignment_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_ePoolAttributes_set")] public static extern void CSharp_AkDeviceSettings_ePoolAttributes_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_ePoolAttributes_get")] public static extern int CSharp_AkDeviceSettings_ePoolAttributes_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uGranularity_set")] public static extern void CSharp_AkDeviceSettings_uGranularity_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uGranularity_get")] public static extern uint CSharp_AkDeviceSettings_uGranularity_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uSchedulerTypeFlags_set")] public static extern void CSharp_AkDeviceSettings_uSchedulerTypeFlags_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uSchedulerTypeFlags_get")] public static extern uint CSharp_AkDeviceSettings_uSchedulerTypeFlags_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_threadProperties_set")] public static extern void CSharp_AkDeviceSettings_threadProperties_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_threadProperties_get")] public static extern global::System.IntPtr CSharp_AkDeviceSettings_threadProperties_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_set")] public static extern void CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_set(global::System.IntPtr jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_get")] public static extern float CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uMaxConcurrentIO_set")] public static extern void CSharp_AkDeviceSettings_uMaxConcurrentIO_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uMaxConcurrentIO_get")] public static extern uint CSharp_AkDeviceSettings_uMaxConcurrentIO_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_bUseStreamCache_set")] public static extern void CSharp_AkDeviceSettings_bUseStreamCache_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_bUseStreamCache_get")] public static extern bool CSharp_AkDeviceSettings_bUseStreamCache_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uMaxCachePinnedBytes_set")] public static extern void CSharp_AkDeviceSettings_uMaxCachePinnedBytes_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDeviceSettings_uMaxCachePinnedBytes_get")] public static extern uint CSharp_AkDeviceSettings_uMaxCachePinnedBytes_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkDeviceSettings")] public static extern global::System.IntPtr CSharp_new_AkDeviceSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkDeviceSettings")] public static extern void CSharp_delete_AkDeviceSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkThreadProperties_nPriority_set")] public static extern void CSharp_AkThreadProperties_nPriority_set(global::System.IntPtr jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkThreadProperties_nPriority_get")] public static extern int CSharp_AkThreadProperties_nPriority_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkThreadProperties_dwAffinityMask_set")] public static extern void CSharp_AkThreadProperties_dwAffinityMask_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkThreadProperties_dwAffinityMask_get")] public static extern uint CSharp_AkThreadProperties_dwAffinityMask_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkThreadProperties_uStackSize_set")] public static extern void CSharp_AkThreadProperties_uStackSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkThreadProperties_uStackSize_get")] public static extern uint CSharp_AkThreadProperties_uStackSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkThreadProperties")] public static extern global::System.IntPtr CSharp_new_AkThreadProperties(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkThreadProperties")] public static extern void CSharp_delete_AkThreadProperties(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetErrorLogger__SWIG_0")] public static extern void CSharp_SetErrorLogger__SWIG_0(AkLogger.ErrorLoggerInteropDelegate jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetErrorLogger__SWIG_1")] public static extern void CSharp_SetErrorLogger__SWIG_1(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetAudioInputCallbacks")] public static extern void CSharp_SetAudioInputCallbacks(AkAudioInputManager.AudioSamplesInteropDelegate jarg1, AkAudioInputManager.AudioFormatInteropDelegate jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPathParams_listenerPos_set")] public static extern void CSharp_AkPathParams_listenerPos_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPathParams_listenerPos_get")] public static extern global::System.IntPtr CSharp_AkPathParams_listenerPos_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPathParams_emitterPos_set")] public static extern void CSharp_AkPathParams_emitterPos_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPathParams_emitterPos_get")] public static extern global::System.IntPtr CSharp_AkPathParams_emitterPos_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPathParams_numValidPaths_set")] public static extern void CSharp_AkPathParams_numValidPaths_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPathParams_numValidPaths_get")] public static extern uint CSharp_AkPathParams_numValidPaths_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkPathParams")] public static extern global::System.IntPtr CSharp_new_AkPathParams(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkPathParams")] public static extern void CSharp_delete_AkPathParams(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkUnityPlatformSpecificSettings")] public static extern global::System.IntPtr CSharp_new_AkUnityPlatformSpecificSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkUnityPlatformSpecificSettings")] public static extern void CSharp_delete_AkUnityPlatformSpecificSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkCommunicationSettings")] public static extern global::System.IntPtr CSharp_new_AkCommunicationSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uPoolSize_set")] public static extern void CSharp_AkCommunicationSettings_uPoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uPoolSize_get")] public static extern uint CSharp_AkCommunicationSettings_uPoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uDiscoveryBroadcastPort_set")] public static extern void CSharp_AkCommunicationSettings_uDiscoveryBroadcastPort_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uDiscoveryBroadcastPort_get")] public static extern ushort CSharp_AkCommunicationSettings_uDiscoveryBroadcastPort_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uCommandPort_set")] public static extern void CSharp_AkCommunicationSettings_uCommandPort_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uCommandPort_get")] public static extern ushort CSharp_AkCommunicationSettings_uCommandPort_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uNotificationPort_set")] public static extern void CSharp_AkCommunicationSettings_uNotificationPort_set(global::System.IntPtr jarg1, ushort jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_uNotificationPort_get")] public static extern ushort CSharp_AkCommunicationSettings_uNotificationPort_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_bInitSystemLib_set")] public static extern void CSharp_AkCommunicationSettings_bInitSystemLib_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_bInitSystemLib_get")] public static extern bool CSharp_AkCommunicationSettings_bInitSystemLib_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_szAppNetworkName_set")] public static extern void CSharp_AkCommunicationSettings_szAppNetworkName_set(global::System.IntPtr jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkCommunicationSettings_szAppNetworkName_get")] public static extern global::System.IntPtr CSharp_AkCommunicationSettings_szAppNetworkName_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkCommunicationSettings")] public static extern void CSharp_delete_AkCommunicationSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkInitializationSettings")] public static extern global::System.IntPtr CSharp_new_AkInitializationSettings(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkInitializationSettings")] public static extern void CSharp_delete_AkInitializationSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_memSettings_set")] public static extern void CSharp_AkInitializationSettings_memSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_memSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_memSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_streamMgrSettings_set")] public static extern void CSharp_AkInitializationSettings_streamMgrSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_streamMgrSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_streamMgrSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_deviceSettings_set")] public static extern void CSharp_AkInitializationSettings_deviceSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_deviceSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_deviceSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_initSettings_set")] public static extern void CSharp_AkInitializationSettings_initSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_initSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_initSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_platformSettings_set")] public static extern void CSharp_AkInitializationSettings_platformSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_platformSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_platformSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_musicSettings_set")] public static extern void CSharp_AkInitializationSettings_musicSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_musicSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_musicSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_preparePoolSize_set")] public static extern void CSharp_AkInitializationSettings_preparePoolSize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_preparePoolSize_get")] public static extern uint CSharp_AkInitializationSettings_preparePoolSize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_unityPlatformSpecificSettings_set")] public static extern void CSharp_AkInitializationSettings_unityPlatformSpecificSettings_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_unityPlatformSpecificSettings_get")] public static extern global::System.IntPtr CSharp_AkInitializationSettings_unityPlatformSpecificSettings_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_useAsyncOpen_set")] public static extern void CSharp_AkInitializationSettings_useAsyncOpen_set(global::System.IntPtr jarg1, bool jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkInitializationSettings_useAsyncOpen_get")] public static extern bool CSharp_AkInitializationSettings_useAsyncOpen_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkExternalSourceInfo__SWIG_0")] public static extern global::System.IntPtr CSharp_new_AkExternalSourceInfo__SWIG_0(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_delete_AkExternalSourceInfo")] public static extern void CSharp_delete_AkExternalSourceInfo(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkExternalSourceInfo__SWIG_1")] public static extern global::System.IntPtr CSharp_new_AkExternalSourceInfo__SWIG_1(global::System.IntPtr jarg1, uint jarg2, uint jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkExternalSourceInfo__SWIG_2")] public static extern global::System.IntPtr CSharp_new_AkExternalSourceInfo__SWIG_2([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_new_AkExternalSourceInfo__SWIG_3")] public static extern global::System.IntPtr CSharp_new_AkExternalSourceInfo__SWIG_3(uint jarg1, uint jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_Clear")] public static extern void CSharp_AkExternalSourceInfo_Clear(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_Clone")] public static extern void CSharp_AkExternalSourceInfo_Clone(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_GetSizeOf")] public static extern int CSharp_AkExternalSourceInfo_GetSizeOf(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_iExternalSrcCookie_set")] public static extern void CSharp_AkExternalSourceInfo_iExternalSrcCookie_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_iExternalSrcCookie_get")] public static extern uint CSharp_AkExternalSourceInfo_iExternalSrcCookie_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_idCodec_set")] public static extern void CSharp_AkExternalSourceInfo_idCodec_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_idCodec_get")] public static extern uint CSharp_AkExternalSourceInfo_idCodec_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_szFile_set")] public static extern void CSharp_AkExternalSourceInfo_szFile_set(global::System.IntPtr jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_szFile_get")] public static extern global::System.IntPtr CSharp_AkExternalSourceInfo_szFile_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_pInMemory_set")] public static extern void CSharp_AkExternalSourceInfo_pInMemory_set(global::System.IntPtr jarg1, global::System.IntPtr jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_pInMemory_get")] public static extern global::System.IntPtr CSharp_AkExternalSourceInfo_pInMemory_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_uiMemorySize_set")] public static extern void CSharp_AkExternalSourceInfo_uiMemorySize_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_uiMemorySize_get")] public static extern uint CSharp_AkExternalSourceInfo_uiMemorySize_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_idFile_set")] public static extern void CSharp_AkExternalSourceInfo_idFile_set(global::System.IntPtr jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkExternalSourceInfo_idFile_get")] public static extern uint CSharp_AkExternalSourceInfo_idFile_get(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_Init")] public static extern int CSharp_Init(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_InitSpatialAudio")] public static extern int CSharp_InitSpatialAudio(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_InitCommunication")] public static extern int CSharp_InitCommunication(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_Term")] public static extern void CSharp_Term(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RegisterGameObjInternal")] public static extern int CSharp_RegisterGameObjInternal(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnregisterGameObjInternal")] public static extern int CSharp_UnregisterGameObjInternal(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RegisterGameObjInternal_WithName")] public static extern int CSharp_RegisterGameObjInternal_WithName(ulong jarg1, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetBasePath")] public static extern int CSharp_SetBasePath([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetCurrentLanguage")] public static extern int CSharp_SetCurrentLanguage([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadFilePackage")] public static extern int CSharp_LoadFilePackage([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, out uint jarg2, int jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AddBasePath")] public static extern int CSharp_AddBasePath([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetGameName")] public static extern int CSharp_SetGameName([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetDecodedBankPath")] public static extern int CSharp_SetDecodedBankPath([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadAndDecodeBank")] public static extern int CSharp_LoadAndDecodeBank([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg1, bool jarg2, out uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_LoadAndDecodeBankFromMemory")] public static extern int CSharp_LoadAndDecodeBankFromMemory(global::System.IntPtr jarg1, uint jarg2, bool jarg3, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]string jarg4, bool jarg5, out uint jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetCurrentLanguage")] public static extern global::System.IntPtr CSharp_GetCurrentLanguage(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadFilePackage")] public static extern int CSharp_UnloadFilePackage(uint jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnloadAllFilePackages")] public static extern int CSharp_UnloadAllFilePackages(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetObjectPosition")] public static extern int CSharp_SetObjectPosition(ulong jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSourceMultiplePlayPositions")] public static extern int CSharp_GetSourceMultiplePlayPositions(uint jarg1, [global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg2, [global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]uint[] jarg3, [global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]int[] jarg4, ref uint jarg5, bool jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetListeners")] public static extern int CSharp_SetListeners(ulong jarg1, ulong[] jarg2, uint jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetDefaultListeners")] public static extern int CSharp_SetDefaultListeners(ulong[] jarg1, uint jarg2); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AddOutput")] public static extern int CSharp_AddOutput(global::System.IntPtr jarg1, out ulong jarg2, ulong[] jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDefaultStreamSettings")] public static extern void CSharp_GetDefaultStreamSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDefaultDeviceSettings")] public static extern void CSharp_GetDefaultDeviceSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDefaultMusicSettings")] public static extern void CSharp_GetDefaultMusicSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDefaultInitSettings")] public static extern void CSharp_GetDefaultInitSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetDefaultPlatformInitSettings")] public static extern void CSharp_GetDefaultPlatformInitSettings(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetMajorMinorVersion")] public static extern uint CSharp_GetMajorMinorVersion(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_GetSubminorBuildVersion")] public static extern uint CSharp_GetSubminorBuildVersion(); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_QueryIndirectPaths")] public static extern int CSharp_QueryIndirectPaths(ulong jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_QueryDiffractionPaths")] public static extern int CSharp_QueryDiffractionPaths(ulong jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, uint jarg4); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRoomPortal")] public static extern int CSharp_SetRoomPortal(ulong jarg1, global::System.IntPtr jarg2, global::System.IntPtr jarg3, bool jarg4, ulong jarg5, ulong jarg6); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetRoom")] public static extern int CSharp_SetRoom(ulong jarg1, global::System.IntPtr jarg2, [global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPStr)]string jarg3); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_RegisterSpatialAudioListener")] public static extern int CSharp_RegisterSpatialAudioListener(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_UnregisterSpatialAudioListener")] public static extern int CSharp_UnregisterSpatialAudioListener(ulong jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_SetGeometry")] public static extern int CSharp_SetGeometry(ulong jarg1, global::System.IntPtr jarg2, uint jarg3, global::System.IntPtr jarg4, uint jarg5, global::System.IntPtr jarg6, uint jarg7, ulong jarg8, bool jarg9, bool jarg10); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkPlaylist_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkPlaylist_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIPost_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkMIDIPost_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkEventCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkEventCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMIDIEventCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkMIDIEventCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMarkerCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkMarkerCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDurationCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkDurationCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkDynamicSequenceItemCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkDynamicSequenceItemCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicSyncCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkMusicSyncCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport("AkSoundEngine", EntryPoint="CSharp_AkMusicPlaylistCallbackInfo_SWIGUpcast")] public static extern global::System.IntPtr CSharp_AkMusicPlaylistCallbackInfo_SWIGUpcast(global::System.IntPtr jarg1);} #endif // #if (UNITY_STANDALONE_WIN && !UNITY_EDITOR) || UNITY_EDITOR_WIN
117.756141
615
0.835839
[ "Apache-2.0" ]
cece95/GGJ2020-EarthBuilders
Assets/Wwise/Deployment/API/Generated/Windows/AkSoundEnginePINVOKE_Windows.cs
263,656
C#
using MBN; using MBN.Modules; using System; using System.Threading; namespace Examples { class Program { static void Main() { Test7Seg(); Thread.Sleep(Timeout.Infinite); } private static void Test7Seg() { var seg = new Ut7SegClick(Hardware.SocketOne); // Displays from 0 to 9.9 // Trick : no float here, only bytes, the dot is added as soon as i > 9 for (Byte i = 0; i < 100; i++) { seg.Write(i < 10 ? new Byte[] { seg.GetDigit(i), 0x00 } : new[] { seg.GetDigit((Byte)(i % 10)), (Byte)(seg.GetDigit((Byte)(i / 10)) | 0b10000000) }); Thread.Sleep(100); } Thread.Sleep(2000); seg.Clear(); seg.Enabled = false; } } }
24.864865
114
0.446739
[ "Apache-2.0" ]
MBNSoftware/MBN-TinyCLR
Examples/UT-X-7SegClick/Program.cs
922
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Device.I2c; namespace Iot.Device.SenseHat { /// <summary> /// SenseHAT - Joystick /// </summary> public class SenseHatJoystick : IDisposable { /// <summary> /// Default I2C address /// </summary> public const int I2cAddress = 0x46; private const byte StateRegister = 0xF2; private I2cDevice _i2c; /// <summary> /// Constructs SenseHatJoystick instance /// </summary> /// <param name="i2cDevice">I2C device used to communicate with the device</param> public SenseHatJoystick(I2cDevice? i2cDevice = null) { _i2c = i2cDevice ?? CreateDefaultI2cDevice(); Read(); } /// <summary> /// Is holding left /// </summary> public bool HoldingLeft { get; private set; } /// <summary> /// Is holding right /// </summary> public bool HoldingRight { get; private set; } /// <summary> /// Is holding up /// </summary> public bool HoldingUp { get; private set; } /// <summary> /// Is holding down /// </summary> public bool HoldingDown { get; private set; } /// <summary> /// Is holding button /// </summary> public bool HoldingButton { get; private set; } /// <summary> /// Read joystick state /// </summary> public void Read() { JoystickState state = ReadState(); HoldingLeft = state.HasFlag(JoystickState.Left); HoldingRight = state.HasFlag(JoystickState.Right); HoldingUp = state.HasFlag(JoystickState.Up); HoldingDown = state.HasFlag(JoystickState.Down); HoldingButton = state.HasFlag(JoystickState.Button); } private static I2cDevice CreateDefaultI2cDevice() { I2cConnectionSettings settings = new (1, I2cAddress); return I2cDevice.Create(settings); } /// <inheritdoc/> public void Dispose() { _i2c?.Dispose(); _i2c = null!; } private JoystickState ReadState() { _i2c.WriteByte(StateRegister); return (JoystickState)_i2c.ReadByte(); } [Flags] private enum JoystickState : byte { Down = 1, Right = 1 << 1, Up = 1 << 2, Button = 1 << 3, Left = 1 << 4, } } }
26.98
90
0.52891
[ "MIT" ]
AU-tomata/iot
src/devices/SenseHat/SenseHatJoystick.cs
2,700
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class WrongAndGood : MonoBehaviour { public bool correctAnswer; void Start() { correctAnswer = false; } // Update is called once per frame void Update() { } }
15.05
41
0.627907
[ "Apache-2.0" ]
Yes-Brothers-Co/KingFrog
Assets/Script/Interactions/WrongAndGood.cs
303
C#
using System; using System.Collections.Generic; using System.Text; namespace Mastersign.Bench.PropertyCollections { /// <summary> /// This interface describes an object, which stores grouped properties. /// It is a combination of <see cref="IGroupedPropertySource"/> and <see cref="IGroupedPropertyTarget"/>. /// </summary> public interface IGroupedPropertyCollection : IGroupedPropertySource, IGroupedPropertyTarget { /// <summary> /// Gets the groups in this collection. /// </summary> /// <returns>An enumeration of group names.</returns> IEnumerable<string> Groups(); /// <summary> /// Gets all groups, marked with the specified category. /// </summary> /// <param name="category">The category.</param> /// <returns>An enumeration of group names.</returns> IEnumerable<string> GroupsByCategory(string category); /// <summary> /// Gets the property names in the specified group. /// </summary> /// <param name="group">The group name.</param> /// <returns>An enumeration of property names.</returns> IEnumerable<string> PropertyNames(string group); /// <summary> /// Gets the value of the specified property, or a given default value, /// in case the specified property does not exist. /// </summary> /// <param name="group">The group of the property.</param> /// <param name="name">The name of the property.</param> /// <param name="def">The default value.</param> /// <returns>The value of the specified property, or <paramref name="def"/> /// in case the specified value does not exist.</returns> object GetGroupValue(string group, string name, object def); /// <summary> /// Checks, whether this collection contains properties in the specified group. /// </summary> /// <param name="group">The name of the group.</param> /// <returns><c>true</c> if properties in the specified group exists; /// otherwise <c>false</c>.</returns> /// <seealso cref="IPropertySource.CanGetValue(string)"/> bool ContainsGroup(string group); /// <summary> /// Checks, whether this collection contains the specified property in the specified group. /// </summary> /// <param name="group">The group of the property.</param> /// <param name="name">The name of the property.</param> /// <returns><c>true</c> if this collection contains the specified property; /// otherwise <c>false</c>.</returns> /// <seealso cref="IPropertySource.CanGetValue(string)"/> bool ContainsGroupValue(string group, string name); } }
43.4375
109
0.623381
[ "MIT" ]
winbench/bench
BenchManager/BenchLib/PropertyCollections/IGroupedPropertyCollection.cs
2,782
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UncommonSense.CBreeze.Automation { public static class ParameterSetNames { public const string AddWithID = "AddWithID"; public const string AddWithoutID = "AddWithoutID"; public const string NewWithID = "NewWithID"; public const string NewWithoutID = "NewWithoutID"; public static IEnumerable<string> Enumerate() { yield return AddWithID; yield return AddWithoutID; yield return NewWithID; yield return NewWithoutID; } public static bool IsAdd(string name) => (name == AddWithID) || (name == AddWithoutID); public static bool IsNew(string name) => (name == NewWithID) || (name == NewWithoutID); public static bool WithID(string name) => (name == AddWithID) || (name == NewWithID); public static bool WithoutID(string name) => (name == AddWithoutID) || (name == NewWithoutID); } }
33.125
102
0.65
[ "MIT" ]
FSharpCSharp/UncommonSense.CBreeze
CBreeze/UncommonSense.CBreeze.Automation/ParameterSetNames.cs
1,062
C#
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Serialization; public class CameraController : MonoBehaviour { public static CameraController Main; public static Camera Camera; //Static access to our Camera (because Camera.main is expensive) Transform target; //The transform we're following [Tooltip("How much to multiply the mouse axis values")] [SerializeField] float sensitivity = 1f; //Multiplier for mouse axis values [Tooltip("How fast the camera follows the target's position")] [SerializeField] float followSpeed = 50f; //How fast we're following the target (lower is slower) [Tooltip("How fast the camera follows the target's rotation")] [SerializeField] float rotationSpeed = 50f; //How fast we're matching rotation of the target [Tooltip("How far up we can look")] [SerializeField] float minAngle = -89; //Less than 90 to avoid gimbal lock [Tooltip("How far down we can look")] [SerializeField] float maxAngle = 89; //Runtime values Vector2 lookAxis; Vector3 currentPosition; Quaternion currentRotation; Vector3 targetForward; float verticalAngle; void Awake() { Main = this; Camera = GetComponent<Camera> (); } public void SetTarget(Transform t) { target = t; targetForward = target.forward; transform.SetPositionAndRotation (target.position, target.rotation); } public void LookInput(Vector2 axis) { lookAxis = axis; } void LateUpdate() { var delta = Time.deltaTime; var worldUp = Vector3.up; //Calculate rotation after input Quaternion rotationFromInput = Quaternion.Euler(worldUp * (lookAxis.x * sensitivity)); targetForward = rotationFromInput * targetForward; targetForward = Vector3.Cross(worldUp, Vector3.Cross(targetForward, worldUp)); verticalAngle -= lookAxis.y * sensitivity; verticalAngle = Mathf.Clamp(verticalAngle, minAngle, maxAngle); //Calculate final rotation values Quaternion forwardRotation = Quaternion.LookRotation(targetForward, worldUp); Quaternion verticalRotation = Quaternion.Euler(verticalAngle, 0, 0); currentPosition = Vector3.Lerp (currentPosition, target.position, followSpeed * delta); currentRotation = Quaternion.Slerp(currentRotation, forwardRotation * verticalRotation, rotationSpeed * delta); transform.SetPositionAndRotation (currentPosition, currentRotation); } }
31.407895
113
0.758693
[ "MIT" ]
pheonise/Basic-Character-Controller
Assets/Scripts/Characters/CameraController.cs
2,389
C#
using System.Text.RegularExpressions; using System.Threading.Tasks; namespace KeyVaultBuild.Features.Transformation { public class TransformKeys { private readonly ISecretService _secretService; private static readonly Regex KeyRegex = new Regex(@"(?<keyvault>\#{keyvault:[a-zA-Z0-9:\-]*})", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); public TransformKeys(ISecretService secretService) { _secretService = secretService; } public static bool IsKeySyntax(string keySyntax) { return KeyRegex.IsMatch(keySyntax); } public string ReplaceKeys(string content) { return KeyRegex.Replace(content, Evaluator); } private string Evaluator(Match match) { var key = match.Groups["keyvault"].Value; var keyVaultKey = _secretService.ResolveSingleKey(key); var result = Task.Factory.StartNew(() => keyVaultKey.ExecuteAsync()).Unwrap().GetAwaiter().GetResult(); return match.Result(result); } } }
33.088235
180
0.642667
[ "MIT" ]
brendankowitz/KeyVaultBuild
src/KeyVaultBuild.Core/Features/Transformation/TransformKeys.cs
1,127
C#
using System; using System.Threading.Tasks; using Reinforced.Tecture.Channels; using Reinforced.Tecture.Channels.Multiplexer; using Reinforced.Tecture.Commands; using Reinforced.Tecture.Query; using Reinforced.Tecture.Tracing.Commands; using Reinforced.Tecture.Tracing.Commands.Cycles; // ReSharper disable ArrangeAccessorOwnerBody namespace Reinforced.Tecture.Services { public partial class TectureServiceBase : IDisposable { internal TectureServiceBase() { } #region Auto-injected internal ServiceManager ServiceManager; internal ChannelMultiplexer ChannelMultiplexer; internal Pipeline Pipeline; internal AuxiliaryContainer Aux; internal void CallOnSave() => OnSave(); internal void CallOnFinally() => OnFinally(); internal Task CallOnSaveAsync() => OnSaveAsync(); internal Task CallOnFinallyAsync() => OnFinallyAsync(); internal void CallInit() => Init(); #endregion /// <summary> /// Determines whether particular channel is bound or not /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> protected bool IsBound<T>() where T : Channel => ChannelMultiplexer.IsKnown(typeof(T)); /// <summary> /// Await point to split actions before/after savechanges call /// </summary> protected ActionsQueueTask Save => new ActionsQueueTask(Pipeline.PostSaveActions); /// <summary> /// Await point to split actions that must happen after everything /// </summary> protected ActionsQueueTask Final => new ActionsQueueTask(Pipeline.FinallyActions); /// <summary> /// Aggregating service pattern. Override this method to write aggregated data before save changes call. Use await Save; if necessary /// </summary> protected virtual void OnSave() { } /// <summary> /// Aggregating service pattern. Override this method to write aggregated data after all save changes calls. /// </summary> protected virtual void OnFinally() { } /// <summary> /// Aggregating service pattern. Override this method to write aggregated data before save changes call. Use await Save; if necessary /// </summary> #pragma warning disable 1998 protected virtual async Task OnSaveAsync() { } /// <summary> /// Aggregating service pattern. Override this method to write aggregated data after all save changes calls. /// </summary> protected virtual async Task OnFinallyAsync() { } #pragma warning restore 1998 /// <summary> /// Called right after service initialization. Use it to do things right after service is created /// </summary> protected virtual void Init() { } /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> public void Dispose() { ServiceManager.DestroyService(this); } /// <summary> /// Comments some activity. Comment goes directly to pipeline queue as fake side-effect /// </summary> /// <param name="comment">Comment text</param> [Unexplainable] protected void Comment(string comment) { Pipeline.Enqueue(new Comment() { Annotation = comment }); } /// <summary> /// Begins cycle description region /// </summary> /// <param name="annotation">Cycle begin annotation</param> /// <returns>Cycle context</returns> protected ICycleTraceContext Cycle(string annotation = null) { if (Aux.TraceCollector != null) { return new CycleTraceContext(Pipeline, annotation); } return new FakeCycleTraceContext(); } } }
35.727273
141
0.639949
[ "MIT" ]
fjod/Reinforced.Tecture
Reinforced.Tecture/Services/TectureServiceBase.cs
3,932
C#
// <copyright file="Constants.cs" company="Microsoft"> // Copyright (c) Microsoft. All rights reserved. // </copyright> namespace Microsoft.Teams.Shifts.Integration.API.Common { /// <summary> /// This class models the constants being used. /// </summary> public static class Constants { /// <summary> /// User.Read score for Graph API. /// </summary> public const string ScopeUserRead = "User.Read"; /// <summary> /// Bearer for authorization. /// </summary> public const string BearerAuthorizationScheme = "Bearer"; /// <summary> /// Cache key to store Kronos JSessionId. /// </summary> public const string KronosLoginCacheKey = "KronosLoginCache"; /// <summary> /// Identifier of the target resource that is the recipient of the requested token. /// </summary> public const string Resource = "https://graph.microsoft.com"; /// <summary> /// The scope for WorkforceIntegration.Read.All. /// </summary> public const string ScopeWorkforceIntegrationRead = "WorkforceIntegration.Read.All"; /// <summary> /// The scope for WorkforceIntegration.ReadWrite.All. /// </summary> public const string ScopeWorkforceIntegrationReadWriteAll = "WorkforceIntegration.ReadWrite.All"; /// <summary> /// The scope for Group.Read.All. /// </summary> public const string ScopeGroupReadAll = "Group.Read.All"; /// <summary> /// The scope for Group.ReadWrite.All. /// </summary> public const string ScopeGroupReadWriteAll = "Group.ReadWrite.All"; /// <summary> /// Workforce integration supported entities. /// </summary> public const string WFISupports = "Shift, SwapRequest, OpenShift, OpenShiftRequest, TimeOffRequest"; /// <summary> /// Workforce integration supported eligibility filtering entities. /// </summary> public const string WFISupportedEligibilityFiltering = "SwapRequest"; /// <summary> /// Number of open slots for creating a new Open Shift in Shifts. /// </summary> public const int ShiftsOpenSlotCount = 1; /// <summary> /// Defines the StartDayNumber string. /// </summary> public const string StartDayNumberString = "1"; /// <summary> /// Defines the EndDayNumber string. /// </summary> public const string EndDayNumberString = "1"; /// <summary> /// Defines the date format. /// </summary> public const string DateFormat = "M/dd/yyyy"; /// <summary> /// Defines the API controller method in the ShiftController. /// </summary> public const string SyncShiftsFromKronos = "SyncShiftsFromKronos"; /// <summary> /// This constant defines the pending status for the Open Shift Request from Shifts. /// </summary> public const string ShiftsOpenShiftRequestPendingStatus = "Pending"; } }
34.076087
108
0.603828
[ "MIT" ]
Andy65/Microsoft-Teams-Shifts-WFM-Connectors
Kronos-Shifts-Connector/Microsoft.Teams.Shifts.Integration/Microsoft.Teams.Shifts.Integration.API/Common/Constants.cs
3,137
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("deveeldb-log4net")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("deveeldb-log4net")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cfacaa61-ae33-4618-a953-61fa62f74b29")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.972973
84
0.745196
[ "Apache-2.0" ]
deveel/deveeldb-log4net
src/deveeldb-log4net/Properties/AssemblyInfo.cs
1,408
C#
using System.IO; using Marten.Schema; using Marten.Storage; namespace Marten.Events { // SAMPLE: AppendEventFunction public class AppendEventFunction : Function { private readonly EventGraph _events; public AppendEventFunction(EventGraph events) : base(new DbObjectName(events.DatabaseSchemaName, "mt_append_event")) { _events = events; } public override void Write(DdlRules rules, StringWriter writer) { var streamIdType = _events.GetStreamIdDBType(); var databaseSchema = _events.DatabaseSchemaName; var tenancyStyle = _events.TenancyStyle; var streamsWhere = "id = stream"; if (tenancyStyle == TenancyStyle.Conjoined) { streamsWhere += " AND tenant_id = tenantid"; } writer.WriteLine($@" CREATE OR REPLACE FUNCTION {Identifier}(stream {streamIdType}, stream_type varchar, tenantid varchar, event_ids uuid[], event_types varchar[], dotnet_types varchar[], bodies jsonb[]) RETURNS int[] AS $$ DECLARE event_version int; event_type varchar; event_id uuid; body jsonb; index int; seq int; actual_tenant varchar; return_value int[]; BEGIN select version into event_version from {databaseSchema}.mt_streams where {streamsWhere}; if event_version IS NULL then event_version = 0; insert into {databaseSchema}.mt_streams (id, type, version, timestamp, tenant_id) values (stream, stream_type, 0, now(), tenantid); else if tenantid IS NOT NULL then select tenant_id into actual_tenant from {databaseSchema}.mt_streams where {streamsWhere}; if actual_tenant != tenantid then RAISE EXCEPTION 'The tenantid does not match the existing stream'; end if; end if; end if; index := 1; return_value := ARRAY[event_version + array_length(event_ids, 1)]; foreach event_id in ARRAY event_ids loop seq := nextval('{databaseSchema}.mt_events_sequence'); return_value := array_append(return_value, seq); event_version := event_version + 1; event_type = event_types[index]; body = bodies[index]; insert into {databaseSchema}.mt_events (seq_id, id, stream_id, version, data, type, tenant_id, {DocumentMapping.DotNetTypeColumn}) values (seq, event_id, stream, event_version, body, event_type, tenantid, dotnet_types[index]); index := index + 1; end loop; update {databaseSchema}.mt_streams set version = event_version, timestamp = now() where {streamsWhere}; return return_value; END $$ LANGUAGE plpgsql; "); } protected override string toDropSql() { var streamIdType = _events.GetStreamIdDBType(); return $"drop function if exists {Identifier} ({streamIdType}, varchar, varchar, uuid[], varchar[], jsonb[])"; } } // ENDSAMPLE }
31.423913
202
0.675199
[ "MIT" ]
pauleck/marten
src/Marten/Events/AppendEventFunction.cs
2,891
C#
#if WITH_EDITOR #if PLATFORM_64BITS using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace UnrealEngine { /// <summary>The Slot for the USizeBoxSlot, contains the widget displayed in a button's single slot</summary> public partial class USizeBoxSlot { static readonly int Padding__Offset; /// <summary>The padding area between the slot and the content it contains.</summary> public FMargin Padding { get{ CheckIsValid();return (FMargin)Marshal.PtrToStructure(_this.Get()+Padding__Offset, typeof(FMargin));} set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+Padding__Offset, false);} } static readonly int HorizontalAlignment__Offset; /// <summary>The alignment of the object horizontally.</summary> public EHorizontalAlignment HorizontalAlignment { get{ CheckIsValid();return (EHorizontalAlignment)Marshal.PtrToStructure(_this.Get()+HorizontalAlignment__Offset, typeof(EHorizontalAlignment));} set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+HorizontalAlignment__Offset, false);} } static readonly int VerticalAlignment__Offset; /// <summary>The alignment of the object vertically.</summary> public EVerticalAlignment VerticalAlignment { get{ CheckIsValid();return (EVerticalAlignment)Marshal.PtrToStructure(_this.Get()+VerticalAlignment__Offset, typeof(EVerticalAlignment));} set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+VerticalAlignment__Offset, false);} } static USizeBoxSlot() { IntPtr NativeClassPtr=GetNativeClassFromName("SizeBoxSlot"); Padding__Offset=GetPropertyOffset(NativeClassPtr,"Padding"); HorizontalAlignment__Offset=GetPropertyOffset(NativeClassPtr,"HorizontalAlignment"); VerticalAlignment__Offset=GetPropertyOffset(NativeClassPtr,"VerticalAlignment"); } } } #endif #endif
36.173077
147
0.779904
[ "MIT" ]
RobertAcksel/UnrealCS
Engine/Plugins/UnrealCS/UECSharpDomain/UnrealEngine/GeneratedScriptFile_Editor_64bits/USizeBoxSlot_FixSize.cs
1,881
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Manager : MonoBehaviour { public static Manager Instance { set; get; } public Text l1Time; public Text l2Time; public Text l3Time; public Text l4Time; public Text l5Time; public Text l6Time; public Text l7Time; public Text l8Time; public Text l9Time; public Text l10Time; private void Awake() { DontDestroyOnLoad(gameObject); Instance = this; l1bestClearTime(); l2bestClearTime(); l3bestClearTime(); l4bestClearTime(); l5bestClearTime(); l6bestClearTime(); l7bestClearTime(); l8bestClearTime(); l9bestClearTime(); l10bestClearTime(); } public int currentLevel = 0; //Used when changing from menu to game scene public int menuFocus = 0; // used when entering the menu scene void l1bestClearTime() { float duration = SaveManager.Instance.state.level1CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l1Time.text = minutes + ":" + seconds; } void l2bestClearTime() { float duration = SaveManager.Instance.state.level2CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l2Time.text = minutes + ":" + seconds; } void l3bestClearTime() { float duration = SaveManager.Instance.state.level3CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l3Time.text = minutes + ":" + seconds; } void l4bestClearTime() { float duration = SaveManager.Instance.state.level4CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l4Time.text = minutes + ":" + seconds; } void l5bestClearTime() { float duration = SaveManager.Instance.state.level5CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l5Time.text = minutes + ":" + seconds; } void l6bestClearTime() { float duration = SaveManager.Instance.state.level6CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l6Time.text = minutes + ":" + seconds; } void l7bestClearTime() { float duration = SaveManager.Instance.state.level7CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l7Time.text = minutes + ":" + seconds; } void l8bestClearTime() { float duration = SaveManager.Instance.state.level8CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l8Time.text = minutes + ":" + seconds; } void l9bestClearTime() { float duration = SaveManager.Instance.state.level9CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l9Time.text = minutes + ":" + seconds; } void l10bestClearTime() { float duration = SaveManager.Instance.state.level10CompleteTime; string minutes = ((int)duration / 60).ToString(); string seconds = (duration % 60).ToString("f2"); l10Time.text = minutes + ":" + seconds; } }
25.696552
77
0.610038
[ "MIT" ]
razein97/Game-Projects
tumball/Assets/Scripts/Manager.cs
3,728
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the accessanalyzer-2019-11-01.normal.json service model. */ using System; using System.Globalization; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Amazon.AccessAnalyzer; using Amazon.AccessAnalyzer.Model; using Amazon.AccessAnalyzer.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using Amazon.Util; using ServiceClientGenerator; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public partial class AccessAnalyzerMarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("accessanalyzer"); [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ApplyArchiveRuleMarshallTest() { var operation = service_model.FindOperation("ApplyArchiveRule"); var request = InstantiateClassGenerator.Execute<ApplyArchiveRuleRequest>(); var marshaller = new ApplyArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ApplyArchiveRule", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ApplyArchiveRule_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ApplyArchiveRule"); var request = InstantiateClassGenerator.Execute<ApplyArchiveRuleRequest>(); var marshaller = new ApplyArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ApplyArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ApplyArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ApplyArchiveRule_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ApplyArchiveRule"); var request = InstantiateClassGenerator.Execute<ApplyArchiveRuleRequest>(); var marshaller = new ApplyArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ApplyArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ApplyArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ApplyArchiveRule_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ApplyArchiveRule"); var request = InstantiateClassGenerator.Execute<ApplyArchiveRuleRequest>(); var marshaller = new ApplyArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ApplyArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ApplyArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ApplyArchiveRule_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ApplyArchiveRule"); var request = InstantiateClassGenerator.Execute<ApplyArchiveRuleRequest>(); var marshaller = new ApplyArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ApplyArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ApplyArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ApplyArchiveRule_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ApplyArchiveRule"); var request = InstantiateClassGenerator.Execute<ApplyArchiveRuleRequest>(); var marshaller = new ApplyArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ApplyArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ApplyArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CancelPolicyGenerationMarshallTest() { var operation = service_model.FindOperation("CancelPolicyGeneration"); var request = InstantiateClassGenerator.Execute<CancelPolicyGenerationRequest>(); var marshaller = new CancelPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CancelPolicyGeneration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CancelPolicyGenerationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CancelPolicyGenerationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CancelPolicyGeneration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CancelPolicyGeneration"); var request = InstantiateClassGenerator.Execute<CancelPolicyGenerationRequest>(); var marshaller = new CancelPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CancelPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CancelPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CancelPolicyGeneration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CancelPolicyGeneration"); var request = InstantiateClassGenerator.Execute<CancelPolicyGenerationRequest>(); var marshaller = new CancelPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CancelPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CancelPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CancelPolicyGeneration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CancelPolicyGeneration"); var request = InstantiateClassGenerator.Execute<CancelPolicyGenerationRequest>(); var marshaller = new CancelPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CancelPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CancelPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CancelPolicyGeneration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CancelPolicyGeneration"); var request = InstantiateClassGenerator.Execute<CancelPolicyGenerationRequest>(); var marshaller = new CancelPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CancelPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CancelPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreviewMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateAccessPreviewResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateAccessPreviewResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAccessPreview_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAccessPreview"); var request = InstantiateClassGenerator.Execute<CreateAccessPreviewRequest>(); var marshaller = new CreateAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzerMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateAnalyzerResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateAnalyzerResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzer_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzer_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzer_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzer_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzer_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateAnalyzer_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAnalyzer"); var request = InstantiateClassGenerator.Execute<CreateAnalyzerRequest>(); var marshaller = new CreateAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRuleMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void CreateArchiveRule_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateArchiveRule"); var request = InstantiateClassGenerator.Execute<CreateArchiveRuleRequest>(); var marshaller = new CreateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteAnalyzerMarshallTest() { var operation = service_model.FindOperation("DeleteAnalyzer"); var request = InstantiateClassGenerator.Execute<DeleteAnalyzerRequest>(); var marshaller = new DeleteAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAnalyzer", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteAnalyzer_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAnalyzer"); var request = InstantiateClassGenerator.Execute<DeleteAnalyzerRequest>(); var marshaller = new DeleteAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteAnalyzer_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAnalyzer"); var request = InstantiateClassGenerator.Execute<DeleteAnalyzerRequest>(); var marshaller = new DeleteAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteAnalyzer_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAnalyzer"); var request = InstantiateClassGenerator.Execute<DeleteAnalyzerRequest>(); var marshaller = new DeleteAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteAnalyzer_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAnalyzer"); var request = InstantiateClassGenerator.Execute<DeleteAnalyzerRequest>(); var marshaller = new DeleteAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteAnalyzer_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAnalyzer"); var request = InstantiateClassGenerator.Execute<DeleteAnalyzerRequest>(); var marshaller = new DeleteAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteArchiveRuleMarshallTest() { var operation = service_model.FindOperation("DeleteArchiveRule"); var request = InstantiateClassGenerator.Execute<DeleteArchiveRuleRequest>(); var marshaller = new DeleteArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteArchiveRule", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteArchiveRule_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteArchiveRule"); var request = InstantiateClassGenerator.Execute<DeleteArchiveRuleRequest>(); var marshaller = new DeleteArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteArchiveRule_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteArchiveRule"); var request = InstantiateClassGenerator.Execute<DeleteArchiveRuleRequest>(); var marshaller = new DeleteArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteArchiveRule_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteArchiveRule"); var request = InstantiateClassGenerator.Execute<DeleteArchiveRuleRequest>(); var marshaller = new DeleteArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteArchiveRule_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteArchiveRule"); var request = InstantiateClassGenerator.Execute<DeleteArchiveRuleRequest>(); var marshaller = new DeleteArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void DeleteArchiveRule_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteArchiveRule"); var request = InstantiateClassGenerator.Execute<DeleteArchiveRuleRequest>(); var marshaller = new DeleteArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAccessPreviewMarshallTest() { var operation = service_model.FindOperation("GetAccessPreview"); var request = InstantiateClassGenerator.Execute<GetAccessPreviewRequest>(); var marshaller = new GetAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAccessPreview", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetAccessPreviewResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetAccessPreviewResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAccessPreview_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAccessPreview"); var request = InstantiateClassGenerator.Execute<GetAccessPreviewRequest>(); var marshaller = new GetAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAccessPreview_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetAccessPreview"); var request = InstantiateClassGenerator.Execute<GetAccessPreviewRequest>(); var marshaller = new GetAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAccessPreview_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetAccessPreview"); var request = InstantiateClassGenerator.Execute<GetAccessPreviewRequest>(); var marshaller = new GetAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAccessPreview_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetAccessPreview"); var request = InstantiateClassGenerator.Execute<GetAccessPreviewRequest>(); var marshaller = new GetAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAccessPreview_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetAccessPreview"); var request = InstantiateClassGenerator.Execute<GetAccessPreviewRequest>(); var marshaller = new GetAccessPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAccessPreview", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAccessPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzedResourceMarshallTest() { var operation = service_model.FindOperation("GetAnalyzedResource"); var request = InstantiateClassGenerator.Execute<GetAnalyzedResourceRequest>(); var marshaller = new GetAnalyzedResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzedResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetAnalyzedResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetAnalyzedResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzedResource_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzedResource"); var request = InstantiateClassGenerator.Execute<GetAnalyzedResourceRequest>(); var marshaller = new GetAnalyzedResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzedResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzedResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzedResource_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzedResource"); var request = InstantiateClassGenerator.Execute<GetAnalyzedResourceRequest>(); var marshaller = new GetAnalyzedResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzedResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzedResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzedResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzedResource"); var request = InstantiateClassGenerator.Execute<GetAnalyzedResourceRequest>(); var marshaller = new GetAnalyzedResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzedResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzedResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzedResource_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzedResource"); var request = InstantiateClassGenerator.Execute<GetAnalyzedResourceRequest>(); var marshaller = new GetAnalyzedResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzedResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzedResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzedResource_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzedResource"); var request = InstantiateClassGenerator.Execute<GetAnalyzedResourceRequest>(); var marshaller = new GetAnalyzedResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzedResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzedResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzerMarshallTest() { var operation = service_model.FindOperation("GetAnalyzer"); var request = InstantiateClassGenerator.Execute<GetAnalyzerRequest>(); var marshaller = new GetAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzer", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetAnalyzerResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetAnalyzerResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzer_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzer"); var request = InstantiateClassGenerator.Execute<GetAnalyzerRequest>(); var marshaller = new GetAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzer_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzer"); var request = InstantiateClassGenerator.Execute<GetAnalyzerRequest>(); var marshaller = new GetAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzer_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzer"); var request = InstantiateClassGenerator.Execute<GetAnalyzerRequest>(); var marshaller = new GetAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzer_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzer"); var request = InstantiateClassGenerator.Execute<GetAnalyzerRequest>(); var marshaller = new GetAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetAnalyzer_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetAnalyzer"); var request = InstantiateClassGenerator.Execute<GetAnalyzerRequest>(); var marshaller = new GetAnalyzerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAnalyzer", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAnalyzerResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetArchiveRuleMarshallTest() { var operation = service_model.FindOperation("GetArchiveRule"); var request = InstantiateClassGenerator.Execute<GetArchiveRuleRequest>(); var marshaller = new GetArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetArchiveRule", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetArchiveRuleResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetArchiveRuleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetArchiveRule_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetArchiveRule"); var request = InstantiateClassGenerator.Execute<GetArchiveRuleRequest>(); var marshaller = new GetArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetArchiveRule_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetArchiveRule"); var request = InstantiateClassGenerator.Execute<GetArchiveRuleRequest>(); var marshaller = new GetArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetArchiveRule_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetArchiveRule"); var request = InstantiateClassGenerator.Execute<GetArchiveRuleRequest>(); var marshaller = new GetArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetArchiveRule_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetArchiveRule"); var request = InstantiateClassGenerator.Execute<GetArchiveRuleRequest>(); var marshaller = new GetArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetArchiveRule_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetArchiveRule"); var request = InstantiateClassGenerator.Execute<GetArchiveRuleRequest>(); var marshaller = new GetArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetFindingMarshallTest() { var operation = service_model.FindOperation("GetFinding"); var request = InstantiateClassGenerator.Execute<GetFindingRequest>(); var marshaller = new GetFindingRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFinding", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetFindingResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetFindingResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetFinding_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetFinding"); var request = InstantiateClassGenerator.Execute<GetFindingRequest>(); var marshaller = new GetFindingRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFinding", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetFinding_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetFinding"); var request = InstantiateClassGenerator.Execute<GetFindingRequest>(); var marshaller = new GetFindingRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFinding", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetFinding_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetFinding"); var request = InstantiateClassGenerator.Execute<GetFindingRequest>(); var marshaller = new GetFindingRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFinding", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetFinding_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetFinding"); var request = InstantiateClassGenerator.Execute<GetFindingRequest>(); var marshaller = new GetFindingRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFinding", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetFinding_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetFinding"); var request = InstantiateClassGenerator.Execute<GetFindingRequest>(); var marshaller = new GetFindingRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFinding", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetGeneratedPolicyMarshallTest() { var operation = service_model.FindOperation("GetGeneratedPolicy"); var request = InstantiateClassGenerator.Execute<GetGeneratedPolicyRequest>(); var marshaller = new GetGeneratedPolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGeneratedPolicy", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetGeneratedPolicyResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetGeneratedPolicyResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetGeneratedPolicy_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetGeneratedPolicy"); var request = InstantiateClassGenerator.Execute<GetGeneratedPolicyRequest>(); var marshaller = new GetGeneratedPolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGeneratedPolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGeneratedPolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetGeneratedPolicy_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetGeneratedPolicy"); var request = InstantiateClassGenerator.Execute<GetGeneratedPolicyRequest>(); var marshaller = new GetGeneratedPolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGeneratedPolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGeneratedPolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetGeneratedPolicy_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetGeneratedPolicy"); var request = InstantiateClassGenerator.Execute<GetGeneratedPolicyRequest>(); var marshaller = new GetGeneratedPolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGeneratedPolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGeneratedPolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void GetGeneratedPolicy_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetGeneratedPolicy"); var request = InstantiateClassGenerator.Execute<GetGeneratedPolicyRequest>(); var marshaller = new GetGeneratedPolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGeneratedPolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGeneratedPolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindingsMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListAccessPreviewFindingsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListAccessPreviewFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindings_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindings_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindings_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindings_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewFindings_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviewFindings"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewFindingsRequest>(); var marshaller = new ListAccessPreviewFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviewFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviewsMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviews"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewsRequest>(); var marshaller = new ListAccessPreviewsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviews", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListAccessPreviewsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListAccessPreviewsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviews_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviews"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewsRequest>(); var marshaller = new ListAccessPreviewsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviews", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviews_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviews"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewsRequest>(); var marshaller = new ListAccessPreviewsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviews", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviews_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviews"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewsRequest>(); var marshaller = new ListAccessPreviewsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviews", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviews_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviews"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewsRequest>(); var marshaller = new ListAccessPreviewsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviews", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAccessPreviews_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListAccessPreviews"); var request = InstantiateClassGenerator.Execute<ListAccessPreviewsRequest>(); var marshaller = new ListAccessPreviewsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAccessPreviews", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAccessPreviewsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzedResourcesMarshallTest() { var operation = service_model.FindOperation("ListAnalyzedResources"); var request = InstantiateClassGenerator.Execute<ListAnalyzedResourcesRequest>(); var marshaller = new ListAnalyzedResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzedResources", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListAnalyzedResourcesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListAnalyzedResourcesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzedResources_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzedResources"); var request = InstantiateClassGenerator.Execute<ListAnalyzedResourcesRequest>(); var marshaller = new ListAnalyzedResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzedResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzedResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzedResources_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzedResources"); var request = InstantiateClassGenerator.Execute<ListAnalyzedResourcesRequest>(); var marshaller = new ListAnalyzedResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzedResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzedResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzedResources_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzedResources"); var request = InstantiateClassGenerator.Execute<ListAnalyzedResourcesRequest>(); var marshaller = new ListAnalyzedResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzedResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzedResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzedResources_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzedResources"); var request = InstantiateClassGenerator.Execute<ListAnalyzedResourcesRequest>(); var marshaller = new ListAnalyzedResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzedResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzedResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzedResources_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzedResources"); var request = InstantiateClassGenerator.Execute<ListAnalyzedResourcesRequest>(); var marshaller = new ListAnalyzedResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzedResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzedResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzersMarshallTest() { var operation = service_model.FindOperation("ListAnalyzers"); var request = InstantiateClassGenerator.Execute<ListAnalyzersRequest>(); var marshaller = new ListAnalyzersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzers", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListAnalyzersResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListAnalyzersResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzers_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzers"); var request = InstantiateClassGenerator.Execute<ListAnalyzersRequest>(); var marshaller = new ListAnalyzersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzers_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzers"); var request = InstantiateClassGenerator.Execute<ListAnalyzersRequest>(); var marshaller = new ListAnalyzersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzers_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzers"); var request = InstantiateClassGenerator.Execute<ListAnalyzersRequest>(); var marshaller = new ListAnalyzersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListAnalyzers_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListAnalyzers"); var request = InstantiateClassGenerator.Execute<ListAnalyzersRequest>(); var marshaller = new ListAnalyzersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAnalyzers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAnalyzersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListArchiveRulesMarshallTest() { var operation = service_model.FindOperation("ListArchiveRules"); var request = InstantiateClassGenerator.Execute<ListArchiveRulesRequest>(); var marshaller = new ListArchiveRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListArchiveRules", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListArchiveRulesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListArchiveRulesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListArchiveRules_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListArchiveRules"); var request = InstantiateClassGenerator.Execute<ListArchiveRulesRequest>(); var marshaller = new ListArchiveRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListArchiveRules", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListArchiveRulesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListArchiveRules_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListArchiveRules"); var request = InstantiateClassGenerator.Execute<ListArchiveRulesRequest>(); var marshaller = new ListArchiveRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListArchiveRules", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListArchiveRulesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListArchiveRules_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListArchiveRules"); var request = InstantiateClassGenerator.Execute<ListArchiveRulesRequest>(); var marshaller = new ListArchiveRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListArchiveRules", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListArchiveRulesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListArchiveRules_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListArchiveRules"); var request = InstantiateClassGenerator.Execute<ListArchiveRulesRequest>(); var marshaller = new ListArchiveRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListArchiveRules", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListArchiveRulesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListFindingsMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute<ListFindingsRequest>(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListFindingsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute<ListFindingsRequest>(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListFindings_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute<ListFindingsRequest>(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListFindings_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute<ListFindingsRequest>(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListFindings_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute<ListFindingsRequest>(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListFindings_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute<ListFindingsRequest>(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListPolicyGenerationsMarshallTest() { var operation = service_model.FindOperation("ListPolicyGenerations"); var request = InstantiateClassGenerator.Execute<ListPolicyGenerationsRequest>(); var marshaller = new ListPolicyGenerationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListPolicyGenerations", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListPolicyGenerationsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListPolicyGenerationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListPolicyGenerations_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListPolicyGenerations"); var request = InstantiateClassGenerator.Execute<ListPolicyGenerationsRequest>(); var marshaller = new ListPolicyGenerationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListPolicyGenerations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListPolicyGenerationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListPolicyGenerations_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListPolicyGenerations"); var request = InstantiateClassGenerator.Execute<ListPolicyGenerationsRequest>(); var marshaller = new ListPolicyGenerationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListPolicyGenerations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListPolicyGenerationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListPolicyGenerations_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListPolicyGenerations"); var request = InstantiateClassGenerator.Execute<ListPolicyGenerationsRequest>(); var marshaller = new ListPolicyGenerationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListPolicyGenerations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListPolicyGenerationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListPolicyGenerations_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListPolicyGenerations"); var request = InstantiateClassGenerator.Execute<ListPolicyGenerationsRequest>(); var marshaller = new ListPolicyGenerationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListPolicyGenerations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListPolicyGenerationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListTagsForResourceMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListTagsForResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListTagsForResource_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListTagsForResource_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListTagsForResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListTagsForResource_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ListTagsForResource_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGenerationMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = StartPolicyGenerationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as StartPolicyGenerationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGeneration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGeneration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGeneration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGeneration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGeneration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartPolicyGeneration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("StartPolicyGeneration"); var request = InstantiateClassGenerator.Execute<StartPolicyGenerationRequest>(); var marshaller = new StartPolicyGenerationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartPolicyGeneration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartPolicyGenerationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartResourceScanMarshallTest() { var operation = service_model.FindOperation("StartResourceScan"); var request = InstantiateClassGenerator.Execute<StartResourceScanRequest>(); var marshaller = new StartResourceScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartResourceScan", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartResourceScan_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("StartResourceScan"); var request = InstantiateClassGenerator.Execute<StartResourceScanRequest>(); var marshaller = new StartResourceScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartResourceScan", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartResourceScanResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartResourceScan_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("StartResourceScan"); var request = InstantiateClassGenerator.Execute<StartResourceScanRequest>(); var marshaller = new StartResourceScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartResourceScan", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartResourceScanResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartResourceScan_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("StartResourceScan"); var request = InstantiateClassGenerator.Execute<StartResourceScanRequest>(); var marshaller = new StartResourceScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartResourceScan", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartResourceScanResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartResourceScan_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("StartResourceScan"); var request = InstantiateClassGenerator.Execute<StartResourceScanRequest>(); var marshaller = new StartResourceScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartResourceScan", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartResourceScanResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void StartResourceScan_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("StartResourceScan"); var request = InstantiateClassGenerator.Execute<StartResourceScanRequest>(); var marshaller = new StartResourceScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartResourceScan", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartResourceScanResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void TagResourceMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute<TagResourceRequest>(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = TagResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as TagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void TagResource_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute<TagResourceRequest>(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void TagResource_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute<TagResourceRequest>(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void TagResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute<TagResourceRequest>(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void TagResource_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute<TagResourceRequest>(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void TagResource_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute<TagResourceRequest>(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UntagResourceMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute<UntagResourceRequest>(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UntagResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UntagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UntagResource_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute<UntagResourceRequest>(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UntagResource_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute<UntagResourceRequest>(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UntagResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute<UntagResourceRequest>(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UntagResource_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute<UntagResourceRequest>(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UntagResource_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute<UntagResourceRequest>(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateArchiveRuleMarshallTest() { var operation = service_model.FindOperation("UpdateArchiveRule"); var request = InstantiateClassGenerator.Execute<UpdateArchiveRuleRequest>(); var marshaller = new UpdateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateArchiveRule", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateArchiveRule_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateArchiveRule"); var request = InstantiateClassGenerator.Execute<UpdateArchiveRuleRequest>(); var marshaller = new UpdateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateArchiveRule_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateArchiveRule"); var request = InstantiateClassGenerator.Execute<UpdateArchiveRuleRequest>(); var marshaller = new UpdateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateArchiveRule_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateArchiveRule"); var request = InstantiateClassGenerator.Execute<UpdateArchiveRuleRequest>(); var marshaller = new UpdateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateArchiveRule_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateArchiveRule"); var request = InstantiateClassGenerator.Execute<UpdateArchiveRuleRequest>(); var marshaller = new UpdateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateArchiveRule_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateArchiveRule"); var request = InstantiateClassGenerator.Execute<UpdateArchiveRuleRequest>(); var marshaller = new UpdateArchiveRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateArchiveRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateArchiveRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateFindingsMarshallTest() { var operation = service_model.FindOperation("UpdateFindings"); var request = InstantiateClassGenerator.Execute<UpdateFindingsRequest>(); var marshaller = new UpdateFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindings", request, internalRequest, service_model); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindings"); var request = InstantiateClassGenerator.Execute<UpdateFindingsRequest>(); var marshaller = new UpdateFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateFindings_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindings"); var request = InstantiateClassGenerator.Execute<UpdateFindingsRequest>(); var marshaller = new UpdateFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateFindings_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindings"); var request = InstantiateClassGenerator.Execute<UpdateFindingsRequest>(); var marshaller = new UpdateFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateFindings_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindings"); var request = InstantiateClassGenerator.Execute<UpdateFindingsRequest>(); var marshaller = new UpdateFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void UpdateFindings_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindings"); var request = InstantiateClassGenerator.Execute<UpdateFindingsRequest>(); var marshaller = new UpdateFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ValidatePolicyMarshallTest() { var operation = service_model.FindOperation("ValidatePolicy"); var request = InstantiateClassGenerator.Execute<ValidatePolicyRequest>(); var marshaller = new ValidatePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ValidatePolicy", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ValidatePolicyResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ValidatePolicyResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ValidatePolicy_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ValidatePolicy"); var request = InstantiateClassGenerator.Execute<ValidatePolicyRequest>(); var marshaller = new ValidatePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ValidatePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ValidatePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ValidatePolicy_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ValidatePolicy"); var request = InstantiateClassGenerator.Execute<ValidatePolicyRequest>(); var marshaller = new ValidatePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ValidatePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ValidatePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ValidatePolicy_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ValidatePolicy"); var request = InstantiateClassGenerator.Execute<ValidatePolicyRequest>(); var marshaller = new ValidatePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ValidatePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ValidatePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("AccessAnalyzer")] public void ValidatePolicy_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ValidatePolicy"); var request = InstantiateClassGenerator.Execute<ValidatePolicyRequest>(); var marshaller = new ValidatePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ValidatePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ValidatePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } } }
49.627938
147
0.650151
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/test/Services/AccessAnalyzer/UnitTests/Generated/Marshalling/AccessAnalyzerMarshallingTests.cs
263,971
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 namespace Coding4Fun.Toolkit.Test.WindowsStore.Samples.Color { /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial class ColorPicker : Page { public ColorPicker() { this.InitializeComponent(); } private void Cyan_Click(object sender, RoutedEventArgs e) { SetColor(Colors.Cyan); } private void Yellow_Click(object sender, RoutedEventArgs e) { SetColor(Colors.Yellow); } private void Orange_Click(object sender, RoutedEventArgs e) { SetColor(Colors.Orange); } private void Magenta_Click(object sender, RoutedEventArgs e) { SetColor(Colors.Magenta); } private void SetColor(Windows.UI.Color color) { ColorPickerSetOnLoadTest.Color = color; ColorPickerSetOnXamlLoadTest.Color = color; } } }
26.827586
94
0.661954
[ "MIT" ]
Coding4FunProjects/Coding4FunToolk
source/Coding4Fun.Toolkit.Test.WindowsStore/Samples/Color/ColorPicker.xaml.cs
1,558
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Reflection; using Xunit; namespace System.Text.RegularExpressions.Tests { public class RegexReductionTests { // These tests depend on using reflection to access internals of Regex in order to validate // if, when, and how various optimizations are being employed. As implementation details // change, these tests will need to be updated as well. Note, too, that Compiled Regexes // null out the _code field being accessed here, so this mechanism won't work to validate // Compiled, which also means it won't work to validate optimizations only enabled // when using Compiled, such as auto-atomicity for the last node in a regex. private static readonly FieldInfo s_regexCode; private static readonly FieldInfo s_regexCodeCodes; private static readonly FieldInfo s_regexCodeTree; private static readonly FieldInfo s_regexCodeTreeMinRequiredLength; static RegexReductionTests() { if (PlatformDetection.IsNetFramework) { // These members may not exist, and the tests won't run. return; } s_regexCode = typeof(Regex).GetField("_code", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); Assert.NotNull(s_regexCode); s_regexCodeCodes = s_regexCode.FieldType.GetField("Codes", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); Assert.NotNull(s_regexCodeCodes); s_regexCodeTree = s_regexCode.FieldType.GetField("Tree", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); Assert.NotNull(s_regexCodeTree); s_regexCodeTreeMinRequiredLength = s_regexCodeTree.FieldType.GetField("MinRequiredLength", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); Assert.NotNull(s_regexCodeTreeMinRequiredLength); } private static string GetRegexCodes(Regex r) { object code = s_regexCode.GetValue(r); Assert.NotNull(code); string result = code.ToString(); // In release builds, the above ToString won't be informative. // Also include the numerical codes, which are not as comprehensive // but which exist in release builds as well. int[] codes = s_regexCodeCodes.GetValue(code) as int[]; Assert.NotNull(codes); result += Environment.NewLine + string.Join(", ", codes); return result; } private static int GetMinRequiredLength(Regex r) { object code = s_regexCode.GetValue(r); Assert.NotNull(code); object tree = s_regexCodeTree.GetValue(code); Assert.NotNull(tree); object minRequiredLength = s_regexCodeTreeMinRequiredLength.GetValue(tree); Assert.IsType<int>(minRequiredLength); return (int)minRequiredLength; } [Theory] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Many of these optimizations don't exist in .NET Framework.")] // Two greedy one loops [InlineData("a*a*", "a*")] [InlineData("(a*a*)", "(a*)")] [InlineData("a*(?:a*)", "a*")] [InlineData("a*a+", "a+")] [InlineData("a*a?", "a*")] [InlineData("a*a{1,3}", "a+")] [InlineData("a+a*", "a+")] [InlineData("a+a+", "a{2,}")] [InlineData("a+a?", "a+")] [InlineData("a+a{1,3}", "a{2,}")] [InlineData("a?a*", "a*")] [InlineData("a?a+", "a+")] [InlineData("a?a?", "a{0,2}")] [InlineData("a?a{1,3}", "a{1,4}")] [InlineData("a{1,3}a*", "a+")] [InlineData("a{1,3}a+", "a{2,}")] [InlineData("a{1,3}a?", "a{1,4}")] [InlineData("a{1,3}a{1,3}", "a{2,6}")] // Greedy one loop and one [InlineData("a*a", "a+")] [InlineData("a+a", "a{2,}")] [InlineData("a?a", "a{1,2}")] [InlineData("a{1,3}a", "a{2,4}")] [InlineData("aa*", "a+")] [InlineData("aa+", "a{2,}")] [InlineData("aa?", "a{1,2}")] [InlineData("aa{1,3}", "a{2,4}")] // Two atomic one loops [InlineData("(?>a*)(?>a*)", "(?>a*)")] [InlineData("(?>a*)(?>(?:a*))", "(?>a*)")] [InlineData("(?>a*)(?>a+)", "(?>a+)")] [InlineData("(?>a*)(?>a?)", "(?>a*)")] [InlineData("(?>a*)(?>a{1,3})", "(?>a+)")] [InlineData("(?>a+)(?>a*)", "(?>a+)")] [InlineData("(?>a+)(?>a+)", "(?>a{2,})")] [InlineData("(?>a+)(?>a?)", "(?>a+)")] [InlineData("(?>a+)(?>a{1,3})", "(?>a{2,})")] [InlineData("(?>a?)(?>a*)", "(?>a*)")] [InlineData("(?>a?)(?>a+)", "(?>a+)")] [InlineData("(?>a?)(?>a?)", "(?>a{0,2})")] [InlineData("(?>a?)(?>a{1,3})", "(?>a{1,4})")] [InlineData("(?>a{1,3})(?>a*)", "(?>a+)")] [InlineData("(?>a{1,3})(?>a+)", "(?>a{2,})")] [InlineData("(?>a{1,3})(?>a?)", "(?>a{1,4})")] [InlineData("(?>a{1,3})(?>a{1,3})", "(?>a{2,6})")] // Atomic one loop and one [InlineData("(?>a*)a", "(?>a+)")] [InlineData("(?>a+)a", "(?>a{2,})")] [InlineData("(?>a?)a", "(?>a{1,2})")] [InlineData("(?>a{1,3})a", "(?>a{2,4})")] [InlineData("a(?>a*)", "(?>a+)")] [InlineData("a(?>a+)", "(?>a{2,})")] [InlineData("a(?>a?)", "(?>a{1,2})")] [InlineData("a(?>a{1,3})", "(?>a{2,4})")] // Two lazy one loops [InlineData("a*?a*?", "a*?")] [InlineData("a*?a+?", "a+?")] [InlineData("a*?a??", "a*?")] [InlineData("a*?a{1,3}?", "a+?")] [InlineData("a+?a*?", "a+?")] [InlineData("a+?a+?", "a{2,}?")] [InlineData("a+?a??", "a+?")] [InlineData("a+?a{1,3}?", "a{2,}?")] [InlineData("a??a*?", "a*?")] [InlineData("a??a+?", "a+?")] [InlineData("a??a??", "a{0,2}?")] [InlineData("a??a{1,3}?", "a{1,4}?")] [InlineData("a{1,3}?a*?", "a+?")] [InlineData("a{1,3}?a+?", "a{2,}?")] [InlineData("a{1,3}?a??", "a{1,4}?")] [InlineData("a{1,3}?a{1,3}?", "a{2,6}?")] // Lazy one loop and one [InlineData("a*?a", "a+?")] [InlineData("a+?a", "a{2,}?")] [InlineData("a??a", "a{1,2}?")] [InlineData("a{1,3}?a", "a{2,4}?")] [InlineData("aa*?", "a+?")] [InlineData("aa+?", "a{2,}?")] [InlineData("aa??", "a{1,2}?")] [InlineData("aa{1,3}?", "a{2,4}?")] // Two greedy notone loops [InlineData("[^a]*[^a]*", "[^a]*")] [InlineData("[^a]*[^a]+", "[^a]+")] [InlineData("[^a]*[^a]?", "[^a]*")] [InlineData("[^a]*[^a]{1,3}", "[^a]+")] [InlineData("[^a]+[^a]*", "[^a]+")] [InlineData("[^a]+[^a]+", "[^a]{2,}")] [InlineData("[^a]+[^a]?", "[^a]+")] [InlineData("[^a]+[^a]{1,3}", "[^a]{2,}")] [InlineData("[^a]?[^a]*", "[^a]*")] [InlineData("[^a]?[^a]+", "[^a]+")] [InlineData("[^a]?[^a]?", "[^a]{0,2}")] [InlineData("[^a]?[^a]{1,3}", "[^a]{1,4}")] [InlineData("[^a]{1,3}[^a]*", "[^a]+")] [InlineData("[^a]{1,3}[^a]+", "[^a]{2,}")] [InlineData("[^a]{1,3}[^a]?", "[^a]{1,4}")] [InlineData("[^a]{1,3}[^a]{1,3}", "[^a]{2,6}")] // Two lazy notone loops [InlineData("[^a]*?[^a]*?", "[^a]*?")] [InlineData("[^a]*?[^a]+?", "[^a]+?")] [InlineData("[^a]*?[^a]??", "[^a]*?")] [InlineData("[^a]*?[^a]{1,3}?", "[^a]+?")] [InlineData("[^a]+?[^a]*?", "[^a]+?")] [InlineData("[^a]+?[^a]+?", "[^a]{2,}?")] [InlineData("[^a]+?[^a]??", "[^a]+?")] [InlineData("[^a]+?[^a]{1,3}?", "[^a]{2,}?")] [InlineData("[^a]??[^a]*?", "[^a]*?")] [InlineData("[^a]??[^a]+?", "[^a]+?")] [InlineData("[^a]??[^a]??", "[^a]{0,2}?")] [InlineData("[^a]??[^a]{1,3}?", "[^a]{1,4}?")] [InlineData("[^a]{1,3}?[^a]*?", "[^a]+?")] [InlineData("[^a]{1,3}?[^a]+?", "[^a]{2,}?")] [InlineData("[^a]{1,3}?[^a]??", "[^a]{1,4}?")] [InlineData("[^a]{1,3}?[^a]{1,3}?", "[^a]{2,6}?")] // Two atomic notone loops [InlineData("(?>[^a]*)(?>[^a]*)", "(?>[^a]*)")] [InlineData("(?>[^a]*)(?>[^a]+)", "(?>[^a]+)")] [InlineData("(?>[^a]*)(?>[^a]?)", "(?>[^a]*)")] [InlineData("(?>[^a]*)(?>[^a]{1,3})", "(?>[^a]+)")] [InlineData("(?>[^a]+)(?>[^a]*)", "(?>[^a]+)")] [InlineData("(?>[^a]+)(?>[^a]+)", "(?>[^a]{2,})")] [InlineData("(?>[^a]+)(?>[^a]?)", "(?>[^a]+)")] [InlineData("(?>[^a]+)(?>[^a]{1,3})", "(?>[^a]{2,})")] [InlineData("(?>[^a]?)(?>[^a]*)", "(?>[^a]*)")] [InlineData("(?>[^a]?)(?>[^a]+)", "(?>[^a]+)")] [InlineData("(?>[^a]?)(?>[^a]?)", "(?>[^a]{0,2})")] [InlineData("(?>[^a]?)(?>[^a]{1,3})", "(?>[^a]{1,4})")] [InlineData("(?>[^a]{1,3})(?>[^a]*)", "(?>[^a]+)")] [InlineData("(?>[^a]{1,3})(?>[^a]+)", "(?>[^a]{2,})")] [InlineData("(?>[^a]{1,3})(?>[^a]?)", "(?>[^a]{1,4})")] [InlineData("(?>[^a]{1,3})(?>[^a]{1,3})", "(?>[^a]{2,6})")] // Greedy notone loop and notone [InlineData("[^a]*[^a]", "[^a]+")] [InlineData("[^a]+[^a]", "[^a]{2,}")] [InlineData("[^a]?[^a]", "[^a]{1,2}")] [InlineData("[^a]{1,3}[^a]", "[^a]{2,4}")] [InlineData("[^a][^a]*", "[^a]+")] [InlineData("[^a][^a]+", "[^a]{2,}")] [InlineData("[^a][^a]?", "[^a]{1,2}")] [InlineData("[^a][^a]{1,3}", "[^a]{2,4}")] // Lazy notone loop and notone [InlineData("[^a]*?[^a]", "[^a]+?")] [InlineData("[^a]+?[^a]", "[^a]{2,}?")] [InlineData("[^a]??[^a]", "[^a]{1,2}?")] [InlineData("[^a]{1,3}?[^a]", "[^a]{2,4}?")] [InlineData("[^a][^a]*?", "[^a]+?")] [InlineData("[^a][^a]+?", "[^a]{2,}?")] [InlineData("[^a][^a]??", "[^a]{1,2}?")] [InlineData("[^a][^a]{1,3}?", "[^a]{2,4}?")] // Atomic notone loop and notone [InlineData("(?>[^a]*)[^a]", "(?>[^a]+)")] [InlineData("(?>[^a]+)[^a]", "(?>[^a]{2,})")] [InlineData("(?>[^a]?)[^a]", "(?>[^a]{1,2})")] [InlineData("(?>[^a]{1,3})[^a]", "(?>[^a]{2,4})")] [InlineData("[^a](?>[^a]*)", "(?>[^a]+)")] [InlineData("[^a](?>[^a]+)", "(?>[^a]{2,})")] [InlineData("[^a](?>[^a]?)", "(?>[^a]{1,2})")] [InlineData("[^a](?>[^a]{1,3})", "(?>[^a]{2,4})")] // Notone and notone [InlineData("[^a][^a]", "[^a]{2}")] // Two greedy set loops [InlineData("[0-9]*[0-9]*", "[0-9]*")] [InlineData("[0-9]*[0-9]+", "[0-9]+")] [InlineData("[0-9]*[0-9]?", "[0-9]*")] [InlineData("[0-9]*[0-9]{1,3}", "[0-9]+")] [InlineData("[0-9]+[0-9]*", "[0-9]+")] [InlineData("[0-9]+[0-9]+", "[0-9]{2,}")] [InlineData("[0-9]+[0-9]?", "[0-9]+")] [InlineData("[0-9]+[0-9]{1,3}", "[0-9]{2,}")] [InlineData("[0-9]?[0-9]*", "[0-9]*")] [InlineData("[0-9]?[0-9]+", "[0-9]+")] [InlineData("[0-9]?[0-9]?", "[0-9]{0,2}")] [InlineData("[0-9]?[0-9]{1,3}", "[0-9]{1,4}")] [InlineData("[0-9]{1,3}[0-9]*", "[0-9]+")] [InlineData("[0-9]{1,3}[0-9]+", "[0-9]{2,}")] [InlineData("[0-9]{1,3}[0-9]?", "[0-9]{1,4}")] [InlineData("[0-9]{1,3}[0-9]{1,3}", "[0-9]{2,6}")] // Greedy set loop and set [InlineData("[0-9]*[0-9]", "[0-9]+")] [InlineData("[0-9]+[0-9]", "[0-9]{2,}")] [InlineData("[0-9]?[0-9]", "[0-9]{1,2}")] [InlineData("[0-9]{1,3}[0-9]", "[0-9]{2,4}")] [InlineData("[0-9][0-9]*", "[0-9]+")] [InlineData("[0-9][0-9]+", "[0-9]{2,}")] [InlineData("[0-9][0-9]?", "[0-9]{1,2}")] [InlineData("[0-9][0-9]{1,3}", "[0-9]{2,4}")] // Atomic set loop and set [InlineData("(?>[0-9]*)[0-9]", "(?>[0-9]+)")] [InlineData("(?>[0-9]+)[0-9]", "(?>[0-9]{2,})")] [InlineData("(?>[0-9]?)[0-9]", "(?>[0-9]{1,2})")] [InlineData("(?>[0-9]{1,3})[0-9]", "(?>[0-9]{2,4})")] [InlineData("[0-9](?>[0-9]*)", "(?>[0-9]+)")] [InlineData("[0-9](?>[0-9]+)", "(?>[0-9]{2,})")] [InlineData("[0-9](?>[0-9]?)", "(?>[0-9]{1,2})")] [InlineData("[0-9](?>[0-9]{1,3})", "(?>[0-9]{2,4})")] // Two lazy set loops [InlineData("[0-9]*?[0-9]*?", "[0-9]*?")] [InlineData("[0-9]*?[0-9]+?", "[0-9]+?")] [InlineData("[0-9]*?[0-9]??", "[0-9]*?")] [InlineData("[0-9]*?[0-9]{1,3}?", "[0-9]+?")] [InlineData("[0-9]+?[0-9]*?", "[0-9]+?")] [InlineData("[0-9]+?[0-9]+?", "[0-9]{2,}?")] [InlineData("[0-9]+?[0-9]??", "[0-9]+?")] [InlineData("[0-9]+?[0-9]{1,3}?", "[0-9]{2,}?")] [InlineData("[0-9]??[0-9]*?", "[0-9]*?")] [InlineData("[0-9]??[0-9]+?", "[0-9]+?")] [InlineData("[0-9]??[0-9]??", "[0-9]{0,2}?")] [InlineData("[0-9]??[0-9]{1,3}?", "[0-9]{1,4}?")] [InlineData("[0-9]{1,3}?[0-9]*?", "[0-9]+?")] [InlineData("[0-9]{1,3}?[0-9]+?", "[0-9]{2,}?")] [InlineData("[0-9]{1,3}?[0-9]??", "[0-9]{1,4}?")] [InlineData("[0-9]{1,3}?[0-9]{1,3}?", "[0-9]{2,6}?")] // Two atomic set loops [InlineData("(?>[0-9]*)(?>[0-9]*)", "(?>[0-9]*)")] [InlineData("(?>[0-9]*)(?>[0-9]+)", "(?>[0-9]+)")] [InlineData("(?>[0-9]*)(?>[0-9]?)", "(?>[0-9]*)")] [InlineData("(?>[0-9]*)(?>[0-9]{1,3})", "(?>[0-9]+)")] [InlineData("(?>[0-9]+)(?>[0-9]*)", "(?>[0-9]+)")] [InlineData("(?>[0-9]+)(?>[0-9]+)", "(?>[0-9]{2,})")] [InlineData("(?>[0-9]+)(?>[0-9]?)", "(?>[0-9]+)")] [InlineData("(?>[0-9]+)(?>[0-9]{1,3})", "(?>[0-9]{2,})")] [InlineData("(?>[0-9]?)(?>[0-9]*)", "(?>[0-9]*)")] [InlineData("(?>[0-9]?)(?>[0-9]+)", "(?>[0-9]+)")] [InlineData("(?>[0-9]?)(?>[0-9]?)", "(?>[0-9]{0,2})")] [InlineData("(?>[0-9]?)(?>[0-9]{1,3})", "(?>[0-9]{1,4})")] [InlineData("(?>[0-9]{1,3})(?>[0-9]*)", "(?>[0-9]+)")] [InlineData("(?>[0-9]{1,3})(?>[0-9]+)", "(?>[0-9]{2,})")] [InlineData("(?>[0-9]{1,3})(?>[0-9]?)", "(?>[0-9]{1,4})")] [InlineData("(?>[0-9]{1,3})(?>[0-9]{1,3})", "(?>[0-9]{2,6})")] // Lazy set loop and set [InlineData("[0-9]*?[0-9]", "[0-9]+?")] [InlineData("[0-9]+?[0-9]", "[0-9]{2,}?")] [InlineData("[0-9]??[0-9]", "[0-9]{1,2}?")] [InlineData("[0-9]{1,3}?[0-9]", "[0-9]{2,4}?")] [InlineData("[0-9][0-9]*?", "[0-9]+?")] [InlineData("[0-9][0-9]+?", "[0-9]{2,}?")] [InlineData("[0-9][0-9]??", "[0-9]{1,2}?")] [InlineData("[0-9][0-9]{1,3}?", "[0-9]{2,4}?")] // Set and set [InlineData("[ace][ace]", "[ace]{2}")] // Set and one [InlineData("[a]", "a")] [InlineData("[a]*", "a*")] [InlineData("(?>[a]*)", "(?>a*)")] [InlineData("[a]*?", "a*?")] // Set and notone [InlineData("[^\n]", ".")] [InlineData("[^\n]*", ".*")] [InlineData("(?>[^\n]*)", "(?>.*)")] [InlineData("[^\n]*?", ".*?")] // Large loop patterns [InlineData("a*a*a*a*a*a*a*b*b*?a+a*", "a*b*b*?a+")] [InlineData("a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "a{0,30}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] // Group elimination [InlineData("(?:(?:(?:(?:(?:(?:a*))))))", "a*")] // Nested loops [InlineData("(?:a*)*", "a*")] [InlineData("(?:a*)+", "a*")] [InlineData("(?:a+){4}", "a{4,}")] [InlineData("(?:a{1,2}){4}", "a{4,8}")] // Nested atomic [InlineData("(?>(?>(?>(?>abc*))))", "(?>ab(?>c*))")] // Alternation reduction [InlineData("a|b", "[ab]")] [InlineData("a|b|c|d|e|g|h|z", "[a-eghz]")] [InlineData("a|b|c|def|g|h", "(?>[a-c]|def|[gh])")] [InlineData("this|that|there|then|those", "th(?>is|at|ere|en|ose)")] [InlineData("it's (?>this|that|there|then|those)", "it's (?>th(?>is|at|e(?>re|n)|ose))")] [InlineData("it's (?>this|that|there|then|those)!", "it's (?>th(?>is|at|e(?>re|n)|ose))!")] [InlineData("abcd|abce", "abc[de]")] [InlineData("abcd|abef", "ab(?>cd|ef)")] [InlineData("abcd|aefg", "a(?>bcd|efg)")] [InlineData("abcd|abc|ab|a", "a(?>bcd|bc|b|)")] [InlineData("abcde|abcdef", "abcde(?>|f)")] [InlineData("abcdef|abcde", "abcde(?>f|)")] [InlineData("abcdef|abcdeg|abcdeh|abcdei|abcdej|abcdek|abcdel", "abcde[f-l]")] [InlineData("(ab|ab*)bc", "(a(?:b|b*))bc")] [InlineData("abc(?:defgh|defij)klmn", "abcdef(?:gh|ij)klmn")] [InlineData("abc(defgh|defij)klmn", "abc(def(?:gh|ij))klmn")] [InlineData("a[b-f]|a[g-k]", "a[b-k]")] [InlineData("this|this", "this")] [InlineData("this|this|this", "this")] [InlineData("hello there|hello again|hello|hello|hello|hello", "hello(?> there| again|)")] [InlineData("hello there|hello again|hello|hello|hello|hello|hello world", "hello(?> there| again|| world)")] [InlineData("hello there|hello again|hello|hello|hello|hello|hello world|hello", "hello(?> there| again|| world)")] [InlineData("abcd(?:(?i:e)|(?i:f))", "abcd(?i:[ef])")] [InlineData("(?i:abcde)|(?i:abcdf)", "(?i:abcd[ef])")] [InlineData("xyz(?:(?i:abcde)|(?i:abcdf))", "xyz(?i:abcd[ef])")] [InlineData("bonjour|hej|ciao|shalom|zdravo|pozdrav|hallo|hola|hello|hey|witam|tere|bonjou|salam|helo|sawubona", "(?>bonjou(?>r|)|h(?>e(?>j|(?>l(?>lo|o)|y))|allo|ola)|ciao|s(?>halom|a(?>lam|wubona))|zdravo|pozdrav|witam|tere)")] // Auto-atomicity [InlineData("a*b", "(?>a*)b")] [InlineData("a*b+", "(?>a*)b+")] [InlineData("a*b{3,4}", "(?>a*)b{3,4}")] [InlineData("a+b", "(?>a+)b")] [InlineData("a?b", "(?>a?)b")] [InlineData("[^\n]*\n", "(?>[^\n]*)\n")] [InlineData("[^\n]*\n+", "(?>[^\n]*)\n+")] [InlineData("(a+)b", "((?>a+))b")] [InlineData("a*(?:bcd|efg)", "(?>a*)(?:bcd|efg)")] [InlineData("\\w*\\b", "(?>\\w*)\\b")] [InlineData("\\d*\\b", "(?>\\d*)\\b")] [InlineData("(?:abc*|def*)g", "(?:ab(?>c*)|de(?>f*))g")] [InlineData("(?:a[ce]*|b*)g", "(?:a(?>[ce]*)|(?>b*))g")] [InlineData("(?:a[ce]*|b*)c", "(?:a[ce]*|(?>b*))c")] [InlineData("apple|(?:orange|pear)|grape", "apple|orange|pear|grape")] [InlineData("(?>(?>(?>(?:abc)*)))", "(?:abc)*")] [InlineData("(?:w*)+", "(?>w*)+")] [InlineData("(?:w*)+\\.", "(?>w*)+\\.")] [InlineData("(a[bcd]e*)*fg", "(a[bcd](?>e*))*fg")] [InlineData("(\\w[bcd]\\s*)*fg", "(\\w[bcd](?>\\s*))*fg")] public void PatternsReduceIdentically(string pattern1, string pattern2) { string result1 = GetRegexCodes(new Regex(pattern1)); string result2 = GetRegexCodes(new Regex(pattern2)); if (result1 != result2) { throw new Xunit.Sdk.EqualException(result2, result1); } Assert.NotEqual(GetRegexCodes(new Regex(pattern1, RegexOptions.RightToLeft)), GetRegexCodes(new Regex(pattern2))); if (!pattern1.Contains("?i:") && !pattern2.Contains("?i:")) { Assert.NotEqual(GetRegexCodes(new Regex(pattern1, RegexOptions.IgnoreCase)), GetRegexCodes(new Regex(pattern2))); } } [Theory] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Many of these optimizations don't exist in .NET Framework.")] // Not coalescing loops [InlineData("aa", "a{2}")] [InlineData("a[^a]", "a{2}")] [InlineData("[^a]a", "[^a]{2}")] [InlineData("a*b*", "a*")] [InlineData("a*b*", "b*")] [InlineData("[^a]*[^b]", "[^a]*")] [InlineData("[ace]*[acd]", "[ace]*")] [InlineData("a+b+", "a+")] [InlineData("a+b+", "b+")] [InlineData("a*(a*)", "a*")] [InlineData("(a*)a*", "a*")] [InlineData("a*(?>a*)", "a*")] [InlineData("a*a*?", "a*")] [InlineData("a*?a*", "a*")] [InlineData("a*[^a]*", "a*")] [InlineData("[^a]*a*", "a*")] [InlineData("a{2147483646}a", "a{2147483647}")] [InlineData("a{2147483647}a", "a{2147483647}")] [InlineData("a{0,2147483646}a", "a{0,2147483647}")] [InlineData("aa{2147483646}", "a{2147483647}")] [InlineData("aa{0,2147483646}", "a{0,2147483647}")] [InlineData("a{2147482647}a{1000}", "a{2147483647}")] [InlineData("a{0,2147482647}a{0,1000}", "a{0,2147483647}")] [InlineData("[^a]{2147483646}[^a]", "[^a]{2147483647}")] [InlineData("[^a]{2147483647}[^a]", "[^a]{2147483647}")] [InlineData("[^a]{0,2147483646}[^a]", "[^a]{0,2147483647}")] [InlineData("[^a][^a]{2147483646}", "[^a]{2147483647}")] [InlineData("[^a][^a]{0,2147483646}", "[^a]{0,2147483647}")] [InlineData("[^a]{2147482647}[^a]{1000}", "[^a]{2147483647}")] [InlineData("[^a]{0,2147482647}[^a]{0,1000}", "[^a]{0,2147483647}")] [InlineData("[ace]{2147483646}[ace]", "[ace]{2147483647}")] [InlineData("[ace]{2147483647}[ace]", "[ace]{2147483647}")] [InlineData("[ace]{0,2147483646}[ace]", "[ace]{0,2147483647}")] [InlineData("[ace][ace]{2147483646}", "[ace]{2147483647}")] [InlineData("[ace][ace]{0,2147483646}", "[ace]{0,2147483647}")] [InlineData("[ace]{2147482647}[ace]{1000}", "[ace]{2147483647}")] [InlineData("[ace]{0,2147482647}[ace]{0,1000}", "[ace]{0,2147483647}")] // Not reducing branches of alternations with different casing [InlineData("(?i:abcd)|abcd", "abcd|abcd")] [InlineData("abcd|(?i:abcd)", "abcd|abcd")] [InlineData("abc(?:(?i:e)|f)", "abc[ef]")] // Not applying auto-atomicity [InlineData("a*b*", "(?>a*)b*")] [InlineData("[ab]*[^a]", "(?>[ab]*)[^a]")] [InlineData("[ab]*[^a]*", "(?>[ab]*)[^a]*")] [InlineData("[ab]*[^a]*?", "(?>[ab]*)[^a]*?")] [InlineData("[ab]*(?>[^a]*)", "(?>[ab]*)(?>[^a]*)")] [InlineData("[^\n]*\n*", "(?>[^\n]*)\n")] [InlineData("(a[bcd]a*)*fg", "(a[bcd](?>a*))*fg")] [InlineData("(\\w[bcd]\\d*)*fg", "(\\w[bcd](?>\\d*))*fg")] [InlineData("a*(?<=[^a])b", "(?>a*)(?<=[^a])b")] [InlineData("[\x0000-\xFFFF]*[a-z]", "(?>[\x0000-\xFFFF]*)[a-z]")] [InlineData("[a-z]*[\x0000-\xFFFF]+", "(?>[a-z]*)[\x0000-\xFFFF]+")] [InlineData("[^a-c]*[e-g]", "(?>[^a-c]*)[e-g]")] [InlineData("[^a-c]*[^e-g]", "(?>[^a-c]*)[^e-g]")] [InlineData("(w+)+", "((?>w+))+")] [InlineData("(w{1,2})+", "((?>w{1,2}))+")] [InlineData("(?:ab|cd|ae)f", "(?>ab|cd|ae)f")] public void PatternsReduceDifferently(string pattern1, string pattern2) { var r1 = new Regex(pattern1); var r2 = new Regex(pattern2); Assert.NotEqual(GetRegexCodes(r1), GetRegexCodes(r2)); } [Theory] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Not computed in netfx")] [InlineData(@"a", 1)] [InlineData(@"[^a]", 1)] [InlineData(@"[abcdefg]", 1)] [InlineData(@"abcd", 4)] [InlineData(@"a*", 0)] [InlineData(@"a*?", 0)] [InlineData(@"a?", 0)] [InlineData(@"a??", 0)] [InlineData(@"a+", 1)] [InlineData(@"a+?", 1)] [InlineData(@"a{2}", 2)] [InlineData(@"a{2}?", 2)] [InlineData(@"a{3,17}", 3)] [InlineData(@"a{3,17}?", 3)] [InlineData(@"(abcd){5}", 20)] [InlineData(@"(abcd|ef){2,6}", 4)] [InlineData(@"abcef|de", 2)] [InlineData(@"abc(def|ghij)k", 7)] [InlineData(@"\d{1,2}-\d{1,2}-\d{2,4}", 6)] [InlineData(@"1(?=9)\d", 2)] [InlineData(@"1(?!\d)\w", 2)] [InlineData(@"a*a*a*a*a*a*a*b*", 0)] [InlineData(@"((a{1,2}){4}){3,7}", 12)] [InlineData(@"\b\w{4}\b", 4)] [InlineData(@"abcd(?=efgh)efgh", 8)] [InlineData(@"abcd(?<=cd)efgh", 8)] [InlineData(@"abcd(?!ab)efgh", 8)] [InlineData(@"abcd(?<!ef)efgh", 8)] [InlineData(@"(a{1073741824}){2}", 2147483647)] [InlineData(@"a{1073741824}b{1073741824}", 2147483647)] // we stop computing after a certain depth; if that logic changes in the future, these tests can be updated [InlineData(@"((((((((((((((((((((((((((((((ab|cd+)|ef+)|gh+)|ij+)|kl+)|mn+)|op+)|qr+)|st+)|uv+)|wx+)|yz+)|01+)|23+)|45+)|67+)|89+)|AB+)|CD+)|EF+)|GH+)|IJ+)|KL+)|MN+)|OP+)|QR+)|ST+)|UV+)|WX+)|YZ)", 0)] [InlineData(@"(YZ+|(WX+|(UV+|(ST+|(QR+|(OP+|(MN+|(KL+|(IJ+|(GH+|(EF+|(CD+|(AB+|(89+|(67+|(45+|(23+|(01+|(yz+|(wx+|(uv+|(st+|(qr+|(op+|(mn+|(kl+|(ij+|(gh+|(ef+|(de+|(a|bc+)))))))))))))))))))))))))))))))", 0)] [InlineData(@"a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(ab|cd+)|ef+)|gh+)|ij+)|kl+)|mn+)|op+)|qr+)|st+)|uv+)|wx+)|yz+)|01+)|23+)|45+)|67+)|89+)|AB+)|CD+)|EF+)|GH+)|IJ+)|KL+)|MN+)|OP+)|QR+)|ST+)|UV+)|WX+)|YZ+)", 3)] [InlineData(@"(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((a)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", 0)] public void MinRequiredLengthIsCorrect(string pattern, int expectedLength) { var r = new Regex(pattern); Assert.Equal(expectedLength, GetMinRequiredLength(r)); } } }
50.081553
240
0.432111
[ "MIT" ]
3DCloud/runtime
src/libraries/System.Text.RegularExpressions/tests/RegexReductionTests.cs
25,792
C#
#region Mr. Advice // Mr. Advice // A simple post build weaving package // http://mradvice.arxone.com/ // Released under MIT license http://opensource.org/licenses/mit-license.php #endregion namespace ArxOne.MrAdvice.IO { using System.Diagnostics; using System.IO; using StitcherBoy.Logging; public class FileLogging : ILogging { private readonly StreamWriter _streamWriter; private readonly Stopwatch _stopwatch = new Stopwatch(); public FileLogging(string logFilePath) { _streamWriter = File.CreateText(logFilePath); _stopwatch.Start(); } public void Write(string format, params object[] parameters) { var prefix = $@"[{_stopwatch.Elapsed:mm\:ss\.fff}] "; _streamWriter.WriteLine(prefix + format, parameters); _streamWriter.Flush(); } public void WriteWarning(string format, params object[] parameters) => Write("! " + format, parameters); public void WriteError(string format, params object[] parameters) => Write("* " + format, parameters); public void WriteDebug(string format, params object[] parameters) => Write(". " + format, parameters); } }
32.564103
113
0.629921
[ "MIT" ]
ArxOne/MrAdvice
MrAdvice.Weaver/IO/FileLogging.cs
1,272
C#
using System; using System.Collections.Generic; namespace Weikio.TypeGenerator.Delegates { public class DelegateCache { public static Dictionary<Guid, MulticastDelegate> Cache = new Dictionary<Guid, MulticastDelegate>(); public static Guid Add(MulticastDelegate multicastDelegate) { var id = Guid.NewGuid(); Cache.Add(id, multicastDelegate); return id; } public static MulticastDelegate Get(Guid id) { return Cache[id]; } } }
22.791667
108
0.617916
[ "MIT" ]
t-andre/TypeGenerator
src/Weikio.TypeGenerator/Delegates/DelegateCache.cs
549
C#
using FileTypeChecker; using FileTypeChecker.Abstracts; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using Scholarships.Data; using Scholarships.Models.Forms; using Scholarships.Services; using Serilog; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; namespace Scholarships.Controllers { [Authorize] public class AnswerGroupController : Controller { private readonly ApplicationDbContext _context; private readonly DataService _dataService; private readonly ViewRenderService _viewRenderService; private readonly Services.Configuration _configuration; private readonly IWebHostEnvironment _hostingEnvironment; public AnswerGroupController(ApplicationDbContext context, DataService dataService, ViewRenderService viewRenderService, Services.Configuration configurationService, IWebHostEnvironment hostingEnvironment) { _context = context; _dataService = dataService; _viewRenderService = viewRenderService; _configuration = configurationService; _hostingEnvironment = hostingEnvironment; } /// <summary> /// Returns a form built from a questionset /// </summary> /// <param name="id">AnswerGroupId from a previously constructed AnswerGroup</param> /// <returns></returns> /// [Produces("application/json")] public async Task<object> QuestionFormAjax(int? id) { if (id == null) return NotFound(); // The form still needs the answer group Id QuestionSet qset = await _dataService.GetQuestionSetWithAnswers((int)id); if (qset == null) return NotFound(); var result = new Dictionary<string, object> { { "primaryForm", await _viewRenderService.RenderToStringAsync("QuestionFormAjax", qset) } }; Dictionary<string, IEnumerable<object>> files = new Dictionary<string, IEnumerable<object>>(); foreach (AnswerSet answerset in qset.AnswerSets) { foreach (Answer answer in answerset.Answers) { if (answer.FileAttachmentGroup != null) { var attachments = answer.FileAttachmentGroup.FileAttachments.Select(fa => new { filename = fa.FileName, attachid = fa.FileAttachmentId, uuid = fa.FileAttachmentUuid, size = fa.Length, type = fa.ContentType, url = Url.ActionLink("Download", "SecureDownload", new { id = fa.FileAttachmentId, filename = fa.FileName }, protocol: "https") }).ToList(); files.Add("" + answer.AnswerSetId + "." + answer.QuestionId, attachments); } } } result.Add("attachments", files); return result; } /// <summary> /// Saves an ajax submitted form from /Scholarships/Apply/{id} /// </summary> /// <param name="id">AnswerGroup Id</param> /// <param name="asets">List of partial answersets constructed from form data</param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] [Produces("application/json")] public async Task<FormsBaseViewModel> Save(int? id, ICollection<AnswerSet> asets) { if (id == null) return new FormsBaseViewModel { ErrorCode = QuestionSetError.NotFound }; // First let's see if we can load the relevant question set var qset = await _dataService.GetQuestionSetWithAnswers((int)id); if (qset == null) return new FormsBaseViewModel { ErrorCode = QuestionSetError.NotFound }; foreach (var aset in asets) { var safeAnswerSet = qset.AnswerSets.FirstOrDefault(a => a.AnswerSetId == aset.AnswerSetId); // Check to see if the answerSet is already saved if (safeAnswerSet == null) { // TODO: Create an answerset to hold this answer? continue; // For now we don't have to worry about multiple answersets } if (aset.Answers == null) continue; // Iterate through the answers and save them for (int i = 0; i < aset.Answers.Count; i++) { var answer = aset.Answers[i]; var safeAnswer = safeAnswerSet.Answers.FirstOrDefault(q => q.QuestionId == answer.QuestionId); if (safeAnswer == null) continue; safeAnswer.Response = answer.Response ?? ""; safeAnswer.DateTime = answer.DateTime; safeAnswer.Config = JsonConvert.SerializeObject(new { answer.QuestionOptions }); safeAnswer.QuestionOptionId = answer.QuestionOptionId; // Each answer must be validated, answerId likely to be invalid if (safeAnswer.AnswerId == 0) { _context.Answer.Add(safeAnswer); } else { _context.Answer.Update(safeAnswer); } } await _context.SaveChangesAsync(); } var vm = new QuestionSetViewModel { ErrorCode = QuestionSetError.NoError, PrimaryForm = await _viewRenderService.RenderToStringAsync("QuestionFormAjax", qset) }; return vm; } public async Task<IActionResult> Remove(int id, string uuid) { string attachPath = _configuration.ConfigPath.AttachmentPath; var profile = await _dataService.GetProfileAsync(); if (profile == null) return NotFound(); var fa = await _context.FileAttachment.Include(a => a.FileAttachmentGroup) .FirstOrDefaultAsync(a => a.FileAttachmentId == id && a.FileAttachmentUuid == uuid); // Does this file exist? if (fa == null) { return NotFound(); } if (fa.FileAttachmentGroup.ProfileId == profile.ProfileId) { var filePath = Path.Combine(attachPath, fa.FileSubPath, fa.SecureFileName); try { _context.FileAttachment.Remove(fa); await _context.SaveChangesAsync(); System.IO.File.Delete(filePath); } catch (Exception e) { Log.Error(e, "Unable to delete file: {0}", filePath); } } return Ok(); } // See https://stackoverflow.com/questions/17759286/how-can-i-show-you-the-files-already-stored-on-server-using-dropzone-js for how to integrate already existing files into display // Scroll down to section that shows init function solution [Produces("application/json")] public async Task<object> Upload(IEnumerable<IFormFile> files, int questionid, int answersetid) { string attachPath = _configuration.ConfigPath.AttachmentPath; var profile = await _dataService.GetProfileAsync(); var aset = await _context.AnswerSet.Include(a => a.Answers) .FirstOrDefaultAsync(a => a.AnswerSetId == answersetid && a.ProfileId == profile.ProfileId); if (aset == null) return NotFound(); var answer = aset.Answers.FirstOrDefault(a => a.QuestionId == questionid); if (answer == null) { answer = new Answer { AnswerSetId = aset.AnswerSetId, QuestionId = questionid }; } if (answer.FileAttachmentGroupId == null) { // We need to create a new file attachment group FileAttachmentGroup fg = new FileAttachmentGroup { ProfileId = profile.ProfileId }; _context.FileAttachmentGroup.Add(fg); await _context.SaveChangesAsync(); answer.FileAttachmentGroupId = fg.FileAttachmentGroupId; _context.Answer.Update(answer); await _context.SaveChangesAsync(); } //long totalsize = files.Sum(f => f.Length); // full path to file in temp location // var filePath = Path.GetTempFileName(); List<object> response = new List<object>(); foreach (var formFile in files) { if (formFile.Length > 0) { FileAttachment fa = new FileAttachment { FileAttachmentGroupId = (int)answer.FileAttachmentGroupId, FileName = Path.GetFileName(formFile.FileName), ContentType = formFile.ContentType, CreatedDate = DateTime.Now, Length = formFile.Length, SecureFileName = Path.GetRandomFileName() }; if (!fa.ContentType.StartsWith("image/") && fa.ContentType != "application/pdf") continue; List<string> pathParts = new List<string>(); pathParts.Add("" + DateTime.Now.Year); pathParts.Add("" + profile.ProfileId); pathParts.Add("" + fa.FileAttachmentGroupId); // Calculate the subpath based on the current year and the user's profile Id fa.FileSubPath = Path.Combine(pathParts.ToArray()); // Now let's build the correct filepath pathParts.Insert(0, attachPath); var filePath = Path.Combine(pathParts.ToArray()); // Create the directory if it doesn't exist Directory.CreateDirectory(filePath); // Now add the secure filename and build the full file path pathParts.Add(fa.SecureFileName); filePath = Path.Combine(pathParts.ToArray()); using (var ftStream = formFile.OpenReadStream()) { // Examine the file byte structure to validate the type IFileType fileType = FileTypeValidator.GetFileType(ftStream); switch (fileType.Extension) { case "jpg": case "png": case "gif": case "pdf": case "doc": case "docx": _context.FileAttachment.Add(fa); await _context.SaveChangesAsync(); using (var stream = new FileStream(filePath, FileMode.Create)) { await formFile.CopyToAsync(stream); } response.Add(new { status = "verified", attachid = fa.FileAttachmentId, uuid = fa.FileAttachmentUuid, fa.FileName }); break; default: response.Add(new { status = "invalid", uuid = "", fa.FileName }); break; } } } } return response; } } }
38.300595
213
0.502992
[ "MIT" ]
eahs/Scholarships
ADSBackend/Controllers/AnswerGroupController.cs
12,871
C#
using System; using System.Collections.Generic; using System.Text; using Singularis.Specification.Definition; using Singularis.Specification.Definition.Query; using Singularis.Specification.Demo.Models; namespace Singularis.Specification.Demo.Specifications { class UserWithRelatedObjects : Specification<User> { public UserWithRelatedObjects() { Query = Source() .Fetch(x => x.Characters) .ThenFetch(x => x.Items) .ThenFetch(x => x.Runes) .ThenFetch(x => x.Rune); } } }
22.772727
54
0.740519
[ "Apache-2.0" ]
SingularisLab/singularis.specification
src/Singularis.Specification/Singularis.Specification.Demo/Specifications/UserWithRelatedObjects.cs
503
C#
// <auto-generated> // automatically generated by the FlatBuffers compiler, do not modify // </auto-generated> namespace MyGame.Example { using global::System; using global::System.Collections.Generic; using global::FlatBuffers; public struct TypeAliases : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); } public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb) { return GetRootAsTypeAliases(_bb, new TypeAliases()); } public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public TypeAliases __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public sbyte I8 { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } } public bool MutateI8(sbyte i8) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, i8); return true; } else { return false; } } public byte U8 { get { int o = __p.__offset(6); return o != 0 ? __p.bb.Get(o + __p.bb_pos) : (byte)0; } } public bool MutateU8(byte u8) { int o = __p.__offset(6); if (o != 0) { __p.bb.Put(o + __p.bb_pos, u8); return true; } else { return false; } } public short I16 { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } } public bool MutateI16(short i16) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutShort(o + __p.bb_pos, i16); return true; } else { return false; } } public ushort U16 { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } } public bool MutateU16(ushort u16) { int o = __p.__offset(10); if (o != 0) { __p.bb.PutUshort(o + __p.bb_pos, u16); return true; } else { return false; } } public int I32 { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public bool MutateI32(int i32) { int o = __p.__offset(12); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, i32); return true; } else { return false; } } public uint U32 { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } } public bool MutateU32(uint u32) { int o = __p.__offset(14); if (o != 0) { __p.bb.PutUint(o + __p.bb_pos, u32); return true; } else { return false; } } public long I64 { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public bool MutateI64(long i64) { int o = __p.__offset(16); if (o != 0) { __p.bb.PutLong(o + __p.bb_pos, i64); return true; } else { return false; } } public ulong U64 { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong)0; } } public bool MutateU64(ulong u64) { int o = __p.__offset(18); if (o != 0) { __p.bb.PutUlong(o + __p.bb_pos, u64); return true; } else { return false; } } public float F32 { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } } public bool MutateF32(float f32) { int o = __p.__offset(20); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f32); return true; } else { return false; } } public double F64 { get { int o = __p.__offset(22); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)0.0; } } public bool MutateF64(double f64) { int o = __p.__offset(22); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, f64); return true; } else { return false; } } public sbyte V8(int j) { int o = __p.__offset(24); return o != 0 ? __p.bb.GetSbyte(__p.__vector(o) + j * 1) : (sbyte)0; } public int V8Length { get { int o = __p.__offset(24); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span<sbyte> GetV8Bytes() { return __p.__vector_as_span<sbyte>(24, 1); } #else public ArraySegment<byte>? GetV8Bytes() { return __p.__vector_as_arraysegment(24); } #endif public sbyte[] GetV8Array() { return __p.__vector_as_array<sbyte>(24); } public bool MutateV8(int j, sbyte v8) { int o = __p.__offset(24); if (o != 0) { __p.bb.PutSbyte(__p.__vector(o) + j * 1, v8); return true; } else { return false; } } public double Vf64(int j) { int o = __p.__offset(26); return o != 0 ? __p.bb.GetDouble(__p.__vector(o) + j * 8) : (double)0; } public int Vf64Length { get { int o = __p.__offset(26); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span<double> GetVf64Bytes() { return __p.__vector_as_span<double>(26, 8); } #else public ArraySegment<byte>? GetVf64Bytes() { return __p.__vector_as_arraysegment(26); } #endif public double[] GetVf64Array() { return __p.__vector_as_array<double>(26); } public bool MutateVf64(int j, double vf64) { int o = __p.__offset(26); if (o != 0) { __p.bb.PutDouble(__p.__vector(o) + j * 8, vf64); return true; } else { return false; } } public static Offset<MyGame.Example.TypeAliases> CreateTypeAliases(FlatBufferBuilder builder, sbyte i8 = 0, byte u8 = 0, short i16 = 0, ushort u16 = 0, int i32 = 0, uint u32 = 0, long i64 = 0, ulong u64 = 0, float f32 = 0.0f, double f64 = 0.0, VectorOffset v8Offset = default(VectorOffset), VectorOffset vf64Offset = default(VectorOffset)) { builder.StartTable(12); TypeAliases.AddF64(builder, f64); TypeAliases.AddU64(builder, u64); TypeAliases.AddI64(builder, i64); TypeAliases.AddVf64(builder, vf64Offset); TypeAliases.AddV8(builder, v8Offset); TypeAliases.AddF32(builder, f32); TypeAliases.AddU32(builder, u32); TypeAliases.AddI32(builder, i32); TypeAliases.AddU16(builder, u16); TypeAliases.AddI16(builder, i16); TypeAliases.AddU8(builder, u8); TypeAliases.AddI8(builder, i8); return TypeAliases.EndTypeAliases(builder); } public static void StartTypeAliases(FlatBufferBuilder builder) { builder.StartTable(12); } public static void AddI8(FlatBufferBuilder builder, sbyte i8) { builder.AddSbyte(0, i8, 0); } public static void AddU8(FlatBufferBuilder builder, byte u8) { builder.AddByte(1, u8, 0); } public static void AddI16(FlatBufferBuilder builder, short i16) { builder.AddShort(2, i16, 0); } public static void AddU16(FlatBufferBuilder builder, ushort u16) { builder.AddUshort(3, u16, 0); } public static void AddI32(FlatBufferBuilder builder, int i32) { builder.AddInt(4, i32, 0); } public static void AddU32(FlatBufferBuilder builder, uint u32) { builder.AddUint(5, u32, 0); } public static void AddI64(FlatBufferBuilder builder, long i64) { builder.AddLong(6, i64, 0); } public static void AddU64(FlatBufferBuilder builder, ulong u64) { builder.AddUlong(7, u64, 0); } public static void AddF32(FlatBufferBuilder builder, float f32) { builder.AddFloat(8, f32, 0.0f); } public static void AddF64(FlatBufferBuilder builder, double f64) { builder.AddDouble(9, f64, 0.0); } public static void AddV8(FlatBufferBuilder builder, VectorOffset v8Offset) { builder.AddOffset(10, v8Offset.Value, 0); } public static VectorOffset CreateV8Vector(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddSbyte(data[i]); return builder.EndVector(); } public static VectorOffset CreateV8VectorBlock(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); } public static void StartV8Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); } public static void AddVf64(FlatBufferBuilder builder, VectorOffset vf64Offset) { builder.AddOffset(11, vf64Offset.Value, 0); } public static VectorOffset CreateVf64Vector(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddDouble(data[i]); return builder.EndVector(); } public static VectorOffset CreateVf64VectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static void StartVf64Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static Offset<MyGame.Example.TypeAliases> EndTypeAliases(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset<MyGame.Example.TypeAliases>(o); } public TypeAliasesT UnPack() { var _o = new TypeAliasesT(); this.UnPackTo(_o); return _o; } public void UnPackTo(TypeAliasesT _o) { _o.I8 = this.I8; _o.U8 = this.U8; _o.I16 = this.I16; _o.U16 = this.U16; _o.I32 = this.I32; _o.U32 = this.U32; _o.I64 = this.I64; _o.U64 = this.U64; _o.F32 = this.F32; _o.F64 = this.F64; _o.V8 = new List<sbyte>(); for (var _j = 0; _j < this.V8Length; ++_j) {_o.V8.Add(this.V8(_j));} _o.Vf64 = new List<double>(); for (var _j = 0; _j < this.Vf64Length; ++_j) {_o.Vf64.Add(this.Vf64(_j));} } public static Offset<MyGame.Example.TypeAliases> Pack(FlatBufferBuilder builder, TypeAliasesT _o) { if (_o == null) return default(Offset<MyGame.Example.TypeAliases>); var _v8 = default(VectorOffset); if (_o.V8 != null) { var __v8 = _o.V8.ToArray(); _v8 = CreateV8Vector(builder, __v8); } var _vf64 = default(VectorOffset); if (_o.Vf64 != null) { var __vf64 = _o.Vf64.ToArray(); _vf64 = CreateVf64Vector(builder, __vf64); } return CreateTypeAliases( builder, _o.I8, _o.U8, _o.I16, _o.U16, _o.I32, _o.U32, _o.I64, _o.U64, _o.F32, _o.F64, _v8, _vf64); } }; public class TypeAliasesT { [Newtonsoft.Json.JsonProperty("i8")] public sbyte I8 { get; set; } [Newtonsoft.Json.JsonProperty("u8")] public byte U8 { get; set; } [Newtonsoft.Json.JsonProperty("i16")] public short I16 { get; set; } [Newtonsoft.Json.JsonProperty("u16")] public ushort U16 { get; set; } [Newtonsoft.Json.JsonProperty("i32")] public int I32 { get; set; } [Newtonsoft.Json.JsonProperty("u32")] public uint U32 { get; set; } [Newtonsoft.Json.JsonProperty("i64")] public long I64 { get; set; } [Newtonsoft.Json.JsonProperty("u64")] public ulong U64 { get; set; } [Newtonsoft.Json.JsonProperty("f32")] public float F32 { get; set; } [Newtonsoft.Json.JsonProperty("f64")] public double F64 { get; set; } [Newtonsoft.Json.JsonProperty("v8")] public List<sbyte> V8 { get; set; } [Newtonsoft.Json.JsonProperty("vf64")] public List<double> Vf64 { get; set; } public TypeAliasesT() { this.I8 = 0; this.U8 = 0; this.I16 = 0; this.U16 = 0; this.I32 = 0; this.U32 = 0; this.I64 = 0; this.U64 = 0; this.F32 = 0.0f; this.F64 = 0.0; this.V8 = null; this.Vf64 = null; } } }
52.548077
230
0.668893
[ "Apache-2.0" ]
khoitd1997/flatbuffers
tests/MyGame/Example/TypeAliases.cs
10,930
C#
using Microsoft.EntityFrameworkCore; using Simu.App.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Simu.Data.Context { public class MeuDbContext : DbContext { public MeuDbContext(DbContextOptions options) : base(options) { } public DbSet<Prova> Provas { get; set; } public DbSet<Questao> Questoes { get; set; } public DbSet<Assunto> Assuntos { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { //foreach (var property in modelBuilder.Model.GetEntityTypes() // .SelectMany(e => e.GetProperties() // .Where(p => p.ClrType == typeof(string)))) // property.Relational().ColumnType = "varchar(200)"; modelBuilder.ApplyConfigurationsFromAssembly(typeof(MeuDbContext).Assembly); base.OnModelCreating(modelBuilder); } } }
30.484848
88
0.642147
[ "MIT" ]
ericksalec/SimuPoscomp
src/Simu.Data/Context/MeuDbContext.cs
1,008
C#