content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using Newtonsoft.Json.Linq; using Skybrud.Essentials.Json.Extensions; namespace Skybrud.Social.Slack.Models.Channels { /// <summary> /// Class representing a the response body of a single Slack channel. /// </summary> public class SlackChannelResponseBody : SlackResponseBody { #region Properties /// <summary> /// Gets a reference to the channel from the response body. /// </summary> public SlackChannel Channel { get; } #endregion #region Constructors /// <summary> /// Initializes a new instance based on the specified <paramref name="obj"/>. /// </summary> /// <param name="obj">An instance of <see cref="JObject"/> representing the object.</param> protected SlackChannelResponseBody(JObject obj) : base(obj) { Channel = obj.GetObject("channel", SlackChannel.Parse); } #endregion #region Static methods /// <summary> /// Parses the specified <paramref name="obj"/> into an instance of <see cref="SlackChannelResponseBody"/>. /// </summary> /// <param name="obj">The instance of <see cref="JObject"/> to parse.</param> /// <returns>An instance of <see cref="SlackChannelResponseBody"/>.</returns> public static SlackChannelResponseBody Parse(JObject obj) { return obj == null ? null : new SlackChannelResponseBody(obj); } #endregion } }
31.617021
115
0.615747
[ "MIT" ]
abjerner/Skybrud.Social.Slack
src/Skybrud.Social.Slack/Models/Channels/SlackChannelResponseBody.cs
1,488
C#
#if !NOJSONNET using NBitcoin.Crypto; using NBitcoin.DataEncoders; using NBitcoin.Protocol; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Runtime.ExceptionServices; using System.Text; using System.Threading; using System.Threading.Tasks; using static NBitcoin.RPC.BlockchainInfo; namespace NBitcoin.RPC { /* Category Name Implemented ------------------ --------------------------- ----------------------- ------------------ Overall control/query calls control getinfo control help control stop ------------------ P2P networking network getnetworkinfo network addnode Yes network disconnectnode network getaddednodeinfo Yes network getconnectioncount network getnettotals network getpeerinfo Yes network ping network setban network listbanned network clearbanned ------------------ Block chain and UTXO blockchain getblockchaininfo Yes blockchain getbestblockhash Yes blockchain getblockcount Yes blockchain getblock Yes blockchain getblockhash Yes blockchain getchaintips blockchain getdifficulty blockchain getmempoolinfo blockchain getrawmempool Yes blockchain gettxout Yes blockchain gettxoutproof blockchain verifytxoutproof blockchain gettxoutsetinfo Yes blockchain verifychain ------------------ Mining mining getblocktemplate mining getmininginfo mining getnetworkhashps mining prioritisetransaction mining submitblock ------------------ Coin generation generating getgenerate generating setgenerate generating generate ------------------ Raw transactions rawtransactions createrawtransaction rawtransactions decoderawtransaction rawtransactions decodescript rawtransactions getrawtransaction rawtransactions sendrawtransaction rawtransactions signrawtransaction rawtransactions fundrawtransaction ------------------ PSBT psbt - decodepsbt psbt - combinepsbt psbt - finalizepsbt psbt - createpsbt psbt - convertopsbt ------------------ Utility functions util createmultisig util validateaddress util verifymessage util estimatefee Yes util estimatesmartfee Yes ------------------ Not shown in help hidden invalidateblock Yes hidden reconsiderblock hidden setmocktime hidden resendwallettransactions ------------------ Wallet wallet addmultisigaddress wallet backupwallet Yes wallet dumpprivkey Yes wallet dumpwallet wallet encryptwallet wallet getaccountaddress Yes wallet getaccount wallet getaddressesbyaccount wallet getbalance wallet getnewaddress wallet getrawchangeaddress wallet getreceivedbyaccount wallet getreceivedbyaddress wallet gettransaction wallet getunconfirmedbalance wallet getwalletinfo wallet importprivkey Yes wallet importwallet wallet importaddress Yes wallet keypoolrefill wallet listaccounts Yes wallet listaddressgroupings Yes wallet listlockunspent wallet listreceivedbyaccount wallet listreceivedbyaddress wallet listsinceblock wallet listtransactions wallet listunspent Yes wallet lockunspent Yes wallet move wallet sendfrom wallet sendmany wallet sendtoaddress wallet setaccount wallet settxfee wallet signmessage wallet walletlock wallet walletpassphrasechange wallet walletpassphrase Yes wallet walletprocesspsbt wallet walletcreatefundedpsbt */ public partial class RPCClient : IBlockRepository { public static string GetRPCAuth(NetworkCredential credentials) { if (credentials == null) throw new ArgumentNullException(nameof(credentials)); var salt = Encoders.Hex.EncodeData(RandomUtils.GetBytes(16)); var nobom = new UTF8Encoding(false); var result = Hashes.HMACSHA256(nobom.GetBytes(salt), nobom.GetBytes(credentials.Password)); return $"{credentials.UserName}:{salt}${Encoders.Hex.EncodeData(result)}"; } private static Lazy<HttpClient> _Shared = new Lazy<HttpClient>(() => new HttpClient() { Timeout = System.Threading.Timeout.InfiniteTimeSpan }); HttpClient _HttpClient; public HttpClient HttpClient { get { return _HttpClient ?? _Shared.Value; } set { _HttpClient = value; } } private string _Authentication; private readonly Uri _address; public Uri Address { get { return _address; } } RPCCredentialString _CredentialString; public RPCCredentialString CredentialString { get { return _CredentialString; } } private readonly Network _network; public Network Network { get { return _network; } } /// <summary> /// Use default bitcoin parameters to configure a RPCClient. /// </summary> /// <param name="network">The network used by the node. Must not be null.</param> public RPCClient(Network network) : this(null as string, BuildUri(null, null, network.RPCPort), network) { } [Obsolete("Use RPCClient(ConnectionString, string, Network)")] public RPCClient(NetworkCredential credentials, string host, Network network) : this(credentials, BuildUri(host, null, network.RPCPort), network) { } public RPCClient(RPCCredentialString credentials, Network network) : this(credentials, null as String, network) { } public RPCClient(RPCCredentialString credentials, string host, Network network) : this(credentials, BuildUri(host, credentials.ToString(), network.RPCPort), network) { } public RPCClient(RPCCredentialString credentials, Uri address, Network network) { credentials = credentials ?? new RPCCredentialString(); if (address != null && network == null) { network = Network.GetNetworks().FirstOrDefault(n => n.RPCPort == address.Port); if (network == null) throw new ArgumentNullException(nameof(network)); } if (credentials.UseDefault && network == null) throw new ArgumentException("network parameter is required if you use default credentials"); if (address == null && network == null) throw new ArgumentException("network parameter is required if you use default uri"); if (address == null) address = new Uri("http://127.0.0.1:" + network.RPCPort + "/"); if (credentials.UseDefault) { //will throw impossible to get the cookie path GetDefaultCookieFilePath(network); } _CredentialString = credentials; _address = address; _network = network; if (credentials.UserPassword != null) { _Authentication = $"{credentials.UserPassword.UserName}:{credentials.UserPassword.Password}"; } if (_Authentication == null) { TryRenewCookie(); } } static ConcurrentDictionary<Network, string> _DefaultPaths = new ConcurrentDictionary<Network, string>(); static RPCClient() { #if !NOFILEIO var home = Environment.GetEnvironmentVariable("HOME"); var localAppData = Environment.GetEnvironmentVariable("APPDATA"); if (string.IsNullOrEmpty(home) && string.IsNullOrEmpty(localAppData)) return; if (!string.IsNullOrEmpty(home) && string.IsNullOrEmpty(localAppData)) { var bitcoinFolder = Path.Combine(home, ".bitcoin"); var mainnet = Path.Combine(bitcoinFolder, ".cookie"); RegisterDefaultCookiePath(Network.Main, mainnet); var testnet = Path.Combine(bitcoinFolder, "testnet3", ".cookie"); RegisterDefaultCookiePath(Network.TestNet, testnet); var regtest = Path.Combine(bitcoinFolder, "regtest", ".cookie"); RegisterDefaultCookiePath(Network.RegTest, regtest); } else if (!string.IsNullOrEmpty(localAppData)) { var bitcoinFolder = Path.Combine(localAppData, "Bitcoin"); var mainnet = Path.Combine(bitcoinFolder, ".cookie"); RegisterDefaultCookiePath(Network.Main, mainnet); var testnet = Path.Combine(bitcoinFolder, "testnet3", ".cookie"); RegisterDefaultCookiePath(Network.TestNet, testnet); var regtest = Path.Combine(bitcoinFolder, "regtest", ".cookie"); RegisterDefaultCookiePath(Network.RegTest, regtest); } #endif } public static void RegisterDefaultCookiePath(Network network, string path) { _DefaultPaths.TryAdd(network, path); } private string GetCookiePath() { if (CredentialString.UseDefault && Network == null) throw new InvalidOperationException("NBitcoin bug, report to the developers"); if (CredentialString.UseDefault) return GetDefaultCookieFilePath(Network); if (CredentialString.CookieFile != null) return CredentialString.CookieFile; return null; } /// <summary> /// The RPC Capabilities of this RPCClient instance, this property will be set by a call to ScanRPCCapabilitiesAsync /// </summary> public RPCCapabilities Capabilities { get; set; } /// <summary> /// Run several RPC function to scan the RPC capabilities, then set RPCClient.Capabilities /// </summary> /// <returns>The RPCCapabilities</returns> public async Task<RPCCapabilities> ScanRPCCapabilitiesAsync() { var capabilities = new RPCCapabilities(); var rpc = this.PrepareBatch(); var waiting = Task.WhenAll( SetVersion(capabilities), CheckCapabilities(rpc, "scantxoutset", v => capabilities.SupportScanUTXOSet = v), CheckCapabilities(rpc, "signrawtransactionwithkey", v => capabilities.SupportSignRawTransactionWith = v), CheckCapabilities(rpc, "testmempoolaccept", v => capabilities.SupportTestMempoolAccept = v), CheckCapabilities(rpc, "estimatesmartfee", v => capabilities.SupportEstimateSmartFee = v), CheckCapabilities(rpc, "generatetoaddress", v => capabilities.SupportGenerateToAddress = v), CheckSegwitCapabilities(rpc, v => capabilities.SupportSegwit = v)); await rpc.SendBatchAsync().ConfigureAwait(false); await waiting.ConfigureAwait(false); #if !NETSTANDARD1X Thread.MemoryBarrier(); #endif if (!capabilities.SupportGetNetworkInfo) { #pragma warning disable CS0618 // Type or member is obsolete var getInfo = await SendCommandAsync(RPCOperations.getinfo); #pragma warning restore CS0618 // Type or member is obsolete capabilities.Version = ((JObject)getInfo.Result)["version"].Value<int>(); } Capabilities = capabilities; return capabilities; } private async Task SetVersion(RPCCapabilities capabilities) { try { var getInfo = await SendCommandAsync(RPCOperations.getnetworkinfo); capabilities.Version = ((JObject)getInfo.Result)["version"].Value<int>(); capabilities.SupportGetNetworkInfo = true; return; } catch (RPCException ex) when (ex.RPCCode == RPCErrorCode.RPC_METHOD_NOT_FOUND || ex.RPCCode == RPCErrorCode.RPC_METHOD_DEPRECATED) { capabilities.SupportGetNetworkInfo = false; } } /// <summary> /// Run several RPC function to scan the RPC capabilities, then set RPCClient.RPCCapabilities /// </summary> /// <returns>The RPCCapabilities</returns> public RPCCapabilities ScanRPCCapabilities() { return ScanRPCCapabilitiesAsync().GetAwaiter().GetResult(); } async static Task CheckSegwitCapabilities(RPCClient rpc, Action<bool> setResult) { var address = new Key().ScriptPubKey.WitHash.ScriptPubKey.GetDestinationAddress(rpc.Network); if (address == null) { setResult(false); return; } try { var result = await rpc.SendCommandAsync("validateaddress", new[] { address.ToString() }).ConfigureAwait(false); result.ThrowIfError(); setResult(result.Result["isvalid"].Value<bool>()); } catch (RPCException ex) { setResult(ex.RPCCode == RPCErrorCode.RPC_TYPE_ERROR); } catch { setResult(false); } } private static async Task CheckCapabilities(Func<Task> command, Action<bool> setResult) { try { await command().ConfigureAwait(false); setResult(true); } catch (RPCException ex) when (ex.RPCCode == RPCErrorCode.RPC_METHOD_NOT_FOUND || ex.RPCCode == RPCErrorCode.RPC_METHOD_DEPRECATED) { setResult(false); } catch (RPCException) { setResult(true); } catch { setResult(false); } } private static Task CheckCapabilities(RPCClient rpc, string command, Action<bool> setResult) { return CheckCapabilities(() => rpc.SendCommandAsync(command, "random"), setResult); } public static string GetDefaultCookieFilePath(Network network) { string path = null; if (!_DefaultPaths.TryGetValue(network, out path)) throw new ArgumentException("This network has no default cookie file path registered, use RPCClient.RegisterDefaultCookiePath to register", "network"); return path; } public static string TryGetDefaultCookieFilePath(Network network) { string path = null; if (!_DefaultPaths.TryGetValue(network, out path)) return null; return path; } /// <summary> /// Create a new RPCClient instance /// </summary> /// <param name="authenticationString">username:password, the content of the .cookie file, or cookiefile=pathToCookieFile</param> /// <param name="hostOrUri"></param> /// <param name="network"></param> public RPCClient(string authenticationString, string hostOrUri, Network network) : this(authenticationString, BuildUri(hostOrUri, authenticationString, network.RPCPort), network) { } private static Uri BuildUri(string hostOrUri, string connectionString, int port) { RPCCredentialString connString; if (connectionString != null && RPCCredentialString.TryParse(connectionString, out connString)) { if (connString.Server != null) hostOrUri = connString.Server; } if (hostOrUri != null) { hostOrUri = hostOrUri.Trim(); try { if (hostOrUri.StartsWith("https://", StringComparison.OrdinalIgnoreCase) || hostOrUri.StartsWith("http://", StringComparison.OrdinalIgnoreCase)) return new Uri(hostOrUri, UriKind.Absolute); } catch { } } hostOrUri = hostOrUri ?? "127.0.0.1"; var indexOfPort = hostOrUri.IndexOf(":"); if (indexOfPort != -1) { port = int.Parse(hostOrUri.Substring(indexOfPort + 1)); hostOrUri = hostOrUri.Substring(0, indexOfPort); } UriBuilder builder = new UriBuilder(); builder.Host = hostOrUri; builder.Scheme = "http"; builder.Port = port; return builder.Uri; } public RPCClient(NetworkCredential credentials, Uri address, Network network = null) : this(credentials == null ? null : (credentials.UserName + ":" + credentials.Password), address, network) { } /// <summary> /// Create a new RPCClient instance /// </summary> /// <param name="authenticationString">username:password or the content of the .cookie file or null to auto configure</param> /// <param name="address"></param> /// <param name="network"></param> public RPCClient(string authenticationString, Uri address, Network network = null) : this(authenticationString == null ? null as RPCCredentialString : RPCCredentialString.Parse(authenticationString), address, network) { } public string Authentication { get { return _Authentication; } } ConcurrentQueue<Tuple<RPCRequest, TaskCompletionSource<RPCResponse>>> _BatchedRequests; public RPCClient PrepareBatch() { return new RPCClient(CredentialString, Address, Network) { _BatchedRequests = new ConcurrentQueue<Tuple<RPCRequest, TaskCompletionSource<RPCResponse>>>(), Capabilities = Capabilities, RequestTimeout = RequestTimeout, _HttpClient = _HttpClient }; } public RPCClient Clone() { return new RPCClient(CredentialString, Address, Network) { _BatchedRequests = _BatchedRequests, Capabilities = Capabilities, RequestTimeout = RequestTimeout, _HttpClient = _HttpClient }; } public RPCResponse SendCommand(RPCOperations commandName, params object[] parameters) { return SendCommand(commandName.ToString(), parameters); } public BitcoinAddress GetNewAddress() { return BitcoinAddress.Create(SendCommand(RPCOperations.getnewaddress).Result.ToString(), Network); } public BitcoinAddress GetNewAddress(GetNewAddressRequest request) { return GetNewAddressAsync(request).GetAwaiter().GetResult(); } public async Task<BitcoinAddress> GetNewAddressAsync() { var result = await SendCommandAsync(RPCOperations.getnewaddress).ConfigureAwait(false); return BitcoinAddress.Create(result.Result.ToString(), Network); } public async Task<BitcoinAddress> GetNewAddressAsync(GetNewAddressRequest request) { var p = new Dictionary<string, object>(); if (request != null) { if (request.Label != null) { p.Add("label", request.Label); } if (request.AddressType != null) { p.Add("address_type", request.AddressType.Value == AddressType.Bech32 ? "bech32" : request.AddressType.Value == AddressType.Legacy ? "legacy" : request.AddressType.Value == AddressType.P2SHSegwit ? "p2sh-segwit" : throw new NotSupportedException(request.AddressType.Value.ToString()) ); } } return BitcoinAddress.Create((await SendCommandWithNamedArgsAsync(RPCOperations.getnewaddress.ToString(), p).ConfigureAwait(false)).Result.ToString(), Network); } public BitcoinAddress GetRawChangeAddress() { return GetRawChangeAddressAsync().GetAwaiter().GetResult(); } public async Task<BitcoinAddress> GetRawChangeAddressAsync() { var result = await SendCommandAsync(RPCOperations.getrawchangeaddress).ConfigureAwait(false); return BitcoinAddress.Create(result.Result.ToString(), Network); } public Task<RPCResponse> SendCommandAsync(RPCOperations commandName, params object[] parameters) { return SendCommandAsync(commandName.ToString(), parameters); } /// <summary> /// Send a command /// </summary> /// <param name="commandName">https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list</param> /// <param name="parameters"></param> /// <returns></returns> public RPCResponse SendCommand(string commandName, params object[] parameters) { return SendCommand(new RPCRequest(commandName, parameters)); } public RPCResponse SendCommandWithNamedArgs(string commandName, Dictionary<string, object> parameters) { return SendCommand(new RPCRequest() { Method = commandName, NamedParams = parameters }); } public Task<RPCResponse> SendCommandWithNamedArgsAsync(string commandName, Dictionary<string, object> parameters) { return SendCommandAsync(new RPCRequest() { Method = commandName, NamedParams = parameters }); } public Task<RPCResponse> SendCommandAsync(string commandName, params object[] parameters) { return SendCommandAsync(new RPCRequest(commandName, parameters)); } public RPCResponse SendCommand(RPCRequest request, bool throwIfRPCError = true) { return SendCommandAsync(request, throwIfRPCError).GetAwaiter().GetResult(); } /// <summary> /// Send all commands in one batch /// </summary> public void SendBatch() { SendBatchAsync().GetAwaiter().GetResult(); } /// <summary> /// Cancel all commands /// </summary> public void CancelBatch() { var batches = _BatchedRequests; if (batches == null) throw new InvalidOperationException("This RPCClient instance is not a batch, use PrepareBatch"); _BatchedRequests = null; Tuple<RPCRequest, TaskCompletionSource<RPCResponse>> req; while (batches.TryDequeue(out req)) { req.Item2.TrySetCanceled(); } } public async Task StopAsync() { await SendCommandAsync(RPCOperations.stop).ConfigureAwait(false); } public void Stop() { SendCommand(RPCOperations.stop); } /// <summary> /// Returns the total uptime of the server. /// </summary> public TimeSpan Uptime() { return UptimeAsync().GetAwaiter().GetResult(); } /// <summary> /// Returns the total uptime of the server. /// </summary> public async Task<TimeSpan> UptimeAsync() { var res = await SendCommandAsync(RPCOperations.uptime).ConfigureAwait(false); return TimeSpan.FromSeconds(res.Result.Value<double>()); } /// <summary> /// Scans the unspent transaction output set for entries that match certain output descriptors. /// </summary> /// <param name="descriptorObjects"></param> /// <returns></returns> public async Task<ScanTxoutSetResponse> StartScanTxoutSetAsync(params ScanTxoutSetObject[] descriptorObjects) { if (descriptorObjects == null) throw new ArgumentNullException(nameof(descriptorObjects)); JArray descriptorsJson = new JArray(); foreach (var descObj in descriptorObjects) { JObject descJson = new JObject(); descJson.Add(new JProperty("desc", descObj.Descriptor.Value)); if (descObj.Range.HasValue) { descJson.Add(new JProperty("range", descObj.Range.Value)); } descriptorsJson.Add(descJson); } var result = await SendCommandAsync(RPCOperations.scantxoutset, "start", descriptorsJson); result.ThrowIfError(); var jobj = result.Result as JObject; var amount = Money.Coins(jobj.Property("total_amount").Value.Value<decimal>()); var success = jobj.Property("success").Value.Value<bool>(); //searched_items var searchedItems = (int)(jobj.Property("txouts") ?? jobj.Property("searched_items")).Value.Value<long>(); var outputs = new List<ScanTxoutOutput>(); foreach (var unspent in (jobj.Property("unspents").Value as JArray).OfType<JObject>()) { OutPoint outpoint = OutPoint.Parse($"{unspent.Property("txid").Value.Value<string>()}-{(int)unspent.Property("vout").Value.Value<long>()}"); var a = Money.Coins(unspent.Property("amount").Value.Value<decimal>()); int height = (int)unspent.Property("height").Value.Value<long>(); var scriptPubKey = Script.FromBytesUnsafe(Encoders.Hex.DecodeData(unspent.Property("scriptPubKey").Value.Value<string>())); outputs.Add(new ScanTxoutOutput() { Coin = new Coin(outpoint, new TxOut(a, scriptPubKey)), Height = height }); } return new ScanTxoutSetResponse() { Outputs = outputs.ToArray(), TotalAmount = amount, Success = success, SearchedItems = searchedItems }; } /// <summary> /// Scans the unspent transaction output set for entries that match certain output descriptors. /// </summary> /// <param name="descriptorObjects"></param> /// <returns></returns> public ScanTxoutSetResponse StartScanTxoutSet(params ScanTxoutSetObject[] descriptorObjects) { return StartScanTxoutSetAsync(descriptorObjects).GetAwaiter().GetResult(); } /// <summary> /// Get the progress report (in %) of the current scan /// </summary> /// <returns>The progress in %</returns> public async Task<decimal?> GetStatusScanTxoutSetAsync() { var result = await SendCommandAsync(RPCOperations.scantxoutset, "status", new object[0]).ConfigureAwait(false); result.ThrowIfError(); return (result.Result as JObject)?.Property("progress")?.Value?.Value<decimal>(); } /// <summary> /// Get the progress report (in %) of the current scan /// </summary> /// <returns>The progress in %</returns> public decimal? GetStatusScanTxoutSet() { return GetStatusScanTxoutSetAsync().GetAwaiter().GetResult(); } /// <summary> /// Aborting the current scan /// </summary> /// <returns>Returns true when abort was successful</returns> public async Task<bool> AbortScanTxoutSetAsync() { var result = await SendCommandAsync(RPCOperations.scantxoutset, "abort", new object[0]); result.ThrowIfError(); return ((JValue)result.Result).Value<bool>(); } /// <summary> /// Aborting the current scan /// </summary> /// <returns>Returns true when abort was successful</returns> public bool AbortScanTxoutSet() { return AbortScanTxoutSetAsync().GetAwaiter().GetResult(); } /// <summary> /// Send all commands in one batch /// </summary> public async Task SendBatchAsync() { Tuple<RPCRequest, TaskCompletionSource<RPCResponse>> req; List<Tuple<RPCRequest, TaskCompletionSource<RPCResponse>>> requests = new List<Tuple<RPCRequest, TaskCompletionSource<RPCResponse>>>(); var batches = _BatchedRequests; if (batches == null) throw new InvalidOperationException("This RPCClient instance is not a batch, use PrepareBatch"); _BatchedRequests = null; while (batches.TryDequeue(out req)) { requests.Add(req); } if (requests.Count == 0) return; await SendBatchAsyncCore(requests).ConfigureAwait(false); } private async Task SendBatchAsyncCore(List<Tuple<RPCRequest, TaskCompletionSource<RPCResponse>>> requests) { var writer = new StringWriter(); writer.Write("["); bool first = true; foreach (var item in requests) { if (!first) { writer.Write(","); } first = false; item.Item1.WriteJSON(writer); } writer.Write("]"); writer.Flush(); int responseIndex = 0; JArray response; try { retry: var webRequest = CreateWebRequest(writer.ToString()); using (var cts = new CancellationTokenSource(RequestTimeout)) { using (var httpResponse = await HttpClient.SendAsync(webRequest, cts.Token).ConfigureAwait(false)) { if (httpResponse.IsSuccessStatusCode) { response = JArray.Load(new JsonTextReader( new StreamReader(await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false), NoBOMUTF8))); foreach (var jobj in response.OfType<JObject>()) { try { RPCResponse rpcResponse = new RPCResponse(jobj); requests[responseIndex].Item2.TrySetResult(rpcResponse); } catch (Exception ex) { requests[responseIndex].Item2.TrySetException(ex); } responseIndex++; } } else { if (httpResponse.StatusCode == HttpStatusCode.Unauthorized) { if (TryRenewCookie()) goto retry; httpResponse.EnsureSuccessStatusCode(); // Let's throw } if (httpResponse.Content == null || (httpResponse.Content.Headers.ContentLength == null || httpResponse.Content.Headers.ContentLength.Value == 0) || !httpResponse.Content.Headers.ContentType.MediaType.Equals("application/json", StringComparison.Ordinal)) { httpResponse.EnsureSuccessStatusCode(); // Let's throw } } } } } catch (Exception ex) { foreach (var item in requests) { item.Item2.TrySetException(ex); } } // Because TaskCompletionSources are executing on the threadpool adding a delay make sure they are all treated // when the function returns. Not quite useful, but make that when SendBatch, all tasks are finished running await Task.Delay(1); } public async Task<RPCResponse> SendCommandAsync(RPCRequest request, bool throwIfRPCError = true) { return await SendCommandAsyncCore(request, throwIfRPCError).ConfigureAwait(false); } private bool TryRenewCookie() { var cookiePath = GetCookiePath(); if (cookiePath == null) return false; #if !NOFILEIO try { var newCookie = File.ReadAllText(cookiePath); if (_Authentication == newCookie) return false; _Authentication = newCookie; return true; } //We are only interested into the previous exception catch { return false; } #else throw new NotSupportedException("Cookie authentication is not supported for this platform"); #endif } static Encoding NoBOMUTF8 = new UTF8Encoding(false); async Task<RPCResponse> SendCommandAsyncCore(RPCRequest request, bool throwIfRPCError) { RPCResponse response = null; var batches = _BatchedRequests; if (batches != null) { #if NO_RCA TaskCompletionSource<RPCResponse> source = new TaskCompletionSource<RPCResponse>(); #else TaskCompletionSource<RPCResponse> source = new TaskCompletionSource<RPCResponse>(TaskCreationOptions.RunContinuationsAsynchronously); #endif batches.Enqueue(Tuple.Create(request, source)); response = await source.Task.ConfigureAwait(false); if (throwIfRPCError) response?.ThrowIfError(); } if (response == null) { var writer = new StringWriter(); request.WriteJSON(writer); writer.Flush(); bool renewedCookie = false; TimeSpan retryTimeout = TimeSpan.FromSeconds(1.0); TimeSpan maxRetryTimeout = TimeSpan.FromSeconds(10.0); retry: var webRequest = CreateWebRequest(writer.ToString()); using (var cts = new CancellationTokenSource(RequestTimeout)) { using (var httpResponse = await HttpClient.SendAsync(webRequest, cts.Token).ConfigureAwait(false)) { if (httpResponse.IsSuccessStatusCode) { response = RPCResponse.Load(await httpResponse.Content.ReadAsStreamAsync()); if (throwIfRPCError) response.ThrowIfError(); } else { if (httpResponse.StatusCode == HttpStatusCode.Unauthorized) { if (!renewedCookie && TryRenewCookie()) { renewedCookie = true; goto retry; } httpResponse.EnsureSuccessStatusCode(); // Let's throw } if (IsJson(httpResponse)) { response = RPCResponse.Load(await httpResponse.Content.ReadAsStreamAsync()); if (throwIfRPCError) response.ThrowIfError(); } else if (await IsWorkQueueFull(httpResponse)) { await Task.Delay(retryTimeout, cts.Token); retryTimeout = TimeSpan.FromTicks(retryTimeout.Ticks * 2); if (retryTimeout > maxRetryTimeout) retryTimeout = maxRetryTimeout; goto retry; } else { httpResponse.EnsureSuccessStatusCode(); // Let's throw } } } } } return response; } private bool IsJson(HttpResponseMessage httpResponse) { return httpResponse.Content?.Headers?.ContentType?.MediaType?.Equals("application/json", StringComparison.Ordinal) is true; } private async Task<bool> IsWorkQueueFull(HttpResponseMessage httpResponse) { if (httpResponse.StatusCode != HttpStatusCode.InternalServerError) return false; return (await httpResponse.Content?.ReadAsStringAsync())?.Equals("Work queue depth exceeded", StringComparison.Ordinal) is true; } private HttpRequestMessage CreateWebRequest(string json) { var address = Address.AbsoluteUri; if (!string.IsNullOrEmpty(CredentialString.WalletName)) { if (!address.EndsWith("/")) address = address + "/"; address += "wallet/" + CredentialString.WalletName; } var webRequest = new HttpRequestMessage(HttpMethod.Post, address); webRequest.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Encoders.Base64.EncodeData(Encoders.ASCII.DecodeData(_Authentication))); webRequest.Content = new StringContent(json, NoBOMUTF8, "application/json-rpc"); return webRequest; } public TimeSpan RequestTimeout { get; set; } = TimeSpan.FromSeconds(100); private async Task<Stream> ToMemoryStreamAsync(Stream stream) { MemoryStream ms = new MemoryStream(); await stream.CopyToAsync(ms).ConfigureAwait(false); ms.Position = 0; return ms; } #region P2P Networking #if !NOSOCKET public PeerInfo[] GetPeersInfo() { PeerInfo[] peers = null; peers = GetPeersInfoAsync().GetAwaiter().GetResult(); return peers; } public async Task<PeerInfo[]> GetPeersInfoAsync() { var resp = await SendCommandAsync(RPCOperations.getpeerinfo).ConfigureAwait(false); var peers = resp.Result as JArray; var result = new PeerInfo[peers.Count]; var i = 0; foreach (var peer in peers) { var localAddr = (string)peer["addrlocal"]; var pingWait = peer["pingwait"] != null ? (double)peer["pingwait"] : 0; localAddr = string.IsNullOrEmpty(localAddr) ? "127.0.0.1:8333" : localAddr; ulong services; if (!ulong.TryParse((string)peer["services"], out services)) { services = Utils.ToUInt64(Encoders.Hex.DecodeData((string)peer["services"]), false); } IPEndPoint addressEnpoint = null; try { addressEnpoint = Utils.ParseIpEndpoint((string)peer["addr"], this.Network.DefaultPort, false); } catch { } IPEndPoint localEndpoint = null; try { localEndpoint = Utils.ParseIpEndpoint(localAddr, this.Network.DefaultPort, false); } catch { } result[i++] = new PeerInfo { Id = (int)peer["id"], Address = addressEnpoint, AddressString = (string)peer["addr"], LocalAddress = localEndpoint, LocalAddressString = localAddr, Services = (NodeServices)services, LastSend = Utils.UnixTimeToDateTime((uint)peer["lastsend"]), LastReceive = Utils.UnixTimeToDateTime((uint)peer["lastrecv"]), BytesSent = (long)peer["bytessent"], BytesReceived = (long)peer["bytesrecv"], ConnectionTime = Utils.UnixTimeToDateTime((uint)peer["conntime"]), TimeOffset = TimeSpan.FromSeconds(Math.Min((long)int.MaxValue, (long)peer["timeoffset"])), PingTime = peer["pingtime"] == null ? (TimeSpan?)null : TimeSpan.FromSeconds((double)peer["pingtime"]), PingWait = TimeSpan.FromSeconds(pingWait), Blocks = peer["blocks"] != null ? (int)peer["blocks"] : -1, Version = (int)peer["version"], SubVersion = (string)peer["subver"], Inbound = (bool)peer["inbound"], StartingHeight = (int)peer["startingheight"], SynchronizedBlocks = (int)peer["synced_blocks"], SynchronizedHeaders = (int)peer["synced_headers"], IsWhiteListed = (bool)peer["whitelisted"], BanScore = peer["banscore"] == null ? 0 : (int)peer["banscore"], Inflight = peer["inflight"].Select(x => uint.Parse((string)x)).ToArray() }; } return result; } public void AddNode(EndPoint nodeEndPoint, bool onetry = false) { if (nodeEndPoint == null) throw new ArgumentNullException(nameof(nodeEndPoint)); SendCommand("addnode", nodeEndPoint.ToString(), onetry ? "onetry" : "add"); } public async Task AddNodeAsync(EndPoint nodeEndPoint, bool onetry = false) { if (nodeEndPoint == null) throw new ArgumentNullException(nameof(nodeEndPoint)); await SendCommandAsync(RPCOperations.addnode, nodeEndPoint.ToString(), onetry ? "onetry" : "add").ConfigureAwait(false); } public void RemoveNode(EndPoint nodeEndPoint) { if (nodeEndPoint == null) throw new ArgumentNullException(nameof(nodeEndPoint)); SendCommandAsync(RPCOperations.addnode, nodeEndPoint.ToString(), "remove"); } public async Task RemoveNodeAsync(EndPoint nodeEndPoint) { if (nodeEndPoint == null) throw new ArgumentNullException(nameof(nodeEndPoint)); await SendCommandAsync(RPCOperations.addnode, nodeEndPoint.ToString(), "remove").ConfigureAwait(false); } public async Task<AddedNodeInfo[]> GetAddedNodeInfoAsync(bool detailed) { var result = await SendCommandAsync(RPCOperations.getaddednodeinfo, detailed).ConfigureAwait(false); var obj = result.Result; return obj.Select(entry => new AddedNodeInfo { AddedNode = Utils.ParseEndpoint((string)entry["addednode"], 8333), Connected = (bool)entry["connected"], Addresses = entry["addresses"].Select(x => new NodeAddressInfo { Address = Utils.ParseEndpoint((string)x["address"], 8333) as IPEndPoint, Connected = (bool)x["connected"] }) }).ToArray(); } public AddedNodeInfo[] GetAddedNodeInfo(bool detailed) { AddedNodeInfo[] addedNodesInfo = null; addedNodesInfo = GetAddedNodeInfoAsync(detailed).GetAwaiter().GetResult(); return addedNodesInfo; } public AddedNodeInfo GetAddedNodeInfo(bool detailed, EndPoint nodeEndPoint) { AddedNodeInfo addedNodeInfo = null; addedNodeInfo = GetAddedNodeInfoAync(detailed, nodeEndPoint).GetAwaiter().GetResult(); return addedNodeInfo; } public async Task<AddedNodeInfo> GetAddedNodeInfoAync(bool detailed, EndPoint nodeEndPoint) { if (nodeEndPoint == null) throw new ArgumentNullException(nameof(nodeEndPoint)); try { var result = await SendCommandAsync(RPCOperations.getaddednodeinfo, detailed, nodeEndPoint.ToString()).ConfigureAwait(false); var e = result.Result; return e.Select(entry => new AddedNodeInfo { AddedNode = Utils.ParseEndpoint((string)entry["addednode"], 8333), Connected = (bool)entry["connected"], Addresses = entry["addresses"].Select(x => new NodeAddressInfo { Address = Utils.ParseEndpoint((string)x["address"], 8333) as IPEndPoint, Connected = (bool)x["connected"] }) }).FirstOrDefault(); } catch (RPCException ex) { if (ex.RPCCode == RPCErrorCode.RPC_CLIENT_NODE_NOT_ADDED) return null; throw; } } #endif #endregion #region Block chain and UTXO public async Task<BlockchainInfo> GetBlockchainInfoAsync() { var response = await SendCommandAsync(RPCOperations.getblockchaininfo).ConfigureAwait(false); var result = response.Result; var epochToDtateTimeOffset = new Func<long, DateTimeOffset>(epoch => { try { return Utils.UnixTimeToDateTime(epoch); } catch (OverflowException) { return DateTimeOffset.MaxValue; } }); JToken softForksToken = result["softforks"]; List<SoftFork> softForks; List<Bip9SoftFork> bip9SoftForks; try { softForks = softForksToken ?.Cast<JProperty>() ?.Select(x => new SoftFork { Bip = x.Name, ForkType = x.Value.Value<string>("type"), Activated = x.Value.Value<bool>("activated"), Height = x.Value.Value<uint>("height") }) ?.ToList(); bip9SoftForks = Enumerable.Empty<Bip9SoftFork>().ToList(); } catch (InvalidCastException) { // Then the client may be pre Biitcoin Core 19, so Ensure backwards compatibility. softForks = softForksToken ?.Cast<JObject>() ?.Select(x => new SoftFork { Bip = x.Value<string>("id") }) ?.ToList(); bip9SoftForks = result["bip9_softforks"] ?.Cast<JProperty>() ?.Select(x => new Bip9SoftFork { Name = x.Name, Status = x.Value.Value<string>("status"), StartTime = epochToDtateTimeOffset(x.Value.Value<long>("startTime")), Timeout = epochToDtateTimeOffset(x.Value.Value<long>("timeout")), SinceHeight = x.Value.Value<ulong?>("since") ?? 0 }) ?.ToList(); } var blockchainInfo = new BlockchainInfo { Chain = Network.GetNetwork(result.Value<string>("chain")), Blocks = result.Value<ulong>("blocks"), Headers = result.Value<ulong>("headers"), BestBlockHash = new uint256(result.Value<string>("bestblockhash")), // the block hash Difficulty = result.Value<ulong>("difficulty"), MedianTime = result.Value<ulong>("mediantime"), VerificationProgress = result.Value<float>("verificationprogress"), InitialBlockDownload = result.Value<bool?>("initialblockdownload") ?? false, ChainWork = new uint256(result.Value<string>("chainwork")), SizeOnDisk = result.Value<ulong?>("size_on_disk") ?? 0, Pruned = result.Value<bool>("pruned"), SoftForks = softForks, Bip9SoftForks = bip9SoftForks }; return blockchainInfo; } public BlockchainInfo GetBlockchainInfo() { return GetBlockchainInfoAsync().Result; } public uint256 GetBestBlockHash() { return uint256.Parse((string)SendCommand(RPCOperations.getbestblockhash).Result); } public async Task<uint256> GetBestBlockHashAsync() { return uint256.Parse((string)(await SendCommandAsync(RPCOperations.getbestblockhash).ConfigureAwait(false)).Result); } public BlockHeader GetBlockHeader(int height) { var hash = GetBlockHash(height); return GetBlockHeader(hash); } public BlockHeader GetBlockHeader(uint height) { var hash = GetBlockHash(height); return GetBlockHeader(hash); } public async Task<BlockHeader> GetBlockHeaderAsync(int height) { var hash = await GetBlockHashAsync(height).ConfigureAwait(false); return await GetBlockHeaderAsync(hash).ConfigureAwait(false); } public async Task<BlockHeader> GetBlockHeaderAsync(uint height) { var hash = await GetBlockHashAsync(height).ConfigureAwait(false); return await GetBlockHeaderAsync(hash).ConfigureAwait(false); } /// <summary> /// Get the a whole block /// </summary> /// <param name="blockId"></param> /// <returns></returns> public async Task<Block> GetBlockAsync(uint256 blockId) { var resp = await SendCommandAsync(RPCOperations.getblock, blockId, false).ConfigureAwait(false); return Block.Parse(resp.Result.ToString(), Network); } /// <summary> /// Get the a whole block /// </summary> /// <param name="blockId"></param> /// <returns></returns> public Block GetBlock(uint256 blockId) { return GetBlockAsync(blockId).GetAwaiter().GetResult(); } public Block GetBlock(int height) { return GetBlockAsync(height).GetAwaiter().GetResult(); } public Block GetBlock(uint height) { return GetBlockAsync(height).GetAwaiter().GetResult(); } public async Task<Block> GetBlockAsync(int height) { var hash = await GetBlockHashAsync(height).ConfigureAwait(false); return await GetBlockAsync(hash).ConfigureAwait(false); } public async Task<Block> GetBlockAsync(uint height) { var hash = await GetBlockHashAsync(height).ConfigureAwait(false); return await GetBlockAsync(hash).ConfigureAwait(false); } public BlockHeader GetBlockHeader(uint256 blockHash) { var resp = SendCommand("getblockheader", blockHash, false); return ParseBlockHeader(resp); } public async Task<BlockHeader> GetBlockHeaderAsync(uint256 blockHash) { var resp = await SendCommandAsync("getblockheader", blockHash, false).ConfigureAwait(false); return ParseBlockHeader(resp); } private BlockHeader ParseBlockHeader(RPCResponse resp) { var header = Network.Consensus.ConsensusFactory.CreateBlockHeader(); var hex = Encoders.Hex.DecodeData(resp.Result.Value<string>()); header.ReadWrite(new BitcoinStream(hex)); return header; } public uint256 GetBlockHash(int height) { var resp = SendCommand(RPCOperations.getblockhash, height); return uint256.Parse(resp.Result.ToString()); } public uint256 GetBlockHash(uint height) { var resp = SendCommand(RPCOperations.getblockhash, height); return uint256.Parse(resp.Result.ToString()); } public async Task<uint256> GetBlockHashAsync(int height) { var resp = await SendCommandAsync(RPCOperations.getblockhash, height).ConfigureAwait(false); return uint256.Parse(resp.Result.ToString()); } public async Task<uint256> GetBlockHashAsync(uint height) { var resp = await SendCommandAsync(RPCOperations.getblockhash, height).ConfigureAwait(false); return uint256.Parse(resp.Result.ToString()); } /// <summary> /// Retrieve a BIP 157 content filter for a particular block. /// </summary> /// <param name="blockHash">The hash of the block.</param> public BlockFilter GetBlockFilter(uint256 blockHash) { return GetBlockFilterAsync(blockHash).GetAwaiter().GetResult(); } /// <summary> /// Retrieve a BIP 157 content filter for a particular block. /// </summary> /// <param name="blockHash">The hash of the block.</param> public async Task<BlockFilter> GetBlockFilterAsync(uint256 blockHash) { var resp = await SendCommandAsync(RPCOperations.getblockfilter, blockHash, "basic").ConfigureAwait(false); return ParseCompactFilter(resp); } private BlockFilter ParseCompactFilter(RPCResponse resp) { var json = (JObject)resp.Result; return new BlockFilter( GolombRiceFilter.Parse(json.Value<string>("filter")), uint256.Parse(json.Value<string>("header")) ); } public int GetBlockCount() { return (int)SendCommand(RPCOperations.getblockcount).Result; } public async Task<int> GetBlockCountAsync() { return (int)(await SendCommandAsync(RPCOperations.getblockcount).ConfigureAwait(false)).Result; } public MemPoolInfo GetMemPool() { return this.GetMemPoolAsync().GetAwaiter().GetResult(); } public async Task<MemPoolInfo> GetMemPoolAsync() { var response = await SendCommandAsync(RPCOperations.getmempoolinfo); return new MemPoolInfo() { Size = Int32.Parse((string)response.Result["size"], CultureInfo.InvariantCulture), Bytes = Int32.Parse((string)response.Result["bytes"], CultureInfo.InvariantCulture), Usage = Int32.Parse((string)response.Result["usage"], CultureInfo.InvariantCulture), MaxMemPool = Double.Parse((string)response.Result["maxmempool"], CultureInfo.InvariantCulture), MemPoolMinFee = Double.Parse((string)response.Result["mempoolminfee"], CultureInfo.InvariantCulture), MinRelayTxFee = Double.Parse((string)response.Result["minrelaytxfee"], CultureInfo.InvariantCulture) }; } public uint256[] GetRawMempool() { var result = SendCommand(RPCOperations.getrawmempool); var array = (JArray)result.Result; return array.Select(o => (string)o).Select(uint256.Parse).ToArray(); } public async Task<uint256[]> GetRawMempoolAsync() { var result = await SendCommandAsync(RPCOperations.getrawmempool).ConfigureAwait(false); var array = (JArray)result.Result; return array.Select(o => (string)o).Select(uint256.Parse).ToArray(); } public MempoolEntry GetMempoolEntry(uint256 txid, bool throwIfNotFound = true) { return GetMempoolEntryAsync(txid, throwIfNotFound).GetAwaiter().GetResult(); } public async Task<MempoolEntry> GetMempoolEntryAsync(uint256 txid, bool throwIfNotFound = true) { var response = await SendCommandAsync(RPCOperations.getmempoolentry, txid).ConfigureAwait(false); if (throwIfNotFound) response.ThrowIfError(); if (response.Error != null && response.Error.Code == RPCErrorCode.RPC_INVALID_ADDRESS_OR_KEY) return null; var jobj = (JObject)response.Result; return new MempoolEntry { TransactionId = txid, VirtualSizeBytes = (jobj["size"] ?? jobj["vsize"]).Value<int>(), Time = Utils.UnixTimeToDateTime(jobj["time"].Value<long>()), Height = jobj["height"].Value<int>(), DescendantCount = jobj["descendantcount"].Value<int>(), DescendantVirtualSizeBytes = jobj["descendantsize"].Value<int>(), AncestorCount = jobj["ancestorcount"].Value<int>(), AncestorVirtualSizeBytes = jobj["ancestorsize"].Value<int>(), TransactionIdWithWitness = uint256.Parse((string)jobj["wtxid"]), BaseFee = new Money(jobj["fees"]["base"].Value<decimal>(), MoneyUnit.BTC), ModifiedFee = new Money(jobj["fees"]["modified"].Value<decimal>(), MoneyUnit.BTC), DescendantFees = new Money(jobj["fees"]["descendant"].Value<decimal>(), MoneyUnit.BTC), AncestorFees = new Money(jobj["fees"]["ancestor"].Value<decimal>(), MoneyUnit.BTC), Depends = jobj["depends"]?.Select(x => uint256.Parse((string)x)).ToArray(), SpentBy = jobj["spentby"]?.Select(x => uint256.Parse((string)x)).ToArray() }; } private FeeRate AbsurdlyHighFee { get; } = new FeeRate(10_000L); public MempoolAcceptResult TestMempoolAccept(Transaction transaction, bool allowHighFees = false) { return TestMempoolAcceptAsync(transaction, allowHighFees).GetAwaiter().GetResult(); } public async Task<MempoolAcceptResult> TestMempoolAcceptAsync(Transaction transaction, bool allowHighFees = false) { var maxFeeRate = allowHighFees ? AbsurdlyHighFee : null; return await TestMempoolAcceptAsync(transaction, maxFeeRate).ConfigureAwait(false); } public MempoolAcceptResult TestMempoolAccept(Transaction transaction, FeeRate maxFeeRate) { return TestMempoolAcceptAsync(transaction, maxFeeRate).GetAwaiter().GetResult(); } public MempoolAcceptResult TestMempoolAccept(Transaction transaction) { return TestMempoolAcceptAsync(transaction, null as FeeRate).GetAwaiter().GetResult(); } public Task<MempoolAcceptResult> TestMempoolAcceptAsync(Transaction transaction) { return TestMempoolAcceptAsync(transaction, null as FeeRate); } public async Task<MempoolAcceptResult> TestMempoolAcceptAsync(Transaction transaction, FeeRate maxFeeRate = null) { RPCResponse response; if (maxFeeRate is FeeRate feeRate) { try { var feeRateDecimal = feeRate.FeePerK.ToDecimal(MoneyUnit.Satoshi); response = await SendCommandAsync(RPCOperations.testmempoolaccept, new[] { transaction.ToHex() }, feeRateDecimal).ConfigureAwait(false); } catch (RPCException ex) when (ex.Message == "Expected type bool, got number") { var allowHighFees = feeRate >= AbsurdlyHighFee ? true : false; response = await SendCommandAsync(RPCOperations.testmempoolaccept, new[] { transaction.ToHex() }, allowHighFees).ConfigureAwait(false); } } else { response = await SendCommandAsync(RPCOperations.testmempoolaccept, new[] { new[] { transaction.ToHex() } }).ConfigureAwait(false); } var first = response.Result[0]; var allowed = first["allowed"].Value<bool>(); RejectCode rejectedCode = RejectCode.INVALID; var rejectedReason = string.Empty; if (!allowed) { var rejected = first["reject-reason"].Value<string>(); var separatorIdx = rejected.IndexOf(':'); if (separatorIdx != -1) { rejectedCode = (RejectCode)int.Parse(rejected.Substring(0, separatorIdx)); rejectedReason = rejected.Substring(separatorIdx + 2); } else { rejectedReason = rejected; } } return new MempoolAcceptResult { TxId = uint256.Parse(first["txid"].Value<string>()), IsAllowed = allowed, RejectCode = rejectedCode, RejectReason = rejectedReason }; } /// <summary> /// Returns details about an unspent transaction output. /// </summary> /// <param name="txid">The transaction id</param> /// <param name="index">vout number</param> /// <param name="includeMempool">Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear.</param> /// <returns>null if spent or never existed</returns> public GetTxOutResponse GetTxOut(uint256 txid, int index, bool includeMempool = true) { return GetTxOutAsync(txid, index, includeMempool).GetAwaiter().GetResult(); } /// <summary> /// Returns details about an unspent transaction output. /// </summary> /// <param name="txid">The transaction id</param> /// <param name="index">vout number</param> /// <param name="includeMempool">Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear.</param> /// <returns>null if spent or never existed</returns> public async Task<GetTxOutResponse> GetTxOutAsync(uint256 txid, int index, bool includeMempool = true) { var response = await SendCommandAsync(RPCOperations.gettxout, txid, index, includeMempool).ConfigureAwait(false); if (string.IsNullOrWhiteSpace(response?.ResultString)) { return null; } var result = response.Result; var value = result.Value<decimal>("value"); // The transaction value in BTC var txOut = new TxOut(Money.Coins(value), new Script(result["scriptPubKey"].Value<string>("asm"))); return new GetTxOutResponse { BestBlock = new uint256(result.Value<string>("bestblock")), // the block hash Confirmations = result.Value<int>("confirmations"), // The number of confirmations IsCoinBase = result.Value<bool>("coinbase"), // Coinbase or not ScriptPubKeyType = result["scriptPubKey"].Value<string>("type"), // The type, eg pubkeyhash TxOut = txOut }; } /// <summary> /// Returns statistics about the unspent transaction output (UTXO) set /// </summary> /// <returns>Parsed object containing all info</returns> public GetTxOutSetInfoResponse GetTxoutSetInfo() { return GetTxoutSetInfoAsync().GetAwaiter().GetResult(); } public async Task<GetTxOutSetInfoResponse> GetTxoutSetInfoAsync() { var response = await SendCommandAsync(RPCOperations.gettxoutsetinfo).ConfigureAwait(false); var result = response.Result; return new GetTxOutSetInfoResponse { Height = result.Value<int>("height"), Bestblock = uint256.Parse(result.Value<string>("bestblock")), Transactions = result.Value<int>("transactions"), Txouts = result.Value<long>("txouts"), Bogosize = result.Value<long>("bogosize"), HashSerialized2 = result.Value<string>("hash_serialized_2"), DiskSize = result.Value<long>("disk_size"), TotalAmount = Money.FromUnit(result.Value<decimal>("total_amount"), MoneyUnit.BTC) }; } /// <summary> /// GetTransactions only returns on txn which are not entirely spent unless you run bitcoinq with txindex=1. /// </summary> /// <param name="blockHash"></param> /// <returns></returns> public IEnumerable<Transaction> GetTransactions(uint256 blockHash) { if (blockHash == null) throw new ArgumentNullException(nameof(blockHash)); var resp = SendCommand(RPCOperations.getblock, blockHash); var tx = resp.Result["tx"] as JArray; if (tx != null) { foreach (var item in tx) { var result = GetRawTransaction(uint256.Parse(item.ToString()), false); if (result != null) yield return result; } } } public IEnumerable<Transaction> GetTransactions(int height) { return GetTransactions(GetBlockHash(height)); } #endregion #region Coin generation #endregion #region Raw Transaction public Transaction DecodeRawTransaction(string rawHex) { return ParseTxHex(rawHex); } public Transaction DecodeRawTransaction(byte[] raw) { return DecodeRawTransaction(Encoders.Hex.EncodeData(raw)); } public Task<Transaction> DecodeRawTransactionAsync(string rawHex) { return Task.FromResult(ParseTxHex(rawHex)); } public Task<Transaction> DecodeRawTransactionAsync(byte[] raw) { return DecodeRawTransactionAsync(Encoders.Hex.EncodeData(raw)); } /// <summary> /// getrawtransaction only returns on txn which are not entirely spent unless you run bitcoinq with txindex=1. /// </summary> /// <param name="txid"></param> /// <returns></returns> public Transaction GetRawTransaction(uint256 txid, bool throwIfNotFound = true) { return GetRawTransactionAsync(txid, throwIfNotFound).GetAwaiter().GetResult(); } public Task<Transaction> GetRawTransactionAsync(uint256 txid, bool throwIfNotFound = true) { return GetRawTransactionAsync(txid, null, throwIfNotFound); } public Transaction GetRawTransaction(uint256 txid, uint256 blockId, bool throwIfNotFound = true) { return GetRawTransactionAsync(txid, blockId, throwIfNotFound).GetAwaiter().GetResult(); } public async Task<Transaction> GetRawTransactionAsync(uint256 txid, uint256 blockId, bool throwIfNotFound = true) { List<object> args = new List<object>(3); args.Add(txid); args.Add(0); if (blockId != null) args.Add(blockId); var response = await SendCommandAsync(new RPCRequest(RPCOperations.getrawtransaction, args.ToArray()), throwIfNotFound).ConfigureAwait(false); if (throwIfNotFound) response.ThrowIfError(); if (response.Error != null && response.Error.Code == RPCErrorCode.RPC_INVALID_ADDRESS_OR_KEY) return null; response.ThrowIfError(); var tx = Network.Consensus.ConsensusFactory.CreateTransaction(); tx.ReadWrite(Encoders.Hex.DecodeData(response.Result.ToString()), Network); return tx; } public RawTransactionInfo GetRawTransactionInfo(uint256 txid) { return GetRawTransactionInfoAsync(txid).GetAwaiter().GetResult(); } private Transaction ParseTxHex(string hex) { var tx = Network.Consensus.ConsensusFactory.CreateTransaction(); tx.ReadWrite(Encoders.Hex.DecodeData(hex), Network); return tx; } public async Task<RawTransactionInfo> GetRawTransactionInfoAsync(uint256 txId) { var request = new RPCRequest(RPCOperations.getrawtransaction, new object[] { txId, true }); var response = await SendCommandAsync(request); var json = response.Result; return new RawTransactionInfo { Transaction = ParseTxHex(json.Value<string>("hex")), TransactionId = uint256.Parse(json.Value<string>("txid")), TransactionTime = json["time"] != null ? NBitcoin.Utils.UnixTimeToDateTime(json.Value<long>("time")) : (DateTimeOffset?)null, Hash = json["hash"] is JToken token ? uint256.Parse(token.Value<string>()) : null, Size = json.Value<uint>("size"), VirtualSize = json.Value<uint>("vsize"), Version = json.Value<uint>("version"), LockTime = new LockTime(json.Value<uint>("locktime")), BlockHash = json["blockhash"] != null ? uint256.Parse(json.Value<string>("blockhash")) : null, Confirmations = json.Value<uint>("confirmations"), BlockTime = json["blocktime"] != null ? NBitcoin.Utils.UnixTimeToDateTime(json.Value<long>("blocktime")) : (DateTimeOffset?)null }; } public uint256 SendRawTransaction(Transaction tx) { return SendRawTransaction(tx.ToBytes()); } public uint256 SendRawTransaction(byte[] bytes) { return SendRawTransactionAsync(bytes).GetAwaiter().GetResult(); } public Task<uint256> SendRawTransactionAsync(Transaction tx) { return SendRawTransactionAsync(tx.ToBytes()); } public async Task<uint256> SendRawTransactionAsync(byte[] bytes) { var result = await SendCommandAsync(RPCOperations.sendrawtransaction, Encoders.Hex.EncodeData(bytes)).ConfigureAwait(false); result.ThrowIfError(); if (result.Result.Type != JTokenType.String) return null; return new uint256(result.Result.Value<string>()); } public BumpResponse BumpFee(uint256 txid) { return BumpFeeAsync(txid).GetAwaiter().GetResult(); } public async Task<BumpResponse> BumpFeeAsync(uint256 txid) { var response = await SendCommandAsync(RPCOperations.bumpfee, txid); var o = response.Result; return new BumpResponse { TransactionId = uint256.Parse((string)o["txid"]), OriginalFee = (ulong)o["origfee"], Fee = (ulong)o["fee"], Errors = o["errors"].Select(x => (string)x).ToList() }; } #endregion #region Utility functions // Estimates the approximate fee per kilobyte needed for a transaction to begin // confirmation within conf_target blocks if possible and return the number of blocks // for which the estimate is valid.Uses virtual transaction size as defined // in BIP 141 (witness data is discounted). #region Fee Estimation /// <summary> /// (>= Bitcoin Core v0.14) Get the estimated fee per kb for being confirmed in nblock /// If Capabilities is set and estimatesmartfee is not supported, will fallback on estimatefee /// </summary> /// <param name="confirmationTarget">Confirmation target in blocks (1 - 1008)</param> /// <param name="estimateMode">Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market.</param> /// <returns>The estimated fee rate, block number where estimate was found</returns> /// <exception cref="NoEstimationException">The Fee rate couldn't be estimated because of insufficient data from Bitcoin Core</exception> public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) { return EstimateSmartFeeAsync(confirmationTarget, estimateMode).GetAwaiter().GetResult(); } /// <summary> /// (>= Bitcoin Core v0.14) Tries to get the estimated fee per kb for being confirmed in nblock /// If Capabilities is set and estimatesmartfee is not supported, will fallback on estimatefee /// </summary> /// <param name="confirmationTarget">Confirmation target in blocks (1 - 1008)</param> /// <param name="estimateMode">Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market.</param> /// <returns>The estimated fee rate, block number where estimate was found or null</returns> public async Task<EstimateSmartFeeResponse> TryEstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) { return await EstimateSmartFeeImplAsync(confirmationTarget, estimateMode).ConfigureAwait(false); } /// <summary> /// (>= Bitcoin Core v0.14) Tries to get the estimated fee per kb for being confirmed in nblock /// If Capabilities is set and estimatesmartfee is not supported, will fallback on estimatefee /// </summary> /// <param name="confirmationTarget">Confirmation target in blocks (1 - 1008)</param> /// <param name="estimateMode">Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market.</param> /// <returns>The estimated fee rate, block number where estimate was found or null</returns> public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) { return TryEstimateSmartFeeAsync(confirmationTarget, estimateMode).GetAwaiter().GetResult(); } /// <summary> /// (>= Bitcoin Core v0.14) Get the estimated fee per kb for being confirmed in nblock /// If Capabilities is set and estimatesmartfee is not supported, will fallback on estimatefee /// </summary> /// <param name="confirmationTarget">Confirmation target in blocks (1 - 1008)</param> /// <param name="estimateMode">Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market.</param> /// <returns>The estimated fee rate, block number where estimate was found</returns> /// <exception cref="NoEstimationException">when fee couldn't be estimated</exception> public async Task<EstimateSmartFeeResponse> EstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) { var feeRate = await EstimateSmartFeeImplAsync(confirmationTarget, estimateMode); if (feeRate == null) throw new NoEstimationException(confirmationTarget); return feeRate; } /// <summary> /// (>= Bitcoin Core v0.14) /// </summary> private async Task<EstimateSmartFeeResponse> EstimateSmartFeeImplAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) { if (Capabilities == null || Capabilities.SupportEstimateSmartFee) { var request = new RPCRequest(RPCOperations.estimatesmartfee.ToString(), new object[] { confirmationTarget, estimateMode.ToString().ToUpperInvariant() }); var response = await SendCommandAsync(request, throwIfRPCError: false).ConfigureAwait(false); if (response?.Error != null) { return null; } var resultJToken = response.Result; var feeRateDecimal = resultJToken.Value<decimal>("feerate"); // estimate fee-per-kilobyte (in BTC) var blocks = resultJToken.Value<int>("blocks"); // block number where estimate was found var money = Money.Coins(feeRateDecimal); if (money.Satoshi <= 0) { return null; } return new EstimateSmartFeeResponse { FeeRate = new FeeRate(money), Blocks = blocks }; } else { // BCH removed estimatesmartfee and removed arguments to estimatefee so special case for them... if (Network.NetworkSet.CryptoCode == "BCH") { var response = await SendCommandAsync(RPCOperations.estimatefee).ConfigureAwait(false); var result = response.Result.Value<decimal>(); var money = Money.Coins(result); if (money.Satoshi < 0) return null; return new EstimateSmartFeeResponse() { FeeRate = new FeeRate(money), Blocks = confirmationTarget }; } else { RPCResponse response = await SendCommandAsync(new RPCRequest(RPCOperations.estimatefee, new object[] { confirmationTarget }), false).ConfigureAwait(false); if (response.Error != null) { if (response.Error.Code is RPCErrorCode.RPC_MISC_ERROR) { // Some shitcoins do not require a parameter to estimatefee anymore response = await SendCommandAsync(RPCOperations.estimatefee).ConfigureAwait(false); } else { response.ThrowIfError(); } } var result = response.Result.Value<decimal>(); var money = Money.Coins(result); if (money.Satoshi < 0) return null; return new EstimateSmartFeeResponse() { FeeRate = new FeeRate(money), Blocks = confirmationTarget }; } } } #endregion /// <summary> /// Requires wallet support. Requires an unlocked wallet or an unencrypted wallet. /// </summary> /// <param name="address">A P2PKH or P2SH address to which the bitcoins should be sent</param> /// <param name="amount">The amount to spend</param> /// <param name="commentTx">A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment</param> /// <param name="commentDest">A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment</param> /// <param name="subtractFeeFromAmount">The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. </param> /// <param name="replaceable">Allow this transaction to be replaced by a transaction with higher fees. </param> /// <returns>The TXID of the sent transaction</returns> public uint256 SendToAddress( BitcoinAddress address, Money amount, string commentTx = null, string commentDest = null, bool subtractFeeFromAmount = false, bool replaceable = false ) { uint256 txid = null; txid = SendToAddressAsync(address, amount, commentTx, commentDest, subtractFeeFromAmount, replaceable).GetAwaiter().GetResult(); return txid; } /// <summary> /// Requires wallet support. Requires an unlocked wallet or an unencrypted wallet. /// </summary> /// <param name="scriptPubKey">The destination where coins should be sent</param> /// <param name="amount">The amount to spend</param> /// <param name="commentTx">A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment</param> /// <param name="commentDest">A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment</param> /// <param name="subtractFeeFromAmount">The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. </param> /// <param name="replaceable">Allow this transaction to be replaced by a transaction with higher fees. </param> /// <returns>The TXID of the sent transaction</returns> public uint256 SendToAddress( Script scriptPubKey, Money amount, string commentTx = null, string commentDest = null, bool subtractFeeFromAmount = false, bool replaceable = false ) { return SendToAddressAsync(scriptPubKey, amount, commentTx, commentDest, subtractFeeFromAmount, replaceable).GetAwaiter().GetResult(); } /// <summary> /// Requires wallet support. Requires an unlocked wallet or an unencrypted wallet. /// </summary> /// <param name="scriptPubKey">The destination where coins should be sent</param> /// <param name="amount">The amount to spend</param> /// <param name="commentTx">A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment</param> /// <param name="commentDest">A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment</param> /// <param name="subtractFeeFromAmount">The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. </param> /// <param name="replaceable">Allow this transaction to be replaced by a transaction with higher fees. </param> /// <returns>The TXID of the sent transaction</returns> public Task<uint256> SendToAddressAsync( Script scriptPubKey, Money amount, string commentTx = null, string commentDest = null, bool subtractFeeFromAmount = false, bool replaceable = false ) { if (scriptPubKey == null) throw new ArgumentNullException(nameof(scriptPubKey)); return SendToAddressAsync(scriptPubKey.GetDestinationAddress(Network), amount, commentTx, commentDest, subtractFeeFromAmount, replaceable); } /// <summary> /// Requires wallet support. Requires an unlocked wallet or an unencrypted wallet. /// </summary> /// <param name="address">A P2PKH or P2SH address to which the bitcoins should be sent</param> /// <param name="amount">The amount to spend</param> /// <param name="commentTx">A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment</param> /// <param name="commentDest">A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment</param> /// <param name="subtractFeeFromAmount">The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. </param> /// <param name="replaceable">Allow this transaction to be replaced by a transaction with higher fees. </param> /// <returns>The TXID of the sent transaction</returns> public async Task<uint256> SendToAddressAsync( BitcoinAddress address, Money amount, string commentTx = null, string commentDest = null, bool subtractFeeFromAmount = false, bool replaceable = false ) { if (address == null) throw new ArgumentNullException(nameof(address)); if (amount == null) throw new ArgumentNullException(nameof(amount)); List<object> parameters = new List<object>(); parameters.Add(address.ToString()); parameters.Add(amount.ToString()); parameters.Add($"{commentTx}"); parameters.Add($"{commentDest}"); if (subtractFeeFromAmount || replaceable) { parameters.Add(subtractFeeFromAmount); if (replaceable) parameters.Add(replaceable); } var resp = await SendCommandAsync(RPCOperations.sendtoaddress, parameters.ToArray()).ConfigureAwait(false); return uint256.Parse(resp.Result.ToString()); } public bool SetTxFee(FeeRate feeRate) { return SendCommand(RPCOperations.settxfee, new[] { feeRate.FeePerK.ToString() }).Result.ToString() == "true"; } #endregion public async Task<uint256[]> GenerateAsync(int nBlocks) { if (nBlocks < 0) throw new ArgumentOutOfRangeException("nBlocks"); if (Capabilities != null && Capabilities.SupportGenerateToAddress) { var address = await GetNewAddressAsync(); return await GenerateToAddressAsync(nBlocks, address); } else { try { var result = (JArray)(await SendCommandAsync(RPCOperations.generate, nBlocks).ConfigureAwait(false)).Result; return result.Select(r => new uint256(r.Value<string>())).ToArray(); } catch (RPCException rpc) when (rpc.RPCCode == RPCErrorCode.RPC_METHOD_DEPRECATED || rpc.RPCCode == RPCErrorCode.RPC_METHOD_NOT_FOUND) { var address = await GetNewAddressAsync(); return await GenerateToAddressAsync(nBlocks, address); } } } public uint256[] Generate(int nBlocks) { return GenerateAsync(nBlocks).GetAwaiter().GetResult(); } public async Task<uint256[]> GenerateToAddressAsync(int nBlocks, BitcoinAddress address) { if (nBlocks < 0) throw new ArgumentOutOfRangeException(nameof(nBlocks)); if (address == null) throw new ArgumentNullException(nameof(address)); var result = (JArray)(await SendCommandAsync(RPCOperations.generatetoaddress, nBlocks, address.ToString()).ConfigureAwait(false)).Result; return result.Select(r => new uint256(r.Value<string>())).ToArray(); } public uint256[] GenerateToAddress(int nBlocks, BitcoinAddress address) { return GenerateToAddressAsync(nBlocks, address).GetAwaiter().GetResult(); } #region Region Hidden Methods /// <summary> /// Permanently marks a block as invalid, as if it violated a consensus rule. /// </summary> /// <param name="blockhash">the hash of the block to mark as invalid</param> public void InvalidateBlock(uint256 blockhash) { SendCommand(RPCOperations.invalidateblock, blockhash); } /// <summary> /// Permanently marks a block as invalid, as if it violated a consensus rule. /// </summary> /// <param name="blockhash">the hash of the block to mark as invalid</param> public async Task InvalidateBlockAsync(uint256 blockhash) { await SendCommandAsync(RPCOperations.invalidateblock, blockhash).ConfigureAwait(false); } /// <summary> /// Marks a transaction and all its in-wallet descendants as abandoned which will allow /// for their inputs to be respent. /// </summary> /// <param name="txId">the transaction id to be marked as abandoned.</param> public void AbandonTransaction(uint256 txId) { SendCommand(RPCOperations.abandontransaction, txId.ToString()); } /// <summary> /// Marks a transaction and all its in-wallet descendants as abandoned which will allow /// for their inputs to be respent. /// </summary> /// <param name="txId">the transaction id to be marked as abandoned.</param> public async Task AbandonTransactionAsync(uint256 txId) { await SendCommandAsync(RPCOperations.abandontransaction, txId.ToString()).ConfigureAwait(false); } #endregion } #if !NOSOCKET public class PeerInfo { public int Id { get; internal set; } public IPEndPoint Address { get; internal set; } public string AddressString { get; set; } public IPEndPoint LocalAddress { get; internal set; } public string LocalAddressString { get; set; } public NodeServices Services { get; internal set; } public DateTimeOffset LastSend { get; internal set; } public DateTimeOffset LastReceive { get; internal set; } public long BytesSent { get; internal set; } public long BytesReceived { get; internal set; } public DateTimeOffset ConnectionTime { get; internal set; } public TimeSpan? PingTime { get; internal set; } public int Version { get; internal set; } public string SubVersion { get; internal set; } public bool Inbound { get; internal set; } public int StartingHeight { get; internal set; } public int BanScore { get; internal set; } public int SynchronizedHeaders { get; internal set; } public int SynchronizedBlocks { get; internal set; } public uint[] Inflight { get; internal set; } public bool IsWhiteListed { get; internal set; } public TimeSpan PingWait { get; internal set; } public int Blocks { get; internal set; } public TimeSpan TimeOffset { get; internal set; } } public class AddedNodeInfo { public EndPoint AddedNode { get; internal set; } public bool Connected { get; internal set; } public IEnumerable<NodeAddressInfo> Addresses { get; internal set; } } public class NodeAddressInfo { public IPEndPoint Address { get; internal set; } public bool Connected { get; internal set; } } #endif public class BlockchainInfo { public class SoftFork { public string Bip { get; set; } public string ForkType { get; set; } public bool Activated { get; set; } public uint Height { get; set; } } public class Bip9SoftFork { public string Name { get; set; } public string Status { get; set; } public DateTimeOffset StartTime { get; set; } public DateTimeOffset Timeout { get; set; } public ulong SinceHeight { get; set; } } public Network Chain { get; set; } public ulong Blocks { get; set; } public ulong Headers { get; set; } public uint256 BestBlockHash { get; set; } public ulong Difficulty { get; set; } public ulong MedianTime { get; set; } public float VerificationProgress { get; set; } public bool InitialBlockDownload { get; set; } public uint256 ChainWork { get; set; } public ulong SizeOnDisk { get; set; } public bool Pruned { get; set; } public List<SoftFork> SoftForks { get; set; } public List<Bip9SoftFork> Bip9SoftForks { get; set; } } public class RawTransactionInfo { public Transaction Transaction { get; internal set; } public uint256 TransactionId { get; internal set; } public uint256 Hash { get; internal set; } public uint Size { get; internal set; } public uint VirtualSize { get; internal set; } public uint Version { get; internal set; } public LockTime LockTime { get; internal set; } public uint256 BlockHash { get; internal set; } public uint Confirmations { get; internal set; } public DateTimeOffset? TransactionTime { get; internal set; } public DateTimeOffset? BlockTime { get; internal set; } } public class BumpResponse { public uint256 TransactionId { get; set; } public ulong OriginalFee { get; set; } public ulong Fee { get; set; } public List<string> Errors { get; set; } } public class NoEstimationException : Exception { public NoEstimationException(int nblock) : base("The FeeRate couldn't be estimated because of insufficient data from Bitcoin Core. Try to use smaller nBlock, or wait Bitcoin Core to gather more data.") { } } public class MempoolEntry { /// <summary> /// The transaction id (must be in mempool.) /// </summary> public uint256 TransactionId { get; set; } /// <summary> /// Virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. /// </summary> public int VirtualSizeBytes { get; set; } /// <summary> /// Local time transaction entered pool in seconds since 1 Jan 1970 GMT. /// </summary> public DateTimeOffset Time { get; set; } /// <summary> /// Block height when transaction entered pool. /// </summary> public int Height { get; set; } /// <summary> /// Number of in-mempool descendant transactions (including this one.) /// </summary> public int DescendantCount { get; set; } /// <summary> /// Virtual transaction size of in-mempool descendants (including this one.) /// </summary> public int DescendantVirtualSizeBytes { get; set; } /// <summary> /// Number of in-mempool ancestor transactions (including this one.) /// </summary> public int AncestorCount { get; set; } /// <summary> /// Virtual transaction size of in-mempool ancestors (including this one.) /// </summary> public int AncestorVirtualSizeBytes { get; set; } /// <summary> /// Hash of serialized transaction, including witness data. /// </summary> public uint256 TransactionIdWithWitness { get; set; } /// <summary> /// Transaction fee. /// </summary> public Money BaseFee { get; set; } /// <summary> /// Transaction fee with fee deltas used for mining priority. /// </summary> public Money ModifiedFee { get; set; } /// <summary> /// Modified fees (see above) of in-mempool ancestors (including this one.) /// </summary> public Money AncestorFees { get; set; } /// <summary> /// Modified fees (see above) of in-mempool descendants (including this one.) /// </summary> public Money DescendantFees { get; set; } /// <summary> /// Unconfirmed transactions used as inputs for this transaction. /// </summary> public uint256[] Depends { get; set; } /// <summary> /// Unconfirmed transactions spending outputs from this transaction. /// </summary> public uint256[] SpentBy { get; set; } } public class MempoolAcceptResult { public uint256 TxId { get; internal set; } public bool IsAllowed { get; internal set; } public RejectCode RejectCode { get; internal set; } public string RejectReason { get; internal set; } } public class BlockFilter { public GolombRiceFilter Filter { get; } public uint256 Header { get; } public BlockFilter(GolombRiceFilter filter, uint256 header) { Filter = filter; Header = header; } } } #endif
34.343493
323
0.686482
[ "MIT" ]
JoaoCampos89/NBitcoin
NBitcoin/RPC/RPCClient.cs
83,388
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("CaptiveAire.NModbus.Serial.UWP")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CaptiveAire.NModbus.Serial.UWP")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 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")] [assembly: ComVisible(false)]
38.103448
85
0.725792
[ "MIT" ]
Alezy80/NModbus
CaptiveAire.NModbus.Serial.UWP/Properties/AssemblyInfo.cs
1,108
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WinFormAlunos { public partial class TelaLista : Form { public TelaLista() { InitializeComponent(); } private void ListView1_SelectedIndexChanged(object sender, EventArgs e) { } } }
18.538462
79
0.676349
[ "MIT" ]
asrieltiago/GitCsharp
GITCLASS/Windows Forms/WinFormAlunos/WinFormAlunos/TelaLista.cs
484
C#
// -------------------------------------------------------- // Copyright: Toni Kalajainen // Date: 29.10.2019 // Url: http://lexical.fi // -------------------------------------------------------- using System; using System.IO; namespace Lexical.FileSystem.Utility { /// <summary> /// Memory pool that can lease memory. /// /// See subinterfaces: /// <list type="bullet"> /// <item><see cref="IMemoryPool{T}"/></item> /// <item><see cref="IMemoryPoolArray"/></item> /// <item><see cref="IMemoryPoolBlock"/></item> /// </list> /// </summary> public interface IMemoryPool { /// <summary>Total amount of bytes available and allocated.</summary> long TotalLength { get; } /// <summary>Bytes allocated to leasers</summary> long Allocated { get; } /// <summary>Available for allocation</summary> long Available { get; } /// <summary>Policy whether return memory is cleared.</summary> bool ClearsRecycledBlocks { get; set; } /// <summary><see cref="IMemory"/> subtypes that are supported by this pool.</summary> Type[] MemoryTypes { get; } } /// <summary> /// Memory pool that can lease memory as <typeparamref name="T"/>. /// </summary> /// <typeparam name="T"></typeparam> public interface IMemoryPool<T> : IMemoryPool where T : IMemory { /// <summary> /// Try to allocate memory, if not enough memory is available, then returns false and null. /// </summary> /// <param name="length"></param> /// <param name="memory"></param> /// <returns>true if <paramref name="memory"/> was placed with block, false if there were not free space</returns> /// <exception cref="IOException"></exception> bool TryAllocate(long length, out T memory); /// <summary> /// Allocate memory. If not enough memory is available, then waits until there is. /// </summary> /// <returns>block</returns> /// <exception cref="IOException"></exception> T Allocate(long length); } /// <summary> /// Memory pool that can lease byte arrays. /// </summary> public interface IMemoryPoolArray : IMemoryPool<IMemoryArray> { } /// <summary> /// Memory pool that can lease blocks. /// </summary> public interface IMemoryPoolBlock : IMemoryPool<IMemoryBlock> { } /// <summary> /// Abstract memory block. Dispose to return to pool. /// </summary> public interface IMemory : IDisposable { /// <summary>Leasing pool.</summary> IMemoryPool Pool { get; } /// <summary>Block length</summary> long Length { get; } } /// <summary> /// Leased memory block that can be written and read. Dispose to return to pool. /// </summary> public interface IMemoryBlock : IMemory { /// <summary> /// Read from block. /// </summary> /// <param name="offset"></param> /// <param name="length"></param> /// <param name="buffer"></param> /// <exception cref="IOException"></exception> /// <exception cref="ArgumentOutOfRangeException"></exception> /// <exception cref="ArgumentException">The sum of offset and count is larger than the buffer length.</exception> /// <exception cref="ObjectDisposedException">object has been returned to the leaser</exception> void Read(long offset, int length, byte[] buffer); /// <summary> /// Write to block. /// </summary> /// <param name="offset"></param> /// <param name="length"></param> /// <param name="buffer"></param> /// <exception cref="IOException"></exception> /// <exception cref="ArgumentOutOfRangeException"></exception> /// <exception cref="ArgumentException">The sum of offset and count is larger than the buffer length.</exception> /// <exception cref="ObjectDisposedException">object has been returned to the leaser</exception> void Write(long offset, int length, byte[] buffer); } /// <summary> /// Leased memory array. Dispose to return to pool. /// </summary> public interface IMemoryArray : IMemory { /// <summary>Reference to array.</summary> byte[] Array { get; } } /// <summary> /// Memory pool extensions /// </summary> public static class IMemoryPoolExtensions { /// <summary> /// Try to allocate memory, if not enough memory is available, then returns false and null. /// </summary> /// <param name="memoryPool"></param> /// <param name="length"></param> /// <param name="memory"></param> /// <returns>true if <paramref name="memory"/> was placed with block, false if there were not free space</returns> /// <exception cref="IOException"></exception> /// <exception cref="NotSupportedException">if <typeparamref name="T"/> is not supported.</exception> public static bool TryAllocate<T>(this IMemoryPool memoryPool, long length, out T memory) where T : IMemory { if (memoryPool is IMemoryPool<T> t_pool) return t_pool.TryAllocate(length, out memory); memory = default; return false; } /// <summary> /// Allocate memory. If not enough memory is available, then waits until there is. /// </summary> /// <param name="memoryPool"></param> /// <param name="length"></param> /// <returns>block</returns> /// <exception cref="IOException"></exception> /// <exception cref="NotSupportedException">if <typeparamref name="T"/> is not supported.</exception> public static T Allocate<T>(this IMemoryPool memoryPool, long length) where T : IMemory => memoryPool is IMemoryPool<T> t_pool ? t_pool.Allocate<T>(length) : throw new NotSupportedException(nameof(T)); } }
38.566879
125
0.58365
[ "Apache-2.0" ]
tagcode/Lexical.FileSystem
Lexical.FileSystem.Abstractions/Utility/IMemoryPool.cs
6,057
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("BbNut")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BbNut")] [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("8724f11b-6f86-4299-bb03-5cbad1e77ba2")] // 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.378378
84
0.742589
[ "MIT" ]
donghoon/ifctoolkit
BlackBox/Predefined/BbNut/Properties/AssemblyInfo.cs
1,386
C#
using System; using System.Threading.Tasks; using Meziantou.Framework; using Meziantou.Moneiz.Extensions; using Microsoft.JSInterop; namespace Meziantou.Moneiz.Services { public sealed class SettingsProvider { private readonly IJSRuntime _jsRuntime; public SettingsProvider(IJSRuntime jsRuntime) { _jsRuntime = jsRuntime; } private ValueTask<T> GetValue<T>(string key) { return _jsRuntime.GetValue<T>("settings:" + key); } private ValueTask SetValue<T>(string key, T value) { return _jsRuntime.SetValue("settings:" + key, value); } public ValueTask<bool?> GetShowReconciliatedTransactions(int accountId) { return GetValue<bool?>("account:" + accountId.ToStringInvariant() + ":ShowReconciled"); } public ValueTask SetShowReconciliatedTransactions(int accountId, bool value) { return SetValue("account:" + accountId.ToStringInvariant() + ":ShowReconciled", value); } public async ValueTask<MoneizDisplaySettings> GetDisplaySettings() { var result = await GetValue<MoneizDisplaySettings>("displaySettings"); result ??= new MoneizDisplaySettings(); result.PageSize = Math.Clamp(result.PageSize, 10, int.MaxValue); return result; } public ValueTask SetDisplaySettings(MoneizDisplaySettings value) { return SetValue("displaySettings", value); } } }
30.038462
99
0.631882
[ "MIT" ]
meziantou/meziantou.moneiz
src/Meziantou.Moneiz/Services/SettingsProvider.cs
1,564
C#
using System; using System.Reflection; using ReflectionLibrary.Interfaces; namespace ReflectionLibrary.Models { /// <summary> /// Provides access to methods that require the underlying reflected property to be defined. /// </summary> public class ReflectedPropertyOperations : IReflectedPropertyOperations { /// <summary> /// /// </summary> public PropertyInfo PropertyInfo { get; set; } /// <summary> /// Func value , item //return propertyInfo.GetValue(item); /// </summary> public Func<dynamic, dynamic> GetValueFunction { get; set; } public dynamic GetValue(dynamic item) { if (item == null) throw new Exception("GetPropertyInfoValueFunction should not be called with a null item passed into it."); return GetValueFunction(item); } /// <summary> /// propertyInfo.SetValue(item, value); /// </summary> public Action<dynamic, dynamic> SetValueAction { get; set; } public void SetPropertyInfoValueFunction(dynamic item, dynamic value) { SetValueAction(item, value); } } }
31.526316
122
0.611018
[ "Apache-2.0" ]
PrecisionWebTechnologies/DynamicMVC
ReflectionLibrary/Models/ReflectedPropertyOperations.cs
1,200
C#
namespace Library.Web.Models { using Library.Web.Models.Interfaces; using System.Collections.Generic; public class BookIndexViewModel : ILibraryEntry { public int Id { get; set; } public string Title { get; set; } public string Status { get; set; } public List<IOriginator> Originators { get; set; } } }
22.647059
58
0.594805
[ "MIT" ]
msotiroff/Softuni-learning
C# Web Module/CSharp-Web-Asp.Net.Core-MVC/04.MVC-Architecture-Components/Library/Library.Web/Models/Book/BookIndexViewModel.cs
387
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.ContainerRegistry { /// <summary> /// An object that represents an export pipeline for a container registry. /// API Version: 2020-11-01-preview. /// </summary> [AzureNativeResourceType("azure-native:containerregistry:ExportPipeline")] public partial class ExportPipeline : Pulumi.CustomResource { /// <summary> /// The identity of the export pipeline. /// </summary> [Output("identity")] public Output<Outputs.IdentityPropertiesResponse?> Identity { get; private set; } = null!; /// <summary> /// The location of the export pipeline. /// </summary> [Output("location")] public Output<string?> Location { get; private set; } = null!; /// <summary> /// The name of the resource. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// The list of all options configured for the pipeline. /// </summary> [Output("options")] public Output<ImmutableArray<string>> Options { get; private set; } = null!; /// <summary> /// The provisioning state of the pipeline at the time the operation was called. /// </summary> [Output("provisioningState")] public Output<string> ProvisioningState { get; private set; } = null!; /// <summary> /// Metadata pertaining to creation and last modification of the resource. /// </summary> [Output("systemData")] public Output<Outputs.SystemDataResponse> SystemData { get; private set; } = null!; /// <summary> /// The target properties of the export pipeline. /// </summary> [Output("target")] public Output<Outputs.ExportPipelineTargetPropertiesResponse> Target { get; private set; } = null!; /// <summary> /// The type of the resource. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// Create a ExportPipeline 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 ExportPipeline(string name, ExportPipelineArgs args, CustomResourceOptions? options = null) : base("azure-native:containerregistry:ExportPipeline", name, args ?? new ExportPipelineArgs(), MakeResourceOptions(options, "")) { } private ExportPipeline(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:containerregistry:ExportPipeline", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:containerregistry:ExportPipeline"}, new Pulumi.Alias { Type = "azure-native:containerregistry/v20191201preview:ExportPipeline"}, new Pulumi.Alias { Type = "azure-nextgen:containerregistry/v20191201preview:ExportPipeline"}, new Pulumi.Alias { Type = "azure-native:containerregistry/v20201101preview:ExportPipeline"}, new Pulumi.Alias { Type = "azure-nextgen:containerregistry/v20201101preview:ExportPipeline"}, new Pulumi.Alias { Type = "azure-native:containerregistry/v20210601preview:ExportPipeline"}, new Pulumi.Alias { Type = "azure-nextgen:containerregistry/v20210601preview:ExportPipeline"}, }, }; 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 ExportPipeline 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="options">A bag of options that control this resource's behavior</param> public static ExportPipeline Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new ExportPipeline(name, id, options); } } public sealed class ExportPipelineArgs : Pulumi.ResourceArgs { /// <summary> /// The name of the export pipeline. /// </summary> [Input("exportPipelineName")] public Input<string>? ExportPipelineName { get; set; } /// <summary> /// The identity of the export pipeline. /// </summary> [Input("identity")] public Input<Inputs.IdentityPropertiesArgs>? Identity { get; set; } /// <summary> /// The location of the export pipeline. /// </summary> [Input("location")] public Input<string>? Location { get; set; } [Input("options")] private InputList<Union<string, Pulumi.AzureNative.ContainerRegistry.PipelineOptions>>? _options; /// <summary> /// The list of all options configured for the pipeline. /// </summary> public InputList<Union<string, Pulumi.AzureNative.ContainerRegistry.PipelineOptions>> Options { get => _options ?? (_options = new InputList<Union<string, Pulumi.AzureNative.ContainerRegistry.PipelineOptions>>()); set => _options = value; } /// <summary> /// The name of the container registry. /// </summary> [Input("registryName", required: true)] public Input<string> RegistryName { get; set; } = null!; /// <summary> /// The name of the resource group to which the container registry belongs. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; /// <summary> /// The target properties of the export pipeline. /// </summary> [Input("target", required: true)] public Input<Inputs.ExportPipelineTargetPropertiesArgs> Target { get; set; } = null!; public ExportPipelineArgs() { } } }
41.577143
141
0.609538
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/ContainerRegistry/ExportPipeline.cs
7,276
C#
using DN.WebApi.Application.Identity.Interfaces; using DN.WebApi.Application.Wrapper; using DN.WebApi.Domain.Constants; using DN.WebApi.Infrastructure.Identity.Permissions; using DN.WebApi.Shared.DTOs.Identity; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace DN.WebApi.Host.Controllers.Identity; [ApiController] [Route("api/[controller]")] [ApiVersionNeutral] [ApiConventionType(typeof(FSHApiConventions))] public sealed class IdentityController : ControllerBase { private readonly ICurrentUser _user; private readonly IIdentityService _identityService; private readonly IUserService _userService; public IdentityController(IIdentityService identityService, ICurrentUser user, IUserService userService) { _identityService = identityService; _user = user; _userService = userService; } [HttpPost("register")] [MustHavePermission(PermissionConstants.Identity.Register)] [ProducesResponseType(200)] [ProducesResponseType(400, Type = typeof(HttpValidationProblemDetails))] [ProducesDefaultResponseType(typeof(ErrorResult<string>))] public async Task<ActionResult<Result<string>>> RegisterAsync(RegisterRequest request) { string origin = GenerateOrigin(); return Ok(await _identityService.RegisterAsync(request, origin)); } [HttpGet("confirm-email")] [AllowAnonymous] [ProducesResponseType(200)] [ProducesDefaultResponseType(typeof(ErrorResult<string>))] public async Task<ActionResult<Result<string>>> ConfirmEmailAsync([FromQuery] string userId, [FromQuery] string code, [FromQuery] string tenant) { return Ok(await _identityService.ConfirmEmailAsync(userId, code, tenant)); } [HttpGet("confirm-phone-number")] [AllowAnonymous] [ProducesResponseType(200)] [ProducesDefaultResponseType(typeof(ErrorResult<string>))] public async Task<ActionResult<Result<string>>> ConfirmPhoneNumberAsync([FromQuery] string userId, [FromQuery] string code) { return Ok(await _identityService.ConfirmPhoneNumberAsync(userId, code)); } [HttpPost("forgot-password")] [AllowAnonymous] [ProducesResponseType(200)] [ProducesDefaultResponseType(typeof(ErrorResult<string>))] public async Task<ActionResult<Result>> ForgotPasswordAsync(ForgotPasswordRequest request) { string origin = GenerateOrigin(); return Ok(await _identityService.ForgotPasswordAsync(request, origin)); } [HttpPost("reset-password")] [AllowAnonymous] [ProducesResponseType(200)] [ProducesDefaultResponseType(typeof(ErrorResult<string>))] public async Task<ActionResult<Result>> ResetPasswordAsync(ResetPasswordRequest request) { return Ok(await _identityService.ResetPasswordAsync(request)); } [HttpPut("profile")] public async Task<ActionResult<Result>> UpdateProfileAsync(UpdateProfileRequest request) { return Ok(await _identityService.UpdateProfileAsync(request, _user.GetUserId().ToString())); } [HttpGet("profile")] public async Task<ActionResult<Result<UserDetailsDto>>> GetProfileDetailsAsync() { return Ok(await _userService.GetAsync(_user.GetUserId().ToString())); } [HttpPut("change-password")] [ProducesResponseType(200)] [ProducesResponseType(400, Type = typeof(HttpValidationProblemDetails))] [ProducesDefaultResponseType(typeof(ErrorResult<string>))] public async Task<ActionResult<Result>> ChangePasswordAsync(ChangePasswordRequest model) { var response = await _identityService.ChangePasswordAsync(model, _user.GetUserId().ToString()); return Ok(response); } private string GenerateOrigin() { return $"{Request.Scheme}://{Request.Host.Value}{Request.PathBase.Value}"; } }
37.637255
148
0.740818
[ "MIT" ]
Khair95/FullCleanArchitecture
src/Host/Controllers/Identity/IdentityController.cs
3,839
C#
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace wifiAnalysis { public class ScanningPage : ContentPage { List<RoomObject> rooms; Picker picker; Entry entry; bool rescan = false; protected override async void OnAppearing() { base.OnAppearing(); rooms = await App.ScanDatabase.GetRooms(); rooms.Reverse(); picker.Items.Clear(); foreach (RoomObject room in rooms) { picker.Items.Add(room.Room_Name); } if (!rescan) { picker.SelectedIndex = rooms.Count - 1; } } public ScanningPage() { Title = "Scan Settings"; bool scanInprogress = false; int sliderValue = 5; Label header = new Label { Text = "WebView", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), //VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.Center }; WebView webView = new WebView { Source = new UrlWebViewSource { Url = "http://klaipsc.mathcs.wilkes.edu/speedtest2", }, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.FromHex("1e90ff") }; Button viewResultsButton = new Button { Text = "View Results", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.Center }; Label sliderLabel = new Label { Text = "Level of Accuracy: " + sliderValue, TextColor = Color.FromHex("f5f5f5"), HorizontalOptions = LayoutOptions.Center, }; Slider accuracySlider = new Slider { Maximum = 10, Minimum = 1, Value = sliderValue, HorizontalOptions = LayoutOptions.FillAndExpand }; Button startScanButton = new Button { Text = "Start Scan", HorizontalOptions = LayoutOptions.FillAndExpand }; entry = new Entry { Placeholder = "Enter Room Name", IsVisible = false }; picker = new Picker { Title = "Select a Room", TextColor = Color.WhiteSmoke, HorizontalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand }; Button addRoom = new Button { Text = "Add Room" }; async void AddRoom_Clicked(object sender, EventArgs e) { entry.IsVisible = true; await Task.Delay(500); entry.Focus(); } async void Entry_Completed(object sender, EventArgs e) { entry.IsVisible = false; try { RoomObject room = new RoomObject { Room_Name = entry.Text}; await App.ScanDatabase.SaveRoomAsync(room); rooms = await App.ScanDatabase.GetRooms(); rooms.Add(new RoomObject { Room_ID = 0, Room_Name = "Not Specified" }); picker.Items.Clear(); foreach (RoomObject myroom in rooms) { picker.Items.Add(myroom.Room_Name); } picker.SelectedIndex = rooms.FindIndex(x => x.Room_Name.Equals(room.Room_Name)); } catch (Exception) { await DisplayAlert("Error", "Could not save room.", "OK"); } entry.Text = ""; } async void onStartScanButtonClicked(object sender, EventArgs args) { if (scanInprogress) { string result = await webView.EvaluateJavaScriptAsync("parseResults2()"); accuracySlider.IsEnabled = false; ScanObject scanResult = new ScanObject { Room_ID = rooms.Find(x => x.Room_Name.Equals(picker.Items[picker.SelectedIndex])).Room_ID }; if (result != null) { Console.WriteLine(result); jsonScan scanDeserialized = JsonConvert.DeserializeObject<jsonScan>(result); scanResult.download = scanDeserialized.download; scanResult.hostname = scanDeserialized.hostname; scanResult.ip_address = scanDeserialized.ip_address; scanResult.jitter = scanDeserialized.jitter; scanResult.latency = scanDeserialized.latency; scanResult.maxDownload = scanDeserialized.maxDownload; scanResult.maxUpload = scanDeserialized.maxUpload; scanResult.testDate = scanDeserialized.testDate; scanResult.testServer = scanDeserialized.testServer; scanResult.upload = scanDeserialized.upload; scanResult.userAgent = scanDeserialized.userAgent; //await App.ScanDatabase.SaveScanAsync(scanResult); //saveResultsButton.Text = "Database Saved"; //await Navigation.PushAsync(new ScanProgressPage(scanResult)); scanInprogress = false; MessagingCenter.Subscribe<ScanResults>(this, "ping", (theSender) => { refresh(); }); string Room_Name = picker.SelectedItem.ToString(); startScanButton.Text = "Start Scan"; await Navigation.PushModalAsync(new ScanResults(scanResult, Room_Name)); } } else { startScanButton.Text = "See Results"; scanInprogress = true; picker.IsEnabled = false; accuracySlider.IsEnabled = false; await webView.EvaluateJavaScriptAsync("callStart(" + sliderValue + ")"); } } void refresh() { rescan = true; webView.Reload(); scanInprogress = false; accuracySlider.IsEnabled = true; picker.IsEnabled = true; } void AccuracySlider_ValueChanged(object sender, ValueChangedEventArgs e) { sliderValue = (int)Math.Round(accuracySlider.Value); sliderLabel.Text = "Level of Accuracy: " + sliderValue; } startScanButton.Clicked += onStartScanButtonClicked; accuracySlider.ValueChanged += AccuracySlider_ValueChanged; addRoom.Clicked += AddRoom_Clicked; entry.Completed += Entry_Completed; // Build the page. this.Content = new StackLayout { BackgroundColor = Color.FromHex("1e90ff"), Children = { webView, entry, new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { addRoom, picker } }, sliderLabel, accuracySlider, startScanButton } }; } } }
36.9869
113
0.472609
[ "MIT" ]
adamabad/wifiAnalysis
wifiAnalysis/wifiAnalysis/View/ScanningPage.cs
8,472
C#
using Prism.Mvvm; using System.IO; namespace HomeLink.App.ViewModels { public sealed class FileViewModel : BindableBase { private string _name; private byte[] _data; public FileViewModel(string name) { _name = Path.GetFileName(name); _data = new byte[0]; } public FileViewModel(string name, byte[] data) { _name = Path.GetFileName(name); _data = data; } public string Name { get => _name; set => SetProperty(ref _name, value); } public byte[] Data => _data; public bool HasData => _data.Length != 0; } }
23.928571
56
0.549254
[ "MIT" ]
RomanEmreis/HomeLink.App
HomeLink.App/HomeLink.App/HomeLink.App/ViewModels/FileViewModel.cs
672
C#
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Web.Configuration; using System.Web.Mvc; using System.Web.Security; using Epi.Cloud.Common.Constants; using Epi.Cloud.Common.DTO; using Epi.Cloud.Common.Extensions; using Epi.Cloud.Common.Message; using Epi.Cloud.Common.Metadata; using Epi.Cloud.Common.Model; using Epi.Cloud.Facades.Interfaces; using Epi.Cloud.Interfaces.MetadataInterfaces; using Epi.Cloud.MVC.Constants; using Epi.Cloud.MVC.Extensions; using Epi.Cloud.MVC.Models; using Epi.Cloud.MVC.Utility; using Epi.Common.Core.DataStructures; using Epi.Core.EnterInterpreter; using Epi.DataPersistence.Constants; using Epi.DataPersistence.DataStructures; using Epi.FormMetadata.DataStructures; namespace Epi.Cloud.MVC.Controllers { [Authorize] public class FormResponseController : BaseSurveyController { private IEnumerable<AbridgedFieldInfo> _pageFields; private string _requiredList = ""; private bool _isNewRequest = true; //Added for retain search and sort public FormResponseController(ISurveyFacade isurveyFacade, IProjectMetadataProvider projectMetadataProvider ) { _surveyFacade = isurveyFacade; _projectMetadataProvider = projectMetadataProvider; } [HttpGet] //string responseid,string SurveyId, int ViewId, string CurrentPage // View =0 Root form public ActionResult Index(string formid, string responseId, int pagenumber = 1, int viewId = 0) { bool reset = false; string sortField = null; string sortOrder = null; if (Request.QueryString["sortfield"] != null) { sortField = Request.QueryString["sortfield"]; SetSessionValue(UserSession.Key.SortField, sortField); } if (Request.QueryString["sort"] != null) { sortOrder = Request.QueryString["sort"]; SetSessionValue(UserSession.Key.SortOrder, sortOrder); } if (string.IsNullOrWhiteSpace(sortOrder)) { sortOrder = GetStringSessionValue(UserSession.Key.SortOrder, defaultValue: null); if (string.IsNullOrWhiteSpace(sortOrder)) { sortOrder = AppSettings.GetStringValue(AppSettings.Key.DefaultSortOrder); } } if (string.IsNullOrWhiteSpace(sortField)) { sortField = GetStringSessionValue(UserSession.Key.SortField, defaultValue: null); if (string.IsNullOrWhiteSpace(sortField)) { sortField = AppSettings.GetStringValue(AppSettings.Key.DefaultSortField); } } bool.TryParse(Request.QueryString["reset"], out reset); if (reset) { RemoveSessionValue(UserSession.Key.SortOrder); RemoveSessionValue(UserSession.Key.SortField); RemoveSessionValue(UserSession.Key.SearchCriteria); } string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); ViewBag.Version = version; bool isAndroid = false; if (this.Request.UserAgent.IndexOf("Android", StringComparison.OrdinalIgnoreCase) >= 0) { isAndroid = true; } if (viewId == 0) { //Following code checks if request is for new or selected form. if (GetStringSessionValue(UserSession.Key.RootFormId) == formid) { _isNewRequest = false; } SetSessionValue(UserSession.Key.RootFormId, formid); RemoveSessionValue(UserSession.Key.RootResponseId); RemoveSessionValue(UserSession.Key.FormValuesHasChanged); SetSessionValue(UserSession.Key.IsEditMode, false); if (pagenumber == 0) pagenumber = 1; var model = new FormResponseInfoModel(); model.ViewId = viewId; int currentOrgId = GetIntSessionValue(UserSession.Key.CurrentOrgId, defaultValue: -1); model = GetSurveyResponseInfoModel(formid, pagenumber, sortOrder, sortField, currentOrgId); SetSessionValue(UserSession.Key.SelectedOrgId, model.FormInfoModel.OrganizationId); return View("Index", model); } else { List<FormsHierarchyDTO> formsHierarchy = GetFormsHierarchy(); int userId = SurveyHelper.GetDecryptUserId(Session[UserSession.Key.UserId].ToString()); bool isMobileDevice = this.Request.Browser.IsMobileDevice; int requestedViewId = viewId; SetSessionValue(UserSession.Key.RequestedViewId, requestedViewId); SurveyModel surveyModel = new SurveyModel(); surveyModel.RelateModel = formsHierarchy.ToRelateModel(formid); surveyModel.RequestedViewId = requestedViewId; var relateSurveyId = formsHierarchy.Single(x => x.ViewId == viewId); if (!string.IsNullOrEmpty(responseId)) { surveyModel.FormResponseInfoModel = GetFormResponseInfoModels(relateSurveyId.FormId, responseId, formsHierarchy); surveyModel.FormResponseInfoModel.NumberOfResponses = surveyModel.FormResponseInfoModel.ResponsesList.Count(); surveyModel.FormResponseInfoModel.ParentResponseId = responseId; } if (relateSurveyId.ResponseIds.Count() > 0) { SurveyAnswerDTO surveyAnswerDTO = GetSurveyAnswer(relateSurveyId.ResponseIds[0].ResponseId, relateSurveyId.FormId); var form = _surveyFacade.GetSurveyFormData(relateSurveyId.ResponseIds[0].SurveyId, 1, surveyAnswerDTO, isMobileDevice, null, null, isAndroid); surveyModel.Form = form; if (string.IsNullOrEmpty(responseId)) { surveyModel.FormResponseInfoModel = GetFormResponseInfoModels(relateSurveyId.FormId, responseId, formsHierarchy); surveyModel.FormResponseInfoModel.ParentResponseId = relateSurveyId.ResponseIds[0].ParentResponseId; } surveyModel.FormResponseInfoModel.FormInfoModel.FormName = form.SurveyInfo.SurveyName; surveyModel.FormResponseInfoModel.FormInfoModel.FormId = form.SurveyInfo.SurveyId; surveyModel.FormResponseInfoModel.NumberOfResponses = surveyModel.FormResponseInfoModel.ResponsesList.Count(); } else { FormResponseInfoModel responseInfoModel = new FormResponseInfoModel(); if (surveyModel.FormResponseInfoModel.ResponsesList.Count() > 0) { SurveyAnswerDTO surveyAnswerDTO = GetSurveyAnswer(surveyModel.FormResponseInfoModel.ResponsesList[0].Column0, relateSurveyId.FormId); responseInfoModel = GetFormResponseInfoModels(relateSurveyId.FormId, responseId, formsHierarchy); surveyModel.Form = _surveyFacade.GetSurveyFormData(surveyAnswerDTO.SurveyId, 1, surveyAnswerDTO, isMobileDevice, null, null, isAndroid); responseInfoModel.FormInfoModel.FormName = surveyModel.Form.SurveyInfo.SurveyName.ToString(); responseInfoModel.FormInfoModel.FormId = surveyModel.Form.SurveyInfo.SurveyId.ToString(); responseInfoModel.ParentResponseId = responseId;//SurveyModel.FormResponseInfoModel.ResponsesList[0].Column0; responseInfoModel.NumberOfResponses = surveyModel.FormResponseInfoModel.ResponsesList.Count(); } else { var form1 = _surveyFacade.GetSurveyInfoModel(relateSurveyId.FormId); responseInfoModel.FormInfoModel.FormName = form1.SurveyName.ToString(); responseInfoModel.FormInfoModel.FormId = form1.SurveyId.ToString(); responseInfoModel.ParentResponseId = responseId; } surveyModel.FormResponseInfoModel = responseInfoModel; } surveyModel.FormResponseInfoModel.ViewId = viewId; return View("Index", surveyModel.FormResponseInfoModel); } } [HttpPost] public ActionResult Index(string surveyId, string addNewFormId, string editForm, string cancel) { // Assign "editForm" parameter to a less confusing name. // editForm contains the responseId of the record being edited. string editResponseId = editForm; int userId = GetIntSessionValue(UserSession.Key.UserId); string userName = GetStringSessionValue(UserSession.Key.UserName); bool isMobileDevice = this.Request.Browser.IsMobileDevice; FormsAuthentication.SetAuthCookie("BeginSurvey", false); bool isEditMode = false; if (isMobileDevice == true) { isMobileDevice = Epi.Cloud.MVC.Utility.SurveyHelper.IsMobileDevice(this.Request.UserAgent.ToString()); } bool isAndroid = this.Request.UserAgent.IndexOf("Android", StringComparison.OrdinalIgnoreCase) >= 0; if (!string.IsNullOrEmpty(/*FromURL*/cancel)) { int pageNumber; int.TryParse(/*FromURL*/cancel, out pageNumber); Dictionary<string, int> surveyPagesList = GetSessionValue<Dictionary<string, int>>(UserSession.Key.RelateButtonPageId); if (surveyPagesList != null) { pageNumber = surveyPagesList[this.Request.Form["Parent_Response_Id"].ToString()]; } return RedirectToRoute(new { Controller = "Survey", Action = "Index", responseid = this.Request.Form["Parent_Response_Id"].ToString(), PageNumber = pageNumber }); } if (string.IsNullOrEmpty(/*FromURL*/editResponseId) && string.IsNullOrEmpty(/*FromURL*/addNewFormId) && !IsSessionValueNull(UserSession.Key.EditResponseId)) { editResponseId = GetStringSessionValue(UserSession.Key.EditResponseId); } if (!string.IsNullOrEmpty(editResponseId)) { if (IsSessionValueNull(UserSession.Key.RootResponseId)) { SetSessionValue(UserSession.Key.RootResponseId, editResponseId); } isEditMode = true; SetSessionValue(UserSession.Key.IsEditMode, isEditMode); SurveyAnswerDTO surveyAnswer = GetSurveyAnswer(editResponseId, GetStringSessionValue(UserSession.Key.RootFormId)); if (!IsSessionValueNull(UserSession.Key.RecoverLastRecordVersion)) { surveyAnswer.RecoverLastRecordVersion = GetBoolSessionValue(UserSession.Key.RecoverLastRecordVersion); } // string childRecordId = GetChildRecordId(surveyAnswer); //return RedirectToAction(ViewActions.Index, ControllerNames.Survey, new { responseid = surveyAnswer.ParentResponseId, PageNumber = 1, Edit = "Edit" }); return RedirectToAction(ViewActions.Index, ControllerNames.Survey, new { responseid = editResponseId, PageNumber = 1, Edit = "Edit" }); } //create the responseid Guid responseId = Guid.NewGuid(); if (IsSessionValueNull(UserSession.Key.RootResponseId)) { SetSessionValue(UserSession.Key.RootResponseId, responseId); } var rootResponseId = GetStringSessionValue(UserSession.Key.RootResponseId); TempData[TempDataKeys.ResponseId] = responseId.ToString(); int orgId = GetIntSessionValue(UserSession.Key.CurrentOrgId); var responseContext = InitializeResponseContext(formId: /*FromURL*/addNewFormId, responseId: responseId.ToString(), parentResponseId: this.Request.Form["Parent_Response_Id"].ToString(), isNewRecord: !isEditMode); // create the first survey response SurveyAnswerDTO surveyAnswerDTO = _surveyFacade.CreateSurveyAnswer(responseContext); List<FormsHierarchyDTO> formsHierarchy = GetFormsHierarchy(); SurveyInfoModel surveyInfoModel = GetSurveyInfo(surveyAnswerDTO.SurveyId, formsHierarchy); MetadataAccessor metadataAccessor = surveyInfoModel as MetadataAccessor; // set the survey answer to be production or test surveyAnswerDTO.IsDraftMode = surveyInfoModel.IsDraftMode; MvcDynamicForms.Form form = _surveyFacade.GetSurveyFormData(surveyAnswerDTO.SurveyId, 1, surveyAnswerDTO, isMobileDevice, null, formsHierarchy, isAndroid); TempData[TempDataKeys.Width] = form.Width + 100; var formDigest = metadataAccessor.GetFormDigest(surveyAnswerDTO.SurveyId); string checkcode = formDigest.CheckCode; FormResponseDetail responseDetail = surveyAnswerDTO.ResponseDetail; form.FormCheckCodeObj = form.GetCheckCodeObj(MetadataAccessor.GetFieldDigests(surveyAnswerDTO.SurveyId), responseDetail, checkcode); ///////////////////////////// Execute - Record Before - start////////////////////// Dictionary<string, string> ContextDetailList = new Dictionary<string, string>(); EnterRule functionObject_B = (EnterRule)form.FormCheckCodeObj.GetCommand("level=record&event=before&identifier="); SurveyResponseBuilder surveyResponseBuilder = new SurveyResponseBuilder(_requiredList); if (functionObject_B != null && !functionObject_B.IsNull()) { try { PageDigest[] pageDigests = form.MetadataAccessor.GetCurrentFormPageDigests(); responseDetail = surveyResponseBuilder.CreateResponseDocument(responseContext, pageDigests); SetSessionValue(UserSession.Key.RequiredList, surveyResponseBuilder.RequiredList); _requiredList = surveyResponseBuilder.RequiredList; form.RequiredFieldsList = _requiredList; functionObject_B.Context.HiddenFieldList = form.HiddenFieldsList; functionObject_B.Context.HighlightedFieldList = form.HighlightedFieldsList; functionObject_B.Context.DisabledFieldList = form.DisabledFieldsList; functionObject_B.Context.RequiredFieldList = form.RequiredFieldsList; functionObject_B.Execute(); // field list form.HiddenFieldsList = functionObject_B.Context.HiddenFieldList; form.HighlightedFieldsList = functionObject_B.Context.HighlightedFieldList; form.DisabledFieldsList = functionObject_B.Context.DisabledFieldList; form.RequiredFieldsList = functionObject_B.Context.RequiredFieldList; ContextDetailList = SurveyHelper.GetContextDetailList(functionObject_B); form = SurveyHelper.UpdateControlsValuesFromContext(form, ContextDetailList); _surveyFacade.UpdateSurveyResponse(surveyInfoModel, responseId.ToString(), form, surveyAnswerDTO, false, false, 0, orgId, userId, userName); } catch (Exception ex) { // do nothing so that processing // can continue } } else { PageDigest[] pageDigestArray = form.MetadataAccessor.GetCurrentFormPageDigests();// metadataAccessor.GetPageDigests(surveyInfoModel.SurveyId); surveyAnswerDTO.ResponseDetail = surveyResponseBuilder.CreateResponseDocument(responseContext, pageDigestArray); _requiredList = surveyResponseBuilder.RequiredList; SetSessionValue(UserSession.Key.RequiredList, _requiredList); form.RequiredFieldsList = _requiredList; _surveyFacade.UpdateSurveyResponse(surveyInfoModel, surveyAnswerDTO.ResponseId, form, surveyAnswerDTO, false, false, 0, orgId, userId, userName); } surveyAnswerDTO = (SurveyAnswerDTO)formsHierarchy.SelectMany(x => x.ResponseIds).FirstOrDefault(z => z.ResponseId == surveyAnswerDTO.ResponseId); ///////////////////////////// Execute - Record Before - End////////////////////// return RedirectToAction(ViewActions.Index, ControllerNames.Survey, new { responseid = responseId, PageNumber = 1 }); } public FormResponseInfoModel GetSurveyResponseInfoModel(string surveyId, int pageNumber, string sort = "", string sortfield = "", int orgid = -1) { // Initialize the Metadata Accessor MetadataAccessor.CurrentFormId = surveyId; FormResponseInfoModel formResponseInfoModel = null; int orgId = GetIntSessionValue(UserSession.Key.CurrentOrgId); int userId = GetIntSessionValue(UserSession.Key.UserId); string userName = GetStringSessionValue(UserSession.Key.UserName); if (!string.IsNullOrEmpty(surveyId)) { formResponseInfoModel = GetFormResponseInfoModel(surveyId, orgid, userId); FormSettingResponse formSettingResponse = formResponseInfoModel.FormSettingResponse; var surveyResponseBuilder = new SurveyResponseBuilder(); formResponseInfoModel.FormInfoModel.IsShared = formSettingResponse.FormInfo.IsShared; formResponseInfoModel.FormInfoModel.IsShareable = formSettingResponse.FormInfo.IsShareable; formResponseInfoModel.FormInfoModel.FormName = formSettingResponse.FormInfo.FormName; formResponseInfoModel.FormInfoModel.FormNumber = formSettingResponse.FormInfo.FormNumber; // Set User Role //if (formResponseInfoModel.FormInfoModel.IsShared) //{ // SetUserRole(UserId, orgid); //} //else //{ //SetUserRole(UserId, FormSettingResponse.FormInfo.OrganizationId); //} //SetUserRole(userId, orgid); var responseContext = InitializeResponseContext(formId: surveyId); SurveyAnswerRequest formResponseReq = new SurveyAnswerRequest { ResponseContext = responseContext }; formResponseReq.Criteria.SurveyId = surveyId.ToString(); formResponseReq.Criteria.PageNumber = /*FromURL*/pageNumber; formResponseReq.Criteria.UserId = userId; formResponseReq.Criteria.IsSqlProject = formSettingResponse.FormInfo.IsSQLProject; formResponseReq.Criteria.IsShareable = formSettingResponse.FormInfo.IsShareable; formResponseReq.Criteria.DataAccessRuleId = formSettingResponse.FormSetting.SelectedDataAccessRule; //formResponseReq.Criteria.IsMobile = true; formResponseReq.Criteria.UserOrganizationId = orgid; formResponseReq.Criteria.IsDraftMode = formSettingResponse.FormInfo.IsDraftMode; SetSessionValue(UserSession.Key.IsSqlProject, formSettingResponse.FormInfo.IsSQLProject); SetSessionValue(UserSession.Key.IsOwner, formSettingResponse.FormInfo.IsOwner); // Following code retain search starts string sessionSearchCriteria = GetStringSessionValue(UserSession.Key.SearchCriteria, defaultValue: null); if (!string.IsNullOrEmpty(sessionSearchCriteria) && (Request.QueryString["col1"] == null || Request.QueryString["col1"] == "undefined")) { formResponseReq.Criteria.SearchCriteria = sessionSearchCriteria; formResponseInfoModel.SearchModel = GetSessionValue<SearchBoxModel>(UserSession.Key.SearchModel); } else { formResponseReq.Criteria.SearchCriteria = CreateSearchCriteria(Request.QueryString, formResponseInfoModel.SearchModel, formResponseInfoModel); SetSessionValue(UserSession.Key.SearchModel, formResponseInfoModel.SearchModel); SetSessionValue(UserSession.Key.SearchCriteria, formResponseReq.Criteria.SearchCriteria); } // Following code retain search ends PopulateDropDownlists(formResponseInfoModel, formSettingResponse.FormSetting.FormControlNameList.ToList()); if (sort != null && sort.Length > 0) { formResponseReq.Criteria.SortOrder = sort; } else { formResponseReq.Criteria.SortOrder = AppSettings.GetStringValue(AppSettings.Key.DefaultSortOrder); } if (!string.IsNullOrEmpty(sortfield) && sortfield.Length > 0) { formResponseReq.Criteria.Sortfield = sortfield; } else { formResponseReq.Criteria.Sortfield = AppSettings.GetStringValue(AppSettings.Key.DefaultSortField); } formResponseReq.Criteria.SurveyQAList = _columns.ToDictionary(c => c.Key.ToString(), c => c.Value); formResponseReq.Criteria.FieldDigestList = formResponseInfoModel.ColumnDigests.ToDictionary(c => c.Key, c => c.Value); formResponseReq.Criteria.SearchDigestList = ToSearchDigestList(formResponseInfoModel.SearchModel, surveyId); SurveyAnswerResponse formResponseList = _surveyFacade.GetFormResponseList(formResponseReq); var surveyResponse = formResponseList.SurveyResponseList;//.Skip((pageNumber - 1) * 20).Take(20); formResponseList.SurveyResponseList = surveyResponse.ToList(); List<ResponseModel> responseList = new List<ResponseModel>(); List<ResponseModel> responseListModel = new List<ResponseModel>(); Dictionary<string, string> dictory = new Dictionary<string, string>(); List<Dictionary<string, string>> dictoryList = new List<Dictionary<string, string>>(); ; foreach (var item in formResponseList.SurveyResponseList) { if (item.SqlData != null) { responseList.Add(ConvertRowToModel(item, _columns, "GlobalRecordId")); } else { responseList.Add(item.ToResponseModel(_columns)); } } string sortFieldcolumn = string.Empty; if (!string.IsNullOrEmpty(sortfield)) { foreach (var column in _columns) { if (column.Value== sortfield) { sortFieldcolumn = "Column" + column.Key; } } } var sortList = responseList; if (!string.IsNullOrEmpty(sortfield)) { if (sort != "ASC") { switch (sortFieldcolumn) { case "Column1": responseListModel = sortList.OrderByDescending(x => x.Column1).ToList(); break; case "Column2": responseListModel = sortList.OrderByDescending(x => x.Column2).ToList(); break; case "Column3": responseListModel = sortList.OrderByDescending(x => x.Column3).ToList(); break; case "Column4": responseListModel = sortList.OrderByDescending(x => x.Column4).ToList(); break; case "Column5": responseListModel = sortList.OrderByDescending(x => x.Column5).ToList(); break; } } else { switch (sortFieldcolumn) { case "Column1": responseListModel = sortList.OrderBy(x => x.Column1).ToList(); break; case "Column2": responseListModel = sortList.OrderBy(x => x.Column2).ToList(); break; case "Column3": responseListModel = sortList.OrderBy(x => x.Column3).ToList(); break; case "Column4": responseListModel = sortList.OrderBy(x => x.Column4).ToList(); break; case "Column5": responseListModel = sortList.OrderBy(x => x.Column5).ToList(); break; } } // formResponseInfoModel.ResponsesList = responseListModel.Skip((pageNumber - 1) * 20).Take(20).ToList(); formResponseInfoModel.ResponsesList = responseList.Take(20).ToList(); } if (string.IsNullOrEmpty(sort)) { // formResponseInfoModel.ResponsesList = responseList.Skip((pageNumber - 1) * 20).Take(20).ToList(); formResponseInfoModel.ResponsesList = responseList.Take(20).ToList(); } //Setting Form Info formResponseInfoModel.FormInfoModel = formResponseList.FormInfo.ToFormInfoModel(); //Setting Additional Data formResponseInfoModel.NumberOfPages = formResponseList.NumberOfPages; formResponseInfoModel.PageSize = ReadPageSize(); formResponseInfoModel.NumberOfResponses = formResponseList.NumberOfResponses; formResponseInfoModel.sortfield = /*FromURL*/sortfield; formResponseInfoModel.sortOrder = /*FromURL*/sort; formResponseInfoModel.CurrentPage = /*FromURL*/pageNumber; } return formResponseInfoModel; } public ActionResult ReadSortedResponseInfo(string formId, int? page, string sort, string sortField, int orgId, bool reset = false) { page = page.HasValue ? page.Value : 1; bool isMobileDevice = this.Request.Browser.IsMobileDevice; //Code added to retain Search Starts if (reset) { RemoveSessionValue(UserSession.Key.SortOrder); RemoveSessionValue(UserSession.Key.SortField); } if (IsSessionValueNull(UserSession.Key.ProjectId)) { // This will prime the cache if the project is not already loaded into cache. SetSessionValue(UserSession.Key.ProjectId, _projectMetadataProvider.GetProjectId_RetrieveProjectIfNecessary()); } SetSessionValue(UserSession.Key.SelectedOrgId, orgId); var rootFormId = GetStringSessionValue(UserSession.Key.RootFormId, defaultValue: null); if (rootFormId == formId) { string sessionSortOrder = GetStringSessionValue(UserSession.Key.SortOrder, defaultValue: null); if (!string.IsNullOrEmpty(sessionSortOrder) && string.IsNullOrEmpty(sort)) { sort = sessionSortOrder; } string sessionSortField = GetStringSessionValue(UserSession.Key.SortField, defaultValue: null); if (!string.IsNullOrEmpty(sessionSortField) && string.IsNullOrEmpty(sortField)) { sortField = sessionSortField; } SetSessionValue(UserSession.Key.SortOrder, sort); SetSessionValue(UserSession.Key.SortField, sortField); SetSessionValue(UserSession.Key.PageNumber, page.Value); } else { SetSessionValue(UserSession.Key.RootFormId, formId); ResponseContext responseContext = InitializeResponseContext(formId: formId) as ResponseContext; SetSessionValue(UserSession.Key.ResponseContext, responseContext); RemoveSessionValue(UserSession.Key.SortOrder); RemoveSessionValue(UserSession.Key.SortField); SetSessionValue(UserSession.Key.PageNumber, page.Value); } //Code added to retain Search Ends. var formResponseInfoModel = GetSurveyResponseInfoModel(formId, page.Value, sort, sortField, orgId); if (isMobileDevice == false) { return PartialView("ListResponses", formResponseInfoModel); } else { return View("ListResponses", formResponseInfoModel); } } private void PopulateDropDownlists(FormResponseInfoModel formResponseInfoModel, List<KeyValuePair<int, string>> list) { PopulateDropDownlist(out formResponseInfoModel.SearchColumns1, formResponseInfoModel.SearchModel.SearchCol1, list); PopulateDropDownlist(out formResponseInfoModel.SearchColumns2, formResponseInfoModel.SearchModel.SearchCol2, list); PopulateDropDownlist(out formResponseInfoModel.SearchColumns3, formResponseInfoModel.SearchModel.SearchCol3, list); PopulateDropDownlist(out formResponseInfoModel.SearchColumns4, formResponseInfoModel.SearchModel.SearchCol4, list); PopulateDropDownlist(out formResponseInfoModel.SearchColumns5, formResponseInfoModel.SearchModel.SearchCol5, list); } public SurveyInfoModel GetSurveyInfo(string surveyId, List<FormsHierarchyDTO> formsHierarchyDTOList = null) { SurveyInfoModel surveyInfoModel = new SurveyInfoModel(); if (formsHierarchyDTOList != null) { var formsHierarchyDTO = formsHierarchyDTOList.FirstOrDefault(x => x.FormId == surveyId).SurveyInfo; surveyInfoModel = formsHierarchyDTO.ToSurveyInfoModel(); } else { surveyInfoModel = _surveyFacade.GetSurveyInfoModel(surveyId); } return surveyInfoModel; } private string GetChildRecordId(SurveyAnswerDTO surveyAnswerDTO) { SurveyAnswerRequest SurveyAnswerRequest = new SurveyAnswerRequest(); SurveyAnswerResponse SurveyAnswerResponse = new SurveyAnswerResponse(); string ChildId = Guid.NewGuid().ToString(); surveyAnswerDTO.ParentResponseId = surveyAnswerDTO.ResponseId; surveyAnswerDTO.ResponseId = ChildId; surveyAnswerDTO.Status = RecordStatus.InProcess; surveyAnswerDTO.ReasonForStatusChange = RecordStatusChangeReason.CreateMulti; SurveyAnswerRequest.SurveyAnswerList.Add(surveyAnswerDTO); string result; //responseId = TempData[TempDataKeys.ResponseId].ToString(); SurveyAnswerRequest.Criteria.UserId = GetIntSessionValue(UserSession.Key.UserId); SurveyAnswerRequest.RequestId = ChildId; SurveyAnswerRequest.Action = RequestAction.CreateMulti; SurveyAnswerResponse = _surveyFacade.SetChildRecord(SurveyAnswerRequest); result = SurveyAnswerResponse.SurveyResponseList[0].ResponseId.ToString(); return result; } [HttpPost] public ActionResult Delete(string responseId) { var rootFormId = GetStringSessionValue(UserSession.Key.RootFormId); int userId = GetIntSessionValue(UserSession.Key.UserId); int orgId = GetIntSessionValue(UserSession.Key.CurrentOrgId); var responseContext = new ResponseContext { ResponseId = responseId, RootResponseId = responseId, FormId = rootFormId, UserOrgId = orgId, UserId = userId }.ResolveMetadataDependencies() as ResponseContext; SurveyAnswerRequest surveyAnswerRequest = responseContext.ToSurveyAnswerRequest(); surveyAnswerRequest.SurveyAnswerList.Add(responseContext.ToSurveyAnswerDTOLite()); surveyAnswerRequest.Criteria.UserOrganizationId = orgId; surveyAnswerRequest.Criteria.UserId = userId; surveyAnswerRequest.Criteria.IsSqlProject = GetBoolSessionValue(UserSession.Key.IsSqlProject); surveyAnswerRequest.Criteria.SurveyId = rootFormId; surveyAnswerRequest.Criteria.StatusChangeReason = RecordStatusChangeReason.DeleteResponse; surveyAnswerRequest.Action = RequestAction.Delete; SurveyAnswerResponse surveyAnswerResponse = _surveyFacade.DeleteResponse(surveyAnswerRequest); return Json(string.Empty); } [HttpPost] public ActionResult DeleteBranch(string ResponseId)//List<FormInfoModel> ModelList, string formid) { SurveyAnswerRequest surveyAnswerRequest = new SurveyAnswerRequest(); surveyAnswerRequest.SurveyAnswerList.Add(new SurveyAnswerDTO() { ResponseId = ResponseId }); surveyAnswerRequest.Criteria.UserId = GetIntSessionValue(UserSession.Key.UserId); surveyAnswerRequest.Criteria.IsEditMode = false; surveyAnswerRequest.Criteria.IsDeleteMode = false; surveyAnswerRequest.Criteria.IsSqlProject = GetBoolSessionValue(UserSession.Key.IsSqlProject); surveyAnswerRequest.Criteria.SurveyId = GetStringSessionValue(UserSession.Key.RootFormId); SurveyAnswerResponse saResponse = _surveyFacade.DeleteResponse(surveyAnswerRequest); return Json(string.Empty); } private List<FormsHierarchyDTO> GetFormsHierarchy() { FormsHierarchyResponse formsHierarchyResponse = new FormsHierarchyResponse(); FormsHierarchyRequest formsHierarchyRequest = new FormsHierarchyRequest(); string rootFormId = GetStringSessionValue(UserSession.Key.RootFormId, defaultValue: null); string rootResponseId = GetStringSessionValue(UserSession.Key.RootResponseId, defaultValue: null); if (rootFormId != null && rootResponseId != null) { formsHierarchyRequest.SurveyInfo.FormId = rootFormId; formsHierarchyRequest.SurveyResponseInfo.ResponseId = rootResponseId; formsHierarchyResponse = _surveyFacade.GetFormsHierarchy(formsHierarchyRequest); } return formsHierarchyResponse.FormsHierarchy; } private FormResponseInfoModel GetFormResponseInfoModels(string surveyId, string responseId, List<FormsHierarchyDTO> formsHierarchyDTOList = null) { FormResponseInfoModel formResponseInfoModel = new FormResponseInfoModel(); var formHieratchyDTO = formsHierarchyDTOList.FirstOrDefault(h => h.FormId == surveyId); SurveyResponseBuilder surveyResponseBuilder = new SurveyResponseBuilder(); if (!string.IsNullOrEmpty(surveyId)) { SurveyAnswerRequest surveyAnswerRequest = new SurveyAnswerRequest(); FormSettingRequest formSettingRequest = new FormSettingRequest { ProjectId = GetStringSessionValue(UserSession.Key.ProjectId) }; //Populating the request formSettingRequest.FormInfo.FormId = surveyId; formSettingRequest.FormInfo.UserId = GetIntSessionValue(UserSession.Key.UserId); //Getting Column Name List FormSettingResponse formSettingResponse = _surveyFacade.GetFormSettings(formSettingRequest); _columns = formSettingResponse.FormSetting.ColumnNameList.ToList(); _columns.Sort(Compare); // Setting Column Name List formResponseInfoModel.Columns = _columns; //Getting Resposes var ResponseListDTO = formsHierarchyDTOList.FirstOrDefault(x => x.FormId == surveyId).ResponseIds; // If we don't have any data for this child form yet then create a response if (ResponseListDTO.Count == 0) { var formResponseDetail = InitializeFormResponseDetail(); formResponseDetail.ParentResponseId = responseId; formResponseDetail.ResponseId = Guid.NewGuid().ToString(); formResponseDetail.ResolveMetadataDependencies(); var surveyAnswerDTO = new SurveyAnswerDTO(formResponseDetail); surveyAnswerDTO.CurrentPageNumber = 1; ResponseListDTO.Add(surveyAnswerDTO); } //Setting Resposes List List<ResponseModel> ResponseList = new List<ResponseModel>(); foreach (var item in ResponseListDTO) { if (item.ParentResponseId == responseId) { if (item.SqlData != null) { ResponseList.Add(ConvertRowToModel(item, _columns, "ChildGlobalRecordID")); } else { ResponseList.Add(item.ToResponseModel(_columns)); } } } formResponseInfoModel.ResponsesList = ResponseList; formResponseInfoModel.PageSize = ReadPageSize(); formResponseInfoModel.CurrentPage = 1; } return formResponseInfoModel; } private int ReadPageSize() { return Convert.ToInt16(WebConfigurationManager.AppSettings["RESPONSE_PAGE_SIZE"].ToString()); } [HttpGet] public ActionResult LogOut() { FormsAuthentication.SignOut(); Session.Clear(); return RedirectToAction(ViewActions.Index, ControllerNames.Login); } [HttpPost] [AcceptVerbs(HttpVerbs.Post)] public ActionResult CheckForConcurrency(String responseId) { ResponseContext responseContext = GetSetResponseContext(responseId); var surveyAnswerStateDTO = GetSurveyAnswerState(responseContext); SetSessionValue(UserSession.Key.EditResponseId, responseId); // Minimize the amount of Json data by serializing only pertinent state information var json = Json(surveyAnswerStateDTO); return json; } [HttpPost] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Unlock(String responseId, bool recoverLastRecordVersion) { return UnlockResponse(responseId, recoverLastRecordVersion); } } }
50.927848
224
0.612955
[ "Apache-2.0" ]
82ndAirborneDiv/Epi-Info-Cloud-Contact-Tracing
Cloud Enter/Epi.Cloud/Controllers/FormResponseController.cs
40,235
C#
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Boleto Fácil SDK")] [assembly: AssemblyDescription("SDK para integração com o Boleto Fácil")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Juno")] [assembly: AssemblyProduct("Boleto Fácil SDK")] [assembly: AssemblyCopyright("${AuthorCopyright}")] [assembly: AssemblyTrademark("Juno")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
39.333333
82
0.750471
[ "Apache-2.0" ]
boletofacil/boletofacil-sdk-net
BoletoFacilSDK/Properties/AssemblyInfo.cs
1,069
C#
using System; namespace FizzBuzz { class Program { static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine().Trim()); Result.fizzBuzz(n); } } class Result { /* * Complete the 'fizzBuzz' function below. * * The function accepts INTEGER n as parameter. */ public static void fizzBuzz(int n) { for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) { Console.WriteLine("FizzBuzz"); } else if (i % 3 == 0) { Console.WriteLine("Fizz"); } else if (i % 5 == 0) { Console.WriteLine("Buzz"); } else { Console.WriteLine(i); } } } } }
20.1
63
0.344279
[ "MIT" ]
tonchevaAleksandra/HackerRank-Problem-Solving
C Sharp Basic Skills Certification Test/FizzBuzz/Program.cs
1,007
C#
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace DemoService { public static class UseExtensions { public static IHostBuilder UsePrinter(this IHostBuilder hostBuilder) { return hostBuilder.ConfigureServices(services => services.AddHostedService<PrinterHostedService>()); } } }
27.928571
76
0.693095
[ "MIT" ]
codeyu/netcore-generic-host-demo
src/DemoService/UseExtensions.cs
391
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System; using System.Threading; using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; namespace Azure.ResourceManager.AppService { #pragma warning disable SA1649 // File name should match first type name internal class AppServiceArmOperation<T> : ArmOperation<T> #pragma warning restore SA1649 // File name should match first type name { private readonly OperationInternal<T> _operation; /// <summary> Initializes a new instance of AppServiceArmOperation for mocking. </summary> protected AppServiceArmOperation() { } internal AppServiceArmOperation(Response<T> response) { _operation = OperationInternal<T>.Succeeded(response.GetRawResponse(), response.Value); } internal AppServiceArmOperation(IOperationSource<T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia) { var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia); _operation = new OperationInternal<T>(clientDiagnostics, nextLinkOperation, response, "AppServiceArmOperation", fallbackStrategy: new ExponentialDelayStrategy()); } /// <inheritdoc /> #pragma warning disable CA1822 public override string Id => throw new NotImplementedException(); #pragma warning restore CA1822 /// <inheritdoc /> public override T Value => _operation.Value; /// <inheritdoc /> public override bool HasValue => _operation.HasValue; /// <inheritdoc /> public override bool HasCompleted => _operation.HasCompleted; /// <inheritdoc /> public override Response GetRawResponse() => _operation.RawResponse; /// <inheritdoc /> public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); /// <inheritdoc /> public override ValueTask<Response> UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); /// <inheritdoc /> public override Response<T> WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); /// <inheritdoc /> public override Response<T> WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); /// <inheritdoc /> public override ValueTask<Response<T>> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); /// <inheritdoc /> public override ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); } }
42.986842
216
0.731558
[ "MIT" ]
damodaravadhani/azure-sdk-for-net
sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/AppServiceArmOperationOfT.cs
3,267
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.IO; using System.Management.Automation; using System.Management.Automation.Internal; using System.Reflection; using System.Threading; using Microsoft.PowerShell.Commands.Internal.Format; namespace Microsoft.PowerShell.Commands { internal class OutWindowProxy : IDisposable { private const string OutGridViewWindowClassName = "Microsoft.Management.UI.Internal.OutGridViewWindow"; private const string OriginalTypePropertyName = "OriginalType"; internal const string OriginalObjectPropertyName = "OutGridViewOriginalObject"; private const string ToStringValuePropertyName = "ToStringValue"; private const string IndexPropertyName = "IndexValue"; private int _index; /// <summary> Columns definition of the underlying Management List</summary> private HeaderInfo _headerInfo; private bool _isWindowStarted; private string _title; private OutputModeOption _outputMode; private AutoResetEvent _closedEvent; private OutGridViewCommand _parentCmdlet; private GraphicalHostReflectionWrapper _graphicalHostReflectionWrapper; /// <summary> /// Initializes a new instance of the OutWindowProxy class. /// </summary> internal OutWindowProxy(string title, OutputModeOption outPutMode, OutGridViewCommand parentCmdlet) { _title = title; _outputMode = outPutMode; _parentCmdlet = parentCmdlet; _graphicalHostReflectionWrapper = GraphicalHostReflectionWrapper.GetGraphicalHostReflectionWrapper(parentCmdlet, OutWindowProxy.OutGridViewWindowClassName); } /// <summary> /// Adds columns to the output window. /// </summary> /// <param name="propertyNames">An array of property names to add.</param> /// <param name="displayNames">An array of display names to add.</param> /// <param name="types">An array of types to add.</param> internal void AddColumns(string[] propertyNames, string[] displayNames, Type[] types) { if (propertyNames == null) { throw new ArgumentNullException("propertyNames"); } if (displayNames == null) { throw new ArgumentNullException("displayNames"); } if (types == null) { throw new ArgumentNullException("types"); } try { _graphicalHostReflectionWrapper.CallMethod("AddColumns", propertyNames, displayNames, types); } catch (TargetInvocationException ex) { // Verify if this is an error loading the System.Core dll. FileNotFoundException fileNotFoundEx = ex.InnerException as FileNotFoundException; if (fileNotFoundEx != null && fileNotFoundEx.FileName.Contains("System.Core")) { _parentCmdlet.ThrowTerminatingError( new ErrorRecord(new InvalidOperationException( StringUtil.Format(FormatAndOut_out_gridview.RestartPowerShell, _parentCmdlet.CommandInfo.Name), ex.InnerException), "ErrorLoadingAssembly", ErrorCategory.ObjectNotFound, null)); } else { // Let PowerShell take care of this problem. throw; } } } // Types that are not defined in the database and are not scalar. internal void AddColumnsAndItem(PSObject liveObject, TableView tableView) { // Create a header using only the input object's properties. _headerInfo = tableView.GenerateHeaderInfo(liveObject, _parentCmdlet); AddColumnsAndItemEnd(liveObject); } // Database defined types. internal void AddColumnsAndItem(PSObject liveObject, TableView tableView, TableControlBody tableBody) { _headerInfo = tableView.GenerateHeaderInfo(liveObject, tableBody, _parentCmdlet); AddColumnsAndItemEnd(liveObject); } // Scalar types. internal void AddColumnsAndItem(PSObject liveObject) { _headerInfo = new HeaderInfo(); // On scalar types the type name is used as a column name. _headerInfo.AddColumn(new ScalarTypeColumnInfo(liveObject.BaseObject.GetType())); AddColumnsAndItemEnd(liveObject); } private void AddColumnsAndItemEnd(PSObject liveObject) { // Add columns to the underlying Management list and as a byproduct get a stale PSObject. PSObject staleObject = _headerInfo.AddColumnsToWindow(this, liveObject); // Add 3 extra properties, so that the stale PSObject has meaningful info in the Hetero-type header view. AddExtraProperties(staleObject, liveObject); // Add the stale PSObject to the underlying Management list. _graphicalHostReflectionWrapper.CallMethod("AddItem", staleObject); } // Hetero types. internal void AddHeteroViewColumnsAndItem(PSObject liveObject) { _headerInfo = new HeaderInfo(); _headerInfo.AddColumn(new IndexColumnInfo(OutWindowProxy.IndexPropertyName, StringUtil.Format(FormatAndOut_out_gridview.IndexColumnName), _index)); _headerInfo.AddColumn(new ToStringColumnInfo(OutWindowProxy.ToStringValuePropertyName, StringUtil.Format(FormatAndOut_out_gridview.ValueColumnName), _parentCmdlet)); _headerInfo.AddColumn(new TypeNameColumnInfo(OutWindowProxy.OriginalTypePropertyName, StringUtil.Format(FormatAndOut_out_gridview.TypeColumnName))); // Add columns to the underlying Management list and as a byproduct get a stale PSObject. PSObject staleObject = _headerInfo.AddColumnsToWindow(this, liveObject); // Add the stale PSObject to the underlying Management list. _graphicalHostReflectionWrapper.CallMethod("AddItem", staleObject); } private void AddExtraProperties(PSObject staleObject, PSObject liveObject) { // Add 3 extra properties, so that the stale PSObject has meaningful info in the Hetero-type header view. staleObject.Properties.Add(new PSNoteProperty(OutWindowProxy.IndexPropertyName, _index++)); staleObject.Properties.Add(new PSNoteProperty(OutWindowProxy.OriginalTypePropertyName, liveObject.BaseObject.GetType().FullName)); staleObject.Properties.Add(new PSNoteProperty(OutWindowProxy.OriginalObjectPropertyName, liveObject)); // Convert the LivePSObject to a string preserving PowerShell formatting. staleObject.Properties.Add(new PSNoteProperty(OutWindowProxy.ToStringValuePropertyName, _parentCmdlet.ConvertToString(liveObject))); } /// <summary> /// Adds an item to the out window. /// </summary> /// <param name="livePSObject"> /// The item to add. /// </param> internal void AddItem(PSObject livePSObject) { if (livePSObject == null) { throw new ArgumentNullException("livePSObject"); } if (_headerInfo == null) { throw new InvalidOperationException(); } PSObject stalePSObject = _headerInfo.CreateStalePSObject(livePSObject); // Add 3 extra properties, so that the stale PSObject has meaningful info in the Hetero-type header view. AddExtraProperties(stalePSObject, livePSObject); _graphicalHostReflectionWrapper.CallMethod("AddItem", stalePSObject); } /// <summary> /// Adds an item to the out window. /// </summary> /// <param name="livePSObject"> /// The item to add. /// </param> internal void AddHeteroViewItem(PSObject livePSObject) { if (livePSObject == null) { throw new ArgumentNullException("livePSObject"); } if (_headerInfo == null) { throw new InvalidOperationException(); } PSObject stalePSObject = _headerInfo.CreateStalePSObject(livePSObject); _graphicalHostReflectionWrapper.CallMethod("AddItem", stalePSObject); } /// <summary> /// Shows the out window if it has not already been displayed. /// </summary> internal void ShowWindow() { if (!_isWindowStarted) { _closedEvent = new AutoResetEvent(false); _graphicalHostReflectionWrapper.CallMethod("StartWindow", _title, _outputMode.ToString(), _closedEvent); _isWindowStarted = true; } } internal void BlockUntillClosed() { if (_closedEvent != null) { _closedEvent.WaitOne(); } } /// <summary> /// Implements IDisposable logic. /// </summary> /// <param name="isDisposing">True if being called from Dispose.</param> private void Dispose(bool isDisposing) { if (isDisposing) { if (_closedEvent != null) { _closedEvent.Dispose(); _closedEvent = null; } } } /// <summary> /// Dispose method in IDisposable. /// </summary> public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } /// <summary> /// Close the window if it has already been displayed. /// </summary> internal void CloseWindow() { if (_isWindowStarted) { _graphicalHostReflectionWrapper.CallMethod("CloseWindow"); _isWindowStarted = false; } } /// <summary> /// Gets a value indicating whether the out window is closed. /// </summary> /// <returns> /// True if the out window is closed, false otherwise. /// </returns> internal bool IsWindowClosed() { return (bool)_graphicalHostReflectionWrapper.CallMethod("GetWindowClosedStatus"); } /// <summary>Returns any exception that has been thrown by previous method calls.</summary> /// <returns>The thrown and caught exception. It returns null if no exceptions were thrown by any previous method calls.</returns> internal Exception GetLastException() { return (Exception)_graphicalHostReflectionWrapper.CallMethod("GetLastException"); } /// <summary> /// Return the selected item of the OutGridView. /// </summary> /// <returns> /// The selected item. /// </returns> internal List<PSObject> GetSelectedItems() { return (List<PSObject>)_graphicalHostReflectionWrapper.CallMethod("SelectedItems"); } } }
37.908795
168
0.605602
[ "MIT" ]
3pe2/PowerShell
src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutWindowProxy.cs
11,638
C#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeLens; using Microsoft.VisualStudio.Language.CodeLens; using Microsoft.VisualStudio.Language.CodeLens.Remoting; namespace Microsoft.VisualStudio.LanguageServices.CodeLens { /// <summary> /// Provide information related to VS/Roslyn to CodeLens OOP process /// </summary> internal interface ICodeLensContext { /// <summary> /// Get roslyn remote host's host group ID that is required for code lens OOP to connect roslyn remote host /// </summary> Task<string> GetHostGroupIdAsync(CancellationToken cancellationToken); /// <summary> /// Get [documentId.ProjectId.Id, documentId.Id] from given project guid and filePath /// /// we can only use types code lens OOP supports by default. otherwise, we need to define DTO types /// just to marshal between VS and Code lens OOP. /// </summary> List<Guid> GetDocumentId(Guid projectGuid, string filePath, CancellationToken cancellationToken); /// <summary> /// Get reference count of the given descriptor /// </summary> Task<ReferenceCount> GetReferenceCountAsync( CodeLensDescriptor descriptor, CodeLensDescriptorContext descriptorContext, CancellationToken cancellationToken); /// <summary> /// get reference location descriptor of the given descriptor /// </summary> Task<IEnumerable<ReferenceLocationDescriptor>> FindReferenceLocationsAsync( CodeLensDescriptor descriptor, CodeLensDescriptorContext descriptorContext, CancellationToken cancellationToken); /// <summary> /// Given a document and syntax node, returns a collection of locations of methods that refer to the located node. /// </summary> Task<IEnumerable<ReferenceMethodDescriptor>> FindReferenceMethodsAsync( CodeLensDescriptor descriptor, CodeLensDescriptorContext descriptorContext, CancellationToken cancellationToken); } }
45.66
161
0.715725
[ "Apache-2.0" ]
20chan/roslyn
src/VisualStudio/Core/Def/Implementation/CodeLens/ICodeLensContext.cs
2,285
C#
using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Adnc.Maint.Core.Entities; using Adnc.Core.Shared; namespace Adnc.Maint.Core.CoreServices { public interface IMaintManagerService : ICoreService { Task UpdateDicts(SysDict dict, List<SysDict> subDicts, CancellationToken cancellationToken = default); } }
26.357143
110
0.775068
[ "MIT" ]
JavaScript-zt/Adnc
src/ServerApi/Portal/Adnc.Maint/Adnc.Maint.Core/CoreServices/IMaintManagerService.cs
371
C#
using System; using System.Collections.Generic; using System.Linq; using Windows.Foundation.Collections; namespace IntegrationExample.Common { /// <summary> /// Implementation of IObservableMap that supports reentrancy for use as a default view /// model. /// </summary> public class ObservableDictionary : IObservableMap<string, object> { private class ObservableDictionaryChangedEventArgs : IMapChangedEventArgs<string> { public ObservableDictionaryChangedEventArgs(CollectionChange change, string key) { this.CollectionChange = change; this.Key = key; } public CollectionChange CollectionChange { get; private set; } public string Key { get; private set; } } private Dictionary<string, object> _dictionary = new Dictionary<string, object>(); public event MapChangedEventHandler<string, object> MapChanged; private void InvokeMapChanged(CollectionChange change, string key) { var eventHandler = MapChanged; if (eventHandler != null) { eventHandler(this, new ObservableDictionaryChangedEventArgs(change, key)); } } public void Add(string key, object value) { this._dictionary.Add(key, value); this.InvokeMapChanged(CollectionChange.ItemInserted, key); } public void Add(KeyValuePair<string, object> item) { this.Add(item.Key, item.Value); } public bool Remove(string key) { if (this._dictionary.Remove(key)) { this.InvokeMapChanged(CollectionChange.ItemRemoved, key); return true; } return false; } public bool Remove(KeyValuePair<string, object> item) { object currentValue; if (this._dictionary.TryGetValue(item.Key, out currentValue) && Object.Equals(item.Value, currentValue) && this._dictionary.Remove(item.Key)) { this.InvokeMapChanged(CollectionChange.ItemRemoved, item.Key); return true; } return false; } public object this[string key] { get { return this._dictionary[key]; } set { this._dictionary[key] = value; this.InvokeMapChanged(CollectionChange.ItemChanged, key); } } public void Clear() { var priorKeys = this._dictionary.Keys.ToArray(); this._dictionary.Clear(); foreach (var key in priorKeys) { this.InvokeMapChanged(CollectionChange.ItemRemoved, key); } } public ICollection<string> Keys { get { return this._dictionary.Keys; } } public bool ContainsKey(string key) { return this._dictionary.ContainsKey(key); } public bool TryGetValue(string key, out object value) { return this._dictionary.TryGetValue(key, out value); } public ICollection<object> Values { get { return this._dictionary.Values; } } public bool Contains(KeyValuePair<string, object> item) { return this._dictionary.Contains(item); } public int Count { get { return this._dictionary.Count; } } public bool IsReadOnly { get { return false; } } public IEnumerator<KeyValuePair<string, object>> GetEnumerator() { return this._dictionary.GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this._dictionary.GetEnumerator(); } public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex) { int arraySize = array.Length; foreach (var pair in this._dictionary) { if (arrayIndex >= arraySize) break; array[arrayIndex++] = pair; } } } }
29.946667
94
0.535396
[ "MIT" ]
JeremyLikness/WinRTExamples
WinRTByExample81/IntegrationExample/Common/ObservableDictionary.cs
4,494
C#
using System; namespace FileSystemAbstraction.Adapters.AzureBlobStorage { public static class AzureBlobStorageFileSystemExtensions { public static FileSystemBuilder AddAzureBlobStorage(this FileSystemBuilder builder, string scheme, Action<AzureBlobStorageFileSystemOptions> configureOptions) { //builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<AzureBlobStorageFileSystemOptions>, AzureBlobStorageFileSystemOptions.PostConfigureOptions>()); return builder.AddScheme<AzureBlobStorageFileSystemOptions, AzureBlobStorageFileSystemAdapter>(scheme, configureOptions); } public static FileSystemBuilder AddAzureBlobStorage(this FileSystemBuilder builder, Action<AzureBlobStorageFileSystemOptions> configureOptions) => builder.AddAzureBlobStorage(AzureBlobStorageFileSystemDefaults.DefaultScheme, configureOptions); public static FileSystemBuilder AddAzureBlobStorage(this FileSystemBuilder builder, string scheme, string containerName, string connectionString, bool detectContentType) { if (containerName == null) throw new ArgumentNullException(nameof(containerName)); if (connectionString == null) throw new ArgumentNullException(nameof(connectionString)); return builder.AddAzureBlobStorage(scheme, opt => { opt.ContainerName = containerName; opt.BobClientFactory = new AzureCloudBlobFactory(connectionString); opt.DetectContentType = detectContentType; }); } public static FileSystemBuilder AddAzureBlobStorage(this FileSystemBuilder builder, string scheme, string containerName, string connectionString) => builder.AddAzureBlobStorage(scheme, containerName, connectionString, detectContentType:true); public static FileSystemBuilder AddAzureBlobStorage(this FileSystemBuilder builder, string containerName, string connectionString, bool detectContentType) => builder.AddAzureBlobStorage(AzureBlobStorageFileSystemDefaults.DefaultScheme, containerName, connectionString, detectContentType); public static FileSystemBuilder AddAzureBlobStorage(this FileSystemBuilder builder, string containerName, string connectionString) => builder.AddAzureBlobStorage(AzureBlobStorageFileSystemDefaults.DefaultScheme, containerName, connectionString, detectContentType:true); } }
61.268293
193
0.763933
[ "MIT" ]
srigaux/FileSystemAbstraction
src/FileSystemAbstraction.Adapters.AzureBlobStorage/AzureBlobStorageFileSystemExtensions.cs
2,514
C#
namespace Example.RectangleOverlay { partial class Window { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.viewer = new Example.RectangleOverlay.Viewer(); this.SuspendLayout(); // // viewer // this.viewer.Dock = System.Windows.Forms.DockStyle.Fill; this.viewer.Location = new System.Drawing.Point(0, 0); this.viewer.Name = "viewer"; this.viewer.Size = new System.Drawing.Size(784, 562); this.viewer.TabIndex = 0; // // Window // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 562); this.Controls.Add(this.viewer); this.Name = "Window"; this.Text = "Vidview Example Rectangle Overlay"; this.ResumeLayout(false); } #endregion private Viewer viewer; } }
25.316667
101
0.676103
[ "BSD-2-Clause" ]
vidview/Example.RectangleOverlay
Example.RectangleOverlay/Window.Designer.cs
1,521
C#
//////////////////////////////////////////////////////////////////////////////// //NUnit tests for "EF Core Provider for LCPI OLE DB" // IBProvider and Contributors. 02.05.2021. using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using Microsoft.EntityFrameworkCore; using NUnit.Framework; using xdb=lcpi.data.oledb; namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Operators.SET_001.LessThan.Complete.Double.Int32{ //////////////////////////////////////////////////////////////////////////////// using T_DATA1 =System.Double; using T_DATA2 =System.Int32; using T_DATA1_U=System.Double; using T_DATA2_U=System.Int32; //////////////////////////////////////////////////////////////////////////////// //class TestSet_001__fields__01__VV public static class TestSet_001__fields__01__VV { private const string c_NameOf__TABLE ="TEST_MODIFY_ROW2"; private const string c_NameOf__COL_DATA1 ="COL_DOUBLE"; private const string c_NameOf__COL_DATA2 ="COL2_INTEGER"; private sealed class MyContext:TestBaseDbContext { [Table(c_NameOf__TABLE)] public sealed class TEST_RECORD { [Key] [Column("TEST_ID")] public System.Int64? TEST_ID { get; set; } [Column(c_NameOf__COL_DATA1)] public T_DATA1 COL_DATA1 { get; set; } [Column(c_NameOf__COL_DATA2)] public T_DATA2 COL_DATA2 { get; set; } };//class TEST_RECORD //---------------------------------------------------------------------- public DbSet<TEST_RECORD> testTable { get; set; } //---------------------------------------------------------------------- public MyContext(xdb.OleDbTransaction tr) :base(tr) { }//MyContext };//class MyContext //----------------------------------------------------------------------- [Test] public static void Test_001() { using(var cn=LocalCnHelper.CreateCn()) { cn.Open(); using(var tr=cn.BeginTransaction()) { //insert new record in external transaction using(var db=new MyContext(tr)) { const T_DATA1_U c_value1=3; const T_DATA2_U c_value2=4; System.Int64? testID=Helper__InsertRow(db,c_value1,c_value2); var recs=db.testTable.Where(r => (r.COL_DATA1 /*OP{*/ < /*}OP*/ r.COL_DATA2) && r.TEST_ID==testID); int nRecs=0; foreach(var r in recs) { Assert.AreEqual (0, nRecs); ++nRecs; Assert.IsTrue (r.TEST_ID.HasValue); Assert.AreEqual (testID, r.TEST_ID.Value); Assert.AreEqual (c_value1, r.COL_DATA1); Assert.AreEqual (c_value2, r.COL_DATA2); }//foreach r db.CheckTextOfLastExecutedCommand (new TestSqlTemplate() .T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL() .T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL() .T("WHERE (").N("t",c_NameOf__COL_DATA1).T(" < ").N_AS_DBL("t",c_NameOf__COL_DATA2).T(") AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")")); Assert.AreEqual (1, nRecs); }//using db tr.Rollback(); }//using tr }//using cn }//Test_001 //Helper methods -------------------------------------------------------- private static System.Int64 Helper__InsertRow(MyContext db, T_DATA1 valueForColData1, T_DATA2 valueForColData2) { var newRecord=new MyContext.TEST_RECORD(); newRecord.COL_DATA1 =valueForColData1; newRecord.COL_DATA2 =valueForColData2; db.testTable.Add(newRecord); db.SaveChanges(); db.CheckTextOfLastExecutedCommand (new TestSqlTemplate() .T("INSERT INTO ").N(c_NameOf__TABLE).T(" (").N(c_NameOf__COL_DATA1).T(", ").N(c_NameOf__COL_DATA2).T(")").EOL() .T("VALUES (").P("p0").T(", ").P("p1").T(")").EOL() .T("RETURNING ").N("TEST_ID").EOL() .T("INTO ").P("p2").T(";")); Assert.IsTrue (newRecord.TEST_ID.HasValue); Console.WriteLine("TEST_ID: {0}",newRecord.TEST_ID.Value); return newRecord.TEST_ID.Value; }//Helper__InsertRow };//class TestSet_001__fields__01__VV //////////////////////////////////////////////////////////////////////////////// }//namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Operators.SET_001.LessThan.Complete.Double.Int32
29.622517
158
0.563604
[ "MIT" ]
ibprovider/Lcpi.EFCore.LcpiOleDb
Tests/General/Source/Work/DBMS/Firebird/V03_0_0/D1/Query/Operators/SET_001/LessThan/Complete/Double/Int32/TestSet_001__fields__01__VV.cs
4,475
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Compute.V20210701 { public static class GetGalleryImage { /// <summary> /// Specifies information about the gallery image definition that you want to create or update. /// </summary> public static Task<GetGalleryImageResult> InvokeAsync(GetGalleryImageArgs args, InvokeOptions? options = null) => Pulumi.Deployment.Instance.InvokeAsync<GetGalleryImageResult>("azure-native:compute/v20210701:getGalleryImage", args ?? new GetGalleryImageArgs(), options.WithVersion()); } public sealed class GetGalleryImageArgs : Pulumi.InvokeArgs { /// <summary> /// The name of the gallery image definition to be retrieved. /// </summary> [Input("galleryImageName", required: true)] public string GalleryImageName { get; set; } = null!; /// <summary> /// The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. /// </summary> [Input("galleryName", required: true)] public string GalleryName { get; set; } = null!; /// <summary> /// The name of the resource group. /// </summary> [Input("resourceGroupName", required: true)] public string ResourceGroupName { get; set; } = null!; public GetGalleryImageArgs() { } } [OutputType] public sealed class GetGalleryImageResult { /// <summary> /// The description of this gallery image definition resource. This property is updatable. /// </summary> public readonly string? Description; /// <summary> /// Describes the disallowed disk types. /// </summary> public readonly Outputs.DisallowedResponse? Disallowed; /// <summary> /// The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. /// </summary> public readonly string? EndOfLifeDate; /// <summary> /// The Eula agreement for the gallery image definition. /// </summary> public readonly string? Eula; /// <summary> /// A list of gallery image features. /// </summary> public readonly ImmutableArray<Outputs.GalleryImageFeatureResponse> Features; /// <summary> /// The hypervisor generation of the Virtual Machine. Applicable to OS disks only. /// </summary> public readonly string? HyperVGeneration; /// <summary> /// Resource Id /// </summary> public readonly string Id; /// <summary> /// This is the gallery image definition identifier. /// </summary> public readonly Outputs.GalleryImageIdentifierResponse Identifier; /// <summary> /// Resource location /// </summary> public readonly string Location; /// <summary> /// Resource name /// </summary> public readonly string Name; /// <summary> /// This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. /// </summary> public readonly string OsState; /// <summary> /// This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux** /// </summary> public readonly string OsType; /// <summary> /// The privacy statement uri. /// </summary> public readonly string? PrivacyStatementUri; /// <summary> /// The provisioning state, which only appears in the response. /// </summary> public readonly string ProvisioningState; /// <summary> /// Describes the gallery image definition purchase plan. This is used by marketplace images. /// </summary> public readonly Outputs.ImagePurchasePlanResponse? PurchasePlan; /// <summary> /// The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. /// </summary> public readonly Outputs.RecommendedMachineConfigurationResponse? Recommended; /// <summary> /// The release note uri. /// </summary> public readonly string? ReleaseNoteUri; /// <summary> /// Resource tags /// </summary> public readonly ImmutableDictionary<string, string>? Tags; /// <summary> /// Resource type /// </summary> public readonly string Type; [OutputConstructor] private GetGalleryImageResult( string? description, Outputs.DisallowedResponse? disallowed, string? endOfLifeDate, string? eula, ImmutableArray<Outputs.GalleryImageFeatureResponse> features, string? hyperVGeneration, string id, Outputs.GalleryImageIdentifierResponse identifier, string location, string name, string osState, string osType, string? privacyStatementUri, string provisioningState, Outputs.ImagePurchasePlanResponse? purchasePlan, Outputs.RecommendedMachineConfigurationResponse? recommended, string? releaseNoteUri, ImmutableDictionary<string, string>? tags, string type) { Description = description; Disallowed = disallowed; EndOfLifeDate = endOfLifeDate; Eula = eula; Features = features; HyperVGeneration = hyperVGeneration; Id = id; Identifier = identifier; Location = location; Name = name; OsState = osState; OsType = osType; PrivacyStatementUri = privacyStatementUri; ProvisioningState = provisioningState; PurchasePlan = purchasePlan; Recommended = recommended; ReleaseNoteUri = releaseNoteUri; Tags = tags; Type = type; } } }
35.021053
242
0.605651
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Compute/V20210701/GetGalleryImage.cs
6,654
C#
using System.Collections.Generic; using System.Threading.Tasks; using Abp.Application.Services; using Abp.Application.Services.Dto; using Abp.Domain.Repositories; using iProof.Authorization; using iProof.Authorization.Users; using iProof.Users.Dto; using Microsoft.AspNetCore.Identity; using System.Linq; using Abp.Collections.Extensions; using Microsoft.EntityFrameworkCore; using Abp.IdentityFramework; using iProof.Authorization.Roles; using iProof.Roles.Dto; namespace iProof.Users { public class UserAppService : AsyncCrudAppService<User, UserDto, long, PagedResultRequestDto, CreateUserDto, UserDto>, IUserAppService { private readonly UserManager _userManager; private readonly IPasswordHasher<User> _passwordHasher; private readonly IRepository<Role> _roleRepository; public UserAppService(IRepository<User, long> repository, UserManager userManager, IPasswordHasher<User> passwordHasher, IRepository<Role> roleRepository) : base(repository) { _userManager = userManager; _passwordHasher = passwordHasher; _roleRepository = roleRepository; CreatePermissionName = GetAllPermissionName = GetPermissionName = UpdatePermissionName = DeletePermissionName = PermissionNames.Pages_Users; } public override async Task<UserDto> Create(CreateUserDto input) { CheckCreatePermission(); var user = ObjectMapper.Map<User>(input); user.TenantId = AbpSession.TenantId; user.Password = _passwordHasher.HashPassword(user, input.Password); user.IsEmailConfirmed = true; CheckErrors(await _userManager.CreateAsync(user)); if (input.Roles != null) { CheckErrors(await _userManager.SetRoles(user, input.Roles)); } CurrentUnitOfWork.SaveChanges(); return MapToEntityDto(user); } public override async Task<UserDto> Update(UserDto input) { CheckUpdatePermission(); var user = await _userManager.GetUserByIdAsync(input.Id); MapToEntity(input, user); CheckErrors(await _userManager.UpdateAsync(user)); if (input.Roles != null) { CheckErrors(await _userManager.SetRoles(user, input.Roles)); } return await Get(input); } public override async Task Delete(EntityDto<long> input) { var user = await _userManager.GetUserByIdAsync(input.Id); await _userManager.DeleteAsync(user); } public async Task<ListResultDto<RoleDto>> GetRoles() { var roles = await _roleRepository.GetAllListAsync(); return new ListResultDto<RoleDto>(ObjectMapper.Map<List<RoleDto>>(roles)); } protected override User MapToEntity(CreateUserDto createInput) { var user = ObjectMapper.Map<User>(createInput); user.SetNormalizedNames(); return user; } protected override void MapToEntity(UserDto input, User user) { ObjectMapper.Map(input, user); user.SetNormalizedNames(); } protected override IQueryable<User> CreateFilteredQuery(PagedResultRequestDto input) { return Repository.GetAllIncluding(x => x.Roles); } protected override async Task<User> GetEntityByIdAsync(long id) { return await Repository.GetAllIncluding(x => x.Roles).FirstOrDefaultAsync(x => x.Id == id); } protected override IQueryable<User> ApplySorting(IQueryable<User> query, PagedResultRequestDto input) { return query.OrderBy(r => r.UserName); } protected virtual void CheckErrors(IdentityResult identityResult) { identityResult.CheckErrors(LocalizationManager); } } }
32.552
162
0.638978
[ "MIT" ]
bquadre/iProof
aspnet-core/src/iProof.Application/Users/UserAppService.cs
4,069
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.ContractsLight; using System.Linq; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using BuildXL.Cache.ContentStore.Hashing; using BuildXL.Engine.Cache.Artifacts; using BuildXL.Native.IO; using BuildXL.Pips; using BuildXL.Pips.Artifacts; using BuildXL.Pips.Operations; using BuildXL.Processes; using BuildXL.Scheduler.Fingerprints; using BuildXL.Scheduler.Tracing; using BuildXL.Storage; using BuildXL.Storage.ChangeTracking; using BuildXL.Tracing; using BuildXL.Utilities; using BuildXL.Utilities.Collections; using BuildXL.Utilities.Configuration; using BuildXL.Utilities.Instrumentation.Common; using BuildXL.Utilities.Tasks; using BuildXL.Utilities.Tracing; using static BuildXL.Utilities.FormattableStringEx; using Logger = BuildXL.Scheduler.Tracing.Logger; namespace BuildXL.Scheduler.Artifacts { /// <summary> /// This class tracks content hashes and materialization state of files allowing /// managing hashing and materialization of pip inputs and outputs. As pips run /// they report content (potentially not materialized). Later pips may request materialization /// of inputs whose content must have been reported by an earlier operation (either through /// <see cref="ReportOutputContent"/>, <see cref="ReportInputContent"/>, <see cref="TryHashDependenciesAsync"/>, /// or <see cref="TryHashOutputsAsync"/>. /// /// Reporting: /// * <see cref="ReportOutputContent"/> is used to report the output content of all pips except hash source file /// * <see cref="ReportDynamicDirectoryContents"/> is used to report the files produced into dynamic output directories /// * <see cref="TryHashOutputsAsync"/> is used to report content for the hash source file pip or during incremental scheduling. /// * <see cref="TryHashDependenciesAsync"/> is used to report content for inputs prior to running/cache lookup. /// * <see cref="ReportInputContent"/> is used to report the content of inputs (distributed workers only since prerequisite pips /// will run on the worker and report output content) /// /// Querying: /// * <see cref="GetInputContent"/> retrieves hash of reported content /// * <see cref="TryQuerySealedOrUndeclaredInputContentAsync"/> gets the hash of the input file inside a sealed directory or a file that /// is outside any declared containers, but allowed undeclared reads are on. /// This may entail hashing the file. /// * <see cref="ListSealedDirectoryContents"/> gets the files inside a sealed directory (including dynamic directories which /// have been reported via <see cref="ReportDynamicDirectoryContents"/>. /// /// Materialization: /// At a high level materialization has the following workflow /// * Get files/directories to materialize /// * Delete materialized output directories /// * Delete files required to be absent (reported with absent file hash) /// * Pin hashes of existent files in the cache /// * Place existent files from cache /// </summary> [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] public sealed class FileContentManager : IQueryableFileContentManager { private const int MAX_SYMLINK_TRAVERSALS = 100; private readonly ITempDirectoryCleaner m_tempDirectoryCleaner; #region Internal State /// <summary> /// Cached completed pip output origin tasks /// </summary> private readonly ReadOnlyArray<Task<PipOutputOrigin>> m_originTasks = ReadOnlyArray<Task<PipOutputOrigin>>.From(EnumTraits<PipOutputOrigin>.EnumerateValues() .Select(origin => Task.FromResult(origin))); private static readonly Task<FileMaterializationInfo?> s_placeHolderFileHashTask = Task.FromResult<FileMaterializationInfo?>(null); /// <summary> /// Statistics for file content operations /// </summary> private FileContentStats m_stats; /// <summary> /// Gets the current file content stats /// </summary> public FileContentStats FileContentStats => m_stats; /// <summary> /// Dictionary of number of cache content hits by cache name. /// </summary> private readonly ConcurrentDictionary<string, int> m_cacheContentSource = new ConcurrentDictionary<string, int>(); // Semaphore to limit concurrency for cache IO calls private readonly SemaphoreSlim m_materializationSemaphore = new SemaphoreSlim(EngineEnvironmentSettings.MaterializationConcurrency); /// <summary> /// Pending materializations /// </summary> private readonly ConcurrentBigMap<FileArtifact, Task<PipOutputOrigin>> m_materializationTasks = new ConcurrentBigMap<FileArtifact, Task<PipOutputOrigin>>(); /// <summary> /// Map of deletion tasks for materialized directories /// </summary> private readonly ConcurrentBigMap<DirectoryArtifact, Task<bool>> m_dynamicDirectoryDeletionTasks = new ConcurrentBigMap<DirectoryArtifact, Task<bool>>(); /// <summary> /// The directories which have already been materialized /// </summary> private readonly ConcurrentBigSet<DirectoryArtifact> m_materializedDirectories = new ConcurrentBigSet<DirectoryArtifact>(); /// <summary> /// File hashing tasks for tracking completion of hashing. Entries here are transient and only used to ensure /// a file is hashed only once /// </summary> private readonly ConcurrentBigMap<FileArtifact, Task<FileMaterializationInfo?>> m_fileArtifactHashTasks = new ConcurrentBigMap<FileArtifact, Task<FileMaterializationInfo?>>(); /// <summary> /// The contents of dynamic output directories /// </summary> private readonly ConcurrentBigMap<DirectoryArtifact, SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer>> m_sealContents = new ConcurrentBigMap<DirectoryArtifact, SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer>>(); /// <summary> /// Current materializations for files by their path. Allows ensuring that latest rewrite count is the only file materialized /// </summary> private readonly ConcurrentBigMap<AbsolutePath, FileArtifact> m_currentlyMaterializingFilesByPath = new ConcurrentBigMap<AbsolutePath, FileArtifact>(); /// <summary> /// All the sealed files for registered sealed directories. Maps the sealed path to the file artifact which was sealed. We always seal at a /// particular rewrite count. /// </summary> private readonly ConcurrentBigMap<AbsolutePath, FileArtifact> m_sealedFiles = new ConcurrentBigMap<AbsolutePath, FileArtifact>(); /// <summary> /// The registered seal directories (all the files in the directory should be in <see cref="m_sealedFiles"/> unless it is a sealed source directory /// </summary> private readonly ConcurrentBigSet<DirectoryArtifact> m_registeredSealDirectories = new ConcurrentBigSet<DirectoryArtifact>(); /// <summary> /// Maps paths to the corresponding seal source directory artifact /// </summary> private readonly ConcurrentBigMap<AbsolutePath, DirectoryArtifact> m_sealedSourceDirectories = new ConcurrentBigMap<AbsolutePath, DirectoryArtifact>(); /// <summary> /// Pool of artifact state objects contain state used during hashing and materialization operations /// </summary> private readonly ConcurrentQueue<PipArtifactsState> m_statePool = new ConcurrentQueue<PipArtifactsState>(); /// <summary> /// Content hashes for source and output artifacts. Source artifacts have content hashes that are known statically, /// whereas output artifacts have hashes that are determined by tool execution (including cached execution). /// </summary> private readonly ConcurrentBigMap<FileArtifact, FileMaterializationInfo> m_fileArtifactContentHashes = new ConcurrentBigMap<FileArtifact, FileMaterializationInfo>(); /// <summary> /// The distinct content used during the build and associated hashes. A <see cref="ContentId"/> represents /// a pairing of file and hash (via an index into <see cref="m_fileArtifactContentHashes"/>). In this set, the hash is used as the key. /// </summary> private readonly ConcurrentBigSet<ContentId> m_allCacheContentHashes = new ConcurrentBigSet<ContentId>(); /// <summary> /// Set of paths for which <see cref="TryQueryContentAsync"/> was called which were determined to be a directory /// </summary> private readonly ConcurrentBigSet<AbsolutePath> m_contentQueriedDirectoryPaths = new ConcurrentBigSet<AbsolutePath>(); /// <summary> /// Maps files in registered dynamic output directories to the corresponding dynamic output directory artifact /// </summary> private readonly ConcurrentBigMap<FileArtifact, DirectoryArtifact> m_dynamicOutputFileDirectories = new ConcurrentBigMap<FileArtifact, DirectoryArtifact>(); /// <summary> /// Symlink definitions. /// </summary> private readonly SymlinkDefinitions m_symlinkDefinitions; /// <summary> /// Flag indicating if symlink should be created lazily. /// </summary> private bool LazySymlinkCreation => m_host.Configuration.Schedule.UnsafeLazySymlinkCreation && m_symlinkDefinitions != null; #endregion #region External State (i.e. passed into constructor) private PipExecutionContext Context => m_host.Context; private SemanticPathExpander SemanticPathExpander => m_host.SemanticPathExpander; private LocalDiskContentStore LocalDiskContentStore => m_host.LocalDiskContentStore; private IArtifactContentCache ArtifactContentCache { get; } private IConfiguration Configuration => m_host.Configuration; private IExecutionLogTarget ExecutionLog => m_host.ExecutionLog; private IOperationTracker OperationTracker { get; } private readonly FlaggedHierarchicalNameDictionary<Unit> m_outputMaterializationExclusionMap; private ILocalDiskFileSystemExistenceView m_localDiskFileSystemView; private ILocalDiskFileSystemExistenceView LocalDiskFileSystemView => m_localDiskFileSystemView ?? LocalDiskContentStore; /// <summary> /// The host for getting data about pips /// </summary> private readonly IFileContentManagerHost m_host; // TODO: Enable or remove this functionality (i.e. materializing source file in addition to pip outputs // on distributed build workers) private bool SourceFileMaterializationEnabled => Configuration.Distribution.EnableSourceFileMaterialization; private bool IsDistributedWorker => Configuration.Distribution.BuildRole == DistributedBuildRoles.Worker; /// <summary> /// Unit tests only. Used to suppress warnings which are not considered by unit tests /// when hashing source files /// </summary> internal bool TrackFilesUnderInvalidMountsForTests = false; private static readonly SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer> s_emptySealContents = SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer>.CloneAndSort(new FileArtifact[0], OrdinalFileArtifactComparer.Instance); #endregion /// <summary> /// Creates a new file content manager with the specified host for providing /// auxillary data /// </summary> public FileContentManager( IFileContentManagerHost host, IOperationTracker operationTracker, SymlinkDefinitions symlinkDefinitions = null, ITempDirectoryCleaner tempDirectoryCleaner = null) { m_host = host; ArtifactContentCache = new ElidingArtifactContentCacheWrapper(host.ArtifactContentCache); OperationTracker = operationTracker; m_symlinkDefinitions = symlinkDefinitions; m_tempDirectoryCleaner = tempDirectoryCleaner; m_outputMaterializationExclusionMap = new FlaggedHierarchicalNameDictionary<Unit>(host.Context.PathTable, HierarchicalNameTable.NameFlags.Root); foreach (var outputMaterializationExclusionRoot in host.Configuration.Schedule.OutputMaterializationExclusionRoots) { m_outputMaterializationExclusionMap.TryAdd(outputMaterializationExclusionRoot.Value, Unit.Void); } } /// <summary> /// Sets local file system observer /// </summary> internal void SetLocalDiskFileSystemExistenceView(ILocalDiskFileSystemExistenceView localDiskFileSystem) { Contract.Requires(localDiskFileSystem != null); m_localDiskFileSystemView = localDiskFileSystem; } /// <summary> /// Registers the completion of a seal directory pip /// </summary> public void RegisterStaticDirectory(DirectoryArtifact artifact) { RegisterDirectoryContents(artifact); } /// <summary> /// Records the hash of an input of the pip. All static inputs must be reported, even those that were already up-to-date. /// </summary> public bool ReportWorkerPipInputContent(LoggingContext loggingContext, FileArtifact artifact, in FileMaterializationInfo info) { Contract.Assert(IsDistributedWorker); SetFileArtifactContentHashResult result = SetFileArtifactContentHash(artifact, info, PipOutputOrigin.NotMaterialized); // Notify the host with content that was reported m_host.ReportContent(artifact, info, PipOutputOrigin.NotMaterialized); if (result == SetFileArtifactContentHashResult.HasConflictingExistingEntry) { var existingInfo = m_fileArtifactContentHashes[artifact]; // File was already hashed (i.e. seal directory input) prior to this pip which has the explicit input. // Report the content mismatch and fail. ReportWorkerContentMismatch( loggingContext, Context.PathTable, artifact, expectedHash: info.Hash, actualHash: existingInfo.Hash); return false; } return true; } /// <summary> /// Records the hash of an input of the pip. All static inputs must be reported, even those that were already up-to-date. /// </summary> public void ReportInputContent(FileArtifact artifact, in FileMaterializationInfo info) { ReportContent(artifact, info, PipOutputOrigin.NotMaterialized); } /// <summary> /// Records the hash of an output of the pip. All static outputs must be reported, even those that were already up-to-date. /// </summary> public void ReportOutputContent( OperationContext operationContext, string pipDescription, FileArtifact artifact, in FileMaterializationInfo info, PipOutputOrigin origin, bool doubleWriteErrorsAreWarnings = false) { Contract.Requires(artifact.IsOutputFile); if (ReportContent(artifact, info, origin, doubleWriteErrorsAreWarnings)) { if (origin != PipOutputOrigin.NotMaterialized && artifact.IsOutputFile) { LogOutputOrigin(operationContext, pipDescription, artifact.Path.ToString(Context.PathTable), info, origin); } } } /// <summary> /// Ensures pip source inputs are hashed /// </summary> public async Task<Possible<Unit>> TryHashSourceDependenciesAsync(Pip pip, OperationContext operationContext) { using (PipArtifactsState state = GetPipArtifactsState()) { // Get inputs PopulateDependencies(pip, state.PipArtifacts, includeLazyInputs: true, onlySourceFiles: true); var maybeInputsHashed = await TryHashFileArtifactsAsync(state, operationContext, pip.ProcessAllowsUndeclaredSourceReads); if (!maybeInputsHashed.Succeeded) { return maybeInputsHashed.Failure; } return maybeInputsHashed; } } /// <summary> /// Ensures pip inputs are hashed /// </summary> public async Task<Possible<Unit>> TryHashDependenciesAsync(Pip pip, OperationContext operationContext) { // If force skip dependencies then try to hash the files. How does this work with lazy materialization? Or distributed build? // Probably assume dependencies are materialized if force skip dependencies is enabled using (PipArtifactsState state = GetPipArtifactsState()) { // Get inputs PopulateDependencies(pip, state.PipArtifacts, includeLazyInputs: true); // In case of dirty build, we need to hash the seal contents without relying on consumers of seal contents. SealDirectory sealDirectory = pip as SealDirectory; if (sealDirectory != null) { foreach (var input in sealDirectory.Contents) { state.PipArtifacts.Add(FileOrDirectoryArtifact.Create(input)); } } return await TryHashArtifacts(operationContext, state, pip.ProcessAllowsUndeclaredSourceReads); } } /// <summary> /// Ensures pip outputs are hashed /// </summary> public async Task<Possible<Unit>> TryHashOutputsAsync(Pip pip, OperationContext operationContext) { using (PipArtifactsState state = GetPipArtifactsState()) { // Get outputs PopulateOutputs(pip, state.PipArtifacts); // If running TryHashOutputs, the pip's outputs are assumed to be materialized // Mark directory artifacts as materialized so we don't try to materialize them later // NOTE: We don't hash the contents of the directory because they will be hashed lazily // by consumers of the seal directory MarkDirectoryMaterializations(state); return await TryHashArtifacts(operationContext, state, pip.ProcessAllowsUndeclaredSourceReads); } } private async Task<Possible<Unit>> TryHashArtifacts(OperationContext operationContext, PipArtifactsState state, bool allowUndeclaredSourceReads) { var maybeReported = EnumerateAndReportDynamicOutputDirectories(state.PipArtifacts); if (!maybeReported.Succeeded) { return maybeReported.Failure; } // Register the seal file contents of the directory dependencies RegisterDirectoryContents(state.PipArtifacts); // Hash inputs if necessary var maybeInputsHashed = await TryHashFileArtifactsAsync(state, operationContext, allowUndeclaredSourceReads); if (!maybeInputsHashed.Succeeded) { return maybeInputsHashed.Failure; } return Unit.Void; } /// <summary> /// Ensures pip directory inputs are registered with file content manager /// </summary> public void RegisterDirectoryDependencies(Pip pip) { using (PipArtifactsState state = GetPipArtifactsState()) { // Get inputs PopulateDependencies(pip, state.PipArtifacts); // Register the seal file contents of the directory dependencies RegisterDirectoryContents(state.PipArtifacts); } } /// <summary> /// Ensures pip inputs are materialized /// </summary> public async Task<bool> TryMaterializeDependenciesAsync(Pip pip, OperationContext operationContext) { using (PipArtifactsState state = GetPipArtifactsState()) { // Get inputs PopulateDependencies(pip, state.PipArtifacts); // Register the seal file contents of the directory dependencies RegisterDirectoryContents(state.PipArtifacts); // Materialize inputs var result = await TryMaterializeArtifactsCore(new PipInfo(pip, Context), operationContext, state, materializatingOutputs: false, isDeclaredProducer: false); Contract.Assert(result != ArtifactMaterializationResult.None); switch (result) { case ArtifactMaterializationResult.Succeeded: return true; case ArtifactMaterializationResult.PlaceFileFailed: Logger.Log.PipMaterializeDependenciesFromCacheFailure( operationContext, pip.GetDescription(Context), state.GetFailure().DescribeIncludingInnerFailures()); return false; default: // Catch-all error for non-cache dependency materialization failures Logger.Log.PipMaterializeDependenciesFailureUnrelatedToCache( operationContext, pip.GetDescription(Context), result.ToString(), state.GetFailure().DescribeIncludingInnerFailures()); return false; } } } /// <summary> /// Ensures pip outputs are materialized /// </summary> public async Task<Possible<PipOutputOrigin>> TryMaterializeOutputsAsync(Pip pip, OperationContext operationContext) { using (PipArtifactsState state = GetPipArtifactsState()) { bool hasExcludedOutput = false; // Get outputs PopulateOutputs(pip, state.PipArtifacts, exclude: output => { if (m_outputMaterializationExclusionMap.TryGetFirstMapping(output.Path.Value, out var mapping)) { hasExcludedOutput = true; return true; } return false; }); // Register the seal file contents of the directory dependencies RegisterDirectoryContents(state.PipArtifacts); // Materialize outputs var result = await TryMaterializeArtifactsCore(new PipInfo(pip, Context), operationContext, state, materializatingOutputs: true, isDeclaredProducer: true); if (result != ArtifactMaterializationResult.Succeeded) { return state.GetFailure(); } if (hasExcludedOutput) { return PipOutputOrigin.NotMaterialized; } // NotMaterialized means the files were materialized by some other operation // Normalize this to DeployedFromCache because the outputs are materialized return state.OverallOutputOrigin == PipOutputOrigin.NotMaterialized ? PipOutputOrigin.DeployedFromCache : state.OverallOutputOrigin; } } /// <summary> /// Attempts to load the output content for the pip to ensure it is available for materialization /// </summary> public async Task<bool> TryLoadAvailableOutputContentAsync( PipInfo pipInfo, OperationContext operationContext, IReadOnlyList<(FileArtifact fileArtifact, ContentHash contentHash)> filesAndContentHashes, Action onFailure = null, Action<int, string> onContentUnavailable = null, bool materialize = false) { Logger.Log.ScheduleTryBringContentToLocalCache(operationContext, pipInfo.Description); Interlocked.Increment(ref m_stats.TryBringContentToLocalCache); if (!materialize) { var result = await TryLoadAvailableContentAsync( operationContext, pipInfo, materializingOutputs: true, // Only failures matter since we are checking a cache entry and not actually materializing onlyLogUnavailableContent: true, filesAndContentHashes: filesAndContentHashes.SelectList((tuple, index) => (tuple.fileArtifact, tuple.contentHash, index)), onFailure: failure => { onFailure?.Invoke(); }, onContentUnavailable: onContentUnavailable ?? ((index, hashLogStr) => { /* Do nothing. Callee already logs the failure */ })); return result; } else { using (var state = GetPipArtifactsState()) { state.VerifyMaterializationOnly = true; foreach (var fileAndContentHash in filesAndContentHashes) { FileArtifact file = fileAndContentHash.fileArtifact; ContentHash hash = fileAndContentHash.contentHash; state.PipInfo = pipInfo; state.AddMaterializationFile( fileToMaterialize: file, allowReadOnly: true, materializationInfo: FileMaterializationInfo.CreateWithUnknownLength(hash), materializationCompletion: TaskSourceSlim.Create<PipOutputOrigin>(), symlinkTarget: AbsolutePath.Invalid); } return await PlaceFilesAsync(operationContext, pipInfo, state, materialize: true); } } } /// <summary> /// Reports the contents of an output directory /// </summary> public void ReportDynamicDirectoryContents(DirectoryArtifact directoryArtifact, IEnumerable<FileArtifact> contents, PipOutputOrigin outputOrigin) { m_sealContents.GetOrAdd(directoryArtifact, contents, (key, contents2) => SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer>.CloneAndSort(contents2, OrdinalFileArtifactComparer.Instance)); RegisterDirectoryContents(directoryArtifact); if (outputOrigin != PipOutputOrigin.NotMaterialized) { // Mark directory as materialized and ensure no deletions for the directory m_dynamicDirectoryDeletionTasks.TryAdd(directoryArtifact, BoolTask.True); MarkDirectoryMaterialization(directoryArtifact); } } /// <summary> /// Enumerates dynamic output directory. /// </summary> public Possible<Unit> EnumerateDynamicOutputDirectory( DirectoryArtifact directoryArtifact, Action<FileArtifact> handleFile, Action<AbsolutePath> handleDirectory) { Contract.Requires(directoryArtifact.IsValid); var pathTable = Context.PathTable; var directoryPath = directoryArtifact.Path; var queue = new Queue<AbsolutePath>(); queue.Enqueue(directoryPath); while (queue.Count > 0) { var currentDirectoryPath = queue.Dequeue(); var result = m_host.LocalDiskContentStore.TryEnumerateDirectoryAndTrackMembership( currentDirectoryPath, handleEntry: (entry, attributes) => { var path = currentDirectoryPath.Combine(pathTable, entry); // must treat directory symlinks as files: recursing on directory symlinks can lean to infinite loops if (!FileUtilities.IsDirectoryNoFollow(attributes)) { var fileArtifact = FileArtifact.CreateOutputFile(path); handleFile?.Invoke(fileArtifact); } else { handleDirectory?.Invoke(path); queue.Enqueue(path); } }); if (!result.Succeeded) { return result.Failure; } } return Unit.Void; } /// <summary> /// Lists the contents of a sealed directory (static or dynamic). /// </summary> public SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer> ListSealedDirectoryContents(DirectoryArtifact directoryArtifact) { SortedReadOnlyArray<FileArtifact, OrdinalFileArtifactComparer> contents; var sealDirectoryKind = m_host.GetSealDirectoryKind(directoryArtifact); if (sealDirectoryKind.IsDynamicKind()) { // If sealContents does not have the dynamic directory, then the dynamic directory has no content and it is produced by another worker. return m_sealContents.TryGetValue(directoryArtifact, out contents) ? contents : s_emptySealContents; } if (!m_sealContents.TryGetValue(directoryArtifact, out contents)) { // Load and cache contents from host contents = m_host.ListSealDirectoryContents(directoryArtifact); m_sealContents.TryAdd(directoryArtifact, contents); } return contents; } /// <summary> /// Gets the pip inputs including all direct file dependencies and output file seal directory file dependencies. /// </summary> public void CollectPipInputsToMaterialize( PipTable pipTable, Pip pip, HashSet<FileArtifact> files, MultiValueDictionary<FileArtifact, DirectoryArtifact> dynamicInputs = null, Func<FileOrDirectoryArtifact, bool> filter = null, Func<PipId, bool> serviceFilter = null) { CollectPipFilesToMaterialize( isMaterializingInputs: true, pipTable: pipTable, pip: pip, files: files, dynamicFileMap: dynamicInputs, shouldInclude: filter, shouldIncludeServiceFiles: serviceFilter); } /// <summary> /// Gets the pip outputs /// </summary> public void CollectPipOutputsToMaterialize( PipTable pipTable, Pip pip, HashSet<FileArtifact> files, MultiValueDictionary<FileArtifact, DirectoryArtifact> dynamicOutputs = null, Func<FileOrDirectoryArtifact, bool> shouldInclude = null) { CollectPipFilesToMaterialize( isMaterializingInputs: false, pipTable: pipTable, pip: pip, files: files, dynamicFileMap: dynamicOutputs, shouldInclude: shouldInclude); } /// <summary> /// Gets the pip inputs or outputs /// </summary> public void CollectPipFilesToMaterialize( bool isMaterializingInputs, PipTable pipTable, Pip pip, HashSet<FileArtifact> files = null, MultiValueDictionary<FileArtifact, DirectoryArtifact> dynamicFileMap = null, Func<FileOrDirectoryArtifact, bool> shouldInclude = null, Func<PipId, bool> shouldIncludeServiceFiles = null) { // Always include if no filter specified shouldInclude = shouldInclude ?? (a => true); shouldIncludeServiceFiles = shouldIncludeServiceFiles ?? (a => true); using (PipArtifactsState state = GetPipArtifactsState()) { if (isMaterializingInputs) { // Get inputs PopulateDependencies(pip, state.PipArtifacts, includeLazyInputs: true); } else { PopulateOutputs(pip, state.PipArtifacts); } foreach (var artifact in state.PipArtifacts) { if (!shouldInclude(artifact)) { continue; } if (artifact.IsDirectory) { DirectoryArtifact directory = artifact.DirectoryArtifact; SealDirectoryKind sealDirectoryKind = m_host.GetSealDirectoryKind(directory); foreach (var file in ListSealedDirectoryContents(directory)) { if (sealDirectoryKind.IsDynamicKind()) { dynamicFileMap?.Add(file, directory); } if (file.IsOutputFile || SourceFileMaterializationEnabled) { if (!shouldInclude(file)) { continue; } files?.Add(file); } } } else { files?.Add(artifact.FileArtifact); } } } if (isMaterializingInputs) { // For the IPC pips, we need to collect the inputs of their service dependencies as well. if (pip.PipType == PipType.Ipc) { var ipc = (IpcPip)pip; foreach (var servicePipId in ipc.ServicePipDependencies) { if (!shouldIncludeServiceFiles(servicePipId)) { continue; } var servicePip = pipTable.HydratePip(servicePipId, PipQueryContext.CollectPipInputsToMaterializeForIPC); CollectPipInputsToMaterialize(pipTable, servicePip, files, dynamicFileMap, filter: shouldInclude); } } } } /// <summary> /// Attempts to the symlink target if registered /// </summary> public AbsolutePath TryGetRegisteredSymlinkFinalTarget(AbsolutePath symlink) { if (m_symlinkDefinitions == null) { return AbsolutePath.Invalid; } AbsolutePath symlinkTarget = symlink; for (int i = 0; i < MAX_SYMLINK_TRAVERSALS; i++) { var next = m_symlinkDefinitions.TryGetSymlinkTarget(symlinkTarget); if (next.IsValid) { symlinkTarget = next; } else { return symlinkTarget == symlink ? AbsolutePath.Invalid : symlinkTarget; } } // Symlink chain is too long List<AbsolutePath> symlinkChain = new List<AbsolutePath>(); symlinkTarget = symlink; for (int i = 0; i < MAX_SYMLINK_TRAVERSALS; i++) { symlinkChain.Add(symlinkTarget); symlinkTarget = m_symlinkDefinitions.TryGetSymlinkTarget(symlinkTarget); } throw new BuildXLException(I( $"Registered symlink chain exceeds max length of {MAX_SYMLINK_TRAVERSALS}: {string.Join("->" + Environment.NewLine, symlinkChain)}")); } /// <summary> /// Reports an unexpected access which the file content manager can check to verify that access is safe with respect to lazy /// symlink creation /// </summary> internal void ReportUnexpectedSymlinkAccess(LoggingContext loggingContext, string pipDescription, AbsolutePath path, ObservedInputType observedInputType, CompactSet<ReportedFileAccess> reportedAccesses) { if (TryGetSymlinkPathKind(path, out var symlinkPathKind)) { using (var toolPathSetWrapper = Pools.StringSetPool.GetInstance()) using (var toolFileNameSetWrapper = Pools.StringSetPool.GetInstance()) { var toolPathSet = toolPathSetWrapper.Instance; var toolFileNameSet = toolFileNameSetWrapper.Instance; foreach (var reportedAccess in reportedAccesses) { if (!string.IsNullOrEmpty(reportedAccess.Process.Path)) { if (toolPathSet.Add(reportedAccess.Process.Path)) { AbsolutePath toolPath; if (AbsolutePath.TryCreate(Context.PathTable, reportedAccess.Process.Path, out toolPath)) { toolFileNameSet.Add(toolPath.GetName(Context.PathTable).ToString(Context.StringTable)); } } } } Logger.Log.UnexpectedAccessOnSymlinkPath( pipDescription: pipDescription, context: loggingContext, path: path.ToString(Context.PathTable), pathKind: symlinkPathKind, inputType: observedInputType.ToString(), tools: string.Join(", ", toolFileNameSet)); } } } internal bool TryGetSymlinkPathKind(AbsolutePath path, out string kind) { kind = null; if (m_symlinkDefinitions == null) { return false; } if (m_symlinkDefinitions.IsSymlink(path)) { kind = "file"; } else if (m_symlinkDefinitions.HasNestedSymlinks(path)) { kind = "directory"; } return kind != null; } /// <summary> /// Gets the updated semantic path information for the given path with data from the file content manager /// </summary> internal SemanticPathInfo GetUpdatedSemanticPathInfo(in SemanticPathInfo mountInfo) { if (mountInfo.IsValid && LazySymlinkCreation && m_symlinkDefinitions.HasNestedSymlinks(mountInfo.Root)) { // Rewrite the semantic path info to indicate that the mount has potential build outputs return new SemanticPathInfo(mountInfo.RootName, mountInfo.Root, mountInfo.Flags | SemanticPathFlags.HasPotentialBuildOutputs); } return mountInfo; } /// <summary> /// Gets whether the given directory has potential outputs of the build /// </summary> public bool HasPotentialBuildOutputs(AbsolutePath directoryPath, in SemanticPathInfo mountInfo, bool isReadOnlyDirectory) { // If (1) the directory is writeable, or (2) the directory contains symlinks, that may have not been created, then use the graph enumeration. return (mountInfo.IsWritable && !isReadOnlyDirectory) || (LazySymlinkCreation && m_symlinkDefinitions.DirectoryContainsSymlink(directoryPath)); } /// <summary> /// For a given path (which must be one of the pip's input artifacts; not an output), returns a content hash if: /// - that path has been 'sealed' (i.e., is under a sealed directory) . Since a sealed directory never changes, the path is un-versioned /// (unlike a <see cref="FileArtifact" />) /// - that path is not under any sealed container (source or full/partial seal directory), but undeclared source reads are allowed. In that /// case the path is also unversioned because immutability is also guaranteed by dynamic enforcements. /// This method always succeeds or fails synchronously. /// </summary> public async Task<FileContentInfo?> TryQuerySealedOrUndeclaredInputContentAsync(AbsolutePath path, string consumerDescription, bool allowUndeclaredSourceReads) { FileOrDirectoryArtifact declaredArtifact; var isDynamicallyObservedSource = false; if (!m_sealedFiles.TryGetValue(path, out FileArtifact sealedFile)) { var sourceSealDirectory = TryGetSealSourceAncestor(path); if (!sourceSealDirectory.IsValid) { // If there is no sealed artifact that contains the read, then we check if undeclared source reads are allowed if (!allowUndeclaredSourceReads) { // No source seal directory found return null; } else { // If undeclared source reads is enabled but the path does not exist, then we can just shortcut // the query here. This matches the declared case when no static artifact is found that contains // the path var maybeResult = FileUtilities.TryProbePathExistence(path.ToString(Context.PathTable), followSymlink: false); if (!maybeResult.Succeeded || maybeResult.Result == PathExistence.Nonexistent) { return null; } } // We set the declared artifact as the path itself, there is no 'declared container' for this case. declaredArtifact = FileArtifact.CreateSourceFile(path); } else { // The source seal directory is the artifact which is actually declared // file artifact is created on the fly and never declared declaredArtifact = sourceSealDirectory; } // The path is not under a full/partial seal directory. So it is either under a source seal, or it is an allowed undeclared read. In both // cases it is a dynamically observed source isDynamicallyObservedSource = true; // This path is in a sealed source directory or undeclared source reads are allowed // so create a source file and query the content of it sealedFile = FileArtifact.CreateSourceFile(path); } else { declaredArtifact = sealedFile; } FileMaterializationInfo? materializationInfo; using (var operationContext = OperationTracker.StartOperation(OperationKind.PassThrough, m_host.LoggingContext)) using (operationContext.StartOperation(PipExecutorCounter.FileContentManagerTryQuerySealedInputContentDuration, sealedFile)) { materializationInfo = await TryQueryContentAsync(sealedFile, operationContext, declaredArtifact, allowUndeclaredSourceReads, consumerDescription); } if (materializationInfo == null) { if (isDynamicallyObservedSource && m_contentQueriedDirectoryPaths.Contains(path)) { // Querying a directory under a source seal directory is allowed, return null which // allows the ObservedInputProcessor to proceed // This is different from the case of other seal directory types because the paths registered // in those directories are required to be files or missing // Querying a directory when undeclared source reads are allowed is also allowed return null; } // This causes the ObservedInputProcessor to abort the strong fingerprint computation // by indicating a failure in hashing a path // TODO: In theory, ObservedInputProcessor should not treat return FileContentInfo.CreateWithUnknownLength(WellKnownContentHashes.UntrackedFile); } return materializationInfo.Value.FileContentInfo; } /// <summary> /// For a given file artifact (which must be one of the pip's input artifacts; not an output), returns a content hash. /// This method always succeeds synchronously. The specified artifact must be a statically known (not dynamic) dependency. /// </summary> public FileMaterializationInfo GetInputContent(FileArtifact fileArtifact) { FileMaterializationInfo materializationInfo; bool found = TryGetInputContent(fileArtifact, out materializationInfo); if (!found) { Contract.Assume( false, "Attempted to query the content hash for an artifact which has not passed through SetFileArtifactContentHash: " + fileArtifact.Path.ToString(Context.PathTable)); } return materializationInfo; } /// <summary> /// Attempts to get the materialization info for the input artifact /// </summary> public bool TryGetInputContent(FileArtifact file, out FileMaterializationInfo info) { return m_fileArtifactContentHashes.TryGetValue(file, out info); } /// <summary> /// Whether there is a directory artifact representing an output directory (shared or exclusive opaque) that contains the given path /// </summary> public bool TryGetContainingOutputDirectory(AbsolutePath path, out DirectoryArtifact containingOutputDirectory) { containingOutputDirectory = DirectoryArtifact.Invalid; return (m_sealedFiles.TryGetValue(path, out FileArtifact sealedFile) && m_dynamicOutputFileDirectories.TryGetValue(sealedFile, out containingOutputDirectory)); } /// <summary> /// Attempts to materialize the given file /// </summary> public async Task<bool> TryMaterializeFile(FileArtifact outputFile) { var producer = GetDeclaredProducer(outputFile); using (var operationContext = OperationTracker.StartOperation(PipExecutorCounter.FileContentManagerTryMaterializeFileDuration, m_host.LoggingContext)) { return ArtifactMaterializationResult.Succeeded == await TryMaterializeFilesAsync(producer, operationContext, new[] { outputFile }, materializatingOutputs: true, isDeclaredProducer: true); } } /// <summary> /// Attempts to materialize the specified files /// </summary> public async Task<ArtifactMaterializationResult> TryMaterializeFilesAsync( Pip requestingPip, OperationContext operationContext, IEnumerable<FileArtifact> filesToMaterialize, bool materializatingOutputs, bool isDeclaredProducer) { var pipInfo = new PipInfo(requestingPip, Context); using (PipArtifactsState state = GetPipArtifactsState()) { foreach (var item in filesToMaterialize) { state.PipArtifacts.Add(item); } return await TryMaterializeArtifactsCore( pipInfo, operationContext, state, materializatingOutputs: materializatingOutputs, isDeclaredProducer: isDeclaredProducer); } } /// <summary> /// Gets the materialization origin of a file. /// </summary> public PipOutputOrigin GetPipOutputOrigin(FileArtifact file) { Contract.Requires(file.IsValid); return m_materializationTasks.TryGetValue(file, out Task<PipOutputOrigin> outputOrigin) ? outputOrigin.Result : PipOutputOrigin.NotMaterialized; } private PipArtifactsState GetPipArtifactsState() { PipArtifactsState state; if (!m_statePool.TryDequeue(out state)) { return new PipArtifactsState(this); } return state; } private static void PopulateDependencies(Pip pip, HashSet<FileOrDirectoryArtifact> dependencies, bool includeLazyInputs = false, bool onlySourceFiles = false) { if (pip.PipType == PipType.SealDirectory) { // Seal directory contents are handled by consumer of directory return; } Func<FileOrDirectoryArtifact, bool> action = (input) => { if (!onlySourceFiles || (input.IsFile && input.FileArtifact.IsSourceFile)) { dependencies.Add(input); } return true; }; Func<FileOrDirectoryArtifact, bool> lazyInputAction = action; if (!includeLazyInputs) { lazyInputAction = lazyInput => { // Remove lazy inputs dependencies.Remove(lazyInput); return true; }; } PipArtifacts.ForEachInput(pip, action, includeLazyInputs: true, overrideLazyInputAction: lazyInputAction); } private static void PopulateOutputs(Pip pip, HashSet<FileOrDirectoryArtifact> outputs, Func<FileOrDirectoryArtifact, bool> exclude = null) { PipArtifacts.ForEachOutput(pip, output => { if (exclude?.Invoke(output) == true) { return true; } outputs.Add(output); return true; }, includeUncacheable: false); } // TODO: Consider calling this from TryHashDependencies. That would allow us to remove logic which requires // that direct seal directory dependencies are scheduled private Possible<Unit> EnumerateAndReportDynamicOutputDirectories(HashSet<FileOrDirectoryArtifact> artifacts) { foreach (var artifact in artifacts) { if (artifact.IsDirectory) { var directory = artifact.DirectoryArtifact; SealDirectoryKind sealDirectoryKind = m_host.GetSealDirectoryKind(directory); if (sealDirectoryKind == SealDirectoryKind.Opaque) { if (m_sealContents.ContainsKey(directory)) { // Only enumerate and report if the directory has not already been reported continue; } if (Context.CancellationToken.IsCancellationRequested) { return Context.CancellationToken.CreateFailure(); } var result = EnumerateAndReportDynamicOutputDirectory(directory); if (!result.Succeeded) { return result; } } } } return Unit.Void; } private Possible<Unit> EnumerateAndReportDynamicOutputDirectory(DirectoryArtifact directory) { using (var poolFileList = Pools.GetFileArtifactList()) { var fileList = poolFileList.Instance; fileList.Clear(); var result = EnumerateDynamicOutputDirectory(directory, handleFile: file => fileList.Add(file), handleDirectory: null); if (!result.Succeeded) { return result.Failure; } ReportDynamicDirectoryContents(directory, fileList, PipOutputOrigin.UpToDate); } return Unit.Void; } private void RegisterDirectoryContents(HashSet<FileOrDirectoryArtifact> artifacts) { foreach (var artifact in artifacts) { if (artifact.IsDirectory) { var directory = artifact.DirectoryArtifact; RegisterDirectoryContents(directory); } } } private void RegisterDirectoryContents(DirectoryArtifact directory) { if (!m_registeredSealDirectories.Contains(directory)) { SealDirectoryKind sealDirectoryKind = m_host.GetSealDirectoryKind(directory); foreach (var file in ListSealedDirectoryContents(directory)) { var addedFile = m_sealedFiles.GetOrAdd(file.Path, file).Item.Value; if (addedFile != file) { Contract.Assert(false, $"Attempted to seal path twice with different rewrite counts ({addedFile.RewriteCount} != {file.RewriteCount}): {addedFile.Path.ToString(Context.PathTable)}"); } if (sealDirectoryKind.IsDynamicKind()) { // keep only the original {file -> directory} mapping m_dynamicOutputFileDirectories.TryAdd(file, directory); } } if (m_host.ShouldScrubFullSealDirectory(directory)) { using (var pooledList = Pools.GetStringList()) { var unsealedFiles = pooledList.Instance; FileUtilities.DeleteDirectoryContents( path: directory.Path.ToString(Context.PathTable), deleteRootDirectory: false, shouldDelete: filePath => { if (!m_sealedFiles.ContainsKey(AbsolutePath.Create(Context.PathTable, filePath))) { unsealedFiles.Add(filePath); return true; } return false; }, tempDirectoryCleaner: m_tempDirectoryCleaner); Logger.Log.DeleteFullySealDirectoryUnsealedContents( context: m_host.LoggingContext, directoryPath: directory.Path.ToString(Context.PathTable), pipDescription: GetAssociatedPipDescription(directory), string.Join(Environment.NewLine, unsealedFiles.Select(f => "\t" + f))); } } else if (sealDirectoryKind.IsSourceSeal()) { m_sealedSourceDirectories.TryAdd(directory.Path, directory); } m_registeredSealDirectories.Add(directory); } } /// <summary> /// Attempts to get the producer pip id for the producer of the file. The file may be /// a file produced inside a dynamic directory so its 'declared' producer will be the /// producer of the dynamic directory /// </summary> private PipId TryGetDeclaredProducerId(FileArtifact file) { return m_host.TryGetProducerId(GetDeclaredArtifact(file)); } /// <summary> /// Attempts to get the producer pip for the producer of the file. The file may be /// a file produced inside a dynamic directory so its 'declared' producer will be the /// producer of the dynamic directory /// </summary> private Pip GetDeclaredProducer(FileArtifact file) { return m_host.GetProducer(GetDeclaredArtifact(file)); } /// <summary> /// Gets the statically declared artifact corresponding to the file. In most cases, this is the file /// except for dynamic outputs or seal source files which are dynamically discovered /// </summary> private FileOrDirectoryArtifact GetDeclaredArtifact(FileArtifact file) { DirectoryArtifact declaredDirectory; if (m_sealedFiles.ContainsKey(file.Path)) { if (file.IsOutputFile) { if (m_dynamicOutputFileDirectories.TryGetValue(file, out declaredDirectory)) { return declaredDirectory; } } } else if (file.IsSourceFile) { declaredDirectory = TryGetSealSourceAncestor(file.Path); if (declaredDirectory.IsValid) { return declaredDirectory; } } return file; } private async Task<Possible<Unit>> TryHashFileArtifactsAsync(PipArtifactsState state, OperationContext operationContext, bool allowUndeclaredSourceReads) { foreach (var artifact in state.PipArtifacts) { if (!artifact.IsDirectory) { // Directory artifact contents are not hashed since they will be hashed dynamically // if the pip accesses them, so the file is the declared artifact FileMaterializationInfo fileContentInfo; FileArtifact file = artifact.FileArtifact; if (!m_fileArtifactContentHashes.TryGetValue(file, out fileContentInfo)) { // Directory artifact contents are not hashed since they will be hashed dynamically // if the pip accesses them, so the file is the declared artifact state.HashTasks.Add(TryQueryContentAsync( file, operationContext, declaredArtifact: file, allowUndeclaredSourceReads)); } } } FileMaterializationInfo?[] artifactContentInfos = await Task.WhenAll(state.HashTasks); foreach (var artifactContentInfo in artifactContentInfos) { if (!artifactContentInfo.HasValue) { return new Failure<string>("Could not retrieve input content for pip"); } } return Unit.Void; } private async Task<FileMaterializationInfo?> TryQueryContentAsync( FileArtifact fileArtifact, OperationContext operationContext, FileOrDirectoryArtifact declaredArtifact, bool allowUndeclaredSourceReads, string consumerDescription = null, bool verifyingHash = false) { if (!verifyingHash) { // Just use the stored hash if available and we are not verifying the hash which must bypass the // use of the stored hash FileMaterializationInfo recordedfileContentInfo; if (m_fileArtifactContentHashes.TryGetValue(fileArtifact, out recordedfileContentInfo)) { return recordedfileContentInfo; } } Task<FileMaterializationInfo?> alreadyHashingTask; TaskSourceSlim<FileMaterializationInfo?> hashCompletion; if (!TryReserveCompletion(m_fileArtifactHashTasks, fileArtifact, out alreadyHashingTask, out hashCompletion)) { var hash = await alreadyHashingTask; return hash; } FileMaterializationInfo? fileContentInfo; AbsolutePath symlinkTarget = TryGetSymlinkTarget(fileArtifact); if (symlinkTarget.IsValid) { fileContentInfo = GetOrComputeSymlinkInputContent(fileArtifact); } else { // for output files, call GetAndRecordFileContentHashAsyncCore directly which // doesn't include checks for mount points used for source file hashing TrackedFileContentInfo? trackedFileContentInfo = fileArtifact.IsSourceFile ? await GetAndRecordSourceFileContentHashAsync(operationContext, fileArtifact, declaredArtifact, allowUndeclaredSourceReads, consumerDescription) : await GetAndRecordFileContentHashAsyncCore(operationContext, fileArtifact, declaredArtifact, consumerDescription); fileContentInfo = trackedFileContentInfo?.FileMaterializationInfo; } if (fileContentInfo.HasValue) { if (!verifyingHash) { // Don't store the hash when performing verification ReportContent(fileArtifact, fileContentInfo.Value, symlinkTarget.IsValid ? PipOutputOrigin.NotMaterialized : PipOutputOrigin.UpToDate); } // Remove task now that content info is stored in m_fileArtifactContentHashes m_fileArtifactHashTasks.TryRemove(fileArtifact, out alreadyHashingTask); } hashCompletion.SetResult(fileContentInfo); return fileContentInfo; } /// <summary> /// Creates all symlink files in the symlink definitions /// </summary> public static bool CreateSymlinkEagerly(LoggingContext loggingContext, IConfiguration configuration, PathTable pathTable, SymlinkDefinitions symlinkDefinitions, CancellationToken cancellationToken) { Contract.Requires(loggingContext != null); Contract.Requires(symlinkDefinitions != null); Contract.Requires(!configuration.Schedule.UnsafeLazySymlinkCreation || configuration.Engine.PopulateSymlinkDirectories.Count != 0); Logger.Log.SymlinkFileTraceMessage(loggingContext, I($"Eagerly creating symlinks found in symlink file.")); int createdSymlinkCount = 0; int reuseExistingSymlinkCount = 0; int failedSymlinkCount = 0; var startTime = TimestampUtilities.Timestamp; var symlinkDirectories = symlinkDefinitions.DirectorySymlinkContents.Keys.ToList(); var populateSymlinkDirectories = new HashSet<HierarchicalNameId>(configuration.Engine.PopulateSymlinkDirectories.Select(p => p.Value)); Parallel.ForEach( symlinkDirectories, new ParallelOptions { MaxDegreeOfParallelism = configuration.Schedule.MaxProcesses, }, symlinkDirectory => { bool populateSymlinks = !configuration.Schedule.UnsafeLazySymlinkCreation; if (!populateSymlinks) { // If populating symlinks lazily, check if the directory is under the explicitly specified symlink directories // to populate foreach (var parent in pathTable.EnumerateHierarchyBottomUp(symlinkDirectory.Value)) { if (populateSymlinkDirectories.Contains(parent)) { populateSymlinks = true; break; } } } if (!populateSymlinks) { return; } var directorySymlinks = symlinkDefinitions.DirectorySymlinkContents[symlinkDirectory]; foreach (var symlinkPath in directorySymlinks) { var symlink = symlinkPath.ToString(pathTable); var symlinkTarget = symlinkDefinitions[symlinkPath].ToString(pathTable); if (cancellationToken.IsCancellationRequested) { Interlocked.Increment(ref failedSymlinkCount); break; } bool created; var maybeSymlink = FileUtilities.TryCreateSymlinkIfNotExistsOrTargetsDoNotMatch(symlink, symlinkTarget, true, out created); if (maybeSymlink.Succeeded) { if (created) { Interlocked.Increment(ref createdSymlinkCount); } else { Interlocked.Increment(ref reuseExistingSymlinkCount); } } else { Interlocked.Increment(ref failedSymlinkCount); Logger.Log.FailedToCreateSymlinkFromSymlinkMap(loggingContext, symlink, symlinkTarget, maybeSymlink.Failure.DescribeIncludingInnerFailures()); } } }); Logger.Log.CreateSymlinkFromSymlinkMap( loggingContext, createdSymlinkCount, reuseExistingSymlinkCount, failedSymlinkCount, (int)(TimestampUtilities.Timestamp - startTime).TotalMilliseconds); return failedSymlinkCount == 0; } private async Task<ArtifactMaterializationResult> TryMaterializeArtifactsCore( PipInfo pipInfo, OperationContext operationContext, PipArtifactsState state, bool materializatingOutputs, bool isDeclaredProducer) { // If materializing outputs, all files come from the same pip and therefore have the same // policy for whether they are readonly bool? allowReadOnly = materializatingOutputs ? !PipArtifacts.IsOutputMustRemainWritablePip(pipInfo.UnderlyingPip) : (bool?)null; state.PipInfo = pipInfo; state.MaterializingOutputs = materializatingOutputs; state.IsDeclaredProducer = isDeclaredProducer; // Get the files which need to be materialized // We reserve completion of directory deletions and file materialization so only a single deleter/materializer of a // directory/file. If the operation is reserved, code will perform the operation. Otherwise, it will await a task // signaling the completion of the operation PopulateArtifactsToMaterialize(state, allowReadOnly); using (operationContext.StartOperation(PipExecutorCounter.FileContentManagerDeleteDirectoriesDuration)) { // Delete dynamic directory contents prior to placing files // NOTE: This should happen before any per-file materialization/deletion operations because // it skips deleting declared files in the materialized directory under the assumption that // a later step will materialize/delete the file as necessary if (!await PrepareDirectoriesAsync(state, operationContext)) { return ArtifactMaterializationResult.PrepareDirectoriesFailed; } } if (IsDistributedWorker) { // Check that source files match (this may fail the materialization or leave the // source file to be materialized later if the materializeSourceFiles option is set (distributed worker)) if (!await VerifySourceFileInputsAsync(operationContext, pipInfo, state)) { return ArtifactMaterializationResult.VerifySourceFilesFailed; } } // Delete the absent files if any if (!await DeleteFilesRequiredAbsentAsync(state, operationContext)) { return ArtifactMaterializationResult.DeleteFilesRequiredAbsentFailed; } // Place Files: if (!await PlaceFilesAsync(operationContext, pipInfo, state)) { return ArtifactMaterializationResult.PlaceFileFailed; } // Mark directories as materialized so that the full set of files in the directory will // not need to be checked for completion on subsequent materialization calls MarkDirectoryMaterializations(state); return ArtifactMaterializationResult.Succeeded; } private void PopulateArtifactsToMaterialize(PipArtifactsState state, bool? allowReadOnlyOverride) { foreach (var artifact in state.PipArtifacts) { if (artifact.IsDirectory) { DirectoryArtifact directory = artifact.DirectoryArtifact; if (m_materializedDirectories.Contains(directory)) { // Directory is already materialized, no need to materialize its contents continue; } SealDirectoryKind sealDirectoryKind = m_host.GetSealDirectoryKind(directory); bool? directoryAllowReadOnlyOverride = allowReadOnlyOverride; if (sealDirectoryKind == SealDirectoryKind.Opaque) { // Dynamic directories must be deleted before materializing files // We don't want this to happen for shared dynamic ones AddDirectoryDeletion(state, artifact.DirectoryArtifact); // For dynamic directories we need to specify the value of // allow read only since the host will not know about the // dynamically produced file if (directoryAllowReadOnlyOverride == null && m_host.TryGetProducerId(directory).IsValid) { var producer = m_host.GetProducer(directory); directoryAllowReadOnlyOverride = !PipArtifacts.IsOutputMustRemainWritablePip(producer); } } else if (sealDirectoryKind == SealDirectoryKind.SourceTopDirectoryOnly) { IReadOnlyList<AbsolutePath> paths; if (LazySymlinkCreation && m_symlinkDefinitions.TryGetSymlinksInDirectory(directory.Path, out paths)) { foreach (var path in paths) { AddFileMaterialization( state, FileArtifact.CreateSourceFile(path), directoryAllowReadOnlyOverride, m_symlinkDefinitions[path]); } } continue; } else if (sealDirectoryKind == SealDirectoryKind.SourceAllDirectories) { if (LazySymlinkCreation && m_symlinkDefinitions.HasNestedSymlinks(directory)) { foreach (var node in Context.PathTable.EnumerateHierarchyTopDown(directory.Path.Value)) { var path = new AbsolutePath(node); AddFileMaterialization( state, FileArtifact.CreateSourceFile(path), directoryAllowReadOnlyOverride, m_symlinkDefinitions.TryGetSymlinkTarget(path)); } } continue; } // Full, partial, and dynamic output must have contents materialized foreach (var file in ListSealedDirectoryContents(directory)) { // This is not needed for shared dynamic since we are not deleting them to begin with if (sealDirectoryKind == SealDirectoryKind.Opaque) { // Track reported files inside dynamic directories so they are not deleted // during the directory deletion step (they will be replaced by the materialization // step or may have already been replaced if the file was explicitly materialized) state.MaterializedDirectoryContents.Add(file); } AddFileMaterialization(state, file, directoryAllowReadOnlyOverride, TryGetSymlinkTarget(file)); } } else { AddFileMaterialization(state, artifact.FileArtifact, allowReadOnlyOverride, TryGetSymlinkTarget(artifact.FileArtifact)); } } } private AbsolutePath TryGetSymlinkTarget(FileArtifact file) { if (file.IsOutputFile || !LazySymlinkCreation) { // Only source files can be declared as symlinks return AbsolutePath.Invalid; } return m_symlinkDefinitions.TryGetSymlinkTarget(file); } private void MarkDirectoryMaterializations(PipArtifactsState state) { foreach (var artifact in state.PipArtifacts) { if (artifact.IsDirectory) { MarkDirectoryMaterialization(artifact.DirectoryArtifact); } } } /// <summary> /// Checks if a <see cref="DirectoryArtifact"/> is materialized. /// </summary> public bool IsMaterialized(DirectoryArtifact directoryArtifact) { return m_materializedDirectories.Contains(directoryArtifact); } private void MarkDirectoryMaterialization(DirectoryArtifact directoryArtifact) { m_materializedDirectories.Add(directoryArtifact); m_host.ReportMaterializedArtifact(directoryArtifact); } private void AddDirectoryDeletion(PipArtifactsState state, DirectoryArtifact directoryArtifact) { var sealDirectoryKind = m_host.GetSealDirectoryKind(directoryArtifact); if (sealDirectoryKind != SealDirectoryKind.Opaque) { // Only dynamic output directories should be deleted return; } TaskSourceSlim<bool> deletionCompletion; Task<bool> alreadyDeletingTask; if (!TryReserveCompletion(m_dynamicDirectoryDeletionTasks, directoryArtifact, out alreadyDeletingTask, out deletionCompletion)) { if (alreadyDeletingTask.Status != TaskStatus.RanToCompletion || !alreadyDeletingTask.Result) { state.PendingDirectoryDeletions.Add(alreadyDeletingTask); } } else { state.DirectoryDeletionCompletions.Add((directoryArtifact, deletionCompletion)); } } /// <summary> /// Adds a file to the list of files to be materialized. /// </summary> /// <param name="state">the state object containing the list of file materializations.</param> /// <param name="file">the file to materialize.</param> /// <param name="allowReadOnlyOverride">specifies whether the file is allowed to be read-only. If not specified, the host is queried.</param> /// <param name="symlinkTarget">the target of the symlink (if file is registered symlink).</param> /// <param name="dependentFileIndex">the index of a file (in the list of materialized files) which requires the materialization of this file as /// a prerequisite (if any). This is used when restoring content into cache for a host materialized file (i.e. write file output).</param> private void AddFileMaterialization( PipArtifactsState state, FileArtifact file, bool? allowReadOnlyOverride, AbsolutePath symlinkTarget, int? dependentFileIndex = null) { bool shouldMaterializeSourceFile = (IsDistributedWorker && SourceFileMaterializationEnabled) || symlinkTarget.IsValid; if (file.IsSourceFile && !shouldMaterializeSourceFile) { // Only distributed workers need to verify/materialize source files return; } TaskSourceSlim<PipOutputOrigin> materializationCompletion; Task<PipOutputOrigin> alreadyMaterializingTask; if (!TryReserveCompletion(m_materializationTasks, file, out alreadyMaterializingTask, out materializationCompletion)) { if (dependentFileIndex != null) { // Ensure the dependent artifact waits on the materialization of this file to complete state.SetDependencyArtifactCompletion(dependentFileIndex.Value, alreadyMaterializingTask); } // Another thread tried to materialize this file // so add this to the list of pending placements so that we await the result before trying to place the other files. // Note: File is not added if it already finish materializing with a successful result since its safe // to just bypass it in this case if (alreadyMaterializingTask.Status != TaskStatus.RanToCompletion || alreadyMaterializingTask.Result == PipOutputOrigin.NotMaterialized) { state.PendingPlacementTasks.Add((file, alreadyMaterializingTask)); } else { // Update OverallMaterializationResult state.MergeResult(alreadyMaterializingTask.Result); } } else { if (dependentFileIndex != null) { // Ensure the dependent artifact waits on the materialization of this file to complete state.SetDependencyArtifactCompletion(dependentFileIndex.Value, materializationCompletion.Task); } // Don't query host for allow readonly for symlinks as this // has no effect and host may not be aware of the file (source // seal directory files) if (symlinkTarget.IsValid) { allowReadOnlyOverride = false; } FileMaterializationInfo materializationInfo = symlinkTarget.IsValid ? GetOrComputeSymlinkInputContent(file) : GetInputContent(file); state.AddMaterializationFile( fileToMaterialize: file, allowReadOnly: allowReadOnlyOverride ?? AllowFileReadOnly(file), materializationInfo: materializationInfo, materializationCompletion: materializationCompletion, symlinkTarget: symlinkTarget); } } private FileMaterializationInfo GetOrComputeSymlinkInputContent(FileArtifact file) { FileMaterializationInfo materializationInfo; if (!TryGetInputContent(file, out materializationInfo)) { var hash = m_host.LocalDiskContentStore.ComputePathHash(file.Path.ToString(Context.PathTable)); materializationInfo = new FileMaterializationInfo(FileContentInfo.CreateWithUnknownLength(hash), file.Path.GetName(Context.PathTable)); } return materializationInfo; } private async Task<bool> DeleteFilesRequiredAbsentAsync(PipArtifactsState state, OperationContext operationContext) { // Don't do anything for materialization that are already completed by prior states state.RemoveCompletedMaterializations(); bool deletionSuccess = await Task.Run(() => { bool success = true; for (int i = 0; i < state.MaterializationFiles.Count; i++) { MaterializationFile materializationFile = state.MaterializationFiles[i]; if (materializationFile.MaterializationInfo.Hash == WellKnownContentHashes.AbsentFile) { var file = materializationFile.Artifact; var filePath = file.Path.ToString(Context.PathTable); try { ContentMaterializationOrigin origin = ContentMaterializationOrigin.UpToDate; if (FileUtilities.Exists(filePath)) { // Delete the file if it exists FileUtilities.DeleteFile(filePath, tempDirectoryCleaner: m_tempDirectoryCleaner); origin = ContentMaterializationOrigin.DeployedFromCache; } state.SetMaterializationSuccess(i, origin: origin, operationContext: operationContext); } catch (BuildXLException ex) { Logger.Log.StorageRemoveAbsentFileOutputWarning( operationContext, pipDescription: GetAssociatedPipDescription(file), destinationPath: filePath, errorMessage: ex.LogEventMessage); success = false; state.SetMaterializationFailure(i); } } } return success; }); return deletionSuccess; } /// <summary> /// Delete the contents of opaque (or dynamic) directories before deploying files from cache if directories exist; otherwise create empty directories. /// </summary> /// <remarks> /// Creating empty directories when they don't exist ensures the correctness of replaying pip outputs. Those existence of such directories may be needed /// by downstream pips. Empty directories are not stored into the cache, but their paths are stored in the pip itself and are collected when we populate <see cref="PipArtifactsState"/>. /// If the pip outputs are removed, then to replay the empty output directories in the next build, when we have a cache hit, those directories need to be created. /// </remarks> private async Task<bool> PrepareDirectoriesAsync(PipArtifactsState state, OperationContext operationContext) { bool deletionSuccess = await Task.Run(() => { bool success = true; // Delete the contents of opaque directories before deploying files from cache, or re-create empty directories if they don't exist. foreach (var (directory, completion) in state.DirectoryDeletionCompletions) { try { var dirOutputPath = directory.Path.ToString(Context.PathTable); if (FileUtilities.DirectoryExistsNoFollow(dirOutputPath)) { // Delete directory contents if the directory itself exists. Directory content deletion // can throw an exception if users are naughty, e.g. they remove the output directory, rename directory, etc. // The exception is thrown because the method tries to verify that the directory has been emptied by // enumerating the directory or a descendant directory. Note that this is a possibly expensive I/O operation. FileUtilities.DeleteDirectoryContents( dirOutputPath, shouldDelete: filePath => { using ( operationContext.StartAsyncOperation( PipExecutorCounter.FileContentManagerDeleteDirectoriesPathParsingDuration)) { var file = FileArtifact.CreateOutputFile(AbsolutePath.Create(Context.PathTable, filePath)); // MaterializedDirectoryContents will contain all declared contents of the directory which should not be deleted // as the file may already have been materialized by the file content manager. If the file was not materialized // by the file content manager, it will be deleted and replaced as a part of file materialization return !state.MaterializedDirectoryContents.Contains(file); } }, tempDirectoryCleaner: m_tempDirectoryCleaner); } else { if (FileUtilities.FileExistsNoFollow(dirOutputPath)) { FileUtilities.DeleteFile(dirOutputPath, waitUntilDeletionFinished: true, tempDirectoryCleaner: m_tempDirectoryCleaner); } // If the directory does not exist, create one. This is to ensure that an opaque directory is always present on disk. FileUtilities.CreateDirectory(dirOutputPath); } m_dynamicDirectoryDeletionTasks[directory] = BoolTask.True; completion.SetResult(true); } catch (BuildXLException ex) { Logger.Log.StorageCacheCleanDirectoryOutputError( operationContext, pipDescription: GetAssociatedPipDescription(directory), destinationPath: directory.Path.ToString(Context.PathTable), errorMessage: ex.LogEventMessage); state.AddFailedDirectory(directory); success = false; m_dynamicDirectoryDeletionTasks[directory] = BoolTask.False; completion.SetResult(false); } } return success; }); var deletionResults = await Task.WhenAll(state.PendingDirectoryDeletions); deletionSuccess &= deletionResults.All(result => result); return deletionSuccess; } /// <summary> /// Attempt to place files from local cache /// </summary> /// <remarks> /// Logs warnings when a file placement fails; does not log errors. /// </remarks> private async Task<bool> PlaceFilesAsync( OperationContext operationContext, PipInfo pipInfo, PipArtifactsState state, bool materialize = true) { bool success = true; if (state.MaterializationFiles.Count != 0) { var pathTable = Context.PathTable; // Remove the completed materializations (this is mainly to remove source file 'materializations') which // may have already completed if running in the mode where source files are assumed to be materialized prior to the // start of the build on a distributed worker state.RemoveCompletedMaterializations(); success &= await TryLoadAvailableContentAsync( operationContext, pipInfo, state); if (!materialize) { return success; } // Remove the failures // After calling TryLoadAvailableContentAsync some files may be marked completed (as failures) // we need to remove them so we don't try to place them state.RemoveCompletedMaterializations(); // Maybe we didn't manage to fetch all of the remote content. However, for the content that was fetched, // we still are mandated to finish materializing if possible and eventually complete the materialization task. using (operationContext.StartOperation(PipExecutorCounter.FileContentManagerPlaceFilesDuration)) { for (int i = 0; i < state.MaterializationFiles.Count; i++) { MaterializationFile materializationFile = state.MaterializationFiles[i]; FileArtifact file = materializationFile.Artifact; FileMaterializationInfo materializationInfo = materializationFile.MaterializationInfo; ContentHash hash = materializationInfo.Hash; PathAtom fileName = materializationInfo.FileName; AbsolutePath symlinkTarget = materializationFile.SymlinkTarget; bool allowReadOnly = materializationFile.AllowReadOnly; int materializationFileIndex = i; state.PlacementTasks.Add(Task.Run( async () => { // Wait for the prior version of the file artifact to finish materialization await materializationFile.PriorArtifactVersionCompletion; if (Context.CancellationToken.IsCancellationRequested) { state.SetMaterializationFailure(fileIndex: materializationFileIndex); success = false; return; } Possible<ContentMaterializationResult> possiblyPlaced; using (var outerContext = operationContext.StartAsyncOperation(PipExecutorCounter.FileContentManagerTryMaterializeOuterDuration, file)) using (await m_materializationSemaphore.AcquireAsync()) { if (m_host.CanMaterializeFile(file)) { using (outerContext.StartOperation(PipExecutorCounter.FileContentManagerHostTryMaterializeDuration, file)) { var possiblyMaterialized = await m_host.TryMaterializeFileAsync(file, outerContext); possiblyPlaced = possiblyMaterialized.Then(origin => new ContentMaterializationResult( origin, TrackedFileContentInfo.CreateUntracked(materializationInfo.FileContentInfo))); } } else { using (outerContext.StartOperation( (symlinkTarget.IsValid || materializationInfo.ReparsePointInfo.ReparsePointType == ReparsePointType.SymLink) ? PipExecutorCounter.TryMaterializeSymlinkDuration : PipExecutorCounter.FileContentManagerTryMaterializeDuration, file)) { if (state.VerifyMaterializationOnly) { // Ensure local existence by opening content stream. var possiblyStream = await ArtifactContentCache.TryOpenContentStreamAsync(hash); if (possiblyStream.Succeeded) { #pragma warning disable AsyncFixer02 possiblyStream.Result.Dispose(); #pragma warning restore AsyncFixer02 possiblyPlaced = new Possible<ContentMaterializationResult>( new ContentMaterializationResult( ContentMaterializationOrigin.DeployedFromCache, TrackedFileContentInfo.CreateUntracked(materializationInfo.FileContentInfo, fileName))); possiblyPlaced = WithLineInfo(possiblyPlaced); } else { possiblyPlaced = new Possible<ContentMaterializationResult>(possiblyStream.Failure); possiblyPlaced = WithLineInfo(possiblyPlaced); } } else { // Try materialize content. possiblyPlaced = await LocalDiskContentStore.TryMaterializeAsync( ArtifactContentCache, fileRealizationModes: GetFileRealizationMode(allowReadOnly: allowReadOnly), path: file.Path, contentHash: hash, fileName: fileName, symlinkTarget: symlinkTarget, reparsePointInfo: materializationInfo.ReparsePointInfo); possiblyPlaced = WithLineInfo(possiblyPlaced); } } } } if (possiblyPlaced.Succeeded) { state.SetMaterializationSuccess( fileIndex: materializationFileIndex, origin: possiblyPlaced.Result.Origin, operationContext: operationContext); m_host.ReportFileArtifactPlaced(file); } else { Logger.Log.StorageCacheGetContentWarning( operationContext, pipDescription: pipInfo.Description, contentHash: hash.ToHex(), destinationPath: file.Path.ToString(pathTable), errorMessage: possiblyPlaced.Failure.DescribeIncludingInnerFailures()); state.SetMaterializationFailure(fileIndex: materializationFileIndex); // Latch overall success (across all placements) to false. success = false; } })); } await Task.WhenAll(state.PlacementTasks); } } // Wait on any placements for files already in progress by other pips using (operationContext.StartOperation(PipExecutorCounter.FileContentManagerPlaceFilesDuration)) { state.PlacementTasks.Clear(); foreach (var pendingPlacementTask in state.PendingPlacementTasks) { state.PlacementTasks.Add(pendingPlacementTask.Item2); } await Task.WhenAll(state.PlacementTasks); foreach (var pendingPlacement in state.PendingPlacementTasks) { var result = await pendingPlacement.Item2; if (result == PipOutputOrigin.NotMaterialized) { var file = pendingPlacement.fileArtifact; state.AddFailedFile(file, GetInputContent(file).Hash); // Not materialized indicates failure success = false; } else { state.MergeResult(result); } } } return success; } private static Possible<T> WithLineInfo<T>(Possible<T> possible, [CallerMemberName] string caller = null, [CallerLineNumber] int line = 0) { return possible.Succeeded ? possible : new Failure<string>(I($"Failure line info: {caller} ({line})"), possible.Failure); } private static PipOutputOrigin GetPipOutputOrigin(ContentMaterializationOrigin origin, Pip pip) { switch (pip.PipType) { case PipType.WriteFile: case PipType.CopyFile: return origin.ToPipOutputOriginHidingDeploymentFromCache(); default: return origin.ToPipOutputOrigin(); } } /// <summary> /// Attempt to bring multiple file contents into the local cache. /// </summary> /// <remarks> /// May log warnings. Does not log errors. /// </remarks> private Task<bool> TryLoadAvailableContentAsync( OperationContext operationContext, PipInfo pipInfo, PipArtifactsState state) { return TryLoadAvailableContentAsync( operationContext, pipInfo, state.MaterializingOutputs, state.GetCacheMaterializationContentHashes(), onFailure: failure => { for (int index = 0; index < state.MaterializationFiles.Count; index++) { state.SetMaterializationFailure(index); } state.InnerFailure = failure; }, onContentUnavailable: (index, hashLogStr) => { state.SetMaterializationFailure(index); // Log the eventual path on failure for sake of correlating the file within the build if (Configuration.Schedule.StoreOutputsToCache) { Logger.Log.FailedToLoadFileContentWarning( operationContext, pipInfo.Description, hashLogStr, state.MaterializationFiles[index].Artifact.Path.ToString(Context.PathTable)); } }, state: state); } /// <summary> /// Attempt to bring multiple file contents into the local cache. /// </summary> /// <remarks> /// May log warnings. Does not log errors. /// </remarks> private async Task<bool> TryLoadAvailableContentAsync( OperationContext operationContext, PipInfo pipInfo, bool materializingOutputs, IReadOnlyList<(FileArtifact fileArtifact, ContentHash contentHash, int fileIndex)> filesAndContentHashes, Action<Failure> onFailure, Action<int, string> onContentUnavailable, bool onlyLogUnavailableContent = false, PipArtifactsState state = null) { const string TargetUpToDate = "True"; const string TargetNotUpToDate = "False"; const string TargetNotChecked = "Not Checked"; bool success = true; Possible<ContentAvailabilityBatchResult, Failure> possibleResults; using (operationContext.StartOperation(PipExecutorCounter.FileContentManagerTryLoadAvailableContentDuration)) { possibleResults = await ArtifactContentCache.TryLoadAvailableContentAsync( filesAndContentHashes.Select(pathAndContentHash => pathAndContentHash.Item2).ToList()); } if (!possibleResults.Succeeded) { // Actual failure (distinct from a per-hash miss); should be unusual // We need to fail all materialization tasks since we don't have per-hash results. // TODO: We may want to check if the files on disk are up-to-date. Logger.Log.StorageBringProcessContentLocalWarning( operationContext, pipInfo.Description, possibleResults.Failure.DescribeIncludingInnerFailures()); onFailure(possibleResults.Failure); success = false; } else { ContentAvailabilityBatchResult resultsBatch = possibleResults.Result; ReadOnlyArray<ContentAvailabilityResult> results = resultsBatch.Results; Contract.Assert(filesAndContentHashes.Count == results.Length); for (int i = 0; i < results.Length; i++) { if (Context.CancellationToken.IsCancellationRequested) { success = false; break; } var result = results[i]; var fileArtifact = filesAndContentHashes[i].fileArtifact; var contentHash = filesAndContentHashes[i].contentHash; var currentFileIndex = filesAndContentHashes[i].fileIndex; using (operationContext.StartOperation(OperationCounter.FileContentManagerHandleContentAvailability, fileArtifact)) { Contract.Assume(contentHash == result.Hash); bool isAvailable = result.IsAvailable; string targetLocationUpToDate = TargetNotChecked; if (!isAvailable) { Possible<ContentDiscoveryResult, Failure>? existingContent = null; bool isPreservedOutputFile = IsPreservedOutputFile(pipInfo.UnderlyingPip, materializingOutputs, fileArtifact); bool shouldDiscoverContentOnDisk = Configuration.Schedule.ReuseOutputsOnDisk || !Configuration.Schedule.StoreOutputsToCache || isPreservedOutputFile; if (shouldDiscoverContentOnDisk) { using (operationContext.StartOperation(OperationCounter.FileContentManagerDiscoverExistingContent, fileArtifact)) { // Discover the existing file (if any) and get its content hash existingContent = await LocalDiskContentStore.TryDiscoverAsync(fileArtifact); } } if (existingContent.HasValue && existingContent.Value.Succeeded && existingContent.Value.Result.TrackedFileContentInfo.FileContentInfo.Hash == contentHash) { Contract.Assert(shouldDiscoverContentOnDisk); targetLocationUpToDate = TargetUpToDate; if (isPreservedOutputFile || !Configuration.Schedule.StoreOutputsToCache) { // If file should be preserved, then we do not restore its content back to the cache. // If the preserved file is copied using a copy-file pip, then the materialization of // the copy-file destination relies on the else-clause below where we try to get // other file using TryGetFileArtifactForHash. // If we don't store outputs to cache, then we should not include cache operation to determine // if the content is available. However, we just checked, by TryDiscoverAsync above, that the content // is available with the expected content hash. Thus, we can safely say that the content is available. isAvailable = true; } else { // The file has the correct hash so we can restore it back into the cache for future use/retention. // But don't restore files that need to be preserved because they were not stored to the cache. var possiblyStored = await RestoreContentInCacheAsync( operationContext, pipInfo.UnderlyingPip, materializingOutputs, fileArtifact, contentHash, fileArtifact); // Try to be conservative here due to distributed builds (e.g., the files may not exist on other machines). isAvailable = possiblyStored.Succeeded; } if (isAvailable) { // Content is up to date and available, so just mark the file as successfully materialized. state?.SetMaterializationSuccess(currentFileIndex, ContentMaterializationOrigin.UpToDate, operationContext); } } else { if (shouldDiscoverContentOnDisk) { targetLocationUpToDate = TargetNotUpToDate; } // If the up-to-dateness of file on disk is not checked, or the file on disk is not up-to-date, // then fall back to using the cache. // Attempt to find a materialized file for the hash and store that // into the cache to ensure the content is available // This is mainly used for incremental scheduling which does not account // for content which has been evicted from the cache when performing copies FileArtifact otherFile = TryGetFileArtifactForHash(contentHash); if (!otherFile.IsValid) { FileArtifact copyOutput = fileArtifact; FileArtifact copySource; while (m_host.TryGetCopySourceFile(copyOutput, out copySource)) { // Use the source of the copy file as the file to restore otherFile = copySource; if (copySource.IsSourceFile) { // Reached a source file. Just abort rather than calling the host again. break; } // Try to keep going back through copy chain copyOutput = copySource; } } if (otherFile.IsValid) { if (otherFile.IsSourceFile || IsFileMaterialized(otherFile)) { var possiblyStored = await RestoreContentInCacheAsync( operationContext, pipInfo.UnderlyingPip, materializingOutputs, otherFile, contentHash, fileArtifact); isAvailable = possiblyStored.Succeeded; } else if (state != null && m_host.CanMaterializeFile(otherFile)) { // Add the file containing the required content to the list of files to be materialized. // The added to the list rather than inlining the materializing to prevent duplicate/concurrent // materializations of the same file. It also ensures that the current file waits on the materialization // of the other file before attempting materialization. if (!TryGetInputContent(otherFile, out var otherFileMaterializationInfo)) { // Need to set the materialization info in case it is not set on the current machine (i.e. distributed worker) // This can happen with copied write file outputs. Since the hash of the write file output will not be transferred to worker // but instead the copied output consumed by the pip will be transferred. We use the hash from the copied file since it is // the same. We recreate without the file name because copied files can have different names that the originating file. otherFileMaterializationInfo = FileMaterializationInfo.CreateWithUnknownName(state.MaterializationFiles[currentFileIndex].MaterializationInfo.FileContentInfo); ReportInputContent(otherFile, otherFileMaterializationInfo); } // Example (dataflow graph) // W[F_W0] -> C[F_C0] -> P1,P2 // Where 'W' is a write file which writes an output 'F_W0' with hash '#W0' // Where 'C' is a copy file which copies 'F_W0' to 'F_C0' (with hash '#W0'). // Where 'P1' and 'P2' are consumers of 'F_C0' // In this case when P1 materializes inputs, // This list of materialized files are: // 0: F_C0 = #W0 (i.e. materialize file with hash #W0 at the location F_C0) // When processing F_C0 (currentFileIndex=0) we enter this call and // The add file materialization call adds an entry to the list of files to materialize // and modifies F_C0 entry to wait for the completion of F_W0 // 0: C0 = #W0 (+ wait for F_W0 to complete materialization) // + 1: F_W0 = #W0 AddFileMaterialization( state, otherFile, allowReadOnlyOverride: null, symlinkTarget: AbsolutePath.Invalid, // Ensure that the current file waits on the materialization before attempting its materialization. // This ensures that content is present in the cache dependentFileIndex: currentFileIndex); isAvailable = true; } } } } // Log the result of each requested hash string hashLogStr = contentHash.ToHex(); using (operationContext.StartOperation(OperationCounter.FileContentManagerHandleContentAvailabilityLogContentAvailability, fileArtifact)) { if (!onlyLogUnavailableContent || !isAvailable) { if (materializingOutputs) { Logger.Log.ScheduleCopyingPipOutputToLocalStorage( operationContext, pipInfo.Description, hashLogStr, result: isAvailable, targetLocationUpToDate: targetLocationUpToDate, remotelyCopyBytes: result.BytesTransferred); } else { Logger.Log.ScheduleCopyingPipInputToLocalStorage( operationContext, pipInfo.SemiStableHash, pipInfo.Description, hashLogStr, result: isAvailable, targetLocationUpToDate: targetLocationUpToDate, remotelyCopyBytes: result.BytesTransferred); } } if (result.IsAvailable) { // The result was available in cache so report it // Note that, in the above condition, we are using "result.isAvailable" instead of "isAvailable". // If we used "isAvailable", the couter would be incorrect because "isAvailable" can also mean that // the artifact is already on disk (or in the object folder). This can happen when the preserved-output // mode is enabled or when BuildXL doesn't store outputs to cache. ReportTransferredArtifactToLocalCache(true, result.BytesTransferred, result.SourceCache); } // Misses for content are graceful (i.e., the 'load available content' succeeded but deemed something unavailable). // We need to fail the materialization task in that case; there may be other waiters for the same hash / file. if (!isAvailable) { success = false; onContentUnavailable(currentFileIndex, hashLogStr); } } } } } return success; } private FileRealizationMode GetFileRealizationModeForCacheRestore( Pip pip, bool materializingOutputs, FileArtifact file, AbsolutePath targetPath) { if (file.Path != targetPath) { // File has different path from the target path. return FileRealizationMode.Copy; } bool isPreservedOutputFile = IsPreservedOutputFile(pip, materializingOutputs, file); bool allowReadOnly = materializingOutputs ? !PipArtifacts.IsOutputMustRemainWritablePip(pip) : AllowFileReadOnly(file); return GetFileRealizationMode(allowReadOnly && !isPreservedOutputFile); } private async Task<Possible<TrackedFileContentInfo>> RestoreContentInCacheAsync( OperationContext operationContext, Pip pip, bool materializingOutputs, FileArtifact fileArtifact, ContentHash hash, FileArtifact targetFile) { if (!Configuration.Schedule.StoreOutputsToCache && !m_host.IsFileRewritten(targetFile)) { return new Failure<string>("Storing content to cache is not allowed"); } using (operationContext.StartOperation(OperationCounter.FileContentManagerRestoreContentInCache)) { FileRealizationMode fileRealizationMode = GetFileRealizationModeForCacheRestore(pip, materializingOutputs, fileArtifact, targetFile.Path); bool shouldReTrack = fileRealizationMode != FileRealizationMode.Copy; var possiblyStored = await LocalDiskContentStore.TryStoreAsync( ArtifactContentCache, fileRealizationModes: fileRealizationMode, path: fileArtifact.Path, tryFlushPageCacheToFileSystem: shouldReTrack, knownContentHash: hash, trackPath: shouldReTrack); return possiblyStored; } } private void ReportTransferredArtifactToLocalCache(bool contentIsLocal, long transferredBytes, string sourceCache) { if (contentIsLocal && transferredBytes > 0) { Interlocked.Increment(ref m_stats.ArtifactsBroughtToLocalCache); Interlocked.Add(ref m_stats.TotalSizeArtifactsBroughtToLocalCache, transferredBytes); } m_cacheContentSource.AddOrUpdate(sourceCache, 1, (key, value) => value + 1); } private async Task<bool> VerifySourceFileInputsAsync( OperationContext operationContext, PipInfo pipInfo, PipArtifactsState state) { Contract.Requires(IsDistributedWorker); var pathTable = Context.PathTable; bool success = true; for (int i = 0; i < state.MaterializationFiles.Count; i++) { if (Context.CancellationToken.IsCancellationRequested) { return false; } MaterializationFile materializationFile = state.MaterializationFiles[i]; FileArtifact file = materializationFile.Artifact; bool createSymlink = materializationFile.CreateSymlink; if (file.IsSourceFile && !createSymlink) { // Start the task to hash input state.HashTasks.Add(TryQueryContentAsync( file, operationContext, declaredArtifact: file, pipInfo.UnderlyingPip.ProcessAllowsUndeclaredSourceReads, verifyingHash: true)); } else { // Just store placeholder task for output files/lazy symlinks since they are not verified state.HashTasks.Add(s_placeHolderFileHashTask); } } for (int i = 0; i < state.MaterializationFiles.Count; i++) { MaterializationFile materializationFile = state.MaterializationFiles[i]; FileArtifact file = materializationFile.Artifact; var materializationInfo = materializationFile.MaterializationInfo; var expectedHash = materializationInfo.Hash; bool createSymlink = materializationFile.CreateSymlink; if (file.IsOutputFile || // TODO: Bug #995938: Temporary hack to handle pip graph construction verifcation oversight // where source files declared inside output directories state.MaterializedDirectoryContents.Contains(file.Path) || // Don't verify if it a symlink creation createSymlink) { // Only source files should be verified continue; } FileMaterializationInfo? maybeFileInfo = await state.HashTasks[i]; bool sourceFileHashMatches = maybeFileInfo?.Hash.Equals(expectedHash) == true; if (SourceFileMaterializationEnabled) { // Only attempt to materialize the file if the hash does not match if (!sourceFileHashMatches) { if (expectedHash.IsSpecialValue() && expectedHash != WellKnownContentHashes.AbsentFile) { // We are trying to materialize the source file to a special value (like untracked) so // just set it to succeed since these values cannot actually be materialized // AbsentFile however can be materialized by deleting the file state.SetMaterializationSuccess(fileIndex: i, origin: ContentMaterializationOrigin.UpToDate, operationContext: operationContext); } if (maybeFileInfo.Value.Hash == WellKnownContentHashes.AbsentFile) { Logger.Log.PipInputVerificationMismatchRecoveryExpectedExistence( operationContext, pipInfo.SemiStableHash, pipInfo.Description, filePath: file.Path.ToString(pathTable)); } else if (expectedHash == WellKnownContentHashes.AbsentFile) { Logger.Log.PipInputVerificationMismatchRecoveryExpectedNonExistence( operationContext, pipInfo.SemiStableHash, pipInfo.Description, filePath: file.Path.ToString(pathTable)); } else { Logger.Log.PipInputVerificationMismatchRecovery( operationContext, pipInfo.SemiStableHash, pipInfo.Description, actualHash: maybeFileInfo.Value.Hash.ToHex(), expectedHash: expectedHash.ToHex(), filePath: file.Path.ToString(pathTable)); } // Just continue rather than reporting result so that the file will be materialized continue; } } else { // Not materializing source files, so verify that the file matches instead if (!maybeFileInfo.HasValue) { Logger.Log.PipInputVerificationUntrackedInput( operationContext, pipInfo.SemiStableHash, pipInfo.Description, file.Path.ToString(pathTable)); } else if (maybeFileInfo.Value.Hash != expectedHash) { var actualFileInfo = maybeFileInfo.Value; ReportWorkerContentMismatch(operationContext, pathTable, file, expectedHash, actualFileInfo.Hash); } } if (sourceFileHashMatches) { state.SetMaterializationSuccess( fileIndex: i, origin: ContentMaterializationOrigin.UpToDate, operationContext: operationContext); } else { state.SetMaterializationFailure(fileIndex: i); success = false; } } Contract.Assert(success || operationContext.LoggingContext.WarningWasLogged, "Warning must be logged if source file verification fails"); return success; } private static void ReportWorkerContentMismatch( LoggingContext loggingContext, PathTable pathTable, FileArtifact file, ContentHash expectedHash, ContentHash actualHash) { if (actualHash == WellKnownContentHashes.AbsentFile) { Logger.Log.PipInputVerificationMismatchExpectedExistence( loggingContext, filePath: file.Path.ToString(pathTable)); } else if (expectedHash == WellKnownContentHashes.AbsentFile) { Logger.Log.PipInputVerificationMismatchExpectedNonExistence( loggingContext, filePath: file.Path.ToString(pathTable)); } else { Logger.Log.PipInputVerificationMismatch( loggingContext, actualHash: actualHash.ToHex(), expectedHash: expectedHash.ToHex(), filePath: file.Path.ToString(pathTable)); } } private DirectoryArtifact TryGetSealSourceAncestor(AbsolutePath path) { // Walk the parent directories of the sealedPath to find if it is under a sealedSourceDirectory. // The entries are cached and short-circuited otherwise var pathTable = Context.PathTable; var initialDirectory = path.GetParent(pathTable); var currentPath = initialDirectory; while (currentPath.IsValid) { DirectoryArtifact directory; if (m_sealedSourceDirectories.TryGetValue(currentPath, out directory)) { // Cache the parent folder of the file so that subsequent lookups don't have to traverse the parent chain. if (currentPath != path && currentPath != initialDirectory) { m_sealedSourceDirectories.TryAdd(initialDirectory, directory); } return directory; } currentPath = currentPath.GetParent(pathTable); } return DirectoryArtifact.Invalid; } private static bool TryReserveCompletion<TKey, TResult>( ConcurrentBigMap<TKey, Task<TResult>> taskCompletionMap, TKey key, out Task<TResult> retrievedTask, out TaskSourceSlim<TResult> addedTaskCompletionSource) { Task<TResult> taskResult; if (taskCompletionMap.TryGetValue(key, out taskResult)) { retrievedTask = taskResult; addedTaskCompletionSource = default; return false; } addedTaskCompletionSource = TaskSourceSlim.Create<TResult>(); var actualMaterializationTask = taskCompletionMap.GetOrAdd(key, addedTaskCompletionSource.Task).Item.Value; if (actualMaterializationTask != addedTaskCompletionSource.Task) { retrievedTask = actualMaterializationTask; addedTaskCompletionSource = default; return false; } retrievedTask = null; return true; } /// <summary> /// Computes a content hash for a file artifact presently on disk. /// Computed content hashes are stored in the scheduler's <see cref="FileContentTable" />, if present. /// </summary> private async Task<TrackedFileContentInfo?> GetAndRecordSourceFileContentHashAsync( OperationContext operationContext, FileArtifact fileArtifact, FileOrDirectoryArtifact declaredArtifact, bool allowUndeclaredSourceReads, string consumerDescription = null) { Contract.Requires(fileArtifact.IsValid); Contract.Requires(fileArtifact.IsSourceFile); SemanticPathInfo mountInfo = SemanticPathExpander.GetSemanticPathInfo(fileArtifact.Path); // if there is a declared mount for the file, it has to allow hashing // otherwise, if there is no mount defined, we only hash the file if allowed undeclared source reads is on (and for some tests) if ((mountInfo.IsValid && mountInfo.AllowHashing) || (!mountInfo.IsValid && (TrackFilesUnderInvalidMountsForTests || allowUndeclaredSourceReads))) { return await GetAndRecordFileContentHashAsyncCore(operationContext, fileArtifact, declaredArtifact, consumerDescription); } if (!mountInfo.IsValid) { Logger.Log.ScheduleIgnoringUntrackedSourceFileNotUnderMount(operationContext, fileArtifact.Path.ToString(Context.PathTable)); } else { Logger.Log.ScheduleIgnoringUntrackedSourceFileUnderMountWithHashingDisabled( operationContext, fileArtifact.Path.ToString(Context.PathTable), mountInfo.RootName.ToString(Context.StringTable)); } Interlocked.Increment(ref m_stats.SourceFilesUntracked); return TrackedFileContentInfo.CreateUntrackedWithUnknownLength(WellKnownContentHashes.UntrackedFile); } private string GetAssociatedPipDescription(FileOrDirectoryArtifact declaredArtifact, string consumerDescription = null) { if (consumerDescription != null) { return consumerDescription; } if (declaredArtifact.IsFile) { DirectoryArtifact dynamicDirectoryArtifact; if (declaredArtifact.FileArtifact.IsSourceFile) { consumerDescription = m_host.GetConsumerDescription(declaredArtifact); if (consumerDescription != null) { return consumerDescription; } } else if (m_dynamicOutputFileDirectories.TryGetValue(declaredArtifact.FileArtifact, out dynamicDirectoryArtifact)) { declaredArtifact = dynamicDirectoryArtifact; } } return m_host.GetProducerDescription(declaredArtifact); } private async Task<TrackedFileContentInfo?> GetAndRecordFileContentHashAsyncCore( OperationContext operationContext, FileArtifact fileArtifact, FileOrDirectoryArtifact declaredArtifact, string consumerDescription = null) { using (var outerContext = operationContext.StartAsyncOperation(PipExecutorCounter.FileContentManagerGetAndRecordFileContentHashDuration, fileArtifact)) { ExpandedAbsolutePath artifactExpandedPath = fileArtifact.Path.Expand(Context.PathTable); string artifactFullPath = artifactExpandedPath.ExpandedPath; TrackedFileContentInfo fileTrackedHash; Possible<PathExistence> possibleProbeResult = LocalDiskFileSystemView.TryProbeAndTrackPathForExistence(artifactExpandedPath); if (!possibleProbeResult.Succeeded) { Logger.Log.FailedToHashInputFileDueToFailedExistenceCheck( operationContext, m_host.GetProducerDescription(declaredArtifact), artifactFullPath, possibleProbeResult.Failure.DescribeIncludingInnerFailures()); return null; } if (possibleProbeResult.Result == PathExistence.ExistsAsDirectory) { // Record the fact that this path is a directory for use by TryQuerySealedOrUndeclaredInputContent. // Special behavior is used for directories m_contentQueriedDirectoryPaths.Add(fileArtifact.Path); } if (possibleProbeResult.Result == PathExistence.ExistsAsFile) { Possible<ContentDiscoveryResult> possiblyDiscovered = await LocalDiskContentStore.TryDiscoverAsync(fileArtifact, artifactExpandedPath); DiscoveredContentHashOrigin origin; if (possiblyDiscovered.Succeeded) { fileTrackedHash = possiblyDiscovered.Result.TrackedFileContentInfo; origin = possiblyDiscovered.Result.Origin; } else { // We may fail to access a file due to permissions issues, or due to some other process that has the file locked (opened for writing?) Logger.Log.FailedToHashInputFile( operationContext, GetAssociatedPipDescription(declaredArtifact, consumerDescription), artifactFullPath, possiblyDiscovered.Failure.CreateException()); return null; } switch (origin) { case DiscoveredContentHashOrigin.NewlyHashed: if (fileArtifact.IsSourceFile) { Interlocked.Increment(ref m_stats.SourceFilesHashed); } else { Interlocked.Increment(ref m_stats.OutputFilesHashed); } Logger.Log.StorageHashedSourceFile(operationContext, artifactFullPath, fileTrackedHash.Hash.ToHex()); break; case DiscoveredContentHashOrigin.Cached: if (fileArtifact.IsSourceFile) { Interlocked.Increment(ref m_stats.SourceFilesUnchanged); } else { Interlocked.Increment(ref m_stats.OutputFilesUnchanged); } Logger.Log.StorageUsingKnownHashForSourceFile(operationContext, artifactFullPath, fileTrackedHash.Hash.ToHex()); break; default: throw Contract.AssertFailure("Unhandled DiscoveredContentHashOrigin"); } } else if (possibleProbeResult.Result == PathExistence.ExistsAsDirectory) { // Attempted to query the hash of a directory // Case 1: For declared source files when TreatDirectoryAsAbsentFileOnHashingInputContent=true, we treat them as absent file hash // Case 2: For declared source files when TreatDirectoryAsAbsentFileOnHashingInputContent=false, we return null and error // Case 3: For other files (namely paths under sealed source direcotories or outputs), we return null. Outputs will error. Paths under // sealed source directories will be handled by ObservedInputProcessor which will treat them as Enumeration/DirectoryProbe. if (fileArtifact.IsSourceFile && declaredArtifact.IsFile) { // Declared source file if (Configuration.Schedule.TreatDirectoryAsAbsentFileOnHashingInputContent) { // Case 1: fileTrackedHash = TrackedFileContentInfo.CreateUntrackedWithUnknownLength(WellKnownContentHashes.AbsentFile, possibleProbeResult.Result); } else { // Case 2: // We only log the warning for hash source file pips Logger.Log.FailedToHashInputFileBecauseTheFileIsDirectory( operationContext, GetAssociatedPipDescription(declaredArtifact, consumerDescription), artifactFullPath); // This should error return null; } } else { // Case 3: // Path under sealed source directory // Caller will not error since this is a valid operation. ObservedInputProcessor will later discover that this is a directory return null; } } else { Interlocked.Increment(ref m_stats.SourceFilesAbsent); fileTrackedHash = TrackedFileContentInfo.CreateUntrackedWithUnknownLength(WellKnownContentHashes.AbsentFile, possibleProbeResult.Result); } if (BuildXL.Scheduler.ETWLogger.Log.IsEnabled(BuildXL.Tracing.Diagnostics.EventLevel.Verbose, Keywords.Diagnostics)) { if (fileArtifact.IsSourceFile) { Logger.Log.ScheduleHashedSourceFile(operationContext, artifactFullPath, fileTrackedHash.Hash.ToHex()); } else { Logger.Log.ScheduleHashedOutputFile( operationContext, GetAssociatedPipDescription(declaredArtifact, consumerDescription), artifactFullPath, fileTrackedHash.Hash.ToHex()); } } return fileTrackedHash; } } private FileRealizationMode GetFileRealizationMode(bool allowReadOnly) { return Configuration.Engine.UseHardlinks && allowReadOnly ? FileRealizationMode.HardLinkOrCopy // Prefers hardlinks, but will fall back to copying when creating a hard link fails. (e.g. >1023 links) : FileRealizationMode.Copy; } private void UpdateOutputContentStats(PipOutputOrigin origin) { switch (origin) { case PipOutputOrigin.UpToDate: Interlocked.Increment(ref m_stats.OutputsUpToDate); break; case PipOutputOrigin.DeployedFromCache: Interlocked.Increment(ref m_stats.OutputsDeployed); break; case PipOutputOrigin.Produced: Interlocked.Increment(ref m_stats.OutputsProduced); break; case PipOutputOrigin.NotMaterialized: break; default: throw Contract.AssertFailure("Unhandled PipOutputOrigin"); } } private bool ReportContent( FileArtifact fileArtifact, in FileMaterializationInfo fileMaterializationInfo, PipOutputOrigin origin, bool doubleWriteErrorsAreWarnings = false) { SetFileArtifactContentHashResult result = SetFileArtifactContentHash( fileArtifact, fileMaterializationInfo, origin); // Notify the host with content that was reported m_host.ReportContent(fileArtifact, fileMaterializationInfo, origin); if (result == SetFileArtifactContentHashResult.Added) { return true; } if (result == SetFileArtifactContentHashResult.HasMatchingExistingEntry) { return false; } Contract.Equals(SetFileArtifactContentHashResult.HasConflictingExistingEntry, result); var existingInfo = m_fileArtifactContentHashes[fileArtifact]; if (!Configuration.Sandbox.UnsafeSandboxConfiguration.UnexpectedFileAccessesAreErrors || doubleWriteErrorsAreWarnings) { // If we reached this case and UnexpectedFileAccessesAreErrors is false or // pip level option doubleWriteErrorsAreWarnings is set to true, that means // the flag supressed a double write violation detection. So let's just warn // and move on. Logger.Log.FileArtifactContentMismatch( m_host.LoggingContext, fileArtifact.Path.ToString(Context.PathTable), existingInfo.Hash.ToHex(), fileMaterializationInfo.Hash.ToHex()); return false; } throw Contract.AssertFailure(I($"Content hash of file artifact '{fileArtifact.Path.ToString(Context.PathTable)}:{fileArtifact.RewriteCount}' can be set multiple times, but only with the same content hash (old hash: {existingInfo.Hash.ToHex()}, new hash: {fileMaterializationInfo.Hash.ToHex()})")); } private enum SetFileArtifactContentHashResult { /// <summary> /// Found entry with differing content hash /// </summary> HasConflictingExistingEntry, /// <summary> /// Found entry with the same content hash /// </summary> HasMatchingExistingEntry, /// <summary> /// New entry was added with the given content hash /// </summary> Added, } /// <summary> /// Records the given file artifact as having the given content hash. /// </summary> private SetFileArtifactContentHashResult SetFileArtifactContentHash( FileArtifact fileArtifact, in FileMaterializationInfo fileMaterializationInfo, PipOutputOrigin origin) { Contract.Requires(fileArtifact.IsValid, "Argument fileArtifact must be valid"); AssertFileNamesMatch(Context, fileArtifact, fileMaterializationInfo); var result = m_fileArtifactContentHashes.GetOrAdd(fileArtifact, fileMaterializationInfo); if (result.IsFound) { FileContentInfo storedFileContentInfo = result.Item.Value.FileContentInfo; if (storedFileContentInfo.Hash != fileMaterializationInfo.Hash) { // We allow the same hash to be reported multiple times, but only with the same content hash. return SetFileArtifactContentHashResult.HasConflictingExistingEntry; } if (storedFileContentInfo.HasKnownLength && fileMaterializationInfo.FileContentInfo.HasKnownLength && storedFileContentInfo.Length != fileMaterializationInfo.Length) { Contract.Assert(false, $"File length mismatch for file '{fileMaterializationInfo.FileName}' :: " + $"arg = {{ hash: {fileMaterializationInfo.Hash.ToHex()}, length: {fileMaterializationInfo.Length} }}, " + $"stored = {{ hash: {storedFileContentInfo.Hash.ToHex()}, length: {storedFileContentInfo.Length}, rawLength: {storedFileContentInfo.RawLength}, existence: {storedFileContentInfo.Existence} }}"); } } bool added = !result.IsFound; var contentId = new ContentId(result.Index); var contentSetItem = new ContentIdSetItem(contentId, fileMaterializationInfo.Hash, this); bool? isNewContent = null; if (origin != PipOutputOrigin.NotMaterialized) { // Mark the file as materialized // Due to StoreNoOutputToCache, we need to update the materialization task. // For copy file pip, with StoreNoOutputToCache enabled, BuildXL first tries to materialize the output, but // because the output is most likely not in the cache, TryLoadAvailableContent will fail and subsequently // will set the materialization task for the output file to NotMaterialized. var originAsTask = ToTask(origin); var addOrUpdateResult = m_materializationTasks.AddOrUpdate( fileArtifact, ToTask(origin), (f, newOrigin) => newOrigin, (f, newOrigin, oldOrigin) => oldOrigin.Result == PipOutputOrigin.NotMaterialized ? newOrigin : oldOrigin); if (!addOrUpdateResult.IsFound || addOrUpdateResult.OldItem.Value.Result == PipOutputOrigin.NotMaterialized) { EnsureHashMappedToMaterializedFile(contentSetItem, isNewContent: out isNewContent); } m_host.ReportMaterializedArtifact(fileArtifact); } if (added) { if (fileMaterializationInfo.FileContentInfo.HasKnownLength && (isNewContent ?? m_allCacheContentHashes.AddItem(contentSetItem))) { if (fileArtifact.IsOutputFile) { Interlocked.Add(ref m_stats.TotalCacheSizeNeeded, fileMaterializationInfo.Length); } } ExecutionLog?.FileArtifactContentDecided(new FileArtifactContentDecidedEventData { FileArtifact = fileArtifact, FileContentInfo = fileMaterializationInfo.FileContentInfo, OutputOrigin = origin, }); return SetFileArtifactContentHashResult.Added; } return SetFileArtifactContentHashResult.HasMatchingExistingEntry; } /// <summary> /// Gets whether a file artifact is materialized /// </summary> private bool IsFileMaterialized(FileArtifact file) { Task<PipOutputOrigin> materializationResult; return m_materializationTasks.TryGetValue(file, out materializationResult) && materializationResult.IsCompleted && materializationResult.Result != PipOutputOrigin.NotMaterialized; } private bool AllowFileReadOnly(FileArtifact file) { Contract.Requires(file.IsValid); // File can be a dynamic output. First get the declared artifact. FileOrDirectoryArtifact declaredArtifact = GetDeclaredArtifact(file); return m_host.AllowArtifactReadOnly(declaredArtifact); } private bool IsPreservedOutputFile(Pip pip, bool materializingOutput, FileArtifact file) { Contract.Requires(file.IsValid); if (Configuration.Sandbox.UnsafeSandboxConfiguration.PreserveOutputs == PreserveOutputsMode.Disabled) { return false; } if (!materializingOutput) { // File can be a dynamic output. First get the declared artifact. FileOrDirectoryArtifact declaredArtifact = GetDeclaredArtifact(file); return m_host.IsPreservedOutputArtifact(declaredArtifact); } var pipId = m_host.TryGetProducerId(file); // If the producer is invalid, the file is a dynamic output under a directory output. // As the pip did not run yet and sealContents is not populated, we cannot easily get // declared directory artifact for the given dynamic file. return PipArtifacts.IsPreservedOutputByPip(pip, file, Context.PathTable, isDynamicFileOutput: !pipId.IsValid); } /// <summary> /// Adds the mapping of hash to file into <see cref="m_allCacheContentHashes"/> /// </summary> private void EnsureHashMappedToMaterializedFile(ContentIdSetItem materializedFileContentItem, out bool? isNewContent) { // Update m_allCacheContentHashes to point to the content hash for a materialized // file (used to recover content which cannot be materialized because it is not available in // the cache by storing the content from the materialized file). // Only updated if current value does not point to materialized file to avoid // lock contention with lots of files with the same content (not known to be a problem // but this logic is added as a precaution) var hashAddResult = m_allCacheContentHashes.GetOrAddItem(materializedFileContentItem); isNewContent = !hashAddResult.IsFound; if (hashAddResult.IsFound) { // Only update m_allCacheContentHashes if there was already an entry // and it was not materialized FileArtifact contentFile = hashAddResult.Item.GetFile(this); if (!IsFileMaterialized(contentFile)) { m_allCacheContentHashes.UpdateItem(materializedFileContentItem); } } } /// <summary> /// Attempts to get the file artifact which has the given hash (if any) /// </summary> private FileArtifact TryGetFileArtifactForHash(ContentHash hash) { ContentId contentId; if (m_allCacheContentHashes.TryGetItem(new ContentIdSetItem(hash, this), out contentId)) { var file = contentId.GetFile(this); if (IsFileMaterialized(file) || m_host.CanMaterializeFile(file)) { return file; } } return FileArtifact.Invalid; } private void LogOutputOrigin(OperationContext operationContext, string pipDescription, string path, in FileMaterializationInfo info, PipOutputOrigin origin) { string hashHex = info.Hash.ToHex(); string reparsePointInfo = info.ReparsePointInfo.ToString(); switch (origin) { case PipOutputOrigin.Produced: Logger.Log.SchedulePipOutputProduced(operationContext, pipDescription, path, hashHex, reparsePointInfo); break; case PipOutputOrigin.UpToDate: Logger.Log.SchedulePipOutputUpToDate(operationContext, pipDescription, path, hashHex, reparsePointInfo); break; case PipOutputOrigin.NotMaterialized: Logger.Log.SchedulePipOutputNotMaterialized(operationContext, pipDescription, path, hashHex, reparsePointInfo); break; default: Contract.Assert(origin == PipOutputOrigin.DeployedFromCache, "Unhandled PipOutputOrigin"); Logger.Log.SchedulePipOutputDeployedFromCache(operationContext, pipDescription, path, hashHex, reparsePointInfo); break; } UpdateOutputContentStats(origin); } private static void AssertFileNamesMatch(PipExecutionContext context, FileArtifact fileArtifact, in FileMaterializationInfo fileMaterializationInfo) { Contract.Requires(fileArtifact.IsValid); if (!fileMaterializationInfo.FileName.IsValid) { return; } PathAtom fileArtifactFileName = fileArtifact.Path.GetName(context.PathTable); if (!fileMaterializationInfo.FileName.CaseInsensitiveEquals(context.StringTable, fileArtifactFileName)) { string fileArtifactPathString = fileArtifact.Path.ToString(context.PathTable); string fileMaterializationFileNameString = fileMaterializationInfo.FileName.ToString(context.StringTable); Contract.Assert( false, I($"File name should only differ by casing. File artifact's full path: '{fileArtifactPathString}'; file artifact's file name: '{fileArtifactFileName.ToString(context.StringTable)}'; materialization info file name: '{fileMaterializationFileNameString}'")); } } /// <summary> /// Reports schedule stats that are relevant at the completion of a build. /// </summary> public void LogStats(LoggingContext loggingContext) { Logger.Log.StorageCacheContentHitSources(loggingContext, m_cacheContentSource); Dictionary<string, long> statistics = new Dictionary<string, long> { { Statistics.TotalCacheSizeNeeded, m_stats.TotalCacheSizeNeeded } }; Logger.Log.CacheTransferStats( loggingContext, tryBringContentToLocalCacheCounts: Volatile.Read(ref m_stats.TryBringContentToLocalCache), artifactsBroughtToLocalCacheCounts: Volatile.Read(ref m_stats.ArtifactsBroughtToLocalCache), totalSizeArtifactsBroughtToLocalCache: ((double)Volatile.Read(ref m_stats.TotalSizeArtifactsBroughtToLocalCache)) / (1024 * 1024)); Logger.Log.SourceFileHashingStats( loggingContext, sourceFilesHashed: Volatile.Read(ref m_stats.SourceFilesHashed), sourceFilesUnchanged: Volatile.Read(ref m_stats.SourceFilesUnchanged), sourceFilesUntracked: Volatile.Read(ref m_stats.SourceFilesUntracked), sourceFilesAbsent: Volatile.Read(ref m_stats.SourceFilesAbsent)); Logger.Log.OutputFileHashingStats( loggingContext, outputFilesHashed: Volatile.Read(ref m_stats.OutputFilesHashed), outputFilesUnchanged: Volatile.Read(ref m_stats.OutputFilesUnchanged)); statistics.Add(Statistics.OutputFilesChanged, m_stats.OutputFilesHashed); statistics.Add(Statistics.OutputFilesUnchanged, m_stats.OutputFilesUnchanged); statistics.Add(Statistics.SourceFilesChanged, m_stats.SourceFilesHashed); statistics.Add(Statistics.SourceFilesUnchanged, m_stats.SourceFilesUnchanged); statistics.Add(Statistics.SourceFilesUntracked, m_stats.SourceFilesUntracked); statistics.Add(Statistics.SourceFilesAbsent, m_stats.SourceFilesAbsent); Logger.Log.OutputFileStats( loggingContext, outputFilesNewlyCreated: Volatile.Read(ref m_stats.OutputsProduced), outputFilesDeployed: Volatile.Read(ref m_stats.OutputsDeployed), outputFilesUpToDate: Volatile.Read(ref m_stats.OutputsUpToDate)); statistics.Add(Statistics.OutputFilesProduced, m_stats.OutputsProduced); statistics.Add(Statistics.OutputFilesCopiedFromCache, m_stats.OutputsDeployed); statistics.Add(Statistics.OutputFilesUpToDate, m_stats.OutputsUpToDate); int numDirectoryArtifacts = m_sealContents.Count; long numFileArtifacts = 0; foreach (var kvp in m_sealContents) { numFileArtifacts += kvp.Value.Length; } statistics.Add("FileContentManager_SealContents_NumDirectoryArtifacts", numDirectoryArtifacts); statistics.Add("FileContentManager_SealContents_NumFileArtifacts", numFileArtifacts); BuildXL.Tracing.Logger.Log.BulkStatistic(loggingContext, statistics); } private Task<PipOutputOrigin> ToTask(PipOutputOrigin origin) { return m_originTasks[(int)origin]; } /// <summary> /// A content id representing an index into <see cref="m_fileArtifactContentHashes"/> referring /// to a file and hash /// </summary> private readonly struct ContentId { public static readonly ContentId Invalid = new ContentId(-1); public bool IsValid => FileArtifactContentHashesIndex >= 0; public readonly int FileArtifactContentHashesIndex; public ContentId(int fileArtifactContentHashesIndex) { FileArtifactContentHashesIndex = fileArtifactContentHashesIndex; } private KeyValuePair<FileArtifact, FileMaterializationInfo> GetEntry(FileContentManager manager) { Contract.Assert(FileArtifactContentHashesIndex >= 0); return manager .m_fileArtifactContentHashes .BackingSet[FileArtifactContentHashesIndex]; } public ContentHash GetHash(FileContentManager manager) { FileMaterializationInfo info = GetEntry(manager).Value; return info.Hash; } public FileArtifact GetFile(FileContentManager manager) { return GetEntry(manager).Key; } } /// <summary> /// Wrapper for adding a content id (index into <see cref="m_fileArtifactContentHashes"/>) to a concurrent /// big set keyed by hash and also for looking up content id by hash. /// </summary> private readonly struct ContentIdSetItem : IPendingSetItem<ContentId> { private readonly ContentId m_contentId; private readonly FileContentManager m_manager; private readonly ContentHash m_hash; public ContentIdSetItem(ContentId contentId, ContentHash hash, FileContentManager manager) { m_contentId = contentId; m_manager = manager; m_hash = hash; } public ContentIdSetItem(ContentHash hash, FileContentManager manager) { m_contentId = ContentId.Invalid; m_manager = manager; m_hash = hash; } public int HashCode => m_hash.GetHashCode(); public ContentId CreateOrUpdateItem(ContentId oldItem, bool hasOldItem, out bool remove) { remove = false; Contract.Assert(m_contentId.IsValid); return m_contentId; } public bool Equals(ContentId other) { return m_hash.Equals(other.GetHash(m_manager)); } } private struct MaterializationFile { public readonly FileArtifact Artifact; public readonly FileMaterializationInfo MaterializationInfo; public readonly bool AllowReadOnly; public readonly TaskSourceSlim<PipOutputOrigin> MaterializationCompletion; public Task PriorArtifactVersionCompletion; public readonly AbsolutePath SymlinkTarget; public bool CreateSymlink => SymlinkTarget.IsValid; public MaterializationFile( FileArtifact artifact, FileMaterializationInfo materializationInfo, bool allowReadOnly, TaskSourceSlim<PipOutputOrigin> materializationCompletion, Task priorArtifactVersionCompletion, AbsolutePath symlinkTarget) { Artifact = artifact; MaterializationInfo = materializationInfo; AllowReadOnly = allowReadOnly; MaterializationCompletion = materializationCompletion; PriorArtifactVersionCompletion = priorArtifactVersionCompletion; SymlinkTarget = symlinkTarget; } } /// <summary> /// Pooled state used by hashing and materialization operations /// </summary> private sealed class PipArtifactsState : IDisposable { private readonly FileContentManager m_manager; public PipArtifactsState(FileContentManager manager) { m_manager = manager; } /// <summary> /// The pip info for the materialization operation /// </summary> public PipInfo PipInfo { get; set; } /// <summary> /// Indicates whether content is materialized for verification purposes only /// </summary> public bool VerifyMaterializationOnly { get; set; } /// <summary> /// Indicates whether the operation is materializing outputs /// </summary> public bool MaterializingOutputs { get; set; } /// <summary> /// Indicates pip is the declared producer for the materialized files /// </summary> public bool IsDeclaredProducer { get; set; } /// <summary> /// The overall output origin result for materializing outputs /// </summary> public PipOutputOrigin OverallOutputOrigin { get; private set; } = PipOutputOrigin.NotMaterialized; /// <summary> /// The materialized file paths in all materialized directories /// </summary> public readonly HashSet<AbsolutePath> MaterializedDirectoryContents = new HashSet<AbsolutePath>(); /// <summary> /// All the artifacts to process /// </summary> public readonly HashSet<FileOrDirectoryArtifact> PipArtifacts = new HashSet<FileOrDirectoryArtifact>(); /// <summary> /// The completion results for directory deletions /// </summary> public readonly List<(DirectoryArtifact, TaskSourceSlim<bool>)> DirectoryDeletionCompletions = new List<(DirectoryArtifact, TaskSourceSlim<bool>)>(); /// <summary> /// Required directory deletions initiated by other pips which must be awaited /// </summary> public readonly List<Task<bool>> PendingDirectoryDeletions = new List<Task<bool>>(); /// <summary> /// The set of files to materialize /// </summary> public readonly List<MaterializationFile> MaterializationFiles = new List<MaterializationFile>(); /// <summary> /// The paths and content hashes for files in <see cref="MaterializationFiles"/> /// </summary> private readonly List<(FileArtifact, ContentHash, int)> m_filesAndContentHashes = new List<(FileArtifact, ContentHash, int)>(); /// <summary> /// The tasks for hashing files /// </summary> public readonly List<Task<FileMaterializationInfo?>> HashTasks = new List<Task<FileMaterializationInfo?>>(); /// <summary> /// Materialization tasks initiated by other pips which must be awaited /// </summary> public readonly List<(FileArtifact fileArtifact, Task<PipOutputOrigin> tasks)> PendingPlacementTasks = new List<(FileArtifact, Task<PipOutputOrigin>)>(); /// <summary> /// Materialization tasks initiated by the current pip /// </summary> public readonly List<Task> PlacementTasks = new List<Task>(); /// <summary> /// Files which failed to materialize /// </summary> private readonly List<(FileArtifact, ContentHash)> m_failedFiles = new List<(FileArtifact, ContentHash)>(); /// <summary> /// Directories which failed to materialize /// </summary> private readonly List<DirectoryArtifact> m_failedDirectories = new List<DirectoryArtifact>(); /// <nodoc /> public Failure InnerFailure = null; /// <summary> /// Get the content hashes for <see cref="MaterializationFiles"/> /// </summary> public IReadOnlyList<(FileArtifact, ContentHash, int)> GetCacheMaterializationContentHashes() { m_filesAndContentHashes.Clear(); for (int i = 0; i < MaterializationFiles.Count; i++) { var file = MaterializationFiles[i]; if (!(file.CreateSymlink || file.MaterializationInfo.IsReparsePointActionable) && !m_manager.m_host.CanMaterializeFile(file.Artifact)) { m_filesAndContentHashes.Add((file.Artifact, file.MaterializationInfo.Hash, i)); } } return m_filesAndContentHashes; } public void Dispose() { MaterializingOutputs = false; IsDeclaredProducer = false; VerifyMaterializationOnly = false; PipInfo = null; OverallOutputOrigin = PipOutputOrigin.NotMaterialized; MaterializedDirectoryContents.Clear(); PipArtifacts.Clear(); DirectoryDeletionCompletions.Clear(); PendingDirectoryDeletions.Clear(); MaterializationFiles.Clear(); m_filesAndContentHashes.Clear(); HashTasks.Clear(); PendingPlacementTasks.Clear(); PlacementTasks.Clear(); m_failedFiles.Clear(); m_failedDirectories.Clear(); InnerFailure = null; m_manager.m_statePool.Enqueue(this); } /// <summary> /// Gets the materialization failure. NOTE: This should only be called when the materialization result is not successful /// </summary> public ArtifactMaterializationFailure GetFailure() { Contract.Assert(m_failedFiles.Count != 0 || m_failedDirectories.Count != 0); return new ArtifactMaterializationFailure(m_failedFiles.ToReadOnlyArray(), m_failedDirectories.ToReadOnlyArray(), m_manager.m_host.Context.PathTable, InnerFailure); } /// <summary> /// Set the materialization result for the file to failure /// </summary> public void SetMaterializationFailure(int fileIndex) { var failedFile = MaterializationFiles[fileIndex]; AddFailedFile(failedFile.Artifact, failedFile.MaterializationInfo.FileContentInfo.Hash); SetMaterializationResult(fileIndex, success: false); } /// <summary> /// Adds a failed file /// </summary> public void AddFailedFile(FileArtifact file, ContentHash contentHash) { lock (m_failedFiles) { m_failedFiles.Add((file, contentHash)); } } /// <summary> /// Adds a failed directory /// </summary> public void AddFailedDirectory(DirectoryArtifact directory) { lock (m_failedDirectories) { m_failedDirectories.Add(directory); } } /// <summary> /// Ensures that the materialization of the specified file is not started until after the given /// completion of an artifact dependency (i.e. host materialized files). /// </summary> public void SetDependencyArtifactCompletion(int fileIndex, Task dependencyArtifactCompletion) { var materializationFile = MaterializationFiles[fileIndex]; var priorArtifactCompletion = materializationFile.PriorArtifactVersionCompletion; if (priorArtifactCompletion != null && !priorArtifactCompletion.IsCompleted) { // Wait for prior artifact and the dependency artifact before attempting materialization priorArtifactCompletion = Task.WhenAll(dependencyArtifactCompletion, priorArtifactCompletion); } else { // No outstanding prior artifact, just wait for the dependency artifact before attempting materialization priorArtifactCompletion = dependencyArtifactCompletion; } materializationFile.PriorArtifactVersionCompletion = priorArtifactCompletion; MaterializationFiles[fileIndex] = materializationFile; } /// <summary> /// Set the materialization result for the file to success with the given <see cref="PipOutputOrigin"/> /// </summary> public void SetMaterializationSuccess(int fileIndex, ContentMaterializationOrigin origin, OperationContext operationContext) { PipOutputOrigin result = origin.ToPipOutputOrigin(); if (!VerifyMaterializationOnly) { MaterializationFile materializationFile = MaterializationFiles[fileIndex]; var file = materializationFile.Artifact; if (file.IsOutputFile && (IsDeclaredProducer || m_manager.TryGetDeclaredProducerId(file).IsValid)) { var producer = IsDeclaredProducer ? PipInfo.UnderlyingPip : m_manager.GetDeclaredProducer(file); result = GetPipOutputOrigin(origin, producer); var producerDescription = IsDeclaredProducer ? PipInfo.Description : producer.GetDescription(m_manager.Context); m_manager.LogOutputOrigin( operationContext, producerDescription, file.Path.ToString(m_manager.Context.PathTable), materializationFile.MaterializationInfo, result); // Notify the host that output content for a pip was materialized // NOTE: This is specifically for use when materializing outputs // to preserve legacy behavior for tests. m_manager.m_host.ReportContent(file, materializationFile.MaterializationInfo, result); } } SetMaterializationResult(fileIndex, success: true, result: result); } private void SetMaterializationResult(int materializationFileIndex, bool success, PipOutputOrigin result = PipOutputOrigin.NotMaterialized) { Contract.Requires(result != PipOutputOrigin.NotMaterialized || !success, "Successfully materialization cannot have NotMaterialized result"); MaterializationFile file = MaterializationFiles[materializationFileIndex]; file.MaterializationCompletion.SetResult(result); if (!VerifyMaterializationOnly) { // Normalize to task results to shared cached pip origin tasks to save memory m_manager.m_materializationTasks[file.Artifact] = m_manager.ToTask(result); } m_manager.m_currentlyMaterializingFilesByPath.CompareRemove(file.Artifact.Path, file.Artifact); MergeResult(result); } /// <summary> /// Combines the individual result with <see cref="OverallOutputOrigin"/> /// </summary> public void MergeResult(PipOutputOrigin result) { lock (this) { // Merged result is result with highest precedence OverallOutputOrigin = GetMergePrecedence(result) > GetMergePrecedence(OverallOutputOrigin) ? result : OverallOutputOrigin; } } private static int GetMergePrecedence(PipOutputOrigin origin) { switch (origin) { case PipOutputOrigin.Produced: // Takes precedence over all other results. Producing any content // means the pip result is produced return 3; case PipOutputOrigin.DeployedFromCache: // Pip result is deployed from cache if its outputs are up to date or deployed // deployed from cache return 2; case PipOutputOrigin.UpToDate: // Pip result is only up to date if all its outputs are up to date return 1; case PipOutputOrigin.NotMaterialized: return 0; default: throw Contract.AssertFailure(I($"Unexpected PipOutputOrigin: {origin}")); } } /// <summary> /// Adds a file to be materialized /// </summary> public void AddMaterializationFile( FileArtifact fileToMaterialize, bool allowReadOnly, in FileMaterializationInfo materializationInfo, TaskSourceSlim<PipOutputOrigin> materializationCompletion, AbsolutePath symlinkTarget) { Contract.Assert(PipInfo != null, "PipInfo must be set to materialize files"); var result = m_manager.m_currentlyMaterializingFilesByPath.AddOrUpdate( fileToMaterialize.Path, fileToMaterialize, (path, file) => file, (path, file, oldFile) => file.RewriteCount > oldFile.RewriteCount ? file : oldFile); Task priorArtifactCompletion = Unit.VoidTask; // Only materialize the file if it is the latest version bool isLatestVersion = result.Item.Value == fileToMaterialize; if (isLatestVersion) { if (result.IsFound && result.OldItem.Value != fileToMaterialize) { priorArtifactCompletion = m_manager.m_materializationTasks[result.OldItem.Value]; } // Populate collections with corresponding information for files MaterializationFiles.Add(new MaterializationFile( fileToMaterialize, materializationInfo, allowReadOnly, materializationCompletion, priorArtifactCompletion, symlinkTarget)); } else { // File is not materialized because it is not the latest file version materializationCompletion.SetResult(PipOutputOrigin.NotMaterialized); } } /// <summary> /// Remove completed materializations /// </summary> public void RemoveCompletedMaterializations() { MaterializationFiles.RemoveAll(file => file.MaterializationCompletion.Task.IsCompleted); } } } }
48.482297
310
0.545977
[ "MIT" ]
buildxl-team-collab/BuildXL
Public/Src/Engine/Scheduler/Artifacts/FileContentManager.cs
184,863
C#
using BaseLib.Media; using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Linq; using System.Reflection; namespace BaseLib { public static class Time { public static long FromTicks(long ticks, long timeBase) { return Convert.ToInt64((double)ticks * timeBase / 10000000.0); } public static long ToTick(long time, long timeBase) { return Convert.ToInt64(time * 10000000.0 / timeBase); } public static long GetTime(long frame, FPS fps, long timebase) { return (long)((double)fps.Number.num * frame * timebase / fps.Number.den); } public static long GetFrame(long time, FPS fps, long timebase) { return (long)(double)((time * (double)fps.Number.den) / (timebase * fps.Number.num)); } } } namespace BaseLib { public class ExpandTypeConverter : TypeConverter { public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return true; } public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { if (value != null) { return GetProperties(value, attributes); } return base.GetProperties(context, value, attributes); } public virtual PropertyDescriptorCollection GetProperties(object value, Attribute[] attributes) { List<PropertyDescriptor> props = new List<PropertyDescriptor>(); foreach (MemberInfo m in value.GetType().GetMembers( BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)) { bool ok = false; Type t = null; object v = null; if (m is PropertyInfo) { if ((m as PropertyInfo).GetIndexParameters().Length == 0) { t = (m as PropertyInfo).PropertyType; ok = true; } } else if (m is FieldInfo) { if ((m as FieldInfo).FieldType == typeof(EventHandler)) ok = false; else { t = (m as FieldInfo).FieldType; ok = true; } } if (ok) { foreach (Attribute a in attributes) { Attribute aa = m.GetCustomAttributes(a.GetType(), true).OfType<Attribute>().FirstOrDefault(); if (aa != null) { string name = aa.GetType().Name; if (name.EndsWith("Attribute")) { PropertyInfo prop = aa.GetType().GetProperty( name.Substring(0, name.Length - 9), BindingFlags.Public | BindingFlags.Instance); ok = (bool)prop.GetValue(a, null) == (bool)prop.GetValue(aa, null); } } if (!ok) { break; } } if (ok) { List<Attribute> aa = new List<Attribute>(); if (m is PropertyInfo) { if ((m as PropertyInfo).GetIndexParameters().Length == 0) { v = (m as PropertyInfo).GetValue(value, null); } } else if (m is FieldInfo) { v = (m as FieldInfo).GetValue(value); } if (v != null) { foreach (Attribute a in TypeDescriptor.GetAttributes(v.GetType(), false)) { aa.Add(a); } foreach (Attribute a in v.GetType().GetCustomAttributes(true)) { aa.Add(a); } } foreach (Attribute a in TypeDescriptor.GetAttributes(t, false)) { aa.Add(a); } foreach (Attribute a in t.GetCustomAttributes(true)) { aa.Add(a); } foreach (Attribute a in m.GetCustomAttributes(true)) { aa.Add(a); } // Attribute[] a = new Attribute[o.Length]; // o.CopyTo(a, 0); props.Add(new ExpandPropertyDescriptor(m, aa.ToArray())); } } } return new PropertyDescriptorCollection(props.ToArray()); } public class ExpandPropertyDescriptor : PropertyDescriptor { MemberInfo info; bool isreadonly; public ExpandPropertyDescriptor(MemberInfo m, Attribute[] a) : base(m.Name, a) { this.info = m; this.isreadonly = ((ReadOnlyAttribute)new List<Attribute>(a).Find(_a => _a is ReadOnlyAttribute) ?? new ReadOnlyAttribute(false)).IsReadOnly; } public override bool CanResetValue(object component) { return false; } public override Type ComponentType { get { return info.ReflectedType; } } public override object GetValue(object component) { if (info is PropertyInfo) { return (info as PropertyInfo).GetValue(component, null); } else if (info is FieldInfo) { return (info as FieldInfo).GetValue(component); } throw new NotImplementedException(); } public override bool IsReadOnly { get { return this.isreadonly; } } public override Type PropertyType { get { if (info is PropertyInfo) { return (info as PropertyInfo).PropertyType; } else if (info is FieldInfo) { return (info as FieldInfo).FieldType; }; throw new NotImplementedException(); } } public override void ResetValue(object component) { } private Type FieldPropertyType { get { if (info is FieldInfo) { return (info as FieldInfo).FieldType; } if (info is PropertyInfo) { return (info as PropertyInfo).PropertyType; } throw new NotImplementedException(); } } public override void SetValue(object component, object value) { if (value != null) { if (value.GetType() != FieldPropertyType) { TypeConverter converter = TypeDescriptor.GetConverter(FieldPropertyType); if (converter != null) { if (converter.CanConvertFrom(value.GetType())) { value = converter.ConvertFrom(value); } } } } if (info is PropertyInfo) { (info as PropertyInfo).SetValue(component, value, null); } else if (info is FieldInfo) { (info as FieldInfo).SetValue(component, value); } } public override bool ShouldSerializeValue(object component) { return false; } } } public class EnumDescriptionConverter<T> : EnumConverter where T : Enum { public EnumDescriptionConverter() : base(typeof(T)) { } public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof(string)) { return true; } return base.CanConvertFrom(context, sourceType); } public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(string)) { return true; } return base.CanConvertTo(context, destinationType); } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string) { var v = Enum.GetValues(typeof(T)).Cast<T>().FirstOrDefault(_v => GetDescription(_v) == (string)value); if (GetDescription(v) == (string)value) { return v; } } return base.ConvertFrom(context, culture, value); } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(string)) { return GetDescription((T)value); } return base.ConvertTo(context, culture, value, destinationType); } public static string GetDescription(Enum value) { return value.GetType().GetField(value.ToString()). GetCustomAttributes(typeof(DescriptionAttribute), false). OfType<DescriptionAttribute>(). Select(_d => _d.Description). FirstOrDefault() ?? value.ToString(); } } }
36.092715
157
0.437982
[ "MIT" ]
Bert1974/BB74.Media.Xwt
BB74.Media.Base/Time.cs
10,902
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 Trust.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
35.16129
152
0.563303
[ "MIT" ]
crazyxhz/TrustSelfSignedCertificates
src/Trust/Properties/Settings.Designer.cs
1,092
C#
namespace Allie.Chat.Lib.Requests.Users { /// <summary> /// A Twitch User update request /// </summary> public class UserTwitchUpdateRequest : UserUpdateRequest { } }
19.2
60
0.640625
[ "Apache-2.0" ]
LiveOrDevTrying/Allie.Chat
Allie.Chat.Lib/Requests/Users/UserTwitchUpdateRequest.cs
194
C#
using System; using Newtonsoft.Json; namespace LetterApp.Models.DTO.RequestModels { public class PasswordChangeRequestModel { public PasswordChangeRequestModel(string email, string newPassword, string requestedCode) { Email = email; NewPassword = newPassword; RequestedCode = requestedCode; } [JsonProperty("email")] public string Email { get; set; } [JsonProperty("new_password")] public string NewPassword { get; set; } [JsonProperty("activation_code")] public string RequestedCode { get; set; } } public class UserChangePassword { public UserChangePassword(string oldPassword, string newPassword) { OldPassword = oldPassword; NewPassword = newPassword; } [JsonProperty("old_password")] public string OldPassword { get; set; } [JsonProperty("new_password")] public string NewPassword { get; set; } } public class UserDeleteAccount { public UserDeleteAccount(string password) { Password = password; } [JsonProperty("password")] public string Password { get; set; } } }
26.104167
97
0.605746
[ "MIT" ]
joaowd/Letter
LetterApp.Core/Models/DTO/RequestModels/PasswordChangeRequestModel.cs
1,255
C#
namespace GreenCap.Data.Migrations { using System; using Microsoft.EntityFrameworkCore.Migrations; public partial class TestMigration : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "CreatedOn", table: "UserLikes"); migrationBuilder.DropColumn( name: "Id", table: "UserLikes"); migrationBuilder.DropColumn( name: "ModifiedOn", table: "UserLikes"); migrationBuilder.DropColumn( name: "CreatedOn", table: "UserEvents"); migrationBuilder.DropColumn( name: "Id", table: "UserEvents"); migrationBuilder.DropColumn( name: "ModifiedOn", table: "UserEvents"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn<DateTime>( name: "CreatedOn", table: "UserLikes", type: "datetime2", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddColumn<int>( name: "Id", table: "UserLikes", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn<DateTime>( name: "ModifiedOn", table: "UserLikes", type: "datetime2", nullable: true); migrationBuilder.AddColumn<DateTime>( name: "CreatedOn", table: "UserEvents", type: "datetime2", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddColumn<int>( name: "Id", table: "UserEvents", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn<DateTime>( name: "ModifiedOn", table: "UserEvents", type: "datetime2", nullable: true); } } }
29.9
91
0.485368
[ "MIT" ]
G0m0r0/GreenCap-Web-Project
src/Data/GreenCap.Data/Migrations/20201106190336_TestMigration.cs
2,394
C#
namespace SampleProject.Domain.Customers { using System; using SeedWork; public class CustomerId : TypedIdValueBase { public CustomerId(Guid value) : base(value) { } } }
17.916667
51
0.613953
[ "MIT" ]
gabrielesteveslima/net-public-sample-dotnet-core-cqrs-api
src/SampleProject.Domain/Customers/CustomerId.cs
217
C#
using System; using GraphQL.SystemTextJson; using GraphQL.Types; using Xunit; namespace GraphQL.Tests.Bugs { // https://github.com/graphql-dotnet/graphql-dotnet/pulls/1773 public class Bug1773 : QueryTestBase<Bug1773Schema> { private void AssertQueryWithError(string query, string result, string message, int line, int column, object[] path, Exception exception = null, string code = null, string inputs = null, string localizedMessage = null) { var error = exception == null ? new ExecutionError(message) : new ExecutionError(message, exception); if (line != 0) error.AddLocation(line, column); error.Path = path; if (code != null) error.Code = code; var expected = CreateQueryResult(result, new ExecutionErrors { error }); var actualResult = AssertQueryIgnoreErrors(query, expected, inputs?.ToInputs(), renderErrors: true, expectedErrorCount: 1); if (exception != null) { Assert.Equal(exception.GetType(), actualResult.Errors[0].InnerException.GetType()); if (localizedMessage != null && actualResult.Errors[0].InnerException.Message == localizedMessage) return; Assert.Equal(exception.Message, actualResult.Errors[0].InnerException.Message); } } [Fact] public void list_valid() { AssertQuerySuccess("{testListValid}", "{\"testListValid\": [123]}"); } [Fact] public void list_throws_when_not_ienumerable() { AssertQueryWithError("{testListInvalid}", "{\"testListInvalid\": null}", "Error trying to resolve field 'testListInvalid'.", 1, 2, new[] { "testListInvalid" }, new InvalidOperationException("Expected an IEnumerable list though did not find one. Found: Int32")); } [Fact] public void nonnull_list_valid() { AssertQuerySuccess("{testListNullValid}", "{\"testListNullValid\": [123]}"); } [Fact] public void nonnull_list_throws_when_null() { AssertQueryWithError("{testListNullInvalid}", "{\"testListNullInvalid\": null}", "Error trying to resolve field 'testListNullInvalid'.", 1, 2, new[] { "testListNullInvalid" }, new InvalidOperationException("Cannot return a null member within a non-null list for list index 0.")); } [Fact] public void list_throws_for_invalid_type() { // TODO: does not yet fully meet spec (does not return members of lists that are able to be serialized, with nulls and individual errors for unserializable values) AssertQueryWithError("{testListInvalidType}", "{\"testListInvalidType\": null}", "Error trying to resolve field 'testListInvalidType'.", 1, 2, new[] { "testListInvalidType" }, new FormatException("Input string was not in a correct format."), localizedMessage: "Входная строка имела неверный формат."); } [Fact] public void list_throws_for_invalid_type_when_conversion_returns_null() { // TODO: does not yet fully meet spec (does not return members of lists that are able to be serialized, with nulls and individual errors for unserializable values) AssertQueryWithError("{testListInvalidType2}", "{\"testListInvalidType2\": null}", "Error trying to resolve field 'testListInvalidType2'.", 1, 2, new[] { "testListInvalidType2" }, new InvalidOperationException("Unable to serialize 'test' to 'Bug1773Enum' for list index 0.")); } [Fact] public void throws_for_invalid_type() { // in this case, the conversion threw a FormatException AssertQueryWithError("{testInvalidType}", "{\"testInvalidType\": null}", "Error trying to resolve field 'testInvalidType'.", 1, 2, new[] { "testInvalidType" }, new FormatException("Input string was not in a correct format."), localizedMessage: "Входная строка имела неверный формат."); } [Fact] public void throws_for_invalid_type_when_conversion_returns_null() { // in this case, the converstion returned null, and GraphQL threw an InvalidOperationException AssertQueryWithError("{testInvalidType2}", "{\"testInvalidType2\": null}", "Error trying to resolve field 'testInvalidType2'.", 1, 2, new[] { "testInvalidType2" }, new InvalidOperationException("Unable to serialize 'test' to 'Bug1773Enum'.")); } } public class Bug1773Schema : Schema { public Bug1773Schema() { Query = new Bug1773Query(); } } public class Bug1773Query : ObjectGraphType { public Bug1773Query() { Field<ListGraphType<IntGraphType>>("testListValid", resolve: context => new object[] { 123 }); Field<ListGraphType<IntGraphType>>("testListInvalid", resolve: context => 123); Field<ListGraphType<IntGraphType>>("testListInvalidType", resolve: context => new object[] { "test" }); Field<ListGraphType<EnumerationGraphType<Bug1773Enum>>>("testListInvalidType2", resolve: context => new object[] { "test" }); Field<ListGraphType<NonNullGraphType<IntGraphType>>>("testListNullValid", resolve: context => new object[] { 123 }); Field<ListGraphType<NonNullGraphType<IntGraphType>>>("testListNullInvalid", resolve: context => new object[] { null }); Field<IntGraphType>("testNullValid", resolve: context => null); Field<NonNullGraphType<IntGraphType>>("testNullInvalid", resolve: context => null); Field<IntGraphType>("testInvalidType", resolve: context => "test"); Field<EnumerationGraphType<Bug1773Enum>>("testInvalidType2", resolve: context => "test"); } } public enum Bug1773Enum { Hello } }
49.743802
225
0.638478
[ "MIT" ]
srs6814/graphql-dotnet
src/GraphQL.Tests/Bugs/Bug1773.cs
6,083
C#
// This file is part of Silk.NET. // // You may modify and distribute Silk.NET under the terms // of the MIT license. See the LICENSE file for details. using System; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Xml.Linq; using JetBrains.Annotations; using Microsoft.CodeAnalysis.CSharp; using MoreLinq.Extensions; using Silk.NET.BuildTools.Common; using Silk.NET.BuildTools.Common.Enums; using Silk.NET.BuildTools.Common.Functions; using Silk.NET.BuildTools.Common.Structs; using Silk.NET.BuildTools.Converters.Khronos; using Attribute = Silk.NET.BuildTools.Common.Attribute; using Enum = Silk.NET.BuildTools.Common.Enums.Enum; using Type = Silk.NET.BuildTools.Common.Functions.Type; namespace Silk.NET.BuildTools.Converters.Readers { public class OpenCLReader : IReader { private static readonly string[] Apis = "opencl".Split('|'); private static readonly Dictionary<string, string> Constants = new Dictionary<string, string> { // Constants {"int_CL_CHAR_BIT", "8"}, {"int_CL_SCHAR_MAX", "127"}, {"int_CL_SCHAR_MIN", "-127 - 1"}, {"int_CL_CHAR_MAX", "127"}, {"int_CL_CHAR_MIN", "-127 - 1"}, {"int_CL_UCHAR_MAX", "255"}, {"short_CL_SHRT_MAX", "32767"}, {"short_CL_SHRT_MIN", "-32767 - 1"}, {"ushort_CL_USHRT_MAX", "65535"}, {"int_CL_INT_MAX", "2147483647"}, {"int_CL_INT_MIN", "-2147483647 - 1"}, {"uint_CL_UINT_MAX", "0xffffffffU"}, {"long_CL_LONG_MAX", "0x7FFFFFFFFFFFFFFFL"}, {"long_CL_LONG_MIN", "-0x7FFFFFFFFFFFFFFFL - 1L"}, {"ulong_CL_ULONG_MAX", "0xFFFFFFFFFFFFFFFFUL"}, {"float_CL_FLT_DIG", "6"}, {"float_CL_FLT_MANT_DIG", "24"}, {"float_CL_FLT_MAX_10_EXP", "+38"}, {"float_CL_FLT_MAX_EXP", "+128"}, {"float_CL_FLT_MIN_10_EXP", "-37"}, {"float_CL_FLT_MIN_EXP", "-125"}, {"float_CL_FLT_RADIX", "2"}, {"float_CL_FLT_MAX", "340282346638528859811704183484516925440.0f"}, {"float_CL_FLT_MIN", "1.175494350822287507969e-38f"}, {"float_CL_FLT_EPSILON", "1.1920928955078125e-7f"}, {"short_CL_HALF_DIG", "3"}, {"short_CL_HALF_MANT_DIG", "11"}, {"short_CL_HALF_MAX_10_EXP", "+4"}, {"short_CL_HALF_MAX_EXP", "+16"}, {"short_CL_HALF_MIN_10_EXP", "-4"}, {"short_CL_HALF_MIN_EXP", "-13"}, {"short_CL_HALF_RADIX", "2"}, {"short_CL_HALF_MAX", "unchecked((short)65504.0f)"}, {"short_CL_HALF_MIN", "unchecked((short)6.103515625e-05f)"}, {"short_CL_HALF_EPSILON", "unchecked((short)9.765625e-04f)"}, {"double_CL_DBL_DIG", "15"}, {"double_CL_DBL_MANT_DIG", "53"}, {"double_CL_DBL_MAX_10_EXP", "+308"}, {"double_CL_DBL_MAX_EXP", "+1024"}, {"double_CL_DBL_MIN_10_EXP", "-307"}, {"double_CL_DBL_MIN_EXP", "-1021"}, {"double_CL_DBL_RADIX", "2"}, {"double_CL_DBL_MAX", "1.7976931348623158e+308"}, {"double_CL_DBL_MIN", "2.225073858507201383090e-308"}, {"double_CL_DBL_EPSILON", "2.220446049250313080847e-16"}, {"double_CL_M_E", "2.7182818284590452354"}, {"double_CL_M_LOG2E", "1.4426950408889634074"}, {"double_CL_M_LOG10E", "0.43429448190325182765"}, {"double_CL_M_LN2", "0.69314718055994530942"}, {"double_CL_M_LN10", "2.30258509299404568402"}, {"double_CL_M_PI", "3.14159265358979323846"}, {"double_CL_M_PI_2", "1.57079632679489661923"}, {"double_CL_M_PI_4", "0.78539816339744830962"}, {"double_CL_M_1_PI", "0.31830988618379067154"}, {"double_CL_M_2_PI", "0.63661977236758134308"}, {"double_CL_M_2_SQRTPI", "1.12837916709551257390"}, {"double_CL_M_SQRT2", "1.41421356237309504880"}, {"double_CL_M_SQRT1_2", "0.70710678118654752440"}, {"float_CL_M_E_F", "2.718281828f"}, {"float_CL_M_LOG2E_F", "1.442695041f"}, {"float_CL_M_LOG10E_F", "0.434294482f"}, {"float_CL_M_LN2_F", "0.693147181f"}, {"float_CL_M_LN10_F", "2.302585093f"}, {"float_CL_M_PI_F", "3.141592654f"}, {"float_CL_M_PI_2_F", "1.570796327f"}, {"float_CL_M_PI_4_F", "0.785398163f"}, {"float_CL_M_1_PI_F", "0.318309886f"}, {"float_CL_M_2_PI_F", "0.636619772f"}, {"float_CL_M_2_SQRTPI_F", "1.128379167f"}, {"float_CL_M_SQRT2_F", "1.414213562f"}, {"float_CL_M_SQRT1_2_F", "0.707106781f"}, {"float_CL_NAN", "float.NaN"}, {"float_CL_HUGE_VALF", "(float) 1e50"}, {"double_CL_HUGE_VAL", "double.PositiveInfinity"}, {"float_CL_MAXFLOAT", "float.MaxValue"}, {"float_CL_INFINITY", "float.PositiveInfinity"}, // MiscNumbers {"int_CL_PROPERTIES_LIST_END_EXT", "0"}, {"int_CL_PARTITION_BY_COUNTS_LIST_END_EXT", "0"}, {"int_CL_DEVICE_PARTITION_BY_COUNTS_LIST_END", "0x0"}, {"int_CL_PARTITION_BY_NAMES_LIST_END_EXT", "0 - 1"}, {"int_CL_PARTITION_BY_NAMES_LIST_END_INTEL", "-1"}, // Versioning {"int_CL_VERSION_MAJOR_BITS", "10"}, {"int_CL_VERSION_MINOR_BITS", "10"}, {"int_CL_VERSION_PATCH_BITS", "12"}, {"int_CL_NAME_VERSION_MAX_NAME_SIZE", "64"}, }; public object Load(Stream stream) { return XDocument.Load(stream); } public IEnumerable<Struct> ReadStructs(object obj, ProfileConverterOptions opts) { var xd = (XDocument) obj; var rawStructs = xd.Element("registry")?.Element("types")?.Elements("type") .Where(typex => typex.HasCategoryAttribute("struct")) .Select(typex => StructureDefinition.CreateFromXml(typex)) .ToArray(); var structs = ConvertStructs(rawStructs, opts); foreach (var feature in xd.Element("registry").Elements("feature").Attributes("api").Select(x => x.Value).RemoveDuplicates()) { foreach (var (_, s) in structs) { yield return new Struct { Attributes = s.Attributes, ExtensionName = "Core", Fields = s.Fields, Functions = s.Functions, Name = s.Name, NativeName = s.NativeName, ProfileName = feature, ProfileVersion = null }; } } opts.TypeMaps.Add(structs.ToDictionary(x => x.Key, x => x.Value.Name)); } private Dictionary<string, Struct> ConvertStructs(StructureDefinition[] spec, ProfileConverterOptions opts) { var prefix = opts.Prefix; var ret = new Dictionary<string, Struct>(); foreach (var s in spec) { ret.Add ( s.Name, new Struct { Fields = s.Members.Select ( x => new Field { Count = string.IsNullOrEmpty(x.ElementCountSymbolic) ? x.ElementCount != 1 ? new Count(x.ElementCount) : null : new Count(x.ElementCountSymbolic, false), Name = Naming.Translate(TrimName(x.Name, opts), prefix), Doc = $"/// <summary>{x.Comment}</summary>", NativeName = x.Name, NativeType = x.Type.ToString(), Type = ConvertType(x.Type) } ) .ToList(), Name = Naming.TranslateLite(TrimName(s.Name, opts), prefix), NativeName = s.Name } ); } return ret; } private Type ConvertType(TypeSpec type) { return new Type { ArrayDimensions = type.ArrayDimensions, IndirectionLevels = type.PointerIndirection, Name = type.Name, OriginalName = type.Name }; } //////////////////////////////////////////////////////////////////////////////////////// // Function Parsing //////////////////////////////////////////////////////////////////////////////////////// public IEnumerable<Function> ReadFunctions(object obj, ProfileConverterOptions opts) { var doc = obj as XDocument; var allFunctions = doc.Element("registry").Elements("commands") .Elements("command") .Select(x => TranslateCommand(x, opts)) .ToDictionary(x => x.Attribute("name")?.Value, x => x); var apis = doc.Element("registry").Elements("feature").Concat(doc.Element("registry").Elements("extensions").Elements("extension")); var removals = doc.Element("registry").Elements("feature") .Elements("remove") .Elements("command") .Attributes("name") .Select(x => x.Value) .ToList(); foreach (var api in apis) { foreach (var requirement in api.Elements("require")) { var apiName = requirement.Attribute("api")?.Value ?? api.Attribute("api")?.Value ?? api.Attribute("supported")?.Value ?? "opencl"; var apiVersion = api.Attribute("number") != null ? Version.Parse(api.Attribute("number").Value) : null; foreach (var name in apiName.Split('|')) { foreach (var function in requirement.Elements("command") .Attributes("name") .Select(x => x.Value)) { var xf = allFunctions[TrimName(function, opts)]; var ret = new Function { Attributes = removals.Contains(function) ? new List<Attribute> { new Attribute { Name = "System.Obsolete", Arguments = new List<string> { $"\"Deprecated in version {apiVersion?.ToString(2)}\"" } } } : new List<Attribute>(), Categories = new List<string>{ExtensionName(api.Attribute("name")?.Value, opts)}, Doc = string.Empty, ExtensionName = api.Name == "feature" ? "Core" : ExtensionName(api.Attribute("name")?.Value, opts), GenericTypeParameters = new List<GenericTypeParameter>(), Name = Naming.Translate(NameTrimmer.Trim(TrimName(xf.Attribute("name")?.Value, opts), opts.Prefix), opts.Prefix), NativeName = function, Parameters = ParseParameters(xf), ProfileName = name, ProfileVersion = apiVersion, ReturnType = ParseTypeSignature(xf.Element("returns")) }; yield return ret; allFunctions.Remove(function); } } } } } [NotNull] public static Type ParseTypeSignature([NotNull] XElement typeElement) { var typeString = typeElement.Attribute("type")?.Value ?? throw new DataException("Couldn't find type."); var group = typeElement.Attribute("group")?.Value; var ret = ParseTypeSignature(typeString); if (!(group is null)) { ret.OriginalGroup = group; } return ret; } [NotNull] public static Type ParseTypeSignature([NotNull] string type, string original = null) { if (type.Contains('*') && (type.Contains('[') || type.Contains(']'))) { throw new InvalidDataException("A type cannot be both a pointer and an array at the same time."); } const string constValueSpecifier = "const "; const string constPointerSpecifier = " const"; const string structSpecifier = "struct "; // We'll ignore struct and const specifiers for the moment var isConstValue = type.StartsWith(constValueSpecifier); if (isConstValue) { type = type.Remove(0, constValueSpecifier.Length); } var isConstPointer = type.EndsWith(constPointerSpecifier); if (isConstPointer) { var specifierIndex = type.LastIndexOf(constPointerSpecifier, StringComparison.Ordinal); type = type.Remove(specifierIndex); } var isStruct = type.StartsWith(structSpecifier); if (isStruct) { type = type.Remove(0, structSpecifier.Length); } var typeName = new string(type.ToCharArray().Where(c => !char.IsWhiteSpace(c)).ToArray()); var pointerLevel = 0; var isPointer = type.EndsWith("*"); if (isPointer) { var firstPointerLevelIndex = typeName.IndexOf('*'); var lastPointerLevelIndex = typeName.LastIndexOf('*'); pointerLevel = Math.Abs(lastPointerLevelIndex - firstPointerLevelIndex) + 1; typeName = typeName.Remove(firstPointerLevelIndex); } var arrayLevel = 0; var isArray = typeName.EndsWith("]"); if (isArray) { var firstArrayIndex = typeName.IndexOf('['); var lastArrayIndex = typeName.IndexOf(']'); arrayLevel = Math.Abs(firstArrayIndex - lastArrayIndex); typeName = typeName.Remove(firstArrayIndex); } return new Type { Name = typeName, OriginalName = original ?? typeName, IndirectionLevels = pointerLevel, ArrayDimensions = arrayLevel }; } /// </returns> [CanBeNull] [ContractAnnotation ( "hasComputedCount : true => computedCountParameterNames : notnull; hasValueReference : true => valueReferenceName : notnull" )] public static Count ParseCountSignature ( [CanBeNull] string countData, out bool hasComputedCount, [CanBeNull] out IReadOnlyList<string> computedCountParameterNames, out bool hasValueReference, [CanBeNull] out string valueReferenceName, [CanBeNull] out string valueReferenceExpression ) { computedCountParameterNames = null; valueReferenceName = null; valueReferenceExpression = null; hasComputedCount = false; hasValueReference = false; if (string.IsNullOrWhiteSpace(countData)) { return null; } if (int.TryParse(countData, out var staticCount)) { return new Count(staticCount); } var countDataSpan = countData.AsSpan(); if (countDataSpan.StartsWith("COMPSIZE")) { var slice = countDataSpan.Slice(countDataSpan.IndexOf('(') + 1); slice = slice.Slice(0, slice.IndexOf(')')); var countList = new List<string>(); var record = string.Empty; foreach (var character in slice) { if (character == ',') { countList.Add(record.Trim()); record = string.Empty; continue; } record += character; } if (!string.IsNullOrWhiteSpace(record)) { countList.Add(record.Trim()); } return new Count(countList); } if (SyntaxFacts.IsValidIdentifier(countData)) { // It's a parameter value reference count (that is, taken from the value of another parameter) valueReferenceName = countData; hasValueReference = true; return new Count(valueReferenceName); } static bool IsMath(ReadOnlySpan<char> span) { for (int i = 0; i < span.Length; i++) { if (span[i] != '+' && span[i] != '-' && span[i] != '*' && span[i] != '/' && span[i] != '^' && span[i] != ' ' && !char.IsDigit(span[i])) { return false; } } return true; } // check for count with expression. if (char.IsLetter(countDataSpan[0])) { int i = 1; while (char.IsLetterOrDigit(countDataSpan[i])) { i++; } // at this point there HAS to be some invalid letter there, so no for needed. var identifier = new string(countDataSpan.Slice(0, i)); var expression = countDataSpan.Slice(i); if (SyntaxFacts.IsValidIdentifier(identifier) && IsMath(expression)) { // the rest is likely a mathematical expression valueReferenceName = identifier; valueReferenceExpression = new string(expression); hasValueReference = true; return new Count(valueReferenceName); } } throw new InvalidDataException("No valid count could be parsed from the input."); } private static List<Parameter> ParseParameters([NotNull] XElement functionElement) { var parameterElements = functionElement.Elements().Where(e => e.Name == "param"); var parametersWithComputedCounts = new List<(Parameter Parameter, IReadOnlyList<string> ComputedCountParameterNames)>(); var parametersWithValueReferenceCounts = new List<(Parameter Parameter, string ParameterReferenceName)>(); var resultParameters = new List<Parameter>(); foreach (var parameterElement in parameterElements) { var parameter = ParseParameter ( parameterElement, out var hasComputedCount, out var computedCountParameterNames, out var hasValueReference, out var valueReferenceName, out _ ); switch (parameter.Name) { case "pfn_free_func": { resultParameters.Add ( new Parameter { Name = "pfn_free_func", Attributes = new List<Attribute> { new Attribute { Name = "Ultz.SuperInvoke.InteropServices.PinObjectAttribute", Arguments = new List<string> {"Ultz.SuperInvoke.InteropServices.PinMode.UntilNextCall"} } }, Count = null, Flow = FlowDirection.In, Type = new Type {Name = "FreeCallback", OriginalName = "CL_CALLBACK"} } ); continue; } case "pfn_notify": { resultParameters.Add ( new Parameter { Name = "pfn_notify", Attributes = new List<Attribute> { new Attribute { Name = "Ultz.SuperInvoke.InteropServices.PinObjectAttribute", Arguments = new List<string> {"Ultz.SuperInvoke.InteropServices.PinMode.UntilNextCall"} } }, Count = null, Flow = FlowDirection.In, Type = new Type {Name = "NotifyCallback", OriginalName = "CL_CALLBACK"} } ); continue; } case "user_func": { resultParameters.Add ( new Parameter { Name = "user_func", Count = null, Flow = FlowDirection.In, Type = new Type {Name = "FuncPtr", OriginalName = "CL_CALLBACK"} } ); continue; } } if (hasComputedCount) { parametersWithComputedCounts.Add((parameter, computedCountParameterNames)); } if (hasValueReference) { parametersWithValueReferenceCounts.Add((parameter, valueReferenceName)); // TODO: Pass on the mathematical expression } if (parameter.Type.ToString() == "void") { // uh-oh, bad parameter alert. Add a pointer to hopefully make it better. parameter.Type.IndirectionLevels++; } resultParameters.Add(parameter); } return resultParameters; } private static Parameter ParseParameter ( [NotNull] XElement paramElement, out bool hasComputedCount, [CanBeNull] out IReadOnlyList<string> computedCountParameterNames, out bool hasValueReference, [CanBeNull] out string valueReferenceName, [CanBeNull] out string valueReferenceExpression ) { var paramName = paramElement.Attribute("name")?.Value ?? throw new DataException("Missing name attribute."); // A parameter is technically a type signature (think of it as Parameter : ITypeSignature) var paramType = ParseTypeSignature(paramElement); var paramFlowStr = paramElement.Attribute("flow").Value ?? throw new DataException("Missing flow attribute."); if (!System.Enum.TryParse<FlowDirection>(paramFlowStr, true, out var paramFlow)) { throw new InvalidDataException("Could not parse the parameter flow."); } var paramCountStr = paramElement.Attribute("count")?.Value; var countSignature = ParseCountSignature ( paramCountStr, out hasComputedCount, out computedCountParameterNames, out hasValueReference, out valueReferenceName, out valueReferenceExpression ); return new Parameter { Name = Utilities.CSharpKeywords.Contains(paramName) ? $"@{paramName}" : paramName, Flow = paramFlow, Type = paramType, Count = countSignature, Attributes = paramType.Name.StartsWith ("CL_CALLBACK") ? new List<Attribute> { new Attribute { Arguments = new List<string> {"Ultz.SuperInvoke.InteropServices.PinMode.UntilNextCall"}, Name = "Ultz.SuperInvoke.InteropServices.PinObjectAttribute" } } : new List<Attribute>() }; } private string FunctionName(XElement e, ProfileConverterOptions opts) { return TrimName(e.Element("proto")?.Element("name")?.Value, opts); } public string TrimName(string name, ProfileConverterOptions opts) { if (name.ToUpper().StartsWith($"{opts.Prefix.ToUpper()}_")) { return name.Remove(0, opts.Prefix.Length + 1); } return name.ToLower().StartsWith(opts.Prefix.ToLower()) ? name.Remove(0, opts.Prefix.Length) : name; } private static Random _random = new Random(); private static string FunctionParameterType(XElement e) { // Parse the C-like <proto> element. Possible instances: // Return types: // - <proto>void <name>clGetSharpenTexFuncSGIS</name></proto> // -> <returns>void</returns> // - <proto group="String">const <ptype>clubyte</ptype> *<name>clGetString</name></proto> // -> <returns>String</returns> // Note: group attribute takes precedence if it exists. This matches the old .spec file format. // Parameter types: // - <param><ptype>clenum</ptype> <name>shadertype</name></param> // -> <param name="shadertype" type="clenum" /> // - <param len="1"><ptype>clsizei</ptype> *<name>length</name></param> // -> <param name="length" type="clsizei" count="1" /> var proto = e.Value; var name = e.Element("name"); if (name == null) { Debug.WriteLine($"Warning: Parameter name is null. Element: {e}."); } var ret = name is null ? proto : proto.Remove(proto.LastIndexOf(name.Value, StringComparison.Ordinal)).Trim(); return ret; } private int unnamedParameters = 0; private XElement TranslateCommand(XElement command, ProfileConverterOptions opts) { var function = new XElement("function"); var cmdName = FunctionName(command, opts); var name = new XAttribute("name", cmdName); var returns = new XElement ( "returns", command.Element("proto").Attribute("group") is null ? new object[]{new XAttribute ( "type", FunctionParameterType(command.Element("proto")) .Replace("const", string.Empty) .Replace("struct", string.Empty) .Replace("String *", "String") .Trim() )} : new object[]{new XAttribute ( "type", FunctionParameterType(command.Element("proto")) .Replace("const", string.Empty) .Replace("struct", string.Empty) .Replace("String *", "String") .Trim() ), new XAttribute("group", command.Element("proto").Attribute("group").Value)} ); foreach (var parameter in command.Elements("param")) { var param = FunctionParameterType(parameter); var p = new XElement("param"); string randomName = null; if (parameter.Element("name") is null) { Debug.WriteLine($"Warning: Parameter name is null. Element: {parameter}."); randomName = "unnamedParameter" + unnamedParameters++; Debug.WriteLine($"Giving it name {randomName}"); } var pname = new XAttribute("name", parameter.Element("name")?.Value ?? randomName); var type = new XAttribute ( "type", param .Replace("const", string.Empty) .Replace("struct", string.Empty) .Trim() ); var count = parameter.Attribute("len") != null ? new XAttribute("count", parameter.Attribute("len")?.Value ?? throw new NullReferenceException()) : null; var flow = new XAttribute ( "flow", param.Contains("*") && !param.Contains("const") ? "out" : "in" ); p.Add(pname, type, flow); if (count != null) { p.Add(count); } if (!(parameter.Attribute("group") is null)) { p.Add(new XAttribute("group", parameter.Attribute("group").Value)); } function.Add(p); } function.Add(name); function.Add(returns); return function; } //////////////////////////////////////////////////////////////////////////////////////// // Enum Parsing //////////////////////////////////////////////////////////////////////////////////////// public IEnumerable<Enum> ReadEnums(object obj, ProfileConverterOptions opts) { var doc = obj as XDocument; var allEnums = doc.Element("registry") .Elements("enums") .Elements("enum") .DistinctBy(x => x.Attribute("name")?.Value) .Where ( x => x.Parent?.Attribute("name")?.Value != "Constants" && x.Parent?.Attribute("name")?.Value != "MiscNumbers" ) .ToDictionary ( x => x.Attribute("name")?.Value, x => FormatToken ( x.Attribute("value")?.Value ?? (x.Attribute("bitpos") is null ? null : (1 << int.Parse(x.Attribute("bitpos").Value)).ToString()) ) ); var apis = doc.Element("registry").Elements("feature").Concat(doc.Element("registry").Elements("extensions").Elements("extension")); var removals = doc.Element("registry").Elements("feature") .Elements("remove") .Elements("enum") .Attributes("name") .Select(x => x.Value) .ToList(); foreach (var api in apis) { foreach (var requirement in api.Elements("require")) { var apiName = requirement.Attribute("api")?.Value ?? api.Attribute("api")?.Value ?? api.Attribute("supported")?.Value ?? "opencl"; var apiVersion = api.Attribute("number") != null ? Version.Parse(api.Attribute("number").Value) : null; var tokens = requirement.Elements("enum") .Attributes("name") .Where(x => !Constants.ContainsKey(x.Value) && allEnums.ContainsKey(x.Value)) .Select ( token => new Token { Attributes = removals.Contains(token.Value) ? new List<Attribute> { new Attribute { Arguments = new List<string> {$"\"Deprecated in version {apiVersion?.ToString(2)}\""}, Name = "System.Obsolete" } } : new List<Attribute>(), Doc = string.Empty, Name = Naming.Translate(TrimName(token.Value, opts), opts.Prefix), NativeName = token.Value, Value = allEnums.ContainsKey (token.Value) ? allEnums[token.Value] : FormatToken(Constants[token.Value].ToString()) } ) .ToList(); foreach (var name in apiName.Split('|')) { var ret = new Enum { Attributes = new List<Attribute>(), ExtensionName = api.Name == "feature" ? "Core" : ExtensionName(api.Attribute("name")?.Value, opts), Name = Naming.Translate(TrimName(api.Attribute("name")?.Value, opts), opts.Prefix), NativeName = api.Attribute("name")?.Value, ProfileName = name, ProfileVersion = apiVersion, Tokens = tokens }; yield return ret; } } } } private string ExtensionName(string ext, ProfileConverterOptions opts) { if (ext == "cl_device_partition_property_ext") // spec inconsistency return "EXT_device_partition_property"; if (ext == "ck_khr_mipmap_image") return "KHR_mipmap_image"; var trimmedExt = TrimName(ext, opts); var splitTrimmed = trimmedExt.Split('_'); return splitTrimmed[0].ToUpper() + "_" + string.Join ("_", new ArraySegment<string>(splitTrimmed, 1, splitTrimmed.Length - 1)); } public IEnumerable<Constant> ReadConstants(object obj, ProfileConverterOptions opts) { return Constants.Select ( x => new Constant { Name = Naming.Translate(TrimName(GetName(x.Key, out var type), opts), opts.Prefix), NativeName = GetName(x.Key, out _), Type = new Type {Name = type}, Value = x.Value.ToString() } ); } private static string GetName(string xKey, out string type) { var split = xKey.Split('_'); type = split[0]; return string.Join("_", new ArraySegment<string>(split, 1, split.Length - 1)); } private static string FormatToken(string token) { if (token == null) { return null; } if (token == "CL_TRUE") return 1.ToString(); if (token == "CL_FALSE") return 0.ToString(); if (token == "(0x1 << 24)") return (0x1 << 24).ToString(); if (token == "(0x2 << 24)") return (0x2 << 24).ToString(); if (token == "(0x3 << 24)") return (0x3 << 24).ToString(); if (token == "(0x55 << 24)") return (0x55 << 24).ToString(); if (token == "(0xAA << 24)") return (0xAA << 24).ToString(); if (token == "(0xFF << 24)") return (0xFF << 24).ToString(); if (token == "(0x1 << 24)") return (0x1 << 24).ToString(); if (token == "(0x2 << 24)") return (0x2 << 24).ToString(); if (token == "(0x1 << 26)") return (0x1 << 26).ToString(); if (token == "(0x2 << 26)") return (0x2 << 26).ToString(); if (token == "(0x1 << 28)") return (0x1 << 28).ToString(); if (token == "(0x2 << 28)") return (0x2 << 28).ToString(); if (token == "(0x1 << 30)") return (0x1 << 30).ToString(); if (token == "(0x2 << 30)") return (0x2 << 30).ToString(); var tokenHex = token.StartsWith("0x") ? token.Substring(2) : token; if (!long.TryParse(tokenHex, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var value)) { if (!long.TryParse(tokenHex, out value)) { if (!ulong.TryParse(tokenHex, out var uValue)) { throw new InvalidDataException("Token value was not in a valid format."); } value = unchecked((long) uValue); } } var valueString = $"0x{value:X}"; var needsCasting = value > int.MaxValue || value < 0; if (needsCasting) { Debug.WriteLine($"Warning: casting overflowing enum value {token} from 64-bit to 32-bit."); valueString = $"unchecked((int){valueString})"; } return valueString; } } }
42.018066
145
0.458358
[ "MIT" ]
mcavanagh/Silk.NET
src/Core/BuildTools/Converters/Readers/OpenCLReader.cs
39,539
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18449 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Microsoft.Protocols.TestSuites.MS_OXCTABL { using System; using System.Collections.Generic; using System.Text; using System.Reflection; using Microsoft.SpecExplorer.Runtime.Testing; using Microsoft.Protocols.TestTools; [System.CodeDom.Compiler.GeneratedCodeAttribute("Spec Explorer", "3.5.3130.0")] [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()] public partial class S05_ResetSortTableRops_SortTable_TestSuite : PtfTestClassBase { public S05_ResetSortTableRops_SortTable_TestSuite() { this.SetSwitch("ProceedControlTimeout", "100"); this.SetSwitch("QuiescenceTimeout", "2000000"); } #region Expect Delegates public delegate void CheckMAPIHTTPTransportSupportedDelegate1(bool isSupported); public delegate void CheckRequirementEnabledDelegate1(bool enabled); public delegate void RopQueryRowsResponseDelegate1(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger); #endregion #region Event Metadata static System.Reflection.MethodBase CheckMAPIHTTPTransportSupportedInfo = TestManagerHelpers.GetMethodInfo(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter), "CheckMAPIHTTPTransportSupported", typeof(bool).MakeByRefType()); static System.Reflection.MethodBase CheckRequirementEnabledInfo = TestManagerHelpers.GetMethodInfo(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter), "CheckRequirementEnabled", typeof(int), typeof(bool).MakeByRefType()); static System.Reflection.EventInfo RopQueryRowsResponseInfo = TestManagerHelpers.GetEventInfo(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter), "RopQueryRowsResponse"); #endregion #region Adapter Instances private Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter IMS_OXCTABLAdapterInstance; #endregion #region Class Initialization and Cleanup [Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute()] public static void ClassInitialize(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) { PtfTestClassBase.Initialize(context); } [Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupAttribute()] public static void ClassCleanup() { PtfTestClassBase.Cleanup(); } #endregion #region Test Initialization and Cleanup protected override void TestInitialize() { this.InitializeTestManager(); this.IMS_OXCTABLAdapterInstance = ((Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter)(this.Manager.GetAdapter(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter)))); this.Manager.Subscribe(RopQueryRowsResponseInfo, this.IMS_OXCTABLAdapterInstance); } protected override void TestCleanup() { base.TestCleanup(); this.CleanupTestManager(); } #endregion #region Test Starting in S0 [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()] public void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuite() { this.Manager.BeginTest("MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuite"); this.Manager.Comment("reaching state \'S0\'"); bool temp0; this.Manager.Comment("executing step \'call CheckMAPIHTTPTransportSupported(out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckMAPIHTTPTransportSupported(out temp0); this.Manager.AddReturn(CheckMAPIHTTPTransportSupportedInfo, null, temp0); this.Manager.Comment("reaching state \'S1\'"); int temp57 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckMAPIHTTPTransportSupportedChecker)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckMAPIHTTPTransportSupportedChecker1))); if ((temp57 == 0)) { this.Manager.Comment("reaching state \'S2\'"); goto label31; } if ((temp57 == 1)) { this.Manager.Comment("reaching state \'S3\'"); this.Manager.Comment("executing step \'call InitializeTable(CONTENT_TABLE)\'"); this.IMS_OXCTABLAdapterInstance.InitializeTable(((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableType)(0))); this.Manager.Comment("reaching state \'S4\'"); this.Manager.Comment("checking step \'return InitializeTable\'"); this.Manager.Comment("reaching state \'S5\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp1; this.Manager.Comment("executing step \'call RopSetColumns(1,False,False,False)\'"); temp1 = this.IMS_OXCTABLAdapterInstance.RopSetColumns(1u, false, false, false); this.Manager.Checkpoint("MS-OXCTABL_R831"); this.Manager.Checkpoint("MS-OXCTABL_R45"); this.Manager.Comment("reaching state \'S6\'"); this.Manager.Comment("checking step \'return RopSetColumns/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp1, "return of RopSetColumns, state S6"); this.Manager.Comment("reaching state \'S7\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp2; this.Manager.Comment("executing step \'call RopSortTable(1,True,True,True,False,False,False,False)\'"); temp2 = this.IMS_OXCTABLAdapterInstance.RopSortTable(1u, true, true, true, false, false, false, false); this.Manager.Checkpoint("MS-OXCTABL_R447"); this.Manager.Comment("reaching state \'S8\'"); this.Manager.Comment("checking step \'return RopSortTable/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp2, "return of RopSortTable, state S8"); this.Manager.Comment("reaching state \'S9\'"); bool temp3; this.Manager.Comment("executing step \'call CheckRequirementEnabled(768,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(768, out temp3); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp3); this.Manager.Comment("reaching state \'S10\'"); int temp56 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker15))); if ((temp56 == 0)) { this.Manager.Comment("reaching state \'S11\'"); bool temp4; this.Manager.Comment("executing step \'call CheckRequirementEnabled(866,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(866, out temp4); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp4); this.Manager.Comment("reaching state \'S13\'"); int temp29 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker1)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker8))); if ((temp29 == 0)) { this.Manager.Comment("reaching state \'S15\'"); bool temp5; this.Manager.Comment("executing step \'call CheckRequirementEnabled(867,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(867, out temp5); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp5); this.Manager.Comment("reaching state \'S19\'"); int temp16 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker2)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker5))); if ((temp16 == 0)) { this.Manager.Comment("reaching state \'S23\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp6; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp6 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S31\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp6, "return of RopQueryRows, state S31"); this.Manager.Comment("reaching state \'S39\'"); bool temp7; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp7); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp7); this.Manager.Comment("reaching state \'S47\'"); int temp10 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker3)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker4))); if ((temp10 == 0)) { this.Manager.Comment("reaching state \'S55\'"); int temp8 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker1)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker2)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker3))); if ((temp8 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS71(); goto label0; } if ((temp8 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS71(); goto label0; } if ((temp8 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS71(); goto label0; } if ((temp8 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS71(); goto label0; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker1)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker2)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker3))); label0: ; goto label2; } if ((temp10 == 1)) { this.Manager.Comment("reaching state \'S56\'"); int temp9 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker4)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker5)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker6)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker7))); if ((temp9 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS72(); goto label1; } if ((temp9 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS72(); goto label1; } if ((temp9 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS72(); goto label1; } if ((temp9 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS72(); goto label1; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker4)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker5)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker6)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker7))); label1: ; goto label2; } throw new InvalidOperationException("never reached"); label2: ; goto label6; } if ((temp16 == 1)) { this.Manager.Comment("reaching state \'S24\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp11; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp11 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S32\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp11, "return of RopQueryRows, state S32"); this.Manager.Comment("reaching state \'S40\'"); bool temp12; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp12); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp12); this.Manager.Comment("reaching state \'S48\'"); int temp15 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker6)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker7))); if ((temp15 == 0)) { this.Manager.Comment("reaching state \'S57\'"); int temp13 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker8)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker9)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker10)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker11))); if ((temp13 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS73(); goto label3; } if ((temp13 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS73(); goto label3; } if ((temp13 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS73(); goto label3; } if ((temp13 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS73(); goto label3; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker8)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker9)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker10)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker11))); label3: ; goto label5; } if ((temp15 == 1)) { this.Manager.Comment("reaching state \'S58\'"); int temp14 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker12)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker13)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker14)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker15))); if ((temp14 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS74(); goto label4; } if ((temp14 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS74(); goto label4; } if ((temp14 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS74(); goto label4; } if ((temp14 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS74(); goto label4; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker12)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker13)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker14)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker15))); label4: ; goto label5; } throw new InvalidOperationException("never reached"); label5: ; goto label6; } throw new InvalidOperationException("never reached"); label6: ; goto label14; } if ((temp29 == 1)) { this.Manager.Comment("reaching state \'S16\'"); bool temp17; this.Manager.Comment("executing step \'call CheckRequirementEnabled(867,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(867, out temp17); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp17); this.Manager.Comment("reaching state \'S20\'"); int temp28 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker9)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker12))); if ((temp28 == 0)) { this.Manager.Comment("reaching state \'S25\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp18; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp18 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S33\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp18, "return of RopQueryRows, state S33"); this.Manager.Comment("reaching state \'S41\'"); bool temp19; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp19); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp19); this.Manager.Comment("reaching state \'S49\'"); int temp22 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker10)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker11))); if ((temp22 == 0)) { this.Manager.Comment("reaching state \'S59\'"); int temp20 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker16)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker17)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker18)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker19))); if ((temp20 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS75(); goto label7; } if ((temp20 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS75(); goto label7; } if ((temp20 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS75(); goto label7; } if ((temp20 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS75(); goto label7; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker16)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker17)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker18)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker19))); label7: ; goto label9; } if ((temp22 == 1)) { this.Manager.Comment("reaching state \'S60\'"); int temp21 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker20)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker21)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker22)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker23))); if ((temp21 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS76(); goto label8; } if ((temp21 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS76(); goto label8; } if ((temp21 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS76(); goto label8; } if ((temp21 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS76(); goto label8; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker20)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker21)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker22)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker23))); label8: ; goto label9; } throw new InvalidOperationException("never reached"); label9: ; goto label13; } if ((temp28 == 1)) { this.Manager.Comment("reaching state \'S26\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp23; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp23 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S34\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp23, "return of RopQueryRows, state S34"); this.Manager.Comment("reaching state \'S42\'"); bool temp24; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp24); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp24); this.Manager.Comment("reaching state \'S50\'"); int temp27 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker13)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker14))); if ((temp27 == 0)) { this.Manager.Comment("reaching state \'S61\'"); int temp25 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker24)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker25)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker26)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker27))); if ((temp25 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS77(); goto label10; } if ((temp25 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS77(); goto label10; } if ((temp25 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS77(); goto label10; } if ((temp25 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS77(); goto label10; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker24)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker25)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker26)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker27))); label10: ; goto label12; } if ((temp27 == 1)) { this.Manager.Comment("reaching state \'S62\'"); int temp26 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker28)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker29)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker30)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker31))); if ((temp26 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS78(); goto label11; } if ((temp26 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS78(); goto label11; } if ((temp26 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS78(); goto label11; } if ((temp26 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS78(); goto label11; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker28)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker29)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker30)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker31))); label11: ; goto label12; } throw new InvalidOperationException("never reached"); label12: ; goto label13; } throw new InvalidOperationException("never reached"); label13: ; goto label14; } throw new InvalidOperationException("never reached"); label14: ; goto label30; } if ((temp56 == 1)) { this.Manager.Comment("reaching state \'S12\'"); bool temp30; this.Manager.Comment("executing step \'call CheckRequirementEnabled(866,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(866, out temp30); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp30); this.Manager.Comment("reaching state \'S14\'"); int temp55 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker16)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker23))); if ((temp55 == 0)) { this.Manager.Comment("reaching state \'S17\'"); bool temp31; this.Manager.Comment("executing step \'call CheckRequirementEnabled(867,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(867, out temp31); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp31); this.Manager.Comment("reaching state \'S21\'"); int temp42 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker17)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker20))); if ((temp42 == 0)) { this.Manager.Comment("reaching state \'S27\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp32; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp32 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S35\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp32, "return of RopQueryRows, state S35"); this.Manager.Comment("reaching state \'S43\'"); bool temp33; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp33); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp33); this.Manager.Comment("reaching state \'S51\'"); int temp36 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker18)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker19))); if ((temp36 == 0)) { this.Manager.Comment("reaching state \'S63\'"); int temp34 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker32)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker33)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker34)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker35))); if ((temp34 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS79(); goto label15; } if ((temp34 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS79(); goto label15; } if ((temp34 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS79(); goto label15; } if ((temp34 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS79(); goto label15; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker32)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker33)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker34)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker35))); label15: ; goto label17; } if ((temp36 == 1)) { this.Manager.Comment("reaching state \'S64\'"); int temp35 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker36)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker37)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker38)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker39))); if ((temp35 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS80(); goto label16; } if ((temp35 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS80(); goto label16; } if ((temp35 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS80(); goto label16; } if ((temp35 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS80(); goto label16; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker36)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker37)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker38)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker39))); label16: ; goto label17; } throw new InvalidOperationException("never reached"); label17: ; goto label21; } if ((temp42 == 1)) { this.Manager.Comment("reaching state \'S28\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp37; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp37 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S36\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp37, "return of RopQueryRows, state S36"); this.Manager.Comment("reaching state \'S44\'"); bool temp38; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp38); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp38); this.Manager.Comment("reaching state \'S52\'"); int temp41 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker21)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker22))); if ((temp41 == 0)) { this.Manager.Comment("reaching state \'S65\'"); int temp39 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker40)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker41)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker42)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker43))); if ((temp39 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS81(); goto label18; } if ((temp39 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS81(); goto label18; } if ((temp39 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS81(); goto label18; } if ((temp39 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS81(); goto label18; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker40)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker41)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker42)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker43))); label18: ; goto label20; } if ((temp41 == 1)) { this.Manager.Comment("reaching state \'S66\'"); int temp40 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker44)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker45)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker46)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker47))); if ((temp40 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS82(); goto label19; } if ((temp40 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS82(); goto label19; } if ((temp40 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS82(); goto label19; } if ((temp40 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS82(); goto label19; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker44)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker45)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker46)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker47))); label19: ; goto label20; } throw new InvalidOperationException("never reached"); label20: ; goto label21; } throw new InvalidOperationException("never reached"); label21: ; goto label29; } if ((temp55 == 1)) { this.Manager.Comment("reaching state \'S18\'"); bool temp43; this.Manager.Comment("executing step \'call CheckRequirementEnabled(867,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(867, out temp43); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp43); this.Manager.Comment("reaching state \'S22\'"); int temp54 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker24)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker27))); if ((temp54 == 0)) { this.Manager.Comment("reaching state \'S29\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp44; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp44 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S37\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp44, "return of RopQueryRows, state S37"); this.Manager.Comment("reaching state \'S45\'"); bool temp45; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp45); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp45); this.Manager.Comment("reaching state \'S53\'"); int temp48 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker25)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker26))); if ((temp48 == 0)) { this.Manager.Comment("reaching state \'S67\'"); int temp46 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker48)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker49)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker50)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker51))); if ((temp46 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS83(); goto label22; } if ((temp46 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS83(); goto label22; } if ((temp46 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS83(); goto label22; } if ((temp46 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS83(); goto label22; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker48)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker49)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker50)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker51))); label22: ; goto label24; } if ((temp48 == 1)) { this.Manager.Comment("reaching state \'S68\'"); int temp47 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker52)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker53)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker54)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker55))); if ((temp47 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS84(); goto label23; } if ((temp47 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS84(); goto label23; } if ((temp47 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS84(); goto label23; } if ((temp47 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS84(); goto label23; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker52)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker53)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker54)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker55))); label23: ; goto label24; } throw new InvalidOperationException("never reached"); label24: ; goto label28; } if ((temp54 == 1)) { this.Manager.Comment("reaching state \'S30\'"); Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp49; this.Manager.Comment("executing step \'call RopQueryRows(NoAdvance,True)\'"); temp49 = this.IMS_OXCTABLAdapterInstance.RopQueryRows(((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), true); this.Manager.Checkpoint("MS-OXCTABL_R837"); this.Manager.Comment("reaching state \'S38\'"); this.Manager.Comment("checking step \'return RopQueryRows/success\'"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues)(0)), temp49, "return of RopQueryRows, state S38"); this.Manager.Comment("reaching state \'S46\'"); bool temp50; this.Manager.Comment("executing step \'call CheckRequirementEnabled(443,out _)\'"); this.IMS_OXCTABLAdapterInstance.CheckRequirementEnabled(443, out temp50); this.Manager.AddReturn(CheckRequirementEnabledInfo, null, temp50); this.Manager.Comment("reaching state \'S54\'"); int temp53 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker28)), new ExpectedReturn(S05_ResetSortTableRops_SortTable_TestSuite.CheckRequirementEnabledInfo, null, new CheckRequirementEnabledDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker29))); if ((temp53 == 0)) { this.Manager.Comment("reaching state \'S69\'"); int temp51 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker56)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker57)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker58)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker59))); if ((temp51 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS85(); goto label25; } if ((temp51 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS85(); goto label25; } if ((temp51 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS85(); goto label25; } if ((temp51 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS85(); goto label25; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker56)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker57)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker58)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker59))); label25: ; goto label27; } if ((temp53 == 1)) { this.Manager.Comment("reaching state \'S70\'"); int temp52 = this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker60)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker61)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker62)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker63))); if ((temp52 == 0)) { S05_ResetSortTableRops_SortTable_TestSuiteS86(); goto label26; } if ((temp52 == 1)) { S05_ResetSortTableRops_SortTable_TestSuiteS86(); goto label26; } if ((temp52 == 2)) { S05_ResetSortTableRops_SortTable_TestSuiteS86(); goto label26; } if ((temp52 == 3)) { S05_ResetSortTableRops_SortTable_TestSuiteS86(); goto label26; } this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker60)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker61)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker62)), new ExpectedEvent(S05_ResetSortTableRops_SortTable_TestSuite.RopQueryRowsResponseInfo, null, new RopQueryRowsResponseDelegate1(this.MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker63))); label26: ; goto label27; } throw new InvalidOperationException("never reached"); label27: ; goto label28; } throw new InvalidOperationException("never reached"); label28: ; goto label29; } throw new InvalidOperationException("never reached"); label29: ; goto label30; } throw new InvalidOperationException("never reached"); label30: ; goto label31; } throw new InvalidOperationException("never reached"); label31: ; this.Manager.EndTest(); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckMAPIHTTPTransportSupportedChecker(bool isSupported) { this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S1"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckMAPIHTTPTransportSupportedChecker1(bool isSupported) { this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S1"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S10"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker1(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S13"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker2(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S19"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker3(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S47"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S55"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS71() { this.Manager.Comment("reaching state \'S71\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker1(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S55"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker2(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S55"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker3(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S55"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S55"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker4(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S47"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker4(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S56"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS72() { this.Manager.Comment("reaching state \'S72\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker5(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S56"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker6(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S56"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker7(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S56"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S56"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker5(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S19"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker6(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S48"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker8(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S57"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS73() { this.Manager.Comment("reaching state \'S73\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker9(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S57"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker10(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S57"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker11(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S57"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S57"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker7(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S48"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker12(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S58"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS74() { this.Manager.Comment("reaching state \'S74\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker13(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S58"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker14(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S58"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker15(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S58"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S58"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker8(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S13"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker9(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S20"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker10(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S49"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker16(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S59"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS75() { this.Manager.Comment("reaching state \'S75\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker17(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S59"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker18(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S59"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker19(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S59"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S59"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker11(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S49"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker20(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S60"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS76() { this.Manager.Comment("reaching state \'S76\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker21(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S60"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker22(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S60"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker23(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S60"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S60"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker12(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S20"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker13(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S50"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker24(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S61"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS77() { this.Manager.Comment("reaching state \'S77\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker25(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S61"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker26(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S61"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker27(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S61"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S61"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker14(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S50"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker28(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S62"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS78() { this.Manager.Comment("reaching state \'S78\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker29(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S62"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker30(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S62"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker31(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S62"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S62"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker15(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S10"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker16(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S14"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker17(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S21"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker18(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S51"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker32(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S63"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS79() { this.Manager.Comment("reaching state \'S79\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker33(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S63"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker34(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S63"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker35(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S63"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S63"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker19(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S51"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker36(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S64"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS80() { this.Manager.Comment("reaching state \'S80\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker37(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S64"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker38(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S64"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker39(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S64"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S64"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker20(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S21"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker21(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S52"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker40(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S65"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS81() { this.Manager.Comment("reaching state \'S81\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker41(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S65"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker42(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S65"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker43(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S65"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S65"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker22(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S52"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker44(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S66"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS82() { this.Manager.Comment("reaching state \'S82\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker45(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S66"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker46(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S66"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker47(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S66"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S66"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker23(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S14"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker24(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S22"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker25(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S53"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker48(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S67"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS83() { this.Manager.Comment("reaching state \'S83\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker49(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S67"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker50(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S67"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker51(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S67"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S67"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker26(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S53"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker52(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S68"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS84() { this.Manager.Comment("reaching state \'S84\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker53(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S68"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker54(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S68"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker55(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S68"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S68"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker27(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S22"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker28(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out True]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, enabled, "enabled of CheckRequirementEnabled, state S54"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker56(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S69"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS85() { this.Manager.Comment("reaching state \'S85\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker57(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S69"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker58(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S69"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker59(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S69"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S69"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438, MS-OXCTABL_R443"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); this.Manager.Checkpoint("MS-OXCTABL_R443"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteCheckRequirementEnabledChecker29(bool enabled) { this.Manager.Comment("checking step \'return CheckRequirementEnabled/[out False]\'"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, enabled, "enabled of CheckRequirementEnabled, state S54"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker60(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_BEGINNING,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(0)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S70"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R27, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R27"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void S05_ResetSortTableRops_SortTable_TestSuiteS86() { this.Manager.Comment("reaching state \'S86\'"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker61(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_END,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_END, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S70"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker62(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CUSTOM,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType.BOOKMARK_CUSTOM, queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S70"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } private void MSOXCTABL_S05_ResetSortTableRops_SortTable_TestSuiteRopQueryRowsResponseChecker63(Microsoft.Protocols.TestSuites.Common.QueryRowsFlags queryRowFlags, bool bForwardRead, bool bZeroRow, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType ropType, bool bIsCorrectRowCount, bool bCursorPositionChanged, bool bIsLatestRopData, bool bIsLastSuccessRopData, Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType queryRowOrigin, bool isRequestCountTooLarger) { this.Manager.Comment("checking step \'event RopQueryRowsResponse(NoAdvance,True,False,SORTTABLE,True,Fal" + "se,True,True,BOOKMARK_CURRENT,True)\'"); try { TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.Common.QueryRowsFlags>(this.Manager, ((Microsoft.Protocols.TestSuites.Common.QueryRowsFlags)(1)), queryRowFlags, "queryRowFlags of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bForwardRead, "bForwardRead of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bZeroRow, "bZeroRow of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopType)(1)), ropType, "ropType of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsCorrectRowCount, "bIsCorrectRowCount of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, bCursorPositionChanged, "bCursorPositionChanged of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLatestRopData, "bIsLatestRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, bIsLastSuccessRopData, "bIsLastSuccessRopData of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType>(this.Manager, ((Microsoft.Protocols.TestSuites.MS_OXCTABL.BookmarkType)(1)), queryRowOrigin, "queryRowOrigin of RopQueryRowsResponse, state S70"); TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isRequestCountTooLarger, "isRequestCountTooLarger of RopQueryRowsResponse, state S70"); } catch (TransactionFailedException ) { this.Manager.Comment(@"This step would have covered MS-OXCTABL_R470, MS-OXCTABL_R468, MS-OXCTABL_R118, MS-OXCTABL_R462, MS-OXCTABL_R437, MS-OXCTABL_R116, MS-OXCTABL_R66, MS-OXCTABL_R67, MS-OXCTABL_R71, MS-OXCTABL_R72, MS-OXCTABL_R76, MS-OXCTABL_R77, MS-OXCTABL_R119, MS-OXCTABL_R437, MS-OXCTABL_R438"); throw; } this.Manager.Checkpoint("MS-OXCTABL_R470"); this.Manager.Checkpoint("MS-OXCTABL_R468"); this.Manager.Checkpoint("MS-OXCTABL_R118"); this.Manager.Checkpoint("MS-OXCTABL_R462"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R116"); this.Manager.Checkpoint("MS-OXCTABL_R66"); this.Manager.Checkpoint("MS-OXCTABL_R67"); this.Manager.Checkpoint("MS-OXCTABL_R71"); this.Manager.Checkpoint("MS-OXCTABL_R72"); this.Manager.Checkpoint("MS-OXCTABL_R76"); this.Manager.Checkpoint("MS-OXCTABL_R77"); this.Manager.Checkpoint("MS-OXCTABL_R119"); this.Manager.Checkpoint("MS-OXCTABL_R437"); this.Manager.Checkpoint("MS-OXCTABL_R438"); } #endregion } }
103.100959
969
0.70587
[ "MIT" ]
ChangDu2021/Interop-TestSuites
ExchangeMAPI/Source/MS-OXCTABL/TestSuite/S05_ResetSortTableRops_SortTable_TestSuite.cs
344,151
C#
// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace Autofac.Diagnostics; /// <summary> /// Names of the events raised in diagnostics. /// </summary> internal static class DiagnosticEventKeys { /// <summary> /// ID for the event raised when middleware starts. /// </summary> public const string MiddlewareStart = "Autofac.Middleware.Start"; /// <summary> /// ID for the event raised when middleware encounters an error. /// </summary> public const string MiddlewareFailure = "Autofac.Middleware.Failure"; /// <summary> /// ID for the event raised when middleware exits successfully. /// </summary> public const string MiddlewareSuccess = "Autofac.Middleware.Success"; /// <summary> /// ID for the event raised when a resolve operation encounters an error. /// </summary> public const string OperationFailure = "Autofac.Operation.Failure"; /// <summary> /// ID for the event raised when a resolve operation starts. /// </summary> public const string OperationStart = "Autofac.Operation.Start"; /// <summary> /// ID for the event raised when a resolve operation completes successfully. /// </summary> public const string OperationSuccess = "Autofac.Operation.Success"; /// <summary> /// ID for the event raised when a resolve request encounters an error. /// </summary> public const string RequestFailure = "Autofac.Request.Failure"; /// <summary> /// ID for the event raised when a resolve request starts. /// </summary> public const string RequestStart = "Autofac.Request.Start"; /// <summary> /// ID for the event raised when a resolve request completes successfully. /// </summary> public const string RequestSuccess = "Autofac.Request.Success"; }
34.089286
91
0.681509
[ "MIT" ]
rcdailey/Autofac
src/Autofac/Diagnostics/DiagnosticEventKeys.cs
1,911
C#
using System; using System.Numerics; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Atari.Atari2600 { // Emulates the TIA public partial class TIA : IVideoProvider, ISoundProvider { static TIA() { // add alpha to palette entries for (int i = 0; i < PALPalette.Length; i++) { PALPalette[i] |= unchecked((int)0xff000000); } for (int i = 0; i < NTSCPalette.Length; i++) { NTSCPalette[i] |= unchecked((int)0xff000000); } } public TIA(Atari2600 core, bool pal, bool secam) { _core = core; _player0.ScanCnt = 8; _player1.ScanCnt = 8; _pal = pal; SetSecam(secam); CalcFrameRate(); _spf = _vsyncNum / (double)_vsyncDen > 55.0 ? 735 : 882; } // indicates to the core where a new frame is starting public bool New_Frame = false; private const int BackColor = unchecked((int)0xff000000); private const int ScreenWidth = 160; private const int MaxScreenHeight = 312; private const byte CXP0 = 0x01; private const byte CXP1 = 0x02; private const byte CXM0 = 0x04; private const byte CXM1 = 0x08; private const byte CXPF = 0x10; private const byte CXBL = 0x20; private readonly Atari2600 _core; // in all cases, the TIA has 228 clocks per scanline // the NTSC TIA has a clock rate of 3579575hz // the PAL/SECAM TIA has a clock rate of 3546894hz private readonly bool _pal; public int NominalNumScanlines => _pal ? 312 : 262; private int[] _scanlinebuffer = new int[ScreenWidth * MaxScreenHeight]; private int[] _palette; internal int BusState; private byte _pf0Update; private byte _pf1Update; private byte _pf2Update; private bool _pf0Updater; private bool _pf1Updater; private bool _pf2Updater; private byte _pf0DelayClock; private byte _pf1DelayClock; private byte _pf2DelayClock; private byte _pf0MaxDelay; private byte _pf1MaxDelay; private byte _pf2MaxDelay; private int _enam0Delay; private int _enam1Delay; private int _enambDelay; private bool _enam0Val; private bool _enam1Val; private bool _enambVal; private int _vblankDelay; private byte _vblankValue; private bool _p0Stuff; private bool _p1Stuff; private bool _m0Stuff; private bool _m1Stuff; private bool _bStuff; private int _hmp0Delay; private byte _hmp0Val; private int _hmp1Delay; private byte _hmp1Val; private int _hmm0Delay; private byte _hmm0Val; private int _hmm1Delay; private byte _hmm1Val; private int _hmbDelay; private byte _hmbVal; private int _prg0Delay; private int _prg1Delay; private byte _prg0Val; private byte _prg1Val; private bool _doTicks; private bool hmove_cnt_up; private byte _hsyncCnt; private long _capChargeStart; private bool _capCharging; private bool _vblankEnabled; private bool _vsyncEnabled; private int _currentScanLine; public int AudioClocks; // not savestated private PlayerData _player0; private PlayerData _player1; private PlayfieldData _playField; private HMoveData _hmove; private BallData _ball; private readonly Audio[] AUD = { new Audio(), new Audio() }; // current audio register state used to sample correct positions in the scanline (clrclk 0 and 114) ////public byte[] current_audio_register = new byte[6]; public readonly short[] LocalAudioCycles = new short[2000]; private static int ReverseBits(int value, int bits) { int result = 0; for (int i = 0; i < bits; i++) { result = (result << 1) | ((value >> i) & 0x01); } return result; } private void CalcFrameRate() { // TODO when sound timing is made exact: // NTSC refclock is actually 315 / 88 mhz // 3546895 int clockrate = _pal ? 3546895 : 3579545; int clocksperframe = 228 * NominalNumScanlines; int gcd = (int)BigInteger.GreatestCommonDivisor(clockrate, clocksperframe); _vsyncNum = clockrate / gcd; _vsyncDen = clocksperframe / gcd; } public void SetSecam(bool secam) { _palette = _pal ? secam ? SecamPalette : PALPalette : NTSCPalette; } public int CurrentScanLine => _currentScanLine; public bool IsVBlank => _vblankEnabled; public bool IsVSync => _vsyncEnabled; /// <summary> /// Gets or sets a count of lines emulated; incremented by the TIA but not used by it /// </summary> public int LineCount { get; set; } public void Reset() { _hsyncCnt = 0; _capChargeStart = 0; _capCharging = false; _vblankEnabled = false; _vblankDelay = 0; _vblankValue = 0; _vsyncEnabled = false; _currentScanLine = 0; AudioClocks = 0; BusState = 0; _pf0Update = 0; _pf1Update = 0; _pf2Update = 0; _pf0Updater = false; _pf1Updater = false; _pf2Updater = false; _pf0DelayClock = 0; _pf1DelayClock = 0; _pf2DelayClock = 0; _pf0MaxDelay = 0; _pf1MaxDelay = 0; _pf2MaxDelay = 0; _enam0Delay = 0; _enam1Delay = 0; _enambDelay = 0; _enam0Val = false; _enam1Val = false; _enambVal = false; _p0Stuff = false; _p1Stuff = false; _m0Stuff = false; _m1Stuff = false; _bStuff = false; _hmp0Delay = 0; _hmp0Val = 0; _hmp1Delay = 0; _hmp1Val = 0; _hmm0Delay = 0; _hmm0Val = 0; _hmm1Delay = 0; _hmm1Val = 0; _hmbDelay = 0; _hmbVal = 0; _prg0Delay = 0; _prg1Delay = 0; _prg0Val = 0; _prg1Val = 0; _doTicks = false; _player0 = new PlayerData(); _player1 = new PlayerData(); _playField = new PlayfieldData(); _hmove = new HMoveData(); _ball = new BallData(); _player0.ScanCnt = 8; _player1.ScanCnt = 8; } // Execute TIA cycles public void Execute() { // Handle all of the Latch delays that occur in the TIA if (_vblankDelay > 0) { _vblankDelay++; if (_vblankDelay == 3) { _vblankEnabled = (_vblankValue & 0x02) != 0; _vblankDelay = 0; } } if (_pf0Updater) { _pf0DelayClock++; if (_pf0DelayClock > _pf0MaxDelay) { _playField.Grp = (uint)((_playField.Grp & 0x0FFFF) + ((ReverseBits(_pf0Update, 8) & 0x0F) << 16)); _pf0Updater = false; } } if (_pf1Updater) { _pf1DelayClock++; if (_pf1DelayClock > _pf1MaxDelay) { _playField.Grp = (uint)((_playField.Grp & 0xF00FF) + (_pf1Update << 8)); _pf1Updater = false; } } if (_pf2Updater) { _pf2DelayClock++; if (_pf2DelayClock > _pf2MaxDelay) { _playField.Grp = (uint)((_playField.Grp & 0xFFF00) + ReverseBits(_pf2Update, 8)); _pf2Updater = false; } } if (_enam0Delay > 0) { _enam0Delay++; if (_enam0Delay == 3) { _enam0Delay = 0; _player0.Missile.Enabled = _enam0Val; } } if (_enam1Delay > 0) { _enam1Delay++; if (_enam1Delay == 3) { _enam1Delay = 0; _player1.Missile.Enabled = _enam1Val; } } if (_enambDelay > 0) { _enambDelay++; if (_enambDelay == 3) { _enambDelay = 0; _ball.Enabled = _enambVal; } } if (_prg0Delay > 0) { _prg0Delay++; if (_prg0Delay == 3) { _prg0Delay = 0; _player0.Grp = _prg0Val; _player1.Dgrp = _player1.Grp; } } if (_prg1Delay > 0) { _prg1Delay++; if (_prg1Delay == 3) { _prg1Delay = 0; _player1.Grp = _prg1Val; _player0.Dgrp = _player0.Grp; // TODO: Find a game that uses this functionality and test it _ball.Denabled = _ball.Enabled; } } if (_hmp0Delay > 0) { _hmp0Delay++; if (_hmp0Delay == 4) { _hmp0Delay = 0; _player0.HM = _hmp0Val; } } if (_hmp1Delay > 0) { _hmp1Delay++; if (_hmp1Delay == 4) { _hmp1Delay = 0; _player1.HM = _hmp1Val; } } if (_hmm0Delay > 0) { _hmm0Delay++; if (_hmm0Delay == 4) { _hmm0Delay = 0; _player0.Missile.Hm = _hmm0Val; } } if (_hmm1Delay > 0) { _hmm1Delay++; if (_hmm1Delay == 4) { _hmm1Delay = 0; _player1.Missile.Hm = _hmm1Val; } } if (_hmbDelay > 0) { _hmbDelay++; if (_hmbDelay == 4) { _hmbDelay = 0; _ball.HM = _hmbVal; } } // Reset the RDY flag when we reach hblank if (_hsyncCnt <= 0) { _core.Cpu.RDY = true; } // Assume we're on the left side of the screen for now var rightSide = false; // ---- Things that happen only in the drawing section ---- // TODO: Remove this magic number (17). It depends on the HMOVE if (_hsyncCnt >= (_hmove.LateHBlankReset ? 76 : 68)) { _doTicks = false; // TODO: Remove this magic number if ((_hsyncCnt / 4) >= 37) { rightSide = true; } // The bit number of the PF data which we want int pfBit = ((_hsyncCnt / 4) - 17) % 20; // Create the mask for the bit we want // Note that bits are arranged 0 1 2 3 4 .. 19 int pfMask = 1 << (20 - 1 - pfBit); // Reverse the mask if on the right and playfield is reflected if (rightSide && _playField.Reflect) { pfMask = ReverseBits(pfMask, 20); } // Calculate collisions byte collisions = 0x00; if ((_playField.Grp & pfMask) != 0) { collisions |= CXPF; } // ---- Player 0 ---- collisions |= _player0.Tick() ? CXP0 : (byte)0x00; // ---- Missile 0 ---- collisions |= _player0.Missile.Tick() ? CXM0 : (byte)0x00; // ---- Player 1 ---- collisions |= _player1.Tick() ? CXP1 : (byte)0x00; // ---- Missile 0 ---- collisions |= _player1.Missile.Tick() ? CXM1 : (byte)0x00; // ---- Ball ---- collisions |= _ball.Tick() ? CXBL : (byte)0x00; // Pick the pixel color from collisions int pixelColor = BackColor; if (_core.Settings.ShowBG) { pixelColor = _palette[_playField.BkColor]; } if ((collisions & CXPF) != 0 && _core.Settings.ShowPlayfield) { if (_playField.Score) { pixelColor = !rightSide ? _palette[_player0.Color] : _palette[_player1.Color]; } else { pixelColor = _palette[_playField.PfColor]; } } if ((collisions & CXBL) != 0) { _ball.Collisions |= collisions; if (_core.Settings.ShowBall) { pixelColor = _palette[_playField.PfColor]; } } if ((collisions & CXM1) != 0) { _player1.Missile.Collisions |= collisions; if (_core.Settings.ShowMissle2) { pixelColor = _palette[_player1.Color]; } } if ((collisions & CXP1) != 0) { _player1.Collisions |= collisions; if (_core.Settings.ShowPlayer2) { pixelColor = _palette[_player1.Color]; } } if ((collisions & CXM0) != 0) { _player0.Missile.Collisions |= collisions; if (_core.Settings.ShowMissle1) { pixelColor = _palette[_player0.Color]; } } if ((collisions & CXP0) != 0) { _player0.Collisions |= collisions; if (_core.Settings.ShowPlayer1) { pixelColor = _palette[_player0.Color]; } } if (_playField.Score && !_playField.Priority && ((collisions & CXPF) != 0) && _core.Settings.ShowPlayfield) { pixelColor = !rightSide ? _palette[_player0.Color] : _palette[_player1.Color]; } if (_playField.Priority && (collisions & CXPF) != 0 && _core.Settings.ShowPlayfield) { pixelColor = _palette[_playField.PfColor]; } // Handle vblank if (_vblankEnabled) { pixelColor = BackColor; } // Add the pixel to the scanline // TODO: Remove this magic number (68) int y = _currentScanLine; // y >= max screen height means lag frame or game crashed, but is a legal situation. // either way, there's nothing to display if (y < MaxScreenHeight) { int x = _hsyncCnt - 68; if (x < 0 || x > 159) // this can't happen, right? { throw new Exception(); // TODO } _scanlinebuffer[(_currentScanLine * ScreenWidth) + x] = pixelColor; } } else { _doTicks = true; } // if extended HBLank is active, the screen area still needs a color if (_hsyncCnt >= 68 && _hsyncCnt < 76 && _hmove.LateHBlankReset) { int pixelColor = 0; // Add the pixel to the scanline // TODO: Remove this magic number (68) int y = _currentScanLine; // y >= max screen height means lag frame or game crashed, but is a legal situation. // either way, there's nothing to display if (y < MaxScreenHeight) { int x = _hsyncCnt - 68; if (x < 0 || x > 159) // this can't happen, right? { throw new Exception(); // TODO } _scanlinebuffer[(_currentScanLine * ScreenWidth) + x] = pixelColor; } } // Handle HMOVE if (_hmove.HMoveEnabled) { if (_hmove.DecCntEnabled) { // Actually do stuff only evey 4 pulses if (_hmove.HMoveCnt == 0) { // If the latch is still set if (_hmove.Player0Latch) { // If the move counter still has a bit in common with the HM register if (((15 - _hmove.Player0Cnt) ^ ((_player0.HM & 0x07) | ((~(_player0.HM & 0x08)) & 0x08))) != 0x0F) { _p0Stuff = true; } else { _hmove.Player0Latch = false; } } if (_hmove.Missile0Latch) { // If the move counter still has a bit in common with the HM register if (((15 - _hmove.Missile0Cnt) ^ ((_player0.Missile.Hm & 0x07) | ((~(_player0.Missile.Hm & 0x08)) & 0x08))) != 0x0F) { _m0Stuff = true; } else { _hmove.Missile0Latch = false; } } if (_hmove.Player1Latch) { // If the move counter still has a bit in common with the HM register if (((15 - _hmove.Player1Cnt) ^ ((_player1.HM & 0x07) | ((~(_player1.HM & 0x08)) & 0x08))) != 0x0F) { _p1Stuff = true; } else { _hmove.Player1Latch = false; } } if (_hmove.Missile1Latch) { // If the move counter still has a bit in common with the HM register if (((15 - _hmove.Missile1Cnt) ^ ((_player1.Missile.Hm & 0x07) | ((~(_player1.Missile.Hm & 0x08)) & 0x08))) != 0x0F) { _m1Stuff = true; } else { _hmove.Missile1Latch = false; } } if (_hmove.BallLatch) { // If the move counter still has a bit in common with the HM register if (((15 - _hmove.BallCnt) ^ ((_ball.HM & 0x07) | ((~(_ball.HM & 0x08)) & 0x08))) != 0x0F) { _bStuff = true; } else { _hmove.BallLatch = false; } } if (!_hmove.Player0Latch && !_hmove.Player1Latch && !_hmove.BallLatch && !_hmove.Missile0Latch && !_hmove.Missile1Latch) { _hmove.HMoveEnabled = false; _hmove.DecCntEnabled = false; _hmove.HMoveDelayCnt = 0; } } _hmove.HMoveCnt++; _hmove.HMoveCnt %= 4; if (_p0Stuff) { _p0Stuff = false; // "Clock-Stuffing" if (_doTicks) { _player0.Tick(); } // Increase by 1, max of 15 _hmove.test_count_p0++; if (_hmove.test_count_p0 < 16) { _hmove.Player0Cnt++; } else { _hmove.Player0Cnt = 0; } } if (_p1Stuff) { _p1Stuff = false; // "Clock-Stuffing" if (_doTicks) { _player1.Tick(); } // Increase by 1, max of 15 _hmove.test_count_p1++; if (_hmove.test_count_p1 < 16) { _hmove.Player1Cnt++; } else { _hmove.Player1Cnt = 0; } } if (_m0Stuff) { _m0Stuff = false; // "Clock-Stuffing" if (_doTicks) { _player0.Missile.Tick(); } // Increase by 1, max of 15 _hmove.test_count_m0++; if (_hmove.test_count_m0 < 16) { _hmove.Missile0Cnt++; } else { _hmove.Missile0Cnt = 0; } } if (_m1Stuff) { _m1Stuff = false; // "Clock-Stuffing" if (_doTicks) { _player1.Missile.Tick(); } // Increase by 1, max of 15 _hmove.test_count_m1++; if (_hmove.test_count_m1 < 16) { _hmove.Missile1Cnt++; } else { _hmove.Missile1Cnt = 0; } } if (_bStuff) { _bStuff = false; // "Clock-Stuffing" if (_doTicks) { _ball.Tick(); } // Increase by 1, max of 15 _hmove.test_count_b++; if (_hmove.test_count_b < 16) { _hmove.BallCnt++; } else { _hmove.BallCnt = 0; } } } if (hmove_cnt_up) { _hmove.HMoveDelayCnt++; } if ((_hmove.HMoveDelayCnt >= 5) && hmove_cnt_up) { hmove_cnt_up = false; _hmove.HMoveCnt = 4; _hmove.DecCntEnabled = true; _hmove.test_count_p0 = 0; _hmove.test_count_p1 = 0; _hmove.test_count_m0 = 0; _hmove.test_count_m1 = 0; _hmove.test_count_b = 0; _hmove.Player0Latch = true; _hmove.Player0Cnt = 0; _hmove.Missile0Latch = true; _hmove.Missile0Cnt = 0; _hmove.Player1Latch = true; _hmove.Player1Cnt = 0; _hmove.Missile1Latch = true; _hmove.Missile1Cnt = 0; _hmove.BallLatch = true; _hmove.BallCnt = 0; _hmove.LateHBlankReset = true; } } // do the audio sampling if (_hsyncCnt == 36 || _hsyncCnt == 148) { if (AudioClocks < 2000) { LocalAudioCycles[AudioClocks] += (short)(AUD[0].Cycle() / 2); LocalAudioCycles[AudioClocks] += (short)(AUD[1].Cycle() / 2); AudioClocks++; } } // Increment the hsync counter _hsyncCnt++; _hsyncCnt %= 228; // End of the line? Add it to the buffer! if (_hsyncCnt == 0) { _hmove.LateHBlankReset = false; _currentScanLine++; LineCount++; } } private void OutputFrame(int validlines) { int topLine = _pal ? _core.Settings.PALTopLine : _core.Settings.NTSCTopLine; int bottomLine = _pal ? _core.Settings.PALBottomLine : _core.Settings.NTSCBottomLine; // if vsync occured unexpectedly early, black out the remainder for (; validlines < bottomLine; validlines++) { for (int i = 0; i < 160; i++) { _scanlinebuffer[(validlines * 160) + i] = BackColor; } } int srcbytes = sizeof(int) * ScreenWidth * topLine; int count = bottomLine - topLine; // no +1, as the bottom line number is not inclusive count *= sizeof(int) * ScreenWidth; Buffer.BlockCopy(_scanlinebuffer, srcbytes, _frameBuffer, 0, count); } public byte ReadMemory(ushort addr, bool peek) { var maskedAddr = (ushort)(addr & 0x000F); byte coll = 0; int mask = 0; if (maskedAddr == 0x00) // CXM0P { coll = (byte)((((_player0.Missile.Collisions & CXP1) != 0) ? 0x80 : 0x00) | (((_player0.Missile.Collisions & CXP0) != 0) ? 0x40 : 0x00)); mask = 0x3f; } if (maskedAddr == 0x01) // CXM1P { coll = (byte)((((_player1.Missile.Collisions & CXP0) != 0) ? 0x80 : 0x00) | (((_player1.Missile.Collisions & CXP1) != 0) ? 0x40 : 0x00)); mask = 0x3f; } if (maskedAddr == 0x02) // CXP0FB { coll = (byte)((((_player0.Collisions & CXPF) != 0) ? 0x80 : 0x00) | (((_player0.Collisions & CXBL) != 0) ? 0x40 : 0x00)); mask = 0x3f; } if (maskedAddr == 0x03) // CXP1FB { coll = (byte)((((_player1.Collisions & CXPF) != 0) ? 0x80 : 0x00) | (((_player1.Collisions & CXBL) != 0) ? 0x40 : 0x00)); mask = 0x3f; } if (maskedAddr == 0x04) // CXM0FB { coll = (byte)((((_player0.Missile.Collisions & CXPF) != 0) ? 0x80 : 0x00) | (((_player0.Missile.Collisions & CXBL) != 0) ? 0x40 : 0x00)); mask = 0x3f; } if (maskedAddr == 0x05) // CXM1FB { coll = (byte)((((_player1.Missile.Collisions & CXPF) != 0) ? 0x80 : 0x00) | (((_player1.Missile.Collisions & CXBL) != 0) ? 0x40 : 0x00)); mask = 0x3f; } if (maskedAddr == 0x06) // CXBLPF { coll = (byte)(((_ball.Collisions & CXPF) != 0) ? 0x80 : 0x00); mask = 0x7f; } if (maskedAddr == 0x07) // CXPPMM { coll = (byte)((((_player0.Collisions & CXP1) != 0) ? 0x80 : 0x00) | (((_player0.Missile.Collisions & CXM1) != 0) ? 0x40 : 0x00)); mask = 0x3f; } // inputs 0-3 are measured by a charging capacitor, these inputs are used with the paddles and the keyboard // Changing the hard coded value will change the paddle position. The range seems to be roughly 0-56000 according to values from stella // 6105 roughly centers the paddle in Breakout if (maskedAddr == 0x08) // INPT0 { if (_core.ReadPot1(0)>0 && _capCharging && _core.Cpu.TotalExecutedCycles - _capChargeStart >= _core.ReadPot1(0)) { coll = 0x80; } else { coll = 0x00; } mask = 0x7f; } if (maskedAddr == 0x09) // INPT1 { if (_core.ReadPot1(1) > 0 && _capCharging && _core.Cpu.TotalExecutedCycles - _capChargeStart >= _core.ReadPot1(1)) { coll = 0x80; } else { coll = 0x00; } mask = 0x7f; } if (maskedAddr == 0x0A) // INPT2 { if (_core.ReadPot2(0) > 0 && _capCharging && _core.Cpu.TotalExecutedCycles - _capChargeStart >= _core.ReadPot2(0)) { coll = 0x80; } else { coll = 0x00; } mask = 0x7f; } if (maskedAddr == 0x0B) // INPT3 { if (_core.ReadPot2(1) > 0 && _capCharging && _core.Cpu.TotalExecutedCycles - _capChargeStart >= _core.ReadPot2(1)) { coll = 0x80; } else { coll = 0x00; } mask = 0x7f; } if (maskedAddr == 0x0C) // INPT4 { coll = (byte)((_core.ReadControls1(peek) & 0x08) != 0 ? 0x80 : 0x00); mask = 0x7f; } if (maskedAddr == 0x0D) // INPT5 { coll = (byte)((_core.ReadControls2(peek) & 0x08) != 0 ? 0x80 : 0x00); mask = 0x7f; } // some bits of the databus will be undriven when a read call is made. Our goal here is to sort out what // happens to the undriven pins. Most of the time, they will be in whatever state they were when previously // assigned in some other bus access, so let's go with that. coll += (byte)(mask & BusState); if (!peek) { BusState = coll; } return coll; } public void WriteMemory(ushort addr, byte value, bool poke) { var maskedAddr = (ushort)(addr & 0x3f); if (!poke) { BusState = value; } if (maskedAddr == 0x00) // VSYNC { if ((value & 0x02) != 0) { // Frame is complete, output to buffer _vsyncEnabled = true; } else if (_vsyncEnabled) { // When VSYNC is disabled, this will be the first line of the new frame // write to frame buffer OutputFrame(_currentScanLine); New_Frame = true; // Clear all from last frame _currentScanLine = 0; // Frame is done _vsyncEnabled = false; // Do not reset hsync, since we're on the first line of the new frame // hsyncCnt = 0; } } else if (maskedAddr == 0x01) // VBLANK { _vblankDelay = 1; _vblankValue = value; _capCharging = (value & 0x80) == 0; if ((value & 0x80) == 0) { _capChargeStart = _core.Cpu.TotalExecutedCycles; } } else if (maskedAddr == 0x02) // WSYNC { // Halt the CPU until we reach hblank _core.Cpu.RDY = false; } else if (maskedAddr == 0x04) // NUSIZ0 { _player0.Nusiz = (byte)(value & 0x37); _player0.Missile.Size = (byte)((value & 0x30) >> 4); _player0.Missile.Number = (byte)(value & 0x07); } else if (maskedAddr == 0x05) // NUSIZ1 { _player1.Nusiz = (byte)(value & 0x37); _player1.Missile.Size = (byte)((value & 0x30) >> 4); _player1.Missile.Number = (byte)(value & 0x07); } else if (maskedAddr == 0x06) // COLUP0 { _player0.Color = (byte)(value & 0xFE); } else if (maskedAddr == 0x07) // COLUP1 { _player1.Color = (byte)(value & 0xFE); } else if (maskedAddr == 0x08) // COLUPF { _playField.PfColor = (byte)(value & 0xFE); } else if (maskedAddr == 0x09) // COLUBK { _playField.BkColor = (byte)(value & 0xFE); } else if (maskedAddr == 0x0A) // CTRLPF { _playField.Reflect = (value & 0x01) != 0; _playField.Score = (value & 0x02) != 0; _playField.Priority = (value & 0x04) != 0; _ball.Size = (byte)((value & 0x30) >> 4); } else if (maskedAddr == 0x0B) // REFP0 { _player0.Reflect = (value & 0x08) != 0; } else if (maskedAddr == 0x0C) // REFP1 { _player1.Reflect = (value & 0x08) != 0; } else if (maskedAddr == 0x0D) // PF0 { _pf0Update = value; _pf0Updater = true; _pf0DelayClock = 0; if (((_hsyncCnt / 3) & 3) == 0) { _pf0MaxDelay = 4; } if (((_hsyncCnt / 3) & 3) == 1) { _pf0MaxDelay = 5; } if (((_hsyncCnt / 3) & 3) == 2) { _pf0MaxDelay = 2; } if (((_hsyncCnt / 3) & 3) == 3) { _pf0MaxDelay = 3; } ////_playField.Grp = (uint)((_playField.Grp & 0x0FFFF) + ((ReverseBits(value, 8) & 0x0F) << 16)); } else if (maskedAddr == 0x0E) // PF1 { _pf1Update = value; _pf1Updater = true; _pf1DelayClock = 0; if (((_hsyncCnt / 3) & 3) == 0) { _pf1MaxDelay = 4; } if (((_hsyncCnt / 3) & 3) == 1) { _pf1MaxDelay = 5; } if (((_hsyncCnt / 3) & 3) == 2) { _pf1MaxDelay = 2; } if (((_hsyncCnt / 3) & 3) == 3) { _pf1MaxDelay = 3; } ////_playField.Grp = (uint)((_playField.Grp & 0xF00FF) + (value << 8)); } else if (maskedAddr == 0x0F) // PF2 { _pf2Update = value; _pf2Updater = true; _pf2DelayClock = 0; if (((_hsyncCnt / 3) & 3) == 0) { _pf2MaxDelay = 4; } if (((_hsyncCnt / 3) & 3) == 1) { _pf2MaxDelay = 5; } if (((_hsyncCnt / 3) & 3) == 2) { _pf2MaxDelay = 2; } if (((_hsyncCnt / 3) & 3) == 3) { _pf2MaxDelay = 3; } ////_playField.Grp = (uint)((_playField.Grp & 0xFFF00) + ReverseBits(value, 8)); } else if (maskedAddr == 0x10) // RESP0 { // Resp depends on HMOVE if (!_hmove.LateHBlankReset) { _player0.HPosCnt = (byte)(_hsyncCnt < 68 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 67 || _hsyncCnt==0) { _player0.HPosCnt = 160 - 3; } } else { _player0.HPosCnt = (byte)(_hsyncCnt < 76 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 75 || _hsyncCnt == 0) { _player0.HPosCnt = 160 - 3; } } } else if (maskedAddr == 0x11) // RESP1 { // RESP depends on HMOVE if (!_hmove.LateHBlankReset) { _player1.HPosCnt = (byte)(_hsyncCnt < 68 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 67 || _hsyncCnt == 0) { _player1.HPosCnt = 160 - 3; } } else { _player1.HPosCnt = (byte)(_hsyncCnt < 76 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 75 || _hsyncCnt == 0) { _player1.HPosCnt = 160 - 3; } } } else if (maskedAddr == 0x12) // RESM0 { if (!_hmove.LateHBlankReset) { _player0.Missile.HPosCnt = (byte)(_hsyncCnt < 68 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 67 || _hsyncCnt == 0) { _player0.Missile.HPosCnt = 160 - 3; } } else { _player0.Missile.HPosCnt = (byte)(_hsyncCnt < 76 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 75 || _hsyncCnt == 0) { _player0.Missile.HPosCnt = 160 - 3; } } } else if (maskedAddr == 0x13) // RESM1 { if (!_hmove.LateHBlankReset) { _player1.Missile.HPosCnt = (byte)(_hsyncCnt < 68 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 67 || _hsyncCnt == 0) { _player1.Missile.HPosCnt = 160 - 3; } } else { _player1.Missile.HPosCnt = (byte)(_hsyncCnt < 76 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 75 || _hsyncCnt == 0) { _player1.Missile.HPosCnt = 160 - 3; } } } else if (maskedAddr == 0x14) // RESBL { if (!_hmove.LateHBlankReset) { _ball.HPosCnt = (byte)(_hsyncCnt < 68 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 67 || _hsyncCnt == 0) { _ball.HPosCnt = 160 - 3; } } else { _ball.HPosCnt = (byte)(_hsyncCnt < 76 ? 160 - 2 : 160 - 4); if (_hsyncCnt == 75 || _hsyncCnt == 0) { _ball.HPosCnt = 160 - 3; } } } else if (maskedAddr == 0x15) // AUDC0 { AUD[0].AUDC = (byte)(value & 15); } else if (maskedAddr == 0x16) // AUDC1 { AUD[1].AUDC = (byte)(value & 15); } else if (maskedAddr == 0x17) // AUDF0 { AUD[0].AUDF = (byte)((value & 31) + 1); } else if (maskedAddr == 0x18) // AUDF1 { AUD[1].AUDF = (byte)((value & 31) + 1); } else if (maskedAddr == 0x19) // AUDV0 { AUD[0].AUDV = (byte)(value & 15); } else if (maskedAddr == 0x1A) // AUDV1 { AUD[1].AUDV = (byte)(value & 15); } else if (maskedAddr == 0x1B) // GRP0 { _prg0Val = value; _prg0Delay = 1; } else if (maskedAddr == 0x1C) // GRP1 { _prg1Val = value; _prg1Delay = 1; } else if (maskedAddr == 0x1D) // ENAM0 { _enam0Val = (value & 0x02) != 0; _enam0Delay = 1; } else if (maskedAddr == 0x1E) // ENAM1 { _enam1Val = (value & 0x02) != 0; _enam1Delay = 1; } else if (maskedAddr == 0x1F) // ENABL { _enambVal = (value & 0x02) != 0; _enambDelay = 1; } else if (maskedAddr == 0x20) // HMP0 { _hmp0Val = (byte)((value & 0xF0) >> 4); _hmp0Delay = 1; } else if (maskedAddr == 0x21) // HMP1 { _hmp1Val = (byte)((value & 0xF0) >> 4); _hmp1Delay = 1; } else if (maskedAddr == 0x22) // HMM0 { _hmm0Val = (byte)((value & 0xF0) >> 4); _hmm0Delay = 1; } else if (maskedAddr == 0x23) // HMM1 { _hmm1Val = (byte)((value & 0xF0) >> 4); _hmm1Delay = 1; } else if (maskedAddr == 0x24) // HMBL { _hmbVal = (byte)((value & 0xF0) >> 4); _hmbDelay = 1; } else if (maskedAddr == 0x25) // VDELP0 { _player0.Delay = (value & 0x01) != 0; } else if (maskedAddr == 0x26) // VDELP1 { _player1.Delay = (value & 0x01) != 0; } else if (maskedAddr == 0x27) // VDELBL { _ball.Delay = (value & 0x01) != 0; } else if (maskedAddr == 0x28) // RESMP0 { _player0.Missile.ResetToPlayer = (value & 0x02) != 0; } else if (maskedAddr == 0x29) // RESMP1 { _player1.Missile.ResetToPlayer = (value & 0x02) != 0; } else if (maskedAddr == 0x2A) // HMOVE { _hmove.HMoveEnabled = true; hmove_cnt_up = true; _hmove.HMoveDelayCnt = 0; } else if (maskedAddr == 0x2B) // HMCLR { _player0.HM = 0; _player0.Missile.Hm = 0; _player1.HM = 0; _player1.Missile.Hm = 0; _ball.HM = 0; } else if (maskedAddr == 0x2C) // CXCLR { _player0.Collisions = 0; _player0.Missile.Collisions = 0; _player1.Collisions = 0; _player1.Missile.Collisions = 0; _ball.Collisions = 0; } } private enum AudioRegister : byte { AUDC, AUDF, AUDV } } }
23.447178
142
0.54376
[ "MIT" ]
Moliman/BizHawk
BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs
32,406
C#
using System; using System.Collections.Generic; using System.Text; using Game.Logic.AI; namespace GameServerScript.AI.Game { public class TimeVortexHardGame : APVEGameControl { public override void OnCreated() { //Game.SetupMissions("12201,12202,12203,12204"); Game.SetupMissions("12001,12002,12003,12004"); Game.TotalMissionCount = 2; } public override void OnPrepated() { //Game.SessionId = 0; } public override int CalculateScoreGrade(int score) { if (score > 800) { return 3; } else if (score > 725) { return 2; } else if (score > 650) { return 1; } else { return 0; } } public override void OnGameOverAllSession() { } } }
21
60
0.459325
[ "MIT" ]
HuyTruong19x/DDTank4.1
Source Server/Game.Server.Scripts/AI/Game/TimeVortexHardGame.cs
1,010
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: IEntityRequest.cs.tt namespace Microsoft.Graph { using System; using System.IO; using System.Net.Http; using System.Threading; using System.Linq.Expressions; /// <summary> /// The interface IEducationRootRequest. /// </summary> public partial interface IEducationRootRequest : IBaseRequest { /// <summary> /// Creates the specified EducationRoot using POST. /// </summary> /// <param name="educationRootToCreate">The EducationRoot to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created EducationRoot.</returns> System.Threading.Tasks.Task<EducationRoot> CreateAsync(EducationRoot educationRootToCreate, CancellationToken cancellationToken = default); /// <summary> /// Creates the specified EducationRoot using POST and returns a <see cref="GraphResponse{EducationRoot}"/> object. /// </summary> /// <param name="educationRootToCreate">The EducationRoot to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The <see cref="GraphResponse{EducationRoot}"/> object of the request.</returns> System.Threading.Tasks.Task<GraphResponse<EducationRoot>> CreateResponseAsync(EducationRoot educationRootToCreate, CancellationToken cancellationToken = default); /// <summary> /// Deletes the specified EducationRoot. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await.</returns> System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken = default); /// <summary> /// Deletes the specified EducationRoot and returns a <see cref="GraphResponse"/> object. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task of <see cref="GraphResponse"/> to await.</returns> System.Threading.Tasks.Task<GraphResponse> DeleteResponseAsync(CancellationToken cancellationToken = default); /// <summary> /// Gets the specified EducationRoot. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The EducationRoot.</returns> System.Threading.Tasks.Task<EducationRoot> GetAsync(CancellationToken cancellationToken = default); /// <summary> /// Gets the specified EducationRoot and returns a <see cref="GraphResponse{EducationRoot}"/> object. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The <see cref="GraphResponse{EducationRoot}"/> object of the request.</returns> System.Threading.Tasks.Task<GraphResponse<EducationRoot>> GetResponseAsync(CancellationToken cancellationToken = default); /// <summary> /// Updates the specified EducationRoot using PATCH. /// </summary> /// <param name="educationRootToUpdate">The EducationRoot to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The updated EducationRoot.</returns> System.Threading.Tasks.Task<EducationRoot> UpdateAsync(EducationRoot educationRootToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Updates the specified EducationRoot using PATCH and returns a <see cref="GraphResponse{EducationRoot}"/> object. /// </summary> /// <param name="educationRootToUpdate">The EducationRoot to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The <see cref="GraphResponse{EducationRoot}"/> object of the request.</returns> System.Threading.Tasks.Task<GraphResponse<EducationRoot>> UpdateResponseAsync(EducationRoot educationRootToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Updates the specified EducationRoot using PUT. /// </summary> /// <param name="educationRootToUpdate">The EducationRoot object to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await.</returns> System.Threading.Tasks.Task<EducationRoot> PutAsync(EducationRoot educationRootToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Updates the specified EducationRoot using PUT and returns a <see cref="GraphResponse{EducationRoot}"/> object. /// </summary> /// <param name="educationRootToUpdate">The EducationRoot object to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task of <see cref="GraphResponse{EducationRoot}"/> to await.</returns> System.Threading.Tasks.Task<GraphResponse<EducationRoot>> PutResponseAsync(EducationRoot educationRootToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="value">The expand value.</param> /// <returns>The request object to send.</returns> IEducationRootRequest Expand(string value); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="expandExpression">The expression from which to calculate the expand value.</param> /// <returns>The request object to send.</returns> IEducationRootRequest Expand(Expression<Func<EducationRoot, object>> expandExpression); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="value">The select value.</param> /// <returns>The request object to send.</returns> IEducationRootRequest Select(string value); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="selectExpression">The expression from which to calculate the select value.</param> /// <returns>The request object to send.</returns> IEducationRootRequest Select(Expression<Func<EducationRoot, object>> selectExpression); } }
56.656489
170
0.664511
[ "MIT" ]
Aliases/msgraph-sdk-dotnet
src/Microsoft.Graph/Generated/requests/IEducationRootRequest.cs
7,422
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; namespace Microsoft.PowerPlatform.Formulas.Tools.Utility { [DebuggerDisplay("{ToPlatformPath()}")] internal class FilePath { public const int MaxFileNameLength = 60; private const string yamlExtension = ".fx.yaml"; private const string editorStateExtension = ".editorstate.json"; private readonly string[] _pathSegments; public FilePath(params string[] segments) { _pathSegments = segments ?? (new string[] { }); } public string ToMsAppPath() { var path = string.Join("\\", _pathSegments); // Some paths mistakenly start with DirectorySepChar in the msapp, // We replaced it with `_/` when writing, remove that now. if (path.StartsWith(FileEntry.FilenameLeadingUnderscore.ToString())) { path = path.TrimStart(FileEntry.FilenameLeadingUnderscore); } return path; } public string ToPlatformPath() { return Path.Combine(_pathSegments.Select(Utilities.EscapeFilename).ToArray()); } public static FilePath FromPlatformPath(string path) { if (path == null) return new FilePath(); var segments = path.Split(Path.DirectorySeparatorChar).Select(Utilities.UnEscapeFilename); return new FilePath(segments.ToArray()); } public static FilePath FromMsAppPath(string path) { if (path == null) return new FilePath(); var segments = path.Split('\\'); return new FilePath(segments); } public static FilePath ToFilePath(string path) { if (path == null) return new FilePath(); var segments = path.Split(Path.DirectorySeparatorChar).Select(x => x); return new FilePath(segments.ToArray()); } public static FilePath RootedAt(string root, FilePath remainder) { var segments = new List<string>() { root }; segments.AddRange(remainder._pathSegments); return new FilePath(segments.ToArray()); } public FilePath Append(string segment) { var newSegments = new List<string>(_pathSegments); newSegments.Add(segment); return new FilePath(newSegments.ToArray()); } public bool StartsWith(string root, StringComparison stringComparison) { return _pathSegments.Length > 0 && _pathSegments[0].Equals(root, stringComparison); } public bool HasExtension(string extension) { return _pathSegments.Length > 0 && _pathSegments.Last().EndsWith(extension, StringComparison.OrdinalIgnoreCase); } public string GetFileName() { if (_pathSegments.Length == 0) return string.Empty; return Path.GetFileName(_pathSegments.Last()); } public string GetFileNameWithoutExtension() { if (_pathSegments.Length == 0) return string.Empty; return Path.GetFileNameWithoutExtension(_pathSegments.Last()); } public string GetExtension() { if (_pathSegments.Length == 0) return string.Empty; return Path.GetExtension(_pathSegments.Last()); } public override bool Equals(object obj) { if (!(obj is FilePath other)) return false; if (other._pathSegments.Length != _pathSegments.Length) return false; for (var i = 0; i < other._pathSegments.Length; ++i) { if (other._pathSegments[i] != _pathSegments[i]) return false; } return true; } public override int GetHashCode() { return ToMsAppPath().GetHashCode(); } /// <summary> /// If there is a collision in the filename then it generates a new name for the file by appending '_1', '_2' ... to the filename.S /// </summary> /// <param name="path">The string representation of the path including filename.</param> /// <returns>Returns the updated path which has new filename.</returns> public string HandleFileNameCollisions(string path) { var suffixCounter = 0; var fileName = this.GetFileName(); var extension = GetCustomExtension(fileName); var fileNameWithoutExtension = fileName.Substring(0, fileName.Length - extension.Length); var pathWithoutFileName = path.Substring(0, path.Length - fileName.Length); while (File.Exists(path)) { var filename = fileNameWithoutExtension + '_' + ++suffixCounter + extension; path = pathWithoutFileName + filename; } return path; } private string GetCustomExtension(string fileName) { var extension = fileName.EndsWith(yamlExtension, StringComparison.OrdinalIgnoreCase) ? yamlExtension : fileName.EndsWith(editorStateExtension, StringComparison.OrdinalIgnoreCase) ? editorStateExtension : Path.GetExtension(fileName); return extension; } } }
34.203593
139
0.583158
[ "MIT" ]
DineshReddy0908/PowerApps-Language-Tooling
src/PAModel/Utility/FilePath.cs
5,712
C#
// // Serializer for byps.test.api.BResult_9001 // // THIS FILE HAS BEEN GENERATED. DO NOT MODIFY. // using System; using System.Collections.Generic; using byps; namespace byps.test.api { public class BSerializer_2076900492 : BSerializer { public readonly static BSerializer instance = new BSerializer_2076900492(); public BSerializer_2076900492() : base(2076900492) {} public BSerializer_2076900492(int typeId) : base(typeId) {} public override void write(Object obj1, BOutput bout1, long version) { BResult_9001 obj = (BResult_9001)obj1; BOutputBin bout = (BOutputBin)bout1; BBufferBin bbuf = bout.bbuf; // checkpoint byps.gen.cs.PrintContext:494 bout.writeObj(obj.resultValue, false, null); } public override Object read(Object obj1, BInput bin1, long version) { BInputBin bin = (BInputBin)bin1; BResult_9001 obj = (BResult_9001)(obj1 != null ? obj1 : bin.onObjectCreated(new BResult_9001())); BBufferBin bbuf = bin.bbuf; // checkpoint byps.gen.cs.PrintContext:449 obj.resultValue = (byps.test.api.refs.Node)bin.readObj(false, null); return obj; } } } // namespace
24.270833
100
0.704721
[ "MIT" ]
teberhardt/byps
csharp/bypstest-ser/src-ser/byps/test/api/BSerializer_2076900492.cs
1,167
C#
using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace TodoApi.Migrations { public partial class postgresdb : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "TodoItems", columns: table => new { Id = table.Column<long>(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), Name = table.Column<string>(nullable: true), IsComplete = table.Column<bool>(nullable: false) }, constraints: table => { table.PrimaryKey("PK_TodoItems", x => x.Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "TodoItems"); } } }
33.09375
114
0.554297
[ "MIT" ]
VijoyV/todo-dotnet-postgres-app
Migrations/20201106132647_postgres-db.cs
1,061
C#
using HRIS.Model.Sys; using System; using System.Linq; namespace HRIS.Service.Sys { public interface ILocationService { void Create(LocationModel model, out Guid locationId); void Delete(Guid locationId); LocationModel GetById(Guid locationId); IQueryable<LocationModel> GetQuery(); void Update(LocationModel model); } }
19.894737
62
0.685185
[ "MIT" ]
mynrd/HRIS.MVC
HRIS.Service/Sys/ILocationService.cs
380
C#
using System; using System.Collections.Generic; using System.IO; using Difi.SikkerDigitalPost.Klient.Domene.Entiteter; using Difi.SikkerDigitalPost.Klient.Domene.Entiteter.Post; using Difi.SikkerDigitalPost.Klient.XmlValidering; namespace Difi.SikkerDigitalPost.Klient { public class Klientkonfigurasjon { public Klientkonfigurasjon(Miljø miljø) { Miljø = miljø; } [Obsolete] public Organisasjonsnummer MeldingsformidlerOrganisasjon { get; set; } = new Organisasjonsnummer("984661185"); public Miljø Miljø { get; set; } /// <summary> /// Angir host som skal benyttes i forbindelse med bruk av proxy. Både ProxyHost og ProxyPort må spesifiseres for at en /// proxy skal benyttes. public string ProxyHost { get; set; } = null; /// <summary> /// Angir schema ved bruk av proxy. Standardverdien er 'https'. /// </summary> public string ProxyScheme { get; set; } = "https"; /// <summary> /// Angir portnummeret som skal benyttes i forbindelse med bruk av proxy. Både ProxyHost og ProxyPort må spesifiseres /// for at en proxy skal benyttes. /// </summary> public int ProxyPort { get; set; } /// <summary> /// Angir timeout for komunikasjonen fra og til meldingsformindleren. Default tid er 30 sekunder. /// </summary> public int TimeoutIMillisekunder { get; set; } = (int) TimeSpan.FromSeconds(30).TotalMilliseconds; public bool BrukProxy => !string.IsNullOrWhiteSpace(ProxyHost) && ProxyPort > 0; /// <summary> /// Hvis satt til true, så vil alle forespørsler og responser logges med nivå DEBUG. /// </summary> public bool LoggForespørselOgRespons { get; set; } = false; } }
36.411765
131
0.639203
[ "Apache-2.0" ]
difi/dpi-proxy-klient-dotnet
Difi.SikkerDigitalPost.Klient/KlientKonfigurasjon.cs
1,873
C#
/***************************************************************************** Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ******************************************************************************/ using Google.Protobuf; using System; using System.Collections.Generic; using System.Linq; using static Tensorflow.OpDef.Types; using static Tensorflow.Binding; namespace Tensorflow { public class importer { public static ITensorOrOperation[] import_graph_def(GraphDef graph_def, Dictionary<string, Tensor> input_map = null, string[] return_elements = null, string name = null, OpList producer_op_list = null) { var op_dict = op_def_registry.get_registered_ops(); graph_def = _ProcessGraphDefParam(graph_def, op_dict); input_map = _ProcessInputMapParam(input_map); return_elements = _ProcessReturnElementsParam(return_elements); if (producer_op_list != null) _RemoveDefaultAttrs(op_dict, producer_op_list, graph_def); string prefix = ""; var graph = ops.get_default_graph(); tf_with(ops.name_scope(name, "import", input_map.Values), scope => { prefix = scope; /*if (!string.IsNullOrEmpty(prefix)) prefix = prefix.Substring(0, prefix.Length - 1); else prefix = "";*/ // Generate any input map tensors inside name scope input_map = _ConvertInputMapValues(name, input_map); }); TF_ImportGraphDefResults results = null; var bytes = graph_def.ToByteString().ToArray(); using (var buffer = c_api_util.tf_buffer(bytes)) using (var scoped_options = c_api_util.ScopedTFImportGraphDefOptions()) using (var status = new Status()) { _PopulateTFImportGraphDefOptions(scoped_options, prefix, input_map, return_elements); // need to create a class ImportGraphDefWithResults with IDisposal results = new TF_ImportGraphDefResults(c_api.TF_GraphImportGraphDefWithResults(graph, buffer.Handle, scoped_options.Handle, status.Handle)); status.Check(true); } _ProcessNewOps(graph); if (return_elements == null) return null; else return _GatherReturnElements(return_elements, graph, results); } private static ITensorOrOperation[] _GatherReturnElements(string[] requested_return_elements, Graph graph, TF_ImportGraphDefResults results) { var return_outputs = results.return_tensors; var return_opers = results.return_opers; var combined_return_elements = new List<ITensorOrOperation>(); int outputs_idx = 0; #pragma warning disable CS0219 // Variable is assigned but its value is never used int opers_idx = 0; #pragma warning restore CS0219 // Variable is assigned but its value is never used foreach(var name in requested_return_elements) { if (name.Contains(":")) { combined_return_elements.append(graph.get_tensor_by_tf_output(return_outputs[outputs_idx])); outputs_idx += 1; } else { throw new NotImplementedException("_GatherReturnElements"); // combined_return_elements.append(graph._get_operation_by_tf_operation(return_opers[opers_idx])); } } return combined_return_elements.ToArray(); } private static void _ProcessNewOps(Graph graph) { foreach(var new_op in graph._add_new_tf_operations()) { var original_device = new_op.Device; } } public static void _PopulateTFImportGraphDefOptions(ImportGraphDefOptions options, string prefix, Dictionary<string, Tensor> input_map, string[] return_elements) { c_api.TF_ImportGraphDefOptionsSetPrefix(options.Handle, prefix); c_api.TF_ImportGraphDefOptionsSetUniquifyNames(options.Handle, (char)1); foreach(var input in input_map) { throw new NotImplementedException("_PopulateTFImportGraphDefOptions"); } if (return_elements == null) return_elements = new string[0]; foreach (var name in return_elements) { if(name.Contains(":")) { var (op_name, index) = _ParseTensorName(name); c_api.TF_ImportGraphDefOptionsAddReturnOutput(options.Handle, op_name, index); } else { c_api.TF_ImportGraphDefOptionsAddReturnOperation(options.Handle, name); } } // c_api.TF_ImportGraphDefOptionsSetValidateColocationConstraints(options, validate_colocation_constraints); } private static (string, int) _ParseTensorName(string tensor_name) { var components = tensor_name.Split(':'); if (components.Length == 2) return (components[0], int.Parse(components[1])); else if (components.Length == 1) return (components[0], 0); else throw new ValueError($"Cannot convert {tensor_name} to a tensor name."); } public static Dictionary<string, Tensor> _ConvertInputMapValues(string name, Dictionary<string, Tensor> input_map) { return input_map; } public static GraphDef _ProcessGraphDefParam(GraphDef graph_def, Dictionary<string, OpDef> op_dict) { foreach(var node in graph_def.Node) { if (!op_dict.ContainsKey(node.Op)) continue; var op_def = op_dict[node.Op]; _SetDefaultAttrValues(node, op_def); } return graph_def; } private static void _SetDefaultAttrValues(NodeDef node_def, OpDef op_def) { foreach(var attr_def in op_def.Attr) { var key = attr_def.Name; if(attr_def.DefaultValue != null) { if (node_def.Attr.ContainsKey(key)) { var value = node_def.Attr[key]; if (value == null) node_def.Attr[key] = attr_def.DefaultValue; } else { node_def.Attr[key] = attr_def.DefaultValue; } } } } private static Dictionary<string, Tensor> _ProcessInputMapParam(Dictionary<string, Tensor> input_map) { if (input_map == null) return new Dictionary<string, Tensor>(); return input_map; } private static string[] _ProcessReturnElementsParam(string[] return_elements) { if (return_elements == null) return null; return return_elements; } private static void _RemoveDefaultAttrs(Dictionary<string, OpDef> op_dict, OpList producer_op_list, GraphDef graph_def) { var producer_op_dict = new Dictionary<string, OpDef>(); producer_op_list.Op.Select(op => { producer_op_dict[op.Name] = op; return op; }).ToArray(); foreach(var node in graph_def.Node) { // Remove any default attr values that aren't in op_def. if (producer_op_dict.ContainsKey(node.Op)) { var op_def = op_dict[node.Op]; var producer_op_def = producer_op_dict[node.Op]; foreach(var key in node.Attr) { if(_FindAttrInOpDef(key.Key, op_def) == null) { var attr_def = _FindAttrInOpDef(key.Key, producer_op_def); if (attr_def != null && attr_def.DefaultValue != null && node.Attr[key.Key] == attr_def.DefaultValue) node.Attr[key.Key].ClearValue(); } } } } } private static AttrDef _FindAttrInOpDef(string name, OpDef op_def) { return op_def.Attr.FirstOrDefault(x => x.Name == name); } } }
38.060241
156
0.552812
[ "Apache-2.0" ]
BlueCode2019/TensorFlow.NET
src/TensorFlowNET.Core/Framework/importer.cs
9,479
C#
// <auto-generated /> using System; using CasinoReports.Infrastructure.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace CasinoReports.Infrastructure.Data.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20181230165005_CustomerVisitsRelatedTables")] partial class CustomerVisitsRelatedTables { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("CasinoReports.Core.Models.Entities.ApplicationRole", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name") .HasMaxLength(256); b.Property<string>("NormalizedName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex") .HasFilter("[NormalizedName] IS NOT NULL"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.ApplicationUser", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd(); b.Property<int>("AccessFailedCount"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<string>("Email") .HasMaxLength(256); b.Property<bool>("EmailConfirmed"); b.Property<bool>("IsDeleted"); b.Property<bool>("LockoutEnabled"); b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("NormalizedEmail") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .HasMaxLength(256); b.Property<string>("PasswordHash"); b.Property<string>("PhoneNumber"); b.Property<bool>("PhoneNumberConfirmed"); b.Property<string>("SecurityStamp"); b.Property<bool>("TwoFactorEnabled"); b.Property<string>("UserName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.Casino", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.ToTable("Casinos"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CasinoGame", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<int>("DisplayOrder"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.ToTable("CasinoGames"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CasinoManager", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<Guid>("ApplicationUserId"); b.Property<int>("CasinoId"); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.HasKey("Id"); b.HasIndex("ApplicationUserId"); b.HasIndex("CasinoId"); b.HasIndex("IsDeleted"); b.ToTable("CasinoManagers"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CasinoPlayerType", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<int>("DisplayOrder"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.ToTable("CasinoPlayerTypes"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerTotalBetRange", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<int>("DisplayOrder"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.ToTable("CustomerTotalBetRanges"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisits", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<decimal?>("AvgBet") .HasColumnType("decimal(22, 10)"); b.Property<decimal>("Balance") .HasColumnType("decimal(22, 10)"); b.Property<DateTime>("BirthDate"); b.Property<int>("Bonus"); b.Property<int>("BonusFromPoints"); b.Property<decimal?>("BonusPercentOfBet") .HasColumnType("decimal(22, 10)"); b.Property<decimal>("BonusPercentOfLose") .HasColumnType("decimal(22, 10)"); b.Property<decimal>("CleanBalance") .HasColumnType("decimal(22, 10)"); b.Property<DateTime>("CreatedOn"); b.Property<int?>("CustomerVisitsImportId"); b.Property<DateTime>("Date"); b.Property<DateTime?>("DeletedOn"); b.Property<bool?>("HoldOnOkt"); b.Property<bool?>("HoldOnSept"); b.Property<bool>("Holded"); b.Property<bool>("IsDeleted"); b.Property<int>("MatchPay"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("NameFirstLast"); b.Property<bool?>("NewCustomers"); b.Property<bool?>("PlayPercent"); b.Property<int?>("PlayerTypeId"); b.Property<int?>("PreferGameId"); b.Property<int>("TombolaGame"); b.Property<decimal>("TotalBet") .HasColumnType("decimal(22, 10)"); b.Property<int?>("TotalBetRangeId"); b.Property<decimal>("TotalBonuses") .HasColumnType("decimal(22, 10)"); b.Property<int>("Visits"); b.HasKey("Id"); b.HasIndex("CustomerVisitsImportId"); b.HasIndex("Date"); b.HasIndex("IsDeleted"); b.HasIndex("PlayerTypeId"); b.HasIndex("PreferGameId"); b.HasIndex("TotalBetRangeId"); b.ToTable("CustomerVisits"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollection", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.ToTable("CustomerVisitsCollections"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollectionCasino", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("CasinoId"); b.Property<DateTime>("CreatedOn"); b.Property<int>("CustomerVisitsCollectionId"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.HasKey("Id"); b.HasIndex("CasinoId"); b.HasIndex("CustomerVisitsCollectionId"); b.HasIndex("IsDeleted"); b.ToTable("CustomerVisitsCollectionCasinos"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollectionImport", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<int>("CustomerVisitsCollectionId"); b.Property<int>("CustomerVisitsImportId"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.HasKey("Id"); b.HasIndex("CustomerVisitsCollectionId"); b.HasIndex("CustomerVisitsImportId"); b.HasIndex("IsDeleted"); b.ToTable("CustomerVisitsCollectionImports"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollectionUser", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<Guid>("ApplicationUserId"); b.Property<DateTime>("CreatedOn"); b.Property<int>("CustomerVisitsCollectionId"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.HasKey("Id"); b.HasIndex("ApplicationUserId"); b.HasIndex("CustomerVisitsCollectionId"); b.HasIndex("IsDeleted"); b.ToTable("CustomerVisitsCollectionUsers"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsImport", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedOn"); b.Property<DateTime?>("DeletedOn"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("ModifiedOn"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("IsDeleted"); b.ToTable("CustomerVisitsImports"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<Guid>("RoleId"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<Guid>("UserId"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b => { b.Property<string>("LoginProvider"); b.Property<string>("ProviderKey"); b.Property<string>("ProviderDisplayName"); b.Property<Guid>("UserId"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b => { b.Property<Guid>("UserId"); b.Property<Guid>("RoleId"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b => { b.Property<Guid>("UserId"); b.Property<string>("LoginProvider"); b.Property<string>("Name"); b.Property<string>("Value"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CasinoManager", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationUser", "ApplicationUser") .WithMany("CasinoManagers") .HasForeignKey("ApplicationUserId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("CasinoReports.Core.Models.Entities.Casino", "Casino") .WithMany("CasinoManagers") .HasForeignKey("CasinoId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisits", b => { b.HasOne("CasinoReports.Core.Models.Entities.CustomerVisitsImport", "CustomerVisitsImport") .WithMany("CustomerVisits") .HasForeignKey("CustomerVisitsImportId"); b.HasOne("CasinoReports.Core.Models.Entities.CasinoPlayerType", "PlayerType") .WithMany() .HasForeignKey("PlayerTypeId"); b.HasOne("CasinoReports.Core.Models.Entities.CasinoGame", "PreferGame") .WithMany() .HasForeignKey("PreferGameId"); b.HasOne("CasinoReports.Core.Models.Entities.CustomerTotalBetRange", "TotalBetRange") .WithMany() .HasForeignKey("TotalBetRangeId"); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollectionCasino", b => { b.HasOne("CasinoReports.Core.Models.Entities.Casino", "Casino") .WithMany("CustomerVisitsCollectionCasinos") .HasForeignKey("CasinoId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("CasinoReports.Core.Models.Entities.CustomerVisitsCollection", "CustomerVisitsCollection") .WithMany("CustomerVisitsCollectionCasinos") .HasForeignKey("CustomerVisitsCollectionId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollectionImport", b => { b.HasOne("CasinoReports.Core.Models.Entities.CustomerVisitsCollection", "CustomerVisitsCollection") .WithMany("CustomerVisitsCollectionImports") .HasForeignKey("CustomerVisitsCollectionId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("CasinoReports.Core.Models.Entities.CustomerVisitsImport", "CustomerVisitsImport") .WithMany("CustomerVisitsCollectionImports") .HasForeignKey("CustomerVisitsImportId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("CasinoReports.Core.Models.Entities.CustomerVisitsCollectionUser", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationUser", "ApplicationUser") .WithMany("CustomerVisitsCollectionUsers") .HasForeignKey("ApplicationUserId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("CasinoReports.Core.Models.Entities.CustomerVisitsCollection", "CustomerVisitsCollection") .WithMany("CustomerVisitsCollectionUsers") .HasForeignKey("CustomerVisitsCollectionId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationRole") .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationUser") .WithMany("IdentityUserClaims") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Restrict); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationUser") .WithMany("IdentityUserLogins") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Restrict); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationRole") .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("CasinoReports.Core.Models.Entities.ApplicationUser") .WithMany("IdentityUserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Restrict); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b => { b.HasOne("CasinoReports.Core.Models.Entities.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); #pragma warning restore 612, 618 } } }
35.674663
125
0.499769
[ "MIT" ]
pdrosos/CasinoReports
server/CasinoReports/Infrastructure/Data/CasinoReports.Infrastructure.Data/Migrations/20181230165005_CustomerVisitsRelatedTables.Designer.cs
23,797
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. namespace Samples { /// <summary> /// Device Update for IoT Hub sample constants. /// </summary> public static class Constant { /// <summary> /// AAD tenant identifier. /// </summary> public const string TenantId = "_put_your_aad_tenant_id_here_"; /// <summary> /// AAD tenant client identifier. /// </summary> public const string ClientId = "_put_your_aad_client_id_here_"; /// <summary> /// ADU account endpoint. /// </summary> public const string AccountEndpoint = "_your_account_id_.api.adu.microsoft.com"; /// <summary> /// ADU account instance. /// </summary> public const string Instance = "_your_instance_id_"; /// <summary> /// Update provider. /// </summary> public const string Provider = "_your_provider_"; /// <summary> /// Update name. /// </summary> public const string Name = "_your_name_"; } }
26.904762
88
0.568142
[ "MIT" ]
AikoBB/azure-sdk-for-net
sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Constant.cs
1,132
C#
// // ExtensionAttributeAttribute.cs // // Author: // Lluis Sanchez Gual <lluis@novell.com> // // Copyright (c) 2010 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace Mono.Addins { /// <summary> /// Assigns an attribute value to an extension /// </summary> /// <remarks> /// This attribute can be used together with the [Extenion] attribute to specify /// a value for an attribute of the extension. /// </remarks> public class ExtensionAttributeAttribute: Attribute { Type targetType; string targetTypeName; string name; string val; string path; /// <summary> /// Initializes a new instance of the <see cref="Mono.Addins.ExtensionAttributeAttribute"/> class. /// </summary> /// <param name='name'> /// Name of the attribute /// </param> /// <param name='value'> /// Value of the attribute /// </param> public ExtensionAttributeAttribute (string name, string value) { Name = name; Value = value; } /// <summary> /// Initializes a new instance of the <see cref="Mono.Addins.ExtensionAttributeAttribute"/> class. /// </summary> /// <param name='type'> /// Type of the extension for which the attribute value is being set /// </param> /// <param name='name'> /// Name of the attribute /// </param> /// <param name='value'> /// Value of the attribute /// </param> public ExtensionAttributeAttribute (Type type, string name, string value) { Name = name; Value = value; Type = type; } /// <summary> /// Initializes a new instance of the <see cref="Mono.Addins.ExtensionAttributeAttribute"/> class. /// </summary> /// <param name='path'> /// Path of the extension for which the attribute value is being set /// </param> /// <param name='name'> /// Name of the attribute /// </param> /// <param name='value'> /// Value of the attribute /// </param> public ExtensionAttributeAttribute (string path, string name, string value) { Name = name; Value = value; Path = path; } /// <summary> /// Name of the attribute /// </summary> public string Name { get { return this.name; } set { this.name = value; } } /// <summary> /// Value of the attribute /// </summary> public string Value { get { return this.val; } set { this.val = value; } } /// <summary> /// Path of the extension for which the attribute value is being set /// </summary> public string Path { get { return this.path; } set { this.path = value; } } /// <summary> /// Type of the extension for which the attribute value is being set /// </summary> public Type Type { get { return targetType; } set { targetType = value; targetTypeName = targetType.FullName; } } internal string TypeName { get { return targetTypeName ?? string.Empty; } set { targetTypeName = value; } } } }
28.565217
100
0.665652
[ "MIT" ]
directhex/mono-addins
Mono.Addins/Mono.Addins/ExtensionAttributeAttribute.cs
3,942
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; namespace Microsoft.AspNetCore.Mvc.Filters { /// <summary> /// A context for page filters, used specifically in /// <see cref="IPageFilter.OnPageHandlerSelected(PageHandlerSelectedContext)"/> and /// <see cref="IAsyncPageFilter.OnPageHandlerSelectionAsync(PageHandlerSelectedContext)"/>. /// </summary> public class PageHandlerSelectedContext : FilterContext { /// <summary> /// Creates a new instance of <see cref="PageHandlerExecutedContext"/>. /// </summary> /// <param name="pageContext">The <see cref="PageContext"/> associated with the current request.</param> /// <param name="filters">The set of filters associated with the page.</param> /// <param name="handlerInstance">The handler instance associated with the page.</param> public PageHandlerSelectedContext( PageContext pageContext, IList<IFilterMetadata> filters, object handlerInstance) : base(pageContext, filters) { if (handlerInstance == null) { throw new ArgumentNullException(nameof(handlerInstance)); } HandlerInstance = handlerInstance; } /// <summary> /// Gets the descriptor associated with the current page. /// </summary> public new virtual CompiledPageActionDescriptor ActionDescriptor { get { return (CompiledPageActionDescriptor)base.ActionDescriptor; } } /// <summary> /// Gets or sets the descriptor for the handler method about to be invoked. /// </summary> public virtual HandlerMethodDescriptor HandlerMethod { get; set; } /// <summary> /// Gets the object instance containing the handler method. /// </summary> public virtual object HandlerInstance { get; } } }
38.135593
112
0.639111
[ "Apache-2.0" ]
vadzimpm/Mvc
src/Microsoft.AspNetCore.Mvc.RazorPages/Filters/PageHandlerSelectedContext.cs
2,252
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace UXStudy { /// <summary> /// Interaction logic for InitialControl.xaml /// </summary> public partial class InitialControl : UserControl { public InitialControl() { InitializeComponent(); } } }
22.275862
53
0.719814
[ "Apache-2.0" ]
NathanielBeen/UXStudy
UXStudy/UXStudy/InitialControl.xaml.cs
648
C#
#pragma checksum "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "c0add9856bbb8a7d775f04c328097a8364f04050" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Client_ModificationCompteClient), @"mvc.1.0.view", @"/Views/Client/ModificationCompteClient.cshtml")] namespace AspNetCore { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore #line 10 "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" using GestionRelationClient.Models; #line default #line hidden #nullable disable [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"c0add9856bbb8a7d775f04c328097a8364f04050", @"/Views/Client/ModificationCompteClient.cshtml")] public class Views_Client_ModificationCompteClient : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("btn btn-link"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "ListeComptesClient", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("role", new global::Microsoft.AspNetCore.Html.HtmlString("button"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0649 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; #pragma warning restore 0649 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); #pragma warning disable 0169 private string __tagHelperStringValueBuffer; #pragma warning restore 0169 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager { get { if (__backed__tagHelperScopeManager == null) { __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); } return __backed__tagHelperScopeManager; } } private global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 5 "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" Layout = "_Layout"; ViewBag.Title = "Modification compte client"; #line default #line hidden #nullable disable WriteLiteral("<!-- From : https://www.completecsharptutorial.com/asp-net-mvc5/pass-data-using-viewbag-viewdata-and-tempdata-in-asp-net-mvc-5.php -->\r\n"); #nullable restore #line 11 "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" Client client = ViewData["Client"] as Client; #line default #line hidden #nullable disable WriteLiteral("\r\n<div class=\"listeComptesClient\">\r\n\r\n <p class=\"lienRetour\">\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c0add9856bbb8a7d775f04c328097a8364f040504949", async() => { WriteLiteral("< Retour"); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n </p>\r\n\r\n <h2>Bienvenue "); #nullable restore #line 21 "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" Write(client.Login); #line default #line hidden #nullable disable WriteLiteral("</h2>\r\n\r\n\r\n\r\n"); #nullable restore #line 25 "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" using (Html.BeginForm("ModificationCompteClient", "Client", FormMethod.Post)) { #line default #line hidden #nullable disable WriteLiteral(@" <div class=""formInscriptionClient""> <div class=""form-group""> <div> <label for=""Login"">Login</label> <input type=""text"" name=""Login"" class=""form-control"" /> </div> <div> <label for=""Mail"">Mail</label> <input type=""text"" name=""Mail"" class=""form-control"" /> </div> </div> <div class=""form-group""> <div> <label for=""Nom"">Nom</label> <input type=""text"" name=""Nom"" class=""form-control"" /> </div> <div> <label for=""Prenom"">Prénom</label> <input type=""text"" name=""Prenom"" class=""form-control"" /> </div> </div> <div class=""form-group""> <div> <label for=""MotDePasse"">Mot de passe</label> "); WriteLiteral(@" <input type=""password"" name=""MotDePasse"" class=""form-control form-control-motDePasse"" /> </div> </div> <div class=""form-group""> <div> <label for=""Telephone"">Téléphone</label> <input type=""text"" name=""Telephone"" class=""form-control"" /> </div> <div> <label for=""Age"">Age</label> <input type=""number"" name=""Age"" class=""form-control"" /> </div> </div> <button type=""submit"" class=""btn btn-primary toHorizontalyCenter"">Modifier ce compte</button> </div> "); #nullable restore #line 83 "C:\Users\Antoine\Desktop\Scolaire\Master2Uqar\Programmation objet avancée\TP3\gestionClientWeb\GestionRelationClient\GestionRelationClient\Views\Client\ModificationCompteClient.cshtml" } #line default #line hidden #nullable disable WriteLiteral(" \r\n\r\n</div>\r\n"); } #pragma warning restore 1998 [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; } } } #pragma warning restore 1591
53.564516
350
0.701496
[ "MIT" ]
Zardas/gestionClientWeb
GestionRelationClient/GestionRelationClient/obj/Debug/netcoreapp3.1/Razor/Views/Client/ModificationCompteClient.cshtml.g.cs
9,973
C#
namespace CRM.WebApp.Models { public class ContactFilterModel { public string FullName { get; set; } public string CompanyName { get; set; } public string Position { get; set; } public string Country { get; set; } public string Email { get; set; } } }
25.416667
47
0.596721
[ "MIT" ]
BugiMgl/CustomerRelationshipManagement_CRM
CRM.Project_A/Src/CRM.WebApp/Models/ContactsModel/ContactFilterModel.cs
307
C#
using System; using System.Text; using System.Data; using System.Data.SqlClient; using System.Data.Common; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Xml; using System.Xml.Serialization; using SubSonic; using SubSonic.Utilities; // <auto-generated /> namespace DalRis { /// <summary> /// Strongly-typed collection for the SysEstadoCivil class. /// </summary> [Serializable] public partial class SysEstadoCivilCollection : ActiveList<SysEstadoCivil, SysEstadoCivilCollection> { public SysEstadoCivilCollection() {} /// <summary> /// Filters an existing collection based on the set criteria. This is an in-memory filter /// Thanks to developingchris for this! /// </summary> /// <returns>SysEstadoCivilCollection</returns> public SysEstadoCivilCollection Filter() { for (int i = this.Count - 1; i > -1; i--) { SysEstadoCivil o = this[i]; foreach (SubSonic.Where w in this.wheres) { bool remove = false; System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName); if (pi.CanRead) { object val = pi.GetValue(o, null); switch (w.Comparison) { case SubSonic.Comparison.Equals: if (!val.Equals(w.ParameterValue)) { remove = true; } break; } } if (remove) { this.Remove(o); break; } } } return this; } } /// <summary> /// This is an ActiveRecord class which wraps the Sys_EstadoCivil table. /// </summary> [Serializable] public partial class SysEstadoCivil : ActiveRecord<SysEstadoCivil>, IActiveRecord { #region .ctors and Default Settings public SysEstadoCivil() { SetSQLProps(); InitSetDefaults(); MarkNew(); } private void InitSetDefaults() { SetDefaults(); } public SysEstadoCivil(bool useDatabaseDefaults) { SetSQLProps(); if(useDatabaseDefaults) ForceDefaults(); MarkNew(); } public SysEstadoCivil(object keyID) { SetSQLProps(); InitSetDefaults(); LoadByKey(keyID); } public SysEstadoCivil(string columnName, object columnValue) { SetSQLProps(); InitSetDefaults(); LoadByParam(columnName,columnValue); } protected static void SetSQLProps() { GetTableSchema(); } #endregion #region Schema and Query Accessor public static Query CreateQuery() { return new Query(Schema); } public static TableSchema.Table Schema { get { if (BaseSchema == null) SetSQLProps(); return BaseSchema; } } private static void GetTableSchema() { if(!IsSchemaInitialized) { //Schema declaration TableSchema.Table schema = new TableSchema.Table("Sys_EstadoCivil", TableType.Table, DataService.GetInstance("RisProvider")); schema.Columns = new TableSchema.TableColumnCollection(); schema.SchemaName = @"dbo"; //columns TableSchema.TableColumn colvarIdEstadoCivil = new TableSchema.TableColumn(schema); colvarIdEstadoCivil.ColumnName = "idEstadoCivil"; colvarIdEstadoCivil.DataType = DbType.Int32; colvarIdEstadoCivil.MaxLength = 0; colvarIdEstadoCivil.AutoIncrement = true; colvarIdEstadoCivil.IsNullable = false; colvarIdEstadoCivil.IsPrimaryKey = true; colvarIdEstadoCivil.IsForeignKey = false; colvarIdEstadoCivil.IsReadOnly = false; colvarIdEstadoCivil.DefaultSetting = @""; colvarIdEstadoCivil.ForeignKeyTableName = ""; schema.Columns.Add(colvarIdEstadoCivil); TableSchema.TableColumn colvarNombre = new TableSchema.TableColumn(schema); colvarNombre.ColumnName = "nombre"; colvarNombre.DataType = DbType.String; colvarNombre.MaxLength = 50; colvarNombre.AutoIncrement = false; colvarNombre.IsNullable = false; colvarNombre.IsPrimaryKey = false; colvarNombre.IsForeignKey = false; colvarNombre.IsReadOnly = false; colvarNombre.DefaultSetting = @"('')"; colvarNombre.ForeignKeyTableName = ""; schema.Columns.Add(colvarNombre); BaseSchema = schema; //add this schema to the provider //so we can query it later DataService.Providers["RisProvider"].AddSchema("Sys_EstadoCivil",schema); } } #endregion #region Props [XmlAttribute("IdEstadoCivil")] [Bindable(true)] public int IdEstadoCivil { get { return GetColumnValue<int>(Columns.IdEstadoCivil); } set { SetColumnValue(Columns.IdEstadoCivil, value); } } [XmlAttribute("Nombre")] [Bindable(true)] public string Nombre { get { return GetColumnValue<string>(Columns.Nombre); } set { SetColumnValue(Columns.Nombre, value); } } #endregion //no foreign key tables defined (0) //no ManyToMany tables defined (0) #region ObjectDataSource support /// <summary> /// Inserts a record, can be used with the Object Data Source /// </summary> public static void Insert(string varNombre) { SysEstadoCivil item = new SysEstadoCivil(); item.Nombre = varNombre; if (System.Web.HttpContext.Current != null) item.Save(System.Web.HttpContext.Current.User.Identity.Name); else item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name); } /// <summary> /// Updates a record, can be used with the Object Data Source /// </summary> public static void Update(int varIdEstadoCivil,string varNombre) { SysEstadoCivil item = new SysEstadoCivil(); item.IdEstadoCivil = varIdEstadoCivil; item.Nombre = varNombre; item.IsNew = false; if (System.Web.HttpContext.Current != null) item.Save(System.Web.HttpContext.Current.User.Identity.Name); else item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name); } #endregion #region Typed Columns public static TableSchema.TableColumn IdEstadoCivilColumn { get { return Schema.Columns[0]; } } public static TableSchema.TableColumn NombreColumn { get { return Schema.Columns[1]; } } #endregion #region Columns Struct public struct Columns { public static string IdEstadoCivil = @"idEstadoCivil"; public static string Nombre = @"nombre"; } #endregion #region Update PK Collections #endregion #region Deep Save #endregion } }
25.99262
129
0.615985
[ "MIT" ]
saludnqn/ris_publico
DalRis/generated/SysEstadoCivil.cs
7,044
C#
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using Orchard.OutputCache.Models; using Orchard.Utility.Extensions; namespace Orchard.OutputCache.Services { /// <summary> /// Tenant wide case insensitive reverse index for <see cref="CacheItem"/> tags. /// </summary> public class DefaultTagCache : ITagCache { private readonly ConcurrentDictionary<string, HashSet<string>> _dictionary; public DefaultTagCache() { _dictionary = new ConcurrentDictionary<string, HashSet<string>>(StringComparer.OrdinalIgnoreCase); } public void Tag(string tag, params string[] keys) { var set = _dictionary.GetOrAdd(tag, x => new HashSet<string>()); lock (set) { foreach (var key in keys) { set.Add(key); } } } public IEnumerable<string> GetTaggedItems(string tag) { HashSet<string> set; if (_dictionary.TryGetValue(tag, out set)) { lock (set) { return set.ToReadOnlyCollection(); } } return Enumerable.Empty<string>(); } public void RemoveTag(string tag) { HashSet<string> set; _dictionary.TryRemove(tag, out set); } } }
31.217391
111
0.562674
[ "BSD-3-Clause" ]
BilalHasanKhan/Orchard
src/Orchard.Web/Modules/Orchard.OutputCache/Services/DefaultTagCache.cs
1,438
C#
using UnityEngine; namespace ET { public static class XunLuoPathComponentSystem { public static Vector3 GetCurrent(this XunLuoPathComponent self) { return self.path[self.Index]; } public static void MoveNext(this XunLuoPathComponent self) { self.Index = ++self.Index % self.path.Length; } } }
22.705882
71
0.598446
[ "MIT" ]
1090504117/ET
Unity/Assets/Hotfix/Demo/AI/XunLuoPathComponentSystem.cs
386
C#
namespace ZaraEngine.Diseases.Stages.Fluent { public interface IStageTreatmentItems { IStageTreatmentItemAction AndWithSpecialItems(params string[] items); IStageFinish AndWithoutSpecialItems(); } }
19.166667
77
0.734783
[ "MIT" ]
vagrod/zara
zara-demo-unity/Assets/Zara/Diseases/Stages/Fluent/IStageTreatmentItems.cs
230
C#
/* * Bungie.Net API * * These endpoints constitute the functionality exposed by Bungie.net, both for more traditional website functionality and for connectivity to Bungie video games and their related functionality. * * OpenAPI spec version: 2.0.1 * Contact: support@bungie.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using NUnit.Framework; using System; using System.Linq; using System.IO; using System.Collections.Generic; using BungieNetPlatform.BungieNetPlatform.Api; using BungieNetPlatform.BungieNetPlatform.Model; using BungieNetPlatform.Client; using System.Reflection; using Newtonsoft.Json; namespace BungieNetPlatform.Test { /// <summary> /// Class for testing MessagesResponsesSaveMessageResult /// </summary> /// <remarks> /// This file is automatically generated by Swagger Codegen. /// Please update the test case below to test the model. /// </remarks> [TestFixture] public class MessagesResponsesSaveMessageResultTests { // TODO uncomment below to declare an instance variable for MessagesResponsesSaveMessageResult //private MessagesResponsesSaveMessageResult instance; /// <summary> /// Setup before each test /// </summary> [SetUp] public void Init() { // TODO uncomment below to create an instance of MessagesResponsesSaveMessageResult //instance = new MessagesResponsesSaveMessageResult(); } /// <summary> /// Clean up after each test /// </summary> [TearDown] public void Cleanup() { } /// <summary> /// Test an instance of MessagesResponsesSaveMessageResult /// </summary> [Test] public void MessagesResponsesSaveMessageResultInstanceTest() { // TODO uncomment below to test "IsInstanceOfType" MessagesResponsesSaveMessageResult //Assert.IsInstanceOfType<MessagesResponsesSaveMessageResult> (instance, "variable 'instance' is a MessagesResponsesSaveMessageResult"); } /// <summary> /// Test the property 'ConversationId' /// </summary> [Test] public void ConversationIdTest() { // TODO unit test for the property 'ConversationId' } /// <summary> /// Test the property 'MessageId' /// </summary> [Test] public void MessageIdTest() { // TODO unit test for the property 'MessageId' } } }
28.910112
194
0.645161
[ "MIT" ]
xlxCLUxlx/BungieNetPlatform
src/BungieNetPlatform.Test/BungieNetPlatform.Model/MessagesResponsesSaveMessageResultTests.cs
2,573
C#
using Entries.Models; using System; using System.Collections.Generic; using System.ComponentModel; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace Entries.Views { // Learn more about making custom code visible in the Xamarin.Forms previewer // by visiting https://aka.ms/xamarinforms-previewer [DesignTimeVisible(false)] public partial class MenuPage : ContentPage { MainPage RootPage { get => Application.Current.MainPage as MainPage; } List<HomeMenuItem> menuItems; public MenuPage() { InitializeComponent(); menuItems = new List<HomeMenuItem> { new HomeMenuItem {Id = MenuItemType.Browse, Title="Browse" }, new HomeMenuItem {Id = MenuItemType.About, Title="About" } }; ListViewMenu.ItemsSource = menuItems; ListViewMenu.SelectedItem = menuItems[0]; ListViewMenu.ItemSelected += async (sender, e) => { if (e.SelectedItem == null) return; var id = (int)((HomeMenuItem)e.SelectedItem).Id; await RootPage.NavigateFromMenu(id); }; } } }
30.525
81
0.597052
[ "MIT" ]
taublast/droidentrybug
Entries/Views/MenuPage.xaml.cs
1,223
C#
using System; using System.IO; using System.Web; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Subtext.Framework; using Subtext.Framework.Components; using Subtext.Framework.Configuration; using Subtext.Framework.Data; using Subtext.Framework.Routing; namespace UnitTests.Subtext.Framework { /// <summary> /// Tests of the Images class. /// </summary> /// <remarks> /// All tests should use the TestDirectory directory. For example, to create that /// directory, just do this: Directory.Create(TestDirectory); /// </remarks> [TestClass] public class ImageTests { private const string TestDirectory = "unit-test-dir"; static readonly Byte[] singlePixelBytes = Convert.FromBase64String("R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="); [DatabaseIntegrationTestMethod] public void CanUpdate() { UnitTestHelper.SetupBlog(); var repository = new DatabaseObjectProvider(); Image image = CreateImageInstance(); Assert.IsTrue(Config.CurrentBlog.Id >= 0); Assert.AreEqual(Config.CurrentBlog.Id, image.BlogId); int imageId = repository.Insert(image, singlePixelBytes); Image saved = repository.GetImage(imageId, true /* activeOnly */); Assert.AreEqual(Config.CurrentBlog.Id, saved.BlogId, "The blog id for the image does not match!"); saved.LocalDirectoryPath = Path.GetFullPath(TestDirectory); Assert.AreEqual("Test Image", saved.Title); saved.Title = "A Better Title"; repository.Update(saved, singlePixelBytes); Image loaded = repository.GetImage(imageId, true /* activeOnly */); Assert.AreEqual(Config.CurrentBlog.Id, loaded.BlogId, "The blog id for the image does not match!"); loaded.LocalDirectoryPath = Path.GetFullPath(TestDirectory); Assert.AreEqual("A Better Title", loaded.Title, "The title was not updated"); } [DatabaseIntegrationTestMethod] public void CanGetImagesByCategoryId() { UnitTestHelper.SetupBlog(); var repository = new DatabaseObjectProvider(); int categoryId = UnitTestHelper.CreateCategory(Config.CurrentBlog.Id, "UnitTestImages", CategoryType.ImageCollection); Assert.AreEqual(0, repository.GetImagesByCategory(categoryId, true).Count); Image image = CreateImageInstance(Config.CurrentBlog, categoryId); image.IsActive = true; int imageId = repository.Insert(image, singlePixelBytes); ImageCollection images = repository.GetImagesByCategory(categoryId, true); Assert.AreEqual(1, images.Count, "Expected to get our one image."); Assert.AreEqual(imageId, images[0].ImageID); } [DatabaseIntegrationTestMethod] public void CanSaveImage() { string filePath = Path.GetFullPath(@TestDirectory + Path.DirectorySeparatorChar + "test.gif"); Assert.IsTrue(Images.SaveImage(singlePixelBytes, filePath)); FileAssert.Exists(filePath); } [TestMethod] public void CanMakeAlbumImages() { var image = new Image(); image.Title = "Test Image"; image.Height = 1; image.Width = 1; image.IsActive = true; image.LocalDirectoryPath = Path.GetFullPath(TestDirectory); image.FileName = "test.gif"; //Write original image. Images.SaveImage(singlePixelBytes, image.OriginalFilePath); FileAssert.Exists(image.OriginalFilePath); Images.MakeAlbumImages(image); FileAssert.Exists(image.ResizedFilePath); FileAssert.Exists(image.ThumbNailFilePath); } [TestMethod] public void InsertImageReturnsFalseForExistingImage() { var repository = new DatabaseObjectProvider(); Image image = CreateStandaloneImageInstance(); Images.SaveImage(singlePixelBytes, image.OriginalFilePath); Assert.AreEqual(NullValue.NullInt32, repository.Insert(image, singlePixelBytes)); } [DatabaseIntegrationTestMethod] public void CanInsertAndDeleteImage() { var repository = new DatabaseObjectProvider(); int imageId = 0; Image image = CreateImageInstance(); image.IsActive = true; Image loadedImage = null; try { imageId = repository.Insert(image, singlePixelBytes); loadedImage = repository.GetImage(imageId, false /* activeOnly */); Assert.IsNotNull(loadedImage); Assert.AreEqual(image.CategoryID, loadedImage.CategoryID); } finally { if (loadedImage != null) { repository.Delete(loadedImage); } Assert.IsNull(repository.GetImage(imageId, false /* activeOnly */)); } } private static Image CreateStandaloneImageInstance() { var image = new Image(); image.Title = "Test Image"; image.Height = 1; image.Width = 1; image.IsActive = true; image.LocalDirectoryPath = Path.GetFullPath(TestDirectory); image.FileName = "test.gif"; return image; } private static Image CreateImageInstance() { UnitTestHelper.SetupBlog(); int categoryId = UnitTestHelper.CreateCategory(Config.CurrentBlog.Id, TestDirectory); return CreateImageInstance(Config.CurrentBlog, categoryId); } private static Image CreateImageInstance(Blog currentBlog, int categoryId) { Image image = CreateStandaloneImageInstance(); image.BlogId = currentBlog.Id; image.CategoryID = categoryId; return image; } [TestMethod] public void SaveImageReturnsFalseForInvalidImageName() { Assert.IsFalse(Images.SaveImage(singlePixelBytes, "!")); } [TestMethod] public void GalleryDirectoryPath_WithBlogAndCategoryId_ReturnPhysicalDirectoryPath() { // arrange BlogUrlHelper helper = UnitTestHelper.SetupUrlHelper("/Subtext.Web"); Mock<HttpContextBase> httpContext = Mock.Get(helper.HttpContext); httpContext.Setup(c => c.Server.MapPath("/Subtext.Web/images/localhost/Subtext_Web/123/")).Returns( @"c:\123\"); var blog = new Blog { Host = "localhost", Subfolder = "" }; // act string path = helper.GalleryDirectoryPath(blog, 123); // assert Assert.AreEqual(@"c:\123\", path); } [TestMethod] public void DeleteImageThrowsArgumentNullException() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => repository.Delete((Image)null)); } [TestMethod] public void InsertImageThrowsArgumentNullException() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => repository.Insert(null, new byte[0])); } [TestMethod] public void MakeAlbumImagesThrowsArgumentNullException() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => Images.MakeAlbumImages(null)); } [TestMethod] public void SaveImageThrowsArgumentNullExceptionForNullBuffer() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => Images.SaveImage(null, "x")); } [TestMethod] public void SaveImageThrowsArgumentNullExceptionForNullFileName() { UnitTestHelper.AssertThrowsArgumentNullException(() => Images.SaveImage(new byte[0], null)); } [TestMethod] public void SaveImageThrowsArgumentExceptionForNullFileName() { UnitTestHelper.AssertThrowsArgumentNullException(() => Images.SaveImage(new byte[0], "")); } [TestMethod] public void UpdateThrowsArgumentNullExceptionForNullImage() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => repository.Update(null, new byte[0])); } [TestMethod] public void UpdateThrowsArgumentNullExceptionForNullBuffer() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => repository.Update(new Image(), null)); } [TestMethod] public void UpdateImageThrowsArgumentNullException() { var repository = new DatabaseObjectProvider(); UnitTestHelper.AssertThrowsArgumentNullException(() => repository.Update((Image)null)); } private void DeleteTestFolders() { if (Directory.Exists(TestDirectory)) { Directory.Delete(TestDirectory, true); } if (Directory.Exists("image")) { Directory.Delete("image", true); } } [TestInitialize] public void TestInitialize() { DeleteTestFolders(); } [TestCleanup] public void TestCleanup() { DeleteTestFolders(); } } }
36.171533
111
0.608011
[ "MIT" ]
technology-toolbox/Subtext
src/UnitTests.Subtext/Framework/ImageTests.cs
9,911
C#
using DotnetSqlClient; using Netler; using System; using System.Threading.Tasks; namespace Dotnetadapter { class Program { static async Task Main(string[] args) { var port = Convert.ToInt32(args[0]); var clientPid = Convert.ToInt32(args[1]); var adapter = new SqlAdapter(); var server = Server.Create((config) => { config.UsePort(port); config.UseClientPid(clientPid); config.UseRoutes((routes) => { routes.Add("Connect", adapter.Connect); routes.Add("Disconnect", adapter.Disconnect); routes.Add("Execute", adapter.Execute); routes.Add("ExecuteInTransaction", adapter.ExecuteInTransaction); routes.Add("ExecutePreparedStatement", adapter.ExecutePreparedStatement); routes.Add("ExecutePreparedStatementInTransaction", adapter.ExecutePreparedStatementInTransaction); routes.Add("BeginTransaction", adapter.BeginTransaction); routes.Add("RollbackTransaction", adapter.RollbackTransaction); routes.Add("CommitTransaction", adapter.CommitTransaction); routes.Add("PrepareStatement", adapter.PrepareStatement); routes.Add("ClosePreparedStatement", adapter.ClosePreparedStatement); }); }); await server.Start(); } } }
40.175
123
0.550093
[ "MIT" ]
svan-jansson/ex_sql_client
dotnet/dotnet_sql_client/Program.cs
1,607
C#
using System; using System.Net; using System.Text; using com.esendex.sdk.adapters; using com.esendex.sdk.http; using NUnit.Framework; using Moq; namespace com.esendex.sdk.test.http { [TestFixture] public class HttpClientTests { private HttpClient client; private Mock<IHttpRequestHelper> httpRequestHelper; private Mock<IHttpResponseHelper> httpResponseHelper; private Mock<EsendexCredentials> mockEsendexCredentials; [SetUp] public void TestInitialize() { httpRequestHelper = new Mock<IHttpRequestHelper>(); httpResponseHelper = new Mock<IHttpResponseHelper>(); mockEsendexCredentials = new Mock<EsendexCredentials>(); var uri = new UriBuilder("http", "tempuri.org").Uri; client = new HttpClient(mockEsendexCredentials.Object, uri, httpRequestHelper.Object, httpResponseHelper.Object); } [Test] public void DefaultDIConstructor() { // Arrange var credentials = new EsendexCredentials("username", "password"); var uri = new Uri("http://tempuri.org"); var httpRequestHelper = new HttpRequestHelper(); var httpResponseHelper = new HttpResponseHelper(); // Act var clientInstance = new HttpClient(credentials, uri, httpRequestHelper, httpResponseHelper); // Assert Assert.That(clientInstance.Credentials, Is.InstanceOf<EsendexCredentials>()); Assert.That(clientInstance.HttpRequestHelper, Is.InstanceOf<HttpRequestHelper>()); Assert.That(clientInstance.HttpResponseHelper, Is.InstanceOf<HttpResponseHelper>()); Assert.That(clientInstance.Uri, Is.InstanceOf<Uri>()); } [Test] public void Submit_WithHttpRequest_ReturnsHttpResponse() { // Arrange var request = new HttpRequest { ResourcePath = "resource", HttpMethod = HttpMethod.POST, Content = "content", ContentEncoding = Encoding.UTF8, ContentType = "application/xml" }; var expectedResponse = new HttpResponse { StatusCode = HttpStatusCode.OK, Content = "content" }; var mockWebRequest = new Mock<IHttpWebRequestAdapter>(); httpRequestHelper .Setup(rh => rh.Create(request, client.Uri, It.IsAny<Version>())) .Returns(mockWebRequest.Object); httpRequestHelper .Setup(rh => rh.AddCredentials(mockWebRequest.Object, mockEsendexCredentials.Object)); httpRequestHelper .Setup(rh => rh.AddProxy(mockWebRequest.Object, mockEsendexCredentials.Object.WebProxy)); httpRequestHelper .Setup(rh => rh.AddContent(mockWebRequest.Object, request)); var mockWebResponse = new Mock<IHttpWebResponseAdapter>(); mockWebRequest .Setup(wr => wr.GetResponse()) .Returns(mockWebResponse.Object); httpResponseHelper .Setup(rh => rh.Create(mockWebResponse.Object)) .Returns(expectedResponse); // Act var actualResponse = client.Submit(request); // Assert Assert.IsNotNull(actualResponse); Assert.AreEqual(expectedResponse.StatusCode, actualResponse.StatusCode); } [Test] public void Submit_GetResponseThrowsWebException_ReturnsHttpResponse() { // Arrange var request = new HttpRequest { ResourcePath = "http://tempuri.org", HttpMethod = HttpMethod.POST, Content = "content", ContentEncoding = Encoding.UTF8, ContentType = "application/xml" }; var webRequest = new Mock<IHttpWebRequestAdapter>(); httpRequestHelper .Setup(rh => rh.Create(request, client.Uri, It.IsAny<Version>())) .Returns(webRequest.Object); httpRequestHelper .Setup(rh => rh.AddCredentials(webRequest.Object, mockEsendexCredentials.Object)); httpRequestHelper .Setup(rh => rh.AddProxy(webRequest.Object, mockEsendexCredentials.Object.WebProxy)); httpRequestHelper .Setup(rh => rh.AddContent(webRequest.Object, request)); var expectedException = new WebException(); webRequest .Setup(wr => wr.GetResponse()) .Throws(expectedException); var expectedResponse = new HttpResponse { StatusCode = HttpStatusCode.InternalServerError }; httpResponseHelper .Setup(rh => rh.Create(expectedException)) .Returns(expectedResponse); // Act var actualResponse = client.Submit(request); // Assert Assert.IsNotNull(actualResponse); Assert.AreEqual(expectedResponse.StatusCode, actualResponse.StatusCode); } } }
36.42069
125
0.587578
[ "BSD-3-Clause" ]
James226/esendex-dotnet-sdk
test/http/HttpClientTests.cs
5,283
C#
// Copyright 2009 Max Toro Q. // // 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.Collections.Specialized; using System.Text; using System.IO; namespace Nuxleus.Web.Module.EXPath.HttpClient { public sealed class XPathHttpMultipartItem { // required public XPathHttpBody Body { get; set; } // zero or more public NameValueCollection Headers { get; private set; } public XPathHttpMultipartItem() { this.Headers = new NameValueCollection(); } } }
29.777778
75
0.719216
[ "BSD-3-Clause" ]
mdavid/nuxleus
src/Nuxleus.Web/Nuxleus.Web.Modules/expath.httpclient/XPathHttpMultipartItem.cs
1,074
C#
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace TrabalhoCG { public class Poligono { private int id; private List<Ponto> atuais; private List<Ponto> originais; private double[,] ma; public Poligono(int id) { this.id = id; ma = new double[,]{ { 1, 0, 0}, { 0, 1, 0}, { 0, 0, 1} }; atuais = new List<Ponto>(); originais = new List<Ponto>(); } public void rotacao(int grau) { double[,] aux = new double[3, 3]; double[,] aux2 = new double[, ] { { Math.Cos(grau*Math.PI/180), -Math.Sin(grau * Math.PI / 180), 0 }, { Math.Sin(grau * Math.PI / 180), Math.Cos(grau * Math.PI / 180), 0 }, { 0, 0, 1 } }; for (int i = 0; i < 3; i++) { aux[i, 0] = aux2[i, 0] * ma[0, 0] + aux2[i, 1] * ma[1, 0] + aux2[i, 2] * ma[2, 0]; aux[i, 1] = aux2[i, 0] * ma[0, 1] + aux2[i, 1] * ma[1, 1] + aux2[i, 2] * ma[2, 1]; aux[i, 2] = aux2[i, 0] * ma[0, 2] + aux2[i, 1] * ma[1, 2] + aux2[i, 2] * ma[2, 2]; } ma = aux; } public void translacao(int x, int y) { double[,] aux = new double[3, 3]; double[,] aux2 = new double[,] { { 1, 0, x }, { 0, 1, y }, { 0, 0, 1 } }; for (int i = 0; i < 3; i++) { aux[i, 0] = aux2[i, 0] * ma[0, 0] + aux2[i, 1] * ma[1, 0] + aux2[i, 2] * ma[2, 0]; aux[i, 1] = aux2[i, 0] * ma[0, 1] + aux2[i, 1] * ma[1, 1] + aux2[i, 2] * ma[2, 1]; aux[i, 2] = aux2[i, 0] * ma[0, 2] + aux2[i, 1] * ma[1, 2] + aux2[i, 2] * ma[2, 2]; } ma = aux; } public void cisalhamento(double x,double y) { double[,] aux = new double[3, 3]; double[,] auxx = new double[,] { { 1, x, 0 }, { y, 1, 0 }, { 0, 0, 1 } }; for (int i = 0; i < 3; i++) { aux[i, 0] = auxx[i, 0] * ma[0, 0] + auxx[i, 1] * ma[1, 0] + auxx[i, 2] * ma[2, 0]; aux[i, 1] = auxx[i, 0] * ma[0, 1] + auxx[i, 1] * ma[1, 1] + auxx[i, 2] * ma[2, 1]; aux[i, 2] = auxx[i, 0] * ma[0, 2] + auxx[i, 1] * ma[1, 2] + auxx[i, 2] * ma[2, 2]; } ma = aux; } public void escala(double x, double y) { double[,] aux = new double[3, 3]; double[,] aux2 = new double[,] { { x, 0, 0 }, { 0, y, 0 }, { 0, 0, 1 } }; for (int i = 0; i < 3; i++) { aux[i, 0] = aux2[i, 0] * ma[0, 0] + aux2[i, 1] * ma[1, 0] + aux2[i, 2] * ma[2, 0]; aux[i, 1] = aux2[i, 0] * ma[0, 1] + aux2[i, 1] * ma[1, 1] + aux2[i, 2] * ma[2, 1]; aux[i, 2] = aux2[i, 0] * ma[0, 2] + aux2[i, 1] * ma[1, 2] + aux2[i, 2] * ma[2, 2]; } ma = aux; } public void espelhamentoV() { double[,] aux = new double[3, 3]; double[,] aux2 = new double[,] { { 1, 0, 0 }, { 0, -1, 0 }, { 0, 0, 1 } }; for (int i = 0; i < 3; i++) { aux[i, 0] = aux2[i, 0] * ma[0, 0] + aux2[i, 1] * ma[1, 0] + aux2[i, 2] * ma[2, 0]; aux[i, 1] = aux2[i, 0] * ma[0, 1] + aux2[i, 1] * ma[1, 1] + aux2[i, 2] * ma[2, 1]; aux[i, 2] = aux2[i, 0] * ma[0, 2] + aux2[i, 1] * ma[1, 2] + aux2[i, 2] * ma[2, 2]; } ma = aux; } public void espelhamentoH() { double[,] aux = new double[3, 3]; double[,] aux2 = new double[,] { { -1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; for (int i = 0; i < 3; i++) { aux[i, 0] = aux2[i, 0] * ma[0, 0] + aux2[i, 1] * ma[1, 0] + aux2[i, 2] * ma[2, 0]; aux[i, 1] = aux2[i, 0] * ma[0, 1] + aux2[i, 1] * ma[1, 1] + aux2[i, 2] * ma[2, 1]; aux[i, 2] = aux2[i, 0] * ma[0, 2] + aux2[i, 1] * ma[1, 2] + aux2[i, 2] * ma[2, 2]; } ma = aux; } public void setNewAtuais() { atuais = null; atuais = new List<Ponto>(); foreach (Ponto p in originais) { atuais.Add(new Ponto(Convert.ToInt32(ma[0,0]*p.getX()+ma[0,1]*p.getY()+ma[0,2]), Convert.ToInt32(ma[1, 0] * p.getX() + ma[1, 1] * p.getY() + ma[1, 2]))); } } public double[,] getMa() { return ma; } public void setMa(double [,] ma) { this.ma = ma; } public int getId() { return id; } public void addOriginais(Ponto v) { originais.Add(v); } public void addAtuais(Ponto v) { atuais.Add(v); } public List<Ponto> getAtuais() { return atuais; } public void setAtuais(List<Ponto> v) { this.atuais = v; } public List<Ponto> getOriginais() { return originais; } public void setOriginais(List<Ponto> v) { this.originais = v; } } }
33.428571
113
0.382572
[ "MIT" ]
VictorGVC/Manipulacao2D
TrabalhoCG1/TrabalhoCG/Entidades/Poligono.cs
5,384
C#
using System; namespace HandyCollections.BloomFilter { /// <summary> /// A bloom filter. False positives are possible, false negatives are not. Removing items is possible /// </summary> /// <typeparam name="T"></typeparam> public class CountingBloomFilter<T> { internal readonly byte[] Array; /// <summary> /// The number of keys to use for this filter /// </summary> private readonly int _keyCount; /// <summary> /// A hash generation function /// </summary> public delegate int GenerateHash(T a); private readonly GenerateHash _hashGenerator; /// <summary> /// Gets the number of items which have been added to this filter /// </summary> /// <value>The count.</value> public int Count { get; private set; } /// <summary> /// Gets the current false positive rate. /// </summary> /// <value>The false positive rate.</value> public double FalsePositiveRate => BloomFilter<T>.CalculateFalsePositiveRate(_keyCount, Array.Length, Count); /// <summary> /// Initializes a new instance of the <see cref="BloomFilter&lt;T&gt;"/> class. /// </summary> /// <param name="size">The size in bits</param> /// <param name="keys">The key count</param> public CountingBloomFilter(int size, int keys) : this(size, keys, BloomFilter<T>.SystemHash) { } /// <summary> /// Initializes a new instance of the <see cref="BloomFilter&lt;T&gt;"/> class. /// </summary> /// <param name="estimatedsize">The estimated number of items to add to the filter</param> /// <param name="targetFalsePositiveRate">The target positive rate.</param> public CountingBloomFilter(int estimatedsize, float targetFalsePositiveRate) : this(estimatedsize, targetFalsePositiveRate, BloomFilter<T>.SystemHash) { } /// <summary> /// Initializes a new instance of the <see cref="CountingBloomFilter&lt;T&gt;"/> class. /// </summary> /// <param name="size">The size of the filter in bytes</param> /// <param name="keys">The number of keys to use</param> /// <param name="hashgen">The hash generation function</param> public CountingBloomFilter(int size, int keys, GenerateHash hashgen) { Array = new byte[size]; _keyCount = keys; _hashGenerator = hashgen; } /// <summary> /// Initializes a new instance of the <see cref="CountingBloomFilter&lt;T&gt;"/> class. /// </summary> /// <param name="estimatedsize">The estimated number of members of the set</param> /// <param name="targetFalsePositiveRate">The target false positive rate when the estimated size is attained</param> /// <param name="hashgen">The hash generation function</param> public CountingBloomFilter(int estimatedsize, float targetFalsePositiveRate, GenerateHash hashgen) { int size = (int)(-(estimatedsize * Math.Log(targetFalsePositiveRate)) / 0.480453014f); int keys = (int)(0.7f * size / estimatedsize); Array = new byte[size]; _keyCount = keys; _hashGenerator = hashgen; } /// <summary> /// Adds the specified item to the filter /// </summary> /// <param name="item">The item.</param> /// <returns>Returns true if this item was already in the set</returns> public bool Add(T item) { bool b = true; int hash = _hashGenerator.Invoke(item); for (int i = 0; i < _keyCount; i++) { hash++; int index = BloomFilter<T>.GetIndex(hash, Array.Length); if (Array[index] == byte.MaxValue) { //Rollback changes for (int r = i - 1; r >= 0; r--) { hash--; Array[BloomFilter<T>.GetIndex(hash, Array.Length)]--; } throw new OverflowException("Bloom filter overflowed"); } if (Array[index]++ == 0) b = false; } Count++; return b; } /// <summary> /// Removes the specified item from the filter /// </summary> /// <param name="item">The item.</param> /// <returns>Returns true if this item was successfully removed</returns> public bool Remove(T item) { int hash = _hashGenerator.Invoke(item); for (int i = 0; i < _keyCount; i++) { hash++; int index = BloomFilter<T>.GetIndex(hash, Array.Length); if (Array[index] == 0) { //Rollback changes for (int r = i - 1; r >= 0; r--) { hash--; Array[BloomFilter<T>.GetIndex(hash, Array.Length)]++; } return false; } Array[index]--; } Count--; return true; } /// <summary> /// Clears this instance. /// </summary> public void Clear() { Count = 0; for (int i = 0; i < Array.Length; i++) Array[i] = 0; } /// <summary> /// Determines whether this filter contains the specificed object, this will sometimes return false positives but never false negatives /// </summary> /// <param name="item">The item.</param> /// <returns> /// <c>true</c> if the filter might contain the item; otherwise, <c>false</c>. /// </returns> public bool Contains(T item) { int hash = _hashGenerator(item); for (int i = 0; i < _keyCount; i++) { hash++; if (Array[BloomFilter<T>.GetIndex(hash, Array.Length)] == 0) return false; } return true; } } }
35.131868
143
0.509227
[ "MIT" ]
martindevans/HandyCollections
HandyCollections/BloomFilter/CountingBloomFilter.cs
6,396
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Plant : MonoBehaviour { public GameObject objectToPull; public bool pullSelf; // Start is called before the first frame update void Start() { if(pullSelf) { objectToPull = this.gameObject; } } // Update is called once per frame void Update() { } }
17.16
52
0.608392
[ "CC0-1.0" ]
carector/CoastalDoodleWar
Assets/Scripts/Plant.cs
431
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 AWSMigrationHub-2017-05-31.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.MigrationHub.Model { /// <summary> /// This is the response object from the NotifyMigrationTaskState operation. /// </summary> public partial class NotifyMigrationTaskStateResponse : AmazonWebServiceResponse { } }
31.078947
114
0.717189
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/MigrationHub/Generated/Model/NotifyMigrationTaskStateResponse.cs
1,181
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace _30_05_2021_Database_Coursework { public partial class Login_Filter_Frame : Form { private MainFrame OriginFrame; private FilterData filterHandler; public bool IsFilterOn; public Login_Filter_Frame(MainFrame OriginFrame, InterfaceCodes code) { InitializeComponent(); this.OriginFrame = OriginFrame; switch(code) { case InterfaceCodes.FilterGlobalTable: filterHandler = new FilterGlobalData(this); break; case InterfaceCodes.FilterLocalTable: filterHandler = new FilterLocalData(this); break; } } private void AgeFilterButton_Click(object sender, EventArgs e) { filterHandler.FilterDataFromInterface(OriginFrame, LoginTextBox.Text); } abstract class FilterData { public abstract void FilterDataFromInterface(MainFrame OriginFrame, string login); } class FilterGlobalData : FilterData { Login_Filter_Frame CurFrame; public FilterGlobalData(Login_Filter_Frame CurFrame) { this.CurFrame = CurFrame; } public override void FilterDataFromInterface(MainFrame OriginFrame, string login) { // Очищаем таблицу var GlobalTable = OriginFrame.FrameTables.TabPages[0].Controls.OfType<DataGridView>().First(); while(GlobalTable.Rows.Count != 0) { GlobalTable.Rows.Remove(GlobalTable.Rows[0]); } var TreeEl = OriginFrame.GlobalInformationTree.FindElemByLogin(OriginFrame.GlobalInformationTree.Head, login); if (TreeEl != null ) { var Element = TreeEl.info; int rowNumber = GlobalTable.Rows.Add(); GlobalTable.Rows[rowNumber].Cells["Login"].Value = Element.Login; GlobalTable.Rows[rowNumber].Cells["Age"].Value = Element.Age; GlobalTable.Rows[rowNumber].Cells["PassedLevels"].Value = Element.PassedLevels; GlobalTable.Rows[rowNumber].Cells["GameName"].Value = Element.GameName; GlobalTable.Rows[rowNumber].Cells["Developer"].Value = Element.Developer; GlobalTable.Rows[rowNumber].Cells["Contacts"].Value = Element.Contacts; GlobalTable.Rows[rowNumber].Cells["FirstTimePlayed"].Value = Element.FirstTimePlayed; GlobalTable.Rows[rowNumber].Cells["LastTimePlayed"].Value = Element.LastTimePlayed; } } } class FilterLocalData : FilterData { Login_Filter_Frame CurFrame; public FilterLocalData(Login_Filter_Frame CurFrame) { this.CurFrame = CurFrame; } public override void FilterDataFromInterface(MainFrame OriginFrame, string login) { // Очищаем таблицу var LocalTable = OriginFrame.FrameTables.TabPages[1].Controls.OfType<DataGridView>().First(); while (LocalTable.Rows.Count != 0) { LocalTable.Rows.Remove(LocalTable.Rows[0]); } var Element = OriginFrame.PlayersInformationHash.FindByLogin(new PlayerInformation { Login = login }); if (Element != null) { int rowNumber = LocalTable.Rows.Add(); LocalTable.Rows[rowNumber].Cells["PlayersTableLogin"].Value = Element.Login; LocalTable.Rows[rowNumber].Cells["PlayersTableAge"].Value = Element.Age; } } } } }
38.728972
126
0.576014
[ "MIT" ]
StalkerRaftik/Database_Coursework
UsersTable/Login_Filter_Frame.cs
4,174
C#
using GoogleMusicApi.UWP.Requests.Data; namespace GoogleMusicApi.UWP.Requests { public class ListListenNowSituations : StructuredRequest<ListListenNowSituationsRequest, ListListenNowSituationResponse> { public override string RelativeRequestUrl => "listennow/situations"; } }
30.5
89
0.77377
[ "MIT" ]
GlowNtheDark/Bermuda
GoogleMusicApi.UWP/Requests/ListListenNowSituations.cs
307
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\IEntityCollectionRequest.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Linq.Expressions; /// <summary> /// The interface IManagedAppRegistrationOperationsCollectionRequest. /// </summary> public partial interface IManagedAppRegistrationOperationsCollectionRequest : IBaseRequest { /// <summary> /// Adds the specified ManagedAppOperation to the collection via POST. /// </summary> /// <param name="managedAppOperation">The ManagedAppOperation to add.</param> /// <returns>The created ManagedAppOperation.</returns> System.Threading.Tasks.Task<ManagedAppOperation> AddAsync(ManagedAppOperation managedAppOperation); /// <summary> /// Adds the specified ManagedAppOperation to the collection via POST. /// </summary> /// <param name="managedAppOperation">The ManagedAppOperation to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created ManagedAppOperation.</returns> System.Threading.Tasks.Task<ManagedAppOperation> AddAsync(ManagedAppOperation managedAppOperation, CancellationToken cancellationToken); /// <summary> /// Gets the collection page. /// </summary> /// <returns>The collection page.</returns> System.Threading.Tasks.Task<IManagedAppRegistrationOperationsCollectionPage> GetAsync(); /// <summary> /// Gets the collection page. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The collection page.</returns> System.Threading.Tasks.Task<IManagedAppRegistrationOperationsCollectionPage> GetAsync(CancellationToken cancellationToken); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="value">The expand value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Expand(string value); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="expandExpression">The expression from which to calculate the expand value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Expand(Expression<Func<ManagedAppOperation, object>> expandExpression); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="value">The select value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Select(string value); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="selectExpression">The expression from which to calculate the select value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Select(Expression<Func<ManagedAppOperation, object>> selectExpression); /// <summary> /// Adds the specified top value to the request. /// </summary> /// <param name="value">The top value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Top(int value); /// <summary> /// Adds the specified filter value to the request. /// </summary> /// <param name="value">The filter value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Filter(string value); /// <summary> /// Adds the specified skip value to the request. /// </summary> /// <param name="value">The skip value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest Skip(int value); /// <summary> /// Adds the specified orderby value to the request. /// </summary> /// <param name="value">The orderby value.</param> /// <returns>The request object to send.</returns> IManagedAppRegistrationOperationsCollectionRequest OrderBy(string value); } }
46.592593
153
0.644277
[ "MIT" ]
OfficeGlobal/msgraph-beta-sdk-dotnet
src/Microsoft.Graph/Requests/Generated/IManagedAppRegistrationOperationsCollectionRequest.cs
5,032
C#
using System; using ReactNative.Bridge; using ReactNative.Modules.Core; using ReactNative.UIManager; using System.Collections.Generic; namespace RNSentry { public class RNSentryPackage : IReactPackage { public IReadOnlyList<INativeModule> CreateNativeModules(ReactContext reactContext) { return new List<INativeModule> { new RNSentryModule(reactContext), new RNSentryEventEmitter(reactContext) }; } public IReadOnlyList<Type> CreateJavaScriptModulesConfig() { return new List<Type>(0); } public IReadOnlyList<IViewManager> CreateViewManagers(ReactContext reactContext) { return new List<IViewManager>(0); } } }
25.483871
90
0.637975
[ "MIT" ]
axsy-dev/react-native-sentry
windows/RNSentry/RNSentry/RNSentryPackage.cs
790
C#
//----------------------------------------------------------------------------- // FILE: Program.cs // CONTRIBUTOR: Marcus Bowyer // COPYRIGHT: Copyright (c) 2005-2022 by neonFORGE LLC. All rights reserved. using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Neon.Common; using Neon.Kube; using Neon.Service; using Prometheus.DotNetRuntime; namespace NeonDashboard { /// <summary> /// Holds the global program state. /// </summary> public static partial class Program { /// <summary> /// The program entrypoint. /// </summary> /// <param name="args">The command line arguments.</param> public static async Task Main(string[] args) { var service = new NeonDashboardService(KubeService.NeonDashboard); service.MetricsOptions.Mode = MetricsMode.Scrape; service.MetricsOptions.Path = "metrics/"; service.MetricsOptions.Port = 9762; service.MetricsOptions.GetCollector = () => { return DotNetRuntimeStatsBuilder .Default() .StartCollecting(); }; var exitCode = await service.RunAsync(); Environment.Exit(exitCode); } } }
28.528302
79
0.581349
[ "Apache-2.0" ]
codelastnight/neonKUBE
Services/neon-dashboard/Program.cs
1,512
C#
// // ToolStripItemDisplayStyle.cs // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // Copyright (c) 2006 Novell, Inc. // // Authors: // Jonathan Pobst (monkey@jpobst.com) // #if NET_2_0 namespace System.Windows.Forms { public enum ToolStripItemDisplayStyle { None = 0, Text = 1, Image = 2, ImageAndText = 3 } } #endif
33.292683
73
0.744322
[ "Apache-2.0" ]
Sectoid/debian-mono
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemDisplayStyle.cs
1,365
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Text.Json; using Microsoft.Extensions.Configuration; using AzureSamples.AzureSQL.Services; namespace AzureSamples.AzureSQL.Controllers { [ApiController] [Route("shopping_cart")] public class ShoppingCartController : ControllerQuery { public ShoppingCartController(IConfiguration config, ILogger<ShoppingCartController> logger, IScaleOut scaleOut): base(config, logger, scaleOut, "shopping_cart") {} [HttpGet("{id}")] public async Task<JsonDocument> Get(int id) { var (result, replica) = await this.Query(Verb.Get, id); HttpContext.Response.Headers.Add("Used-Replica-Name", replica); return result; } [HttpGet("package/{id}")] public async Task<JsonDocument> GetByPackage(int id) { var (result, replica) = await this.Query(Verb.Get, id, extension: "by_package", tag: "Search"); HttpContext.Response.Headers.Add("Used-Replica-Name", replica); return result; } [HttpGet("search/{term}")] public async Task<JsonDocument> SearchByTerm(String term) { var payload = JsonDocument.Parse(JsonSerializer.Serialize(new { term = term })); var (result, replica) = await this.Query(Verb.Get, payload: payload.RootElement, extension: "by_search", tag: "Search"); HttpContext.Response.Headers.Add("Used-Replica-Name", replica); return result; } [HttpPut] public async Task<JsonDocument> Put([FromBody]JsonElement payload) { var (result, replica) = await this.Query(Verb.Put, payload: payload); HttpContext.Response.Headers.Add("Used-Replica-Name", replica); return result; } } }
36.254545
132
0.639418
[ "MIT" ]
Azure-Samples/azure-sql-db-named-replica-oltp-scaleout
app/Controllers/ShoppingCartController.cs
1,994
C#
using Microsoft.AspNetCore.Identity; using Abp.Authorization; using Abp.Authorization.Users; using Abp.Configuration; using Abp.Configuration.Startup; using Abp.Dependency; using Abp.Domain.Repositories; using Abp.Domain.Uow; using Abp.Zero.Configuration; using SE347.L11_HelloWork.Authorization.Roles; using SE347.L11_HelloWork.Authorization.Users; using SE347.L11_HelloWork.MultiTenancy; namespace SE347.L11_HelloWork.Authorization { public class LogInManager : AbpLogInManager<Tenant, Role, User> { public LogInManager( UserManager userManager, IMultiTenancyConfig multiTenancyConfig, IRepository<Tenant> tenantRepository, IUnitOfWorkManager unitOfWorkManager, ISettingManager settingManager, IRepository<UserLoginAttempt, long> userLoginAttemptRepository, IUserManagementConfig userManagementConfig, IIocResolver iocResolver, IPasswordHasher<User> passwordHasher, RoleManager roleManager, UserClaimsPrincipalFactory claimsPrincipalFactory) : base( userManager, multiTenancyConfig, tenantRepository, unitOfWorkManager, settingManager, userLoginAttemptRepository, userManagementConfig, iocResolver, passwordHasher, roleManager, claimsPrincipalFactory) { } } }
33.826087
76
0.645887
[ "MIT" ]
NgocSon288/HelloWork
aspnet-core/src/SE347.L11_HelloWork.Core/Authorization/LoginManager.cs
1,558
C#
using System.Threading; using System.Threading.Tasks; namespace Vault.Endpoints.Sys { public partial class SysEndpoint { public Task StepDown(CancellationToken ct = default(CancellationToken)) { return _client.PutVoid($"{UriPathBase}/step-down", ct); } } }
21.857143
79
0.660131
[ "MIT" ]
Chatham/Vault.NET
src/Vault/Endpoints/Sys/StepDown.cs
306
C#
using System; using System.Reflection; using UnityObject = UnityEngine.Object; namespace Chronos.Reflection { [Serializable] public class UnityVariable : UnityMember { /// <summary> /// The underlying reflected field, or null if the variable is a property. /// </summary> public FieldInfo fieldInfo { get; private set; } /// <summary> /// The underlying property field, or null if the variable is a field. /// </summary> public PropertyInfo propertyInfo { get; private set; } #region Constructors public UnityVariable() { } public UnityVariable(string name) : base(name) { } public UnityVariable(string name, UnityObject target) : base(name, target) { } public UnityVariable(string component, string name) : base(component, name) { } public UnityVariable(string component, string name, UnityObject target) : base(component, name, target) { } #endregion /// <inheritdoc /> public override void Reflect() { if (!isAssigned) { throw new Exception("Field or property name not specified."); } EnsureTargeted(); Type type = reflectionTarget.GetType(); MemberTypes types = MemberTypes.Property | MemberTypes.Field; BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy; MemberInfo[] variables = type.GetMember(name, types, flags); if (variables.Length == 0) { throw new Exception(string.Format("No matching field or property found: '{0}.{1}'", type.Name, name)); } MemberInfo variable = variables[0]; // Safe, because there can't possibly be more than one variable of the same name fieldInfo = variable as FieldInfo; propertyInfo = variable as PropertyInfo; isReflected = true; } /// <summary> /// Retrieves the value of the variable. /// </summary> public object Get() { EnsureReflected(); if (fieldInfo != null) { return fieldInfo.GetValue(reflectionTarget); } if (propertyInfo != null) { return propertyInfo.GetValue(reflectionTarget, null); } throw new InvalidOperationException(); } /// <summary> /// Retrieves the value of the variable casted to the specified type. /// </summary> public T Get<T>() { return (T)Get(); } /// <summary> /// Assigns a new value to the variable. /// </summary> public void Set(object value) { EnsureReflected(); if (fieldInfo != null) { fieldInfo.SetValue(reflectionTarget, value); return; } if (propertyInfo != null) { propertyInfo.SetValue(reflectionTarget, value, null); return; } throw new InvalidOperationException(); } /// <summary> /// The type of the reflected field or property. /// </summary> public Type type { get { EnsureReflected(); if (fieldInfo != null) { return fieldInfo.FieldType; } if (propertyInfo != null) { return propertyInfo.PropertyType; } throw new InvalidOperationException(); } } public override bool Corresponds(UnityMember other) { return other is UnityVariable && base.Corresponds(other); } } }
22.84058
147
0.669734
[ "MIT" ]
BlackZIjian/SpiralExplosion
Assets/Chronos/Source/Dependencies/Reflection/UnityVariable.cs
3,152
C#
/* Copyright 2008 Timo Eckhardt, University of Siegen 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 Primes.Library; using System; using System.Windows; using System.Windows.Controls; namespace Primes.WpfControls.Start { /// <summary> /// Interaction logic for StartControl.xaml /// </summary> public partial class StartControl : UserControl, IPrimeMethodDivision { private readonly System.Windows.Forms.WebBrowser b; public event Navigate OnStartpageLinkClick; public StartControl() { InitializeComponent(); b = new System.Windows.Forms.WebBrowser { Dock = System.Windows.Forms.DockStyle.Fill }; b.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(b_Navigating); windowsFormsHost1.Child = b; b.DocumentText = Properties.Resources.Start; //b.Document.ContextMenuShowing += new System.Windows.Forms.HtmlElementEventHandler(Document_ContextMenuShowing); } private void Document_ContextMenuShowing(object sender, System.Windows.Forms.HtmlElementEventArgs e) { e.ReturnValue = false; } private void b_Navigating(object sender, System.Windows.Forms.WebBrowserNavigatingEventArgs e) { string target = e.Url.AbsoluteUri; if (target.IndexOf("exec://") >= 0) { target = target.Replace("exec://", ""); target = target.Replace("/", ""); } if (!string.IsNullOrEmpty(target) && OnStartpageLinkClick != null) { NavigationCommandType action = NavigationCommandType.None; switch (target.ToLower()) { case "factor_bf": action = NavigationCommandType.Factor_Bf; break; case "factor_qs": action = NavigationCommandType.Factor_QS; break; case "primetest_sieve": action = NavigationCommandType.Primetest_Sieve; break; case "primetest_miller": action = NavigationCommandType.Primetest_Miller; break; case "primesgeneration": action = NavigationCommandType.Primesgeneration; break; case "graph": action = NavigationCommandType.Graph; break; case "primedistrib_numberline": action = NavigationCommandType.PrimeDistrib_Numberline; break; case "primedistrib_numberrec": action = NavigationCommandType.PrimeDistrib_Numberrec; break; case "primedistrib_ulam": action = NavigationCommandType.PrimeDistrib_Ulam; break; case "primitivroot": action = NavigationCommandType.PrimitivRoot; break; case "powermod": action = NavigationCommandType.PowerMod; break; case "numbertheoryfunctions": action = NavigationCommandType.NumberTheoryFunctions; break; case "primedistrib_goldbach": action = NavigationCommandType.PrimeDistrib_Goldbach; break; } if (action != NavigationCommandType.None) { OnStartpageLinkClick(action); e.Cancel = true; } } } protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) { base.OnRenderSizeChanged(sizeInfo); //this.windowsFormsHost1.Width = sizeInfo.NewSize.Width; } #region IPrimeUserControl Members public void Dispose() { // } #endregion #region IPrimeUserControl Members public void SetTab(int i) { throw new NotImplementedException(); } #endregion #region IPrimeUserControl Members public event VoidDelegate Execute; public void FireExecuteEvent() { if (Execute != null) { Execute(); } } public event VoidDelegate Stop; public void FireStopEvent() { if (Stop != null) { Stop(); } } #endregion #region IPrimeUserControl Members public void Init() { throw new NotImplementedException(); } #endregion } }
33.035714
125
0.534955
[ "Apache-2.0" ]
CrypToolProject/CrypTool-2
CrypPlugins/Primes/Primes/WpfControls/Start/StartControl.xaml.cs
5,550
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.AppConfiguration.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Extensions; /// <summary>Regenerates an access key for the specified configuration store.</summary> /// <remarks> /// [OpenAPI] ConfigurationStores_RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAppConfigurationStoreKey_RegenerateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Description(@"Regenerates an access key for the specified configuration store.")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Generated] public partial class NewAzAppConfigurationStoreKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener { /// <summary>A unique id generatd for the this cmdlet when it is instantiated.</summary> private string __correlationId = System.Guid.NewGuid().ToString(); /// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary> private global::System.Management.Automation.InvocationInfo __invocationInfo; /// <summary>A unique id generatd for the this cmdlet when ProcessRecord() is called.</summary> private string __processRecordId; /// <summary> /// The <see cref="global::System.Threading.CancellationTokenSource" /> for this operation. /// </summary> private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// <summary>Wait for .NET debugger to attach</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } /// <summary>The reference to the client API class.</summary> public Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.AppConfiguration Client => Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Module.Instance.ClientAPI; /// <summary> /// The credentials, account, tenant, and subscription used for communication with Azure /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } /// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } /// <summary>SendAsync Pipeline Steps to be prepended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// <summary>The id of the key to regenerate.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The id of the key to regenerate.")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Info( Required = true, ReadOnly = false, Description = @"The id of the key to regenerate.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] public string Id { get => RegenerateKeyParametersBody.Id ?? null; set => RegenerateKeyParametersBody.Id = value; } /// <summary>Accessor for our copy of the InvocationInfo.</summary> public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// <summary> /// <see cref="IEventListener" /> cancellation delegate. Stops the cmdlet when called. /// </summary> global::System.Action Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; /// <summary><see cref="IEventListener" /> cancellation token.</summary> global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// <summary>Backing field for <see cref="Name" /> property.</summary> private string _name; /// <summary>The name of the configuration store.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the configuration store.")] [Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Info( Required = true, ReadOnly = false, Description = @"The name of the configuration store.", SerializedName = @"configStoreName", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } /// <summary> /// The instance of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.HttpPipeline" /> that the remote call will use. /// </summary> private Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.HttpPipeline Pipeline { get; set; } /// <summary>The URI for the proxy server to use</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Runtime)] public global::System.Uri Proxy { get; set; } /// <summary>Credentials for a proxy server to use for the remote call</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Runtime)] public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } /// <summary>Use the default credentials for the proxy</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } /// <summary>Backing field for <see cref="RegenerateKeyParametersBody" /> property.</summary> private Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IRegenerateKeyParameters _regenerateKeyParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.RegenerateKeyParameters(); /// <summary>The parameters used to regenerate an API key.</summary> private Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IRegenerateKeyParameters RegenerateKeyParametersBody { get => this._regenerateKeyParametersBody; set => this._regenerateKeyParametersBody = value; } /// <summary>Backing field for <see cref="ResourceGroupName" /> property.</summary> private string _resourceGroupName; /// <summary>The name of the resource group to which the container registry belongs.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group to which the container registry belongs.")] [Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Info( Required = true, ReadOnly = false, Description = @"The name of the resource group to which the container registry belongs.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } /// <summary>Backing field for <see cref="SubscriptionId" /> property.</summary> private string _subscriptionId; /// <summary>The Microsoft Azure subscription ID.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Microsoft Azure subscription ID.")] [Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Info( Required = true, ReadOnly = false, Description = @"The Microsoft Azure subscription ID.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.DefaultInfo( Name = @"", Description =@"", Script = @"(Get-AzContext).Subscription.Id")] [global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Category(global::Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } /// <summary> /// <c>overrideOnDefault</c> will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IError" /// /> from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing )</param> partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IError> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IApiKey" /// /> from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing )</param> partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IApiKey> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) /// </summary> protected override void BeginProcessing() { Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.AttachDebugger.Break(); } ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Performs clean-up after the command execution</summary> protected override void EndProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Handles/Dispatches events during the call to the REST service.</summary> /// <param name="id">The message id</param> /// <param name="token">The message cancellation token. When this call is cancelled, this should be <c>true</c></param> /// <param name="messageData">Detailed message data for the message event.</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the message is completed. /// </returns> async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.EventData> messageData) { using( NoSynchronizationContext ) { if (token.IsCancellationRequested) { return ; } switch ( id ) { case Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.Verbose: { WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.Warning: { WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.Information: { var data = messageData(); WriteInformation(data, new[] { data.Message }); return ; } case Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.Debug: { WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.Error: { WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } } await Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; } WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); } } /// <summary> /// Intializes a new instance of the <see cref="NewAzAppConfigurationStoreKey_RegenerateExpanded" /> cmdlet class. /// </summary> public NewAzAppConfigurationStoreKey_RegenerateExpanded() { } /// <summary>Performs execution of the command.</summary> protected override void ProcessRecord() { ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } __processRecordId = System.Guid.NewGuid().ToString(); try { // work if (ShouldProcess($"Call remote 'ConfigurationStoresRegenerateKey' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token) ) { asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token); } } } catch (global::System.AggregateException aggregateException) { // unroll the inner exceptions to get the root cause foreach( var innerException in aggregateException.Flatten().InnerExceptions ) { ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } } catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) { ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } finally { ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletProcessRecordEnd).Wait(); } } /// <summary>Performs execution of the command, working asynchronously if required.</summary> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> protected async global::System.Threading.Tasks.Task ProcessRecordAsync() { using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); } if (null != HttpPipelineAppend) { Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance try { await ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await this.Client.ConfigurationStoresRegenerateKey(SubscriptionId, ResourceGroupName, Name, RegenerateKeyParametersBody, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.UndeclaredResponseException urexception) { WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=RegenerateKeyParametersBody}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); } finally { await ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Events.CmdletProcessRecordAsyncEnd); } } } /// <summary>Interrupts currently running code within the command.</summary> protected override void StopProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IEventListener)this).Cancel(); base.StopProcessing(); } /// <summary> /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IError" /// /> from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IError> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnDefault(responseMessage, response, ref _returnNow); // if overrideOnDefault has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // Error Response : default var code = (await response)?.Code; var message = (await response)?.Message; if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.RestException<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IError>(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=RegenerateKeyParametersBody }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=RegenerateKeyParametersBody }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); } } } /// <summary>a delegate that is called when the remote service returns 200 (OK).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IApiKey" /// /> from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IApiKey> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnOk(responseMessage, response, ref _returnNow); // if overrideOnOk has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20200601.IApiKey WriteObject((await response)); } } } }
75.920482
495
0.683658
[ "MIT" ]
3quanfeng/azure-powershell
src/AppConfiguration/generated/cmdlets/NewAzAppConfigurationStoreKey_RegenerateExpanded.cs
31,093
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 FinanceManager.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
35.6
151
0.583333
[ "BSD-3-Clause" ]
CorporateGreed/FinanceManagerC
FinanceManager/FinanceManager/Properties/Settings.Designer.cs
1,070
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> //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Inventory Management.Server")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyProductAttribute("Inventory Management.Server")] [assembly: System.Reflection.AssemblyTitleAttribute("Inventory Management.Server")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class.
42.958333
85
0.658584
[ "Unlicense" ]
VenkatRaghavRM/Ecommerce-ProductModule-API
Product Module API/Inventory Management.Server/obj/Debug/net5.0/Inventory Management.Server.AssemblyInfo.cs
1,031
C#
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.Serialization; using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Tests.TestObjects { public class SerializationEventTestObject { // This member is serialized and deserialized with no change. public int Member1 { get; set; } // The value of this field is set and reset during and // after serialization. public string Member2 { get; set; } // This field is not serialized. The OnDeserializedAttribute // is used to set the member value after serialization. [JsonIgnore] public string Member3 { get; set; } // This field is set to null, but populated after deserialization. public string Member4 { get; set; } // This field is set to null, but populated after error. [JsonIgnore] public string Member5 { get; set; } // Getting or setting this field will throw an error. public string Member6 { get { throw new Exception("Member5 get error!"); } set { throw new Exception("Member5 set error!"); } } public SerializationEventTestObject() { Member1 = 11; Member2 = "Hello World!"; Member3 = "This is a nonserialized value"; Member4 = null; } [OnSerializing] internal void OnSerializingMethod(StreamingContext context) { Member2 = "This value went into the data file during serialization."; } [OnSerialized] internal void OnSerializedMethod(StreamingContext context) { Member2 = "This value was reset after serialization."; } [OnDeserializing] internal void OnDeserializingMethod(StreamingContext context) { Member3 = "This value was set during deserialization"; } [OnDeserialized] internal void OnDeserializedMethod(StreamingContext context) { Member4 = "This value was set after deserialization."; } [OnError] internal void OnErrorMethod(StreamingContext context, ErrorContext errorContext) { Member5 = "Error message for member " + errorContext.Member + " = " + errorContext.Error.Message; errorContext.Handled = true; } } }
35.555556
109
0.660227
[ "MIT" ]
0xced/Newtonsoft.Json
Src/Newtonsoft.Json.Tests/TestObjects/SerializationEventTestObject.cs
3,522
C#
/* * Copyright (c) Contributors, http://aurora-sim.org/, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Aurora-Sim Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System.Collections.Generic; using OpenMetaverse; namespace Aurora.Framework { public interface BaseCacheAccount { UUID PrincipalID { get; set; } string Name { get; set; } } public class GenericAccountCache<T> where T : BaseCacheAccount { private double CACHE_EXPIRATION_SECONDS = 6*60*1000; // 6 hour cache on useraccounts, since they should not change private bool m_allowNullCaching = true; private readonly ExpiringCache<string, UUID> m_NameCache; private readonly ExpiringCache<UUID, T> m_UUIDCache; private readonly Dictionary<UUID, int> m_nullCacheTimes = new Dictionary<UUID, int>(); public GenericAccountCache() { m_UUIDCache = new ExpiringCache<UUID, T>(); m_NameCache = new ExpiringCache<string, UUID>(); } public GenericAccountCache(double expirationTime) { CACHE_EXPIRATION_SECONDS = expirationTime; m_UUIDCache = new ExpiringCache<UUID, T>(); m_NameCache = new ExpiringCache<string, UUID>(); } public void Cache(UUID userID, T account) { if (!m_allowNullCaching && account == null) return; if (account == null) { if (!m_nullCacheTimes.ContainsKey(userID)) m_nullCacheTimes[userID] = 0; else m_nullCacheTimes[userID]++; if (m_nullCacheTimes[userID] < 5) return; } else if (m_nullCacheTimes.ContainsKey(userID)) m_nullCacheTimes.Remove(userID); // Cache even null accounts m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); if (account != null && !string.IsNullOrEmpty(account.Name)) m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); //MainConsole.Instance.DebugFormat("[USER CACHE]: cached user {0}", userID); } public bool Get(UUID userID, out T account) { if (m_UUIDCache.TryGetValue(userID, out account)) return true; return false; } public bool Get(string name, out T account) { account = default(T); UUID uuid = UUID.Zero; if (m_NameCache.TryGetValue(name, out uuid)) if (m_UUIDCache.TryGetValue(uuid, out account)) return true; return false; } } }
41.495238
102
0.627266
[ "BSD-3-Clause" ]
BillyWarrhol/Aurora-Sim
Aurora/Framework/Utils/GenericAccountCache.cs
4,357
C#
using ShineEngine; /// <summary> /// 返回拍卖行查询结果(generated by shine) /// </summary> public class FuncAuctionReQueryResponse:FuncSResponse { /// <summary> /// 数据类型ID /// </summary> public const int dataID=GameResponseType.FuncAuctionReQuery; /// <summary> /// 结果页码 /// </summary> public int page; /// <summary> /// 结果组 /// </summary> public SList<AuctionItemData> resultList; public FuncAuctionReQueryResponse() { _dataID=GameResponseType.FuncAuctionReQuery; } /// <summary> /// 获取数据类名 /// </summary> public override string getDataClassName() { return "FuncAuctionReQueryResponse"; } /// <summary> /// 读取字节流(完整版) /// </summary> protected override void toReadBytesFull(BytesReadStream stream) { base.toReadBytesFull(stream); stream.startReadObj(); this.page=stream.readInt(); int resultListLen=stream.readLen(); if(this.resultList!=null) { this.resultList.clear(); this.resultList.ensureCapacity(resultListLen); } else { this.resultList=new SList<AuctionItemData>(); } SList<AuctionItemData> resultListT=this.resultList; for(int resultListI=resultListLen-1;resultListI>=0;--resultListI) { AuctionItemData resultListV; BaseData resultListVT=stream.readDataFullNotNull(); if(resultListVT!=null) { if(resultListVT is AuctionItemData) { resultListV=(AuctionItemData)resultListVT; } else { resultListV=new AuctionItemData(); if(!(resultListVT.GetType().IsAssignableFrom(typeof(AuctionItemData)))) { stream.throwTypeReadError(typeof(AuctionItemData),resultListVT.GetType()); } resultListV.shadowCopy(resultListVT); } } else { resultListV=null; } resultListT.add(resultListV); } stream.endReadObj(); } /// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { base.toReadBytesSimple(stream); this.page=stream.readInt(); int resultListLen=stream.readLen(); if(this.resultList!=null) { this.resultList.clear(); this.resultList.ensureCapacity(resultListLen); } else { this.resultList=new SList<AuctionItemData>(); } SList<AuctionItemData> resultListT=this.resultList; for(int resultListI=resultListLen-1;resultListI>=0;--resultListI) { AuctionItemData resultListV; resultListV=(AuctionItemData)stream.readDataSimpleNotNull(); resultListT.add(resultListV); } } /// <summary> /// 转文本输出 /// </summary> protected override void toWriteDataString(DataWriter writer) { base.toWriteDataString(writer); writer.writeTabs(); writer.sb.Append("page"); writer.sb.Append(':'); writer.sb.Append(this.page); writer.writeEnter(); writer.writeTabs(); writer.sb.Append("resultList"); writer.sb.Append(':'); writer.sb.Append("List<AuctionItemData>"); if(this.resultList!=null) { SList<AuctionItemData> resultListT=this.resultList; int resultListLen=resultListT.size(); writer.sb.Append('('); writer.sb.Append(resultListLen); writer.sb.Append(')'); writer.writeEnter(); writer.writeLeftBrace(); for(int resultListI=0;resultListI<resultListLen;++resultListI) { AuctionItemData resultListV=resultListT.get(resultListI); writer.writeTabs(); writer.sb.Append(resultListI); writer.sb.Append(':'); if(resultListV!=null) { resultListV.writeDataString(writer); } else { writer.sb.Append("AuctionItemData=null"); } writer.writeEnter(); } writer.writeRightBrace(); } else { writer.sb.Append("=null"); } writer.writeEnter(); } /// <summary> /// 执行 /// </summary> protected override void execute() { } /// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { base.toRelease(pool); this.page=0; this.resultList=null; } }
21.051546
81
0.642997
[ "Apache-2.0" ]
hw233/home3
core/client/game/src/commonGame/net/response/func/auction/FuncAuctionReQueryResponse.cs
4,184
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. namespace Connector.Tests { using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.Bot.Connector; using Microsoft.Bot.Connector.Authentication; using Microsoft.Bot.Schema; using Microsoft.Rest; using Xunit; public class ConnectorClientTest : BaseTest { [Fact] public void ConnectorClientWithCustomHttpClientAndMicrosoftCredentials() { var baseUri = new Uri("https://test.coffee"); var customHttpClient = new HttpClient(); // Set a special base address so then we can make sure the connector client is honoring this http client customHttpClient.BaseAddress = baseUri; var connector = new ConnectorClient(new Uri("http://localhost/"), new MicrosoftAppCredentials(string.Empty, string.Empty), customHttpClient); Assert.Equal(connector.HttpClient.BaseAddress, baseUri); } } }
33.470588
153
0.68717
[ "MIT" ]
Aliandi/botbuilder-dotnet
tests/Microsoft.Bot.Connector.Tests/ConnectorClientTest.cs
1,140
C#
using System; using System.Collections.Generic; using System.Text; namespace Template.Contracts.V1 { public static class ApiRoutes { public const string Root = "api"; public const string Version = "v1"; public const string Base = Root + "/" + Version; public static class Auth { public const string Register = Base + "/Auth/Register"; public const string Authenticate = Base + "/Auth/Auth"; public const string Refresh = Base + "/Auth/Refresh"; } public static class User { public const string Get = Base + "/User"; public const string GetById = Base + "/User"; public const string Post = Base + "/User"; public const string Put = Base + "/User"; public const string Delete = Base + "/User"; } } }
24.027027
67
0.564679
[ "MIT" ]
kzhou57/CSharp-API-Template
Template.Contracts/V1/ApiRoutes.cs
891
C#
 namespace Sparkle.WebStatus.Controllers { using Sparkle.NetworksStatus.Domain.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using SrkToolkit.Web; [Authorize] public class UsersController : Controller { protected override void OnActionExecuting(ActionExecutingContext filterContext) { this.NavigationLine().Add("Users", this.Url.Action("Index")); base.OnActionExecuting(filterContext); } public ActionResult Index(int page = 0, int pageSize = 100) { var model = this.Domain.Users.GetAllSortedById(page, pageSize); this.ViewBag.Count = this.Domain.Users.Count(); return this.View(model); } public ActionResult Details(int id) { this.NavigationLine().Add(id.ToString(), this.Url.Action("Details", new { id = id, })); var model = this.Domain.Users.GetById(id, withPrimaryEmail: true, withEmailAuths: true); model.EmailAddressAuthentications = this.Domain.Users.GetEmailAddressAuthentications(model.Id); return this.View(model); } public ActionResult Edit(int id, UserModel model) { if (id == 0) { if (model == null) model = new UserModel(); this.NavigationLine().Add("Create", this.Url.Action("Edit", new { id = id, })); this.ViewBag.Title = "Create user"; } else { model = this.Domain.Users.GetById(id, withPrimaryEmail: true, withEmailAuths: true); this.NavigationLine().Add(id.ToString(), this.Url.Action("Details", new { id = id, })); this.NavigationLine().Add("Edit", this.Url.Action("Edit", new { id = id, })); this.ViewBag.Title = "Edit user"; } if (this.Request.HttpMethod == "POST" && this.ModelState.IsValid) { var result = this.Domain.Users.Create(model); if (this.ValidateResult(result, MessageDisplayMode.ModelState)) { return this.RedirectToAction("Details", new { id = result.Data.Id, }); } } return this.View(model); } public ActionResult EditEmailAddressAuthentication(int id, int? UserId) { this.NavigationLine().Add(UserId.ToString(), this.Url.Action("Details", new { id = UserId, })); EmailAddressAuthenticationModel model = null; if (id == 0) { if (model == null) model = new EmailAddressAuthenticationModel(); model.UserId = UserId.Value; this.NavigationLine().Add("Create email authentication", this.Url.Action("EditEmailAddressAuthentication", new { id = id, UserId = UserId, })); this.ViewBag.Title = "Create email authentication"; } else { model = this.Domain.Users.GetEmailAddressAuthenticationById(id); this.NavigationLine().Add(id.ToString(), this.Url.Action("Details", new { id = id, })); this.NavigationLine().Add("Edit", this.Url.Action("Edit", new { id = id, })); this.ViewBag.Title = "Edit email authentication"; } return this.View(model); } [HttpPost] public ActionResult EditEmailAddressAuthentication(int id, EmailAddressAuthenticationModel model) { if (model == null) return this.ResultService.NotFound(); this.NavigationLine().Add(model.UserId.ToString(), this.Url.Action("Details", new { id = model.UserId, })); if (model.Id == 0) { if (model == null) model = new EmailAddressAuthenticationModel(); this.NavigationLine().Add("Create email authentication", this.Url.Action("EditEmailAddressAuthentication", new { id = id, UserId = model.UserId, })); this.ViewBag.Title = "Create email authentication"; } else { this.NavigationLine().Add(id.ToString(), this.Url.Action("Details", new { id = id, })); this.NavigationLine().Add("Edit", this.Url.Action("Edit", new { id = id, })); this.ViewBag.Title = "Edit email authentication"; } if (this.ModelState.IsValid) { if (id == 0) { var result = this.Domain.Users.CreateEmailAddressAuthentications(model); if (this.ValidateResult(result, MessageDisplayMode.TempData)) { this.TempData.AddConfirmation("created"); return this.RedirectToAction("Details", new { id = model.UserId, }); } } else { var result = this.Domain.Users.EditEmailAddressAuthentications(model); if (this.ValidateResult(result, MessageDisplayMode.TempData)) { this.TempData.AddConfirmation("updated"); return this.RedirectToAction("Details", new { id = model.UserId, }); } } } return this.View(model); } } }
40.190141
166
0.523042
[ "MPL-2.0" ]
SparkleNetworks/SparkleNetworks
src/Sparkle.WebStatus/Controllers/UsersController.cs
5,709
C#
using System.IO; using IniParser; using IniParser.Model; namespace Launcher { public class Languages { public const string LANGUAGES_LOCATION = "languages/"; private static Languages _Instance = new Languages(); private static readonly object _SyncRoot = new object(); private IniData language, defaultLanguage; public static Languages Instance { get { lock (_SyncRoot) { return _Instance; } } } private Languages() { if (!Directory.Exists(LANGUAGES_LOCATION)) Directory.CreateDirectory(LANGUAGES_LOCATION); var parser = new FileIniDataParser(); language = parser.ReadFile(LANGUAGES_LOCATION + Settings.Instance.Get("Language", "English") + ".ini", System.Text.Encoding.UTF8); defaultLanguage = parser.ReadFile(LANGUAGES_LOCATION + "English.ini", System.Text.Encoding.UTF8); } public string Get(string section, string key) { string result = language[section][key]; if (null == result || result.Equals(string.Empty)) result = defaultLanguage[section][key]; return result.Replace("\\n", "\n"); } } }
29.8
142
0.571216
[ "MIT" ]
LEM-13/Ika
Programs/Launcher/Launcher/Languages.cs
1,343
C#
/* Copyright 2018-present MongoDB Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.IO; using System.Reflection; using FluentAssertions; using MongoDB.Bson.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders { public class MessageBinaryEncoderBaseTests { [Theory] [ParameterAttributeData] public void MaxMessageSize_should_return_expected_result( [Values(null, 1, 2)] int? maxMessageSize) { var encoderSettings = new MessageEncoderSettings(); encoderSettings.Add(MessageEncoderSettingsName.MaxMessageSize, maxMessageSize); var subject = CreateSubject(encoderSettings: encoderSettings); var result = subject.MaxMessageSize(); result.Should().Be(maxMessageSize); } // private methods private MessageBinaryEncoderBase CreateSubject( Stream stream = null, MessageEncoderSettings encoderSettings = null) { stream = stream ?? new MemoryStream(); encoderSettings = encoderSettings ?? new MessageEncoderSettings(); return new FakeMessageBinaryEncoder(stream, encoderSettings); } // nested types private class FakeMessageBinaryEncoder : MessageBinaryEncoderBase { public FakeMessageBinaryEncoder(Stream stream, MessageEncoderSettings encoderSettings) : base(stream, encoderSettings) { } } } public static class MessageBinaryEncoderBaseReflector { public static MessageEncoderSettings _encoderSettings(this MessageBinaryEncoderBase obj) { var fieldInfo = typeof(MessageBinaryEncoderBase).GetField("_encoderSettings", BindingFlags.NonPublic | BindingFlags.Instance); return (MessageEncoderSettings)fieldInfo.GetValue(obj); } public static Stream _stream(this MessageBinaryEncoderBase obj) { var fieldInfo = typeof(MessageBinaryEncoderBase).GetField("_stream", BindingFlags.NonPublic | BindingFlags.Instance); return (Stream)fieldInfo.GetValue(obj); } public static int? MaxMessageSize(this MessageBinaryEncoderBase obj) { var propertyInfo = typeof(MessageBinaryEncoderBase).GetProperty("MaxMessageSize", BindingFlags.NonPublic | BindingFlags.Instance); return (int?)propertyInfo.GetValue(obj); } } }
37.45679
142
0.691826
[ "Apache-2.0" ]
591094733/mongo-csharp-driver
tests/MongoDB.Driver.Core.Tests/Core/WireProtocol/Messages/Encoders/BinaryEncoders/MessageBinaryEncoderBaseTests.cs
3,036
C#
using System.Threading.Tasks; using Xunit; using Verifier = Thinktecture.Runtime.Tests.Verifiers.CodeFixVerifier<Thinktecture.CodeAnalysis.Diagnostics.ThinktectureRuntimeExtensionsAnalyzer, Thinktecture.CodeAnalysis.CodeFixes.ThinktectureRuntimeExtensionsCodeFixProvider>; namespace Thinktecture.Runtime.Tests.AnalyzerAndCodeFixTests { // ReSharper disable once InconsistentNaming public class TTRESG010_NonValidatable_Enum_must_be_class { private const string _DIAGNOSTIC_ID = "TTRESG010"; [Fact] public async Task Should_trigger_if_IEnum_is_struct() { var code = @" using System; using Thinktecture; namespace TestNamespace { public readonly partial struct {|#0:TestEnum|} : IEnum<string> { public static readonly TestEnum Item1 = default; } }"; var expected = Verifier.Diagnostic(_DIAGNOSTIC_ID).WithLocation(0).WithArguments("TestEnum"); await Verifier.VerifyAnalyzerAsync(code, new[] { typeof(IEnum<>).Assembly }, expected); } [Fact] public async Task Should_not_trigger_if_IEnum_is_class() { var code = @" using System; using Thinktecture; namespace TestNamespace { public partial class {|#0:TestEnum|} : IEnum<string> { public static readonly TestEnum Item1 = default; } }"; await Verifier.VerifyAnalyzerAsync(code, new[] { typeof(IEnum<>).Assembly }); } } }
29.1
230
0.701718
[ "BSD-3-Clause" ]
PawelGerr/Thinktecture.Runtime.Extensions
test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/AnalyzerAndCodeFixTests/TTRESG010.cs
1,455
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 mediapackage-vod-2018-11-07.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.MediaPackageVod.Model { /// <summary> /// Container for the parameters to the ListPackagingGroups operation. /// Returns a collection of MediaPackage VOD PackagingGroup resources. /// </summary> public partial class ListPackagingGroupsRequest : AmazonMediaPackageVodRequest { private int? _maxResults; private string _nextToken; /// <summary> /// Gets and sets the property MaxResults. Upper bound on number of records to return. /// </summary> [AWSProperty(Min=1, Max=1000)] public int MaxResults { get { return this._maxResults.GetValueOrDefault(); } set { this._maxResults = value; } } // Check to see if MaxResults property is set internal bool IsSetMaxResults() { return this._maxResults.HasValue; } /// <summary> /// Gets and sets the property NextToken. A token used to resume pagination from the end /// of a previous request. /// </summary> public string NextToken { get { return this._nextToken; } set { this._nextToken = value; } } // Check to see if NextToken property is set internal bool IsSetNextToken() { return this._nextToken != null; } } }
31.319444
114
0.650554
[ "Apache-2.0" ]
NGL321/aws-sdk-net
sdk/src/Services/MediaPackageVod/Generated/Model/ListPackagingGroupsRequest.cs
2,255
C#
using System; using UnityEngine; using UnityEngine.Animations.Rigging; using UnityEditorInternal; namespace UnityEditor.Animations.Rigging { /// <summary> /// Helper class to manage ReorderableList appearance in the editor. /// </summary> public static class ReorderableListHelper { const int k_NoHeaderHeight = 2; const int k_ElementHeightPadding = 2; /// <summary> /// Creates a ReorderableList using a SerializedProperty array as source. /// </summary> /// <param name="obj">SerializedObject owning the SerializedProperty.</param> /// <param name="property">SerializedProperty array.</param> /// <param name="draggable">Toggles whether an object is draggable in the list. True when an object is draggable, false otherwise.</param> /// <param name="displayHeader">Displays the ReorderableList header.</param> /// <returns>Returns a new ReorderableList.</returns> public static ReorderableList Create(SerializedObject obj, SerializedProperty property, bool draggable = true, bool displayHeader = false) { var list = new ReorderableList(obj, property, draggable, displayHeader, true, true); list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { var element = list.serializedProperty.GetArrayElementAtIndex(index); var offset = k_ElementHeightPadding * 0.5f; rect.y += offset; rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.PropertyField(rect, element, GUIContent.none); }; list.elementHeight = EditorGUIUtility.singleLineHeight + k_ElementHeightPadding; if (!displayHeader) list.headerHeight = k_NoHeaderHeight; return list; } } /// <summary> /// Helper class to manage WeightedTransform and WeightedTransformArray appearance in the editor. /// </summary> public static class WeightedTransformHelper { const int k_NoHeaderHeight = 2; const int k_ElementHeightPadding = 2; const int k_TransformPadding = 6; /// <summary> /// Creates a ReorderableList using a WeightedTransformArray as source. /// </summary> /// <param name="property">The serialized property of the WeightedTransformArray.</param> /// <param name="array">The source WeightedTransformArray.</param> /// <param name="range">Range attribute given for weights in WeightedTransform. No boundaries are set if null.</param> /// <param name="draggable">Toggles whether a WeightedTransform is draggable in the list. True when WeightedTransform is draggable, false otherwise.</param> /// <param name="displayHeader">Displays the ReorderableList header.</param> /// <returns>Returns a new ReorderableList for a WeightedTransformArray.</returns> public static ReorderableList CreateReorderableList(SerializedProperty property, ref WeightedTransformArray array, RangeAttribute range = null, bool draggable = true, bool displayHeader = false) { var reorderableList = new ReorderableList(array, typeof(WeightedTransform), draggable, displayHeader, true, true); reorderableList.drawElementBackgroundCallback = (Rect rect, int index, bool isActive, bool isFocused) => { // Didn't find a way to register a callback before we repaint the reorderable list to toggle draggable flag. // Ideally, we'd need a callback canReorderElementCallback that would enable/disable draggable handle. reorderableList.draggable = !AnimationMode.InAnimationMode() && !Application.isPlaying; ReorderableList.defaultBehaviours.DrawElementBackground(rect, index, isActive, isFocused, reorderableList.draggable); }; reorderableList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { var element = property.FindPropertyRelative("m_Item" + index); var offset = k_ElementHeightPadding * 0.5f; rect.y += offset; rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.BeginChangeCheck(); WeightedTransformOnGUI(rect, element, range); if (EditorGUI.EndChangeCheck()) { var transformProperty = element.FindPropertyRelative("transform"); var weightProperty = element.FindPropertyRelative("weight"); reorderableList.list[index] = new WeightedTransform(transformProperty.objectReferenceValue as Transform, weightProperty.floatValue);; } }; reorderableList.onCanAddCallback = (ReorderableList list) => { return list.list.Count < WeightedTransformArray.k_MaxLength && !AnimationMode.InAnimationMode() && !Application.isPlaying; }; reorderableList.onCanRemoveCallback = (ReorderableList list) => { return !AnimationMode.InAnimationMode() && !Application.isPlaying; }; reorderableList.onAddCallback = (ReorderableList list) => { list.list.Add(WeightedTransform.Default(1f)); }; reorderableList.elementHeight = EditorGUIUtility.singleLineHeight + k_ElementHeightPadding; if (!displayHeader) reorderableList.headerHeight = k_NoHeaderHeight; return reorderableList; } /// <summary> /// Display a single WeightedTransform in the editor. /// </summary> /// <param name="rect">Rectangle on the screen to use for the WeightedTransform.</param> /// <param name="property">Serialized property </param> /// <param name="range">Range attribute given for weights in WeightedTransform. No boundaries are set if null.</param> public static void WeightedTransformOnGUI(Rect rect, SerializedProperty property, RangeAttribute range = null) { EditorGUI.BeginProperty(rect, GUIContent.none, property); var w = rect.width * 0.65f; var weightRect = new Rect(rect.x + w, rect.y, rect.width - w, rect.height); rect.width = w; var transformRect = new Rect(rect.x, rect.y, rect.width - k_TransformPadding, EditorGUIUtility.singleLineHeight); EditorGUI.BeginChangeCheck(); EditorGUI.PropertyField(transformRect, property.FindPropertyRelative("transform"), GUIContent.none); var indentLvl = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; if (range != null) EditorGUI.Slider(weightRect, property.FindPropertyRelative("weight"), range.min, range.max, GUIContent.none); else EditorGUI.PropertyField(weightRect, property.FindPropertyRelative("weight"), GUIContent.none); EditorGUI.indentLevel = indentLvl; if (EditorGUI.EndChangeCheck()) property.serializedObject.ApplyModifiedProperties(); EditorGUI.EndProperty(); } } internal static class MaintainOffsetHelper { static readonly string[] k_MaintainOffsetTypeLables = { "None", "Position and Rotation", "Position", "Rotation"}; static readonly int[] k_BitsToIndex = new int[] {0, 2, 3, 1}; static readonly int[] k_IndexToBits = new int[] {0, 3, 1, 2}; public static void DoDropdown(GUIContent label, SerializedProperty maintainPosition, SerializedProperty maintainRotation) { int currIndex = k_BitsToIndex[System.Convert.ToInt32(maintainPosition.boolValue) | (System.Convert.ToInt32(maintainRotation.boolValue) << 1)]; int newIndex = EditorGUILayout.Popup(label, currIndex, k_MaintainOffsetTypeLables); if (newIndex == currIndex) return; var bits = k_IndexToBits[newIndex]; maintainPosition.boolValue = (bits & 0x1) != 0; maintainRotation.boolValue = (bits & 0x2) != 0; } } internal static class EditorHelper { private const string EditorFolder = "Packages/com.unity.animation.rigging/Editor/"; private const string ShadersFolder = EditorFolder + "Shaders/"; private const string ShapesFolder = EditorFolder + "Shapes/"; public static Shader LoadShader(string filename) { return AssetDatabase.LoadAssetAtPath<Shader>(ShadersFolder + filename); } public static Mesh LoadShape(string filename) { return AssetDatabase.LoadAssetAtPath<Mesh>(ShapesFolder + filename); } public static T GetClosestComponent<T>(Transform transform, Transform root = null) { if (transform == null) return default(T); var top = (root != null) ? root : transform.root; while (true) { if (transform.GetComponent<T>() != null) return transform.GetComponent<T>(); if (transform == top) break; transform = transform.parent; } return default(T); } public static void HandleClickSelection(GameObject gameObject, Event evt) { if (evt.shift || EditorGUI.actionKey) { UnityEngine.Object[] existingSelection = Selection.objects; // For shift, we check if EXACTLY the active GO is hovered by mouse and then subtract. Otherwise additive. // For control/cmd, we check if ANY of the selected GO is hovered by mouse and then subtract. Otherwise additive. // Control/cmd takes priority over shift. bool subtractFromSelection = EditorGUI.actionKey ? Selection.Contains(gameObject) : Selection.activeGameObject == gameObject; if (subtractFromSelection) { // subtract from selection var newSelection = new UnityEngine.Object[existingSelection.Length - 1]; int index = Array.IndexOf(existingSelection, gameObject); System.Array.Copy(existingSelection, newSelection, index); System.Array.Copy(existingSelection, index + 1, newSelection, index, newSelection.Length - index); Selection.objects = newSelection; } else { // add to selection var newSelection = new UnityEngine.Object[existingSelection.Length + 1]; System.Array.Copy(existingSelection, newSelection, existingSelection.Length); newSelection[existingSelection.Length] = gameObject; Selection.objects = newSelection; } } else Selection.activeObject = gameObject; } } }
45.453061
202
0.62958
[ "CC0-1.0" ]
ewanreis/fmp-v1
fmp/Library/PackageCache/com.unity.animation.rigging@1.0.3/Editor/Utils/EditorHelpers.cs
11,136
C#
using NUnit.Framework; using System.Drawing; using Vanara.InteropServices; namespace Vanara.PInvoke.Tests { [TestFixture()] public class SIZETests { [Test()] public void SIZETest() { using (var h = SafeHGlobalHandle.CreateFromStructure(new SIZE(1, 2))) { var sz = h.ToStructure<SIZE>(); Assert.That(sz.cx == 1); Assert.That(sz.cy == 2); Size ms = sz; Assert.That(ms, Is.EqualTo(new Size(1,2))); SIZE sz2 = ms; Assert.That(sz2, Is.EqualTo(sz)); } } [TestCase(1, 1, 2, 2, false)] [TestCase(1, 1, 1, 1, true)] [TestCase(0, 0, 0, 0, true)] [TestCase(-1, -1, -1, -1, true)] [TestCase(-1, -1, 1, 1, false)] public void SIZEEqualityTest(int cx1, int cy1, int cx2, int cy2, bool eq) { var sz1 = new SIZE(cx1, cy1); var sz2 = new SIZE(cx2, cy2); Assert.That(sz1 == sz2, Is.EqualTo(eq)); Assert.That(sz1 != sz2, Is.Not.EqualTo(eq)); Assert.That(sz1.Equals(sz2), Is.EqualTo(eq)); var size2 = new Size(cx2, cy2); Assert.That(sz1.Equals(size2), Is.EqualTo(eq)); Assert.That(sz1.Equals((object)sz2), Is.EqualTo(eq)); Assert.That(sz1.Equals((object)size2), Is.EqualTo(eq)); Assert.That(sz1.Equals(cy2), Is.False); Assert.That(sz2.ToSize(), Is.EqualTo(size2)); Assert.That(sz2.GetHashCode(), Is.EqualTo(new SIZE(cx2, cy2).GetHashCode())); Assert.That(sz1.IsEmpty, Is.EqualTo(cx1 == 0 && cy1 == 0)); Assert.That(sz1.ToString(), Is.EqualTo($"{{cx={sz1.cx}, cy={sz1.cy}}}")); } } }
30.061224
80
0.625255
[ "MIT" ]
AndreGleichner/Vanara
UnitTests/PInvoke/Shared/WinDef/SIZETests.cs
1,475
C#
using System.Collections.Generic; using AllReady.Areas.Admin.ViewModels.Campaign; using MediatR; namespace AllReady.Areas.Admin.Features.Campaigns { public class CampaignListQuery : IRequest<IEnumerable<CampaignSummaryViewModel>> { public int? OrganizationId { get; set; } } }
25.916667
85
0.726688
[ "MIT" ]
digitaldrummerj-ionic/allReady
AllReadyApp/Web-App/AllReady/Areas/Admin/Features/Campaigns/CampaignListQuery.cs
313
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using Agent.Worker.Release; using Microsoft.TeamFoundation.DistributedTask.WebApi; using Microsoft.VisualStudio.Services.Agent.Util; using Microsoft.VisualStudio.Services.ReleaseManagement.WebApi.Contracts; using Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts; using Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.Definition; using Newtonsoft.Json; using Microsoft.TeamFoundation.DistributedTask.Pipelines; namespace Microsoft.VisualStudio.Services.Agent.Worker.Release { public class ReleaseJobExtension : JobExtension { private const string DownloadArtifactsFailureSystemError = "DownloadArtifactsFailureSystemError"; private const string DownloadArtifactsFailureUserError = "DownloadArtifactsFailureUserError"; private static readonly Guid DownloadArtifactsTaskId = new Guid("B152FEAA-7E65-43C9-BCC4-07F6883EE793"); private int ReleaseId { get; set; } private Guid TeamProjectId { get; set; } private string ReleaseWorkingFolder { get; set; } private string ArtifactsWorkingFolder { get; set; } private bool SkipArtifactsDownload { get; set; } private IList<AgentArtifactDefinition> ReleaseArtifacts { get; set; } = new List<AgentArtifactDefinition>(); public override Type ExtensionType => typeof(IJobExtension); public override HostTypes HostType => HostTypes.Release; public override IStep GetExtensionPreJobStep(IExecutionContext jobContext) { if (ReleaseArtifacts.Any()) { return new JobExtensionRunner( runAsync: DownloadArtifactsAndCommitsAsync, condition: ExpressionManager.Succeeded, displayName: StringUtil.Loc("DownloadArtifacts"), data: null); } return null; } public override IStep GetExtensionPostJobStep(IExecutionContext jobContext) { return null; } public override string GetRootedPath(IExecutionContext context, string path) { string rootedPath = null; if (!string.IsNullOrEmpty(path) && path.IndexOfAny(Path.GetInvalidPathChars()) < 0 && Path.IsPathRooted(path)) { try { rootedPath = Path.GetFullPath(path); Trace.Info($"Path resolved by source provider is a rooted path, return absolute path: {rootedPath}"); return rootedPath; } catch (Exception ex) { Trace.Info($"Path resolved is a rooted path, but it is not fully qualified, return the path: {path}"); Trace.Error(ex); return path; } } string artifactRootPath = context.Variables.Release_ArtifactsDirectory ?? string.Empty; Trace.Info($"Artifact root path is system.artifactsDirectory: {artifactRootPath}"); if (!string.IsNullOrEmpty(artifactRootPath) && artifactRootPath.IndexOfAny(Path.GetInvalidPathChars()) < 0 && path != null && path.IndexOfAny(Path.GetInvalidPathChars()) < 0) { path = Path.Combine(artifactRootPath, path); Trace.Info($"After prefix Artifact Path Root provide by JobExtension: {path}"); if (Path.IsPathRooted(path)) { try { rootedPath = Path.GetFullPath(path); Trace.Info($"Return absolute path after prefix ArtifactPathRoot: {rootedPath}"); return rootedPath; } catch (Exception ex) { Trace.Info($"After prefix Artifact Path Root provide by JobExtension. The Path is a rooted path, but it is not fully qualified, return the path: {path}"); Trace.Error(ex); return path; } } } return rootedPath; } public override void ConvertLocalPath(IExecutionContext context, string localPath, out string repoName, out string sourcePath) { Trace.Info($"Received localpath {localPath}"); repoName = string.Empty; sourcePath = string.Empty; } private async Task DownloadArtifactsAndCommitsAsync(IExecutionContext executionContext, object data) { Trace.Entering(); try { await DownloadArtifacts(executionContext, ReleaseArtifacts, ArtifactsWorkingFolder); await DownloadCommits(executionContext, TeamProjectId, ReleaseArtifacts); } catch (Exception ex) { LogDownloadFailureTelemetry(executionContext, ex); throw; } } private IList<AgentArtifactDefinition> GetReleaseArtifacts(IExecutionContext executionContext) { try { var connection = WorkerUtilities.GetVssConnection(executionContext); var releaseServer = new ReleaseServer(connection, TeamProjectId); IList<AgentArtifactDefinition> releaseArtifacts = releaseServer.GetReleaseArtifactsFromService(ReleaseId).ToList(); IList<AgentArtifactDefinition> filteredReleaseArtifacts = FilterArtifactDefintions(releaseArtifacts); filteredReleaseArtifacts.ToList().ForEach(x => Trace.Info($"Found Artifact = {x.Alias} of type {x.ArtifactType}")); return filteredReleaseArtifacts; } catch (Exception ex) { LogDownloadFailureTelemetry(executionContext, ex); throw; } } private async Task DownloadCommits( IExecutionContext executionContext, Guid teamProjectId, IList<AgentArtifactDefinition> agentArtifactDefinitions) { Trace.Entering(); Trace.Info("Creating commit work folder"); string commitsWorkFolder = GetCommitsWorkFolder(executionContext); // Note: We are having an explicit type here. For other artifact types we are planning to go with tasks // Only for jenkins we are making the agent to download var extensionManager = HostContext.GetService<IExtensionManager>(); JenkinsArtifact jenkinsExtension = (extensionManager.GetExtensions<IArtifactExtension>()).FirstOrDefault(x => x.ArtifactType == AgentArtifactType.Jenkins) as JenkinsArtifact; foreach (AgentArtifactDefinition agentArtifactDefinition in agentArtifactDefinitions) { if (agentArtifactDefinition.ArtifactType == AgentArtifactType.Jenkins) { Trace.Info($"Found supported artifact {agentArtifactDefinition.Alias} for downloading commits"); ArtifactDefinition artifactDefinition = ConvertToArtifactDefinition(agentArtifactDefinition, executionContext, jenkinsExtension); await jenkinsExtension.DownloadCommitsAsync(executionContext, artifactDefinition, commitsWorkFolder); } } } private string GetCommitsWorkFolder(IExecutionContext context) { string commitsRootDirectory = Path.Combine(ReleaseWorkingFolder, Constants.Release.Path.ReleaseTempDirectoryPrefix, Constants.Release.Path.CommitsDirectory); Trace.Info($"Ensuring commit work folder {commitsRootDirectory} exists"); var releaseFileSystemManager = HostContext.GetService<IReleaseFileSystemManager>(); releaseFileSystemManager.EnsureDirectoryExists(commitsRootDirectory); return commitsRootDirectory; } private async Task DownloadArtifacts(IExecutionContext executionContext, IList<AgentArtifactDefinition> agentArtifactDefinitions, string artifactsWorkingFolder) { Trace.Entering(); CreateArtifactsFolder(executionContext, artifactsWorkingFolder); executionContext.Output(StringUtil.Loc("RMDownloadingArtifact")); foreach (AgentArtifactDefinition agentArtifactDefinition in agentArtifactDefinitions) { // We don't need to check if its old style artifact anymore. All the build data has been fixed and all the build artifact has Alias now. ArgUtil.NotNullOrEmpty(agentArtifactDefinition.Alias, nameof(agentArtifactDefinition.Alias)); var extensionManager = HostContext.GetService<IExtensionManager>(); IArtifactExtension extension = (extensionManager.GetExtensions<IArtifactExtension>()).FirstOrDefault(x => agentArtifactDefinition.ArtifactType == x.ArtifactType); if (extension == null) { throw new InvalidOperationException(StringUtil.Loc("RMArtifactTypeNotSupported", agentArtifactDefinition.ArtifactType)); } Trace.Info($"Found artifact extension of type {extension.ArtifactType}"); executionContext.Output(StringUtil.Loc("RMStartArtifactsDownload")); ArtifactDefinition artifactDefinition = ConvertToArtifactDefinition(agentArtifactDefinition, executionContext, extension); executionContext.Output(StringUtil.Loc("RMArtifactDownloadBegin", agentArtifactDefinition.Alias, agentArtifactDefinition.ArtifactType)); // Get the local path where this artifact should be downloaded. string downloadFolderPath = Path.GetFullPath(Path.Combine(artifactsWorkingFolder, agentArtifactDefinition.Alias ?? string.Empty)); // download the artifact to this path. RetryExecutor retryExecutor = new RetryExecutor(); retryExecutor.ShouldRetryAction = (ex) => { executionContext.Output(StringUtil.Loc("RMErrorDuringArtifactDownload", ex)); bool retry = true; if (ex is ArtifactDownloadException) { retry = false; } else { executionContext.Output(StringUtil.Loc("RMRetryingArtifactDownload")); Trace.Warning(ex.ToString()); } return retry; }; await retryExecutor.ExecuteAsync( async () => { var releaseFileSystemManager = HostContext.GetService<IReleaseFileSystemManager>(); executionContext.Output(StringUtil.Loc("RMEnsureArtifactFolderExistsAndIsClean", downloadFolderPath)); releaseFileSystemManager.EnsureEmptyDirectory(downloadFolderPath, executionContext.CancellationToken); await extension.DownloadAsync(executionContext, artifactDefinition, downloadFolderPath); }); executionContext.Output(StringUtil.Loc("RMArtifactDownloadFinished", agentArtifactDefinition.Alias)); } executionContext.Output(StringUtil.Loc("RMArtifactsDownloadFinished")); } private void CreateArtifactsFolder(IExecutionContext executionContext, string artifactsWorkingFolder) { Trace.Entering(); RetryExecutor retryExecutor = new RetryExecutor(); retryExecutor.ShouldRetryAction = (ex) => { executionContext.Output(StringUtil.Loc("RMRetryingCreatingArtifactsDirectory", artifactsWorkingFolder, ex)); Trace.Error(ex); return true; }; retryExecutor.Execute( () => { executionContext.Output(StringUtil.Loc("RMCreatingArtifactsDirectory", artifactsWorkingFolder)); var releaseFileSystemManager = HostContext.GetService<IReleaseFileSystemManager>(); releaseFileSystemManager.EnsureEmptyDirectory(artifactsWorkingFolder, executionContext.CancellationToken); }); executionContext.Output(StringUtil.Loc("RMCreatedArtifactsDirectory", artifactsWorkingFolder)); } public override void InitializeJobExtension(IExecutionContext executionContext, IList<JobStep> steps, WorkspaceOptions workspace) { Trace.Entering(); ArgUtil.NotNull(executionContext, nameof(executionContext)); executionContext.Output(StringUtil.Loc("PrepareReleasesDir")); var directoryManager = HostContext.GetService<IReleaseDirectoryManager>(); ReleaseId = executionContext.Variables.GetInt(Constants.Variables.Release.ReleaseId) ?? 0; TeamProjectId = executionContext.Variables.GetGuid(Constants.Variables.System.TeamProjectId) ?? Guid.Empty; SkipArtifactsDownload = executionContext.Variables.GetBoolean(Constants.Variables.Release.SkipArtifactsDownload) ?? false; string releaseDefinitionName = executionContext.Variables.Get(Constants.Variables.Release.ReleaseDefinitionName); // TODO: Should we also write to log in executionContext.Output methods? so that we don't have to repeat writing into logs? // Log these values here to debug scenarios where downloading the artifact fails. executionContext.Output($"ReleaseId={ReleaseId}, TeamProjectId={TeamProjectId}, ReleaseDefinitionName={releaseDefinitionName}"); var releaseDefinition = executionContext.Variables.Get(Constants.Variables.Release.ReleaseDefinitionId); if (string.IsNullOrEmpty(releaseDefinition)) { string pattern = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars()); Regex regex = new Regex(string.Format("[{0}]", Regex.Escape(pattern))); releaseDefinition = regex.Replace(releaseDefinitionName, string.Empty); } var releaseTrackingConfig = directoryManager.PrepareArtifactsDirectory( HostContext.GetDirectory(WellKnownDirectory.Work), executionContext.Variables.System_CollectionId, executionContext.Variables.System_TeamProjectId.ToString(), releaseDefinition); ReleaseWorkingFolder = releaseTrackingConfig.ReleaseDirectory; ArtifactsWorkingFolder = Path.Combine( HostContext.GetDirectory(WellKnownDirectory.Work), releaseTrackingConfig.ReleaseDirectory, Constants.Release.Path.ArtifactsDirectory); executionContext.Output($"Release folder: {ArtifactsWorkingFolder}"); // Ensure directory exist if (!Directory.Exists(ArtifactsWorkingFolder)) { Trace.Info($"Creating {ArtifactsWorkingFolder}."); Directory.CreateDirectory(ArtifactsWorkingFolder); } SetLocalVariables(executionContext, ArtifactsWorkingFolder); // Log the environment variables available after populating the variable service with our variables LogEnvironmentVariables(executionContext); if (SkipArtifactsDownload) { // If this is the first time the agent is executing a task, we need to create the artifactsFolder // otherwise Process.StartWithCreateProcess() will fail with the error "The directory name is invalid" // because the working folder doesn't exist CreateWorkingFolderIfRequired(executionContext, ArtifactsWorkingFolder); // log the message that the user chose to skip artifact download and move on executionContext.Output(StringUtil.Loc("RMUserChoseToSkipArtifactDownload")); Trace.Info("Skipping artifact download based on the setting specified."); } else { ReleaseArtifacts = GetReleaseArtifacts(executionContext); if (!ReleaseArtifacts.Any()) { CreateArtifactsFolder(executionContext, ArtifactsWorkingFolder); Trace.Info("No artifacts found to be downloaded by agent."); } } CheckForAvailableDiskSpace(executionContext); } private void CheckForAvailableDiskSpace(IExecutionContext executionContext) { try { var root = Path.GetPathRoot(ArtifactsWorkingFolder); foreach (var drive in DriveInfo.GetDrives()) { if (string.Equals(root, drive.Name, StringComparison.OrdinalIgnoreCase)) { var availableSpaceInMB = drive.AvailableFreeSpace / (1024 * 1024); if (availableSpaceInMB < 100) { executionContext.Warning(StringUtil.Loc("RMLowAvailableDiskSpace", root)); } break; } } } catch (Exception ex) { // ignore any exceptions during checking for free disk space Trace.Error("Failed to check for available disk space: " + ex); } } private void SetLocalVariables(IExecutionContext executionContext, string artifactsDirectoryPath) { Trace.Entering(); // Always set the AgentReleaseDirectory because this is set as the WorkingDirectory of the task. executionContext.Variables.Set(Constants.Variables.Release.AgentReleaseDirectory, artifactsDirectoryPath); // Set the ArtifactsDirectory even when artifacts downloaded is skipped. Reason: The task might want to access the old artifact. executionContext.Variables.Set(Constants.Variables.Release.ArtifactsDirectory, artifactsDirectoryPath); executionContext.Variables.Set(Constants.Variables.System.DefaultWorkingDirectory, artifactsDirectoryPath); } private void LogEnvironmentVariables(IExecutionContext executionContext) { Trace.Entering(); string stringifiedEnvironmentVariables = AgentUtilities.GetPrintableEnvironmentVariables(executionContext.Variables.Public); // Use LogMessage to ensure that the logs reach the TWA UI, but don't spam the console cmd window executionContext.Output(StringUtil.Loc("RMEnvironmentVariablesAvailable", stringifiedEnvironmentVariables)); } private void CreateWorkingFolderIfRequired(IExecutionContext executionContext, string artifactsFolderPath) { Trace.Entering(); if (!Directory.Exists(artifactsFolderPath)) { executionContext.Output($"Creating artifacts folder: {artifactsFolderPath}"); Directory.CreateDirectory(artifactsFolderPath); } } private ArtifactDefinition ConvertToArtifactDefinition(AgentArtifactDefinition agentArtifactDefinition, IExecutionContext executionContext, IArtifactExtension extension) { Trace.Entering(); ArgUtil.NotNull(agentArtifactDefinition, nameof(agentArtifactDefinition)); ArgUtil.NotNull(executionContext, nameof(executionContext)); var artifactDefinition = new ArtifactDefinition { ArtifactType = agentArtifactDefinition.ArtifactType, Name = agentArtifactDefinition.Name, Version = agentArtifactDefinition.Version }; artifactDefinition.Details = extension.GetArtifactDetails(executionContext, agentArtifactDefinition); return artifactDefinition; } private void LogDownloadFailureTelemetry(IExecutionContext executionContext, Exception ex) { var code = (ex is ArtifactDownloadException || ex is ArtifactDirectoryCreationFailedException || ex is IOException || ex is UnauthorizedAccessException) ? DownloadArtifactsFailureUserError : DownloadArtifactsFailureSystemError; var issue = new Issue { Type = IssueType.Error, Message = StringUtil.Loc("DownloadArtifactsFailed", ex) }; issue.Data.Add("AgentVersion", Constants.Agent.Version); issue.Data.Add("code", code); issue.Data.Add("TaskId", DownloadArtifactsTaskId.ToString()); executionContext.AddIssue(issue); } private IList<AgentArtifactDefinition> FilterArtifactDefintions(IList<AgentArtifactDefinition> agentArtifactDefinitions) { var definitions = new List<AgentArtifactDefinition>(); foreach (var agentArtifactDefinition in agentArtifactDefinitions) { if (agentArtifactDefinition.ArtifactType != AgentArtifactType.Custom) { definitions.Add(agentArtifactDefinition); } else { string artifactType = string.Empty; var artifactDetails = JsonConvert.DeserializeObject<Dictionary<string, string>>(agentArtifactDefinition.Details); if (artifactDetails.TryGetValue("ArtifactType", out artifactType)) { if (artifactType == null || artifactType.Equals("Build", StringComparison.OrdinalIgnoreCase)) { definitions.Add(agentArtifactDefinition); } } else { definitions.Add(agentArtifactDefinition); } } } return definitions; } } }
46.812371
186
0.623282
[ "MIT" ]
Cristie/vsts-agent
src/Agent.Worker/Release/ReleaseJobExtension.cs
22,704
C#
namespace Cafebabe.Attribute; public record JavaParameterAnnotation(JavaAnnotation[] Annotations);
33.333333
68
0.86
[ "MIT" ]
Parzivail-Modding-Team/ModelPainter
Cafebabe/Attribute/JavaParameterAnnotation.cs
102
C#
using RiotSharp.Misc; using System; using System.Collections.Generic; using System.Text; namespace RiotSharp.Endpoints.StaticDataEndpoint.ReforgedRune.Cache { class ReforgedRunePathListStaticWrapper { public Language Language { get; set; } public string Version { get; set; } public List<ReforgedRunePathStatic> ReforgedRunePaths { get; set; } public ReforgedRunePathListStaticWrapper(Language language, string version, List<ReforgedRunePathStatic> reforgedRunePaths) { Language = language; Version = version; ReforgedRunePaths = reforgedRunePaths; } public bool Validate(Language language, string version) { return Language == language && Version == version; } } }
28.678571
131
0.671233
[ "MIT" ]
Vertana/RiotSharp
RiotSharp/Endpoints/StaticDataEndpoint/ReforgedRune/Cache/ReforgedRunePathListStaticWrapper.cs
805
C#
using System.Reflection; 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("Crown")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Crown")] [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("ac6b749b-b65d-46be-938d-95195dac15e8")] // 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.194444
84
0.741598
[ "MIT" ]
pirocorp/Programming-Basics
Draw-with-Loops/Crown/Properties/AssemblyInfo.cs
1,342
C#
#nullable disable using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using VocaDb.Model.Helpers; namespace VocaDb.Tests.Helpers { [TestClass] public class RelatedSitesHelperTests { private void TestRelatedSite(bool expected, string url) { var result = RelatedSitesHelper.IsRelatedSite(url); result.Should().Be(expected, url); } [TestMethod] public void IsRelatedSite_NoMatch() { TestRelatedSite(false, "http://google.com"); } [TestMethod] public void IsRelatedSite_NoMatch2() { TestRelatedSite(false, "https://www5.atwiki.jp/hmiku/pages/37501.html"); } [TestMethod] public void IsRelatedSite_MatchHttp() { TestRelatedSite(true, "http://vocadb.net/S/3939"); } [TestMethod] public void IsRelatedSite_MatchHttps() { TestRelatedSite(true, "https://vocadb.net/S/3939"); } } }
21.023256
76
0.690265
[ "MIT" ]
AgFlore/vocadb
Tests/Helpers/RelatedSitesHelperTests.cs
904
C#