content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
using System;
using System.Globalization;
using System.Windows.Media;
using NLog;
namespace NLogWpfLoggerTarget.ViewModel
{
public class LoggerTargetViewModel
{
public SolidColorBrush BackgroundColorBrush { get; }
public SolidColorBrush BackgroundColorBrushMouseOver { get; }
public Exception Exception { get; }
public SolidColorBrush ForegroundColorBrush { get; set; }
public SolidColorBrush ForegroundColorBrushMouseOver { get; }
public String FormattedMessage { get; }
public String Level { get; }
public String LoggerName { get; }
public String Time { get; }
public String ToolTip { get; }
public LoggerTargetViewModel(LogEventInfo logEventInfo)
{
ToolTip = logEventInfo.FormattedMessage;
Level = logEventInfo.Level.ToString();
FormattedMessage = logEventInfo.FormattedMessage;
Exception = logEventInfo.Exception;
LoggerName = logEventInfo.LoggerName;
Time = logEventInfo.TimeStamp.ToString(CultureInfo.InvariantCulture);
//Setup Colors
ForegroundColorBrush = Brushes.Black;
ForegroundColorBrushMouseOver = Brushes.Black;
BackgroundColorBrush = GetBackgroundColor(logEventInfo.Level);
BackgroundColorBrushMouseOver = Brushes.LightSkyBlue;
}
protected SolidColorBrush GetBackgroundColor(LogLevel logLevel)
{
if (LogLevel.Warn.Equals(logLevel)) return Brushes.Yellow;
if (LogLevel.Error.Equals(logLevel) || LogLevel.Fatal.Equals(logLevel)) return Brushes.Red;
if (LogLevel.Trace.Equals(logLevel)) return Brushes.Fuchsia;
return LogLevel.Debug.Equals(logLevel) ? Brushes.LightGreen : Brushes.White;
}
}
}
| 39.234043 | 103 | 0.669197 | [
"MIT"
] | slessardjr/NLogWpfLoggerTarget | NLogWpfLoggerTarget/ViewModel/LoggerTargetViewModel.cs | 1,846 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*============================================================
**
**
**
** Purpose: An exception for OS 'access denied' types of
** errors, including IO and limited security types
** of errors.
**
**
===========================================================*/
using System.Runtime.Serialization;
namespace System
{
// The UnauthorizedAccessException is thrown when access errors
// occur from IO or other OS methods.
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class UnauthorizedAccessException : SystemException
{
public UnauthorizedAccessException()
: base(SR.Arg_UnauthorizedAccessException)
{
HResult = HResults.COR_E_UNAUTHORIZEDACCESS;
}
public UnauthorizedAccessException(string? message)
: base(message)
{
HResult = HResults.COR_E_UNAUTHORIZEDACCESS;
}
public UnauthorizedAccessException(string? message, Exception? inner)
: base(message, inner)
{
HResult = HResults.COR_E_UNAUTHORIZEDACCESS;
}
protected UnauthorizedAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
| 31.734694 | 134 | 0.61865 | [
"MIT"
] | 06needhamt/runtime | src/libraries/System.Private.CoreLib/src/System/UnauthorizedAccessException.cs | 1,555 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeGeneration;
using Microsoft.CodeAnalysis.DocumentationComments;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Formatting.Rules;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Simplification;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.MetadataAsSource
{
internal abstract partial class AbstractMetadataAsSourceService : IMetadataAsSourceService
{
private readonly ICodeGenerationService _codeGenerationService;
protected AbstractMetadataAsSourceService(ICodeGenerationService codeGenerationService)
{
_codeGenerationService = codeGenerationService;
}
public async Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken)
{
if (document == null)
{
throw new ArgumentNullException(nameof(document));
}
var newSemanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
var rootNamespace = newSemanticModel.GetEnclosingNamespace(0, cancellationToken);
// Add the interface of the symbol to the top of the root namespace
document = await CodeGenerator.AddNamespaceOrTypeDeclarationAsync(
document.Project.Solution,
rootNamespace,
CreateCodeGenerationSymbol(document, symbol),
CreateCodeGenerationOptions(newSemanticModel.SyntaxTree.GetLocation(new TextSpan()), symbol),
cancellationToken).ConfigureAwait(false);
document = await RemoveSimplifierAnnotationsFromImportsAsync(document, cancellationToken).ConfigureAwait(false);
var docCommentFormattingService = document.GetLanguageService<IDocumentationCommentFormattingService>();
var docWithDocComments = await ConvertDocCommentsToRegularCommentsAsync(document, docCommentFormattingService, cancellationToken).ConfigureAwait(false);
var docWithAssemblyInfo = await AddAssemblyInfoRegionAsync(docWithDocComments, symbolCompilation, symbol.GetOriginalUnreducedDefinition(), cancellationToken).ConfigureAwait(false);
var node = await docWithAssemblyInfo.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var formattedDoc = await Formatter.FormatAsync(
docWithAssemblyInfo, SpecializedCollections.SingletonEnumerable(node.FullSpan), options: null, rules: GetFormattingRules(docWithAssemblyInfo), cancellationToken: cancellationToken).ConfigureAwait(false);
var reducers = GetReducers();
return await Simplifier.ReduceAsync(formattedDoc, reducers, null, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <see cref="ImportAdderService"/> adds <see cref="Simplifier.Annotation"/> to Import Directives it adds,
/// which causes the <see cref="Simplifier"/> to remove import directives when thety are only used by attributes.
/// Presumably this is because MetadataAsSource isn't actually semantically valid code.
///
/// To fix this we remove these annotations.
/// </summary>
private static async Task<Document> RemoveSimplifierAnnotationsFromImportsAsync(Document document, CancellationToken cancellationToken)
{
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
var importDirectives = (await document.GetSyntaxRootAsync().ConfigureAwait(false))
.DescendantNodesAndSelf()
.Where(syntaxFacts.IsUsingOrExternOrImport);
return await document.ReplaceNodesAsync(
importDirectives,
(o, c) => c.WithoutAnnotations(Simplifier.Annotation),
cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// provide formatting rules to be used when formatting MAS file
/// </summary>
protected abstract IEnumerable<AbstractFormattingRule> GetFormattingRules(Document document);
/// <summary>
/// Prepends a region directive at the top of the document with a name containing
/// information about the assembly and a comment inside containing the path to the
/// referenced assembly. The containing assembly may not have a path on disk, in which case
/// a string similar to "location unknown" will be placed in the comment inside the region
/// instead of the path.
/// </summary>
/// <param name="document">The document to generate source into</param>
/// <param name="symbolCompilation">The <see cref="Compilation"/> in which symbol is resolved.</param>
/// <param name="symbol">The symbol to generate source for</param>
/// <param name="cancellationToken">To cancel document operations</param>
/// <returns>The updated document</returns>
protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken);
protected abstract Task<Document> ConvertDocCommentsToRegularCommentsAsync(Document document, IDocumentationCommentFormattingService docCommentFormattingService, CancellationToken cancellationToken);
protected abstract ImmutableArray<AbstractReducer> GetReducers();
private static INamespaceOrTypeSymbol CreateCodeGenerationSymbol(Document document, ISymbol symbol)
{
symbol = symbol.GetOriginalUnreducedDefinition();
var topLevelNamespaceSymbol = symbol.ContainingNamespace;
var topLevelNamedType = MetadataAsSourceHelpers.GetTopLevelContainingNamedType(symbol);
var canImplementImplicitly = document.GetLanguageService<ISemanticFactsService>().SupportsImplicitInterfaceImplementation;
var docCommentFormattingService = document.GetLanguageService<IDocumentationCommentFormattingService>();
INamespaceOrTypeSymbol wrappedType = new WrappedNamedTypeSymbol(topLevelNamedType, canImplementImplicitly, docCommentFormattingService);
return topLevelNamespaceSymbol.IsGlobalNamespace
? wrappedType
: CodeGenerationSymbolFactory.CreateNamespaceSymbol(
topLevelNamespaceSymbol.ToDisplayString(SymbolDisplayFormats.NameFormat),
null,
new[] { wrappedType });
}
private static CodeGenerationOptions CreateCodeGenerationOptions(Location contextLocation, ISymbol symbol)
{
return new CodeGenerationOptions(
contextLocation: contextLocation,
generateMethodBodies: false,
generateDocumentationComments: true,
mergeAttributes: false,
autoInsertionLocation: false);
}
}
}
| 53.827338 | 219 | 0.722267 | [
"Apache-2.0"
] | HenrikWM/roslyn | src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.cs | 7,484 | C# |
using Microsoft.Xaml.Behaviors;
using System.Windows;
namespace Baku.VMagicMirrorConfig
{
public class DialogBehavior : Behavior<Window>
{
public bool? Result
{
get { return (bool?)GetValue(ResultProperty); }
set { SetValue(ResultProperty, value); }
}
public static readonly DependencyProperty ResultProperty = DependencyProperty.Register(
nameof(Result),
typeof(bool?),
typeof(DialogBehavior),
new PropertyMetadata(null, OnResultChanged)
);
private static void OnResultChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (!(d is DialogBehavior behavior))
{
return;
}
behavior.AssociatedObject.DialogResult = (bool)e.NewValue;
}
}
} | 29.7 | 101 | 0.583614 | [
"MIT"
] | ShigemoriHakura/VMagicMirror | WPF/VMagicMirrorConfig/View/Code/DialogBehavior.cs | 893 | 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.SecurityInsights.V20200101.Outputs
{
/// <summary>
/// The available data types for TI (Threat Intelligence) data connector.
/// </summary>
[OutputType]
public sealed class TIDataConnectorDataTypesResponse
{
/// <summary>
/// Data type for indicators connection.
/// </summary>
public readonly Outputs.TIDataConnectorDataTypesResponseIndicators? Indicators;
[OutputConstructor]
private TIDataConnectorDataTypesResponse(Outputs.TIDataConnectorDataTypesResponseIndicators? indicators)
{
Indicators = indicators;
}
}
}
| 30.645161 | 112 | 0.701053 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/dotnet/SecurityInsights/V20200101/Outputs/TIDataConnectorDataTypesResponse.cs | 950 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// Used with permission from Mariano Omar Rodriguez
/// http://weblogs.asp.net/marianor/archive/2007/10/15/a-wpf-wrapper-around-windows-form-notifyicon.aspx
namespace ThinkGeo.MapSuite.GisEditor.Plugins
{
public enum BalloonTipIcon
{
None = 0,
Info = 1,
Warning = 2,
Error = 3,
}
} | 32.818182 | 104 | 0.757156 | [
"Apache-2.0"
] | ThinkGeo/GIS-Editor | MapSuiteGisEditor/GisEditorPluginCore/Shares/UIs/TaskbarNotifier/BalloonTipIcon.cs | 1,083 | C# |
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.WebUtilities;
namespace MusicStore.Mocks.Twitter
{
/// <summary>
/// Summary description for TwitterMockBackChannelHttpHandler
/// </summary>
public class TwitterMockBackChannelHttpHandler : HttpMessageHandler
{
private static bool _requestTokenEndpointInvoked = false;
protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var response = new HttpResponseMessage();
if (request.RequestUri.AbsoluteUri.StartsWith("https://api.twitter.com/oauth/access_token", StringComparison.Ordinal))
{
var formData = new FormCollection(await new FormReader(await request.Content.ReadAsStreamAsync()).ReadFormAsync());
if (formData["oauth_verifier"] == "valid_oauth_verifier")
{
if (_requestTokenEndpointInvoked)
{
var response_Form_data = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("oauth_token", "valid_oauth_token"),
new KeyValuePair<string, string>("oauth_token_secret", "valid_oauth_token_secret"),
new KeyValuePair<string, string>("user_id", "valid_user_id"),
new KeyValuePair<string, string>("screen_name", "valid_screen_name"),
};
response.Content = new FormUrlEncodedContent(response_Form_data);
}
else
{
response.StatusCode = HttpStatusCode.InternalServerError;
response.Content = new StringContent("RequestTokenEndpoint is not invoked");
}
return response;
}
response.StatusCode = (HttpStatusCode)400;
return response;
}
else if (request.RequestUri.AbsoluteUri.StartsWith("https://api.twitter.com/oauth/request_token", StringComparison.Ordinal))
{
var response_Form_data = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("oauth_callback_confirmed", "true"),
new KeyValuePair<string, string>("oauth_token", "valid_oauth_token"),
new KeyValuePair<string, string>("oauth_token_secret", "valid_oauth_token_secret")
};
_requestTokenEndpointInvoked = true;
response.Content = new FormUrlEncodedContent(response_Form_data);
return response;
}
throw new NotImplementedException(request.RequestUri.AbsoluteUri);
}
}
}
| 45.176471 | 136 | 0.591471 | [
"Apache-2.0"
] | AaqibAhamed/aspnetcore | src/MusicStore/samples/MusicStore/ForTesting/Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs | 3,072 | C# |
using System;
using System.Collections.Generic;
#nullable disable
namespace api.Models.Ttv
{
public partial class DimWebLink
{
public DimWebLink()
{
FactFieldValues = new HashSet<FactFieldValue>();
}
public int Id { get; set; }
public string Url { get; set; }
public string LinkLabel { get; set; }
public string LinkType { get; set; }
public string LanguageVariant { get; set; }
public int? DimOrganizationId { get; set; }
public int? DimKnownPersonId { get; set; }
public int? DimCallProgrammeId { get; set; }
public int? DimFundingDecisionId { get; set; }
public int? DimResearchDataCatalogId { get; set; }
public int? DimResearchDatasetId { get; set; }
public string SourceDescription { get; set; }
public string SourceId { get; set; }
public DateTime? Created { get; set; }
public DateTime? Modified { get; set; }
public int? DimResearchCommunityId { get; set; }
public virtual DimCallProgramme DimCallProgramme { get; set; }
public virtual DimFundingDecision DimFundingDecision { get; set; }
public virtual DimKnownPerson DimKnownPerson { get; set; }
public virtual DimOrganization DimOrganization { get; set; }
public virtual DimResearchCommunity DimResearchCommunity { get; set; }
public virtual DimResearchDataCatalog DimResearchDataCatalog { get; set; }
public virtual DimResearchDataset DimResearchDataset { get; set; }
public virtual ICollection<FactFieldValue> FactFieldValues { get; set; }
}
}
| 39.333333 | 82 | 0.653148 | [
"MIT"
] | CSCfi/research-fi-mydata | aspnetcore/src/api/Models/Ttv/DimWebLink.cs | 1,654 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using DAL.Siniflar;
using OBJ;
using System.Security.Cryptography;
using System.Net.Mail;
using System.Net;
namespace BL
{
public class BPersonel :DPersonel
{
//Kullanıcı Giriş
public new OIslemSonuc<OPersonel> Login(string _email, string _sifre)
{
var sonuc = base.Login(_email,_sifre);
if(sonuc.hataBilgisi != null)
{
// hatalar veritabanına kaydı...
}
return sonuc;
}//Login()
// Personel ekleme
public new OIslemSonuc<bool> personelEkle(OPersonel _p)
{
/*
var sonuc = new BAdres().adresEkleme(_p.adres);
if (sonuc.basarliMi )
{
_p.adres.adres_ = sonuc.veri;
return base.personelEkle(_p);
}
else
{
return new OIslemSonuc<bool>
{
basarliMi=false,
veri=false,
hataBilgisi=sonuc.hataBilgisi
};
}
*/
return base.personelEkle(_p);
}//personelEkle()
// Personel güncelleme
public new OIslemSonuc<bool> personelGuncelle(OPersonel _p)
{
return base.personelGuncelle(_p);
}//personelGuncelle()
// Personel silme
public new OIslemSonuc<bool> personelSil(int id)
{
return base.personelSil(id);
}//personelSil()
// Personel bilgisi
public new OIslemSonuc<OPersonel> personelBilgisi(int id)
{
return base.personelBilgisi(id);
}//personelBilgisi()
// Personel arama
public new OIslemSonuc<List<OPersonel>> personelAra(string ad, string soyad, string tc, string email)
{
return base.personelAra(ad, soyad, tc, email);
}//personelAra()
// Personel tipine göre arama
public new OIslemSonuc<List<OPersonel>> tipeGoreAra(int personeltip_)
{
return base.tipeGoreAra(personeltip_);
}//tipeGoreAra()
// Personelleri Listeleme
public new OIslemSonuc<List<OPersonel>> personelListele()
{
return base.personelListele();
}//personelListele()
//şifre değiştirme
public new OIslemSonuc<bool> sifreDegistirme(int personel_,string yeniSifre)
{
return base.sifreDegistirme(personel_, yeniSifre);
}//sifreDegistirme()
//MD5 hash algoritması
public string MD5(string _psw)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] btr = Encoding.UTF8.GetBytes(_psw);
btr = md5.ComputeHash(btr);
StringBuilder sb = new StringBuilder();
foreach (byte ba in btr)
{
sb.Append(ba.ToString("x2").ToLower());
}
return sb.ToString();
}
//Email gönderme
public OIslemSonuc<bool> emailGonderme(string konu,string icerik,string aliciEmail)
{
try
{
MailMessage message = new MailMessage();
SmtpClient smtp = new SmtpClient();
message.From = new MailAddress("eyupgevenim@gmail.com"); //gönderici
message.To.Add(new MailAddress(aliciEmail)); // aliciEmail
message.Subject = konu;
message.Body =icerik;
smtp.Port = 587;
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("burodonanim.teknikservis@gmail.com", "0123456789abc");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Send(message);
return new OIslemSonuc<bool>
{
basarliMi=true
};
}
catch (Exception e)
{
return new OIslemSonuc < bool >
{
basarliMi=false,
hataBilgisi=new OHata
{
hataMesaj=e.Message,
sinif="BPersonel",
method="emailGonderme"
}
};
}
}
// Personel emailini sorgulama
public new OIslemSonuc<int> emailSorgu(string email)
{
return base.emailSorgu(email);
}
}
}
| 30.245161 | 112 | 0.517705 | [
"MIT"
] | eyupgevenim/TeknikServis | BL/BPersonel.cs | 4,703 | C# |
using System.Threading.Tasks;
using LanguageExt.TypeClasses;
namespace LanguageExt.ClassInstances
{
public struct EqTryOptionAsync<EqA, A> : EqAsync<TryOptionAsync<A>> where EqA : struct, Eq<A>
{
public Task<bool> EqualsAsync(TryOptionAsync<A> x, TryOptionAsync<A> y) =>
default(ApplTryOptionAsync<A, bool>)
.ApplyOption(default(EqOption<A>).Equals, x, y)
.IfNoneOrFail(false);
public Task<int> GetHashCodeAsync(TryOptionAsync<A> x) =>
default(HashableTryOptionAsync<EqA, A>).GetHashCodeAsync(x);
}
public struct EqTryOptionAsync<A> : EqAsync<TryOptionAsync<A>>
{
public Task<bool> EqualsAsync(TryOptionAsync<A> x, TryOptionAsync<A> y) =>
default(EqTryOptionAsync<EqDefault<A>, A>).EqualsAsync(x, y);
public Task<int> GetHashCodeAsync(TryOptionAsync<A> x) =>
default(HashableTryOptionAsync<A>).GetHashCodeAsync(x);
}
}
| 36.923077 | 97 | 0.664583 | [
"MIT"
] | KiritchoukC/language-ext | LanguageExt.Core/ClassInstances/Eq/EqTryOptionAsync.cs | 962 | C# |
#region Copyright (Apache 2.0)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// <copyright file="GiftCardQueryResponse.cs" company="SCVNGR, Inc. d/b/a LevelUp">
// Copyright(c) 2016 SCVNGR, Inc. d/b/a LevelUp. All rights reserved.
// </copyright>
// <license publisher="Apache Software Foundation" date="January 2004" version="2.0">
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.
// </license>
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#endregion
using JsonEnvelopeSerializer;
using Newtonsoft.Json;
namespace LevelUp.Api.Client.Models.Responses
{
[JsonObject(MemberSerialization.OptIn)]
[ObjectEnvelope("merchant_funded_gift_card_credit")]
[JsonConverter(typeof(EnvelopeSerializer))]
public class GiftCardQueryResponse : Response
{
/// <summary>
/// Private constructor for deserialization
/// </summary>
private GiftCardQueryResponse() { }
public GiftCardQueryResponse(int totalAmount)
{
TotalAmount = totalAmount;
}
[JsonProperty(PropertyName = "total_amount")]
public int TotalAmount { get; private set; }
}
}
| 40.113636 | 103 | 0.619263 | [
"Apache-2.0"
] | TheLevelUp/levelup-sdk-csharp | LevelUp.Api.Client/Models/Responses/GiftCardQueryResponse.cs | 1,767 | C# |
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace Cert.Interfaces
{
interface ICertificateAuthority
{
/// <summary>
/// Generate and sign a new certificate.
/// </summary>
/// <param name="subjectName"></param>
/// <returns></returns>
X509Certificate2 GenerateAndSignCertificate(string subjectName);
}
}
| 24.833333 | 72 | 0.66443 | [
"MIT"
] | alt-how/altinn-cert | Cert/Interfaces/ICertificateAuthority.cs | 449 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using DocuSign.CodeExamples.Controllers;
using DocuSign.CodeExamples.Models;
using DocuSign.CodeExamples.Rooms.Models;
using DocuSign.Rooms.Api;
using DocuSign.Rooms.Client;
using DocuSign.Rooms.Model;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using ApiError = DocuSign.Rooms.Model.ApiError;
namespace DocuSign.CodeExamples.Rooms.Controllers
{
[Area("Rooms")]
[Route("Eg04")]
public class Eg04AddingFormToRoomController : EgController
{
public Eg04AddingFormToRoomController(
DSConfiguration dsConfig,
IRequestItemsService requestItemsService) : base(dsConfig, requestItemsService)
{
}
public override string EgName => "Eg04";
[BindProperty]
public RoomFormModel RoomFormModel { get; set; }
protected override void InitializeInternal()
{
RoomFormModel = new RoomFormModel();
}
[MustAuthenticate]
[HttpGet]
public override IActionResult Get()
{
base.Get();
// Step 1. Obtain your OAuth token
string accessToken = RequestItemsService.User.AccessToken; // Represents your {ACCESS_TOKEN}
var basePath = $"{RequestItemsService.Session.RoomsApiBasePath}/restapi"; // Base API path
// Step 2: Construct your API headers
var apiClient = new ApiClient(basePath);
apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
var roomsApi = new RoomsApi(apiClient);
var formLibrariesApi = new FormLibrariesApi(apiClient);
string accountId = RequestItemsService.Session.AccountId; // Represents your {ACCOUNT_ID}
try
{
//Step 3: Get Forms Libraries
FormLibrarySummaryList formLibraries = formLibrariesApi.GetFormLibraries(accountId);
//Step 4: Get Forms
FormSummaryList forms = new FormSummaryList(new List<FormSummary>());
if (formLibraries.FormsLibrarySummaries.Any())
{
forms = formLibrariesApi.GetFormLibraryForms(
accountId,
formLibraries.FormsLibrarySummaries.First().FormsLibraryId);
}
//Step 5: Get Rooms
RoomSummaryList rooms = roomsApi.GetRooms(accountId);
RoomFormModel = new RoomFormModel { Forms = forms.Forms, Rooms = rooms.Rooms };
return View("Eg04", this);
}
catch (ApiException apiException)
{
ViewBag.errorCode = apiException.ErrorCode;
ViewBag.errorMessage = apiException.Message;
ApiError error = JsonConvert.DeserializeObject<ApiError>(apiException.ErrorContent);
if (error.ErrorCode.Equals("FORMS_INTEGRATION_NOT_ENABLED", StringComparison.InvariantCultureIgnoreCase))
{
return View("ExampleNotAvailable");
}
return View("Error");
}
}
[MustAuthenticate]
[Route("ExportData")]
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult ExportData(RoomFormModel roomFormModel)
{
// Step 1. Obtain your OAuth token
string accessToken = RequestItemsService.User.AccessToken; // Represents your {ACCESS_TOKEN}
var basePath = $"{RequestItemsService.Session.RoomsApiBasePath}/restapi"; // Base API path
// Step 2: Construct your API headers
var apiClient = new ApiClient(basePath);
apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
var roomsApi = new RoomsApi(apiClient);
string accountId = RequestItemsService.Session.AccountId; // Represents your {ACCOUNT_ID}
try
{
// Step 3: Call the Rooms API to add form to a room
RoomDocument roomDocument = roomsApi.AddFormToRoom(
accountId,
roomFormModel.RoomId,
new FormForAdd(roomFormModel.FormId));
ViewBag.h1 = "The form was successfully added to a room";
ViewBag.message = $"Results from the Rooms: AddFormToRoom method. RoomId: {roomFormModel.RoomId}, FormId: {roomFormModel.FormId} :";
ViewBag.Locals.Json = JsonConvert.SerializeObject(roomDocument, Formatting.Indented);
return View("example_done");
}
catch (ApiException apiException)
{
ViewBag.errorCode = apiException.ErrorCode;
ViewBag.errorMessage = apiException.Message;
return View("Error");
}
}
}
} | 38.59375 | 148 | 0.607895 | [
"MIT"
] | olexandr-hrytsenko/AMI-dev-DocuSign | launcher-csharp/Rooms/Controllers/Eg04AddingFormToRoomController.cs | 4,942 | C# |
// SPDX-License-Identifier: MIT
// ATTENTION: This file is automatically generated. Do not edit manually.
#nullable enable
namespace GISharp.Lib.GLib
{
/// <include file="Source.xmldoc" path="declaration/member[@name='Source']/*" />
[GISharp.Runtime.GTypeAttribute("GSource", IsProxyForUnmanagedType = true)]
public sealed unsafe partial class Source : GISharp.Runtime.Boxed
{
private static readonly GISharp.Runtime.GType _GType = g_source_get_type();
/// <summary>
/// The unmanaged data structure.
/// </summary>
public struct UnmanagedStruct
{
#pragma warning disable CS0169, CS0414, CS0649
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.CallbackData']/*" />
internal readonly System.IntPtr CallbackData;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.CallbackFuncs']/*" />
internal readonly GISharp.Lib.GLib.SourceCallbackFuncs* CallbackFuncs;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.SourceFuncs']/*" />
internal readonly GISharp.Lib.GLib.SourceFuncs* SourceFuncs;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.RefCount']/*" />
internal readonly uint RefCount;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Context']/*" />
internal readonly GISharp.Lib.GLib.MainContext.UnmanagedStruct* Context;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Priority']/*" />
internal readonly int Priority;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Flags']/*" />
internal readonly uint Flags;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.SourceId']/*" />
internal readonly uint SourceId;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.PollFds']/*" />
internal readonly GISharp.Lib.GLib.SList.UnmanagedStruct* PollFds;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Prev']/*" />
internal readonly GISharp.Lib.GLib.Source.UnmanagedStruct* Prev;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Next']/*" />
internal readonly GISharp.Lib.GLib.Source.UnmanagedStruct* Next;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Name']/*" />
internal readonly byte* Name;
/// <include file="Source.xmldoc" path="declaration/member[@name='UnmanagedStruct.Priv']/*" />
internal readonly System.IntPtr Priv;
#pragma warning restore CS0169, CS0414, CS0649
}
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Continue']/*" />
[GISharp.Runtime.SinceAttribute("2.32")]
public const bool Continue = true;
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Remove']/*" />
[GISharp.Runtime.SinceAttribute("2.32")]
public const bool Remove = false;
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.CanRecurse']/*" />
public bool CanRecurse { get => GetCanRecurse(); set => SetCanRecurse(value); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Context']/*" />
public GISharp.Lib.GLib.MainContext? Context { get => GetContext(); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Id']/*" />
public uint Id { get => GetId(); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Name']/*" />
[GISharp.Runtime.SinceAttribute("2.26")]
public GISharp.Runtime.NullableUnownedUtf8 Name { get => GetName(); set => SetName(value.Value); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Priority']/*" />
public int Priority { get => GetPriority(); set => SetPriority(value); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.ReadyTime']/*" />
public long ReadyTime { get => GetReadyTime(); set => SetReadyTime(value); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Time']/*" />
[GISharp.Runtime.SinceAttribute("2.28")]
public long Time { get => GetTime(); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.IsDestroyed']/*" />
[GISharp.Runtime.SinceAttribute("2.12")]
public bool IsDestroyed { get => GetIsDestroyed(); }
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Current']/*" />
[GISharp.Runtime.SinceAttribute("2.12")]
public static GISharp.Lib.GLib.Source? Current { get => GetCurrent(); }
/// <summary>
/// For internal runtime use only.
/// </summary>
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public Source(System.IntPtr handle, GISharp.Runtime.Transfer ownership) : base(handle)
{
if (ownership == GISharp.Runtime.Transfer.None)
{
this.handle = (System.IntPtr)g_source_ref((UnmanagedStruct*)handle);
}
}
/// <summary>
/// Creates a new #GSource structure. The size is specified to
/// allow creating structures derived from #GSource that contain
/// additional data. The size passed in must be at least
/// `sizeof (GSource)`.
/// </summary>
/// <remarks>
/// <para>
/// The source will not initially be associated with any #GMainContext
/// and must be added to one with g_source_attach() before it will be
/// executed.
/// </para>
/// </remarks>
/// <param name="sourceFuncs">
/// structure containing functions that implement
/// the sources behavior.
/// </param>
/// <param name="structSize">
/// size of the #GSource structure to create.
/// </param>
/// <returns>
/// the newly-created #GSource.
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:full direction:in */
private static extern GISharp.Lib.GLib.Source.UnmanagedStruct* g_source_new(
/* <type name="SourceFuncs" type="GSourceFuncs*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.SourceFuncs* sourceFuncs,
/* <type name="guint" type="guint" /> */
/* transfer-ownership:none direction:in */
uint structSize);
static partial void CheckNewArgs(ref GISharp.Lib.GLib.SourceFuncs sourceFuncs, uint structSize);
static GISharp.Lib.GLib.Source.UnmanagedStruct* New(ref GISharp.Lib.GLib.SourceFuncs sourceFuncs, uint structSize)
{
fixed (GISharp.Lib.GLib.SourceFuncs* sourceFuncs_ = &sourceFuncs)
{
CheckNewArgs(ref sourceFuncs, structSize);
var structSize_ = (uint)structSize;
var ret_ = g_source_new(sourceFuncs_,structSize_);
GISharp.Runtime.GMarshal.PopUnhandledException();
return ret_;
}
}
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Source(GISharp.Lib.GLib.SourceFuncs,uint)']/*" />
public Source(ref GISharp.Lib.GLib.SourceFuncs sourceFuncs, uint structSize) : this((System.IntPtr)New(ref sourceFuncs, structSize), GISharp.Runtime.Transfer.Full)
{
}
/// <summary>
/// Removes the source with the given ID from the default main context. You must
/// use g_source_destroy() for sources added to a non-default main context.
/// </summary>
/// <remarks>
/// <para>
/// The ID of a #GSource is given by g_source_get_id(), or will be
/// returned by the functions g_source_attach(), g_idle_add(),
/// g_idle_add_full(), g_timeout_add(), g_timeout_add_full(),
/// g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and
/// g_io_add_watch_full().
/// </para>
/// <para>
/// It is a programmer error to attempt to remove a non-existent source.
/// </para>
/// <para>
/// More specifically: source IDs can be reissued after a source has been
/// destroyed and therefore it is never valid to use this function with a
/// source ID which may have already been removed. An example is when
/// scheduling an idle to run in another thread with g_idle_add(): the
/// idle may already have run and been removed by the time this function
/// is called on its (now invalid) source ID. This source ID may have
/// been reissued, leading to the operation being performed against the
/// wrong source.
/// </para>
/// </remarks>
/// <param name="tag">
/// the ID of the source to remove.
/// </param>
/// <returns>
/// For historical reasons, this function always returns %TRUE
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gboolean" type="gboolean" /> */
/* transfer-ownership:none direction:in */
private static extern GISharp.Runtime.Boolean g_source_remove(
/* <type name="guint" type="guint" /> */
/* transfer-ownership:none direction:in */
uint tag);
static partial void CheckRemoveByIdArgs(uint tag);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.RemoveById(uint)']/*" />
public static bool RemoveById(uint tag)
{
CheckRemoveByIdArgs(tag);
var tag_ = (uint)tag;
var ret_ = g_source_remove(tag_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Runtime.BooleanExtensions.IsTrue(ret_);
return ret;
}
/// <summary>
/// Removes a source from the default main loop context given the
/// source functions and user data. If multiple sources exist with the
/// same source functions and user data, only one will be destroyed.
/// </summary>
/// <param name="funcs">
/// The @source_funcs passed to g_source_new()
/// </param>
/// <param name="userData">
/// the user data for the callback
/// </param>
/// <returns>
/// %TRUE if a source was found and removed.
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gboolean" type="gboolean" /> */
/* transfer-ownership:none direction:in */
private static extern GISharp.Runtime.Boolean g_source_remove_by_funcs_user_data(
/* <type name="SourceFuncs" type="GSourceFuncs*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.SourceFuncs* funcs,
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 allow-none:1 direction:in */
System.IntPtr userData);
static partial void CheckRemoveByFuncsUserDataArgs(ref GISharp.Lib.GLib.SourceFuncs funcs, System.IntPtr userData);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.RemoveByFuncsUserData(GISharp.Lib.GLib.SourceFuncs,System.IntPtr)']/*" />
public static bool RemoveByFuncsUserData(ref GISharp.Lib.GLib.SourceFuncs funcs, System.IntPtr userData)
{
fixed (GISharp.Lib.GLib.SourceFuncs* funcs_ = &funcs)
{
CheckRemoveByFuncsUserDataArgs(ref funcs, userData);
var userData_ = (System.IntPtr)userData;
var ret_ = g_source_remove_by_funcs_user_data(funcs_,userData_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Runtime.BooleanExtensions.IsTrue(ret_);
return ret;
}
}
/// <summary>
/// Removes a source from the default main loop context given the user
/// data for the callback. If multiple sources exist with the same user
/// data, only one will be destroyed.
/// </summary>
/// <param name="userData">
/// the user_data for the callback.
/// </param>
/// <returns>
/// %TRUE if a source was found and removed.
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gboolean" type="gboolean" /> */
/* transfer-ownership:none direction:in */
private static extern GISharp.Runtime.Boolean g_source_remove_by_user_data(
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 allow-none:1 direction:in */
System.IntPtr userData);
static partial void CheckRemoveByUserDataArgs(System.IntPtr userData);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.RemoveByUserData(System.IntPtr)']/*" />
public static bool RemoveByUserData(System.IntPtr userData)
{
CheckRemoveByUserDataArgs(userData);
var userData_ = (System.IntPtr)userData;
var ret_ = g_source_remove_by_user_data(userData_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Runtime.BooleanExtensions.IsTrue(ret_);
return ret;
}
/// <summary>
/// Sets the name of a source using its ID.
/// </summary>
/// <remarks>
/// <para>
/// This is a convenience utility to set source names from the return
/// value of g_idle_add(), g_timeout_add(), etc.
/// </para>
/// <para>
/// It is a programmer error to attempt to set the name of a non-existent
/// source.
/// </para>
/// <para>
/// More specifically: source IDs can be reissued after a source has been
/// destroyed and therefore it is never valid to use this function with a
/// source ID which may have already been removed. An example is when
/// scheduling an idle to run in another thread with g_idle_add(): the
/// idle may already have run and been removed by the time this function
/// is called on its (now invalid) source ID. This source ID may have
/// been reissued, leading to the operation being performed against the
/// wrong source.
/// </para>
/// </remarks>
/// <param name="tag">
/// a #GSource ID
/// </param>
/// <param name="name">
/// debug name for the source
/// </param>
[GISharp.Runtime.SinceAttribute("2.26")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_name_by_id(
/* <type name="guint" type="guint" /> */
/* transfer-ownership:none direction:in */
uint tag,
/* <type name="utf8" type="const char*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
byte* name);
static partial void CheckSetNameByIdArgs(uint tag, GISharp.Runtime.UnownedUtf8 name);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.SetNameById(uint,GISharp.Runtime.UnownedUtf8)']/*" />
[GISharp.Runtime.SinceAttribute("2.26")]
public static void SetNameById(uint tag, GISharp.Runtime.UnownedUtf8 name)
{
CheckSetNameByIdArgs(tag, name);
var tag_ = (uint)tag;
var name_ = (byte*)name.UnsafeHandle;
g_source_set_name_by_id(tag_, name_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Returns the currently firing source for this thread.
/// </summary>
/// <returns>
/// The currently firing source or %NULL.
/// </returns>
[GISharp.Runtime.SinceAttribute("2.12")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 direction:in */
private static extern GISharp.Lib.GLib.Source.UnmanagedStruct* g_main_current_source();
static partial void CheckGetCurrentArgs();
[GISharp.Runtime.SinceAttribute("2.12")]
private static GISharp.Lib.GLib.Source? GetCurrent()
{
CheckGetCurrentArgs();
var ret_ = g_main_current_source();
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Lib.GLib.Source.GetInstance<GISharp.Lib.GLib.Source>((System.IntPtr)ret_, GISharp.Runtime.Transfer.None);
return ret;
}
[System.Runtime.InteropServices.DllImportAttribute("gobject-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="GType" type="GType" /> */
/* transfer-ownership:full direction:in */
private static extern GISharp.Runtime.GType g_source_get_type();
/// <summary>
/// Adds @child_source to @source as a "polled" source; when @source is
/// added to a #GMainContext, @child_source will be automatically added
/// with the same priority, when @child_source is triggered, it will
/// cause @source to dispatch (in addition to calling its own
/// callback), and when @source is destroyed, it will destroy
/// @child_source as well. (@source will also still be dispatched if
/// its own prepare/check functions indicate that it is ready.)
/// </summary>
/// <remarks>
/// <para>
/// If you don't need @child_source to do anything on its own when it
/// triggers, you can call g_source_set_dummy_callback() on it to set a
/// callback that does nothing (except return %TRUE if appropriate).
/// </para>
/// <para>
/// @source will hold a reference on @child_source while @child_source
/// is attached to it.
/// </para>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="childSource">
/// a second #GSource that @source should "poll"
/// </param>
[GISharp.Runtime.SinceAttribute("2.28")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_add_child_source(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* childSource);
partial void CheckAddChildSourceArgs(GISharp.Lib.GLib.Source childSource);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.AddChildSource(GISharp.Lib.GLib.Source)']/*" />
[GISharp.Runtime.SinceAttribute("2.28")]
public void AddChildSource(GISharp.Lib.GLib.Source childSource)
{
CheckAddChildSourceArgs(childSource);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var childSource_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)childSource.UnsafeHandle;
g_source_add_child_source(source_, childSource_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Adds a file descriptor to the set of file descriptors polled for
/// this source. This is usually combined with g_source_new() to add an
/// event source. The event source's check function will typically test
/// the @revents field in the #GPollFD struct and return %TRUE if events need
/// to be processed.
/// </summary>
/// <remarks>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// <para>
/// Using this API forces the linear scanning of event sources on each
/// main loop iteration. Newly-written event sources should try to use
/// g_source_add_unix_fd() instead of this API.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="fd">
/// a #GPollFD structure holding information about a file
/// descriptor to watch.
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_add_poll(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="PollFD" type="GPollFD*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.PollFD* fd);
partial void CheckAddPollArgs(ref GISharp.Lib.GLib.PollFD fd);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.AddPoll(GISharp.Lib.GLib.PollFD)']/*" />
public void AddPoll(ref GISharp.Lib.GLib.PollFD fd)
{
fixed (GISharp.Lib.GLib.PollFD* fd_ = &fd)
{
CheckAddPollArgs(ref fd);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
g_source_add_poll(source_, fd_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
}
/// <summary>
/// Monitors @fd for the IO events in @events.
/// </summary>
/// <remarks>
/// <para>
/// The tag returned by this function can be used to remove or modify the
/// monitoring of the fd using g_source_remove_unix_fd() or
/// g_source_modify_unix_fd().
/// </para>
/// <para>
/// It is not necessary to remove the fd before destroying the source; it
/// will be cleaned up automatically.
/// </para>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// <para>
/// As the name suggests, this function is not available on Windows.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="fd">
/// the fd to monitor
/// </param>
/// <param name="events">
/// an event mask
/// </param>
/// <returns>
/// an opaque tag
/// </returns>
[GISharp.Runtime.SinceAttribute("2.36")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
private static extern System.IntPtr g_source_add_unix_fd(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gint" type="gint" /> */
/* transfer-ownership:none direction:in */
int fd,
/* <type name="IOCondition" type="GIOCondition" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.IOCondition events);
partial void CheckAddUnixFdArgs(int fd, GISharp.Lib.GLib.IOCondition events);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.AddUnixFd(int,GISharp.Lib.GLib.IOCondition)']/*" />
[GISharp.Runtime.SinceAttribute("2.36")]
public System.IntPtr AddUnixFd(int fd, GISharp.Lib.GLib.IOCondition events)
{
CheckAddUnixFdArgs(fd, events);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var fd_ = (int)fd;
var events_ = (GISharp.Lib.GLib.IOCondition)events;
var ret_ = g_source_add_unix_fd(source_,fd_,events_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (System.IntPtr)ret_;
return ret;
}
/// <summary>
/// Adds a #GSource to a @context so that it will be executed within
/// that context. Remove it by calling g_source_destroy().
/// </summary>
/// <remarks>
/// <para>
/// This function is safe to call from any thread, regardless of which thread
/// the @context is running in.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="context">
/// a #GMainContext (if %NULL, the default context will be used)
/// </param>
/// <returns>
/// the ID (greater than 0) for the source within the
/// #GMainContext.
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="guint" type="guint" /> */
/* transfer-ownership:none direction:in */
private static extern uint g_source_attach(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="MainContext" type="GMainContext*" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 allow-none:1 direction:in */
GISharp.Lib.GLib.MainContext.UnmanagedStruct* context);
partial void CheckAttachArgs(GISharp.Lib.GLib.MainContext? context);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Attach(GISharp.Lib.GLib.MainContext?)']/*" />
public uint Attach(GISharp.Lib.GLib.MainContext? context)
{
CheckAttachArgs(context);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var context_ = (GISharp.Lib.GLib.MainContext.UnmanagedStruct*)(context?.UnsafeHandle ?? System.IntPtr.Zero);
var ret_ = g_source_attach(source_,context_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (uint)ret_;
return ret;
}
/// <summary>
/// Removes a source from its #GMainContext, if any, and mark it as
/// destroyed. The source cannot be subsequently added to another
/// context. It is safe to call this on sources which have already been
/// removed from their context.
/// </summary>
/// <remarks>
/// <para>
/// This does not unref the #GSource: if you still hold a reference, use
/// g_source_unref() to drop it.
/// </para>
/// <para>
/// This function is safe to call from any thread, regardless of which thread
/// the #GMainContext is running in.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_destroy(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckDestroyArgs();
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.Destroy()']/*" />
public void Destroy()
{
CheckDestroyArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
g_source_destroy(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Checks whether a source is allowed to be called recursively.
/// see g_source_set_can_recurse().
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// whether recursion is allowed.
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gboolean" type="gboolean" /> */
/* transfer-ownership:none direction:in */
private static extern GISharp.Runtime.Boolean g_source_get_can_recurse(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetCanRecurseArgs();
private bool GetCanRecurse()
{
CheckGetCanRecurseArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_can_recurse(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Runtime.BooleanExtensions.IsTrue(ret_);
return ret;
}
/// <summary>
/// Gets the #GMainContext with which the source is associated.
/// </summary>
/// <remarks>
/// <para>
/// You can call this on a source that has been destroyed, provided
/// that the #GMainContext it was attached to still exists (in which
/// case it will return that #GMainContext). In particular, you can
/// always call this function on the source returned from
/// g_main_current_source(). But calling this function on a source
/// whose #GMainContext has been destroyed is an error.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// the #GMainContext with which the
/// source is associated, or %NULL if the context has not
/// yet been added to a source.
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="MainContext" type="GMainContext*" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 direction:in */
private static extern GISharp.Lib.GLib.MainContext.UnmanagedStruct* g_source_get_context(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetContextArgs();
private GISharp.Lib.GLib.MainContext? GetContext()
{
CheckGetContextArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_context(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Lib.GLib.MainContext.GetInstance<GISharp.Lib.GLib.MainContext>((System.IntPtr)ret_, GISharp.Runtime.Transfer.None);
return ret;
}
/// <summary>
/// This function ignores @source and is otherwise the same as
/// g_get_current_time().
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="timeval">
/// #GTimeVal structure in which to store current time.
/// </param>
[System.ObsoleteAttribute("use g_source_get_time() instead")]
[GISharp.Runtime.DeprecatedSinceAttribute("2.28")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_get_current_time(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="TimeVal" type="GTimeVal*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.TimeVal* timeval);
partial void CheckGetCurrentTimeArgs(ref GISharp.Lib.GLib.TimeVal timeval);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.GetCurrentTime(GISharp.Lib.GLib.TimeVal)']/*" />
[System.ObsoleteAttribute("use g_source_get_time() instead")]
[GISharp.Runtime.DeprecatedSinceAttribute("2.28")]
public void GetCurrentTime(ref GISharp.Lib.GLib.TimeVal timeval)
{
fixed (GISharp.Lib.GLib.TimeVal* timeval_ = &timeval)
{
CheckGetCurrentTimeArgs(ref timeval);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
g_source_get_current_time(source_, timeval_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
}
/// <summary>
/// Returns the numeric ID for a particular source. The ID of a source
/// is a positive integer which is unique within a particular main loop
/// context. The reverse
/// mapping from ID to source is done by g_main_context_find_source_by_id().
/// </summary>
/// <remarks>
/// <para>
/// You can only call this function while the source is associated to a
/// #GMainContext instance; calling this function before g_source_attach()
/// or after g_source_destroy() yields undefined behavior. The ID returned
/// is unique within the #GMainContext instance passed to g_source_attach().
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// the ID (greater than 0) for the source
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="guint" type="guint" /> */
/* transfer-ownership:none direction:in */
private static extern uint g_source_get_id(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetIdArgs();
private uint GetId()
{
CheckGetIdArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_id(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (uint)ret_;
return ret;
}
/// <summary>
/// Gets a name for the source, used in debugging and profiling. The
/// name may be #NULL if it has never been set with g_source_set_name().
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// the name of the source
/// </returns>
[GISharp.Runtime.SinceAttribute("2.26")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="utf8" type="const char*" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 direction:in */
private static extern byte* g_source_get_name(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetNameArgs();
[GISharp.Runtime.SinceAttribute("2.26")]
private GISharp.Runtime.NullableUnownedUtf8 GetName()
{
CheckGetNameArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_name(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = new GISharp.Runtime.NullableUnownedUtf8(ret_);
return ret;
}
/// <summary>
/// Gets the priority of a source.
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// the priority of the source
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gint" type="gint" /> */
/* transfer-ownership:none direction:in */
private static extern int g_source_get_priority(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetPriorityArgs();
private int GetPriority()
{
CheckGetPriorityArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_priority(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (int)ret_;
return ret;
}
/// <summary>
/// Gets the "ready time" of @source, as set by
/// g_source_set_ready_time().
/// </summary>
/// <remarks>
/// <para>
/// Any time before the current monotonic time (including 0) is an
/// indication that the source will fire immediately.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// the monotonic ready time, -1 for "never"
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gint64" type="gint64" /> */
/* transfer-ownership:none direction:in */
private static extern long g_source_get_ready_time(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetReadyTimeArgs();
private long GetReadyTime()
{
CheckGetReadyTimeArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_ready_time(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (long)ret_;
return ret;
}
/// <summary>
/// Gets the time to be used when checking this source. The advantage of
/// calling this function over calling g_get_monotonic_time() directly is
/// that when checking multiple sources, GLib can cache a single value
/// instead of having to repeatedly get the system monotonic time.
/// </summary>
/// <remarks>
/// <para>
/// The time here is the system monotonic time, if available, or some
/// other reasonable alternative otherwise. See g_get_monotonic_time().
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// the monotonic time in microseconds
/// </returns>
[GISharp.Runtime.SinceAttribute("2.28")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gint64" type="gint64" /> */
/* transfer-ownership:none direction:in */
private static extern long g_source_get_time(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetTimeArgs();
[GISharp.Runtime.SinceAttribute("2.28")]
private long GetTime()
{
CheckGetTimeArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_get_time(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (long)ret_;
return ret;
}
/// <summary>
/// Returns whether @source has been destroyed.
/// </summary>
/// <remarks>
/// <para>
/// This is important when you operate upon your objects
/// from within idle handlers, but may have freed the object
/// before the dispatch of your idle handler.
/// </para>
/// <para>
/// |[<!-- language="C" -->
/// static gboolean
/// idle_callback (gpointer data)
/// {
/// SomeWidget *self = data;
///
/// g_mutex_lock (&self->idle_id_mutex);
/// // do stuff with self
/// self->idle_id = 0;
/// g_mutex_unlock (&self->idle_id_mutex);
///
/// return G_SOURCE_REMOVE;
/// }
///
/// static void
/// some_widget_do_stuff_later (SomeWidget *self)
/// {
/// g_mutex_lock (&self->idle_id_mutex);
/// self->idle_id = g_idle_add (idle_callback, self);
/// g_mutex_unlock (&self->idle_id_mutex);
/// }
///
/// static void
/// some_widget_init (SomeWidget *self)
/// {
/// g_mutex_init (&self->idle_id_mutex);
/// </para>
/// <para>
/// // ...
/// }
/// </para>
/// <para>
/// static void
/// some_widget_finalize (GObject *object)
/// {
/// SomeWidget *self = SOME_WIDGET (object);
///
/// if (self->idle_id)
/// g_source_remove (self->idle_id);
///
/// g_mutex_clear (&self->idle_id_mutex);
/// </para>
/// <para>
/// G_OBJECT_CLASS (parent_class)->finalize (object);
/// }
/// ]|
/// </para>
/// <para>
/// This will fail in a multi-threaded application if the
/// widget is destroyed before the idle handler fires due
/// to the use after free in the callback. A solution, to
/// this particular problem, is to check to if the source
/// has already been destroy within the callback.
/// </para>
/// <para>
/// |[<!-- language="C" -->
/// static gboolean
/// idle_callback (gpointer data)
/// {
/// SomeWidget *self = data;
///
/// g_mutex_lock (&self->idle_id_mutex);
/// if (!g_source_is_destroyed (g_main_current_source ()))
/// {
/// // do stuff with self
/// }
/// g_mutex_unlock (&self->idle_id_mutex);
///
/// return FALSE;
/// }
/// ]|
/// </para>
/// <para>
/// Calls to this function from a thread other than the one acquired by the
/// #GMainContext the #GSource is attached to are typically redundant, as the
/// source could be destroyed immediately after this function returns. However,
/// once a source is destroyed it cannot be un-destroyed, so this function can be
/// used for opportunistic checks from any thread.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// %TRUE if the source has been destroyed
/// </returns>
[GISharp.Runtime.SinceAttribute("2.12")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="gboolean" type="gboolean" /> */
/* transfer-ownership:none direction:in */
private static extern GISharp.Runtime.Boolean g_source_is_destroyed(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
partial void CheckGetIsDestroyedArgs();
[GISharp.Runtime.SinceAttribute("2.12")]
private bool GetIsDestroyed()
{
CheckGetIsDestroyedArgs();
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var ret_ = g_source_is_destroyed(source_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = GISharp.Runtime.BooleanExtensions.IsTrue(ret_);
return ret;
}
/// <summary>
/// Updates the event mask to watch for the fd identified by @tag.
/// </summary>
/// <remarks>
/// <para>
/// @tag is the tag returned from g_source_add_unix_fd().
/// </para>
/// <para>
/// If you want to remove a fd, don't set its event mask to zero.
/// Instead, call g_source_remove_unix_fd().
/// </para>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// <para>
/// As the name suggests, this function is not available on Windows.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="tag">
/// the tag from g_source_add_unix_fd()
/// </param>
/// <param name="newEvents">
/// the new event mask to watch
/// </param>
[GISharp.Runtime.SinceAttribute("2.36")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_modify_unix_fd(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
System.IntPtr tag,
/* <type name="IOCondition" type="GIOCondition" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.IOCondition newEvents);
partial void CheckModifyUnixFdArgs(System.IntPtr tag, GISharp.Lib.GLib.IOCondition newEvents);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.ModifyUnixFd(System.IntPtr,GISharp.Lib.GLib.IOCondition)']/*" />
[GISharp.Runtime.SinceAttribute("2.36")]
public void ModifyUnixFd(System.IntPtr tag, GISharp.Lib.GLib.IOCondition newEvents)
{
CheckModifyUnixFdArgs(tag, newEvents);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var tag_ = (System.IntPtr)tag;
var newEvents_ = (GISharp.Lib.GLib.IOCondition)newEvents;
g_source_modify_unix_fd(source_, tag_, newEvents_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Queries the events reported for the fd corresponding to @tag on
/// @source during the last poll.
/// </summary>
/// <remarks>
/// <para>
/// The return value of this function is only defined when the function
/// is called from the check or dispatch functions for @source.
/// </para>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// <para>
/// As the name suggests, this function is not available on Windows.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="tag">
/// the tag from g_source_add_unix_fd()
/// </param>
/// <returns>
/// the conditions reported on the fd
/// </returns>
[GISharp.Runtime.SinceAttribute("2.36")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="IOCondition" type="GIOCondition" /> */
/* transfer-ownership:none direction:in */
private static extern GISharp.Lib.GLib.IOCondition g_source_query_unix_fd(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
System.IntPtr tag);
partial void CheckQueryUnixFdArgs(System.IntPtr tag);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.QueryUnixFd(System.IntPtr)']/*" />
[GISharp.Runtime.SinceAttribute("2.36")]
public GISharp.Lib.GLib.IOCondition QueryUnixFd(System.IntPtr tag)
{
CheckQueryUnixFdArgs(tag);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var tag_ = (System.IntPtr)tag;
var ret_ = g_source_query_unix_fd(source_,tag_);
GISharp.Runtime.GMarshal.PopUnhandledException();
var ret = (GISharp.Lib.GLib.IOCondition)ret_;
return ret;
}
/// <summary>
/// Increases the reference count on a source by one.
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <returns>
/// @source
/// </returns>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:full direction:in */
private static extern GISharp.Lib.GLib.Source.UnmanagedStruct* g_source_ref(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
/// <summary>
/// Takes ownership of the unmanaged pointer without freeing it.
/// The managed object can no longer be used (will throw disposed exception).
/// </summary>
public override System.IntPtr Take() => (System.IntPtr)g_source_ref((GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle);
/// <summary>
/// Detaches @child_source from @source and destroys it.
/// </summary>
/// <remarks>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="childSource">
/// a #GSource previously passed to
/// g_source_add_child_source().
/// </param>
[GISharp.Runtime.SinceAttribute("2.28")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_remove_child_source(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* childSource);
partial void CheckRemoveChildSourceArgs(GISharp.Lib.GLib.Source childSource);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.RemoveChildSource(GISharp.Lib.GLib.Source)']/*" />
[GISharp.Runtime.SinceAttribute("2.28")]
public void RemoveChildSource(GISharp.Lib.GLib.Source childSource)
{
CheckRemoveChildSourceArgs(childSource);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var childSource_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)childSource.UnsafeHandle;
g_source_remove_child_source(source_, childSource_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Removes a file descriptor from the set of file descriptors polled for
/// this source.
/// </summary>
/// <remarks>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="fd">
/// a #GPollFD structure previously passed to g_source_add_poll().
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_remove_poll(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="PollFD" type="GPollFD*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.PollFD* fd);
partial void CheckRemovePollArgs(ref GISharp.Lib.GLib.PollFD fd);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.RemovePoll(GISharp.Lib.GLib.PollFD)']/*" />
public void RemovePoll(ref GISharp.Lib.GLib.PollFD fd)
{
fixed (GISharp.Lib.GLib.PollFD* fd_ = &fd)
{
CheckRemovePollArgs(ref fd);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
g_source_remove_poll(source_, fd_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
}
/// <summary>
/// Reverses the effect of a previous call to g_source_add_unix_fd().
/// </summary>
/// <remarks>
/// <para>
/// You only need to call this if you want to remove an fd from being
/// watched while keeping the same source around. In the normal case you
/// will just want to destroy the source.
/// </para>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// <para>
/// As the name suggests, this function is not available on Windows.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="tag">
/// the tag from g_source_add_unix_fd()
/// </param>
[GISharp.Runtime.SinceAttribute("2.36")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_remove_unix_fd(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
System.IntPtr tag);
partial void CheckRemoveUnixFdArgs(System.IntPtr tag);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.RemoveUnixFd(System.IntPtr)']/*" />
[GISharp.Runtime.SinceAttribute("2.36")]
public void RemoveUnixFd(System.IntPtr tag)
{
CheckRemoveUnixFdArgs(tag);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var tag_ = (System.IntPtr)tag;
g_source_remove_unix_fd(source_, tag_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Sets the callback function for a source. The callback for a source is
/// called from the source's dispatch function.
/// </summary>
/// <remarks>
/// <para>
/// The exact type of @func depends on the type of source; ie. you
/// should not count on @func being called with @data as its first
/// parameter. Cast @func with G_SOURCE_FUNC() to avoid warnings about
/// incompatible function types.
/// </para>
/// <para>
/// See [memory management of sources][mainloop-memory-management] for details
/// on how to handle memory management of @data.
/// </para>
/// <para>
/// Typically, you won't use this function. Instead use functions specific
/// to the type of source you are using, such as g_idle_add() or g_timeout_add().
/// </para>
/// <para>
/// It is safe to call this function multiple times on a source which has already
/// been attached to a context. The changes will take effect for the next time
/// the source is dispatched after this call returns.
/// </para>
/// </remarks>
/// <param name="source">
/// the source
/// </param>
/// <param name="func">
/// a callback function
/// </param>
/// <param name="data">
/// the data to pass to callback function
/// </param>
/// <param name="notify">
/// a function to call when @data is no longer in use, or %NULL.
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_callback(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="SourceFunc" type="GSourceFunc" /> */
/* transfer-ownership:none scope:notified closure:1 destroy:2 direction:in */
delegate* unmanaged[Cdecl]<System.IntPtr, GISharp.Runtime.Boolean> func,
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 allow-none:1 direction:in */
System.IntPtr data,
/* <type name="DestroyNotify" type="GDestroyNotify" /> */
/* transfer-ownership:none nullable:1 allow-none:1 scope:async direction:in */
delegate* unmanaged[Cdecl]<System.IntPtr, void> notify);
partial void CheckSetCallbackArgs(GISharp.Lib.GLib.SourceFunc func);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.SetCallback(GISharp.Lib.GLib.SourceFunc)']/*" />
public void SetCallback(GISharp.Lib.GLib.SourceFunc func)
{
CheckSetCallbackArgs(func);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var func_ = (delegate* unmanaged[Cdecl]<System.IntPtr, GISharp.Runtime.Boolean>)&GISharp.Lib.GLib.SourceFuncMarshal.Callback;
var funcHandle = System.Runtime.InteropServices.GCHandle.Alloc((func, GISharp.Runtime.CallbackScope.Notified));
var data_ = (System.IntPtr)funcHandle;
var notify_ = (delegate* unmanaged[Cdecl]<System.IntPtr, void>)&GISharp.Runtime.GMarshal.DestroyGCHandle;
g_source_set_callback(source_, func_, data_, notify_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Sets the callback function storing the data as a refcounted callback
/// "object". This is used internally. Note that calling
/// g_source_set_callback_indirect() assumes
/// an initial reference count on @callback_data, and thus
/// @callback_funcs->unref will eventually be called once more
/// than @callback_funcs->ref.
/// </summary>
/// <remarks>
/// <para>
/// It is safe to call this function multiple times on a source which has already
/// been attached to a context. The changes will take effect for the next time
/// the source is dispatched after this call returns.
/// </para>
/// </remarks>
/// <param name="source">
/// the source
/// </param>
/// <param name="callbackData">
/// pointer to callback data "object"
/// </param>
/// <param name="callbackFuncs">
/// functions for reference counting @callback_data
/// and getting the callback and data
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_callback_indirect(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gpointer" type="gpointer" is-pointer="1" /> */
/* transfer-ownership:none nullable:1 allow-none:1 direction:in */
System.IntPtr callbackData,
/* <type name="SourceCallbackFuncs" type="GSourceCallbackFuncs*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.SourceCallbackFuncs* callbackFuncs);
partial void CheckSetCallbackIndirectArgs(System.IntPtr callbackData, ref GISharp.Lib.GLib.SourceCallbackFuncs callbackFuncs);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.SetCallbackIndirect(System.IntPtr,GISharp.Lib.GLib.SourceCallbackFuncs)']/*" />
public void SetCallbackIndirect(System.IntPtr callbackData, ref GISharp.Lib.GLib.SourceCallbackFuncs callbackFuncs)
{
fixed (GISharp.Lib.GLib.SourceCallbackFuncs* callbackFuncs_ = &callbackFuncs)
{
CheckSetCallbackIndirectArgs(callbackData, ref callbackFuncs);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var callbackData_ = (System.IntPtr)callbackData;
g_source_set_callback_indirect(source_, callbackData_, callbackFuncs_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
}
/// <summary>
/// Sets whether a source can be called recursively. If @can_recurse is
/// %TRUE, then while the source is being dispatched then this source
/// will be processed normally. Otherwise, all processing of this
/// source is blocked until the dispatch function returns.
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="canRecurse">
/// whether recursion is allowed for this source
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_can_recurse(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gboolean" type="gboolean" /> */
/* transfer-ownership:none direction:in */
GISharp.Runtime.Boolean canRecurse);
partial void CheckSetCanRecurseArgs(bool canRecurse);
private void SetCanRecurse(bool canRecurse)
{
CheckSetCanRecurseArgs(canRecurse);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var canRecurse_ = GISharp.Runtime.BooleanExtensions.ToBoolean(canRecurse);
g_source_set_can_recurse(source_, canRecurse_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Sets the source functions (can be used to override
/// default implementations) of an unattached source.
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="funcs">
/// the new #GSourceFuncs
/// </param>
[GISharp.Runtime.SinceAttribute("2.12")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_funcs(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="SourceFuncs" type="GSourceFuncs*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.SourceFuncs* funcs);
partial void CheckSetFuncsArgs(ref GISharp.Lib.GLib.SourceFuncs funcs);
/// <include file="Source.xmldoc" path="declaration/member[@name='Source.SetFuncs(GISharp.Lib.GLib.SourceFuncs)']/*" />
[GISharp.Runtime.SinceAttribute("2.12")]
public void SetFuncs(ref GISharp.Lib.GLib.SourceFuncs funcs)
{
fixed (GISharp.Lib.GLib.SourceFuncs* funcs_ = &funcs)
{
CheckSetFuncsArgs(ref funcs);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
g_source_set_funcs(source_, funcs_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
}
/// <summary>
/// Sets a name for the source, used in debugging and profiling.
/// The name defaults to #NULL.
/// </summary>
/// <remarks>
/// <para>
/// The source name should describe in a human-readable way
/// what the source does. For example, "X11 event queue"
/// or "GTK+ repaint idle handler" or whatever it is.
/// </para>
/// <para>
/// It is permitted to call this function multiple times, but is not
/// recommended due to the potential performance impact. For example,
/// one could change the name in the "check" function of a #GSourceFuncs
/// to include details like the event type in the source name.
/// </para>
/// <para>
/// Use caution if changing the name while another thread may be
/// accessing it with g_source_get_name(); that function does not copy
/// the value, and changing the value will free it while the other thread
/// may be attempting to use it.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="name">
/// debug name for the source
/// </param>
[GISharp.Runtime.SinceAttribute("2.26")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_name(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="utf8" type="const char*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
byte* name);
partial void CheckSetNameArgs(GISharp.Runtime.UnownedUtf8 name);
[GISharp.Runtime.SinceAttribute("2.26")]
private void SetName(GISharp.Runtime.UnownedUtf8 name)
{
CheckSetNameArgs(name);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var name_ = (byte*)name.UnsafeHandle;
g_source_set_name(source_, name_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Sets the priority of a source. While the main loop is being run, a
/// source will be dispatched if it is ready to be dispatched and no
/// sources at a higher (numerically smaller) priority are ready to be
/// dispatched.
/// </summary>
/// <remarks>
/// <para>
/// A child source always has the same priority as its parent. It is not
/// permitted to change the priority of a source once it has been added
/// as a child of another source.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="priority">
/// the new priority.
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_priority(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gint" type="gint" /> */
/* transfer-ownership:none direction:in */
int priority);
partial void CheckSetPriorityArgs(int priority);
private void SetPriority(int priority)
{
CheckSetPriorityArgs(priority);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var priority_ = (int)priority;
g_source_set_priority(source_, priority_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Sets a #GSource to be dispatched when the given monotonic time is
/// reached (or passed). If the monotonic time is in the past (as it
/// always will be if @ready_time is 0) then the source will be
/// dispatched immediately.
/// </summary>
/// <remarks>
/// <para>
/// If @ready_time is -1 then the source is never woken up on the basis
/// of the passage of time.
/// </para>
/// <para>
/// Dispatching the source does not reset the ready time. You should do
/// so yourself, from the source dispatch function.
/// </para>
/// <para>
/// Note that if you have a pair of sources where the ready time of one
/// suggests that it will be delivered first but the priority for the
/// other suggests that it would be delivered first, and the ready time
/// for both sources is reached during the same main context iteration,
/// then the order of dispatch is undefined.
/// </para>
/// <para>
/// It is a no-op to call this function on a #GSource which has already been
/// destroyed with g_source_destroy().
/// </para>
/// <para>
/// This API is only intended to be used by implementations of #GSource.
/// Do not call this API on a #GSource that you did not create.
/// </para>
/// </remarks>
/// <param name="source">
/// a #GSource
/// </param>
/// <param name="readyTime">
/// the monotonic time at which the source will be ready,
/// 0 for "immediately", -1 for "never"
/// </param>
[GISharp.Runtime.SinceAttribute("2.36")]
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_set_ready_time(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source,
/* <type name="gint64" type="gint64" /> */
/* transfer-ownership:none direction:in */
long readyTime);
partial void CheckSetReadyTimeArgs(long readyTime);
[GISharp.Runtime.SinceAttribute("2.36")]
private void SetReadyTime(long readyTime)
{
CheckSetReadyTimeArgs(readyTime);
var source_ = (GISharp.Lib.GLib.Source.UnmanagedStruct*)UnsafeHandle;
var readyTime_ = (long)readyTime;
g_source_set_ready_time(source_, readyTime_);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
/// <summary>
/// Decreases the reference count of a source by one. If the
/// resulting reference count is zero the source and associated
/// memory will be destroyed.
/// </summary>
/// <param name="source">
/// a #GSource
/// </param>
[System.Runtime.InteropServices.DllImportAttribute("glib-2.0", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
/* <type name="none" type="void" /> */
/* transfer-ownership:none direction:in */
private static extern void g_source_unref(
/* <type name="Source" type="GSource*" is-pointer="1" /> */
/* transfer-ownership:none direction:in */
GISharp.Lib.GLib.Source.UnmanagedStruct* source);
/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
if (handle != System.IntPtr.Zero)
{
g_source_unref((UnmanagedStruct*)handle);
GISharp.Runtime.GMarshal.PopUnhandledException();
}
base.Dispose(disposing);
}
}
} | 47.374847 | 171 | 0.603479 | [
"MIT"
] | dlech/gisharp | src/Lib/GLib-2.0/Source.Generated.cs | 77,600 | C# |
using UnityEngine;
namespace MagiCloud.RotateAndZoomTool
{
public static class RotateAndZoomManager
{
/// <summary>
/// 相机绕点旋转时候的水平轴方向上旋转的角度限制
/// </summary>
public static Vector2 Limit_CameraRotateAroundCenter_HorizontalAxis = new Vector2(0, 0);
/// <summary>
/// 相机绕点旋转时候的垂直轴方向上旋转的角度限制
/// </summary>
public static Vector2 Limit_CameraRotateAroundCenter_VerticalAxis = new Vector2(-85, 85);
/// <summary>
/// 相机自身旋转时候的水平轴方向上旋转的角度限制
/// </summary>
public static Vector2 Limit_CameraRotateSelf_HorizontalAxis = new Vector2(-360, 360);
/// <summary>
/// 相机自身旋转时候的垂直轴方向上旋转的角度限制
/// </summary>
public static Vector2 Limit_CameraRotateSelf_VerticalAxis = new Vector2(-85, 85);
/// <summary>
/// 相机缩放系数
/// </summary>
public static float Speed_CameraZoom = 20;
/// <summary>
/// 旋转速度 水平轴
/// </summary>
public static float Speed_CameraRotateAroundCenter_HorizontalAxis = 0.2f;
/// <summary>
/// 旋转速度 垂直轴
/// </summary>
public static float Speed_CameraRotateAroundCenter_VerticalAxis = 0.2f;
/// <summary>
/// 缩放暂停或者重启
/// </summary>
private static bool isPauseOrReStart_isZoom = false;
/// <summary>
/// 相机绕点旋转暂停或者重启
/// </summary>
private static bool isPauseOrReStart_CameraRotateAroundCenter = false;
/// <summary>
/// 相机自身转动开启后中间的暂停和重启
/// </summary>
private static bool isPauseOrReStart_CameraSelfRotate = false;
/// <summary>
/// 相机开启绕点转是否初始化完毕
/// </summary>
private static bool isDone_StartCameraAroundCenter_Initialization = false;
/// <summary>
/// 缩放暂停或者重启
/// </summary>
public static bool IsPauseOrReStart_CameraZoom
{
get
{
return isPauseOrReStart_isZoom;
}
set
{
CameraZoom.Instance.IsEnable = value;
isPauseOrReStart_isZoom = value;
}
}
/// <summary>
/// 相机绕点旋转暂停或者重启
/// </summary>
public static bool IsPauseOrReStart_CameraRotateAroundCenter
{
get
{
return isPauseOrReStart_CameraRotateAroundCenter;
}
set
{
CameraRotate.Instance.IsRotateCameraWithCenterEnable = value;
isPauseOrReStart_CameraRotateAroundCenter = value;
}
}
/// <summary>
/// 相机绕点旋转暂停或者重启
/// </summary>
public static bool IsPauseOrReStart_CameraSelfRotate
{
get
{
return isPauseOrReStart_CameraSelfRotate;
}
set
{
CameraRotate.Instance.IsSelfRotateCameraEnable = value;
isPauseOrReStart_CameraSelfRotate = value;
}
}
#region UI控制显示开关
/// <summary>
/// 相机开启绕点转是否初始化完毕
/// </summary>
public static bool IsDone_StartCameraAroundCenter_Initialization
{
get
{
return isDone_StartCameraAroundCenter_Initialization;
}
set
{
isDone_StartCameraAroundCenter_Initialization = value;
}
}
#endregion
#region 相机旋转开启与关闭
/// <summary>
/// 相机围绕某个中心旋转
/// </summary>
/// <param name="center"></param>
public static void StartCameraAroundCenter(Transform center, float duration = 0.5f)
{
CameraRotate.Instance.StartCameraRotateWithCenter(center, duration);
}
/// <summary>
/// 相机围绕某个中心旋转,可初始化相机位置
/// </summary>
/// <param name="center">围绕中心点</param>
/// <param name="pos">初始化相机位置</param>
/// <param name="qua">初始化相机角度</param>
public static void StartCameraAroundCenter(Transform center, Vector3 pos, Quaternion qua, float duration = 0.5f)
{
CameraRotate.Instance.StartCameraRotateWithCenter(center, pos, qua, duration);
}
/// <summary>
/// 关闭相机围绕某个中心旋转
/// </summary>
public static void StopCameraAroundCenter()
{
CameraRotate.Instance.StopCameraRotateWithCenter();
}
/// <summary>
/// 开启相机按自身轴转
/// </summary>
public static void StartCameraSelfRotate()
{
StopCameraAroundCenter();
CameraRotate.Instance.StartCameraSelfRotate();
}
/// <summary>
/// 关闭相机按自身轴转
/// </summary>
public static void StopCameraSelfRotate()
{
CameraRotate.Instance.StopCameraSelfRotate();
}
#endregion
#region 相机缩放开启与关闭
/// <summary>
/// 开启相机缩放
/// </summary>
/// <param name="center">缩放中心</param>
/// <param name="mindistance">距离中心最近距离</param>
/// <param name="maxdistance">距离中心最远距离</param>
public static void StartCameraZoom(Transform center, float mindistance, float maxdistance)
{
CameraZoom.Instance.StartCameraZoomWithCenter(center, mindistance, maxdistance);
}
/// <summary>
/// 关闭相机缩放
/// </summary>
public static void StopCameraZoom()
{
CameraZoom.Instance.StopCameraZoom();
}
/// <summary>
/// 旋转和缩放管理重置 参数和处理对象的数据
/// </summary>
public static void RotateAndZoomReset()
{
//角度限制的重置
Limit_CameraRotateAroundCenter_HorizontalAxis = new Vector2(0, 0);
Limit_CameraRotateAroundCenter_VerticalAxis = new Vector2(-85, 85);
Limit_CameraRotateSelf_HorizontalAxis = new Vector2(-360, 360);
Limit_CameraRotateSelf_VerticalAxis = new Vector2(-85, 85);
//缩放系数
Speed_CameraZoom = 20;
//暂停参数重置
IsPauseOrReStart_CameraRotateAroundCenter = false;
IsPauseOrReStart_CameraSelfRotate = false;
IsPauseOrReStart_CameraZoom = false;
//停止旋转和缩放
StopCameraAroundCenter();
StopCameraSelfRotate();
StopCameraZoom();
//旋转处理对象的清除
CameraRotate.Instance.rotateCore = null;
CameraRotate.Instance.dragMouseOrbit = null;
}
#endregion
}
}
| 26.805668 | 120 | 0.550823 | [
"MIT"
] | U3DC/MFrameworkCore | Assets/MagiCloud/Scripts/Operate/RotateAndZoomTool/RotateAndZoomManager.cs | 7,403 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Security.Cryptography.Asn1;
using System.Security.Cryptography.Pkcs.Asn1;
using System.Security.Cryptography.X509Certificates;
using Internal.Cryptography;
namespace System.Security.Cryptography.Pkcs
{
public sealed partial class SignedCms
{
private SignedDataAsn _signedData;
private bool _hasData;
private readonly SubjectIdentifierType _signerIdentifierType;
// A defensive copy of the relevant portions of the data to Decode
private Memory<byte> _heldData;
// Due to the way the underlying Windows CMS API behaves a copy of the content
// bytes will be held separate once the content is "bound" (first signature or decode)
private ReadOnlyMemory<byte>? _heldContent;
// During decode, if the PKCS#7 fallback for a missing OCTET STRING is present, this
// becomes true and GetHashableContentSpan behaves differently.
// See https://tools.ietf.org/html/rfc5652#section-5.2.1
private bool _hasPkcs7Content;
// Similar to _heldContent, the Windows CMS API held this separate internally,
// and thus we need to be reslilient against modification.
private string _contentType;
public int Version { get; private set; }
public ContentInfo ContentInfo { get; private set; }
public bool Detached { get; private set; }
public SignedCms(SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo, bool detached)
{
if (contentInfo == null)
throw new ArgumentNullException(nameof(contentInfo));
if (contentInfo.Content == null)
throw new ArgumentNullException("contentInfo.Content");
// Normalize the subject identifier type the same way as .NET Framework.
// This value is only used in the zero-argument ComputeSignature overload,
// where it controls whether it succeeds (NoSignature) or throws (anything else),
// but in case it ever applies to anything else, make sure we're storing it
// faithfully.
switch (signerIdentifierType)
{
case SubjectIdentifierType.NoSignature:
case SubjectIdentifierType.IssuerAndSerialNumber:
case SubjectIdentifierType.SubjectKeyIdentifier:
_signerIdentifierType = signerIdentifierType;
break;
default:
_signerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber;
break;
}
ContentInfo = contentInfo;
Detached = detached;
Version = 0;
}
public X509Certificate2Collection Certificates
{
get
{
var coll = new X509Certificate2Collection();
if (!_hasData)
{
return coll;
}
CertificateChoiceAsn[] certChoices = _signedData.CertificateSet;
if (certChoices == null)
{
return coll;
}
foreach (CertificateChoiceAsn choice in certChoices)
{
coll.Add(new X509Certificate2(choice.Certificate.Value.ToArray()));
}
return coll;
}
}
public SignerInfoCollection SignerInfos
{
get
{
if (!_hasData)
{
return new SignerInfoCollection();
}
return new SignerInfoCollection(_signedData.SignerInfos, this);
}
}
public byte[] Encode()
{
if (!_hasData)
{
throw new InvalidOperationException(SR.Cryptography_Cms_MessageNotSigned);
}
try
{
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.DER))
{
_signedData.Encode(writer);
return PkcsHelpers.EncodeContentInfo(writer.Encode(), Oids.Pkcs7Signed);
}
}
catch (CryptographicException) when (!Detached)
{
// If we can't write the contents back out then the most likely culprit is an
// indefinite length encoding in the content field. To preserve as much input data
// as possible while still maintaining our expectations of sorting any SET OF values,
// do the following:
// * Write the DER normalized version of the SignedData in detached mode.
// * BER-decode that structure
// * Copy the content field over
// * BER-write the modified structure.
SignedDataAsn copy = _signedData;
copy.EncapContentInfo.Content = null;
Debug.Assert(_signedData.EncapContentInfo.Content != null);
using (AsnWriter detachedWriter = new AsnWriter(AsnEncodingRules.DER))
{
copy.Encode(detachedWriter);
copy = SignedDataAsn.Decode(detachedWriter.Encode(), AsnEncodingRules.BER);
}
copy.EncapContentInfo.Content = _signedData.EncapContentInfo.Content;
using (AsnWriter attachedWriter = new AsnWriter(AsnEncodingRules.BER))
{
copy.Encode(attachedWriter);
return PkcsHelpers.EncodeContentInfo(attachedWriter.Encode(), Oids.Pkcs7Signed);
}
}
}
public void Decode(byte[] encodedMessage)
{
if (encodedMessage == null)
throw new ArgumentNullException(nameof(encodedMessage));
Decode(new ReadOnlyMemory<byte>(encodedMessage));
}
internal void Decode(ReadOnlyMemory<byte> encodedMessage)
{
// Windows (and thus NetFx) reads the leading data and ignores extra.
// So use the Decode overload which doesn't throw on extra data.
ContentInfoAsn.Decode(
new AsnReader(encodedMessage, AsnEncodingRules.BER),
out ContentInfoAsn contentInfo);
if (contentInfo.ContentType != Oids.Pkcs7Signed)
{
throw new CryptographicException(SR.Cryptography_Cms_InvalidMessageType);
}
// Hold a copy of the SignedData memory so we are protected against memory reuse by the caller.
_heldData = contentInfo.Content.ToArray();
_signedData = SignedDataAsn.Decode(_heldData, AsnEncodingRules.BER);
_contentType = _signedData.EncapContentInfo.ContentType;
_hasPkcs7Content = false;
if (!Detached)
{
ReadOnlyMemory<byte>? content = _signedData.EncapContentInfo.Content;
ReadOnlyMemory<byte> contentValue;
if (content.HasValue)
{
contentValue = GetContent(content.Value, _contentType);
// If no OCTET STRING was stripped off, we have PKCS7 interop concerns.
_hasPkcs7Content = content.Value.Length == contentValue.Length;
}
else
{
contentValue = ReadOnlyMemory<byte>.Empty;
}
// This is in _heldData, so we don't need a defensive copy.
_heldContent = contentValue;
// The ContentInfo object/property DOES need a defensive copy, because
// a) it is mutable by the user, and
// b) it is no longer authoritative
//
// (and c: it takes a byte[] and we have a ReadOnlyMemory<byte>)
ContentInfo = new ContentInfo(new Oid(_contentType), contentValue.ToArray());
}
else
{
// Hold a defensive copy of the content bytes, (Windows/NetFx compat)
_heldContent = ContentInfo.Content.CloneByteArray();
}
Version = _signedData.Version;
_hasData = true;
}
internal static ReadOnlyMemory<byte> GetContent(
ReadOnlyMemory<byte> wrappedContent,
string contentType)
{
// Read the input.
//
// PKCS7's id-data is written in both PKCS#7 and CMS as an OCTET STRING wrapping
// the arbitrary bytes, so the OCTET STRING must always be present.
//
// For other types, CMS says to always write an OCTET STRING, and to put the properly
// encoded data within it.
// PKCS#7 originally ommitted the OCTET STRING wrapper for this model, so this is the
// dynamic adapter.
//
// See https://tools.ietf.org/html/rfc5652#section-5.2.1
byte[] rented = null;
int bytesWritten = 0;
try
{
AsnReader reader = new AsnReader(wrappedContent, AsnEncodingRules.BER);
if (reader.TryReadPrimitiveOctetStringBytes(out ReadOnlyMemory<byte> inner))
{
return inner;
}
rented = CryptoPool.Rent(wrappedContent.Length);
if (!reader.TryCopyOctetStringBytes(rented, out bytesWritten))
{
Debug.Fail($"TryCopyOctetStringBytes failed with an array larger than the encoded value");
throw new CryptographicException();
}
return rented.AsSpan(0, bytesWritten).ToArray();
}
catch (Exception) when (contentType != Oids.Pkcs7Data)
{
}
finally
{
if (rented != null)
{
CryptoPool.Return(rented, bytesWritten);
}
}
// PKCS#7 encoding for something other than id-data.
Debug.Assert(contentType != Oids.Pkcs7Data);
return wrappedContent;
}
public void ComputeSignature() => ComputeSignature(new CmsSigner(_signerIdentifierType), true);
public void ComputeSignature(CmsSigner signer) => ComputeSignature(signer, true);
public void ComputeSignature(CmsSigner signer, bool silent)
{
if (signer == null)
{
throw new ArgumentNullException(nameof(signer));
}
// While it shouldn't be possible to change the length of ContentInfo.Content
// after it's built, use the property at this stage, then use the saved value
// (if applicable) after this point.
if (ContentInfo.Content.Length == 0)
{
throw new CryptographicException(SR.Cryptography_Cms_Sign_Empty_Content);
}
if (_hasData && signer.SignerIdentifierType == SubjectIdentifierType.NoSignature)
{
// Even if all signers have been removed, throw if doing a NoSignature signature
// on a loaded (from file, or from first signature) document.
//
// This matches the NetFX behavior.
throw new CryptographicException(SR.Cryptography_Cms_Sign_No_Signature_First_Signer);
}
if (signer.Certificate == null && signer.SignerIdentifierType != SubjectIdentifierType.NoSignature)
{
if (silent)
{
// NetFX compatibility, silent disallows prompting, so throws InvalidOperationException
// in this state.
//
// The message is different than on NetFX, because the resource string was for
// enveloped CMS recipients (and the other site which would use that resource
// is unreachable code due to CmsRecipient's ctor guarding against null certificates)
throw new InvalidOperationException(SR.Cryptography_Cms_NoSignerCertSilent);
}
// Otherwise, PNSE. .NET Core doesn't support launching the cert picker UI.
throw new PlatformNotSupportedException(SR.Cryptography_Cms_NoSignerCert);
}
// If we had content already, use that now.
// (The second signer doesn't inherit edits to signedCms.ContentInfo.Content)
ReadOnlyMemory<byte> content = _heldContent ?? ContentInfo.Content;
string contentType = _contentType ?? ContentInfo.ContentType.Value ?? Oids.Pkcs7Data;
X509Certificate2Collection chainCerts;
SignerInfoAsn newSigner = signer.Sign(content, contentType, silent, out chainCerts);
bool firstSigner = false;
if (!_hasData)
{
firstSigner = true;
_signedData = new SignedDataAsn
{
DigestAlgorithms = Array.Empty<AlgorithmIdentifierAsn>(),
SignerInfos = Array.Empty<SignerInfoAsn>(),
EncapContentInfo = new EncapsulatedContentInfoAsn { ContentType = contentType },
};
// Since we're going to call Decode before this method exits we don't need to save
// the copy of _heldContent or _contentType here if we're attached.
if (!Detached)
{
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.DER))
{
writer.WriteOctetString(content.Span);
_signedData.EncapContentInfo.Content = writer.Encode();
}
}
_hasData = true;
}
int newIdx = _signedData.SignerInfos.Length;
Array.Resize(ref _signedData.SignerInfos, newIdx + 1);
_signedData.SignerInfos[newIdx] = newSigner;
UpdateCertificatesFromAddition(chainCerts);
ConsiderDigestAddition(newSigner.DigestAlgorithm);
UpdateMetadata();
if (firstSigner)
{
Reencode();
Debug.Assert(_heldContent != null);
Debug.Assert(_contentType == contentType);
}
}
public void RemoveSignature(int index)
{
if (!_hasData)
{
throw new InvalidOperationException(SR.Cryptography_Cms_MessageNotSigned);
}
if (index < 0 || index >= _signedData.SignerInfos.Length)
{
throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
AlgorithmIdentifierAsn signerAlgorithm = _signedData.SignerInfos[index].DigestAlgorithm;
PkcsHelpers.RemoveAt(ref _signedData.SignerInfos, index);
ConsiderDigestRemoval(signerAlgorithm);
UpdateMetadata();
}
public void RemoveSignature(SignerInfo signerInfo)
{
if (signerInfo == null)
throw new ArgumentNullException(nameof(signerInfo));
int idx = SignerInfos.FindIndexForSigner(signerInfo);
if (idx < 0)
{
throw new CryptographicException(SR.Cryptography_Cms_SignerNotFound);
}
RemoveSignature(idx);
}
internal ReadOnlySpan<byte> GetHashableContentSpan()
{
ReadOnlyMemory<byte> content = _heldContent.Value;
if (!_hasPkcs7Content)
{
return content.Span;
}
// In PKCS#7 compat, only return the contents within the outermost tag.
// See https://tools.ietf.org/html/rfc5652#section-5.2.1
AsnReader reader = new AsnReader(content, AsnEncodingRules.BER);
// This span is safe to return because it's still bound under _heldContent.
return reader.PeekContentBytes().Span;
}
internal void Reencode()
{
// When NetFx re-encodes it just resets the CMS handle, the ContentInfo property
// does not get changed.
// See ReopenToDecode
ContentInfo save = ContentInfo;
try
{
byte[] encoded = Encode();
if (Detached)
{
// At this point the _heldContent becomes whatever ContentInfo says it should be.
_heldContent = null;
}
Decode(encoded);
Debug.Assert(_heldContent != null);
}
finally
{
ContentInfo = save;
}
}
private void UpdateMetadata()
{
// Version 5: any certificate of type Other or CRL of type Other. We don't support this.
// Version 4: any certificates are V2 attribute certificates. We don't support this.
// Version 3a: any certificates are V1 attribute certificates. We don't support this.
// Version 3b: any signerInfos are v3
// Version 3c: eContentType != data
// Version 2: does not exist for signed-data
// Version 1: default
// The versions 3 are OR conditions, so we need to check the content type and the signerinfos.
int version = 1;
if ((_contentType ?? ContentInfo.ContentType.Value) != Oids.Pkcs7Data)
{
version = 3;
}
else if (_signedData.SignerInfos.Any(si => si.Version == 3))
{
version = 3;
}
Version = version;
_signedData.Version = version;
}
private void ConsiderDigestAddition(AlgorithmIdentifierAsn candidate)
{
int curLength = _signedData.DigestAlgorithms.Length;
for (int i = 0; i < curLength; i++)
{
ref AlgorithmIdentifierAsn alg = ref _signedData.DigestAlgorithms[i];
if (candidate.Equals(ref alg))
{
return;
}
}
Array.Resize(ref _signedData.DigestAlgorithms, curLength + 1);
_signedData.DigestAlgorithms[curLength] = candidate;
}
private void ConsiderDigestRemoval(AlgorithmIdentifierAsn candidate)
{
bool remove = true;
for (int i = 0; i < _signedData.SignerInfos.Length; i++)
{
ref AlgorithmIdentifierAsn signerAlg = ref _signedData.SignerInfos[i].DigestAlgorithm;
if (candidate.Equals(ref signerAlg))
{
remove = false;
break;
}
}
if (!remove)
{
return;
}
for (int i = 0; i < _signedData.DigestAlgorithms.Length; i++)
{
ref AlgorithmIdentifierAsn alg = ref _signedData.DigestAlgorithms[i];
if (candidate.Equals(ref alg))
{
PkcsHelpers.RemoveAt(ref _signedData.DigestAlgorithms, i);
break;
}
}
}
internal void UpdateCertificatesFromAddition(X509Certificate2Collection newCerts)
{
if (newCerts.Count == 0)
{
return;
}
int existingLength = _signedData.CertificateSet?.Length ?? 0;
if (existingLength > 0 || newCerts.Count > 1)
{
var certs = new HashSet<X509Certificate2>(Certificates.OfType<X509Certificate2>());
for (int i = 0; i < newCerts.Count; i++)
{
X509Certificate2 candidate = newCerts[i];
if (!certs.Add(candidate))
{
newCerts.RemoveAt(i);
i--;
}
}
}
if (newCerts.Count == 0)
{
return;
}
if (_signedData.CertificateSet == null)
{
_signedData.CertificateSet = new CertificateChoiceAsn[newCerts.Count];
}
else
{
Array.Resize(ref _signedData.CertificateSet, existingLength + newCerts.Count);
}
for (int i = existingLength; i < _signedData.CertificateSet.Length; i++)
{
_signedData.CertificateSet[i] = new CertificateChoiceAsn
{
Certificate = newCerts[i - existingLength].RawData
};
}
}
public void CheckSignature(bool verifySignatureOnly) =>
CheckSignature(new X509Certificate2Collection(), verifySignatureOnly);
public void CheckSignature(X509Certificate2Collection extraStore, bool verifySignatureOnly)
{
if (!_hasData)
throw new InvalidOperationException(SR.Cryptography_Cms_MessageNotSigned);
if (extraStore == null)
throw new ArgumentNullException(nameof(extraStore));
CheckSignatures(SignerInfos, extraStore, verifySignatureOnly);
}
private static void CheckSignatures(
SignerInfoCollection signers,
X509Certificate2Collection extraStore,
bool verifySignatureOnly)
{
Debug.Assert(signers != null);
if (signers.Count < 1)
{
throw new CryptographicException(SR.Cryptography_Cms_NoSignerAtIndex);
}
foreach (SignerInfo signer in signers)
{
signer.CheckSignature(extraStore, verifySignatureOnly);
SignerInfoCollection counterSigners = signer.CounterSignerInfos;
if (counterSigners.Count > 0)
{
CheckSignatures(counterSigners, extraStore, verifySignatureOnly);
}
}
}
public void CheckHash()
{
if (!_hasData)
throw new InvalidOperationException(SR.Cryptography_Cms_MessageNotSigned);
SignerInfoCollection signers = SignerInfos;
Debug.Assert(signers != null);
if (signers.Count < 1)
{
throw new CryptographicException(SR.Cryptography_Cms_NoSignerAtIndex);
}
foreach (SignerInfo signer in signers)
{
if (signer.SignerIdentifier.Type == SubjectIdentifierType.NoSignature)
{
signer.CheckHash();
}
}
}
internal ref SignedDataAsn GetRawData()
{
return ref _signedData;
}
public void AddCertificate(X509Certificate2 certificate)
{
int existingLength = _signedData.CertificateSet?.Length ?? 0;
byte[] rawData = certificate.RawData;
if (existingLength > 0)
{
foreach (CertificateChoiceAsn cert in _signedData.CertificateSet)
{
if (cert.Certificate.Value.Span.SequenceEqual(rawData))
{
throw new CryptographicException(SR.Cryptography_Cms_CertificateAlreadyInCollection);
}
}
}
if (_signedData.CertificateSet == null)
{
_signedData.CertificateSet = new CertificateChoiceAsn[1];
}
else
{
Array.Resize(ref _signedData.CertificateSet, existingLength + 1);
}
_signedData.CertificateSet[existingLength] = new CertificateChoiceAsn
{
Certificate = rawData
};
Reencode();
}
public void RemoveCertificate(X509Certificate2 certificate)
{
int existingLength = _signedData.CertificateSet?.Length ?? 0;
if (existingLength != 0)
{
int idx = 0;
byte[] rawData = certificate.RawData;
foreach (CertificateChoiceAsn cert in _signedData.CertificateSet)
{
if (cert.Certificate.Value.Span.SequenceEqual(rawData))
{
PkcsHelpers.RemoveAt(ref _signedData.CertificateSet, idx);
Reencode();
return;
}
idx++;
}
}
throw new CryptographicException(SR.Cryptography_Cms_NoCertificateFound);
}
}
}
| 36.531025 | 111 | 0.549415 | [
"MIT"
] | 939481896/dotnet-corefx | src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs | 25,316 | C# |
/**
* Copyright 2013 Canada Health Infoway, 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.
*
* Author: $LastChangedBy: gng $
* Last modified: $LastChangedDate: 2015-11-19 18:20:12 -0500 (Fri, 30 Jan 2015) $
* Revision: $LastChangedRevision: 9755 $
*/
/* This class was auto-generated by the message builder generator tools. */
using Ca.Infoway.Messagebuilder;
namespace Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Domainvalue {
public interface x_InformationRecipient : Code {
}
}
| 36.275862 | 83 | 0.709125 | [
"ECL-2.0",
"Apache-2.0"
] | CanadaHealthInfoway/message-builder-dotnet | message-builder-release-cda-ab-shr/Main/Ca/Infoway/Messagebuilder/Model/Cda_ab_shr/Domainvalue/x_InformationRecipient.cs | 1,052 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System;
using System.Collections.Generic;
using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.companyreg.Model.V20200306;
namespace Aliyun.Acs.companyreg.Transform.V20200306
{
public class ListUserProduceOperateLogsResponseUnmarshaller
{
public static ListUserProduceOperateLogsResponse Unmarshall(UnmarshallerContext _ctx)
{
ListUserProduceOperateLogsResponse listUserProduceOperateLogsResponse = new ListUserProduceOperateLogsResponse();
listUserProduceOperateLogsResponse.HttpResponse = _ctx.HttpResponse;
listUserProduceOperateLogsResponse.PageNum = _ctx.IntegerValue("ListUserProduceOperateLogs.PageNum");
listUserProduceOperateLogsResponse.PageSize = _ctx.IntegerValue("ListUserProduceOperateLogs.PageSize");
listUserProduceOperateLogsResponse.RequestId = _ctx.StringValue("ListUserProduceOperateLogs.RequestId");
listUserProduceOperateLogsResponse.Success = _ctx.BooleanValue("ListUserProduceOperateLogs.Success");
listUserProduceOperateLogsResponse.TotalItemNum = _ctx.IntegerValue("ListUserProduceOperateLogs.TotalItemNum");
listUserProduceOperateLogsResponse.TotalPageNum = _ctx.IntegerValue("ListUserProduceOperateLogs.TotalPageNum");
List<ListUserProduceOperateLogsResponse.ListUserProduceOperateLogs_OpateLogs> listUserProduceOperateLogsResponse_data = new List<ListUserProduceOperateLogsResponse.ListUserProduceOperateLogs_OpateLogs>();
for (int i = 0; i < _ctx.Length("ListUserProduceOperateLogs.Data.Length"); i++) {
ListUserProduceOperateLogsResponse.ListUserProduceOperateLogs_OpateLogs opateLogs = new ListUserProduceOperateLogsResponse.ListUserProduceOperateLogs_OpateLogs();
opateLogs.BizId = _ctx.StringValue("ListUserProduceOperateLogs.Data["+ i +"].BizId");
opateLogs.BizType = _ctx.StringValue("ListUserProduceOperateLogs.Data["+ i +"].BizType");
opateLogs.OperateName = _ctx.StringValue("ListUserProduceOperateLogs.Data["+ i +"].OperateName");
opateLogs.OperateTime = _ctx.LongValue("ListUserProduceOperateLogs.Data["+ i +"].OperateTime");
opateLogs.OperateUserType = _ctx.StringValue("ListUserProduceOperateLogs.Data["+ i +"].OperateUserType");
opateLogs.BizStatus = _ctx.IntegerValue("ListUserProduceOperateLogs.Data["+ i +"].BizStatus");
opateLogs.ToBizStatus = _ctx.IntegerValue("ListUserProduceOperateLogs.Data["+ i +"].ToBizStatus");
listUserProduceOperateLogsResponse_data.Add(opateLogs);
}
listUserProduceOperateLogsResponse.Data = listUserProduceOperateLogsResponse_data;
return listUserProduceOperateLogsResponse;
}
}
}
| 56.983333 | 208 | 0.794092 | [
"Apache-2.0"
] | aliyun/aliyun-openapi-net-sdk | aliyun-net-sdk-companyreg/Companyreg/Transform/V20200306/ListUserProduceOperateLogsResponseUnmarshaller.cs | 3,419 | C# |
using Elastic.Xunit.XunitPlumbing;
using Nest;
namespace Examples.XPack.Docs.En.RestApi.Security
{
public class GetAppPrivilegesPage : ExampleBase
{
[U(Skip = "Example not implemented")]
public void Line59()
{
// tag::cd8006165ac64f1ef99af48e5a35a25b[]
var response0 = new SearchResponse<object>();
// end::cd8006165ac64f1ef99af48e5a35a25b[]
response0.MatchesExample(@"GET /_security/privilege/myapp/read");
}
[U(Skip = "Example not implemented")]
public void Line91()
{
// tag::3b18e9de638ff0b1c7a1f1f6bf1c24f3[]
var response0 = new SearchResponse<object>();
// end::3b18e9de638ff0b1c7a1f1f6bf1c24f3[]
response0.MatchesExample(@"GET /_security/privilege/myapp/");
}
[U(Skip = "Example not implemented")]
public void Line99()
{
// tag::0ddf705317d9c5095b4a1419a2e3bace[]
var response0 = new SearchResponse<object>();
// end::0ddf705317d9c5095b4a1419a2e3bace[]
response0.MatchesExample(@"GET /_security/privilege/");
}
}
} | 26.052632 | 68 | 0.718182 | [
"Apache-2.0"
] | FrankyBoy/elasticsearch-net | src/Examples/Examples/XPack/Docs/En/RestApi/Security/GetAppPrivilegesPage.cs | 990 | C# |
using System;
using NetRuntimeSystem = System;
using System.ComponentModel;
using NetOffice;
namespace NetOffice.MSHTMLApi
{
#region Delegates
#pragma warning disable
public delegate void HTMLDocument_onhelpEventHandler();
public delegate void HTMLDocument_onclickEventHandler();
public delegate void HTMLDocument_ondblclickEventHandler();
public delegate void HTMLDocument_onkeydownEventHandler();
public delegate void HTMLDocument_onkeyupEventHandler();
public delegate void HTMLDocument_onkeypressEventHandler();
public delegate void HTMLDocument_onmousedownEventHandler();
public delegate void HTMLDocument_onmousemoveEventHandler();
public delegate void HTMLDocument_onmouseupEventHandler();
public delegate void HTMLDocument_onmouseoutEventHandler();
public delegate void HTMLDocument_onmouseoverEventHandler();
public delegate void HTMLDocument_onreadystatechangeEventHandler();
public delegate void HTMLDocument_onbeforeupdateEventHandler();
public delegate void HTMLDocument_onafterupdateEventHandler();
public delegate void HTMLDocument_onrowexitEventHandler();
public delegate void HTMLDocument_onrowenterEventHandler();
public delegate void HTMLDocument_ondragstartEventHandler();
public delegate void HTMLDocument_onselectstartEventHandler();
public delegate void HTMLDocument_onerrorupdateEventHandler();
public delegate void HTMLDocument_oncontextmenuEventHandler();
public delegate void HTMLDocument_onstopEventHandler();
public delegate void HTMLDocument_onrowsdeleteEventHandler();
public delegate void HTMLDocument_onrowsinsertedEventHandler();
public delegate void HTMLDocument_oncellchangeEventHandler();
public delegate void HTMLDocument_onpropertychangeEventHandler();
public delegate void HTMLDocument_ondatasetchangedEventHandler();
public delegate void HTMLDocument_ondataavailableEventHandler();
public delegate void HTMLDocument_ondatasetcompleteEventHandler();
public delegate void HTMLDocument_onbeforeeditfocusEventHandler();
public delegate void HTMLDocument_onselectionchangeEventHandler();
public delegate void HTMLDocument_oncontrolselectEventHandler();
public delegate void HTMLDocument_onmousewheelEventHandler();
public delegate void HTMLDocument_onfocusinEventHandler();
public delegate void HTMLDocument_onfocusoutEventHandler();
public delegate void HTMLDocument_onactivateEventHandler();
public delegate void HTMLDocument_ondeactivateEventHandler();
public delegate void HTMLDocument_onbeforeactivateEventHandler();
public delegate void HTMLDocument_onbeforedeactivateEventHandler();
#pragma warning restore
#endregion
///<summary>
/// CoClass HTMLDocument
/// SupportByVersion MSHTML, 4
///</summary>
[SupportByVersionAttribute("MSHTML", 4)]
[EntityTypeAttribute(EntityType.IsCoClass)]
public class HTMLDocument : DispHTMLDocument,IEventBinding
{
#pragma warning disable
#region Fields
private NetRuntimeSystem.Runtime.InteropServices.ComTypes.IConnectionPoint _connectPoint;
private string _activeSinkId;
private NetRuntimeSystem.Type _thisType;
HTMLDocumentEvents_SinkHelper _hTMLDocumentEvents_SinkHelper;
#endregion
#region Type Information
private static Type _type;
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public static Type LateBindingApiWrapperType
{
get
{
if (null == _type)
_type = typeof(HTMLDocument);
return _type;
}
}
#endregion
#region Construction
///<param name="factory">current used factory core</param>
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
public HTMLDocument(Core factory, COMObject parentObject, object comProxy) : base(factory, parentObject, comProxy)
{
}
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
public HTMLDocument(COMObject parentObject, object comProxy) : base(parentObject, comProxy)
{
}
///<param name="factory">current used factory core</param>
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public HTMLDocument(Core factory, COMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType)
{
}
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public HTMLDocument(COMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType)
{
}
///<param name="replacedObject">object to replaced. replacedObject are not usable after this action</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public HTMLDocument(COMObject replacedObject) : base(replacedObject)
{
}
///<summary>
/// Creates a new instance of HTMLDocument
///</summary>
public HTMLDocument():base("MSHTML.HTMLDocument")
{
}
///<summary>
/// Creates a new instance of HTMLDocument
///</summary>
///<param name="progId">registered ProgID</param>
public HTMLDocument(string progId):base(progId)
{
}
#endregion
#region Static CoClass Methods
/// <summary>
/// Returns all running MSHTML.HTMLDocument objects from the environment/system
/// </summary>
/// <returns>an MSHTML.HTMLDocument array</returns>
public static NetOffice.MSHTMLApi.HTMLDocument[] GetActiveInstances()
{
IDisposableEnumeration proxyList = NetOffice.ProxyService.GetActiveInstances("MSHTML","HTMLDocument");
NetRuntimeSystem.Collections.Generic.List<NetOffice.MSHTMLApi.HTMLDocument> resultList = new NetRuntimeSystem.Collections.Generic.List<NetOffice.MSHTMLApi.HTMLDocument>();
foreach(object proxy in proxyList)
resultList.Add( new NetOffice.MSHTMLApi.HTMLDocument(null, proxy) );
return resultList.ToArray();
}
/// <summary>
/// Returns a running MSHTML.HTMLDocument object from the environment/system.
/// </summary>
/// <returns>an MSHTML.HTMLDocument object or null</returns>
public static NetOffice.MSHTMLApi.HTMLDocument GetActiveInstance()
{
object proxy = NetOffice.ProxyService.GetActiveInstance("MSHTML","HTMLDocument", false);
if(null != proxy)
return new NetOffice.MSHTMLApi.HTMLDocument(null, proxy);
else
return null;
}
/// <summary>
/// Returns a running MSHTML.HTMLDocument object from the environment/system.
/// </summary>
/// <param name="throwOnError">throw an exception if no object was found</param>
/// <returns>an MSHTML.HTMLDocument object or null</returns>
public static NetOffice.MSHTMLApi.HTMLDocument GetActiveInstance(bool throwOnError)
{
object proxy = NetOffice.ProxyService.GetActiveInstance("MSHTML","HTMLDocument", throwOnError);
if(null != proxy)
return new NetOffice.MSHTMLApi.HTMLDocument(null, proxy);
else
return null;
}
#endregion
#region Events
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onhelpEventHandler _onhelpEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onhelpEventHandler onhelpEvent
{
add
{
CreateEventBridge();
_onhelpEvent += value;
}
remove
{
_onhelpEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onclickEventHandler _onclickEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onclickEventHandler onclickEvent
{
add
{
CreateEventBridge();
_onclickEvent += value;
}
remove
{
_onclickEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_ondblclickEventHandler _ondblclickEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_ondblclickEventHandler ondblclickEvent
{
add
{
CreateEventBridge();
_ondblclickEvent += value;
}
remove
{
_ondblclickEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onkeydownEventHandler _onkeydownEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onkeydownEventHandler onkeydownEvent
{
add
{
CreateEventBridge();
_onkeydownEvent += value;
}
remove
{
_onkeydownEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onkeyupEventHandler _onkeyupEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onkeyupEventHandler onkeyupEvent
{
add
{
CreateEventBridge();
_onkeyupEvent += value;
}
remove
{
_onkeyupEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onkeypressEventHandler _onkeypressEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onkeypressEventHandler onkeypressEvent
{
add
{
CreateEventBridge();
_onkeypressEvent += value;
}
remove
{
_onkeypressEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onmousedownEventHandler _onmousedownEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onmousedownEventHandler onmousedownEvent
{
add
{
CreateEventBridge();
_onmousedownEvent += value;
}
remove
{
_onmousedownEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onmousemoveEventHandler _onmousemoveEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onmousemoveEventHandler onmousemoveEvent
{
add
{
CreateEventBridge();
_onmousemoveEvent += value;
}
remove
{
_onmousemoveEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onmouseupEventHandler _onmouseupEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onmouseupEventHandler onmouseupEvent
{
add
{
CreateEventBridge();
_onmouseupEvent += value;
}
remove
{
_onmouseupEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onmouseoutEventHandler _onmouseoutEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onmouseoutEventHandler onmouseoutEvent
{
add
{
CreateEventBridge();
_onmouseoutEvent += value;
}
remove
{
_onmouseoutEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onmouseoverEventHandler _onmouseoverEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onmouseoverEventHandler onmouseoverEvent
{
add
{
CreateEventBridge();
_onmouseoverEvent += value;
}
remove
{
_onmouseoverEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onreadystatechangeEventHandler _onreadystatechangeEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onreadystatechangeEventHandler onreadystatechangeEvent
{
add
{
CreateEventBridge();
_onreadystatechangeEvent += value;
}
remove
{
_onreadystatechangeEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onbeforeupdateEventHandler _onbeforeupdateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onbeforeupdateEventHandler onbeforeupdateEvent
{
add
{
CreateEventBridge();
_onbeforeupdateEvent += value;
}
remove
{
_onbeforeupdateEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onafterupdateEventHandler _onafterupdateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onafterupdateEventHandler onafterupdateEvent
{
add
{
CreateEventBridge();
_onafterupdateEvent += value;
}
remove
{
_onafterupdateEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onrowexitEventHandler _onrowexitEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onrowexitEventHandler onrowexitEvent
{
add
{
CreateEventBridge();
_onrowexitEvent += value;
}
remove
{
_onrowexitEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onrowenterEventHandler _onrowenterEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onrowenterEventHandler onrowenterEvent
{
add
{
CreateEventBridge();
_onrowenterEvent += value;
}
remove
{
_onrowenterEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_ondragstartEventHandler _ondragstartEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_ondragstartEventHandler ondragstartEvent
{
add
{
CreateEventBridge();
_ondragstartEvent += value;
}
remove
{
_ondragstartEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onselectstartEventHandler _onselectstartEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onselectstartEventHandler onselectstartEvent
{
add
{
CreateEventBridge();
_onselectstartEvent += value;
}
remove
{
_onselectstartEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onerrorupdateEventHandler _onerrorupdateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onerrorupdateEventHandler onerrorupdateEvent
{
add
{
CreateEventBridge();
_onerrorupdateEvent += value;
}
remove
{
_onerrorupdateEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_oncontextmenuEventHandler _oncontextmenuEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_oncontextmenuEventHandler oncontextmenuEvent
{
add
{
CreateEventBridge();
_oncontextmenuEvent += value;
}
remove
{
_oncontextmenuEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onstopEventHandler _onstopEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onstopEventHandler onstopEvent
{
add
{
CreateEventBridge();
_onstopEvent += value;
}
remove
{
_onstopEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onrowsdeleteEventHandler _onrowsdeleteEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onrowsdeleteEventHandler onrowsdeleteEvent
{
add
{
CreateEventBridge();
_onrowsdeleteEvent += value;
}
remove
{
_onrowsdeleteEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onrowsinsertedEventHandler _onrowsinsertedEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onrowsinsertedEventHandler onrowsinsertedEvent
{
add
{
CreateEventBridge();
_onrowsinsertedEvent += value;
}
remove
{
_onrowsinsertedEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_oncellchangeEventHandler _oncellchangeEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_oncellchangeEventHandler oncellchangeEvent
{
add
{
CreateEventBridge();
_oncellchangeEvent += value;
}
remove
{
_oncellchangeEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onpropertychangeEventHandler _onpropertychangeEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onpropertychangeEventHandler onpropertychangeEvent
{
add
{
CreateEventBridge();
_onpropertychangeEvent += value;
}
remove
{
_onpropertychangeEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_ondatasetchangedEventHandler _ondatasetchangedEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_ondatasetchangedEventHandler ondatasetchangedEvent
{
add
{
CreateEventBridge();
_ondatasetchangedEvent += value;
}
remove
{
_ondatasetchangedEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_ondataavailableEventHandler _ondataavailableEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_ondataavailableEventHandler ondataavailableEvent
{
add
{
CreateEventBridge();
_ondataavailableEvent += value;
}
remove
{
_ondataavailableEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_ondatasetcompleteEventHandler _ondatasetcompleteEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_ondatasetcompleteEventHandler ondatasetcompleteEvent
{
add
{
CreateEventBridge();
_ondatasetcompleteEvent += value;
}
remove
{
_ondatasetcompleteEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onbeforeeditfocusEventHandler _onbeforeeditfocusEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onbeforeeditfocusEventHandler onbeforeeditfocusEvent
{
add
{
CreateEventBridge();
_onbeforeeditfocusEvent += value;
}
remove
{
_onbeforeeditfocusEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onselectionchangeEventHandler _onselectionchangeEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onselectionchangeEventHandler onselectionchangeEvent
{
add
{
CreateEventBridge();
_onselectionchangeEvent += value;
}
remove
{
_onselectionchangeEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_oncontrolselectEventHandler _oncontrolselectEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_oncontrolselectEventHandler oncontrolselectEvent
{
add
{
CreateEventBridge();
_oncontrolselectEvent += value;
}
remove
{
_oncontrolselectEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onmousewheelEventHandler _onmousewheelEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onmousewheelEventHandler onmousewheelEvent
{
add
{
CreateEventBridge();
_onmousewheelEvent += value;
}
remove
{
_onmousewheelEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onfocusinEventHandler _onfocusinEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onfocusinEventHandler onfocusinEvent
{
add
{
CreateEventBridge();
_onfocusinEvent += value;
}
remove
{
_onfocusinEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onfocusoutEventHandler _onfocusoutEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onfocusoutEventHandler onfocusoutEvent
{
add
{
CreateEventBridge();
_onfocusoutEvent += value;
}
remove
{
_onfocusoutEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onactivateEventHandler _onactivateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onactivateEventHandler onactivateEvent
{
add
{
CreateEventBridge();
_onactivateEvent += value;
}
remove
{
_onactivateEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_ondeactivateEventHandler _ondeactivateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_ondeactivateEventHandler ondeactivateEvent
{
add
{
CreateEventBridge();
_ondeactivateEvent += value;
}
remove
{
_ondeactivateEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onbeforeactivateEventHandler _onbeforeactivateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onbeforeactivateEventHandler onbeforeactivateEvent
{
add
{
CreateEventBridge();
_onbeforeactivateEvent += value;
}
remove
{
_onbeforeactivateEvent -= value;
}
}
/// <summary>
/// SupportByVersion MSHTML, 4
/// </summary>
private event HTMLDocument_onbeforedeactivateEventHandler _onbeforedeactivateEvent;
/// <summary>
/// SupportByVersion MSHTML 4
/// </summary>
[SupportByVersion("MSHTML", 4)]
public event HTMLDocument_onbeforedeactivateEventHandler onbeforedeactivateEvent
{
add
{
CreateEventBridge();
_onbeforedeactivateEvent += value;
}
remove
{
_onbeforedeactivateEvent -= value;
}
}
#endregion
#region IEventBinding Member
/// <summary>
/// Creates active sink helper
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public void CreateEventBridge()
{
if(false == Factory.Settings.EnableEvents)
return;
if (null != _connectPoint)
return;
if (null == _activeSinkId)
_activeSinkId = SinkHelper.GetConnectionPoint(this, ref _connectPoint, HTMLDocumentEvents_SinkHelper.Id);
if(HTMLDocumentEvents_SinkHelper.Id.Equals(_activeSinkId, StringComparison.InvariantCultureIgnoreCase))
{
_hTMLDocumentEvents_SinkHelper = new HTMLDocumentEvents_SinkHelper(this, _connectPoint);
return;
}
}
/// <summary>
/// The instance use currently an event listener
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public bool EventBridgeInitialized
{
get
{
return (null != _connectPoint);
}
}
/// <summary>
/// The instance has currently one or more event recipients
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public bool HasEventRecipients()
{
if(null == _thisType)
_thisType = this.GetType();
foreach (NetRuntimeSystem.Reflection.EventInfo item in _thisType.GetEvents())
{
MulticastDelegate eventDelegate = (MulticastDelegate) _thisType.GetType().GetField(item.Name,
NetRuntimeSystem.Reflection.BindingFlags.NonPublic |
NetRuntimeSystem.Reflection.BindingFlags.Instance).GetValue(this);
if( (null != eventDelegate) && (eventDelegate.GetInvocationList().Length > 0) )
return false;
}
return false;
}
/// <summary>
/// Target methods from its actual event recipients
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Delegate[] GetEventRecipients(string eventName)
{
if(null == _thisType)
_thisType = this.GetType();
MulticastDelegate eventDelegate = (MulticastDelegate)_thisType.GetField(
"_" + eventName + "Event",
NetRuntimeSystem.Reflection.BindingFlags.Instance |
NetRuntimeSystem.Reflection.BindingFlags.NonPublic).GetValue(this);
if (null != eventDelegate)
{
Delegate[] delegates = eventDelegate.GetInvocationList();
return delegates;
}
else
return new Delegate[0];
}
/// <summary>
/// Returns the current count of event recipients
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public int GetCountOfEventRecipients(string eventName)
{
if(null == _thisType)
_thisType = this.GetType();
MulticastDelegate eventDelegate = (MulticastDelegate)_thisType.GetField(
"_" + eventName + "Event",
NetRuntimeSystem.Reflection.BindingFlags.Instance |
NetRuntimeSystem.Reflection.BindingFlags.NonPublic).GetValue(this);
if (null != eventDelegate)
{
Delegate[] delegates = eventDelegate.GetInvocationList();
return delegates.Length;
}
else
return 0;
}
/// <summary>
/// Raise an instance event
/// </summary>
/// <param name="eventName">name of the event without 'Event' at the end</param>
/// <param name="paramsArray">custom arguments for the event</param>
/// <returns>count of called event recipients</returns>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public int RaiseCustomEvent(string eventName, ref object[] paramsArray)
{
if(null == _thisType)
_thisType = this.GetType();
MulticastDelegate eventDelegate = (MulticastDelegate)_thisType.GetField(
"_" + eventName + "Event",
NetRuntimeSystem.Reflection.BindingFlags.Instance |
NetRuntimeSystem.Reflection.BindingFlags.NonPublic).GetValue(this);
if (null != eventDelegate)
{
Delegate[] delegates = eventDelegate.GetInvocationList();
foreach (var item in delegates)
{
try
{
item.Method.Invoke(item.Target, paramsArray);
}
catch (NetRuntimeSystem.Exception exception)
{
Factory.Console.WriteException(exception);
}
}
return delegates.Length;
}
else
return 0;
}
/// <summary>
/// Stop listening events for the instance
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public void DisposeEventBridge()
{
if( null != _hTMLDocumentEvents_SinkHelper)
{
_hTMLDocumentEvents_SinkHelper.Dispose();
_hTMLDocumentEvents_SinkHelper = null;
}
_connectPoint = null;
}
#endregion
#pragma warning restore
}
} | 25.438023 | 174 | 0.670332 | [
"MIT"
] | Engineerumair/NetOffice | Source/MSHTML/Classes/HTMLDocument.cs | 30,373 | C# |
using System.Text.Json.Serialization;
namespace DotNetBungieAPI.Generated.Models.Destiny.Components.PlugSets;
/// <summary>
/// Sockets may refer to a "Plug Set": a set of reusable plugs that may be shared across multiple sockets (or even, in theory, multiple sockets over multiple items).
/// <para />
/// This is the set of those plugs that we came across in the users' inventory, along with the values for plugs in the set. Any given set in this component may be represented in Character and Profile-level, as some plugs may be Profile-level restricted, and some character-level restricted. (note that the ones that are even more specific will remain on the actual socket component itself, as they cannot be reused)
/// </summary>
public sealed class DestinyPlugSetsComponent
{
/// <summary>
/// The shared list of plugs for each relevant PlugSet, keyed by the hash identifier of the PlugSet (DestinyPlugSetDefinition).
/// </summary>
[JsonPropertyName("plugs")]
public Dictionary<uint, List<Destiny.Sockets.DestinyItemPlug>> Plugs { get; init; } // DestinyPlugSetDefinition
}
| 59.684211 | 420 | 0.738095 | [
"MIT"
] | EndGameGl/.NetBungieAPI | DotNetBungieAPI.Generated/Models/Destiny/Components/PlugSets/DestinyPlugSetsComponent.cs | 1,134 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeleeShowAttackTilePlayer : CombatPlayerBehaviour
{
private void OnEnable()
{
MeleeShowAttackRangeBehaviour.OnMeleeShowAttackRangeEnter += MeleeShowAttackRangeEnter;
}
private void OnDisable()
{
MeleeShowAttackRangeBehaviour.OnMeleeShowAttackRangeEnter -= MeleeShowAttackRangeEnter;
}
private void MeleeShowAttackRangeEnter()
{
var cellSize = TileManager.CellSize;
var IsCharacter = !(_targetEntity.GetComponent("Character") as Entity is null);
if (IsCharacter)
{
for (int j = -1; j <= 1; j++)
{
for (int i = -1; i <= 1; i++)
{
var position = new Vector3Int(i, j, 0);
var currentGridPosition = _targetGridPosition + position;
var currentGridCenterPosition = currentGridPosition + cellSize;
var IsNothingOrIsEnemyCharacter = (InTile(currentGridCenterPosition) == (int)EntityType.Nothing ||
InTile(currentGridCenterPosition) == (int)EntityType.EnemyCharacter) && !_collisionTilemap.HasTile(currentGridPosition);
if (_uITilemap.HasTile(currentGridPosition))
{
if (IsNothingOrIsEnemyCharacter)
{
_uITilemap.SetTile(currentGridPosition, _targetTile);
}
}
}
}
}
else
{
for (int x = 0; x < _enemyHeroAttackableTiles.Count; x++)
{
var currentGridPosition = _enemyHeroAttackableTiles[x];
var currentGridCenterPosition = currentGridPosition + cellSize;
var IsNothingOrIsEnemy = InTile(currentGridCenterPosition) == (int)EntityType.Nothing ||
InTile(currentGridCenterPosition) == (int)EntityType.EnemyCharacter || InTile(currentGridCenterPosition) == (int)EntityType.EnemyHero;
if (_floorTilemap.HasTile(currentGridPosition))
{
if (IsNothingOrIsEnemy)
{
_uITilemap.SetTile(currentGridPosition, _targetTile);
}
}
}
//!(i == 0 && j == 0) && _uITilemap.HasTile(currentGridPosition) && (currentGridPosition == _executorGridPos || !(InTile(currentGridCenterPosition) == (int)EntityType.AllyCharacter)) && !_collisionTilemap.HasTile(currentGridPosition)
}
}
}
| 41.4375 | 245 | 0.576169 | [
"MIT"
] | MarcM-collab/Project2_Fix | Assets/Scripts/Turn Based Strategy/FSM/Functions/MeleeShowAttackTilePlayer.cs | 2,652 | C# |
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Options;
using OrchardCore.Sitemaps.Services;
namespace OrchardCore.Sitemaps.Routing
{
public class SitemapsTransformer : DynamicRouteValueTransformer
{
private readonly SitemapEntries _entries;
private readonly SitemapsOptions _options;
public SitemapsTransformer(SitemapEntries entries, IOptions<SitemapsOptions> options)
{
_entries = entries;
_options = options.Value;
}
public override ValueTask<RouteValueDictionary> TransformAsync(HttpContext httpContext, RouteValueDictionary values)
{
// Use route value provided by SitemapTransformer template.
var path = values["sitemap"] as string;
if (!String.IsNullOrEmpty(path) && _entries.TryGetSitemapId(path, out var sitemapId))
{
var routeValues = new RouteValueDictionary(_options.GlobalRouteValues)
{
[_options.SitemapIdKey] = sitemapId
};
return new ValueTask<RouteValueDictionary>(routeValues);
}
return new ValueTask<RouteValueDictionary>((RouteValueDictionary)null);
}
}
}
| 34.275 | 124 | 0.672502 | [
"BSD-3-Clause"
] | Craige/OrchardCore | src/OrchardCore.Modules/OrchardCore.Sitemaps/Routing/SitemapsTransformer.cs | 1,371 | C# |
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Wexflow.Core;
using Wexflow.Core.Service.Client;
using Wexflow.Core.Service.Contracts;
namespace Wexflow.Tasks.Workflow
{
public enum WorkflowAction
{
Start,
Suspend,
Resume,
Stop,
Approve,
Disapprove
}
public class Workflow : Task
{
public string WexflowWebServiceUri { get; }
public string Username { get; }
public string Password { get; }
public WorkflowAction Action { get; }
public int[] WorkflowIds { get; }
public Dictionary<int, Guid> Jobs { get; }
public Workflow(XElement xe, Core.Workflow wf) : base(xe, wf)
{
Jobs = new Dictionary<int, Guid>();
WexflowWebServiceUri = GetSetting("wexflowWebServiceUri");
Username = GetSetting("username");
Password = GetSetting("password");
Action = (WorkflowAction)Enum.Parse(typeof(WorkflowAction), GetSetting("action"), true);
WorkflowIds = GetSettingsInt("id");
}
public override TaskStatus Run()
{
Info("Task started.");
bool success = true;
bool atLeastOneSucceed = false;
foreach (var id in WorkflowIds)
{
WexflowServiceClient client = new WexflowServiceClient(WexflowWebServiceUri);
WorkflowInfo wfInfo = client.GetWorkflow(Username, Password, id);
switch (Action)
{
case WorkflowAction.Start:
if (wfInfo.IsRunning)
{
success = false;
ErrorFormat("Can't start the workflow {0} because it's already running.", Workflow.Id);
}
else
{
var instanceId = client.StartWorkflow(id, Username, Password);
if (Jobs.ContainsKey(id))
{
Jobs[id] = instanceId;
}
else
{
Jobs.Add(id, instanceId);
}
InfoFormat("Workflow {0} started.", id);
if (!atLeastOneSucceed) atLeastOneSucceed = true;
}
break;
case WorkflowAction.Suspend:
if (wfInfo.IsRunning)
{
client.SuspendWorkflow(id, Jobs[id], Username, Password);
InfoFormat("Workflow {0} suspended.", id);
if (!atLeastOneSucceed) atLeastOneSucceed = true;
}
else
{
success = false;
ErrorFormat("Can't suspend the workflow {0} because it's not running.", Workflow.Id);
}
break;
case WorkflowAction.Resume:
if (wfInfo.IsPaused)
{
client.ResumeWorkflow(id, Jobs[id], Username, Password);
InfoFormat("Workflow {0} resumed.", id);
if (!atLeastOneSucceed) atLeastOneSucceed = true;
}
else
{
success = false;
ErrorFormat("Can't resume the workflow {0} because it's not suspended.", Workflow.Id);
}
break;
case WorkflowAction.Stop:
if (wfInfo.IsRunning)
{
client.StopWorkflow(id, Jobs[id], Username, Password);
InfoFormat("Workflow {0} stopped.", id);
if (!atLeastOneSucceed) atLeastOneSucceed = true;
}
else
{
success = false;
ErrorFormat("Can't stop the workflow {0} because it's not running.", Workflow.Id);
}
break;
case WorkflowAction.Approve:
if (wfInfo.IsApproval && wfInfo.IsWaitingForApproval)
{
client.ApproveWorkflow(id, Jobs[id], Username, Password);
InfoFormat("Workflow {0} approved.", id);
if (!atLeastOneSucceed) atLeastOneSucceed = true;
}
else
{
success = false;
ErrorFormat("Can't approve the workflow {0} because it's not waiting for approval.", Workflow.Id);
}
break;
case WorkflowAction.Disapprove:
if (wfInfo.IsApproval && wfInfo.IsWaitingForApproval)
{
client.DisapproveWorkflow(id, Jobs[id], Username, Password);
InfoFormat("Workflow {0} disapproved.", id);
if (!atLeastOneSucceed) atLeastOneSucceed = true;
}
else
{
success = false;
ErrorFormat("Can't disapprove the workflow {0} because it's not waiting for approval.", Workflow.Id);
}
break;
}
}
Info("Task finished.");
var status = Core.Status.Success;
if (!success && atLeastOneSucceed)
{
status = Core.Status.Warning;
}
else if (!success)
{
status = Core.Status.Error;
}
return new TaskStatus(status);
}
}
}
| 40.785714 | 129 | 0.423022 | [
"MIT"
] | PruthviRajuPeddigari/Wexflow | src/dotnet/Wexflow.Tasks.Workflow/Workflow.cs | 6,283 | C# |
namespace Aehnlich.Views.Dir
{
using System.Windows;
using System.Windows.Controls;
/// <summary>
/// Implements a view that can be used to display directory diff information.
/// </summary>
public class DirDiffDocControl : Control
{
#region ctors
/// <summary>
/// Static class constructor
/// </summary>
static DirDiffDocControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DirDiffDocControl),
new FrameworkPropertyMetadata(typeof(DirDiffDocControl)));
}
#endregion ctors
}
}
| 22.521739 | 78 | 0.725869 | [
"MIT"
] | Dirkster99/Aehnlich | source/Aehnlich/Aehnlich/Views/Dir/DirDiffDocControl.xaml.cs | 520 | C# |
using Damme.Interfaces;
using System;
namespace Damme.Classes
{
public class DisplayManager : IDisplay
{
/// <summary>
/// Generates the 2D view of the playing field
/// </summary>
/// <param name="field">Field to display</param>
public void GridView(Pion[,] field)
{
Console.WriteLine(" 1 2 3 4 5 6 7 8 9 10");
for (int x = 0; x < 10; x++)
{
Console.Write(x + 1 + " ");
for (int y = 0; y < 10; y++)
{
Console.Write(field[x, y].PlayerSign + " ");
}
Console.Write("\n"); //line return char
}
}
}
} | 27.5 | 64 | 0.440559 | [
"MIT"
] | Mrgove10/C-Sharp-B2 | Damme/Classes/DisplayManager.cs | 717 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします
// </auto-generated>
//------------------------------------------------------------------------------
namespace PointerSearcher.Properties
{
/// <summary>
/// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
/// </summary>
// このクラスは StronglyTypedResourceBuilder クラスが ResGen
// または Visual Studio のようなツールを使用して自動生成されました。
// メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
// ResGen を実行し直すか、または VS プロジェクトをリビルドします。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// このクラスで使用されるキャッシュされた ResourceManager インスタンスを返します。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PointerSearcher.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
/// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
| 36.166667 | 181 | 0.602919 | [
"MIT"
] | CJBok/PointerSearcher-SE | PointerSearcher/Properties/Resources.Designer.cs | 3,228 | C# |
using Magicodes.ExporterAndImporter.Core.Models;
using System;
using System.IO;
namespace Magicodes.ExporterAndImporter.Core
{
/// <summary>
/// 导入图片字段特性
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
public class ImportImageFieldAttribute : Attribute
{
/// <summary>
/// 图片存储路径(默认存储到临时目录)
/// </summary>
public string ImageDirectory { get; set; } = Path.GetTempPath();
/// <summary>
/// 图片导出方式(默认Base64)
/// </summary>
public ImportImageTo ImportImageTo { get; set; } = ImportImageTo.Base64;
/// <summary>
///
/// </summary>
public ImportImageFieldAttribute()
{
}
/// <summary>
///
/// </summary>
/// <param name="imageDirectory"></param>
public ImportImageFieldAttribute(string imageDirectory)
{
this.ImportImageTo = ImportImageTo.TempFolder;
this.ImageDirectory = imageDirectory ?? Path.GetTempPath();
}
}
}
| 25.833333 | 80 | 0.571429 | [
"MIT"
] | 1518648489/Magicodes.IE | src/Magicodes.ExporterAndImporter.Core/Fields/ImportImageFieldAttribute.cs | 1,157 | C# |
namespace GitReleaseNotes.Git
{
public interface IGitRepositoryContextFactory
{
GitRepositoryContext GetRepositoryContext();
}
}
| 18.75 | 52 | 0.733333 | [
"MIT"
] | JakeGinnivan/GitReleaseNotes | src/GitReleaseNotes/Git/IGitRepositoryContextFactory.cs | 152 | 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.Binary;
using System.Diagnostics;
using System.Globalization;
using System.IO.Pipelines;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.WebSockets.Internal
{
/// <summary>
/// Provides the default implementation of <see cref="IWebSocketConnection"/>.
/// </summary>
/// <remarks>
/// <para>
/// This type is thread-safe, as long as only one thread ever calls <see cref="ExecuteAsync"/>. Multiple threads may call <see cref="SendAsync"/> simultaneously
/// and the sends will block until ongoing send operations complete.
/// </para>
/// <para>
/// The general pattern of having a single thread running <see cref="ExecuteAsync"/> and a separate thread running <see cref="SendAsync"/> will
/// be thread-safe, as each method interacts with completely separate state.
/// </para>
/// </remarks>
public class WebSocketConnection : IWebSocketConnection
{
private WebSocketOptions _options;
private readonly byte[] _maskingKeyBuffer;
private readonly IPipeReader _inbound;
private readonly IPipeWriter _outbound;
private readonly Timer _pinger;
private readonly CancellationTokenSource _timerCts = new CancellationTokenSource();
private Utf8Validator _validator = new Utf8Validator();
private WebSocketOpcode _currentMessageType = WebSocketOpcode.Continuation;
// Sends must be serialized between SendAsync, Pinger, and the Close frames sent when invalid messages are received.
private SemaphoreSlim _sendLock = new SemaphoreSlim(1, 1);
public string SubProtocol { get; }
public WebSocketConnectionState State { get; private set; } = WebSocketConnectionState.Created;
/// <summary>
/// Constructs a new, unmasked, <see cref="WebSocketConnection"/> from an <see cref="IPipeReader"/> and an <see cref="IPipeWriter"/> that represents an established WebSocket connection (i.e. after handshaking)
/// </summary>
/// <param name="inbound">A <see cref="IPipeReader"/> from which frames will be read when receiving.</param>
/// <param name="outbound">A <see cref="IPipeWriter"/> to which frame will be written when sending.</param>
public WebSocketConnection(IPipeReader inbound, IPipeWriter outbound) : this(inbound, outbound, options: WebSocketOptions.DefaultUnmasked) { }
/// <summary>
/// Constructs a new, unmasked, <see cref="WebSocketConnection"/> from an <see cref="IPipeReader"/> and an <see cref="IPipeWriter"/> that represents an established WebSocket connection (i.e. after handshaking)
/// </summary>
/// <param name="inbound">A <see cref="IPipeReader"/> from which frames will be read when receiving.</param>
/// <param name="outbound">A <see cref="IPipeWriter"/> to which frame will be written when sending.</param>
/// <param name="subProtocol">The sub-protocol provided during handshaking</param>
public WebSocketConnection(IPipeReader inbound, IPipeWriter outbound, string subProtocol) : this(inbound, outbound, subProtocol, options: WebSocketOptions.DefaultUnmasked) { }
/// <summary>
/// Constructs a new, <see cref="WebSocketConnection"/> from an <see cref="IPipeReader"/> and an <see cref="IPipeWriter"/> that represents an established WebSocket connection (i.e. after handshaking)
/// </summary>
/// <param name="inbound">A <see cref="IPipeReader"/> from which frames will be read when receiving.</param>
/// <param name="outbound">A <see cref="IPipeWriter"/> to which frame will be written when sending.</param>
/// <param name="options">A <see cref="WebSocketOptions"/> which provides the configuration options for the socket.</param>
public WebSocketConnection(IPipeReader inbound, IPipeWriter outbound, WebSocketOptions options) : this(inbound, outbound, subProtocol: string.Empty, options: options) { }
/// <summary>
/// Constructs a new <see cref="WebSocketConnection"/> from an <see cref="IPipeReader"/> and an <see cref="IPipeWriter"/> that represents an established WebSocket connection (i.e. after handshaking)
/// </summary>
/// <param name="inbound">A <see cref="IPipeReader"/> from which frames will be read when receiving.</param>
/// <param name="outbound">A <see cref="IPipeWriter"/> to which frame will be written when sending.</param>
/// <param name="subProtocol">The sub-protocol provided during handshaking</param>
/// <param name="options">A <see cref="WebSocketOptions"/> which provides the configuration options for the socket.</param>
public WebSocketConnection(IPipeReader inbound, IPipeWriter outbound, string subProtocol, WebSocketOptions options)
{
_inbound = inbound;
_outbound = outbound;
_options = options;
SubProtocol = subProtocol;
if (_options.FixedMaskingKey != null)
{
// Use the fixed key directly as the buffer.
_maskingKeyBuffer = _options.FixedMaskingKey;
// Clear the MaskingKeyGenerator just to ensure that nobody set it.
_options.MaskingKeyGenerator = null;
}
else if (_options.MaskingKeyGenerator != null)
{
// Establish a buffer for the random generator to use
_maskingKeyBuffer = new byte[4];
}
if (_options.PingInterval > TimeSpan.Zero)
{
var pingIntervalMillis = (int)_options.PingInterval.TotalMilliseconds;
// Set up the pinger
_pinger = new Timer(Pinger, this, pingIntervalMillis, pingIntervalMillis);
}
}
private static void Pinger(object state)
{
var connection = (WebSocketConnection)state;
// If we are cancelled, don't send the ping
// Also, if we can't immediately acquire the send lock, we're already sending something, so we don't need the ping.
if (!connection._timerCts.Token.IsCancellationRequested && connection._sendLock.Wait(0))
{
// We don't need to wait for this task to complete, we're "tail calling" and
// we are in a Timer thread-pool thread.
var ignore = connection.SendCoreLockAcquiredAsync(
fin: true,
opcode: WebSocketOpcode.Ping,
payloadAllocLength: 28,
payloadLength: 28,
payloadWriter: PingPayloadWriter,
payload: DateTime.UtcNow,
cancellationToken: connection._timerCts.Token);
}
}
public void Dispose()
{
State = WebSocketConnectionState.Closed;
_pinger?.Dispose();
_timerCts.Cancel();
_inbound.Complete();
_outbound.Complete();
}
public Task<WebSocketCloseResult> ExecuteAsync(Func<WebSocketFrame, object, Task> messageHandler, object state)
{
if (State == WebSocketConnectionState.Closed)
{
throw new ObjectDisposedException(nameof(WebSocketConnection));
}
if (State != WebSocketConnectionState.Created)
{
throw new InvalidOperationException("Connection is already running.");
}
State = WebSocketConnectionState.Connected;
return ReceiveLoop(messageHandler, state);
}
/// <summary>
/// Sends the specified frame.
/// </summary>
/// <param name="frame">The frame to send.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that indicates when/if the send is cancelled.</param>
/// <returns>A <see cref="Task"/> that completes when the message has been written to the outbound stream.</returns>
// TODO: De-taskify this to allow consumers to create their own awaiter.
public Task SendAsync(WebSocketFrame frame, CancellationToken cancellationToken)
{
if (State == WebSocketConnectionState.Closed)
{
throw new ObjectDisposedException(nameof(WebSocketConnection));
}
// This clause is a bit of an artificial restriction to ensure people run "Execute". Maybe we don't care?
else if (State == WebSocketConnectionState.Created)
{
throw new InvalidOperationException($"Cannot send until the connection is started using {nameof(ExecuteAsync)}");
}
else if (State == WebSocketConnectionState.CloseSent)
{
throw new InvalidOperationException("Cannot send after sending a Close frame");
}
if (frame.Opcode == WebSocketOpcode.Close)
{
throw new InvalidOperationException($"Cannot use {nameof(SendAsync)} to send a Close frame, use {nameof(CloseAsync)} instead.");
}
return SendCoreAsync(
fin: frame.EndOfMessage,
opcode: frame.Opcode,
payloadAllocLength: 0, // We don't copy the payload, we append it, so we don't need any alloc for the payload
payloadLength: frame.Payload.Length,
payloadWriter: AppendPayloadWriter,
payload: frame.Payload,
cancellationToken: cancellationToken);
}
/// <summary>
/// Sends a Close frame to the other party. This does not guarantee that the client will send a responding close frame.
/// </summary>
/// <remarks>
/// If the other party does not respond with a close frame, the connection will remain open and the <see cref="Task{WebSocketCloseResult}"/>
/// will remain active. Call the <see cref="IDisposable.Dispose"/> method on this instance to forcibly terminate the connection.
/// </remarks>
/// <param name="result">A <see cref="WebSocketCloseResult"/> with the payload for the close frame</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that indicates when/if the send is cancelled.</param>
/// <returns>A <see cref="Task"/> that completes when the close frame has been sent</returns>
public async Task CloseAsync(WebSocketCloseResult result, CancellationToken cancellationToken)
{
if (State == WebSocketConnectionState.Closed)
{
// Already closed
return;
}
else if (State == WebSocketConnectionState.Created)
{
throw new InvalidOperationException("Cannot send close frame when the connection hasn't been started");
}
else if (State == WebSocketConnectionState.CloseSent)
{
throw new InvalidOperationException("Cannot send multiple close frames");
}
var payloadSize = result.GetSize();
await SendCoreAsync(
fin: true,
opcode: WebSocketOpcode.Close,
payloadAllocLength: payloadSize,
payloadLength: payloadSize,
payloadWriter: CloseResultPayloadWriter,
payload: result,
cancellationToken: cancellationToken);
_timerCts.Cancel();
_pinger?.Dispose();
if (State == WebSocketConnectionState.CloseReceived)
{
State = WebSocketConnectionState.Closed;
}
else
{
State = WebSocketConnectionState.CloseSent;
}
}
private void WriteMaskingKey(Span<byte> buffer)
{
if (_options.MaskingKeyGenerator != null)
{
// Get a new random mask
// Until https://github.com/dotnet/corefx/issues/12323 is fixed we need to use this shared buffer and copy model
// Once we have that fix we should be able to generate the mask directly into the output buffer.
_options.MaskingKeyGenerator.GetBytes(_maskingKeyBuffer);
}
_maskingKeyBuffer.CopyTo(buffer);
}
/// <summary>
/// Terminates the socket abruptly.
/// </summary>
public void Abort()
{
// We duplicate some work from Dispose here, but that's OK.
_timerCts.Cancel();
_inbound.CancelPendingRead();
_outbound.Complete();
}
private async ValueTask<(bool Success, byte OpcodeByte, bool Masked, bool Fin, int Length, uint MaskingKey)> ReadHeaderAsync()
{
// Read at least 2 bytes
var readResult = await _inbound.ReadAtLeastAsync(2);
if (readResult.IsCancelled || (readResult.IsCompleted && readResult.Buffer.Length < 2))
{
_inbound.Advance(readResult.Buffer.End);
return (Success: false, OpcodeByte: 0, Masked: false, Fin: false, Length: 0, MaskingKey: 0);
}
var buffer = readResult.Buffer;
// Read the opcode and length
var opcodeByte = buffer.ReadBigEndian<byte>();
buffer = buffer.Slice(1);
// Read the first byte of the payload length
var lengthByte = buffer.ReadBigEndian<byte>();
buffer = buffer.Slice(1);
_inbound.Advance(buffer.Start);
// Determine how much header there still is to read
var fin = (opcodeByte & 0x80) != 0;
var masked = (lengthByte & 0x80) != 0;
var length = lengthByte & 0x7F;
// Calculate the rest of the header length
var headerLength = masked ? 4 : 0;
if (length == 126)
{
headerLength += 2;
}
else if (length == 127)
{
headerLength += 8;
}
// Read the next set of header data
uint maskingKey = 0;
if (headerLength > 0)
{
readResult = await _inbound.ReadAtLeastAsync(headerLength);
if (readResult.IsCancelled || (readResult.IsCompleted && readResult.Buffer.Length < headerLength))
{
_inbound.Advance(readResult.Buffer.End);
return (Success: false, OpcodeByte: 0, Masked: false, Fin: false, Length: 0, MaskingKey: 0);
}
buffer = readResult.Buffer;
// Read extended payload length (if any)
if (length == 126)
{
length = buffer.ReadBigEndian<ushort>();
buffer = buffer.Slice(sizeof(ushort));
}
else if (length == 127)
{
var longLen = buffer.ReadBigEndian<ulong>();
buffer = buffer.Slice(sizeof(ulong));
if (longLen > int.MaxValue)
{
throw new WebSocketException($"Frame is too large. Maximum frame size is {int.MaxValue} bytes");
}
length = (int)longLen;
}
// Read masking key
if (masked)
{
var maskingKeyStart = buffer.Start;
maskingKey = buffer.Slice(0, sizeof(uint)).ReadBigEndian<uint>();
buffer = buffer.Slice(sizeof(uint));
}
// Mark the length and masking key consumed
_inbound.Advance(buffer.Start);
}
return (Success: true, opcodeByte, masked, fin, length, maskingKey);
}
private async ValueTask<(bool Success, ReadableBuffer Buffer)> ReadPayloadAsync(int length, bool masked, uint maskingKey)
{
var payload = default(ReadableBuffer);
if (length > 0)
{
var readResult = await _inbound.ReadAtLeastAsync(length);
if (readResult.IsCancelled || (readResult.IsCompleted && readResult.Buffer.Length < length))
{
return (Success: false, Buffer: readResult.Buffer);
}
var buffer = readResult.Buffer;
payload = buffer.Slice(0, length);
if (masked)
{
// Unmask
MaskingUtilities.ApplyMask(ref payload, maskingKey);
}
}
return (Success: true, Buffer: payload);
}
private async Task<WebSocketCloseResult> ReceiveLoop(Func<WebSocketFrame, object, Task> messageHandler, object state)
{
try
{
while (true)
{
// WebSocket Frame layout (https://tools.ietf.org/html/rfc6455#section-5.2):
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-------+-+-------------+-------------------------------+
// |F|R|R|R| opcode|M| Payload len | Extended payload length |
// |I|S|S|S| (4) |A| (7) | (16/64) |
// |N|V|V|V| |S| | (if payload len==126/127) |
// | |1|2|3| |K| | |
// +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +
// | Extended payload length continued, if payload len == 127 |
// + - - - - - - - - - - - - - - - +-------------------------------+
// | |Masking-key, if MASK set to 1 |
// +-------------------------------+-------------------------------+
// | Masking-key (continued) | Payload Data |
// +-------------------------------- - - - - - - - - - - - - - - - +
// : Payload Data continued ... :
// + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
// | Payload Data continued ... |
// +---------------------------------------------------------------+
var header = await ReadHeaderAsync();
if (!header.Success)
{
break;
}
// Validate Opcode
var opcodeNum = header.OpcodeByte & 0x0F;
if ((header.OpcodeByte & 0x70) != 0)
{
// Reserved bits set, this frame is invalid, close our side and terminate immediately
await CloseFromProtocolError("Reserved bits, which are required to be zero, were set.");
break;
}
else if ((opcodeNum >= 0x03 && opcodeNum <= 0x07) || (opcodeNum >= 0x0B && opcodeNum <= 0x0F))
{
// Reserved opcode
await CloseFromProtocolError($"Received frame using reserved opcode: 0x{opcodeNum:X}");
break;
}
var opcode = (WebSocketOpcode)opcodeNum;
var payload = await ReadPayloadAsync(header.Length, header.Masked, header.MaskingKey);
if (!payload.Success)
{
_inbound.Advance(payload.Buffer.End);
break;
}
var frame = new WebSocketFrame(header.Fin, opcode, payload.Buffer);
// Start a try-finally because we may get an exception while closing, if there's an error
// And we need to advance the buffer even if that happens. It wasn't needed above because
// we had already parsed the buffer before we verified it, so we had already advanced the
// buffer, if we encountered an error while closing we didn't have to advance the buffer.
// Side Note: Look at this gloriously aligned comment. You have anurse and brecon to thank for it. Oh wait, I ruined it.
try
{
if (frame.Opcode.IsControl() && !frame.EndOfMessage)
{
// Control frames cannot be fragmented.
await CloseFromProtocolError("Control frames may not be fragmented");
break;
}
else if (_currentMessageType != WebSocketOpcode.Continuation && opcode.IsMessage() && opcode != 0)
{
await CloseFromProtocolError("Received non-continuation frame during a fragmented message");
break;
}
else if (_currentMessageType == WebSocketOpcode.Continuation && frame.Opcode == WebSocketOpcode.Continuation)
{
await CloseFromProtocolError("Continuation Frame was received when expecting a new message");
break;
}
if (frame.Opcode == WebSocketOpcode.Close)
{
return await ProcessCloseFrameAsync(frame);
}
else
{
if (frame.Opcode == WebSocketOpcode.Ping)
{
// Check the ping payload length
if (frame.Payload.Length > 125)
{
// Payload too long
await CloseFromProtocolError("Ping frame exceeded maximum size of 125 bytes");
break;
}
await SendCoreAsync(
frame.EndOfMessage,
WebSocketOpcode.Pong,
payloadAllocLength: 0,
payloadLength: frame.Payload.Length,
payloadWriter: AppendPayloadWriter,
payload: frame.Payload,
cancellationToken: CancellationToken.None);
}
var effectiveOpcode = opcode == WebSocketOpcode.Continuation ? _currentMessageType : opcode;
if (effectiveOpcode == WebSocketOpcode.Text && !_validator.ValidateUtf8Frame(frame.Payload, frame.EndOfMessage))
{
// Drop the frame and immediately close with InvalidPayload
await CloseFromProtocolError("An invalid Text frame payload was received", statusCode: WebSocketCloseStatus.InvalidPayloadData);
break;
}
else if (_options.PassAllFramesThrough || (frame.Opcode != WebSocketOpcode.Ping && frame.Opcode != WebSocketOpcode.Pong))
{
await messageHandler(frame, state);
}
}
}
finally
{
if (frame.Payload.Length > 0)
{
_inbound.Advance(frame.Payload.End);
}
}
if (header.Fin)
{
// Reset the UTF8 validator
_validator.Reset();
// If it's a non-control frame, reset the message type tracker
if (opcode.IsMessage())
{
_currentMessageType = WebSocketOpcode.Continuation;
}
}
// If there isn't a current message type, and this was a fragmented message frame, set the current message type
else if (!header.Fin && _currentMessageType == WebSocketOpcode.Continuation && opcode.IsMessage())
{
_currentMessageType = opcode;
}
}
}
catch
{
// Abort the socket and rethrow
Abort();
throw;
}
return WebSocketCloseResult.AbnormalClosure;
}
private async ValueTask<WebSocketCloseResult> ProcessCloseFrameAsync(WebSocketFrame frame)
{
// Allowed frame lengths:
// 0 - No body
// 2 - Code with no reason phrase
// >2 - Code and reason phrase (must be valid UTF-8)
if (frame.Payload.Length > 125)
{
await CloseFromProtocolError("Close frame payload too long. Maximum size is 125 bytes");
return WebSocketCloseResult.AbnormalClosure;
}
else if ((frame.Payload.Length == 1) || (frame.Payload.Length > 2 && !Utf8Validator.ValidateUtf8(frame.Payload.Slice(2))))
{
await CloseFromProtocolError("Close frame payload invalid");
return WebSocketCloseResult.AbnormalClosure;
}
ushort? actualStatusCode;
var closeResult = ParseCloseFrame(frame.Payload, frame, out actualStatusCode);
// Verify the close result
if (actualStatusCode != null)
{
var statusCode = actualStatusCode.Value;
if (statusCode < 1000 || statusCode == 1004 || statusCode == 1005 || statusCode == 1006 || (statusCode > 1011 && statusCode < 3000))
{
await CloseFromProtocolError($"Invalid close status: {statusCode}.");
return WebSocketCloseResult.AbnormalClosure;
}
}
return closeResult;
}
private async Task CloseFromProtocolError(string reason, WebSocketCloseStatus statusCode = WebSocketCloseStatus.ProtocolError)
{
var closeResult = new WebSocketCloseResult(
statusCode,
reason);
await CloseAsync(closeResult, CancellationToken.None);
// We can now terminate our connection, according to the spec.
Abort();
}
private WebSocketCloseResult ParseCloseFrame(ReadableBuffer payload, WebSocketFrame frame, out ushort? actualStatusCode)
{
// Update state
if (State == WebSocketConnectionState.CloseSent)
{
State = WebSocketConnectionState.Closed;
}
else
{
State = WebSocketConnectionState.CloseReceived;
}
// Process the close frame
WebSocketCloseResult closeResult;
if (!WebSocketCloseResult.TryParse(frame.Payload, out closeResult, out actualStatusCode))
{
closeResult = WebSocketCloseResult.Empty;
}
return closeResult;
}
private static void PingPayloadWriter(WritableBuffer output, Span<byte> maskingKey, int payloadLength, DateTime timestamp)
{
var payload = output.Memory.Slice(0, payloadLength);
// TODO: Don't put this string on the heap? Is there a way to do that without re-implementing ToString?
// Ideally we'd like to render the string directly to the output buffer.
var str = timestamp.ToString("O", CultureInfo.InvariantCulture);
ArraySegment<byte> buffer;
if (payload.TryGetArray(out buffer))
{
// Fast path - Write the encoded bytes directly out.
Encoding.UTF8.GetBytes(str, 0, str.Length, buffer.Array, buffer.Offset);
}
else
{
// TODO: Could use TryGetPointer, GetBytes does take a byte*, but it seems like just waiting until we have a version that uses Span is best.
// Slow path - Allocate a heap buffer for the encoded bytes before writing them out.
Encoding.UTF8.GetBytes(str).CopyTo(payload.Span);
}
if (maskingKey.Length > 0)
{
MaskingUtilities.ApplyMask(payload.Span, maskingKey);
}
output.Advance(payloadLength);
}
private static void CloseResultPayloadWriter(WritableBuffer output, Span<byte> maskingKey, int payloadLength, WebSocketCloseResult result)
{
// Write the close payload out
var payload = output.Memory.Slice(0, payloadLength).Span;
result.WriteTo(ref output);
if (maskingKey.Length > 0)
{
MaskingUtilities.ApplyMask(payload, maskingKey);
}
}
private static void AppendPayloadWriter(WritableBuffer output, Span<byte> maskingKey, int payloadLength, ReadableBuffer payload)
{
if (maskingKey.Length > 0)
{
// Mask the payload in it's own buffer
MaskingUtilities.ApplyMask(ref payload, maskingKey);
}
output.Append(payload);
}
private Task SendCoreAsync<T>(bool fin, WebSocketOpcode opcode, int payloadAllocLength, int payloadLength, Action<WritableBuffer, Span<byte>, int, T> payloadWriter, T payload, CancellationToken cancellationToken)
{
if (_sendLock.Wait(0))
{
return SendCoreLockAcquiredAsync(fin, opcode, payloadAllocLength, payloadLength, payloadWriter, payload, cancellationToken);
}
else
{
return SendCoreWaitForLockAsync(fin, opcode, payloadAllocLength, payloadLength, payloadWriter, payload, cancellationToken);
}
}
private async Task SendCoreWaitForLockAsync<T>(bool fin, WebSocketOpcode opcode, int payloadAllocLength, int payloadLength, Action<WritableBuffer, Span<byte>, int, T> payloadWriter, T payload, CancellationToken cancellationToken)
{
await _sendLock.WaitAsync(cancellationToken);
await SendCoreLockAcquiredAsync(fin, opcode, payloadAllocLength, payloadLength, payloadWriter, payload, cancellationToken);
}
private async Task SendCoreLockAcquiredAsync<T>(bool fin, WebSocketOpcode opcode, int payloadAllocLength, int payloadLength, Action<WritableBuffer, Span<byte>, int, T> payloadWriter, T payload, CancellationToken cancellationToken)
{
try
{
// Ensure the lock is held
Debug.Assert(_sendLock.CurrentCount == 0);
// Base header size is 2 bytes.
WritableBuffer buffer;
var allocSize = CalculateAllocSize(payloadAllocLength, payloadLength);
// Allocate a buffer
buffer = _outbound.Alloc(minimumSize: allocSize);
Debug.Assert(buffer.Memory.Length >= allocSize);
// Write the opcode and FIN flag
var opcodeByte = (byte)opcode;
if (fin)
{
opcodeByte |= 0x80;
}
buffer.WriteBigEndian(opcodeByte);
// Write the length and mask flag
WritePayloadLength(payloadLength, buffer);
var maskingKey = Span<byte>.Empty;
if (_maskingKeyBuffer != null)
{
// Get a span of the output buffer for the masking key, write it there, then advance the write head.
maskingKey = buffer.Memory.Slice(0, 4).Span;
WriteMaskingKey(maskingKey);
buffer.Advance(4);
}
// Write the payload
payloadWriter(buffer, maskingKey, payloadLength, payload);
// Flush.
await buffer.FlushAsync();
}
finally
{
// Unlock.
_sendLock.Release();
}
}
private int CalculateAllocSize(int payloadAllocLength, int payloadLength)
{
var allocSize = 2;
if (payloadLength > ushort.MaxValue)
{
// We're going to need an 8-byte length
allocSize += 8;
}
else if (payloadLength > 125)
{
// We're going to need a 2-byte length
allocSize += 2;
}
if (_maskingKeyBuffer != null)
{
// We need space for the masking key
allocSize += 4;
}
// We may need space for the payload too
return allocSize + payloadAllocLength;
}
private void WritePayloadLength(int payloadLength, WritableBuffer buffer)
{
var maskingByte = _maskingKeyBuffer != null ? 0x80 : 0x00;
if (payloadLength > ushort.MaxValue)
{
buffer.WriteBigEndian((byte)(0x7F | maskingByte));
// 8-byte length
buffer.WriteBigEndian((ulong)payloadLength);
}
else if (payloadLength > 125)
{
buffer.WriteBigEndian((byte)(0x7E | maskingByte));
// 2-byte length
buffer.WriteBigEndian((ushort)payloadLength);
}
else
{
// 1-byte length
buffer.WriteBigEndian((byte)(payloadLength | maskingByte));
}
}
}
}
| 46.14077 | 238 | 0.534135 | [
"Apache-2.0"
] | ZeroInfinite/SignalR | src/Microsoft.Extensions.WebSockets.Internal/WebSocketConnection.cs | 34,746 | C# |
namespace ClearHl7.Codes.V271
{
/// <summary>
/// HL7 Version 2 Table 0372 - Specimen Component.
/// </summary>
/// <remarks>https://www.hl7.org/fhir/v2/0372</remarks>
public enum CodeSpecimenComponent
{
/// <summary>
/// BLD - Whole blood, homogeneous.
/// </summary>
WholeBloodHomogeneous,
/// <summary>
/// BSEP - Whole blood, separated.
/// </summary>
WholeBloodSeparated,
/// <summary>
/// PLAS - Plasma, NOS (not otherwise specified).
/// </summary>
Plasma,
/// <summary>
/// PPP - Platelet poor plasma.
/// </summary>
PlateletPoorPlasma,
/// <summary>
/// PRP - Platelet rich plasma.
/// </summary>
PlateletRichPlasma,
/// <summary>
/// SED - Sediment.
/// </summary>
Sediment,
/// <summary>
/// SER - Serum, NOS (not otherwise specified).
/// </summary>
SerumNosNotOtherwiseSpecified,
/// <summary>
/// SUP - Supernatant.
/// </summary>
Supernatant
}
} | 24.653061 | 59 | 0.470199 | [
"MIT"
] | davebronson/clear-hl7-net | src/ClearHl7.Codes/V271/CodeSpecimenComponent.cs | 1,210 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace Nop.Core.Domain.Logging
{
/// <summary>
/// Represents a log level
/// </summary>
public enum LogLevel
{
/// <summary>
/// Debug
/// </summary>
Debug = 10,
/// <summary>
/// Information
/// </summary>
Information = 20,
/// <summary>
/// Warning
/// </summary>
Warning = 30,
/// <summary>
/// Error
/// </summary>
Error = 40,
/// <summary>
/// Fatal
/// </summary>
Fatal = 50
}
}
| 17 | 33 | 0.434985 | [
"Apache-2.0"
] | zbjlala/MyNop | Nop.Core/Domain/Logging/LogLevel.cs | 648 | C# |
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace MineLib.PGL.Screens.GUI.Grid
{
public class BaseGrid : GUIGrid
{
public BaseGrid(Client game, Screen screen, Rectangle backgroundRectangle) : base(game, screen)
{
BackgroundRectangle = backgroundRectangle;
FrameTopRectangle = new Rectangle(BackgroundRectangle.X, BackgroundRectangle.Y, BackgroundRectangle.Width, FrameSize.Y);
FrameBottomRectangle = new Rectangle(BackgroundRectangle.X, BackgroundRectangle.Y + BackgroundRectangle.Height - FrameSize.Y, BackgroundRectangle.Width, FrameSize.Y);
FrameLeftRectangle = new Rectangle(BackgroundRectangle.X, BackgroundRectangle.Y, FrameSize.X, BackgroundRectangle.Height);
FrameRightRectangle = new Rectangle(BackgroundRectangle.X + BackgroundRectangle.Width - FrameSize.X, BackgroundRectangle.Y, FrameSize.X, BackgroundRectangle.Height);
BackgroundTexture = new Texture2D(GraphicsDevice, 1, 1);
BackgroundTexture.SetData(new[] { new Color(150, 150, 150, 255) });
FrameTexture = new Texture2D(GraphicsDevice, 1, 1);
FrameTexture.SetData(new[] { new Color(0, 0, 0, 255) });
}
public override void Update(GameTime gameTime)
{
base.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
base.Draw(gameTime);
SpriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointWrap);
SpriteBatch.Draw(BackgroundTexture, BackgroundRectangle, Rectangle.Empty, Color.White);
SpriteBatch.Draw(FrameTexture, FrameTopRectangle, new Rectangle(0, 0, BackgroundRectangle.X, FrameSize.Y), Color.White);
SpriteBatch.Draw(FrameTexture, FrameBottomRectangle, new Rectangle(0, 0, BackgroundRectangle.X, FrameSize.Y), Color.White);
SpriteBatch.Draw(FrameTexture, FrameLeftRectangle, new Rectangle(0, 0, BackgroundRectangle.Y, FrameSize.X), Color.White);
SpriteBatch.Draw(FrameTexture, FrameRightRectangle, new Rectangle(0, 0, BackgroundRectangle.Y, FrameSize.X), Color.White);
SpriteBatch.End();
}
public override void Dispose()
{
base.Dispose();
BackgroundTexture?.Dispose();
FrameTexture?.Dispose();
}
}
}
| 44.407407 | 178 | 0.680984 | [
"MIT"
] | Aragas/MineLib.Client | Screens/GUI/Grid/BaseGrid.cs | 2,400 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
// связанные со сборкой.
[assembly: AssemblyTitle("STORJ Overwatch")]
[assembly: AssemblyDescription("STORJ share's node monitoring application")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ivanchey Andrey (slayavi@gmail.com)")]
[assembly: AssemblyProduct("STORJOW")]
[assembly: AssemblyCopyright("Free for all")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("10538534-5688-4ff4-809f-194141063dfd")]
// Сведения о версии сборки состоят из следующих четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 39.972973 | 99 | 0.763354 | [
"Unlicense"
] | slayavi/storj-overwatch | SOTRJOW/Properties/AssemblyInfo.cs | 2,038 | C# |
/*
* Copyright 2018 JDCLOUD.COM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Anti DDos Pro Instance APIs
* Anti DDos Pro Instance APIs
*
* OpenAPI spec version: v1
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
using System;
using System.Collections.Generic;
using System.Text;
using JDCloudSDK.Core.Service;
namespace JDCloudSDK.Ipanti.Apis
{
/// <summary>
/// 修改实例页面错误状态码返回页面为为默认页面
/// </summary>
public class ModifyInstanceCustomPageDefaultResult : JdcloudResult
{
///<summary>
/// 0: 修改失败, 1: 修改成功
///</summary>
public int? Code{ get; set; }
///<summary>
/// 修改失败时给出具体原因
///</summary>
public string Message{ get; set; }
}
} | 26.469388 | 76 | 0.67155 | [
"Apache-2.0"
] | jdcloud-api/jdcloud-sdk-net | sdk/src/Service/Ipanti/Apis/ModifyInstanceCustomPageDefaultResult.cs | 1,377 | C# |
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated code. DO NOT EDIT!
namespace Google.Cloud.VMMigration.V1.Snippets
{
// [START vmmigration_v1_generated_VmMigration_CancelCutoverJob_async_flattened]
using Google.Cloud.VMMigration.V1;
using Google.LongRunning;
using System.Threading.Tasks;
public sealed partial class GeneratedVmMigrationClientSnippets
{
/// <summary>Snippet for CancelCutoverJobAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task CancelCutoverJobAsync()
{
// Create client
VmMigrationClient vmMigrationClient = await VmMigrationClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sources/[SOURCE]/migratingVms/[MIGRATING_VM]/cutoverJobs/[CUTOVER_JOB]";
// Make the request
Operation<CancelCutoverJobResponse, OperationMetadata> response = await vmMigrationClient.CancelCutoverJobAsync(name);
// Poll until the returned long-running operation is complete
Operation<CancelCutoverJobResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CancelCutoverJobResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<CancelCutoverJobResponse, OperationMetadata> retrievedResponse = await vmMigrationClient.PollOnceCancelCutoverJobAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
CancelCutoverJobResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmmigration_v1_generated_VmMigration_CancelCutoverJob_async_flattened]
}
| 47.491525 | 156 | 0.706995 | [
"Apache-2.0"
] | AlexandrTrf/google-cloud-dotnet | apis/Google.Cloud.VMMigration.V1/Google.Cloud.VMMigration.V1.GeneratedSnippets/VmMigrationClient.CancelCutoverJobAsyncSnippet.g.cs | 2,802 | C# |
namespace PasswordRecorder
{
partial class Form1
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.CreateBtn = new System.Windows.Forms.Button();
this.Save = new System.Windows.Forms.Button();
this.UnwrapAll = new System.Windows.Forms.Button();
this.protectBtn = new System.Windows.Forms.Button();
this.contentForm = new System.Windows.Forms.FlowLayoutPanel();
this.tableLayoutHeader = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutHeader.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.BackColor = System.Drawing.SystemColors.Control;
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.contentForm, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutHeader, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.MinimumSize = new System.Drawing.Size(300, 150);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(923, 613);
this.tableLayoutPanel1.TabIndex = 0;
//
// CreateBtn
//
this.CreateBtn.AutoSize = true;
this.CreateBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.CreateBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.CreateBtn.FlatAppearance.BorderSize = 0;
this.CreateBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CreateBtn.Font = new System.Drawing.Font("Lucida Sans", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.CreateBtn.Location = new System.Drawing.Point(0, 0);
this.CreateBtn.Margin = new System.Windows.Forms.Padding(0);
this.CreateBtn.Name = "CreateBtn";
this.CreateBtn.Size = new System.Drawing.Size(230, 48);
this.CreateBtn.TabIndex = 0;
this.CreateBtn.Text = "Create";
this.CreateBtn.UseVisualStyleBackColor = true;
this.CreateBtn.Click += new System.EventHandler(this.Create_Click);
//
// Save
//
this.Save.AutoSize = true;
this.Save.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.Save.Dock = System.Windows.Forms.DockStyle.Fill;
this.Save.FlatAppearance.BorderSize = 0;
this.Save.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.Save.Font = new System.Drawing.Font("Lucida Sans", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Save.Location = new System.Drawing.Point(231, 0);
this.Save.Margin = new System.Windows.Forms.Padding(1, 0, 0, 0);
this.Save.Name = "Save";
this.Save.Size = new System.Drawing.Size(229, 48);
this.Save.TabIndex = 1;
this.Save.Text = "Save";
this.Save.UseVisualStyleBackColor = true;
this.Save.Click += new System.EventHandler(this.Save_Click);
//
// UnwrapAll
//
this.UnwrapAll.AutoSize = true;
this.UnwrapAll.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.UnwrapAll.Dock = System.Windows.Forms.DockStyle.Fill;
this.UnwrapAll.FlatAppearance.BorderSize = 0;
this.UnwrapAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.UnwrapAll.Font = new System.Drawing.Font("Lucida Sans", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.UnwrapAll.Location = new System.Drawing.Point(461, 0);
this.UnwrapAll.Margin = new System.Windows.Forms.Padding(1, 0, 0, 0);
this.UnwrapAll.Name = "UnwrapAll";
this.UnwrapAll.Size = new System.Drawing.Size(229, 48);
this.UnwrapAll.TabIndex = 2;
this.UnwrapAll.Text = "Unwrap All";
this.UnwrapAll.UseVisualStyleBackColor = true;
this.UnwrapAll.Click += new System.EventHandler(this.UnwrapAll_Click);
//
// protectBtn
//
this.protectBtn.AutoSize = true;
this.protectBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.protectBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.protectBtn.FlatAppearance.BorderSize = 0;
this.protectBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.protectBtn.Font = new System.Drawing.Font("Lucida Sans", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.protectBtn.Image = ((System.Drawing.Image)(resources.GetObject("protectBtn.Image")));
this.protectBtn.Location = new System.Drawing.Point(691, 0);
this.protectBtn.Margin = new System.Windows.Forms.Padding(1, 0, 0, 0);
this.protectBtn.Name = "protectBtn";
this.protectBtn.Size = new System.Drawing.Size(230, 48);
this.protectBtn.TabIndex = 3;
this.protectBtn.Text = "Protect";
this.protectBtn.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.protectBtn.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.protectBtn.UseVisualStyleBackColor = true;
this.protectBtn.Click += new System.EventHandler(this.protectBtn_Click);
//
// contentForm
//
this.contentForm.AutoSize = true;
this.contentForm.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.contentForm.BackColor = System.Drawing.SystemColors.Control;
this.contentForm.Dock = System.Windows.Forms.DockStyle.Fill;
this.contentForm.Location = new System.Drawing.Point(0, 50);
this.contentForm.Margin = new System.Windows.Forms.Padding(0);
this.contentForm.MinimumSize = new System.Drawing.Size(300, 150);
this.contentForm.Name = "contentForm";
this.contentForm.Size = new System.Drawing.Size(923, 563);
this.contentForm.TabIndex = 0;
//
// tableLayoutHeader
//
this.tableLayoutHeader.AutoSize = true;
this.tableLayoutHeader.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutHeader.BackColor = System.Drawing.SystemColors.Window;
this.tableLayoutHeader.ColumnCount = 4;
this.tableLayoutHeader.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutHeader.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutHeader.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutHeader.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutHeader.Controls.Add(this.protectBtn, 3, 0);
this.tableLayoutHeader.Controls.Add(this.UnwrapAll, 2, 0);
this.tableLayoutHeader.Controls.Add(this.Save, 1, 0);
this.tableLayoutHeader.Controls.Add(this.CreateBtn, 0, 0);
this.tableLayoutHeader.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutHeader.Location = new System.Drawing.Point(1, 1);
this.tableLayoutHeader.Margin = new System.Windows.Forms.Padding(1);
this.tableLayoutHeader.Name = "tableLayoutHeader";
this.tableLayoutHeader.RowCount = 1;
this.tableLayoutHeader.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutHeader.Size = new System.Drawing.Size(921, 48);
this.tableLayoutHeader.TabIndex = 4;
//
// Form1
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoSize = true;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(923, 613);
this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(300, 150);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Password Recorder";
this.Load += new System.EventHandler(this.Form1_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutHeader.ResumeLayout(false);
this.tableLayoutHeader.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.FlowLayoutPanel contentForm;
private System.Windows.Forms.Button CreateBtn;
private System.Windows.Forms.Button Save;
private System.Windows.Forms.Button UnwrapAll;
private System.Windows.Forms.Button protectBtn;
private System.Windows.Forms.TableLayoutPanel tableLayoutHeader;
}
}
| 56.930348 | 164 | 0.644848 | [
"MIT"
] | Volodymyr1337/PasswordRecorder | Form1.Designer.cs | 11,700 | C# |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Utility;
using Utility.FTP;
using WinSCP;
namespace UtilityTests.FTP
{
[TestClass]
public class FtpClientTests
{
/// <summary>
/// The test needs Syncplify.me installed in local system.
/// </summary>
//[TestMethod]
//public void FtpUploadTest()
//{
// string url = "localhost";
// string remoteDir = "/";
// string id = "admin";
// string pw = "admin";
// string sourceFile = @"C:\Users\joe\Documents\Temp\test.csv";
// var ftpClient = new FtpClient(url, remoteDir, id, pw);
// ftpClient.FtpUpload(sourceFile);
// // If there is no error, it is assumed as true
// Assert.IsTrue(true);
//}
//[TestMethod]
//public void FtpScpUploadTest()
//{
// string url = "localhost";
// string remoteDir = "/";
// string id = "admin";
// string pw = "admin";
// string sourceFileName = @"C:\Users\joe\Documents\Temp\test.csv";
// var ftpClient = new SFtpClient(url, id, pw, Protocol.Ftp);
// ftpClient.FtpUpload(sourceFileName, remoteDir);
// // If there is no error, it is assumed as true
// Assert.IsTrue(true);
//}
}
} | 31.204545 | 78 | 0.533139 | [
"MIT"
] | rocker8942/Utility | UtilityTests/FTP/FtpClientTests.cs | 1,375 | C# |
using EFCore.BulkExtensions;
using GameMaster.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GameMaster.Core
{
public class Simulator
{
public record SimulatorSettings
(
int GamesCount,
int NewPlayerCount,
int DecativatedPlayerCount
);
private readonly Controller _controller;
private readonly GameMasterContext _dbContext;
private readonly SimulatorSettings _simulatorSettings;
private Season NewSeason { get; set; }
private List<int> PlayerIds { get; set; }
private Dictionary<(int, int), Queue<Player>> Players { get; set; } = new();
private Dictionary<(int, int), bool> RunnerDone { get; set; } = new();
private Dictionary<int, (Character, Weapon)> PlayerItems { get; set; } = new();
private List<Region> Regions { get; set; }
private List<Rank> Ranks { get; set; }
private Dictionary<int, Character> Characters { get; set; } = new();
private Dictionary<int, CharacterDetail> CharacterDetails { get; set; } = new();
private Dictionary<int, Weapon> Weapons { get; set; } = new();
private Dictionary<int, WeaponDetail> WeaponDetails { get; set; } = new();
private Dictionary<(int, int), Synergy> Synergies { get; set; } = new();
private List<GamePlayer> GamePlayers { get; set; } = new();
public Simulator(Controller controller, GameMasterContext dbContext, SimulatorSettings simulatorSettings)
{
_controller = controller;
_dbContext = dbContext;
_simulatorSettings = simulatorSettings;
NewSeason = _controller.NewSeason(Guid.NewGuid().ToString(), DateTime.UtcNow, DateTime.UtcNow.AddDays(7));
PlayerIds = _controller.GetPlayerIds();
Regions = _controller.GetRegions();
Ranks = _controller.GetRanks();
Characters = _controller.GetAllCharacters().ToDictionary(x => x.Id, x => x);
CharacterDetails = _controller.GetAllCharacters().ToDictionary(x => x.Id, x => new CharacterDetail{ CharacterId = x.Id, GamesPlayed = 0, GamesWon = 0, SeasonId = NewSeason.Id });
Weapons = _controller.GetAllWeapons().ToDictionary(x => x.Id, x => x);
WeaponDetails = _controller.GetAllWeapons().ToDictionary(x => x.Id, x => new WeaponDetail{ WeaponId = x.Id, GamesPlayed = 0, GamesWon = 0, SeasonId = NewSeason.Id });
Synergies = _controller.GetSynergies().ToDictionary(x => (x.CharacterId, x.WeaponId), x => x);
DeactivatePlayers();
AddPlayers();
PlayerIds = _controller.GetPlayerIds();
Regions.ForEach(region => Ranks.ForEach(rank =>
{
Players.Add((region.Id, rank.Id), new(_controller.GetPlayerByRegionAndRank(region.Id, rank.Id)));
RunnerDone[(region.Id, rank.Id)] = false;
}));
}
private void DeactivatePlayers()
{
Random random = new();
int i = _simulatorSettings.DecativatedPlayerCount;
while (i > 0 && PlayerIds.Count > 0)
{
_controller.DeactivatePlayer(PlayerIds[random.Next(PlayerIds.Count)]);
i--;
}
}
private void AddPlayers()
{
Random random = new();
for (int i = 0; i < _simulatorSettings.NewPlayerCount; i++)
{
Region region = Regions[random.Next(Regions.Count)];
string guid = Guid.NewGuid().ToString();
int score = 0;
int activity = random.Next(101);
int skill = random.Next(101);
int temper = random.Next(5);
_controller.AddPlayer(guid, guid, "2000-01-01", DateTime.UtcNow, guid, activity, skill, temper, score, region.Id);
}
}
public async Task SimulateSeason()
{
List<Task> runners = new();
foreach (var q in Players.Keys)
{
int gamesCount = Players[q].Count * _simulatorSettings.GamesCount / PlayerIds.Count;
Queue<Game> games = new();
while (games.Count < gamesCount)
games.Enqueue(new Game { SeasonId = NewSeason.Id, StartTime = DateTime.UtcNow, RegionId = q.Item1 });
_dbContext.BulkInsert(games.ToArray(), new BulkConfig { PreserveInsertOrder = true, SetOutputIdentity = true, BatchSize = 4000 });
runners.Add(Task.Factory.StartNew(() => SimulateGames(Players[q], games, q.Item1, q.Item2)));
//SimulateGames(q);
}
await Task.WhenAll(runners);
_dbContext.BulkInsert(GamePlayers);
_dbContext.BulkInsert(CharacterDetails.Values.ToArray());
_dbContext.BulkInsert(WeaponDetails.Values.ToArray());
foreach (Queue<Player> q in Players.Values)
{
_dbContext.BulkUpdate(q.ToArray());
}
await _dbContext.SaveChangesAsync();
}
private void SimulateGames(Queue<Player> players, Queue<Game> games, int regionId, int rankId)
{
Random random = new();
while (games.Count > 0)
{
Game game = games.Dequeue();
List<Player> gamePlayers = new(2);
while (players.Count > 0 && gamePlayers.Count < 2)
{
Player player = players.Dequeue();
if (random.Next(100) <= player.Activity)
{
gamePlayers.Add(player);
}
else
{
players.Enqueue(player);
}
}
if (players.Count < 2)
return;
List<int> playerScores = new(2);
foreach (Player player in gamePlayers)
{
Character character;
Weapon weapon;
if (!PlayerItems.ContainsKey(player.Id))
{
character = Characters[Characters.Keys.ToList()[random.Next(Characters.Count)]];
weapon = Weapons[Weapons.Keys.ToList()[random.Next(Weapons.Count)]];
PlayerItems.Add(player.Id, (character, weapon));
}
else
{
character = PlayerItems[player.Id].Item1;
weapon = PlayerItems[player.Id].Item2;
}
int playerScore = (character.Health * weapon.Block) + (character.Mana * weapon.Magic) + (character.Mobility * weapon.Speed) + (character.Strength * weapon.Power);
playerScore *= Synergies[(character.Id, weapon.Id)].Multiplier;
playerScore += Synergies[(character.Id, weapon.Id)].Constant;
playerScore *= player.Skill;
playerScores.Add(playerScore);
}
for (int playerNumber = 0; playerNumber < 2; playerNumber++)
{
Player player = gamePlayers[playerNumber];
int playerId = player.Id;
Character character = PlayerItems[playerId].Item1;
Weapon weapon = PlayerItems[playerId].Item2;
CharacterDetails[character.Id].GamesPlayed += 1;
WeaponDetails[weapon.Id].GamesPlayed += 1;
GamePlayer gamePlayer = new()
{
GameId = game.Id,
PlayerId = playerId,
CharacterId = character.Id,
WeaponId = weapon.Id
};
int d = playerScores[playerNumber] - playerScores[1 - playerNumber];
int newScore = d > 200 ? 10 : d < -100 ? 100 : d > 0 ? 10 + d / 5 : 10 + d / 2;
if (playerScores[playerNumber] > playerScores[1 - playerNumber])
{
gamePlayer.IsWinner = true;
player.Score += newScore * 2;
CharacterDetails[character.Id].GamesWon += 1;
WeaponDetails[weapon.Id].GamesWon += 1;
}
else if (playerScores[playerNumber] < playerScores[1 - playerNumber])
{
gamePlayer.IsWinner = false;
player.Score -= newScore / 4;
player.Score = player.Score < 0 ? 0 : player.Score;
if (random.Next(player.Temper) == 0)
{
character = Characters[Characters.Keys.ToList()[random.Next(Characters.Count)]];
weapon = Weapons[Weapons.Keys.ToList()[random.Next(Weapons.Count)]];
PlayerItems[player.Id] = (character, weapon);
}
}
else
{
gamePlayer.IsWinner = true;
CharacterDetails[character.Id].GamesWon += 1;
WeaponDetails[weapon.Id].GamesWon += 1;
}
GamePlayers.Add(gamePlayer);
Rank newRank = Ranks.Where(r => r.Score <= player.Score).OrderByDescending(r => r.Score).First();
player.RankId = newRank.Id;
player.Rank = newRank;
if (!RunnerDone[(regionId, newRank.Id)])
{
Players[(player.RegionId, newRank.Id)].Enqueue(player);
if (newRank.Id != rankId)
{
System.Console.WriteLine("Nice");
}
}
else
{
Players[(regionId, rankId)].Enqueue(player);
}
}
}
RunnerDone[(regionId, rankId)] = true;
}
}
}
| 45.480176 | 190 | 0.509589 | [
"MIT"
] | mazenamr/GameMaster | GameMaster/Core/Simulator.cs | 10,326 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Bueller.MVC
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
| 24.125 | 99 | 0.585492 | [
"MIT"
] | 1804-Apr-USFdotnet/Project-2-Bueller | Project2-BuellerWebSln/Bueller.MVC/App_Start/RouteConfig.cs | 581 | C# |
// <auto-generated />
using System;
using GuitarFootprint.Data.PostgreSQL;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace GuitarFootprint.Data.PostgreSQL.Migrations
{
[DbContext(typeof(ApplicationContext))]
[Migration("20200809181314_AddedIdentity")]
partial class AddedIdentity
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.6")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("GuitarFootprint.Data.Entities.ApplicationRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("GuitarFootprint.Data.Entities.ApplicationUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("GuitarFootprint.Data.Entities.Audio", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte[]>("Content")
.HasColumnType("bytea");
b.Property<DateTimeOffset>("CreatedOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Audio");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<Guid>("RoleId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<Guid>("RoleId")
.HasColumnType("uuid");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.HasOne("GuitarFootprint.Data.Entities.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.HasOne("GuitarFootprint.Data.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.HasOne("GuitarFootprint.Data.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.HasOne("GuitarFootprint.Data.Entities.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GuitarFootprint.Data.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.HasOne("GuitarFootprint.Data.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
| 37.024055 | 128 | 0.471041 | [
"MIT"
] | zuyuz/GuitarFootprint | GuitarFootprint.Data.PostgreSQL/Migrations/20200809181314_AddedIdentity.Designer.cs | 10,776 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Vostok.Metrics.Models;
using Vostok.Metrics.Primitives.Timer;
namespace Vostok.Metrics.Aggregations.AggregateFunctions
{
[PublicAPI]
public class HistogramsAggregateFunction : IAggregateFunction
{
public const string Name = "Histograms";
private MetricEvent lastEvent;
private Dictionary<HistogramBucket, double> buckets = new Dictionary<HistogramBucket, double>();
public void Add(MetricEvent @event)
{
lastEvent = @event;
var bucket = @event.AggregationParameters.GetHistogramBucket();
if (bucket == null)
return;
if (!buckets.ContainsKey(bucket.Value))
buckets[bucket.Value] = 0;
buckets[bucket.Value] += @event.Value;
}
public IEnumerable<MetricEvent> Aggregate(DateTimeOffset timestamp)
{
if (lastEvent == null || !buckets.Any())
return Enumerable.Empty<MetricEvent>();
var result = new List<MetricEvent>();
var tags = lastEvent.Tags;
var quantiles = lastEvent.AggregationParameters.GetQuantiles() ?? Quantiles.DefaultQuantiles;
var sortedBuckets = buckets.OrderBy(b => b.Key.LowerBound).ToList();
var quantileTags = Quantiles.QuantileTags(quantiles, tags);
for (var i = 0; i < quantiles.Length; i++)
{
var value = GetQuantile(sortedBuckets, quantiles[i]);
result.Add(new MetricEvent(value, quantileTags[i], timestamp, lastEvent.Unit, null, null));
}
var totalCount = sortedBuckets.Sum(x => x.Value);
var countTags = tags.Append(WellKnownTagKeys.Aggregate, WellKnownTagValues.AggregateCount);
result.Add(new MetricEvent(totalCount, countTags, timestamp, null, null, null));
return result;
}
internal static double GetQuantile(List<KeyValuePair<HistogramBucket, double>> sortedBuckets, double quantile)
{
var totalCount = sortedBuckets.Sum(x => x.Value);
var skip = quantile * totalCount;
var i = 0;
while (i + 1 < sortedBuckets.Count && sortedBuckets[i].Value < skip)
{
skip -= sortedBuckets[i].Value;
i++;
}
var bucket = sortedBuckets[i].Key;
var value = sortedBuckets[i].Value;
if (double.IsPositiveInfinity(bucket.UpperBound))
return bucket.LowerBound;
if (double.IsNegativeInfinity(bucket.LowerBound))
return bucket.UpperBound;
var length = bucket.UpperBound - bucket.LowerBound;
var result = bucket.LowerBound + skip / value * length;
return result;
}
}
} | 36.192771 | 119 | 0.586218 | [
"MIT"
] | vostok/metrics.aggregations | Vostok.Metrics.Aggregations/AggregateFunctions/HistogramsAggregateFunction.cs | 3,006 | C# |
/*
* Copyright (c) Akifumi Fujita
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Diagnostics;
using System.Timers;
namespace VoiAlarm.Models
{
internal class Core
{
private readonly Timer timer = new Timer(1000);
public SettingsManager SettingsManager { get; }
public PlayerManager PlayerManager { get; }
public Core()
{
SettingsManager = new SettingsManager();
PlayerManager = new PlayerManager(SettingsManager);
}
public void StartTimer()
{
timer.Elapsed += OnTimedEvent;
timer.AutoReset = true;
timer.Enabled = true;
}
private void OnTimedEvent(object source, ElapsedEventArgs e)
{
var now = DateTime.Now;
if (now.Second != 0)
{
return;
}
// Process every minute and zero seconds.
lock (SettingsManager.LockGuard)
{
foreach (var alarm in SettingsManager.Value.Alarms)
{
if (IsEnabled(alarm, now) && IsTimeMatched(alarm, now))
{
Trace.WriteLine("Trigger alarm");
PlayerManager.Play(alarm);
}
}
}
}
private bool IsEnabled(Alarm alarm, DateTime now)
{
switch (now.DayOfWeek)
{
case DayOfWeek.Monday:
return alarm.IsEnabledMonday;
case DayOfWeek.Tuesday:
return alarm.IsEnabledTuesday;
case DayOfWeek.Wednesday:
return alarm.IsEnabledWednesday;
case DayOfWeek.Thursday:
return alarm.IsEnabledThursday;
case DayOfWeek.Friday:
return alarm.IsEnabledFriday;
case DayOfWeek.Saturday:
return alarm.IsEnabledSaturday;
case DayOfWeek.Sunday:
return alarm.IsEnabledSunday;
default:
throw new NotImplementedException("Unreachable");
};
}
private bool IsTimeMatched(Alarm alarm, DateTime now)
{
var alarmTime = DateTime.Parse(alarm.Time);
return alarmTime.Hour == now.Hour && alarmTime.Minute == now.Minute;
}
}
}
| 34.165049 | 81 | 0.585678 | [
"MIT"
] | fjt7tdmi/voi-alarm | VoiAlarm/Models/Core.cs | 3,521 | C# |
using Game.Management;
using UnityEngine;
namespace Game.Fighting.Handlers
{
public abstract class GameOverDisabler : MonoBehaviour
{
[SerializeField] private GameOverManager gameOverManager;
private void OnEnable() => gameOverManager.DidGameOver += OnGameOver;
private void OnDisable() => gameOverManager.DidGameOver -= OnGameOver;
protected abstract void OnGameOver();
}
}
| 26.4375 | 78 | 0.72104 | [
"MIT"
] | dcrdro/Physics-Battle | Assets/Scripts/Game/Fighting/Handlers/GameOverDisabler.cs | 425 | C# |
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
public partial class MasterPagePersonnel : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
| 22.285714 | 68 | 0.745726 | [
"MIT"
] | Mimalef/repop | src/Masters/MasterPagePersonnel.master.cs | 470 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.Identity.Client
{
/// <summary>
/// Contains parameters used by the MSAL call accessing the cache.
/// See also <see cref="T:ITokenCache"/> which contains methods
/// to customize the cache serialization
/// </summary>
public sealed partial class TokenCacheNotificationArgs
{
/// <summary>
/// Gets the <see cref="ITokenCache"/> involved in the transaction
/// </summary>
public ITokenCache TokenCache { get; internal set; }
/// <summary>
/// Gets the ClientId (application ID) of the application involved in the cache transaction
/// </summary>
public string ClientId { get; internal set; }
/// <summary>
/// Gets the account involved in the cache transaction.
/// </summary>
public IAccount Account { get; internal set; }
/// <summary>
/// Indicates whether the state of the cache has changed, for example when tokens are being added or removed.
/// Not all cache operations modify the state of the cache.
/// </summary>
public bool HasStateChanged { get; internal set; }
}
}
| 36.2 | 117 | 0.631413 | [
"MIT"
] | SpillChek2/microsoft-authentication-library-for-dotnet | src/Microsoft.Identity.Client/TokenCacheNotificationArgs.cs | 1,269 | C# |
using System;
using Microsoft.Maui.Graphics;
using static Microsoft.Maui.Primitives.Dimension;
namespace Microsoft.Maui.Layouts
{
public abstract class LayoutManager : ILayoutManager
{
public LayoutManager(ILayout layout)
{
Layout = layout;
}
public ILayout Layout { get; }
public abstract Size Measure(double widthConstraint, double heightConstraint);
public abstract Size ArrangeChildren(Rectangle bounds);
public static double ResolveConstraints(double externalConstraint, double explicitLength, double measuredLength, double min = Minimum, double max = Maximum)
{
var length = IsExplicitSet(explicitLength) ? explicitLength : measuredLength;
if (max < length)
{
length = max;
}
if (min > length)
{
length = min;
}
return Math.Min(length, externalConstraint);
}
}
}
| 22.486486 | 158 | 0.733173 | [
"MIT"
] | 41396/maui | src/Core/src/Layouts/LayoutManager.cs | 832 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using Abp.Domain.Repositories;
using Abp.Domain.Services;
using SPACore.PhoneBook.PhoneBooks.Persons;
namespace SPACore.PhoneBook.Persons.DomainServices
{
/// <summary>
/// Person领域层的业务管理
/// </summary>
public class PersonManager : PhoneBookDomainServiceBase, IPersonManager
{
////BCC/ BEGIN CUSTOM CODE SECTION
////ECC/ END CUSTOM CODE SECTION
private readonly IRepository<Person, int> _personRepository;
/// <summary>
/// Person的构造方法
/// </summary>
public PersonManager(IRepository<Person, int> personRepository)
{
_personRepository = personRepository;
}
//TODO:编写领域业务代码
/// <summary>
/// 初始化
/// </summary>
public void InitPerson()
{
throw new NotImplementedException();
}
}
}
| 24.526316 | 75 | 0.613734 | [
"MIT"
] | 52ABP/SPA.PhoneBook | src/aspnet-core/src/SPACore.PhoneBook.Core/PhoneBooks/Persons/DomainServices/PersonManager.cs | 982 | C# |
using System.Threading;
using Amazon.SimpleNotificationService;
using Amazon.SimpleNotificationService.Model;
using Moq;
using NUnit.Framework;
using Watchman.Engine.Logging;
using Watchman.Engine.Sns;
using System.Threading.Tasks;
namespace Watchman.Engine.Tests.Sns
{
[TestFixture]
public class SnsTopicCreatorTests
{
[Test]
public async Task HappyPathShouldCreateTopic()
{
var client = new Mock<IAmazonSimpleNotificationService>();
MockCreateTopic(client, TestCreateTopicResponse());
var logger = new Mock<IAlarmLogger>();
var snsTopicCreator = new SnsTopicCreator(client.Object, logger.Object);
var topicArn = await snsTopicCreator.EnsureSnsTopic("test1", false);
Assert.That(topicArn, Is.Not.Null);
Assert.That(topicArn, Is.EqualTo("testResponse-abc123"));
client.Verify(c => c.CreateTopicAsync("test1-Alerts", It.IsAny<CancellationToken>()), Times.Once);
}
[Test]
public async Task DryRunShouldNotCreateTopic()
{
var client = new Mock<IAmazonSimpleNotificationService>();
MockCreateTopic(client, TestCreateTopicResponse());
var logger = new Mock<IAlarmLogger>();
var snsTopicCreator = new SnsTopicCreator(client.Object, logger.Object);
var topicArn = await snsTopicCreator.EnsureSnsTopic("test1", true);
Assert.That(topicArn, Is.Not.Null);
client.Verify(c => c.CreateTopicAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()),
Times.Never);
}
private static CreateTopicResponse TestCreateTopicResponse()
{
return new CreateTopicResponse
{
TopicArn = "testResponse-abc123"
};
}
private void MockCreateTopic(Mock<IAmazonSimpleNotificationService> client,
CreateTopicResponse response)
{
client
.Setup(c => c.CreateTopicAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(response);
}
}
}
| 32.954545 | 110 | 0.629425 | [
"Apache-2.0"
] | RTamizian/AwsWatchman | Watchman.Engine.Tests/Sns/SnsTopicCreatorTests.cs | 2,175 | C# |
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace CRM.Interface
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Moduleid operations.
/// </summary>
public partial interface IModuleid
{
/// <summary>
/// Get rra_ModuleId from rra_webpages
/// </summary>
/// <param name='rraWebpageid'>
/// key: rra_webpageid of rra_webpage
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse<MicrosoftDynamicsCRMrraModule>> GetWithHttpMessagesAsync(string rraWebpageid, IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
| 37.431373 | 328 | 0.632268 | [
"MIT"
] | msehudi/cms-accelerator | OData.OpenAPI/odata2openapi/Client/IModuleid.cs | 1,909 | C# |
// from http://www.sharkbombs.com/2015/02/17/unity-editor-enum-flags-as-toggle-buttons/
// Extended by Tassim
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(EnumFlagsAttribute))]
public class EnumFlagsAttributeDrawer : PropertyDrawer {
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) {
// -1 accounts for the Default value wich should always be 0, thus not displayed
bool[] buttons = new bool[prop.enumNames.Length - 1];
float buttonWidth = (pos.width - (label == GUIContent.none ? 0 : EditorGUIUtility.labelWidth)) / buttons.Length;
if (label != GUIContent.none) {
EditorGUI.LabelField(new Rect(pos.x, pos.y, EditorGUIUtility.labelWidth, pos.height), label);
}
// Handle button value
EditorGUI.BeginChangeCheck();
int buttonsValue = 0;
for (int i = 0; i < buttons.Length; i++) {
// Check if the button is/was pressed
if ((prop.intValue & (1 << i)) == (1 << i)) {
buttons[i] = true;
}
// Display the button
Rect buttonPos = new Rect(pos.x + (label == GUIContent.none ? 0 : EditorGUIUtility.labelWidth) + buttonWidth * i, pos.y, buttonWidth, pos.height);
buttons[i] = GUI.Toggle(buttonPos, buttons[i], prop.enumNames[i + 1], "Button");
if (buttons[i]) {
buttonsValue += 1 << i;
}
}
// This is set to true if a control changed in the previous BeginChangeCheck block
if (EditorGUI.EndChangeCheck()) {
prop.intValue = buttonsValue;
}
}
}
| 37.795455 | 158 | 0.606133 | [
"MIT"
] | Tassim/UnityEnumEditor | UnityEnumFlags/Assets/Tassim/EnumFlags/Scripts/Editor/EnumFlagsAttributeDrawer.cs | 1,665 | C# |
using System;
using System.Collections.Generic;
using OmniSharp.Extensions.JsonRpc;
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
namespace OmniSharp.Extensions.LanguageServer.Protocol.Shared
{
public interface ISupportedCapabilities
{
bool AllowsDynamicRegistration(Type? capabilityType);
object? GetRegistrationOptions(ILspHandlerTypeDescriptor handlerTypeDescriptor, IJsonRpcHandler handler);
object? GetRegistrationOptions(ILspHandlerDescriptor handlerTypeDescriptor);
void Add(IEnumerable<ISupports> supports);
void Add(ICapability capability);
void Initialize(ClientCapabilities clientCapabilities);
}
}
| 38.777778 | 113 | 0.793696 | [
"MIT"
] | Devils-Knight/csharp-language-server-protocol | src/Protocol/Shared/ISupportedCapabilities.cs | 700 | C# |
using System;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using DataLayer.Interfaces;
using DomainClasses;
namespace DataLayer.Models
{
public class AddressRepository : IAddressRepository
{
SalesContext context;
public AddressRepository()
{
var uow = new SalesContextUnitOfWork();
context = uow.Context;
}
public AddressRepository(SalesContextUnitOfWork uow)
{
context = uow.Context;
}
public IQueryable<Address> All
{
get { return context.Addresses; }
}
public IQueryable<Address> AllIncluding(params Expression<Func<Address, object>>[] includeProperties)
{
IQueryable<Address> query = context.Addresses;
foreach (var includeProperty in includeProperties)
{
query = query.Include(includeProperty);
}
return query;
}
public Address Find(int id)
{
return context.Addresses.Find(id);
}
public void InsertGraph(Address address)
{
context.Addresses.Add(address);
}
public void InsertOrUpdate(Address address)
{
if (address.Id == default(int)) // New entity
{
context.Entry(address).State = EntityState.Added;
}
else // Existing entity
{
context.Addresses.Add(address);
context.Entry(address).State = EntityState.Modified;
}
}
public void Delete(int id)
{
var address = context.Addresses.Find(id);
context.Addresses.Remove(address);
}
public void Save()
{
context.SaveChanges();
}
public void Dispose()
{
// context.Dispose();
}
}
} | 19.639535 | 105 | 0.631735 | [
"MIT"
] | vickykatoch/acme-mvc | Acme.Data/Repository/AddressRepository.cs | 1,689 | C# |
using EasySharp.ComponentModel.Reflection;
using EasySharpStandardMvvm.Attributes.Rails;
using System.Reflection;
namespace EasySharpStandardMvvm.Models.Rails.Core
{
public class RailsModel
{
public override string ToString()
{
return this.ToCommaSeparatedString(
p => p.GetCustomAttribute<RailsDataMemberBindAttribute>()?.UserVisible == true);
}
}
}
| 26.0625 | 96 | 0.693046 | [
"MIT"
] | kenberry0728/EasySharp | DEV/Standard/EasySharpStandardMvvm/Models/Rails/Core/RailsModel.cs | 419 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace YanZhiwei.BookShop.WebUI.Areas.Admin.Controllers
{
public class HomeController : Controller
{
/*
Controller的歧义问题:
*/
// GET: Admin/Home
public ActionResult Index()
{
return View();
}
}
} | 19.25 | 58 | 0.605195 | [
"MIT"
] | wind2006/DotNet.Utilities | YanZhiwei.BookShop.WebUI/Areas/Admin/Controllers/HomeController.cs | 397 | C# |
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using Eshava.Core.Extensions;
using Eshava.Core.IO;
using Eshava.Core.IO.Exceptions;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Eshava.Test.Core.IO
{
[TestClass, TestCategory("Core.IO")]
public class ZipArchiveEngineTest
{
private ZipArchiveEngine _classUnderTest;
private ConcurrentBag<string> _workspaces;
[TestInitialize]
public void Setup()
{
_workspaces = new ConcurrentBag<string>();
_classUnderTest = new ZipArchiveEngine();
}
[AssemblyCleanup]
public void CleanupAfterAllTests()
{
CleanUpTestBed();
}
[TestMethod, ExpectedException(typeof(ArchiveException))]
public void CreateArchiveFromDirectorNoArchivePathTest()
{
// Act
_classUnderTest.CreateArchive(null, null, CompressionLevel.Optimal, false);
}
[TestMethod, ExpectedException(typeof(NotSupportedException))]
public void CreateArchiveFromDirectoryWrongArchiveTypeTest()
{
// Act
_classUnderTest.CreateArchive(null, Path.Combine(Path.GetTempPath(), "Archive.7z"), CompressionLevel.Optimal, false);
}
[TestMethod]
public void CreateArchiveFromDirectoryTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, false);
var archiveFullFileName = Path.Combine(targetPath, "Archive.zip");
// Act
_classUnderTest.CreateArchive(sourcePath, archiveFullFileName, CompressionLevel.Optimal, false);
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
var fileList = new List<string>();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
fileList.AddRange(archive.Entries.Select(entry => entry.FullName.Replace("/", "\\")));
}
fileList.Should().HaveCount(2);
fileList.First().Should().Be("Darkwing Duck.txt");
fileList.Last().Should().Be(Path.Combine("QuackFu", "Manifest of QuackFu.txt"));
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod]
public void CreateArchiveFromDirectoryIncludeBaseDirectoryTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, false);
var archiveFullFileName = Path.Combine(targetPath, "Archive.zip");
// Act
_classUnderTest.CreateArchive(sourcePath, archiveFullFileName, CompressionLevel.Fastest, true);
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
var fileList = new List<string>();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
fileList.AddRange(archive.Entries.Select(entry => entry.FullName.Replace("/", "\\")));
}
var sourceDirectory = new DirectoryInfo(sourcePath);
fileList.Should().HaveCount(2);
fileList.First().Should().Be(Path.Combine(sourceDirectory.Name, "Darkwing Duck.txt"));
fileList.Last().Should().Be(Path.Combine(sourceDirectory.Name, "QuackFu", "Manifest of QuackFu.txt"));
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod]
public void CreateArchiveByArchiveNameWithExistingTargetArchiveTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, true);
var archiveFullFileName = Path.Combine(targetPath, "Archive.zip");
System.IO.Directory.CreateDirectory(targetPath);
System.IO.File.Move(Path.Combine(sourcePath, "Archive.zip"), Path.Combine(targetPath, "Archive.zip"));
// Act
_classUnderTest.CreateArchive(targetPath, "Archive", Array.Empty<(string source, string target)>());
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
archive.Entries.Should().HaveCount(0);
}
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod]
public void CreateArchiveByArchiveNameWithDirectoryStrutureTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, false);
var archiveFullFileName = Path.Combine(targetPath, "Archive.zip");
var fullFileNames = new List<(string source, string target)>
{
(Path.Combine(sourcePath, "Darkwing Duck.txt"), "Darkwing Duck.txt"),
(Path.Combine(sourcePath, "QuackFu", "Manifest of QuackFu.txt"), Path.Combine("QuackFu", "Manifest of QuackFu.txt"))
};
// Act
_classUnderTest.CreateArchive(targetPath, "Archive", fullFileNames);
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
var fileList = new List<string>();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
fileList.AddRange(archive.Entries.Select(entry => entry.FullName.Replace("/", "\\")));
}
fileList.Should().HaveCount(2);
fileList.First().Should().Be("Darkwing Duck.txt");
fileList.Last().Should().Be(Path.Combine("QuackFu", "Manifest of QuackFu.txt"));
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod]
public void CreateArchiveByArchiveNameWithoutDirectoryStrutureTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, false);
var archiveFullFileName = Path.Combine(targetPath, "Archive.zip");
var fullFileNames = new List<(string source, string target)>
{
(Path.Combine(sourcePath, "Darkwing Duck.txt"), null),
(Path.Combine(sourcePath, "QuackFu", "Manifest of QuackFu.txt"), null)
};
// Act
_classUnderTest.CreateArchive(targetPath, "Archive", fullFileNames);
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
var fileList = new List<string>();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
fileList.AddRange(archive.Entries.Select(entry => entry.FullName.Replace("/", "\\")));
}
fileList.Should().HaveCount(2);
fileList.First().Should().Be("Darkwing Duck.txt");
fileList.Last().Should().Be("Manifest of QuackFu.txt");
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod, ExpectedException(typeof(NotSupportedException))]
public void CreateArchiveWrongArchiveTypeTest()
{
// Act
_classUnderTest.CreateArchive(Path.Combine(Path.GetTempPath(), "Archive.7z"), Array.Empty<(string source, string target)>());
}
[TestMethod]
public void CreateArchiveWithExistingTargetArchiveTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, false);
var archiveFullFileName = Path.Combine(targetPath, "Archive.zip");
var fullFileNames = new List<(string source, string target)>
{
(Path.Combine(sourcePath, "Darkwing Duck.txt"), null),
(Path.Combine(sourcePath, "QuackFu", "Manifest of QuackFu.txt"), null)
};
// Act
_classUnderTest.CreateArchive(archiveFullFileName, fullFileNames);
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
var fileList = new List<string>();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
fileList.AddRange(archive.Entries.Select(entry => entry.FullName.Replace("/", "\\")));
}
fileList.Should().HaveCount(2);
fileList.First().Should().Be("Darkwing Duck.txt");
fileList.Last().Should().Be("Manifest of QuackFu.txt");
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod, ExpectedException(typeof(NotSupportedException))]
public void UpdateArchiveWrongArchiveTypeTest()
{
// Act
_classUnderTest.UpdateArchive(Path.Combine(Path.GetTempPath(), "Archive.7z"), Array.Empty<(string source, string target)>());
}
[TestMethod, ExpectedException(typeof(ArchiveException))]
public void UpdateArchiveMissingArchiveTest()
{
// Act
_classUnderTest.UpdateArchive(Path.Combine(Path.GetTempPath(), "Archive.zip"), Array.Empty<(string source, string target)>());
}
[TestMethod]
public void UpdateArchiveWithExistingTargetArchiveTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(true, true);
var archiveFullFileName = Path.Combine(sourcePath, "Archive.zip");
var fullFileNames = new List<(string source, string target)>
{
(Path.Combine(sourcePath, "Darkwing Duck.txt"), "Darkwing Duck Again.txt")
};
// Act
_classUnderTest.UpdateArchive(archiveFullFileName, fullFileNames);
// Assert
System.IO.File.Exists(archiveFullFileName).Should().BeTrue();
var fileList = new List<string>();
using (var archive = ZipFile.OpenRead(archiveFullFileName))
{
fileList.AddRange(archive.Entries.Select(entry => entry.FullName.Replace("/", "\\")));
}
fileList.Should().HaveCount(3);
fileList[0].Should().Be("Darkwing Duck.txt");
fileList[1].Should().Be(Path.Combine("QuackFu", "Manifest of QuackFu.txt"));
fileList[2].Should().Be("Darkwing Duck Again.txt");
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod, ExpectedException(typeof(NotSupportedException))]
public void ExtractArchiveWrongArchiveTypeTest()
{
// Act
_classUnderTest.ExtractArchive(Path.Combine(Path.GetTempPath(), "Archive.7z"), null);
}
[TestMethod, ExpectedException(typeof(ArchiveException))]
public void ExtractArchiveMissingArchiveTest()
{
// Act
_classUnderTest.ExtractArchive(Path.Combine(Path.GetTempPath(), "Archive.zip"), null);
}
[TestMethod]
public void ExtractArchiveTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(false, true);
var archiveFullFileName = Path.Combine(sourcePath, "Archive.zip");
// Act
_classUnderTest.ExtractArchive(archiveFullFileName, targetPath);
// Assert
System.IO.File.Exists(Path.Combine(targetPath, "Darkwing Duck.txt")).Should().BeTrue();
System.IO.File.Exists(Path.Combine(targetPath, "QuackFu", "Manifest of QuackFu.txt")).Should().BeTrue();
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
private (string SourcePath, string TargetPath) PrepareTestBed(bool copyFiles, bool copyArchive)
{
var userTempPath = Path.GetTempPath();
var sourceDirectory = Path.Combine(userTempPath, Path.GetRandomFileName());
var targetDirectory = Path.Combine(userTempPath, Path.GetRandomFileName());
_workspaces.Add(sourceDirectory);
_workspaces.Add(targetDirectory);
CleanUpTestBed(sourceDirectory, targetDirectory);
if (copyFiles || copyArchive)
{
System.IO.Directory.CreateDirectory(sourceDirectory);
}
if (copyFiles)
{
System.IO.Directory.CreateDirectory(Path.Combine(sourceDirectory, "QuackFu"));
System.IO.File.Copy(Path.Combine(Environment.CurrentDirectory, "Core.IO", "Input", "Darkwing Duck.txt"), Path.Combine(sourceDirectory, "Darkwing Duck.txt"));
System.IO.File.Copy(Path.Combine(Environment.CurrentDirectory, "Core.IO", "Input", "QuackFu", "Manifest of QuackFu.txt"), Path.Combine(sourceDirectory, "QuackFu", "Manifest of QuackFu.txt"));
}
if (copyArchive)
{
System.IO.File.Copy(Path.Combine(Environment.CurrentDirectory, "Core.IO", "Input", "Archive.zip"), Path.Combine(sourceDirectory, "Archive.zip"));
}
return (sourceDirectory, targetDirectory);
}
[TestMethod, ExpectedException(typeof(NotSupportedException))]
public void ReadFullFileNamesWrongArchiveTypeTest()
{
// Act
_classUnderTest.ReadFullFileNames(Path.Combine(Path.GetTempPath(), "Archive.7z"));
}
[TestMethod]
public void ReadFullFileNamesTest()
{
// Arrange
(var sourcePath, var targetPath) = PrepareTestBed(false, true);
var archiveFullFileName = Path.Combine(sourcePath, "Archive.zip");
// Act
var result = _classUnderTest.ReadFullFileNames(archiveFullFileName);
// Assert
result.Should().HaveCount(2);
result.First().Should().Be("Darkwing Duck.txt");
result.Last().Should().Be(Path.Combine("QuackFu", "Manifest of QuackFu.txt"));
// Avoid mess
CleanUpTestBed(sourcePath, targetPath);
}
[TestMethod, ExpectedException(typeof(ArchiveException))]
public void ReadFullFileNamesMissingArchiveTest()
{
// Act
_classUnderTest.ReadFullFileNames(Path.Combine(Path.GetTempPath(), "Archive.zip"));
}
private void CleanUpTestBed(string sourceDirectoryPath, string targetDirectoryPath)
{
if (!sourceDirectoryPath.IsNullOrEmpty() && System.IO.Directory.Exists(sourceDirectoryPath))
{
System.IO.Directory.Delete(sourceDirectoryPath, true);
}
if (!targetDirectoryPath.IsNullOrEmpty() && System.IO.Directory.Exists(targetDirectoryPath))
{
System.IO.Directory.Delete(targetDirectoryPath, true);
}
}
private void CleanUpTestBed()
{
foreach (var workspace in _workspaces.Where(System.IO.Directory.Exists))
{
System.IO.Directory.Delete(workspace, true);
}
}
}
} | 31.994937 | 195 | 0.720367 | [
"MIT"
] | MichaelPruefer/core | Eshava.Test/Core.IO/ZipArchiveEngineTest.cs | 12,640 | C# |
using System.Globalization;
using MyAccounts.Business.AccountOperations.Contracts;
using MyAccounts.Business.AccountOperations.Unified;
namespace MyAccounts.Business.AccountOperations.Sodexo
{
public class SodexoToUnifiedAccountOperationMapper : AccountToUnifiedOperationMapperBase<SodexoOperation>
{
public override UnifiedAccountOperation Map(SodexoOperation operation, CultureInfo culture)
{
var rawAmount = operation.Amount.Replace(" ", string.Empty);
var amount = decimal.Parse(
rawAmount,
NumberStyles.AllowLeadingSign | NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint | NumberStyles.AllowCurrencySymbol,
culture);
decimal income = 0, outcome = 0;
if (amount < 0)
{
outcome = -amount;
}
else
{
income = amount;
}
var trx = new UnifiedAccountOperation
{
ValueDate = operation.Date,
ExecutionDate = operation.Date,
Income = income,
Outcome = outcome,
Currency = "EUR",
Note = operation.Detail,
SourceKind = operation.SourceKind
};
return trx;
}
}
} | 32.547619 | 144 | 0.570593 | [
"MIT"
] | blaise-braye/my-accounts | MyAccounts.Business/AccountOperations/Sodexo/SodexoToUnifiedAccountOperationMapper.cs | 1,369 | C# |
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace TatumPlatform.Model.Requests
{
public class DeployEthereumErc20 : IValidatableObject
{
[Required]
[StringLength(66, MinimumLength = 66)]
public string FromPrivateKey { get; set; }
[Required]
[StringLength(42, MinimumLength = 42)]
public string Address { get; set; }
[Required]
[StringLength(100, MinimumLength = 1)]
[RegularExpression(@"^[a-zA-Z0-9_]+$")]
public string Name { get; set; }
[Required]
[StringLength(30, MinimumLength = 1)]
public string Symbol { get; set; }
[Required]
[RegularExpression(@"^[+]?((\d+(\.\d*)?)|(\.\d+))$")]
public string Supply { get; set; }
[Range(1, 30)]
public byte Digits { get; set; }
public Fee Fee { get; set; }
[Range(0, uint.MaxValue)]
public uint Nonce { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
List<ValidationResult> results = new List<ValidationResult>();
if (Fee != null)
{
var feeContext = new ValidationContext(Fee);
Validator.ValidateObject(Fee, feeContext, validateAllProperties: true);
}
if (results.Count == 0)
{
results.Add(ValidationResult.Success);
}
return results;
}
}
}
| 27.375 | 90 | 0.559035 | [
"MIT"
] | saman-hosseini/tatum-csharp | src/Tatum/Model/Requests/Ethereum/DeployEthereumErc20.cs | 1,535 | C# |
//
// Copyright (c) Microsoft and contributors. 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Management.Sql.Models;
namespace Microsoft.Azure.Management.Sql
{
/// <summary>
/// Represents all the operations of Azure SQL Database Transparent Data
/// Encryption. Contains operations to: Retrieve, and Update Transparent
/// Data Encryption.
/// </summary>
public partial interface ITransparentDataEncryptionOperations
{
/// <summary>
/// Creates or updates an Azure SQL Database Transparent Data
/// Encryption Operation.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the server belongs.
/// </param>
/// <param name='serverName'>
/// The name of the Azure SQL Database Server on which the database is
/// hosted.
/// </param>
/// <param name='databaseName'>
/// The name of the Azure SQL Database for which setting the
/// Transparent Data Encryption applies.
/// </param>
/// <param name='parameters'>
/// The required parameters for creating or updating transparent data
/// encryption.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Represents the response to a Get for a Azure Sql Database
/// Transparent Data Encryption request.
/// </returns>
Task<TransparentDataEncryptionGetResponse> CreateOrUpdateAsync(string resourceGroupName, string serverName, string databaseName, TransparentDataEncryptionCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Returns an Azure SQL Database Transparent Data Encryption Response.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the server belongs.
/// </param>
/// <param name='serverName'>
/// The name of the Azure SQL Database Server on which the database is
/// hosted.
/// </param>
/// <param name='databaseName'>
/// The name of the Azure SQL Database for which the Transparent Data
/// Encryption applies.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Represents the response to a Get for a Azure Sql Database
/// Transparent Data Encryption request.
/// </returns>
Task<TransparentDataEncryptionGetResponse> GetAsync(string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken);
/// <summary>
/// Returns an Azure SQL Database Transparent Data Encryption Activity
/// Response.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the server belongs.
/// </param>
/// <param name='serverName'>
/// The name of the Azure SQL Database Server on which the database is
/// hosted.
/// </param>
/// <param name='databaseName'>
/// The name of the Azure SQL Database for which the Transparent Data
/// Encryption applies.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Represents the response to a List Azure Sql Database Transparent
/// Data Encryption Activity request.
/// </returns>
Task<TransparentDataEncryptionActivityListResponse> ListActivityAsync(string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken);
}
}
| 41.079646 | 236 | 0.640026 | [
"Apache-2.0"
] | CerebralMischief/azure-sdk-for-net | src/ResourceManagement/Sql/SqlManagement/Generated/ITransparentDataEncryptionOperations.cs | 4,642 | C# |
// <copyright file="NotificationRepositoryExtensions.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// </copyright>
namespace Microsoft.Teams.Apps.CompanyCommunicator.Repositories.Extensions
{
using System;
using System.Threading.Tasks;
using Microsoft.Teams.Apps.CompanyCommunicator.Common.Repositories;
using Microsoft.Teams.Apps.CompanyCommunicator.Common.Repositories.NotificationData;
using Microsoft.Teams.Apps.CompanyCommunicator.Models;
/// <summary>
/// Extensions for the repository of the notification data.
/// </summary>
public static class NotificationRepositoryExtensions
{
/// <summary>
/// Create a new draft notification.
/// </summary>
/// <param name="notificationRepository">The notification repository.</param>
/// <param name="notification">Draft Notification model class instance passed in from Web API.</param>
/// <param name="userName">Name of the user who is running the application.</param>
/// <returns>The newly created notification's id.</returns>
public static async Task<string> CreateDraftNotificationAsync(
this NotificationDataRepository notificationRepository,
DraftNotification notification,
string userName)
{
var newId = notificationRepository.TableRowKeyGenerator.CreateNewKeyOrderingOldestToMostRecent();
var notificationEntity = new NotificationDataEntity
{
PartitionKey = PartitionKeyNames.NotificationDataTable.DraftNotificationsPartition,
RowKey = newId,
Id = newId,
Title = notification.Title,
ImageLink = notification.ImageLink,
Summary = notification.Summary,
Author = notification.Author,
ButtonTitle = notification.ButtonTitle,
ButtonLink = notification.ButtonLink,
ButtonTitle2 = notification.ButtonTitle2,
ButtonLink2 = notification.ButtonLink2,
CreatedBy = userName,
CreatedDate = DateTime.UtcNow,
IsDraft = true,
Teams = notification.Teams,
Rosters = notification.Rosters,
ADGroups = notification.ADGroups,
AllUsers = notification.AllUsers,
IsScheduled = notification.IsScheduled,
ScheduleDate = notification.ScheduleDate,
IsRecurrence = notification.IsRecurrence,
Repeats = notification.Repeats,
RepeatFor = Convert.ToInt32(notification.RepeatFor),
RepeatFrequency = notification.RepeatFrequency,
WeekSelection = notification.WeekSelection,
RepeatStartDate = notification.RepeatStartDate,
RepeatEndDate = notification.RepeatEndDate,
};
await notificationRepository.CreateOrUpdateAsync(notificationEntity);
return newId;
}
}
}
| 44.637681 | 110 | 0.641883 | [
"MIT"
] | sacianc/ccv2spa | Source/Microsoft.Teams.Apps.CompanyCommunicator/Repositories/Extensions/NotificationRepositoryExtensions.cs | 3,082 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using API.DTOs;
using API.Entities;
namespace API.Interfaces
{
public interface ILikesRepository
{
Task<Like> GetPostLike(int userId, int postId);
Boolean RemoveLike(Like like);
Task<AppUser> GetUserWithLikes(int userId);
Task<IEnumerable<AppPost>> GetPostsLikedByUserId(int userId);
Task<IEnumerable<PostLikesDto>> GetUsersLikesByPostId(int postId);
}
} | 28 | 74 | 0.730159 | [
"MIT"
] | iMelki/blog-sys-api | API/Interfaces/ILikesRepository.cs | 504 | C# |
using System;
using System.IO;
using appFBLA2019;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace appFBLA2019_Tests
{
[TestClass]
public class DatabaseTests
{
private const string sqLiteExtension = ".db3";
[TestMethod]
public void TestFileCreation()
{
string fileName = "newFile";
// TO DO: Pass in username of level author
//DBHandler.SelectDatabase(fileName);
string path = Path.Combine(
Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData), fileName + sqLiteExtension);
Assert.IsTrue(Directory.GetFiles(path).Length != 0);
}
}
}
| 26.892857 | 107 | 0.600266 | [
"MIT"
] | chungmcl/BizQuiz | appFBLA2019_Tests/DatabaseTests.cs | 755 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using DynamicData.Tests.Domain;
using FluentAssertions;
using Microsoft.Reactive.Testing;
using Xunit;
namespace DynamicData.Tests.Cache
{
public class BufferInitialFixture
{
private static readonly ICollection<Person> People = Enumerable.Range(1, 10_000).Select(i => new Person(i.ToString(), i)).ToList();
[Fact]
public void BufferInitial()
{
var scheduler = new TestScheduler();
using (var cache = new SourceCache<Person, string>(i => i.Name))
using (var aggregator = cache.Connect().BufferInitial(TimeSpan.FromSeconds(1), scheduler).AsAggregator())
{
foreach (var item in People)
cache.AddOrUpdate(item);
aggregator.Data.Count.Should().Be(0);
aggregator.Messages.Count.Should().Be(0);
scheduler.Start();
aggregator.Data.Count.Should().Be(10_000);
aggregator.Messages.Count.Should().Be(1);
cache.AddOrUpdate(new Person("_New",1));
aggregator.Data.Count.Should().Be(10_001);
aggregator.Messages.Count.Should().Be(2);
}
}
}
} | 31.512195 | 139 | 0.589009 | [
"MIT"
] | Didovgopoly/DynamicData | DynamicData.Tests/Cache/BufferInitialFixture.cs | 1,292 | 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("Calisma15")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Calisma15")]
[assembly: System.Reflection.AssemblyTitleAttribute("Calisma15")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
| 40.791667 | 80 | 0.646578 | [
"MIT"
] | aleynazengin/CSharp101 | Calisma15/obj/Release/net5.0/Calisma15.AssemblyInfo.cs | 979 | 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 storagegateway-2013-06-30.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.StorageGateway.Model
{
/// <summary>
/// Container for the parameters to the CreateStorediSCSIVolume operation.
/// Creates a volume on a specified gateway. This operation is only supported in the stored
/// volume gateway type.
///
///
/// <para>
/// The size of the volume to create is inferred from the disk size. You can choose to
/// preserve existing data on the disk, create volume from an existing snapshot, or create
/// an empty volume. If you choose to create an empty gateway volume, then any existing
/// data on the disk is erased.
/// </para>
///
/// <para>
/// In the request you must specify the gateway and the disk information on which you
/// are creating the volume. In response, the gateway creates the volume and returns volume
/// information such as the volume Amazon Resource Name (ARN), its size, and the iSCSI
/// target ARN that initiators can use to connect to the volume target.
/// </para>
/// </summary>
public partial class CreateStorediSCSIVolumeRequest : AmazonStorageGatewayRequest
{
private string _diskId;
private string _gatewayARN;
private bool? _kmsEncrypted;
private string _kmsKey;
private string _networkInterfaceId;
private bool? _preserveExistingData;
private string _snapshotId;
private List<Tag> _tags = new List<Tag>();
private string _targetName;
/// <summary>
/// Gets and sets the property DiskId.
/// <para>
/// The unique identifier for the gateway local disk that is configured as a stored volume.
/// Use <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/API_ListLocalDisks.html">ListLocalDisks</a>
/// to list disk IDs for a gateway.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=300)]
public string DiskId
{
get { return this._diskId; }
set { this._diskId = value; }
}
// Check to see if DiskId property is set
internal bool IsSetDiskId()
{
return this._diskId != null;
}
/// <summary>
/// Gets and sets the property GatewayARN.
/// </summary>
[AWSProperty(Required=true, Min=50, Max=500)]
public string GatewayARN
{
get { return this._gatewayARN; }
set { this._gatewayARN = value; }
}
// Check to see if GatewayARN property is set
internal bool IsSetGatewayARN()
{
return this._gatewayARN != null;
}
/// <summary>
/// Gets and sets the property KMSEncrypted.
/// <para>
/// Set to <code>true</code> to use Amazon S3 server-side encryption with your own AWS
/// KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.
/// </para>
///
/// <para>
/// Valid Values: <code>true</code> | <code>false</code>
/// </para>
/// </summary>
public bool KMSEncrypted
{
get { return this._kmsEncrypted.GetValueOrDefault(); }
set { this._kmsEncrypted = value; }
}
// Check to see if KMSEncrypted property is set
internal bool IsSetKMSEncrypted()
{
return this._kmsEncrypted.HasValue;
}
/// <summary>
/// Gets and sets the property KMSKey.
/// <para>
/// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon
/// S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This
/// value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.
/// </para>
/// </summary>
[AWSProperty(Min=7, Max=2048)]
public string KMSKey
{
get { return this._kmsKey; }
set { this._kmsKey = value; }
}
// Check to see if KMSKey property is set
internal bool IsSetKMSKey()
{
return this._kmsKey != null;
}
/// <summary>
/// Gets and sets the property NetworkInterfaceId.
/// <para>
/// The network interface of the gateway on which to expose the iSCSI target. Only IPv4
/// addresses are accepted. Use <a>DescribeGatewayInformation</a> to get a list of the
/// network interfaces available on a gateway.
/// </para>
///
/// <para>
/// Valid Values: A valid IP address.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string NetworkInterfaceId
{
get { return this._networkInterfaceId; }
set { this._networkInterfaceId = value; }
}
// Check to see if NetworkInterfaceId property is set
internal bool IsSetNetworkInterfaceId()
{
return this._networkInterfaceId != null;
}
/// <summary>
/// Gets and sets the property PreserveExistingData.
/// <para>
/// Set to true <code>true</code> if you want to preserve the data on the local disk.
/// Otherwise, set to <code>false</code> to create an empty volume.
/// </para>
///
/// <para>
/// Valid Values: <code>true</code> | <code>false</code>
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public bool PreserveExistingData
{
get { return this._preserveExistingData.GetValueOrDefault(); }
set { this._preserveExistingData = value; }
}
// Check to see if PreserveExistingData property is set
internal bool IsSetPreserveExistingData()
{
return this._preserveExistingData.HasValue;
}
/// <summary>
/// Gets and sets the property SnapshotId.
/// <para>
/// The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored
/// volume. Specify this field if you want to create the iSCSI storage volume from a snapshot;
/// otherwise, do not include this field. To list snapshots for your account use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html">DescribeSnapshots</a>
/// in the <i>Amazon Elastic Compute Cloud API Reference</i>.
/// </para>
/// </summary>
public string SnapshotId
{
get { return this._snapshotId; }
set { this._snapshotId = value; }
}
// Check to see if SnapshotId property is set
internal bool IsSetSnapshotId()
{
return this._snapshotId != null;
}
/// <summary>
/// Gets and sets the property Tags.
/// <para>
/// A list of up to 50 tags that can be assigned to a stored volume. Each tag is a key-value
/// pair.
/// </para>
/// <note>
/// <para>
/// Valid characters for key and value are letters, spaces, and numbers representable
/// in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum
/// length of a tag's key is 128 characters, and the maximum length for a tag's value
/// is 256.
/// </para>
/// </note>
/// </summary>
public List<Tag> Tags
{
get { return this._tags; }
set { this._tags = value; }
}
// Check to see if Tags property is set
internal bool IsSetTags()
{
return this._tags != null && this._tags.Count > 0;
}
/// <summary>
/// Gets and sets the property TargetName.
/// <para>
/// The name of the iSCSI target used by an initiator to connect to a volume and used
/// as a suffix for the target ARN. For example, specifying <code>TargetName</code> as
/// <i>myvolume</i> results in the target ARN of <code>arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume</code>.
/// The target name must be unique across all volumes on a gateway.
/// </para>
///
/// <para>
/// If you don't specify a value, Storage Gateway uses the value that was previously used
/// for this volume as the new target name.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=200)]
public string TargetName
{
get { return this._targetName; }
set { this._targetName = value; }
}
// Check to see if TargetName property is set
internal bool IsSetTargetName()
{
return this._targetName != null;
}
}
} | 36.557621 | 217 | 0.587147 | [
"Apache-2.0"
] | JeffAshton/aws-sdk-net | sdk/src/Services/StorageGateway/Generated/Model/CreateStorediSCSIVolumeRequest.cs | 9,834 | C# |
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using System;
using System.Net;
namespace IdentityModel.Client
{
/// <summary>Models an OpenID Connect dynamic client registration response</summary>
/// <seealso cref="IdentityModel.Client.Response" />
public class RegistrationResponse : Response
{
/// <summary>Initializes a new instance of the <see cref="RegistrationResponse"/> class.</summary>
/// <param name="raw">The raw response data.</param>
public RegistrationResponse(string raw)
: base(raw)
{
}
/// <summary>Initializes a new instance of the <see cref="RegistrationResponse"/> class.</summary>
/// <param name="exception">The exception.</param>
public RegistrationResponse(Exception exception)
: base(exception)
{
}
/// <summary>Initializes a new instance of the <see cref="RegistrationResponse"/> class.</summary>
/// <param name="statusCode">The status code.</param>
/// <param name="reason">The reason.</param>
public RegistrationResponse(HttpStatusCode statusCode, string reason)
: base(statusCode, reason)
{
}
public string ErrorDescription => Json.TryGetString("error_description");
public string ClientId => Json.TryGetString(OidcConstants.RegistrationResponse.ClientId);
public string ClientSecret => Json.TryGetString(OidcConstants.RegistrationResponse.ClientSecret);
public string RegistrationAccessToken => Json.TryGetString(OidcConstants.RegistrationResponse.RegistrationAccessToken);
public string RegistrationClientUri => Json.TryGetString(OidcConstants.RegistrationResponse.RegistrationClientUri);
public int? ClientIdIssuedAt => Json.TryGetInt(OidcConstants.RegistrationResponse.ClientIdIssuedAt);
public int? ClientSecretExpiresAt => Json.TryGetInt(OidcConstants.RegistrationResponse.ClientSecretExpiresAt);
}
} | 46.348837 | 123 | 0.747115 | [
"Apache-2.0"
] | cuteant/IdentityModel | src/IdentityModel/Client/v2/RegistrationResponse.cs | 1,995 | C# |
namespace Secs4Net;
public sealed class SecsMessage : IDisposable
{
public sealed override string ToString() => $"'S{S}F{F}' {(ReplyExpected ? "W" : string.Empty)} {Name ?? string.Empty}";
/// <summary>
/// message stream number
/// </summary>
public byte S { get; }
/// <summary>
/// message function number
/// </summary>
public byte F { get; }
/// <summary>
/// expect reply message
/// </summary>
public bool ReplyExpected { get; internal set; }
public string? Name { get; set; }
/// <summary>
/// the root item of message
/// </summary>
public Item? SecsItem { get; init; }
/// <summary>
/// constructor of SecsMessage
/// </summary>
/// <param name="s">message stream number</param>
/// <param name="f">message function number</param>
/// <param name="replyExpected">expect reply message</param>
public SecsMessage(byte s, byte f, bool replyExpected = true)
{
if (s > 0b0111_1111)
{
throw new ArgumentOutOfRangeException(nameof(s), s, Resources.SecsMessageStreamNumberMustLessThan127);
}
S = s;
F = f;
ReplyExpected = replyExpected;
}
public void Dispose()
{
SecsItem?.Dispose();
}
}
| 24.769231 | 124 | 0.579969 | [
"MIT"
] | BruceQiu1996/secs4net | src/Secs4Net/SecsMessage.cs | 1,290 | C# |
namespace WebApiSecurity.Areas.HelpPage.ModelDescriptions
{
public class CollectionModelDescription : ModelDescription
{
public ModelDescription ElementDescription { get; set; }
}
} | 28.714286 | 64 | 0.756219 | [
"MIT"
] | mauricedb/mwd-2016-09-26 | mod09/WebApiSecurity/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs | 201 | C# |
using Microsoft.Management.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using SimCim.Core;
namespace SimCim.Root.V2
{
public class InstanceModificationEvent : InstanceOperationEvent
{
public InstanceModificationEvent()
{
}
public InstanceModificationEvent(IInfrastructureObjectScope scope, CimInstance instance): base(scope, instance)
{
}
public CimInstance PreviousInstance
{
get
{
CimInstance result;
this.GetProperty("PreviousInstance", out result);
return result;
}
set
{
this.SetProperty("PreviousInstance", value);
}
}
}
} | 24.235294 | 120 | 0.558252 | [
"Apache-2.0"
] | simonferquel/simcim | SimCim.Root.V2/ClassInstanceModificationEvent.cs | 826 | C# |
using System;
using System.Reflection;
using GitHub.Services.WebApi;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace GitHub.DistributedTask.Pipelines
{
internal sealed class ActionStepDefinitionReferenceConverter : VssSecureJsonConverter
{
public override bool CanWrite
{
get
{
return false;
}
}
public override bool CanConvert(Type objectType)
{
return typeof(Step).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo());
}
public override object ReadJson(
JsonReader reader,
Type objectType,
Object existingValue,
JsonSerializer serializer)
{
if (reader.TokenType != JsonToken.StartObject)
{
return null;
}
JObject value = JObject.Load(reader);
if (value.TryGetValue("Type", StringComparison.OrdinalIgnoreCase, out JToken actionTypeValue))
{
ActionSourceType actionType;
if (actionTypeValue.Type == JTokenType.Integer)
{
actionType = (ActionSourceType)(Int32)actionTypeValue;
}
else if (actionTypeValue.Type != JTokenType.String || !Enum.TryParse((String)actionTypeValue, true, out actionType))
{
return null;
}
ActionStepDefinitionReference reference = null;
switch (actionType)
{
case ActionSourceType.Repository:
reference = new RepositoryPathReference();
break;
case ActionSourceType.ContainerRegistry:
reference = new ContainerRegistryReference();
break;
case ActionSourceType.Script:
reference = new ScriptReference();
break;
}
using (var objectReader = value.CreateReader())
{
serializer.Populate(objectReader, reference);
}
return reference;
}
else
{
return null;
}
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
}
}
| 30.457831 | 132 | 0.518196 | [
"MIT"
] | 0823969789/runner | src/Sdk/DTPipelines/Pipelines/ActionStepDefinitionReferenceConverter.cs | 2,530 | C# |
using System.Collections.Generic;
using System.Linq;
using Inventory.Entities;
namespace Inventory.Services
{
public interface IInventoryMaster
{
List<InventoryMaster> GetInventoryMasters();
InventoryMaster GetInventoryMasterItem(int ID);
void SaveInventoryMaster(InventoryMaster inventoryMaster);
void UpdateInventoryMaster(InventoryMaster inventoryMaster);
InventoryMaster DeleteInventoryMaster(int ID);
}
}
| 23.4 | 68 | 0.752137 | [
"MIT"
] | Kishan1824/InventoryAPI | Inventory.Services/IInventoryMaster.cs | 470 | C# |
using System.Linq;
namespace ImapX
{
public class Capability
{
public Capability(string commandResult)
{
Update(commandResult);
}
/// <summary>
/// Gets whether the server supports the ACL extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc4314" />
public bool Acl { get; private set; }
/// <summary>
/// Contains a list of all capabilities supported by the server
/// </summary>
public string[] All { get; private set; }
/// <summary>
/// A list of additional authentication mechanisms the server supports
/// </summary>
public string[] AuthenticationMechanisms { get; private set; }
/// <summary>
/// Gets whether the server supports the BINARY extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc3516" />
public bool Binary { get; private set; }
/// <summary>
/// Gets whether the server supports the CATENATE extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc4469" />
public bool Catenate { get; private set; }
/// <summary>
/// Gets whether the server supports the CHILD extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc3348" />
public bool Children { get; private set; }
/// <summary>
/// Contains a list of compression mechanisms supported by the server
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc4978" />
public string[] CompressionMechanisms { get; private set; }
/// <summary>
/// Gets whether the server supports the CONDSTORE extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc4551" />
public bool CondStore { get; private set; }
/// <summary>
/// Contains a list of contexts supported by the server
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc5267" />
public string[] Contexts { get; private set; }
/// <summary>
/// Gets whether the server supports the CONVERT extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc5259" />
public bool Convert { get; private set; }
/// <summary>
/// Gets whether the server supports the CREATE-SPECIAL-USE extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc6154" />
public bool CreateSpecialUse { get; private set; }
/// <summary>
/// Gets whether the server supports the ENABLE extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc5161" />
public bool Enable { get; private set; }
/// <summary>
/// Gets whether the server supports the ESEARCH extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc4731" />
public bool ESearch { get; private set; }
/// <summary>
/// Gets whether the server supports the ESORT extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc5267" />
public bool ESort { get; private set; }
/// <summary>
/// Gets whether the server supports the FILTERS extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc5466" />
public bool Filters { get; private set; }
/// <summary>
/// Gets whether the server supports the ID extension
/// </summary>
public bool Id { get; private set; }
/// <summary>
/// Gets whether the server supports the IDLE extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc2177" />
public bool Idle { get; private set; }
/// <summary>
/// Gets whether the LOGIN command is disabled on the server
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc2595" />
public bool LoginDisabled { get; private set; }
/// <summary>
/// Gets whether the METADATA extension is supported
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc5464" />
public bool Metadata { get; private set; }
/// <summary>
/// Gets whether the server supports the NAMESPACE extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc2342" />
public bool Namespace { get; private set; }
/// <summary>
/// Gets whether the server supports authentication through OAuth
/// </summary>
public bool XoAuth { get; private set; }
/// <summary>
/// Gets whether the server supports authentication through OAuth2
/// </summary>
public bool XoAuth2 { get; private set; }
/// <summary>
/// Gets whether the server supports the QUOTA extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc2087" />
public bool Quota { get; private set; }
/// <summary>
/// Gets whether the server supports the UNSELECT extension
/// </summary>
/// <see cref="http://tools.ietf.org/html/rfc3691" />
public bool Unselect { get; private set; }
public bool XList { get; private set; }
public bool XGMExt1 { get; private set; }
internal void Update(string commandResult)
{
if (string.IsNullOrEmpty(commandResult))
return;
commandResult = commandResult.Replace("* CAPABILITY IMAP4rev1 ", "");
All = (All ?? new string[0]).Concat(commandResult.Split(' ').Where(_ => !string.IsNullOrEmpty(_.Trim()))).Distinct().ToArray();
AuthenticationMechanisms = (AuthenticationMechanisms ?? new string[0]).Concat(All.Where(_ => _.StartsWith("AUTH="))
.Select(_ => _.Substring(5, _.Length - 5))).Distinct().ToArray();
CompressionMechanisms = (CompressionMechanisms ?? new string[0]).Concat(All.Where(_ => _.StartsWith("COMPRESS="))
.Select(_ => _.Substring(9, _.Length - 9))).Distinct().ToArray();
Contexts = (Contexts ?? new string[0]).Concat(All.Where(_ => _.StartsWith("CONTEXT="))
.Select(_ => _.Substring(8, _.Length - 8))).Distinct().ToArray();
foreach (string s in All)
{
switch (s)
{
case "X-GM-EXT-1":
XGMExt1 = true;
break;
case "XLIST":
XList = true;
break;
case "UNSELECT":
Unselect = true;
break;
case "QUOTA":
Quota = true;
break;
case "AUTH=XOAUTH2":
XoAuth2 = true;
break;
case "AUTH=XOAUTH":
XoAuth = true;
break;
case "NAMESPACE":
Namespace = true;
break;
case "METADATA":
Metadata = true;
break;
case "LOGINDISABLED":
LoginDisabled = true;
break;
case "IDLE":
Idle = true;
break;
case "ID":
Id = true;
break;
case "FILTERS":
Filters = true;
break;
case "ESORT":
ESort = true;
break;
case "ESEARCH":
ESearch = true;
break;
case "ENABLE":
Enable = true;
break;
case "CREATE-SPECIAL-USE":
CreateSpecialUse = true;
break;
case "CONVERT":
Convert = true;
break;
case "CONDSTORE":
CondStore = true;
break;
case "CHILDREN":
Children = true;
break;
case "CATENATE":
Catenate = true;
break;
case "BINARY":
Binary = true;
break;
case "ACL":
Acl = true;
break;
}
}
}
}
} | 37.546559 | 140 | 0.459133 | [
"Apache-2.0"
] | Contasimple-Engineering/imapx | ImapX/Capability.cs | 9,276 | C# |
namespace DragonDogStudios.UnitySoFunctional.Functional
{
public static partial class F
{
public static Error Error(string message) => new Error(message);
}
public class Error
{
public virtual string Message { get; }
public override string ToString() => Message;
protected Error() { }
internal Error(string Message) { this.Message = Message; }
public static implicit operator Error(string m) => new Error(m);
}
} | 28.647059 | 72 | 0.644764 | [
"MIT"
] | genbod/unity-so-functional | Assets/UnitySoFunctional/Functional/Error.cs | 489 | C# |
using Discord;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Sanakan.DAL.Models;
using Sanakan.DiscordBot.Modules;
using Sanakan.DiscordBot.Session;
using Sanakan.ShindenApi;
using Sanakan.ShindenApi.Models;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace DiscordBot.ModulesTests.PocketWaifuModuleTests
{
/// <summary>
/// Defines tests for <see cref="PocketWaifuModule.UseItemAsync(int, ulong, string)"/> method.
/// </summary>
[TestClass]
public class UseItemAsyncTests : Base
{
[TestMethod]
public async Task Should_Return_Error_Message_Session_Exist()
{
var utcNow = DateTime.UtcNow;
var user = new User(1ul, utcNow);
var itemNumber = 1;
_userMock
.Setup(pr => pr.Id)
.Returns(user.Id);
_userMock
.Setup(pr => pr.Mention)
.Returns("user mention");
_systemClockMock
.Setup(pr => pr.UtcNow)
.Returns(utcNow);
_sessionManagerMock
.Setup(pr => pr.Exists<CraftSession>(user.Id))
.Returns(true);
SetupSendMessage((message, embed) =>
{
embed.Should().NotBeNull();
embed.Description.Should().NotBeNullOrEmpty();
});
await _module.UseItemAsync(itemNumber, 1);
}
[TestMethod]
public async Task Should_Return_Error_Message_No_Items()
{
var utcNow = DateTime.UtcNow;
var user = new User(1ul, utcNow);
var itemNumber = 1;
_userMock
.Setup(pr => pr.Id)
.Returns(user.Id);
_userMock
.Setup(pr => pr.Mention)
.Returns("user mention");
_systemClockMock
.Setup(pr => pr.UtcNow)
.Returns(utcNow);
_sessionManagerMock
.Setup(pr => pr.Exists<CraftSession>(user.Id))
.Returns(false);
_userRepositoryMock
.Setup(pr => pr.GetUserOrCreateAsync(user.Id))
.ReturnsAsync(user);
SetupSendMessage((message, embed) =>
{
embed.Should().NotBeNull();
embed.Description.Should().NotBeNullOrEmpty();
});
await _module.UseItemAsync(itemNumber, 1);
}
[TestMethod]
public async Task Should_Return_Error_Message_Invalid_Index()
{
var utcNow = DateTime.UtcNow;
var user = new User(1ul, utcNow);
user.GameDeck.Items.Add(new Item { Type = ItemType.AffectionRecoveryBig, Count = 3 });
var itemNumber = 2;
_userMock
.Setup(pr => pr.Id)
.Returns(user.Id);
_userMock
.Setup(pr => pr.Mention)
.Returns("user mention");
_systemClockMock
.Setup(pr => pr.UtcNow)
.Returns(utcNow);
_sessionManagerMock
.Setup(pr => pr.Exists<CraftSession>(user.Id))
.Returns(false);
_userRepositoryMock
.Setup(pr => pr.GetUserOrCreateAsync(user.Id))
.ReturnsAsync(user);
SetupSendMessage((message, embed) =>
{
embed.Should().NotBeNull();
embed.Description.Should().NotBeNullOrEmpty();
});
await _module.UseItemAsync(itemNumber, 1);
}
[TestMethod]
[DataRow(ItemType.BetterIncreaseUpgradeCnt)]
[DataRow(ItemType.AffectionRecoveryBig)]
[DataRow(ItemType.AffectionRecoveryGreat)]
[DataRow(ItemType.AffectionRecoveryNormal)]
[DataRow(ItemType.AffectionRecoverySmall)]
[DataRow(ItemType.CardParamsReRoll)]
[DataRow(ItemType.BigRandomBoosterPackE)]
[DataRow(ItemType.ChangeCardImage)]
[DataRow(ItemType.ChangeStarType)]
[DataRow(ItemType.CheckAffection)]
[DataRow(ItemType.DereReRoll)]
[DataRow(ItemType.FigureBodyPart)]
[DataRow(ItemType.FigureHeadPart)]
[DataRow(ItemType.FigureLeftArmPart)]
[DataRow(ItemType.FigureRightArmPart)]
[DataRow(ItemType.FigureLeftLegPart)]
[DataRow(ItemType.FigureRightLegPart)]
[DataRow(ItemType.FigureSkeleton)]
[DataRow(ItemType.FigureClothesPart)]
[DataRow(ItemType.FigureUniversalPart)]
[DataRow(ItemType.IncreaseExpBig)]
[DataRow(ItemType.IncreaseExpSmall)]
[DataRow(ItemType.IncreaseUpgradeCount)]
[DataRow(ItemType.PreAssembledAsuna)]
[DataRow(ItemType.PreAssembledGintoki)]
[DataRow(ItemType.PreAssembledMegumin)]
[DataRow(ItemType.RandomNormalBoosterPackA)]
[DataRow(ItemType.RandomNormalBoosterPackB)]
[DataRow(ItemType.RandomNormalBoosterPackS)]
[DataRow(ItemType.RandomNormalBoosterPackSS)]
[DataRow(ItemType.RandomTitleBoosterPackSingleE)]
[DataRow(ItemType.ResetCardValue)]
[DataRow(ItemType.SetCustomBorder)]
[DataRow(ItemType.SetCustomImage)]
[DataRow(ItemType.RandomBoosterPackSingleE)]
public async Task Should_Consume_Item_And_Send_Confirm_Message(ItemType itemType)
{
var utcNow = DateTime.UtcNow;
var user = new User(1ul, utcNow);
var card = new Card(1ul, "title", "name", 100, 50, Rarity.C, Dere.Bodere, DateTime.UtcNow);
card.Id = 1ul;
user.GameDeck.Cards.Add(card);
user.GameDeck.Items.Add(new Item { Type = itemType, Count = 3 });
var figure = new Figure { IsFocus = true };
user.GameDeck.Figures.Add(figure);
var itemNumber = 1;
var characterInfoResult = new ShindenResult<CharacterInfo>()
{
Value = new CharacterInfo
{
Pictures = new List<ImagePicture>
{
new ImagePicture
{
ArtifactId = 1ul,
},
new ImagePicture
{
ArtifactId = 2ul,
}
}
}
};
_userMock
.Setup(pr => pr.Id)
.Returns(user.Id);
_userMock
.Setup(pr => pr.Mention)
.Returns("user mention");
_userRepositoryMock
.Setup(pr => pr.GetUserOrCreateAsync(user.Id))
.ReturnsAsync(user);
_userMock
.Setup(pr => pr.GetAvatarUrl(ImageFormat.Auto, 128))
.Returns("https://test.com/avatar.png");
_guildUserMock
.Setup(pr => pr.Nickname)
.Returns("nickname");
_systemClockMock
.Setup(pr => pr.UtcNow)
.Returns(utcNow);
_sessionManagerMock
.Setup(pr => pr.Exists<CraftSession>(user.Id))
.Returns(false);
_userRepositoryMock
.Setup(pr => pr.SaveChangesAsync(It.IsAny<CancellationToken>()))
.Returns(Task.CompletedTask);
_shindenClientMock
.Setup(pr => pr.GetCharacterInfoAsync(card.CharacterId))
.ReturnsAsync(characterInfoResult);
_cacheManagerMock
.Setup(pr => pr.ExpireTag(It.IsAny<string[]>()));
_randomNumberGeneratorMock
.Setup(pr => pr.GetRandomValue(32, 69))
.Returns(50);
_randomNumberGeneratorMock
.Setup(pr => pr.GetRandomValue(32, 66))
.Returns(50);
_randomNumberGeneratorMock
.Setup(pr => pr.GetOneRandomFrom(It.IsAny<IEnumerable<Dere>>()))
.Returns(Dere.Tsundere);
_waifuServiceMock
.Setup(pr => pr.DeleteCardImageIfExist(It.IsAny<Card>()));
SetupSendMessage((message, embed) =>
{
embed.Should().NotBeNull();
embed.Description.Should().NotBeNullOrEmpty();
});
var itemsCountOrImageLinkOrStarType = "1";
if(itemType == ItemType.ChangeStarType)
{
itemsCountOrImageLinkOrStarType = "waz";
}
if (itemType == ItemType.SetCustomImage
|| itemType == ItemType.SetCustomBorder)
{
itemsCountOrImageLinkOrStarType = "https://test.com/image.png";
card.ImageUrl = new Uri("https://test.com/old-image.png");
}
if (itemType == ItemType.IncreaseUpgradeCount)
{
card.Affection = 10;
}
if (itemType == ItemType.FigureSkeleton)
{
card.Rarity = Rarity.SSS;
}
switch (itemType)
{
case ItemType.FigureUniversalPart:
figure.FocusedPart = FigurePart.All;
break;
case ItemType.FigureHeadPart:
figure.FocusedPart = FigurePart.Head;
break;
case ItemType.FigureBodyPart:
figure.FocusedPart = FigurePart.Body;
break;
case ItemType.FigureLeftArmPart:
figure.FocusedPart = FigurePart.LeftArm;
break;
case ItemType.FigureRightArmPart:
figure.FocusedPart = FigurePart.RightArm;
break;
case ItemType.FigureLeftLegPart:
figure.FocusedPart = FigurePart.LeftLeg;
break;
case ItemType.FigureRightLegPart:
figure.FocusedPart = FigurePart.RightArm;
break;
case ItemType.FigureClothesPart:
figure.FocusedPart = FigurePart.Clothes;
break;
default:
break;
}
await _module.UseItemAsync(itemNumber, card.Id, itemsCountOrImageLinkOrStarType);
}
}
}
| 33.778135 | 103 | 0.533365 | [
"MPL-2.0"
] | Jozpod/sanakan | Tests/DiscordBot.Tests/ModulesTests/PocketWaifuModuleTests/UseItemAsyncTests.cs | 10,505 | 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>
//------------------------------------------------------------------------------
#pragma warning disable 1591
namespace UAOOI.ProcessObserver.Configuration {
/// <summary>
///Represents a strongly typed in-memory cache of data.
///</summary>
[global::System.Serializable()]
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[global::System.Xml.Serialization.XmlRootAttribute("ComunicationNet")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class ComunicationNet : global::System.Data.DataSet {
private ChannelsDataTable tableChannels;
private InterfacesDataTable tableInterfaces;
private StationDataTable tableStation;
private DataBlocksDataTable tableDataBlocks;
private SegmentsDataTable tableSegments;
private TagsDataTable tableTags;
private GroupsDataTable tableGroups;
private ProtocolDataTable tableProtocol;
private SerialSetingsDataTable tableSerialSetings;
private TagBitDataTable tableTagBit;
private ItemPropertiesTableDataTable tableItemPropertiesTable;
private global::System.Data.DataRelation relationFK_Station_Interfaces;
private global::System.Data.DataRelation relationFK_Segments_Interfaces;
private global::System.Data.DataRelation relationFK_Groups_DataBlocks;
private global::System.Data.DataRelation relationFK_Protocol_Segments;
private global::System.Data.DataRelation relationFK_DataBlocks_Tags;
private global::System.Data.DataRelation relationFK_Station_Groups;
private global::System.Data.DataRelation relationFK_Channels_Protocol;
private global::System.Data.DataRelation relationFK_Tags_TagBit;
private global::System.Data.DataRelation relationFK_Tags_ItemPropertiesTable;
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ComunicationNet() {
this.BeginInit();
this.InitClass();
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
base.Relations.CollectionChanged += schemaChangedHandler;
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected ComunicationNet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
global::System.Data.DataSet ds = new global::System.Data.DataSet();
ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
if ((ds.Tables["Channels"] != null)) {
base.Tables.Add(new ChannelsDataTable(ds.Tables["Channels"]));
}
if ((ds.Tables["Interfaces"] != null)) {
base.Tables.Add(new InterfacesDataTable(ds.Tables["Interfaces"]));
}
if ((ds.Tables["Station"] != null)) {
base.Tables.Add(new StationDataTable(ds.Tables["Station"]));
}
if ((ds.Tables["DataBlocks"] != null)) {
base.Tables.Add(new DataBlocksDataTable(ds.Tables["DataBlocks"]));
}
if ((ds.Tables["Segments"] != null)) {
base.Tables.Add(new SegmentsDataTable(ds.Tables["Segments"]));
}
if ((ds.Tables["Tags"] != null)) {
base.Tables.Add(new TagsDataTable(ds.Tables["Tags"]));
}
if ((ds.Tables["Groups"] != null)) {
base.Tables.Add(new GroupsDataTable(ds.Tables["Groups"]));
}
if ((ds.Tables["Protocol"] != null)) {
base.Tables.Add(new ProtocolDataTable(ds.Tables["Protocol"]));
}
if ((ds.Tables["SerialSetings"] != null)) {
base.Tables.Add(new SerialSetingsDataTable(ds.Tables["SerialSetings"]));
}
if ((ds.Tables["TagBit"] != null)) {
base.Tables.Add(new TagBitDataTable(ds.Tables["TagBit"]));
}
if ((ds.Tables["ItemPropertiesTable"] != null)) {
base.Tables.Add(new ItemPropertiesTableDataTable(ds.Tables["ItemPropertiesTable"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public ChannelsDataTable Channels {
get {
return this.tableChannels;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public InterfacesDataTable Interfaces {
get {
return this.tableInterfaces;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public StationDataTable Station {
get {
return this.tableStation;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public DataBlocksDataTable DataBlocks {
get {
return this.tableDataBlocks;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public SegmentsDataTable Segments {
get {
return this.tableSegments;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public TagsDataTable Tags {
get {
return this.tableTags;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public GroupsDataTable Groups {
get {
return this.tableGroups;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public ProtocolDataTable Protocol {
get {
return this.tableProtocol;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public SerialSetingsDataTable SerialSetings {
get {
return this.tableSerialSetings;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public TagBitDataTable TagBit {
get {
return this.tableTagBit;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public ItemPropertiesTableDataTable ItemPropertiesTable {
get {
return this.tableItemPropertiesTable;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.BrowsableAttribute(true)]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
get {
return this._schemaSerializationMode;
}
set {
this._schemaSerializationMode = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataTableCollection Tables {
get {
return base.Tables;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataRelationCollection Relations {
get {
return base.Relations;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void InitializeDerivedDataSet() {
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataSet Clone() {
ComunicationNet cln = ((ComunicationNet)(base.Clone()));
cln.InitVars();
cln.SchemaSerializationMode = this.SchemaSerializationMode;
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override bool ShouldSerializeTables() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override bool ShouldSerializeRelations() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
this.Reset();
global::System.Data.DataSet ds = new global::System.Data.DataSet();
ds.ReadXml(reader);
if ((ds.Tables["Channels"] != null)) {
base.Tables.Add(new ChannelsDataTable(ds.Tables["Channels"]));
}
if ((ds.Tables["Interfaces"] != null)) {
base.Tables.Add(new InterfacesDataTable(ds.Tables["Interfaces"]));
}
if ((ds.Tables["Station"] != null)) {
base.Tables.Add(new StationDataTable(ds.Tables["Station"]));
}
if ((ds.Tables["DataBlocks"] != null)) {
base.Tables.Add(new DataBlocksDataTable(ds.Tables["DataBlocks"]));
}
if ((ds.Tables["Segments"] != null)) {
base.Tables.Add(new SegmentsDataTable(ds.Tables["Segments"]));
}
if ((ds.Tables["Tags"] != null)) {
base.Tables.Add(new TagsDataTable(ds.Tables["Tags"]));
}
if ((ds.Tables["Groups"] != null)) {
base.Tables.Add(new GroupsDataTable(ds.Tables["Groups"]));
}
if ((ds.Tables["Protocol"] != null)) {
base.Tables.Add(new ProtocolDataTable(ds.Tables["Protocol"]));
}
if ((ds.Tables["SerialSetings"] != null)) {
base.Tables.Add(new SerialSetingsDataTable(ds.Tables["SerialSetings"]));
}
if ((ds.Tables["TagBit"] != null)) {
base.Tables.Add(new TagBitDataTable(ds.Tables["TagBit"]));
}
if ((ds.Tables["ItemPropertiesTable"] != null)) {
base.Tables.Add(new ItemPropertiesTableDataTable(ds.Tables["ItemPropertiesTable"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXml(reader);
this.InitVars();
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
stream.Position = 0;
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.InitVars(true);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars(bool initTable) {
this.tableChannels = ((ChannelsDataTable)(base.Tables["Channels"]));
if ((initTable == true)) {
if ((this.tableChannels != null)) {
this.tableChannels.InitVars();
}
}
this.tableInterfaces = ((InterfacesDataTable)(base.Tables["Interfaces"]));
if ((initTable == true)) {
if ((this.tableInterfaces != null)) {
this.tableInterfaces.InitVars();
}
}
this.tableStation = ((StationDataTable)(base.Tables["Station"]));
if ((initTable == true)) {
if ((this.tableStation != null)) {
this.tableStation.InitVars();
}
}
this.tableDataBlocks = ((DataBlocksDataTable)(base.Tables["DataBlocks"]));
if ((initTable == true)) {
if ((this.tableDataBlocks != null)) {
this.tableDataBlocks.InitVars();
}
}
this.tableSegments = ((SegmentsDataTable)(base.Tables["Segments"]));
if ((initTable == true)) {
if ((this.tableSegments != null)) {
this.tableSegments.InitVars();
}
}
this.tableTags = ((TagsDataTable)(base.Tables["Tags"]));
if ((initTable == true)) {
if ((this.tableTags != null)) {
this.tableTags.InitVars();
}
}
this.tableGroups = ((GroupsDataTable)(base.Tables["Groups"]));
if ((initTable == true)) {
if ((this.tableGroups != null)) {
this.tableGroups.InitVars();
}
}
this.tableProtocol = ((ProtocolDataTable)(base.Tables["Protocol"]));
if ((initTable == true)) {
if ((this.tableProtocol != null)) {
this.tableProtocol.InitVars();
}
}
this.tableSerialSetings = ((SerialSetingsDataTable)(base.Tables["SerialSetings"]));
if ((initTable == true)) {
if ((this.tableSerialSetings != null)) {
this.tableSerialSetings.InitVars();
}
}
this.tableTagBit = ((TagBitDataTable)(base.Tables["TagBit"]));
if ((initTable == true)) {
if ((this.tableTagBit != null)) {
this.tableTagBit.InitVars();
}
}
this.tableItemPropertiesTable = ((ItemPropertiesTableDataTable)(base.Tables["ItemPropertiesTable"]));
if ((initTable == true)) {
if ((this.tableItemPropertiesTable != null)) {
this.tableItemPropertiesTable.InitVars();
}
}
this.relationFK_Station_Interfaces = this.Relations["FK_Station_Interfaces"];
this.relationFK_Segments_Interfaces = this.Relations["FK_Segments_Interfaces"];
this.relationFK_Groups_DataBlocks = this.Relations["FK_Groups_DataBlocks"];
this.relationFK_Protocol_Segments = this.Relations["FK_Protocol_Segments"];
this.relationFK_DataBlocks_Tags = this.Relations["FK_DataBlocks_Tags"];
this.relationFK_Station_Groups = this.Relations["FK_Station_Groups"];
this.relationFK_Channels_Protocol = this.Relations["FK_Channels_Protocol"];
this.relationFK_Tags_TagBit = this.Relations["FK_Tags_TagBit"];
this.relationFK_Tags_ItemPropertiesTable = this.Relations["FK_Tags_ItemPropertiesTable"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.DataSetName = "ComunicationNet";
this.Prefix = "";
this.Namespace = "http://tempuri.org/ComunicationNet.xsd";
this.Locale = new global::System.Globalization.CultureInfo("en-US");
this.EnforceConstraints = true;
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
this.tableChannels = new ChannelsDataTable();
base.Tables.Add(this.tableChannels);
this.tableInterfaces = new InterfacesDataTable();
base.Tables.Add(this.tableInterfaces);
this.tableStation = new StationDataTable();
base.Tables.Add(this.tableStation);
this.tableDataBlocks = new DataBlocksDataTable();
base.Tables.Add(this.tableDataBlocks);
this.tableSegments = new SegmentsDataTable();
base.Tables.Add(this.tableSegments);
this.tableTags = new TagsDataTable();
base.Tables.Add(this.tableTags);
this.tableGroups = new GroupsDataTable();
base.Tables.Add(this.tableGroups);
this.tableProtocol = new ProtocolDataTable();
base.Tables.Add(this.tableProtocol);
this.tableSerialSetings = new SerialSetingsDataTable();
base.Tables.Add(this.tableSerialSetings);
this.tableTagBit = new TagBitDataTable();
base.Tables.Add(this.tableTagBit);
this.tableItemPropertiesTable = new ItemPropertiesTableDataTable();
base.Tables.Add(this.tableItemPropertiesTable);
global::System.Data.ForeignKeyConstraint fkc;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Station_Interfaces", new global::System.Data.DataColumn[] {
this.tableStation.StationIDColumn}, new global::System.Data.DataColumn[] {
this.tableInterfaces.StationIdColumn});
this.tableInterfaces.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Segments_Interfaces", new global::System.Data.DataColumn[] {
this.tableSegments.SegmentIDColumn}, new global::System.Data.DataColumn[] {
this.tableInterfaces.SegmentIdColumn});
this.tableInterfaces.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Groups_DataBlocks", new global::System.Data.DataColumn[] {
this.tableGroups.GroupIDColumn}, new global::System.Data.DataColumn[] {
this.tableDataBlocks.GroupIDColumn});
this.tableDataBlocks.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Protocol_Segments", new global::System.Data.DataColumn[] {
this.tableProtocol.ProtocolIDColumn}, new global::System.Data.DataColumn[] {
this.tableSegments.ProtocolIDColumn});
this.tableSegments.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_DataBlocks_Tags", new global::System.Data.DataColumn[] {
this.tableDataBlocks.DatBlockIDColumn}, new global::System.Data.DataColumn[] {
this.tableTags.DatBlockIDColumn});
this.tableTags.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Station_Groups", new global::System.Data.DataColumn[] {
this.tableStation.StationIDColumn}, new global::System.Data.DataColumn[] {
this.tableGroups.StationIDColumn});
this.tableGroups.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Channels_Protocol", new global::System.Data.DataColumn[] {
this.tableChannels.ChannelIDColumn}, new global::System.Data.DataColumn[] {
this.tableProtocol.ChannelIDColumn});
this.tableProtocol.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Tags_TagBit", new global::System.Data.DataColumn[] {
this.tableTags.TagIDColumn}, new global::System.Data.DataColumn[] {
this.tableTagBit.TagIDColumn});
this.tableTagBit.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
fkc = new global::System.Data.ForeignKeyConstraint("FK_Tags_ItemPropertiesTable", new global::System.Data.DataColumn[] {
this.tableTags.TagIDColumn}, new global::System.Data.DataColumn[] {
this.tableItemPropertiesTable.TagIDColumn});
this.tableItemPropertiesTable.Constraints.Add(fkc);
fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
fkc.DeleteRule = global::System.Data.Rule.Cascade;
fkc.UpdateRule = global::System.Data.Rule.Cascade;
this.relationFK_Station_Interfaces = new global::System.Data.DataRelation("FK_Station_Interfaces", new global::System.Data.DataColumn[] {
this.tableStation.StationIDColumn}, new global::System.Data.DataColumn[] {
this.tableInterfaces.StationIdColumn}, false);
this.Relations.Add(this.relationFK_Station_Interfaces);
this.relationFK_Segments_Interfaces = new global::System.Data.DataRelation("FK_Segments_Interfaces", new global::System.Data.DataColumn[] {
this.tableSegments.SegmentIDColumn}, new global::System.Data.DataColumn[] {
this.tableInterfaces.SegmentIdColumn}, false);
this.Relations.Add(this.relationFK_Segments_Interfaces);
this.relationFK_Groups_DataBlocks = new global::System.Data.DataRelation("FK_Groups_DataBlocks", new global::System.Data.DataColumn[] {
this.tableGroups.GroupIDColumn}, new global::System.Data.DataColumn[] {
this.tableDataBlocks.GroupIDColumn}, false);
this.Relations.Add(this.relationFK_Groups_DataBlocks);
this.relationFK_Protocol_Segments = new global::System.Data.DataRelation("FK_Protocol_Segments", new global::System.Data.DataColumn[] {
this.tableProtocol.ProtocolIDColumn}, new global::System.Data.DataColumn[] {
this.tableSegments.ProtocolIDColumn}, false);
this.Relations.Add(this.relationFK_Protocol_Segments);
this.relationFK_DataBlocks_Tags = new global::System.Data.DataRelation("FK_DataBlocks_Tags", new global::System.Data.DataColumn[] {
this.tableDataBlocks.DatBlockIDColumn}, new global::System.Data.DataColumn[] {
this.tableTags.DatBlockIDColumn}, false);
this.Relations.Add(this.relationFK_DataBlocks_Tags);
this.relationFK_Station_Groups = new global::System.Data.DataRelation("FK_Station_Groups", new global::System.Data.DataColumn[] {
this.tableStation.StationIDColumn}, new global::System.Data.DataColumn[] {
this.tableGroups.StationIDColumn}, false);
this.Relations.Add(this.relationFK_Station_Groups);
this.relationFK_Channels_Protocol = new global::System.Data.DataRelation("FK_Channels_Protocol", new global::System.Data.DataColumn[] {
this.tableChannels.ChannelIDColumn}, new global::System.Data.DataColumn[] {
this.tableProtocol.ChannelIDColumn}, false);
this.Relations.Add(this.relationFK_Channels_Protocol);
this.relationFK_Tags_TagBit = new global::System.Data.DataRelation("FK_Tags_TagBit", new global::System.Data.DataColumn[] {
this.tableTags.TagIDColumn}, new global::System.Data.DataColumn[] {
this.tableTagBit.TagIDColumn}, false);
this.Relations.Add(this.relationFK_Tags_TagBit);
this.relationFK_Tags_ItemPropertiesTable = new global::System.Data.DataRelation("FK_Tags_ItemPropertiesTable", new global::System.Data.DataColumn[] {
this.tableTags.TagIDColumn}, new global::System.Data.DataColumn[] {
this.tableItemPropertiesTable.TagIDColumn}, false);
this.Relations.Add(this.relationFK_Tags_ItemPropertiesTable);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeChannels() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeInterfaces() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeStation() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeDataBlocks() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeSegments() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeTags() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeGroups() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeProtocol() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeSerialSetings() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeTagBit() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private bool ShouldSerializeItemPropertiesTable() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars();
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
any.Namespace = ds.Namespace;
sequence.Items.Add(any);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void ChannelsRowChangeEventHandler(object sender, ChannelsRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void InterfacesRowChangeEventHandler(object sender, InterfacesRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void StationRowChangeEventHandler(object sender, StationRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void DataBlocksRowChangeEventHandler(object sender, DataBlocksRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void SegmentsRowChangeEventHandler(object sender, SegmentsRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void TagsRowChangeEventHandler(object sender, TagsRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void GroupsRowChangeEventHandler(object sender, GroupsRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void ProtocolRowChangeEventHandler(object sender, ProtocolRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void SerialSetingsRowChangeEventHandler(object sender, SerialSetingsRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void TagBitRowChangeEventHandler(object sender, TagBitRowChangeEvent e);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public delegate void ItemPropertiesTableRowChangeEventHandler(object sender, ItemPropertiesTableRowChangeEvent e);
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class ChannelsDataTable : global::System.Data.TypedTableBase<ChannelsRow> {
private global::System.Data.DataColumn columnChannelID;
private global::System.Data.DataColumn columnName;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsDataTable() {
this.TableName = "Channels";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal ChannelsDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected ChannelsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ChannelIDColumn {
get {
return this.columnChannelID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRow this[int index] {
get {
return ((ChannelsRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ChannelsRowChangeEventHandler ChannelsRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ChannelsRowChangeEventHandler ChannelsRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ChannelsRowChangeEventHandler ChannelsRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ChannelsRowChangeEventHandler ChannelsRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddChannelsRow(ChannelsRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRow AddChannelsRow(string Name) {
ChannelsRow rowChannelsRow = ((ChannelsRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
null,
Name};
rowChannelsRow.ItemArray = columnValuesArray;
this.Rows.Add(rowChannelsRow);
return rowChannelsRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRow FindByChannelID(long ChannelID) {
return ((ChannelsRow)(this.Rows.Find(new object[] {
ChannelID})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
ChannelsDataTable cln = ((ChannelsDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new ChannelsDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnChannelID = base.Columns["ChannelID"];
this.columnName = base.Columns["Name"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnChannelID = new global::System.Data.DataColumn("ChannelID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnChannelID);
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.Constraints.Add(new global::System.Data.UniqueConstraint("CahnnelID_MK", new global::System.Data.DataColumn[] {
this.columnChannelID}, true));
this.Constraints.Add(new global::System.Data.UniqueConstraint("ChannelsKey1", new global::System.Data.DataColumn[] {
this.columnName}, false));
this.columnChannelID.AutoIncrement = true;
this.columnChannelID.AllowDBNull = false;
this.columnChannelID.Unique = true;
this.columnName.Unique = true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRow NewChannelsRow() {
return ((ChannelsRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new ChannelsRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(ChannelsRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.ChannelsRowChanged != null)) {
this.ChannelsRowChanged(this, new ChannelsRowChangeEvent(((ChannelsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.ChannelsRowChanging != null)) {
this.ChannelsRowChanging(this, new ChannelsRowChangeEvent(((ChannelsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.ChannelsRowDeleted != null)) {
this.ChannelsRowDeleted(this, new ChannelsRowChangeEvent(((ChannelsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.ChannelsRowDeleting != null)) {
this.ChannelsRowDeleting(this, new ChannelsRowChangeEvent(((ChannelsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveChannelsRow(ChannelsRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "ChannelsDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class InterfacesDataTable : global::System.Data.TypedTableBase<InterfacesRow> {
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnSegmentId;
private global::System.Data.DataColumn columnStationId;
private global::System.Data.DataColumn columnAddress;
private global::System.Data.DataColumn columnInactTime;
private global::System.Data.DataColumn columnInactTimeAFailure;
private global::System.Data.DataColumn columnInterfaceNum;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesDataTable() {
this.TableName = "Interfaces";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal InterfacesDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected InterfacesDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn SegmentIdColumn {
get {
return this.columnSegmentId;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn StationIdColumn {
get {
return this.columnStationId;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn AddressColumn {
get {
return this.columnAddress;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn InactTimeColumn {
get {
return this.columnInactTime;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn InactTimeAFailureColumn {
get {
return this.columnInactTimeAFailure;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn InterfaceNumColumn {
get {
return this.columnInterfaceNum;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRow this[int index] {
get {
return ((InterfacesRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event InterfacesRowChangeEventHandler InterfacesRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event InterfacesRowChangeEventHandler InterfacesRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event InterfacesRowChangeEventHandler InterfacesRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event InterfacesRowChangeEventHandler InterfacesRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddInterfacesRow(InterfacesRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRow AddInterfacesRow(string Name, SegmentsRow parentSegmentsRowByFK_Segments_Interfaces, StationRow parentStationRowByFK_Station_Interfaces, long Address, long InactTime, long InactTimeAFailure, ulong InterfaceNum) {
InterfacesRow rowInterfacesRow = ((InterfacesRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
Name,
null,
null,
Address,
InactTime,
InactTimeAFailure,
InterfaceNum};
if ((parentSegmentsRowByFK_Segments_Interfaces != null)) {
columnValuesArray[1] = parentSegmentsRowByFK_Segments_Interfaces[1];
}
if ((parentStationRowByFK_Station_Interfaces != null)) {
columnValuesArray[2] = parentStationRowByFK_Station_Interfaces[1];
}
rowInterfacesRow.ItemArray = columnValuesArray;
this.Rows.Add(rowInterfacesRow);
return rowInterfacesRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
InterfacesDataTable cln = ((InterfacesDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new InterfacesDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnName = base.Columns["Name"];
this.columnSegmentId = base.Columns["SegmentId"];
this.columnStationId = base.Columns["StationId"];
this.columnAddress = base.Columns["Address"];
this.columnInactTime = base.Columns["InactTime"];
this.columnInactTimeAFailure = base.Columns["InactTimeAFailure"];
this.columnInterfaceNum = base.Columns["InterfaceNum"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnSegmentId = new global::System.Data.DataColumn("SegmentId", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnSegmentId);
this.columnStationId = new global::System.Data.DataColumn("StationId", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnStationId);
this.columnAddress = new global::System.Data.DataColumn("Address", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAddress);
this.columnInactTime = new global::System.Data.DataColumn("InactTime", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnInactTime);
this.columnInactTimeAFailure = new global::System.Data.DataColumn("InactTimeAFailure", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnInactTimeAFailure);
this.columnInterfaceNum = new global::System.Data.DataColumn("InterfaceNum", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnInterfaceNum);
this.Constraints.Add(new global::System.Data.UniqueConstraint("InterfaceMasterKey", new global::System.Data.DataColumn[] {
this.columnStationId,
this.columnInterfaceNum}, false));
this.Constraints.Add(new global::System.Data.UniqueConstraint("InterfacesKey1", new global::System.Data.DataColumn[] {
this.columnName,
this.columnStationId}, false));
this.columnName.AllowDBNull = false;
this.columnSegmentId.AllowDBNull = false;
this.columnStationId.AllowDBNull = false;
this.columnAddress.AllowDBNull = false;
this.columnAddress.DefaultValue = ((long)(0));
this.columnInactTime.AllowDBNull = false;
this.columnInactTime.DefaultValue = ((long)(1000));
this.columnInactTimeAFailure.AllowDBNull = false;
this.columnInactTimeAFailure.DefaultValue = ((long)(1000));
this.columnInterfaceNum.AllowDBNull = false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRow NewInterfacesRow() {
return ((InterfacesRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new InterfacesRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(InterfacesRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.InterfacesRowChanged != null)) {
this.InterfacesRowChanged(this, new InterfacesRowChangeEvent(((InterfacesRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.InterfacesRowChanging != null)) {
this.InterfacesRowChanging(this, new InterfacesRowChangeEvent(((InterfacesRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.InterfacesRowDeleted != null)) {
this.InterfacesRowDeleted(this, new InterfacesRowChangeEvent(((InterfacesRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.InterfacesRowDeleting != null)) {
this.InterfacesRowDeleting(this, new InterfacesRowChangeEvent(((InterfacesRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveInterfacesRow(InterfacesRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "InterfacesDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class StationDataTable : global::System.Data.TypedTableBase<StationRow> {
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnStationID;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationDataTable() {
this.TableName = "Station";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal StationDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected StationDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn StationIDColumn {
get {
return this.columnStationID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow this[int index] {
get {
return ((StationRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event StationRowChangeEventHandler StationRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event StationRowChangeEventHandler StationRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event StationRowChangeEventHandler StationRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event StationRowChangeEventHandler StationRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddStationRow(StationRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow AddStationRow(string Name) {
StationRow rowStationRow = ((StationRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
Name,
null};
rowStationRow.ItemArray = columnValuesArray;
this.Rows.Add(rowStationRow);
return rowStationRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow FindByStationID(long StationID) {
return ((StationRow)(this.Rows.Find(new object[] {
StationID})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
StationDataTable cln = ((StationDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new StationDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnName = base.Columns["Name"];
this.columnStationID = base.Columns["StationID"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnStationID = new global::System.Data.DataColumn("StationID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnStationID);
this.Constraints.Add(new global::System.Data.UniqueConstraint("StationID_MK", new global::System.Data.DataColumn[] {
this.columnStationID}, true));
this.columnName.AllowDBNull = false;
this.columnStationID.AutoIncrement = true;
this.columnStationID.AllowDBNull = false;
this.columnStationID.Unique = true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow NewStationRow() {
return ((StationRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new StationRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(StationRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.StationRowChanged != null)) {
this.StationRowChanged(this, new StationRowChangeEvent(((StationRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.StationRowChanging != null)) {
this.StationRowChanging(this, new StationRowChangeEvent(((StationRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.StationRowDeleted != null)) {
this.StationRowDeleted(this, new StationRowChangeEvent(((StationRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.StationRowDeleting != null)) {
this.StationRowDeleting(this, new StationRowChangeEvent(((StationRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveStationRow(StationRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "StationDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class DataBlocksDataTable : global::System.Data.TypedTableBase<DataBlocksRow> {
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnAddress;
private global::System.Data.DataColumn columnGroupID;
private global::System.Data.DataColumn columnDataType;
private global::System.Data.DataColumn columnDatBlockID;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksDataTable() {
this.TableName = "DataBlocks";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal DataBlocksDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected DataBlocksDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn AddressColumn {
get {
return this.columnAddress;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn GroupIDColumn {
get {
return this.columnGroupID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn DataTypeColumn {
get {
return this.columnDataType;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn DatBlockIDColumn {
get {
return this.columnDatBlockID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRow this[int index] {
get {
return ((DataBlocksRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event DataBlocksRowChangeEventHandler DataBlocksRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event DataBlocksRowChangeEventHandler DataBlocksRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event DataBlocksRowChangeEventHandler DataBlocksRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event DataBlocksRowChangeEventHandler DataBlocksRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddDataBlocksRow(DataBlocksRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRow AddDataBlocksRow(string Name, ulong Address, GroupsRow parentGroupsRowByFK_Groups_DataBlocks, ulong DataType) {
DataBlocksRow rowDataBlocksRow = ((DataBlocksRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
Name,
Address,
null,
DataType,
null};
if ((parentGroupsRowByFK_Groups_DataBlocks != null)) {
columnValuesArray[2] = parentGroupsRowByFK_Groups_DataBlocks[2];
}
rowDataBlocksRow.ItemArray = columnValuesArray;
this.Rows.Add(rowDataBlocksRow);
return rowDataBlocksRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
DataBlocksDataTable cln = ((DataBlocksDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new DataBlocksDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnName = base.Columns["Name"];
this.columnAddress = base.Columns["Address"];
this.columnGroupID = base.Columns["GroupID"];
this.columnDataType = base.Columns["DataType"];
this.columnDatBlockID = base.Columns["DatBlockID"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnAddress = new global::System.Data.DataColumn("Address", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAddress);
this.columnGroupID = new global::System.Data.DataColumn("GroupID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnGroupID);
this.columnDataType = new global::System.Data.DataColumn("DataType", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnDataType);
this.columnDatBlockID = new global::System.Data.DataColumn("DatBlockID", typeof(int), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnDatBlockID);
this.Constraints.Add(new global::System.Data.UniqueConstraint("DataBlokNameKey", new global::System.Data.DataColumn[] {
this.columnName}, false));
this.Constraints.Add(new global::System.Data.UniqueConstraint("DataBlocksKey", new global::System.Data.DataColumn[] {
this.columnDatBlockID}, false));
this.columnName.AllowDBNull = false;
this.columnName.Unique = true;
this.columnAddress.AllowDBNull = false;
this.columnAddress.DefaultValue = ((ulong)(99999ul));
this.columnGroupID.AllowDBNull = false;
this.columnDataType.AllowDBNull = false;
this.columnDataType.DefaultValue = ((ulong)(0ul));
this.columnDatBlockID.AutoIncrement = true;
this.columnDatBlockID.AllowDBNull = false;
this.columnDatBlockID.Unique = true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRow NewDataBlocksRow() {
return ((DataBlocksRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new DataBlocksRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(DataBlocksRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.DataBlocksRowChanged != null)) {
this.DataBlocksRowChanged(this, new DataBlocksRowChangeEvent(((DataBlocksRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.DataBlocksRowChanging != null)) {
this.DataBlocksRowChanging(this, new DataBlocksRowChangeEvent(((DataBlocksRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.DataBlocksRowDeleted != null)) {
this.DataBlocksRowDeleted(this, new DataBlocksRowChangeEvent(((DataBlocksRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.DataBlocksRowDeleting != null)) {
this.DataBlocksRowDeleting(this, new DataBlocksRowChangeEvent(((DataBlocksRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveDataBlocksRow(DataBlocksRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "DataBlocksDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class SegmentsDataTable : global::System.Data.TypedTableBase<SegmentsRow> {
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnSegmentID;
private global::System.Data.DataColumn columnProtocolID;
private global::System.Data.DataColumn columnAddress;
private global::System.Data.DataColumn columnTimeScan;
private global::System.Data.DataColumn columnKeepConnect;
private global::System.Data.DataColumn columnPickupConn;
private global::System.Data.DataColumn columntimeKeepConn;
private global::System.Data.DataColumn columnTimeReconnect;
private global::System.Data.DataColumn columnTimeIdleKeepConn;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsDataTable() {
this.TableName = "Segments";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal SegmentsDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected SegmentsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn SegmentIDColumn {
get {
return this.columnSegmentID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ProtocolIDColumn {
get {
return this.columnProtocolID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn AddressColumn {
get {
return this.columnAddress;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeScanColumn {
get {
return this.columnTimeScan;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn KeepConnectColumn {
get {
return this.columnKeepConnect;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn PickupConnColumn {
get {
return this.columnPickupConn;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn timeKeepConnColumn {
get {
return this.columntimeKeepConn;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeReconnectColumn {
get {
return this.columnTimeReconnect;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeIdleKeepConnColumn {
get {
return this.columnTimeIdleKeepConn;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow this[int index] {
get {
return ((SegmentsRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SegmentsRowChangeEventHandler SegmentsRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SegmentsRowChangeEventHandler SegmentsRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SegmentsRowChangeEventHandler SegmentsRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SegmentsRowChangeEventHandler SegmentsRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddSegmentsRow(SegmentsRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow AddSegmentsRow(string Name, ProtocolRow parentProtocolRowByFK_Protocol_Segments, string Address, long TimeScan, bool KeepConnect, bool PickupConn, long timeKeepConn, long TimeReconnect, long TimeIdleKeepConn) {
SegmentsRow rowSegmentsRow = ((SegmentsRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
Name,
null,
null,
Address,
TimeScan,
KeepConnect,
PickupConn,
timeKeepConn,
TimeReconnect,
TimeIdleKeepConn};
if ((parentProtocolRowByFK_Protocol_Segments != null)) {
columnValuesArray[2] = parentProtocolRowByFK_Protocol_Segments[0];
}
rowSegmentsRow.ItemArray = columnValuesArray;
this.Rows.Add(rowSegmentsRow);
return rowSegmentsRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow FindByName(string Name) {
return ((SegmentsRow)(this.Rows.Find(new object[] {
Name})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
SegmentsDataTable cln = ((SegmentsDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new SegmentsDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnName = base.Columns["Name"];
this.columnSegmentID = base.Columns["SegmentID"];
this.columnProtocolID = base.Columns["ProtocolID"];
this.columnAddress = base.Columns["Address"];
this.columnTimeScan = base.Columns["TimeScan"];
this.columnKeepConnect = base.Columns["KeepConnect"];
this.columnPickupConn = base.Columns["PickupConn"];
this.columntimeKeepConn = base.Columns["timeKeepConn"];
this.columnTimeReconnect = base.Columns["TimeReconnect"];
this.columnTimeIdleKeepConn = base.Columns["TimeIdleKeepConn"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnSegmentID = new global::System.Data.DataColumn("SegmentID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnSegmentID);
this.columnProtocolID = new global::System.Data.DataColumn("ProtocolID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnProtocolID);
this.columnAddress = new global::System.Data.DataColumn("Address", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAddress);
this.columnTimeScan = new global::System.Data.DataColumn("TimeScan", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeScan);
this.columnKeepConnect = new global::System.Data.DataColumn("KeepConnect", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnKeepConnect);
this.columnPickupConn = new global::System.Data.DataColumn("PickupConn", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnPickupConn);
this.columntimeKeepConn = new global::System.Data.DataColumn("timeKeepConn", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columntimeKeepConn);
this.columnTimeReconnect = new global::System.Data.DataColumn("TimeReconnect", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeReconnect);
this.columnTimeIdleKeepConn = new global::System.Data.DataColumn("TimeIdleKeepConn", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeIdleKeepConn);
this.Constraints.Add(new global::System.Data.UniqueConstraint("SegmentID_MK", new global::System.Data.DataColumn[] {
this.columnSegmentID}, false));
this.Constraints.Add(new global::System.Data.UniqueConstraint("SegmentsNameK", new global::System.Data.DataColumn[] {
this.columnName}, true));
this.columnName.AllowDBNull = false;
this.columnName.Unique = true;
this.columnSegmentID.AutoIncrement = true;
this.columnSegmentID.AllowDBNull = false;
this.columnSegmentID.Unique = true;
this.columnAddress.AllowDBNull = false;
this.columnAddress.DefaultValue = ((string)("Set address..."));
this.columnTimeScan.AllowDBNull = false;
this.columnTimeScan.DefaultValue = ((long)(5000));
this.columnKeepConnect.AllowDBNull = false;
this.columnKeepConnect.DefaultValue = ((bool)(true));
this.columnPickupConn.AllowDBNull = false;
this.columnPickupConn.DefaultValue = ((bool)(false));
this.columntimeKeepConn.AllowDBNull = false;
this.columntimeKeepConn.DefaultValue = ((long)(10000));
this.columnTimeReconnect.AllowDBNull = false;
this.columnTimeReconnect.DefaultValue = ((long)(60000));
this.columnTimeIdleKeepConn.AllowDBNull = false;
this.columnTimeIdleKeepConn.DefaultValue = ((long)(100));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow NewSegmentsRow() {
return ((SegmentsRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new SegmentsRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(SegmentsRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.SegmentsRowChanged != null)) {
this.SegmentsRowChanged(this, new SegmentsRowChangeEvent(((SegmentsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.SegmentsRowChanging != null)) {
this.SegmentsRowChanging(this, new SegmentsRowChangeEvent(((SegmentsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.SegmentsRowDeleted != null)) {
this.SegmentsRowDeleted(this, new SegmentsRowChangeEvent(((SegmentsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.SegmentsRowDeleting != null)) {
this.SegmentsRowDeleting(this, new SegmentsRowChangeEvent(((SegmentsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveSegmentsRow(SegmentsRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "SegmentsDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class TagsDataTable : global::System.Data.TypedTableBase<TagsRow> {
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnTagID;
private global::System.Data.DataColumn columnAccessRights;
private global::System.Data.DataColumn columnStateTrigger;
private global::System.Data.DataColumn columnAlarm;
private global::System.Data.DataColumn columnAlarmMask;
private global::System.Data.DataColumn columnStateMask;
private global::System.Data.DataColumn columnDatBlockID;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsDataTable() {
this.TableName = "Tags";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal TagsDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected TagsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TagIDColumn {
get {
return this.columnTagID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn AccessRightsColumn {
get {
return this.columnAccessRights;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn StateTriggerColumn {
get {
return this.columnStateTrigger;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn AlarmColumn {
get {
return this.columnAlarm;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn AlarmMaskColumn {
get {
return this.columnAlarmMask;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn StateMaskColumn {
get {
return this.columnStateMask;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn DatBlockIDColumn {
get {
return this.columnDatBlockID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow this[int index] {
get {
return ((TagsRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagsRowChangeEventHandler TagsRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagsRowChangeEventHandler TagsRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagsRowChangeEventHandler TagsRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagsRowChangeEventHandler TagsRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddTagsRow(TagsRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow AddTagsRow(string Name, sbyte AccessRights, sbyte StateTrigger, bool Alarm, ulong AlarmMask, ulong StateMask, DataBlocksRow parentDataBlocksRowByFK_DataBlocks_Tags) {
TagsRow rowTagsRow = ((TagsRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
Name,
null,
AccessRights,
StateTrigger,
Alarm,
AlarmMask,
StateMask,
null};
if ((parentDataBlocksRowByFK_DataBlocks_Tags != null)) {
columnValuesArray[7] = parentDataBlocksRowByFK_DataBlocks_Tags[4];
}
rowTagsRow.ItemArray = columnValuesArray;
this.Rows.Add(rowTagsRow);
return rowTagsRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow FindByTagID(long TagID) {
return ((TagsRow)(this.Rows.Find(new object[] {
TagID})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
TagsDataTable cln = ((TagsDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new TagsDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnName = base.Columns["Name"];
this.columnTagID = base.Columns["TagID"];
this.columnAccessRights = base.Columns["AccessRights"];
this.columnStateTrigger = base.Columns["StateTrigger"];
this.columnAlarm = base.Columns["Alarm"];
this.columnAlarmMask = base.Columns["AlarmMask"];
this.columnStateMask = base.Columns["StateMask"];
this.columnDatBlockID = base.Columns["DatBlockID"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnTagID = new global::System.Data.DataColumn("TagID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTagID);
this.columnAccessRights = new global::System.Data.DataColumn("AccessRights", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAccessRights);
this.columnStateTrigger = new global::System.Data.DataColumn("StateTrigger", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnStateTrigger);
this.columnAlarm = new global::System.Data.DataColumn("Alarm", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAlarm);
this.columnAlarmMask = new global::System.Data.DataColumn("AlarmMask", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAlarmMask);
this.columnStateMask = new global::System.Data.DataColumn("StateMask", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnStateMask);
this.columnDatBlockID = new global::System.Data.DataColumn("DatBlockID", typeof(int), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnDatBlockID);
this.Constraints.Add(new global::System.Data.UniqueConstraint("TagsKey2", new global::System.Data.DataColumn[] {
this.columnTagID}, true));
this.Constraints.Add(new global::System.Data.UniqueConstraint("TagsKey1", new global::System.Data.DataColumn[] {
this.columnName}, false));
this.columnName.AllowDBNull = false;
this.columnName.Unique = true;
this.columnTagID.AutoIncrement = true;
this.columnTagID.AutoIncrementSeed = 32000;
this.columnTagID.AllowDBNull = false;
this.columnTagID.Unique = true;
this.columnAccessRights.AllowDBNull = false;
this.columnStateTrigger.AllowDBNull = false;
this.columnAlarm.AllowDBNull = false;
this.columnAlarm.DefaultValue = ((bool)(false));
this.columnAlarmMask.AllowDBNull = false;
this.columnAlarmMask.DefaultValue = ((ulong)(0ul));
this.columnStateMask.AllowDBNull = false;
this.columnDatBlockID.AllowDBNull = false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow NewTagsRow() {
return ((TagsRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new TagsRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(TagsRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.TagsRowChanged != null)) {
this.TagsRowChanged(this, new TagsRowChangeEvent(((TagsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.TagsRowChanging != null)) {
this.TagsRowChanging(this, new TagsRowChangeEvent(((TagsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.TagsRowDeleted != null)) {
this.TagsRowDeleted(this, new TagsRowChangeEvent(((TagsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.TagsRowDeleting != null)) {
this.TagsRowDeleting(this, new TagsRowChangeEvent(((TagsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveTagsRow(TagsRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "TagsDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class GroupsDataTable : global::System.Data.TypedTableBase<GroupsRow> {
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnStationID;
private global::System.Data.DataColumn columnGroupID;
private global::System.Data.DataColumn columnTimeScan;
private global::System.Data.DataColumn columnTimeOut;
private global::System.Data.DataColumn columnTimeScanFast;
private global::System.Data.DataColumn columnTimeOutFast;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsDataTable() {
this.TableName = "Groups";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal GroupsDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected GroupsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn StationIDColumn {
get {
return this.columnStationID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn GroupIDColumn {
get {
return this.columnGroupID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeScanColumn {
get {
return this.columnTimeScan;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeOutColumn {
get {
return this.columnTimeOut;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeScanFastColumn {
get {
return this.columnTimeScanFast;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TimeOutFastColumn {
get {
return this.columnTimeOutFast;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow this[int index] {
get {
return ((GroupsRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event GroupsRowChangeEventHandler GroupsRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event GroupsRowChangeEventHandler GroupsRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event GroupsRowChangeEventHandler GroupsRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event GroupsRowChangeEventHandler GroupsRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddGroupsRow(GroupsRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow AddGroupsRow(string Name, StationRow parentStationRowByFK_Station_Groups, ulong TimeScan, ulong TimeOut, ulong TimeScanFast, ulong TimeOutFast) {
GroupsRow rowGroupsRow = ((GroupsRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
Name,
null,
null,
TimeScan,
TimeOut,
TimeScanFast,
TimeOutFast};
if ((parentStationRowByFK_Station_Groups != null)) {
columnValuesArray[1] = parentStationRowByFK_Station_Groups[1];
}
rowGroupsRow.ItemArray = columnValuesArray;
this.Rows.Add(rowGroupsRow);
return rowGroupsRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow FindByGroupID(long GroupID) {
return ((GroupsRow)(this.Rows.Find(new object[] {
GroupID})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
GroupsDataTable cln = ((GroupsDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new GroupsDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnName = base.Columns["Name"];
this.columnStationID = base.Columns["StationID"];
this.columnGroupID = base.Columns["GroupID"];
this.columnTimeScan = base.Columns["TimeScan"];
this.columnTimeOut = base.Columns["TimeOut"];
this.columnTimeScanFast = base.Columns["TimeScanFast"];
this.columnTimeOutFast = base.Columns["TimeOutFast"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnStationID = new global::System.Data.DataColumn("StationID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnStationID);
this.columnGroupID = new global::System.Data.DataColumn("GroupID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnGroupID);
this.columnTimeScan = new global::System.Data.DataColumn("TimeScan", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeScan);
this.columnTimeOut = new global::System.Data.DataColumn("TimeOut", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeOut);
this.columnTimeScanFast = new global::System.Data.DataColumn("TimeScanFast", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeScanFast);
this.columnTimeOutFast = new global::System.Data.DataColumn("TimeOutFast", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTimeOutFast);
this.Constraints.Add(new global::System.Data.UniqueConstraint("StatioGropKey", new global::System.Data.DataColumn[] {
this.columnGroupID}, true));
this.columnName.AllowDBNull = false;
this.columnStationID.AllowDBNull = false;
this.columnGroupID.AutoIncrement = true;
this.columnGroupID.AllowDBNull = false;
this.columnGroupID.Unique = true;
this.columnTimeScan.AllowDBNull = false;
this.columnTimeScan.DefaultValue = ((ulong)(1000ul));
this.columnTimeOut.AllowDBNull = false;
this.columnTimeOut.DefaultValue = ((ulong)(5000ul));
this.columnTimeScanFast.DefaultValue = ((ulong)(1000ul));
this.columnTimeOutFast.DefaultValue = ((ulong)(5000ul));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow NewGroupsRow() {
return ((GroupsRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new GroupsRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(GroupsRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.GroupsRowChanged != null)) {
this.GroupsRowChanged(this, new GroupsRowChangeEvent(((GroupsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.GroupsRowChanging != null)) {
this.GroupsRowChanging(this, new GroupsRowChangeEvent(((GroupsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.GroupsRowDeleted != null)) {
this.GroupsRowDeleted(this, new GroupsRowChangeEvent(((GroupsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.GroupsRowDeleting != null)) {
this.GroupsRowDeleting(this, new GroupsRowChangeEvent(((GroupsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveGroupsRow(GroupsRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "GroupsDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class ProtocolDataTable : global::System.Data.TypedTableBase<ProtocolRow> {
private global::System.Data.DataColumn columnProtocolID;
private global::System.Data.DataColumn columnName;
private global::System.Data.DataColumn columnChannelID;
private global::System.Data.DataColumn columnResponseTimeOut;
private global::System.Data.DataColumn columnFrameTimeOut;
private global::System.Data.DataColumn columnCharacterTimeOut;
private global::System.Data.DataColumn columnInterfarameGap;
private global::System.Data.DataColumn columnMaxNumberOfRetries;
private global::System.Data.DataColumn columnProtocolType;
private global::System.Data.DataColumn columnDPIdentifier;
private global::System.Data.DataColumn columnDPConfig;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolDataTable() {
this.TableName = "Protocol";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal ProtocolDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected ProtocolDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ProtocolIDColumn {
get {
return this.columnProtocolID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ChannelIDColumn {
get {
return this.columnChannelID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ResponseTimeOutColumn {
get {
return this.columnResponseTimeOut;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn FrameTimeOutColumn {
get {
return this.columnFrameTimeOut;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn CharacterTimeOutColumn {
get {
return this.columnCharacterTimeOut;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn InterfarameGapColumn {
get {
return this.columnInterfarameGap;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn MaxNumberOfRetriesColumn {
get {
return this.columnMaxNumberOfRetries;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ProtocolTypeColumn {
get {
return this.columnProtocolType;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn DPIdentifierColumn {
get {
return this.columnDPIdentifier;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn DPConfigColumn {
get {
return this.columnDPConfig;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow this[int index] {
get {
return ((ProtocolRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ProtocolRowChangeEventHandler ProtocolRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ProtocolRowChangeEventHandler ProtocolRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ProtocolRowChangeEventHandler ProtocolRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ProtocolRowChangeEventHandler ProtocolRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddProtocolRow(ProtocolRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow AddProtocolRow(string Name, ChannelsRow parentChannelsRowByFK_Channels_Protocol, long ResponseTimeOut, ulong FrameTimeOut, ulong CharacterTimeOut, ulong InterfarameGap, long MaxNumberOfRetries, sbyte ProtocolType, System.Guid DPIdentifier, string DPConfig) {
ProtocolRow rowProtocolRow = ((ProtocolRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
null,
Name,
null,
ResponseTimeOut,
FrameTimeOut,
CharacterTimeOut,
InterfarameGap,
MaxNumberOfRetries,
ProtocolType,
DPIdentifier,
DPConfig};
if ((parentChannelsRowByFK_Channels_Protocol != null)) {
columnValuesArray[2] = parentChannelsRowByFK_Channels_Protocol[0];
}
rowProtocolRow.ItemArray = columnValuesArray;
this.Rows.Add(rowProtocolRow);
return rowProtocolRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow FindByName(string Name) {
return ((ProtocolRow)(this.Rows.Find(new object[] {
Name})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
ProtocolDataTable cln = ((ProtocolDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new ProtocolDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnProtocolID = base.Columns["ProtocolID"];
this.columnName = base.Columns["Name"];
this.columnChannelID = base.Columns["ChannelID"];
this.columnResponseTimeOut = base.Columns["ResponseTimeOut"];
this.columnFrameTimeOut = base.Columns["FrameTimeOut"];
this.columnCharacterTimeOut = base.Columns["CharacterTimeOut"];
this.columnInterfarameGap = base.Columns["InterfarameGap"];
this.columnMaxNumberOfRetries = base.Columns["MaxNumberOfRetries"];
this.columnProtocolType = base.Columns["ProtocolType"];
this.columnDPIdentifier = base.Columns["DPIdentifier"];
this.columnDPConfig = base.Columns["DPConfig"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnProtocolID = new global::System.Data.DataColumn("ProtocolID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnProtocolID);
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.columnChannelID = new global::System.Data.DataColumn("ChannelID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnChannelID);
this.columnResponseTimeOut = new global::System.Data.DataColumn("ResponseTimeOut", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnResponseTimeOut);
this.columnFrameTimeOut = new global::System.Data.DataColumn("FrameTimeOut", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnFrameTimeOut);
this.columnCharacterTimeOut = new global::System.Data.DataColumn("CharacterTimeOut", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnCharacterTimeOut);
this.columnInterfarameGap = new global::System.Data.DataColumn("InterfarameGap", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnInterfarameGap);
this.columnMaxNumberOfRetries = new global::System.Data.DataColumn("MaxNumberOfRetries", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnMaxNumberOfRetries);
this.columnProtocolType = new global::System.Data.DataColumn("ProtocolType", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnProtocolType);
this.columnDPIdentifier = new global::System.Data.DataColumn("DPIdentifier", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnDPIdentifier);
this.columnDPConfig = new global::System.Data.DataColumn("DPConfig", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnDPConfig);
this.Constraints.Add(new global::System.Data.UniqueConstraint("ProtocolIDMasterKey", new global::System.Data.DataColumn[] {
this.columnProtocolID}, false));
this.Constraints.Add(new global::System.Data.UniqueConstraint("ProtocolNameKey", new global::System.Data.DataColumn[] {
this.columnName}, true));
this.columnProtocolID.AutoIncrement = true;
this.columnProtocolID.AllowDBNull = false;
this.columnProtocolID.Unique = true;
this.columnName.AllowDBNull = false;
this.columnName.Unique = true;
this.columnChannelID.AllowDBNull = false;
this.columnResponseTimeOut.AllowDBNull = false;
this.columnResponseTimeOut.DefaultValue = ((long)(500));
this.columnMaxNumberOfRetries.AllowDBNull = false;
this.columnMaxNumberOfRetries.DefaultValue = ((long)(5));
this.columnProtocolType.DefaultValue = ((sbyte)(0));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow NewProtocolRow() {
return ((ProtocolRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new ProtocolRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(ProtocolRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.ProtocolRowChanged != null)) {
this.ProtocolRowChanged(this, new ProtocolRowChangeEvent(((ProtocolRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.ProtocolRowChanging != null)) {
this.ProtocolRowChanging(this, new ProtocolRowChangeEvent(((ProtocolRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.ProtocolRowDeleted != null)) {
this.ProtocolRowDeleted(this, new ProtocolRowChangeEvent(((ProtocolRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.ProtocolRowDeleting != null)) {
this.ProtocolRowDeleting(this, new ProtocolRowChangeEvent(((ProtocolRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveProtocolRow(ProtocolRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "ProtocolDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class SerialSetingsDataTable : global::System.Data.TypedTableBase<SerialSetingsRow> {
private global::System.Data.DataColumn columnSerialNum;
private global::System.Data.DataColumn columnProtocolID;
private global::System.Data.DataColumn columnBaudRate;
private global::System.Data.DataColumn columnParity;
private global::System.Data.DataColumn columnDataBits;
private global::System.Data.DataColumn columnStopBits;
private global::System.Data.DataColumn columnTxFlowCTS;
private global::System.Data.DataColumn columnTxFlowDSR;
private global::System.Data.DataColumn columnTxFlowX;
private global::System.Data.DataColumn columnTxWhenRxXoff;
private global::System.Data.DataColumn columnRxGateDSR;
private global::System.Data.DataColumn columnRxFlowX;
private global::System.Data.DataColumn columnUseRTS;
private global::System.Data.DataColumn columnUseDTR;
private global::System.Data.DataColumn columnXonChar;
private global::System.Data.DataColumn columnXoffChar;
private global::System.Data.DataColumn columnrxHighWater;
private global::System.Data.DataColumn columnrxLowWater;
private global::System.Data.DataColumn columnsendTimeoutMultiplier;
private global::System.Data.DataColumn columnsendTimeoutConstant;
private global::System.Data.DataColumn columnrxQueue;
private global::System.Data.DataColumn columntxQueue;
private global::System.Data.DataColumn columnautoReopen;
private global::System.Data.DataColumn columncheckAllSends;
private global::System.Data.DataColumn columnSerialType;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SerialSetingsDataTable() {
this.TableName = "SerialSetings";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal SerialSetingsDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected SerialSetingsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn SerialNumColumn {
get {
return this.columnSerialNum;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ProtocolIDColumn {
get {
return this.columnProtocolID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn BaudRateColumn {
get {
return this.columnBaudRate;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ParityColumn {
get {
return this.columnParity;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn DataBitsColumn {
get {
return this.columnDataBits;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn StopBitsColumn {
get {
return this.columnStopBits;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TxFlowCTSColumn {
get {
return this.columnTxFlowCTS;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TxFlowDSRColumn {
get {
return this.columnTxFlowDSR;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TxFlowXColumn {
get {
return this.columnTxFlowX;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TxWhenRxXoffColumn {
get {
return this.columnTxWhenRxXoff;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn RxGateDSRColumn {
get {
return this.columnRxGateDSR;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn RxFlowXColumn {
get {
return this.columnRxFlowX;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn UseRTSColumn {
get {
return this.columnUseRTS;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn UseDTRColumn {
get {
return this.columnUseDTR;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn XonCharColumn {
get {
return this.columnXonChar;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn XoffCharColumn {
get {
return this.columnXoffChar;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn rxHighWaterColumn {
get {
return this.columnrxHighWater;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn rxLowWaterColumn {
get {
return this.columnrxLowWater;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn sendTimeoutMultiplierColumn {
get {
return this.columnsendTimeoutMultiplier;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn sendTimeoutConstantColumn {
get {
return this.columnsendTimeoutConstant;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn rxQueueColumn {
get {
return this.columnrxQueue;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn txQueueColumn {
get {
return this.columntxQueue;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn autoReopenColumn {
get {
return this.columnautoReopen;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn checkAllSendsColumn {
get {
return this.columncheckAllSends;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn SerialTypeColumn {
get {
return this.columnSerialType;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SerialSetingsRow this[int index] {
get {
return ((SerialSetingsRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SerialSetingsRowChangeEventHandler SerialSetingsRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SerialSetingsRowChangeEventHandler SerialSetingsRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SerialSetingsRowChangeEventHandler SerialSetingsRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event SerialSetingsRowChangeEventHandler SerialSetingsRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddSerialSetingsRow(SerialSetingsRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SerialSetingsRow AddSerialSetingsRow(
short SerialNum,
ulong ProtocolID,
long BaudRate,
sbyte Parity,
sbyte DataBits,
sbyte StopBits,
bool TxFlowCTS,
bool TxFlowDSR,
bool TxFlowX,
bool TxWhenRxXoff,
bool RxGateDSR,
bool RxFlowX,
sbyte UseRTS,
sbyte UseDTR,
sbyte XonChar,
sbyte XoffChar,
ulong rxHighWater,
ulong rxLowWater,
ulong sendTimeoutMultiplier,
ulong sendTimeoutConstant,
ulong rxQueue,
ulong txQueue,
bool autoReopen,
bool checkAllSends,
long SerialType) {
SerialSetingsRow rowSerialSetingsRow = ((SerialSetingsRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
SerialNum,
ProtocolID,
BaudRate,
Parity,
DataBits,
StopBits,
TxFlowCTS,
TxFlowDSR,
TxFlowX,
TxWhenRxXoff,
RxGateDSR,
RxFlowX,
UseRTS,
UseDTR,
XonChar,
XoffChar,
rxHighWater,
rxLowWater,
sendTimeoutMultiplier,
sendTimeoutConstant,
rxQueue,
txQueue,
autoReopen,
checkAllSends,
SerialType};
rowSerialSetingsRow.ItemArray = columnValuesArray;
this.Rows.Add(rowSerialSetingsRow);
return rowSerialSetingsRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
SerialSetingsDataTable cln = ((SerialSetingsDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new SerialSetingsDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnSerialNum = base.Columns["SerialNum"];
this.columnProtocolID = base.Columns["ProtocolID"];
this.columnBaudRate = base.Columns["BaudRate"];
this.columnParity = base.Columns["Parity"];
this.columnDataBits = base.Columns["DataBits"];
this.columnStopBits = base.Columns["StopBits"];
this.columnTxFlowCTS = base.Columns["TxFlowCTS"];
this.columnTxFlowDSR = base.Columns["TxFlowDSR"];
this.columnTxFlowX = base.Columns["TxFlowX"];
this.columnTxWhenRxXoff = base.Columns["TxWhenRxXoff"];
this.columnRxGateDSR = base.Columns["RxGateDSR"];
this.columnRxFlowX = base.Columns["RxFlowX"];
this.columnUseRTS = base.Columns["UseRTS"];
this.columnUseDTR = base.Columns["UseDTR"];
this.columnXonChar = base.Columns["XonChar"];
this.columnXoffChar = base.Columns["XoffChar"];
this.columnrxHighWater = base.Columns["rxHighWater"];
this.columnrxLowWater = base.Columns["rxLowWater"];
this.columnsendTimeoutMultiplier = base.Columns["sendTimeoutMultiplier"];
this.columnsendTimeoutConstant = base.Columns["sendTimeoutConstant"];
this.columnrxQueue = base.Columns["rxQueue"];
this.columntxQueue = base.Columns["txQueue"];
this.columnautoReopen = base.Columns["autoReopen"];
this.columncheckAllSends = base.Columns["checkAllSends"];
this.columnSerialType = base.Columns["SerialType"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnSerialNum = new global::System.Data.DataColumn("SerialNum", typeof(short), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnSerialNum);
this.columnProtocolID = new global::System.Data.DataColumn("ProtocolID", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnProtocolID);
this.columnBaudRate = new global::System.Data.DataColumn("BaudRate", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnBaudRate);
this.columnParity = new global::System.Data.DataColumn("Parity", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnParity);
this.columnDataBits = new global::System.Data.DataColumn("DataBits", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnDataBits);
this.columnStopBits = new global::System.Data.DataColumn("StopBits", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnStopBits);
this.columnTxFlowCTS = new global::System.Data.DataColumn("TxFlowCTS", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTxFlowCTS);
this.columnTxFlowDSR = new global::System.Data.DataColumn("TxFlowDSR", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTxFlowDSR);
this.columnTxFlowX = new global::System.Data.DataColumn("TxFlowX", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTxFlowX);
this.columnTxWhenRxXoff = new global::System.Data.DataColumn("TxWhenRxXoff", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTxWhenRxXoff);
this.columnRxGateDSR = new global::System.Data.DataColumn("RxGateDSR", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnRxGateDSR);
this.columnRxFlowX = new global::System.Data.DataColumn("RxFlowX", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnRxFlowX);
this.columnUseRTS = new global::System.Data.DataColumn("UseRTS", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnUseRTS);
this.columnUseDTR = new global::System.Data.DataColumn("UseDTR", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnUseDTR);
this.columnXonChar = new global::System.Data.DataColumn("XonChar", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnXonChar);
this.columnXoffChar = new global::System.Data.DataColumn("XoffChar", typeof(sbyte), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnXoffChar);
this.columnrxHighWater = new global::System.Data.DataColumn("rxHighWater", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnrxHighWater);
this.columnrxLowWater = new global::System.Data.DataColumn("rxLowWater", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnrxLowWater);
this.columnsendTimeoutMultiplier = new global::System.Data.DataColumn("sendTimeoutMultiplier", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnsendTimeoutMultiplier);
this.columnsendTimeoutConstant = new global::System.Data.DataColumn("sendTimeoutConstant", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnsendTimeoutConstant);
this.columnrxQueue = new global::System.Data.DataColumn("rxQueue", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnrxQueue);
this.columntxQueue = new global::System.Data.DataColumn("txQueue", typeof(ulong), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columntxQueue);
this.columnautoReopen = new global::System.Data.DataColumn("autoReopen", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnautoReopen);
this.columncheckAllSends = new global::System.Data.DataColumn("checkAllSends", typeof(bool), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columncheckAllSends);
this.columnSerialType = new global::System.Data.DataColumn("SerialType", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnSerialType);
this.Constraints.Add(new global::System.Data.UniqueConstraint("SerialSetingsProtocolKey", new global::System.Data.DataColumn[] {
this.columnProtocolID}, false));
this.columnSerialNum.AllowDBNull = false;
this.columnProtocolID.AllowDBNull = false;
this.columnProtocolID.Unique = true;
this.columnBaudRate.AllowDBNull = false;
this.columnParity.AllowDBNull = false;
this.columnDataBits.AllowDBNull = false;
this.columnStopBits.AllowDBNull = false;
this.columnSerialType.DefaultValue = ((long)(0));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SerialSetingsRow NewSerialSetingsRow() {
return ((SerialSetingsRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new SerialSetingsRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(SerialSetingsRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.SerialSetingsRowChanged != null)) {
this.SerialSetingsRowChanged(this, new SerialSetingsRowChangeEvent(((SerialSetingsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.SerialSetingsRowChanging != null)) {
this.SerialSetingsRowChanging(this, new SerialSetingsRowChangeEvent(((SerialSetingsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.SerialSetingsRowDeleted != null)) {
this.SerialSetingsRowDeleted(this, new SerialSetingsRowChangeEvent(((SerialSetingsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.SerialSetingsRowDeleting != null)) {
this.SerialSetingsRowDeleting(this, new SerialSetingsRowChangeEvent(((SerialSetingsRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveSerialSetingsRow(SerialSetingsRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "SerialSetingsDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class TagBitDataTable : global::System.Data.TypedTableBase<TagBitRow> {
private global::System.Data.DataColumn columnTagID;
private global::System.Data.DataColumn columnBitNumber;
private global::System.Data.DataColumn columnName;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitDataTable() {
this.TableName = "TagBit";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal TagBitDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected TagBitDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TagIDColumn {
get {
return this.columnTagID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn BitNumberColumn {
get {
return this.columnBitNumber;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn NameColumn {
get {
return this.columnName;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRow this[int index] {
get {
return ((TagBitRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagBitRowChangeEventHandler TagBitRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagBitRowChangeEventHandler TagBitRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagBitRowChangeEventHandler TagBitRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event TagBitRowChangeEventHandler TagBitRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddTagBitRow(TagBitRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRow AddTagBitRow(TagsRow parentTagsRowByFK_Tags_TagBit, short BitNumber, string Name) {
TagBitRow rowTagBitRow = ((TagBitRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
null,
BitNumber,
Name};
if ((parentTagsRowByFK_Tags_TagBit != null)) {
columnValuesArray[0] = parentTagsRowByFK_Tags_TagBit[1];
}
rowTagBitRow.ItemArray = columnValuesArray;
this.Rows.Add(rowTagBitRow);
return rowTagBitRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRow FindByTagIDName(long TagID, string Name) {
return ((TagBitRow)(this.Rows.Find(new object[] {
TagID,
Name})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
TagBitDataTable cln = ((TagBitDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new TagBitDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnTagID = base.Columns["TagID"];
this.columnBitNumber = base.Columns["BitNumber"];
this.columnName = base.Columns["Name"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnTagID = new global::System.Data.DataColumn("TagID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTagID);
this.columnBitNumber = new global::System.Data.DataColumn("BitNumber", typeof(short), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnBitNumber);
this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnName);
this.Constraints.Add(new global::System.Data.UniqueConstraint("TagBitNameKey", new global::System.Data.DataColumn[] {
this.columnTagID,
this.columnName}, true));
this.columnTagID.AllowDBNull = false;
this.columnBitNumber.AllowDBNull = false;
this.columnBitNumber.DefaultValue = ((short)(0));
this.columnName.AllowDBNull = false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRow NewTagBitRow() {
return ((TagBitRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new TagBitRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(TagBitRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.TagBitRowChanged != null)) {
this.TagBitRowChanged(this, new TagBitRowChangeEvent(((TagBitRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.TagBitRowChanging != null)) {
this.TagBitRowChanging(this, new TagBitRowChangeEvent(((TagBitRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.TagBitRowDeleted != null)) {
this.TagBitRowDeleted(this, new TagBitRowChangeEvent(((TagBitRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.TagBitRowDeleting != null)) {
this.TagBitRowDeleting(this, new TagBitRowChangeEvent(((TagBitRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveTagBitRow(TagBitRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "TagBitDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class ItemPropertiesTableDataTable : global::System.Data.TypedTableBase<ItemPropertiesTableRow> {
private global::System.Data.DataColumn columnID;
private global::System.Data.DataColumn columnTagID;
private global::System.Data.DataColumn columnID_Name_Name;
private global::System.Data.DataColumn columnID_Name_Namespace;
private global::System.Data.DataColumn columnID_Code;
private global::System.Data.DataColumn columnValue;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableDataTable() {
this.TableName = "ItemPropertiesTable";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal ItemPropertiesTableDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected ItemPropertiesTableDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn IDColumn {
get {
return this.columnID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn TagIDColumn {
get {
return this.columnTagID;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ID_Name_NameColumn {
get {
return this.columnID_Name_Name;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ID_Name_NamespaceColumn {
get {
return this.columnID_Name_Namespace;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ID_CodeColumn {
get {
return this.columnID_Code;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataColumn ValueColumn {
get {
return this.columnValue;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRow this[int index] {
get {
return ((ItemPropertiesTableRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ItemPropertiesTableRowChangeEventHandler ItemPropertiesTableRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ItemPropertiesTableRowChangeEventHandler ItemPropertiesTableRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ItemPropertiesTableRowChangeEventHandler ItemPropertiesTableRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public event ItemPropertiesTableRowChangeEventHandler ItemPropertiesTableRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void AddItemPropertiesTableRow(ItemPropertiesTableRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRow AddItemPropertiesTableRow(TagsRow parentTagsRowByFK_Tags_ItemPropertiesTable, string ID_Name_Name, string ID_Name_Namespace, int ID_Code, string Value) {
ItemPropertiesTableRow rowItemPropertiesTableRow = ((ItemPropertiesTableRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
null,
null,
ID_Name_Name,
ID_Name_Namespace,
ID_Code,
Value};
if ((parentTagsRowByFK_Tags_ItemPropertiesTable != null)) {
columnValuesArray[1] = parentTagsRowByFK_Tags_ItemPropertiesTable[1];
}
rowItemPropertiesTableRow.ItemArray = columnValuesArray;
this.Rows.Add(rowItemPropertiesTableRow);
return rowItemPropertiesTableRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRow FindByID(long ID) {
return ((ItemPropertiesTableRow)(this.Rows.Find(new object[] {
ID})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public override global::System.Data.DataTable Clone() {
ItemPropertiesTableDataTable cln = ((ItemPropertiesTableDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new ItemPropertiesTableDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal void InitVars() {
this.columnID = base.Columns["ID"];
this.columnTagID = base.Columns["TagID"];
this.columnID_Name_Name = base.Columns["ID_Name_Name"];
this.columnID_Name_Namespace = base.Columns["ID_Name_Namespace"];
this.columnID_Code = base.Columns["ID_Code"];
this.columnValue = base.Columns["Value"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitClass() {
this.columnID = new global::System.Data.DataColumn("ID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnID);
this.columnTagID = new global::System.Data.DataColumn("TagID", typeof(long), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnTagID);
this.columnID_Name_Name = new global::System.Data.DataColumn("ID_Name_Name", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnID_Name_Name);
this.columnID_Name_Namespace = new global::System.Data.DataColumn("ID_Name_Namespace", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnID_Name_Namespace);
this.columnID_Code = new global::System.Data.DataColumn("ID_Code", typeof(int), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnID_Code);
this.columnValue = new global::System.Data.DataColumn("Value", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnValue);
this.Constraints.Add(new global::System.Data.UniqueConstraint("ItemPropertiesTableKey1", new global::System.Data.DataColumn[] {
this.columnID}, true));
this.columnID.AutoIncrement = true;
this.columnID.AutoIncrementSeed = 1;
this.columnID.AllowDBNull = false;
this.columnID.Unique = true;
this.columnTagID.AllowDBNull = false;
this.columnID_Name_Name.Caption = "Used for properties identified by a qualified name";
this.columnID_Name_Namespace.Caption = "A string representation of the namespace or String.Empty";
this.columnID_Code.AllowDBNull = false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRow NewItemPropertiesTableRow() {
return ((ItemPropertiesTableRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new ItemPropertiesTableRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(ItemPropertiesTableRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.ItemPropertiesTableRowChanged != null)) {
this.ItemPropertiesTableRowChanged(this, new ItemPropertiesTableRowChangeEvent(((ItemPropertiesTableRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.ItemPropertiesTableRowChanging != null)) {
this.ItemPropertiesTableRowChanging(this, new ItemPropertiesTableRowChangeEvent(((ItemPropertiesTableRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.ItemPropertiesTableRowDeleted != null)) {
this.ItemPropertiesTableRowDeleted(this, new ItemPropertiesTableRowChangeEvent(((ItemPropertiesTableRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.ItemPropertiesTableRowDeleting != null)) {
this.ItemPropertiesTableRowDeleting(this, new ItemPropertiesTableRowChangeEvent(((ItemPropertiesTableRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void RemoveItemPropertiesTableRow(ItemPropertiesTableRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
ComunicationNet ds = new ComunicationNet();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "ItemPropertiesTableDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class ChannelsRow : global::System.Data.DataRow {
private ChannelsDataTable tableChannels;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal ChannelsRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableChannels = ((ChannelsDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long ChannelID {
get {
return ((long)(this[this.tableChannels.ChannelIDColumn]));
}
set {
this[this.tableChannels.ChannelIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
try {
return ((string)(this[this.tableChannels.NameColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'Channels\' is DBNull.", e);
}
}
set {
this[this.tableChannels.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsNameNull() {
return this.IsNull(this.tableChannels.NameColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetNameNull() {
this[this.tableChannels.NameColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow[] GetProtocolRows() {
if ((this.Table.ChildRelations["FK_Channels_Protocol"] == null)) {
return new ProtocolRow[0];
}
else {
return ((ProtocolRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Channels_Protocol"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class InterfacesRow : global::System.Data.DataRow {
private InterfacesDataTable tableInterfaces;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal InterfacesRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableInterfaces = ((InterfacesDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableInterfaces.NameColumn]));
}
set {
this[this.tableInterfaces.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long SegmentId {
get {
return ((long)(this[this.tableInterfaces.SegmentIdColumn]));
}
set {
this[this.tableInterfaces.SegmentIdColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long StationId {
get {
return ((long)(this[this.tableInterfaces.StationIdColumn]));
}
set {
this[this.tableInterfaces.StationIdColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long Address {
get {
return ((long)(this[this.tableInterfaces.AddressColumn]));
}
set {
this[this.tableInterfaces.AddressColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long InactTime {
get {
return ((long)(this[this.tableInterfaces.InactTimeColumn]));
}
set {
this[this.tableInterfaces.InactTimeColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long InactTimeAFailure {
get {
return ((long)(this[this.tableInterfaces.InactTimeAFailureColumn]));
}
set {
this[this.tableInterfaces.InactTimeAFailureColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong InterfaceNum {
get {
return ((ulong)(this[this.tableInterfaces.InterfaceNumColumn]));
}
set {
this[this.tableInterfaces.InterfaceNumColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow StationRow {
get {
return ((StationRow)(this.GetParentRow(this.Table.ParentRelations["FK_Station_Interfaces"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Station_Interfaces"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow SegmentsRow {
get {
return ((SegmentsRow)(this.GetParentRow(this.Table.ParentRelations["FK_Segments_Interfaces"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Segments_Interfaces"]);
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class StationRow : global::System.Data.DataRow {
private StationDataTable tableStation;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal StationRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableStation = ((StationDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableStation.NameColumn]));
}
set {
this[this.tableStation.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long StationID {
get {
return ((long)(this[this.tableStation.StationIDColumn]));
}
set {
this[this.tableStation.StationIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow[] GetGroupsRows() {
if ((this.Table.ChildRelations["FK_Station_Groups"] == null)) {
return new GroupsRow[0];
}
else {
return ((GroupsRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Station_Groups"])));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRow[] GetInterfacesRows() {
if ((this.Table.ChildRelations["FK_Station_Interfaces"] == null)) {
return new InterfacesRow[0];
}
else {
return ((InterfacesRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Station_Interfaces"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class DataBlocksRow : global::System.Data.DataRow {
private DataBlocksDataTable tableDataBlocks;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal DataBlocksRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableDataBlocks = ((DataBlocksDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableDataBlocks.NameColumn]));
}
set {
this[this.tableDataBlocks.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong Address {
get {
return ((ulong)(this[this.tableDataBlocks.AddressColumn]));
}
set {
this[this.tableDataBlocks.AddressColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long GroupID {
get {
return ((long)(this[this.tableDataBlocks.GroupIDColumn]));
}
set {
this[this.tableDataBlocks.GroupIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong DataType {
get {
return ((ulong)(this[this.tableDataBlocks.DataTypeColumn]));
}
set {
this[this.tableDataBlocks.DataTypeColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public int DatBlockID {
get {
return ((int)(this[this.tableDataBlocks.DatBlockIDColumn]));
}
set {
this[this.tableDataBlocks.DatBlockIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow GroupsRow {
get {
return ((GroupsRow)(this.GetParentRow(this.Table.ParentRelations["FK_Groups_DataBlocks"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Groups_DataBlocks"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow[] GetTagsRows() {
if ((this.Table.ChildRelations["FK_DataBlocks_Tags"] == null)) {
return new TagsRow[0];
}
else {
return ((TagsRow[])(base.GetChildRows(this.Table.ChildRelations["FK_DataBlocks_Tags"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class SegmentsRow : global::System.Data.DataRow {
private SegmentsDataTable tableSegments;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal SegmentsRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableSegments = ((SegmentsDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableSegments.NameColumn]));
}
set {
this[this.tableSegments.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long SegmentID {
get {
return ((long)(this[this.tableSegments.SegmentIDColumn]));
}
set {
this[this.tableSegments.SegmentIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long ProtocolID {
get {
try {
return ((long)(this[this.tableSegments.ProtocolIDColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'ProtocolID\' in table \'Segments\' is DBNull.", e);
}
}
set {
this[this.tableSegments.ProtocolIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Address {
get {
return ((string)(this[this.tableSegments.AddressColumn]));
}
set {
this[this.tableSegments.AddressColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long TimeScan {
get {
return ((long)(this[this.tableSegments.TimeScanColumn]));
}
set {
this[this.tableSegments.TimeScanColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool KeepConnect {
get {
return ((bool)(this[this.tableSegments.KeepConnectColumn]));
}
set {
this[this.tableSegments.KeepConnectColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool PickupConn {
get {
return ((bool)(this[this.tableSegments.PickupConnColumn]));
}
set {
this[this.tableSegments.PickupConnColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long timeKeepConn {
get {
return ((long)(this[this.tableSegments.timeKeepConnColumn]));
}
set {
this[this.tableSegments.timeKeepConnColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long TimeReconnect {
get {
return ((long)(this[this.tableSegments.TimeReconnectColumn]));
}
set {
this[this.tableSegments.TimeReconnectColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long TimeIdleKeepConn {
get {
return ((long)(this[this.tableSegments.TimeIdleKeepConnColumn]));
}
set {
this[this.tableSegments.TimeIdleKeepConnColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow ProtocolRow {
get {
return ((ProtocolRow)(this.GetParentRow(this.Table.ParentRelations["FK_Protocol_Segments"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Protocol_Segments"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsProtocolIDNull() {
return this.IsNull(this.tableSegments.ProtocolIDColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetProtocolIDNull() {
this[this.tableSegments.ProtocolIDColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRow[] GetInterfacesRows() {
if ((this.Table.ChildRelations["FK_Segments_Interfaces"] == null)) {
return new InterfacesRow[0];
}
else {
return ((InterfacesRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Segments_Interfaces"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class TagsRow : global::System.Data.DataRow {
private TagsDataTable tableTags;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal TagsRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableTags = ((TagsDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableTags.NameColumn]));
}
set {
this[this.tableTags.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long TagID {
get {
return ((long)(this[this.tableTags.TagIDColumn]));
}
set {
this[this.tableTags.TagIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte AccessRights {
get {
return ((sbyte)(this[this.tableTags.AccessRightsColumn]));
}
set {
this[this.tableTags.AccessRightsColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte StateTrigger {
get {
return ((sbyte)(this[this.tableTags.StateTriggerColumn]));
}
set {
this[this.tableTags.StateTriggerColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool Alarm {
get {
return ((bool)(this[this.tableTags.AlarmColumn]));
}
set {
this[this.tableTags.AlarmColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong AlarmMask {
get {
return ((ulong)(this[this.tableTags.AlarmMaskColumn]));
}
set {
this[this.tableTags.AlarmMaskColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong StateMask {
get {
return ((ulong)(this[this.tableTags.StateMaskColumn]));
}
set {
this[this.tableTags.StateMaskColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public int DatBlockID {
get {
return ((int)(this[this.tableTags.DatBlockIDColumn]));
}
set {
this[this.tableTags.DatBlockIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRow DataBlocksRow {
get {
return ((DataBlocksRow)(this.GetParentRow(this.Table.ParentRelations["FK_DataBlocks_Tags"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_DataBlocks_Tags"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRow[] GetItemPropertiesTableRows() {
if ((this.Table.ChildRelations["FK_Tags_ItemPropertiesTable"] == null)) {
return new ItemPropertiesTableRow[0];
}
else {
return ((ItemPropertiesTableRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Tags_ItemPropertiesTable"])));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRow[] GetTagBitRows() {
if ((this.Table.ChildRelations["FK_Tags_TagBit"] == null)) {
return new TagBitRow[0];
}
else {
return ((TagBitRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Tags_TagBit"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class GroupsRow : global::System.Data.DataRow {
private GroupsDataTable tableGroups;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal GroupsRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableGroups = ((GroupsDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableGroups.NameColumn]));
}
set {
this[this.tableGroups.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long StationID {
get {
return ((long)(this[this.tableGroups.StationIDColumn]));
}
set {
this[this.tableGroups.StationIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long GroupID {
get {
return ((long)(this[this.tableGroups.GroupIDColumn]));
}
set {
this[this.tableGroups.GroupIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong TimeScan {
get {
return ((ulong)(this[this.tableGroups.TimeScanColumn]));
}
set {
this[this.tableGroups.TimeScanColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong TimeOut {
get {
return ((ulong)(this[this.tableGroups.TimeOutColumn]));
}
set {
this[this.tableGroups.TimeOutColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong TimeScanFast {
get {
try {
return ((ulong)(this[this.tableGroups.TimeScanFastColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'TimeScanFast\' in table \'Groups\' is DBNull.", e);
}
}
set {
this[this.tableGroups.TimeScanFastColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong TimeOutFast {
get {
try {
return ((ulong)(this[this.tableGroups.TimeOutFastColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'TimeOutFast\' in table \'Groups\' is DBNull.", e);
}
}
set {
this[this.tableGroups.TimeOutFastColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow StationRow {
get {
return ((StationRow)(this.GetParentRow(this.Table.ParentRelations["FK_Station_Groups"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Station_Groups"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsTimeScanFastNull() {
return this.IsNull(this.tableGroups.TimeScanFastColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetTimeScanFastNull() {
this[this.tableGroups.TimeScanFastColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsTimeOutFastNull() {
return this.IsNull(this.tableGroups.TimeOutFastColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetTimeOutFastNull() {
this[this.tableGroups.TimeOutFastColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRow[] GetDataBlocksRows() {
if ((this.Table.ChildRelations["FK_Groups_DataBlocks"] == null)) {
return new DataBlocksRow[0];
}
else {
return ((DataBlocksRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Groups_DataBlocks"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class ProtocolRow : global::System.Data.DataRow {
private ProtocolDataTable tableProtocol;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal ProtocolRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableProtocol = ((ProtocolDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long ProtocolID {
get {
return ((long)(this[this.tableProtocol.ProtocolIDColumn]));
}
set {
this[this.tableProtocol.ProtocolIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableProtocol.NameColumn]));
}
set {
this[this.tableProtocol.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long ChannelID {
get {
return ((long)(this[this.tableProtocol.ChannelIDColumn]));
}
set {
this[this.tableProtocol.ChannelIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long ResponseTimeOut {
get {
return ((long)(this[this.tableProtocol.ResponseTimeOutColumn]));
}
set {
this[this.tableProtocol.ResponseTimeOutColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong FrameTimeOut {
get {
try {
return ((ulong)(this[this.tableProtocol.FrameTimeOutColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'FrameTimeOut\' in table \'Protocol\' is DBNull.", e);
}
}
set {
this[this.tableProtocol.FrameTimeOutColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong CharacterTimeOut {
get {
try {
return ((ulong)(this[this.tableProtocol.CharacterTimeOutColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'CharacterTimeOut\' in table \'Protocol\' is DBNull.", e);
}
}
set {
this[this.tableProtocol.CharacterTimeOutColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong InterfarameGap {
get {
try {
return ((ulong)(this[this.tableProtocol.InterfarameGapColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'InterfarameGap\' in table \'Protocol\' is DBNull.", e);
}
}
set {
this[this.tableProtocol.InterfarameGapColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long MaxNumberOfRetries {
get {
return ((long)(this[this.tableProtocol.MaxNumberOfRetriesColumn]));
}
set {
this[this.tableProtocol.MaxNumberOfRetriesColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte ProtocolType {
get {
try {
return ((sbyte)(this[this.tableProtocol.ProtocolTypeColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'ProtocolType\' in table \'Protocol\' is DBNull.", e);
}
}
set {
this[this.tableProtocol.ProtocolTypeColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public System.Guid DPIdentifier {
get {
try {
return ((global::System.Guid)(this[this.tableProtocol.DPIdentifierColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'DPIdentifier\' in table \'Protocol\' is DBNull.", e);
}
}
set {
this[this.tableProtocol.DPIdentifierColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string DPConfig {
get {
if (this.IsDPConfigNull()) {
return string.Empty;
}
else {
return ((string)(this[this.tableProtocol.DPConfigColumn]));
}
}
set {
this[this.tableProtocol.DPConfigColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRow ChannelsRow {
get {
return ((ChannelsRow)(this.GetParentRow(this.Table.ParentRelations["FK_Channels_Protocol"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Channels_Protocol"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsFrameTimeOutNull() {
return this.IsNull(this.tableProtocol.FrameTimeOutColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetFrameTimeOutNull() {
this[this.tableProtocol.FrameTimeOutColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsCharacterTimeOutNull() {
return this.IsNull(this.tableProtocol.CharacterTimeOutColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetCharacterTimeOutNull() {
this[this.tableProtocol.CharacterTimeOutColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsInterfarameGapNull() {
return this.IsNull(this.tableProtocol.InterfarameGapColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetInterfarameGapNull() {
this[this.tableProtocol.InterfarameGapColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsProtocolTypeNull() {
return this.IsNull(this.tableProtocol.ProtocolTypeColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetProtocolTypeNull() {
this[this.tableProtocol.ProtocolTypeColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsDPIdentifierNull() {
return this.IsNull(this.tableProtocol.DPIdentifierColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetDPIdentifierNull() {
this[this.tableProtocol.DPIdentifierColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsDPConfigNull() {
return this.IsNull(this.tableProtocol.DPConfigColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetDPConfigNull() {
this[this.tableProtocol.DPConfigColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow[] GetSegmentsRows() {
if ((this.Table.ChildRelations["FK_Protocol_Segments"] == null)) {
return new SegmentsRow[0];
}
else {
return ((SegmentsRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Protocol_Segments"])));
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class SerialSetingsRow : global::System.Data.DataRow {
private SerialSetingsDataTable tableSerialSetings;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal SerialSetingsRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableSerialSetings = ((SerialSetingsDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public short SerialNum {
get {
return ((short)(this[this.tableSerialSetings.SerialNumColumn]));
}
set {
this[this.tableSerialSetings.SerialNumColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong ProtocolID {
get {
return ((ulong)(this[this.tableSerialSetings.ProtocolIDColumn]));
}
set {
this[this.tableSerialSetings.ProtocolIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long BaudRate {
get {
return ((long)(this[this.tableSerialSetings.BaudRateColumn]));
}
set {
this[this.tableSerialSetings.BaudRateColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte Parity {
get {
return ((sbyte)(this[this.tableSerialSetings.ParityColumn]));
}
set {
this[this.tableSerialSetings.ParityColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte DataBits {
get {
return ((sbyte)(this[this.tableSerialSetings.DataBitsColumn]));
}
set {
this[this.tableSerialSetings.DataBitsColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte StopBits {
get {
return ((sbyte)(this[this.tableSerialSetings.StopBitsColumn]));
}
set {
this[this.tableSerialSetings.StopBitsColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool TxFlowCTS {
get {
try {
return ((bool)(this[this.tableSerialSetings.TxFlowCTSColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'TxFlowCTS\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.TxFlowCTSColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool TxFlowDSR {
get {
try {
return ((bool)(this[this.tableSerialSetings.TxFlowDSRColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'TxFlowDSR\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.TxFlowDSRColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool TxFlowX {
get {
try {
return ((bool)(this[this.tableSerialSetings.TxFlowXColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'TxFlowX\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.TxFlowXColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool TxWhenRxXoff {
get {
try {
return ((bool)(this[this.tableSerialSetings.TxWhenRxXoffColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'TxWhenRxXoff\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.TxWhenRxXoffColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool RxGateDSR {
get {
try {
return ((bool)(this[this.tableSerialSetings.RxGateDSRColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'RxGateDSR\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.RxGateDSRColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool RxFlowX {
get {
try {
return ((bool)(this[this.tableSerialSetings.RxFlowXColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'RxFlowX\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.RxFlowXColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte UseRTS {
get {
try {
return ((sbyte)(this[this.tableSerialSetings.UseRTSColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'UseRTS\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.UseRTSColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte UseDTR {
get {
try {
return ((sbyte)(this[this.tableSerialSetings.UseDTRColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'UseDTR\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.UseDTRColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte XonChar {
get {
try {
return ((sbyte)(this[this.tableSerialSetings.XonCharColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'XonChar\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.XonCharColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public sbyte XoffChar {
get {
try {
return ((sbyte)(this[this.tableSerialSetings.XoffCharColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'XoffChar\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.XoffCharColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong rxHighWater {
get {
try {
return ((ulong)(this[this.tableSerialSetings.rxHighWaterColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'rxHighWater\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.rxHighWaterColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong rxLowWater {
get {
try {
return ((ulong)(this[this.tableSerialSetings.rxLowWaterColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'rxLowWater\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.rxLowWaterColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong sendTimeoutMultiplier {
get {
try {
return ((ulong)(this[this.tableSerialSetings.sendTimeoutMultiplierColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'sendTimeoutMultiplier\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.sendTimeoutMultiplierColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong sendTimeoutConstant {
get {
try {
return ((ulong)(this[this.tableSerialSetings.sendTimeoutConstantColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'sendTimeoutConstant\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.sendTimeoutConstantColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong rxQueue {
get {
try {
return ((ulong)(this[this.tableSerialSetings.rxQueueColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'rxQueue\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.rxQueueColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ulong txQueue {
get {
try {
return ((ulong)(this[this.tableSerialSetings.txQueueColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'txQueue\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.txQueueColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool autoReopen {
get {
try {
return ((bool)(this[this.tableSerialSetings.autoReopenColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'autoReopen\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.autoReopenColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool checkAllSends {
get {
try {
return ((bool)(this[this.tableSerialSetings.checkAllSendsColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'checkAllSends\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.checkAllSendsColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long SerialType {
get {
try {
return ((long)(this[this.tableSerialSetings.SerialTypeColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'SerialType\' in table \'SerialSetings\' is DBNull.", e);
}
}
set {
this[this.tableSerialSetings.SerialTypeColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsTxFlowCTSNull() {
return this.IsNull(this.tableSerialSetings.TxFlowCTSColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetTxFlowCTSNull() {
this[this.tableSerialSetings.TxFlowCTSColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsTxFlowDSRNull() {
return this.IsNull(this.tableSerialSetings.TxFlowDSRColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetTxFlowDSRNull() {
this[this.tableSerialSetings.TxFlowDSRColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsTxFlowXNull() {
return this.IsNull(this.tableSerialSetings.TxFlowXColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetTxFlowXNull() {
this[this.tableSerialSetings.TxFlowXColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsTxWhenRxXoffNull() {
return this.IsNull(this.tableSerialSetings.TxWhenRxXoffColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetTxWhenRxXoffNull() {
this[this.tableSerialSetings.TxWhenRxXoffColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsRxGateDSRNull() {
return this.IsNull(this.tableSerialSetings.RxGateDSRColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetRxGateDSRNull() {
this[this.tableSerialSetings.RxGateDSRColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsRxFlowXNull() {
return this.IsNull(this.tableSerialSetings.RxFlowXColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetRxFlowXNull() {
this[this.tableSerialSetings.RxFlowXColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsUseRTSNull() {
return this.IsNull(this.tableSerialSetings.UseRTSColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetUseRTSNull() {
this[this.tableSerialSetings.UseRTSColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsUseDTRNull() {
return this.IsNull(this.tableSerialSetings.UseDTRColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetUseDTRNull() {
this[this.tableSerialSetings.UseDTRColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsXonCharNull() {
return this.IsNull(this.tableSerialSetings.XonCharColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetXonCharNull() {
this[this.tableSerialSetings.XonCharColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsXoffCharNull() {
return this.IsNull(this.tableSerialSetings.XoffCharColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetXoffCharNull() {
this[this.tableSerialSetings.XoffCharColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsrxHighWaterNull() {
return this.IsNull(this.tableSerialSetings.rxHighWaterColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetrxHighWaterNull() {
this[this.tableSerialSetings.rxHighWaterColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsrxLowWaterNull() {
return this.IsNull(this.tableSerialSetings.rxLowWaterColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetrxLowWaterNull() {
this[this.tableSerialSetings.rxLowWaterColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IssendTimeoutMultiplierNull() {
return this.IsNull(this.tableSerialSetings.sendTimeoutMultiplierColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetsendTimeoutMultiplierNull() {
this[this.tableSerialSetings.sendTimeoutMultiplierColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IssendTimeoutConstantNull() {
return this.IsNull(this.tableSerialSetings.sendTimeoutConstantColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetsendTimeoutConstantNull() {
this[this.tableSerialSetings.sendTimeoutConstantColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsrxQueueNull() {
return this.IsNull(this.tableSerialSetings.rxQueueColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetrxQueueNull() {
this[this.tableSerialSetings.rxQueueColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IstxQueueNull() {
return this.IsNull(this.tableSerialSetings.txQueueColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SettxQueueNull() {
this[this.tableSerialSetings.txQueueColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsautoReopenNull() {
return this.IsNull(this.tableSerialSetings.autoReopenColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetautoReopenNull() {
this[this.tableSerialSetings.autoReopenColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IscheckAllSendsNull() {
return this.IsNull(this.tableSerialSetings.checkAllSendsColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetcheckAllSendsNull() {
this[this.tableSerialSetings.checkAllSendsColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsSerialTypeNull() {
return this.IsNull(this.tableSerialSetings.SerialTypeColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetSerialTypeNull() {
this[this.tableSerialSetings.SerialTypeColumn] = global::System.Convert.DBNull;
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class TagBitRow : global::System.Data.DataRow {
private TagBitDataTable tableTagBit;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal TagBitRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableTagBit = ((TagBitDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long TagID {
get {
return ((long)(this[this.tableTagBit.TagIDColumn]));
}
set {
this[this.tableTagBit.TagIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public short BitNumber {
get {
return ((short)(this[this.tableTagBit.BitNumberColumn]));
}
set {
this[this.tableTagBit.BitNumberColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Name {
get {
return ((string)(this[this.tableTagBit.NameColumn]));
}
set {
this[this.tableTagBit.NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow TagsRow {
get {
return ((TagsRow)(this.GetParentRow(this.Table.ParentRelations["FK_Tags_TagBit"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Tags_TagBit"]);
}
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class ItemPropertiesTableRow : global::System.Data.DataRow {
private ItemPropertiesTableDataTable tableItemPropertiesTable;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
internal ItemPropertiesTableRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableItemPropertiesTable = ((ItemPropertiesTableDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long ID {
get {
return ((long)(this[this.tableItemPropertiesTable.IDColumn]));
}
set {
this[this.tableItemPropertiesTable.IDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public long TagID {
get {
return ((long)(this[this.tableItemPropertiesTable.TagIDColumn]));
}
set {
this[this.tableItemPropertiesTable.TagIDColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string ID_Name_Name {
get {
try {
return ((string)(this[this.tableItemPropertiesTable.ID_Name_NameColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'ID_Name_Name\' in table \'ItemPropertiesTable\' is DBNull.", e);
}
}
set {
this[this.tableItemPropertiesTable.ID_Name_NameColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string ID_Name_Namespace {
get {
try {
return ((string)(this[this.tableItemPropertiesTable.ID_Name_NamespaceColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'ID_Name_Namespace\' in table \'ItemPropertiesTable\' is DBNull" +
".", e);
}
}
set {
this[this.tableItemPropertiesTable.ID_Name_NamespaceColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public int ID_Code {
get {
return ((int)(this[this.tableItemPropertiesTable.ID_CodeColumn]));
}
set {
this[this.tableItemPropertiesTable.ID_CodeColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public string Value {
get {
try {
return ((string)(this[this.tableItemPropertiesTable.ValueColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'Value\' in table \'ItemPropertiesTable\' is DBNull.", e);
}
}
set {
this[this.tableItemPropertiesTable.ValueColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow TagsRow {
get {
return ((TagsRow)(this.GetParentRow(this.Table.ParentRelations["FK_Tags_ItemPropertiesTable"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FK_Tags_ItemPropertiesTable"]);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsID_Name_NameNull() {
return this.IsNull(this.tableItemPropertiesTable.ID_Name_NameColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetID_Name_NameNull() {
this[this.tableItemPropertiesTable.ID_Name_NameColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsID_Name_NamespaceNull() {
return this.IsNull(this.tableItemPropertiesTable.ID_Name_NamespaceColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetID_Name_NamespaceNull() {
this[this.tableItemPropertiesTable.ID_Name_NamespaceColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public bool IsValueNull() {
return this.IsNull(this.tableItemPropertiesTable.ValueColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public void SetValueNull() {
this[this.tableItemPropertiesTable.ValueColumn] = global::System.Convert.DBNull;
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class ChannelsRowChangeEvent : global::System.EventArgs {
private ChannelsRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRowChangeEvent(ChannelsRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ChannelsRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class InterfacesRowChangeEvent : global::System.EventArgs {
private InterfacesRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRowChangeEvent(InterfacesRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public InterfacesRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class StationRowChangeEvent : global::System.EventArgs {
private StationRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRowChangeEvent(StationRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public StationRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class DataBlocksRowChangeEvent : global::System.EventArgs {
private DataBlocksRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRowChangeEvent(DataBlocksRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public DataBlocksRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class SegmentsRowChangeEvent : global::System.EventArgs {
private SegmentsRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRowChangeEvent(SegmentsRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SegmentsRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class TagsRowChangeEvent : global::System.EventArgs {
private TagsRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRowChangeEvent(TagsRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagsRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class GroupsRowChangeEvent : global::System.EventArgs {
private GroupsRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRowChangeEvent(GroupsRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public GroupsRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class ProtocolRowChangeEvent : global::System.EventArgs {
private ProtocolRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRowChangeEvent(ProtocolRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ProtocolRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class SerialSetingsRowChangeEvent : global::System.EventArgs {
private SerialSetingsRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SerialSetingsRowChangeEvent(SerialSetingsRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public SerialSetingsRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class TagBitRowChangeEvent : global::System.EventArgs {
private TagBitRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRowChangeEvent(TagBitRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public TagBitRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public class ItemPropertiesTableRowChangeEvent : global::System.EventArgs {
private ItemPropertiesTableRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRowChangeEvent(ItemPropertiesTableRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public ItemPropertiesTableRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
#pragma warning restore 1591 | 55.714816 | 290 | 0.57143 | [
"MIT"
] | mpostol/PO.Common | CommServer.DAServeConfiguration/Configuration.Designer.cs | 389,950 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SyncObjX.Core
{
class StringHelper
{
}
}
| 12.583333 | 33 | 0.715232 | [
"MIT"
] | cburriss/SyncObjX | source/SyncObjX/Core/StringHelper.cs | 153 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using MLAgents;
public class BasketCatchAgent : Agent
{
#region Member Fields
private float _visionRayLength = 11.0f;
[SerializeField]
private BasketCatchEnvironment _env;
private float _intervalSize;
private Vector3 _agentOrigin;
[Header("Physics")]
[SerializeField]
private Rigidbody _rigidbody;
[SerializeField]
private Text _scoreText;
private float _rewardScore = 0;
private float _punishmentScore = 0;
[SerializeField]
private float _agentSpeed = 12.0f;
[SerializeField]
private LayerMask _punishmentMask;
[SerializeField]
private LayerMask _rewardMask;
[Header("Agent's Inputs")]
[SerializeField]
private float _visionSpectrumLength = 10.0f;
[SerializeField]
private bool _centerRay = true;
[SerializeField]
private int _numAdditionalRays = 12;
#endregion
#region Agent Overrides
/// <summary>
/// Initializes the vision of the agent by defining rays for raycasts.
/// </summary>
public override void InitializeAgent()
{
// Define ray interval size
_intervalSize = (_visionSpectrumLength - transform.localScale.x) / _numAdditionalRays;
_agentOrigin = transform.position;
}
/// <summary>
/// Executes the raycasts to observe the state
/// </summary>
public override void CollectObservations()
{
List<float> state = new List<float>();
// Initialize and update rays
List<Ray> visionRays = new List<Ray>();
float yPos = transform.position.y - (transform.localScale.y / 2);
// Center ray
if (_centerRay)
{
visionRays.Add(new Ray(new Vector3(transform.position.x, yPos, transform.position.z), transform.up));
}
// Additional rays start from the outer edges of the basket
float left = transform.position.x - (transform.localScale.x / 2);
for (int i = 0; i < _numAdditionalRays / 2; i++)
{
Vector3 origin = new Vector3(left - _intervalSize * i, yPos, transform.position.z);
visionRays.Add(new Ray(origin, transform.up));
}
float right = transform.position.x + (transform.localScale.x / 2);
for (int i = 0; i < _numAdditionalRays / 2; i++)
{
Vector3 origin = new Vector3(right + _intervalSize * i, yPos, transform.position.z);
visionRays.Add(new Ray(origin, transform.up));
}
// Execute raycasts (vision of the agent)
foreach (var ray in visionRays)
{
Color debugColor = Color.black;
// Raycast Reward
RaycastHit hit = new RaycastHit();
if (Physics.Raycast(ray, out hit, _visionRayLength, _rewardMask))
{
state.Add(hit.distance / (_visionRayLength));
debugColor = Color.blue;
}
else
{
state.Add(0.0f);
}
// Raycast Punishment
hit = new RaycastHit();
if (Physics.Raycast(ray, out hit, _visionRayLength, _punishmentMask))
{
debugColor = Color.red;
state.Add(hit.distance / (_visionRayLength));
}
else
{
state.Add(0.0f);
}
Debug.DrawLine(ray.origin, ray.origin + Vector3.up * _visionRayLength, debugColor, 0.0f);
}
// Add distance to left wall
state.Add(Mathf.Abs(_env.BoundaryLeft.position.x - transform.position.x) / 18);
// Add distance to right wall
state.Add(Mathf.Abs(_env.BoundaryRight.position.x - transform.position.x) / 18);
AddVectorObs(state);
}
/// <summary>
/// Execution of actions inside of FixedUpdate()
/// </summary>
/// <param name="vectorAction"></param>
/// <param name="textAction"></param>
public override void AgentAction(float[] vectorAction, string textAction)
{
if (brain.brainType.Equals(BrainType.External))
{
if (brain.brainParameters.vectorActionSpaceType == SpaceType.discrete)
{
int action = (int)vectorAction[0];
if (action == 0)
{
// Move Left
_rigidbody.velocity = new Vector3(-1 * _agentSpeed, 0, 0);
}
else if (action == 1)
{
// Move Right
_rigidbody.velocity = new Vector3(1 * _agentSpeed, 0, 0);
}
else
{
// Don't/Stop move
_rigidbody.velocity = Vector3.zero;
}
}
else
{
Debug.LogError("Action Space should be discrete");
}
}
if (brain.brainType.Equals(BrainType.Player))
{
float horizontalInput = Input.GetAxis("Horizontal");
_rigidbody.velocity = new Vector3(horizontalInput * _agentSpeed, 0, 0);
}
}
/// <summary>
/// Resets the agent to its original location and clears the score.
/// </summary>
public override void AgentReset()
{
transform.position = _agentOrigin;
_scoreText.text = "Score: 0";
_rewardScore = 0;
}
#endregion
#region Unity Lifecycle
/// <summary>
/// Update is used to draw the rays.
/// </summary>
//private void Update()
//{
// foreach(var ray in _visionRays)
// {
// Debug.DrawLine(ray.origin, ray.origin + transform.up * _visionRayLength, Color.red);
// }
//}
#endregion
#region Public Functions
/// <summary>
/// Rewards the agent
/// </summary>
/// <param name="rewardSignal">Reward to signal</param>
public void EvaluateReward(ItemType itemType)
{
if (itemType.Equals(ItemType.Reward))
{
AddReward(1.0f);
_rewardScore += 1;
}
else
{
AddReward(-1.0f);
_punishmentScore -= 1;
}
_scoreText.text = "<color=blue>R +" + _rewardScore + "</color>: <color=red>P " + _punishmentScore + "</color>: S: " + (_rewardScore + _punishmentScore);
}
#endregion
} | 31.426471 | 160 | 0.564343 | [
"MIT"
] | MarcoMeter/Unity-ML-Environments | Unity Environments/Basket Catch/Assets/Scripts/BasketCatchAgent.cs | 6,413 | C# |
/*
* Created by SharpDevelop.
* User: trecio
* Date: 2011-09-23
* Time: 19:53
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using developwithpassion.specifications.extensions;
using developwithpassion.specifications.rhinomocks;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.UnitTesting;
using Machine.Specifications;
using Machine.Fakes.Adapters.Rhinomocks;
namespace ICSharpCode.MachineSpecifications.Tests
{
[Subject(typeof(ClassFilterBuilder))]
public class When_building_class_filter_from_test_selection : Observes<ClassFilterBuilder>
{
const string NAMESPACE_FILTER = "Namespace";
static DefaultClass classAddedExplicitly, classInNamespace, classOutsideNamespace, classNestedInAddedExplicitly, classNestedInClassInNamespace;
static SelectedTests selectedTests;
static IProjectContent projectContent;
static IList<string> result;
Establish ctx = () => {
projectContent = fake.an<IProjectContent>();
projectContent.setup(x => x.SystemTypes).Return(new SystemTypes(projectContent));
var compilationUnit = new DefaultCompilationUnit(projectContent);
classAddedExplicitly = new DefaultClass(compilationUnit, "ClassAddedExplicitly");
classNestedInAddedExplicitly = new DefaultClass(compilationUnit, classAddedExplicitly);
classNestedInAddedExplicitly.FullyQualifiedName = "ClassAddedExplicitly.InnerClass";
classAddedExplicitly.InnerClasses.Add(classNestedInAddedExplicitly);
classInNamespace = new DefaultClass(compilationUnit, "Namespace.OtherNamespace.ClassInNamespace");
classNestedInClassInNamespace = new DefaultClass(compilationUnit, classInNamespace);
classNestedInClassInNamespace.FullyQualifiedName = "Namespace.OtherNamespace.ClassInNamespace.InnerClass";
classInNamespace.InnerClasses.Add(classNestedInClassInNamespace);
classOutsideNamespace = new DefaultClass(compilationUnit, "Namespace2.ClassOutsideNamespac");
var project = fake.an<IProject>();
projectContent.setup(x => x.Classes).Return(new[]{classInNamespace, classOutsideNamespace});
selectedTests = new SelectedTests(project, NAMESPACE_FILTER, classAddedExplicitly, null);
};
Because of = () =>
result = sut.BuildFilterFor(selectedTests, projectContent);
It should_add_dotnet_name_of_selected_test_class = () =>
result.ShouldContain(classAddedExplicitly.DotNetName);
It should_add_class_included_in_selected_namespace = () =>
result.ShouldContain(classInNamespace.DotNetName);
It should_not_include_class_not_included_in_namespace = () =>
result.ShouldNotContain(classOutsideNamespace.DotNetName);
It should_not_include_class_nested_in_selected_test_class = () =>
result.ShouldNotContain(classNestedInAddedExplicitly.DotNetName);
It should_include_class_nested_in_class_from_selected_namespace = () =>
result.ShouldContain(classNestedInClassInNamespace.DotNetName);
}
}
| 42.352113 | 145 | 0.809777 | [
"MIT"
] | denza/SharpDevelop | src/AddIns/Analysis/MachineSpecifications/MachineSpecifications.Tests/Src/ClassFilterBuilder.cs | 3,009 | C# |
using System;
using UnityEngine;
public class BillboardScript : MonoBehaviour
{
public void Main()
{
}
public void Update()
{
base.transform.LookAt(Camera.main.transform.position);
base.transform.Rotate((Vector3) (Vector3.left * -90f));
}
}
| 17.705882 | 64 | 0.604651 | [
"MIT"
] | Jagerente/RCFixed | Source/BillboardScript.cs | 303 | C# |
using System.Collections.Generic;
using System.Web.Routing;
namespace Our.Umbraco.PageSpeed.ActionFilters
{
public interface IKeyBuilder
{
string BuildKey(string controllerName);
string BuildKey(string controllerName, string actionName);
string BuildKey(string controllerName, string actionName, RouteValueDictionary routeValues);
string BuildKeyFragment(KeyValuePair<string, object> routeValue);
}
} | 34.307692 | 100 | 0.757848 | [
"MIT"
] | jvtroyen/Our.PageSpeed | Our.Umbraco.PageSpeed/ActionFilters/IKeyBuilder.cs | 448 | C# |
using System.Collections.Generic;
using System.IO;
using ApprovalTests.Core;
using ApprovalTests.Core.Exceptions;
namespace ApprovalTests.Approvers
{
public class FileApprover : IApprovalApprover
{
private readonly IApprovalNamer namer;
private readonly IApprovalWriter writer;
private string approved;
private ApprovalException failure;
private string received;
public FileApprover(IApprovalWriter writer, IApprovalNamer namer)
{
this.writer = writer;
this.namer = namer;
}
public virtual bool Approve()
{
string basename = string.Format(@"{0}\{1}", namer.SourcePath, namer.Name);
approved = Path.GetFullPath(writer.GetApprovalFilename(basename));
received = Path.GetFullPath(writer.GetReceivedFilename(basename));
received = writer.WriteReceivedFile(received);
failure = Approve(approved, received);
return failure == null;
}
public virtual ApprovalException Approve(string approved, string received)
{
if (!File.Exists(approved))
{
return new ApprovalMissingException(received, approved);
}
if (!Compare(File.ReadAllBytes(received), File.ReadAllBytes(approved)))
{
return new ApprovalMismatchException(received, approved);
}
return null;
}
public void Fail()
{
throw failure;
}
public void ReportFailure(IApprovalFailureReporter reporter)
{
reporter.Report(approved, received);
}
public void CleanUpAfterSucess(IApprovalFailureReporter reporter)
{
File.Delete(received);
if (reporter is IApprovalReporterWithCleanUp)
{
((IApprovalReporterWithCleanUp)reporter).CleanUp(approved, received);
}
}
private static bool Compare(ICollection<byte> bytes1, ICollection<byte> bytes2)
{
if (bytes1.Count != bytes2.Count)
return false;
IEnumerator<byte> e1 = bytes1.GetEnumerator();
IEnumerator<byte> e2 = bytes2.GetEnumerator();
while (e1.MoveNext() && e2.MoveNext())
{
if (e1.Current != e2.Current)
return false;
}
return true;
}
}
} | 24.833333 | 82 | 0.69511 | [
"Apache-2.0"
] | GeertvanHorrik/ApprovalTests.Net | ApprovalTests/Approvers/FileApprover.cs | 2,003 | C# |
using System;
using System.Runtime.InteropServices;
using Xwt.GtkBackend;
namespace Xwt.Interop {
public static class DllImportWebkit {
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_network_request_new(IntPtr uri);
public static d_webkit_network_request_new webkit_network_request_new = FuncLoader.LoadFunction<d_webkit_network_request_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_network_request_new"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_network_request_new(IntPtr uri);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_network_request_get_type();
public static d_webkit_network_request_get_type webkit_network_request_get_type = FuncLoader.LoadFunction<d_webkit_network_request_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_network_request_get_type"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_network_request_get_type();
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_network_request_get_uri(IntPtr raw);
public static d_webkit_network_request_get_uri webkit_network_request_get_uri = FuncLoader.LoadFunction<d_webkit_network_request_get_uri>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_network_request_get_uri"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_network_request_get_uri(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_network_request_set_uri(IntPtr raw, IntPtr uri);
public static d_webkit_network_request_set_uri webkit_network_request_set_uri = FuncLoader.LoadFunction<d_webkit_network_request_set_uri>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_network_request_set_uri"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_network_request_set_uri(IntPtr raw, IntPtr uri);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_web_view_new();
public static d_webkit_web_view_new webkit_web_view_new = FuncLoader.LoadFunction<d_webkit_web_view_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_new"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_web_view_new();
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_web_view_get_type();
public static d_webkit_web_view_get_type webkit_web_view_get_type = FuncLoader.LoadFunction<d_webkit_web_view_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_get_type"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_web_view_get_type();
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_load_uri(IntPtr raw, IntPtr uri);
public static d_webkit_web_view_load_uri webkit_web_view_load_uri = FuncLoader.LoadFunction<d_webkit_web_view_load_uri>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_load_uri"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_load_uri(IntPtr raw, IntPtr uri);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_web_view_get_uri(IntPtr raw);
public static d_webkit_web_view_get_uri webkit_web_view_get_uri = FuncLoader.LoadFunction<d_webkit_web_view_get_uri>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_get_uri"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_web_view_get_uri(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate bool d_webkit_web_view_get_full_content_zoom(IntPtr raw);
public static d_webkit_web_view_get_full_content_zoom webkit_web_view_get_full_content_zoom = FuncLoader.LoadFunction<d_webkit_web_view_get_full_content_zoom>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_get_full_content_zoom"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern bool webkit_web_view_get_full_content_zoom(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_set_full_content_zoom(IntPtr raw, bool full_content_zoom);
public static d_webkit_web_view_set_full_content_zoom webkit_web_view_set_full_content_zoom = FuncLoader.LoadFunction<d_webkit_web_view_set_full_content_zoom>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_set_full_content_zoom"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_set_full_content_zoom(IntPtr raw, bool full_content_zoom);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_stop_loading(IntPtr raw);
public static d_webkit_web_view_stop_loading webkit_web_view_stop_loading = FuncLoader.LoadFunction<d_webkit_web_view_stop_loading>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_stop_loading"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_stop_loading(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_reload(IntPtr raw);
public static d_webkit_web_view_reload webkit_web_view_reload = FuncLoader.LoadFunction<d_webkit_web_view_reload>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_reload"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_reload(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate bool d_webkit_web_view_can_go_back(IntPtr raw);
public static d_webkit_web_view_can_go_back webkit_web_view_can_go_back = FuncLoader.LoadFunction<d_webkit_web_view_can_go_back>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_can_go_back"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern bool webkit_web_view_can_go_back(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_go_back(IntPtr raw);
public static d_webkit_web_view_go_back webkit_web_view_go_back = FuncLoader.LoadFunction<d_webkit_web_view_go_back>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_go_back"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_go_back(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate bool d_webkit_web_view_can_go_forward(IntPtr raw);
public static d_webkit_web_view_can_go_forward webkit_web_view_can_go_forward = FuncLoader.LoadFunction<d_webkit_web_view_can_go_forward>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_can_go_forward"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern bool webkit_web_view_can_go_forward(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_go_forward(IntPtr raw);
public static d_webkit_web_view_go_forward webkit_web_view_go_forward = FuncLoader.LoadFunction<d_webkit_web_view_go_forward>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_go_forward"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_go_forward(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_webkit_web_view_load_string(IntPtr raw, IntPtr content, IntPtr mime_type, IntPtr encoding, IntPtr base_uri);
public static d_webkit_web_view_load_string webkit_web_view_load_string = FuncLoader.LoadFunction<d_webkit_web_view_load_string>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_load_string"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern void webkit_web_view_load_string (IntPtr raw, IntPtr content, IntPtr mime_type, IntPtr encoding, IntPtr base_uri);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_webkit_web_view_get_title(IntPtr raw);
public static d_webkit_web_view_get_title webkit_web_view_get_title = FuncLoader.LoadFunction<d_webkit_web_view_get_title>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_get_title"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern IntPtr webkit_web_view_get_title(IntPtr raw);
#endif
#if XWT_GTKSHARP3
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate double d_webkit_web_view_get_progress(IntPtr raw);
public static d_webkit_web_view_get_progress webkit_web_view_get_progress = FuncLoader.LoadFunction<d_webkit_web_view_get_progress>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_web_view_get_progress"));
#else
[DllImport (GtkInterop.LIBWEBKIT)]
public static extern double webkit_web_view_get_progress(IntPtr raw);
#endif
}
} | 56.134078 | 266 | 0.79996 | [
"MIT"
] | dotdevelop/xwt | Xwt.Gtk/GtkInterop/DllImportWebkit.cs | 10,048 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: Guid("e4ecda62-016e-4892-95d3-d88c301aa04e")]
| 23.875 | 56 | 0.811518 | [
"MIT"
] | stpatrick2016/archishow | ArchiShow.UnitTests/Properties/AssemblyInfo.cs | 191 | C# |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace AnaLight
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
| 17.888889 | 42 | 0.701863 | [
"MIT"
] | jmnich/AnaLight | App.xaml.cs | 324 | C# |
using System;
using System.Windows.Forms;
namespace FlatUI.Examples
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new BasicExample());
}
}
} | 24.105263 | 65 | 0.585153 | [
"MIT"
] | EnergyCube/FlatUI | src/FlatUI.Examples/Program.cs | 460 | C# |
using System.Collections.Generic;
namespace DFrame.Kubernetes.Models
{
public class V1Podantiaffinity
{
public IList<V1WeightedPodAffinityTerm> PreferredDuringSchedulingIgnoredDuringExecution { get; set; }
public IList<V1PodAffinityTerm> RequiredDuringSchedulingIgnoredDuringExecution { get; set; }
}
}
| 30.272727 | 109 | 0.771772 | [
"MIT"
] | Cysharp/DFrame | src/DFrame.Kubernetes/Models/V1Podantiaffinity.cs | 335 | C# |
#region License
// Copyright (c) 2009, ClearCanvas Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of ClearCanvas Inc. nor the names of its contributors
// may be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
// OF SUCH DAMAGE.
#endregion
// This file is auto-generated by the ClearCanvas.Model.SqlServer2005.CodeGenerator project.
namespace ClearCanvas.ImageServer.Model.EntityBrokers
{
using ClearCanvas.ImageServer.Enterprise;
using ClearCanvas.ImageServer.Model.EntityBrokers;
public interface IFilesystemEntityBroker : IEntityBroker<Filesystem, FilesystemSelectCriteria, FilesystemUpdateColumns>
{ }
}
| 48.833333 | 120 | 0.753291 | [
"Apache-2.0"
] | econmed/ImageServer20 | ImageServer/Model/EntityBrokers/IFilesystemEntityBroker.gen.cs | 2,051 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WildWorldImporters.Sales.Edmx
{
using System;
using System.Collections.Generic;
public partial class City
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public City()
{
this.DeliveryCustomers = new HashSet<Customer>();
this.PostalCustomers = new HashSet<Customer>();
this.DeliverySuppliers = new HashSet<Supplier>();
this.PostalSuppliers = new HashSet<Supplier>();
}
public int Id { get; set; }
public string Name { get; set; }
public int StateProvinceId { get; set; }
public System.Data.Entity.Spatial.DbGeography Location { get; set; }
public Nullable<long> LatestRecordedPopulation { get; set; }
public int LastEditedById { get; set; }
public System.DateTime ValidFrom { get; set; }
public System.DateTime ValidTo { get; set; }
public virtual Person LastEditedBy { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Customer> DeliveryCustomers { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Customer> PostalCustomers { get; set; }
public virtual StateProvince StateProvince { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Supplier> DeliverySuppliers { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Supplier> PostalSuppliers { get; set; }
}
}
| 49.914894 | 128 | 0.647059 | [
"MIT"
] | boone34/Data.Entity.Edmx | Samples/WildWorldImporters/Sales/Edmx/City.cs | 2,346 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Security;
using System.Xml;
using System.Xml.Serialization;
using CoreWCF.Collections.Generic;
using CoreWCF.Runtime;
using CoreWCF.Runtime.Serialization;
using CoreWCF.Channels;
using CoreWCF.Dispatcher;
namespace CoreWCF.Description
{
internal class XmlSerializerOperationBehavior : IOperationBehavior
{
readonly Reflector.OperationReflector reflector;
readonly bool builtInOperationBehavior;
public XmlSerializerOperationBehavior(OperationDescription operation)
: this(operation, null)
{
}
public XmlSerializerOperationBehavior(OperationDescription operation, XmlSerializerFormatAttribute attribute)
{
if (operation == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operation");
Reflector parentReflector = new Reflector(operation.DeclaringContract.Namespace, operation.DeclaringContract.ContractType);
reflector = parentReflector.ReflectOperation(operation, attribute ?? new XmlSerializerFormatAttribute());
}
internal XmlSerializerOperationBehavior(OperationDescription operation, XmlSerializerFormatAttribute attribute, Reflector parentReflector)
: this(operation, attribute)
{
// used by System.ServiceModel.Web
reflector = parentReflector.ReflectOperation(operation, attribute ?? new XmlSerializerFormatAttribute());
}
XmlSerializerOperationBehavior(Reflector.OperationReflector reflector, bool builtInOperationBehavior)
{
Fx.Assert(reflector != null, "");
this.reflector = reflector;
this.builtInOperationBehavior = builtInOperationBehavior;
}
internal Reflector.OperationReflector OperationReflector
{
get { return reflector; }
}
internal bool IsBuiltInOperationBehavior
{
get { return builtInOperationBehavior; }
}
public XmlSerializerFormatAttribute XmlSerializerFormatAttribute
{
get
{
return reflector.Attribute;
}
}
internal static XmlSerializerOperationFormatter CreateOperationFormatter(OperationDescription operation)
{
return new XmlSerializerOperationBehavior(operation).CreateFormatter();
}
internal static XmlSerializerOperationFormatter CreateOperationFormatter(OperationDescription operation, XmlSerializerFormatAttribute attr)
{
return new XmlSerializerOperationBehavior(operation, attr).CreateFormatter();
}
internal static void AddBehaviors(ContractDescription contract)
{
AddBehaviors(contract, false);
}
internal static void AddBuiltInBehaviors(ContractDescription contract)
{
AddBehaviors(contract, true);
}
static void AddBehaviors(ContractDescription contract, bool builtInOperationBehavior)
{
Reflector reflector = new Reflector(contract.Namespace, contract.ContractType);
foreach (OperationDescription operation in contract.Operations)
{
Reflector.OperationReflector operationReflector = reflector.ReflectOperation(operation);
if (operationReflector != null)
{
bool isInherited = operation.DeclaringContract != contract;
if (!isInherited)
{
operation.Behaviors.Add(new XmlSerializerOperationBehavior(operationReflector, builtInOperationBehavior));
//operation.Behaviors.Add(new XmlSerializerOperationGenerator(new XmlSerializerImportOptions()));
}
}
}
}
internal XmlSerializerOperationFormatter CreateFormatter()
{
return new XmlSerializerOperationFormatter(reflector.Operation, reflector.Attribute, reflector.Request, reflector.Reply);
}
XmlSerializerFaultFormatter CreateFaultFormatter(SynchronizedCollection<FaultContractInfo> faultContractInfos)
{
return new XmlSerializerFaultFormatter(faultContractInfos, reflector.XmlSerializerFaultContractInfos);
}
void IOperationBehavior.Validate(OperationDescription description)
{
}
void IOperationBehavior.AddBindingParameters(OperationDescription description, BindingParameterCollection parameters)
{
}
void IOperationBehavior.ApplyDispatchBehavior(OperationDescription description, DispatchOperation dispatch)
{
if (description == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description");
if (dispatch == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dispatch");
if (dispatch.Formatter == null)
{
dispatch.Formatter = (IDispatchMessageFormatter)CreateFormatter();
dispatch.DeserializeRequest = reflector.RequestRequiresSerialization;
dispatch.SerializeReply = reflector.ReplyRequiresSerialization;
}
if (reflector.Attribute.SupportFaults)
{
if (!dispatch.IsFaultFormatterSetExplicit)
{
dispatch.FaultFormatter = (IDispatchFaultFormatter)CreateFaultFormatter(dispatch.FaultContractInfos);
}
else
{
var wrapper = dispatch.FaultFormatter as IDispatchFaultFormatterWrapper;
if (wrapper != null)
{
wrapper.InnerFaultFormatter = (IDispatchFaultFormatter)CreateFaultFormatter(dispatch.FaultContractInfos);
}
}
}
}
void IOperationBehavior.ApplyClientBehavior(OperationDescription description, ClientOperation proxy)
{
if (description == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description");
if (proxy == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("proxy");
if (proxy.Formatter == null)
{
proxy.Formatter = (IClientMessageFormatter)CreateFormatter();
proxy.SerializeRequest = reflector.RequestRequiresSerialization;
proxy.DeserializeReply = reflector.ReplyRequiresSerialization;
}
if (reflector.Attribute.SupportFaults && !proxy.IsFaultFormatterSetExplicit)
proxy.FaultFormatter = (IClientFaultFormatter)CreateFaultFormatter(proxy.FaultContractInfos);
}
public Collection<XmlMapping> GetXmlMappings()
{
Collection<XmlMapping> mappings = new Collection<XmlMapping>();
if (OperationReflector.Request != null && OperationReflector.Request.HeadersMapping != null)
mappings.Add(OperationReflector.Request.HeadersMapping);
if (OperationReflector.Request != null && OperationReflector.Request.BodyMapping != null)
mappings.Add(OperationReflector.Request.BodyMapping);
if (OperationReflector.Reply != null && OperationReflector.Reply.HeadersMapping != null)
mappings.Add(OperationReflector.Reply.HeadersMapping);
if (OperationReflector.Reply != null && OperationReflector.Reply.BodyMapping != null)
mappings.Add(OperationReflector.Reply.BodyMapping);
return mappings;
}
// helper for reflecting operations
internal class Reflector
{
readonly XmlSerializerImporter importer;
readonly SerializerGenerationContext generation;
Collection<OperationReflector> operationReflectors = new Collection<OperationReflector>();
object thisLock = new object();
internal Reflector(string defaultNs, Type type)
{
importer = new XmlSerializerImporter(defaultNs);
generation = new SerializerGenerationContext(type);
}
internal void EnsureMessageInfos()
{
lock (thisLock)
{
foreach (OperationReflector operationReflector in operationReflectors)
{
operationReflector.EnsureMessageInfos();
}
}
}
static XmlSerializerFormatAttribute FindAttribute(OperationDescription operation)
{
Type contractType = operation.DeclaringContract != null ? operation.DeclaringContract.ContractType : null;
XmlSerializerFormatAttribute contractFormatAttribute = contractType != null ? TypeLoader.GetFormattingAttribute(contractType.GetTypeInfo(), null) as XmlSerializerFormatAttribute : null;
return TypeLoader.GetFormattingAttribute(operation.OperationMethod, contractFormatAttribute) as XmlSerializerFormatAttribute;
}
// auto-reflects the operation, returning null if no attribute was found or inherited
internal OperationReflector ReflectOperation(OperationDescription operation)
{
XmlSerializerFormatAttribute attr = FindAttribute(operation);
if (attr == null)
return null;
return ReflectOperation(operation, attr);
}
// overrides the auto-reflection with an attribute
internal OperationReflector ReflectOperation(OperationDescription operation, XmlSerializerFormatAttribute attrOverride)
{
OperationReflector operationReflector = new OperationReflector(this, operation, attrOverride, true/*reflectOnDemand*/);
operationReflectors.Add(operationReflector);
return operationReflector;
}
internal class OperationReflector
{
readonly Reflector parent;
internal readonly OperationDescription Operation;
internal readonly XmlSerializerFormatAttribute Attribute;
internal readonly bool IsEncoded;
internal readonly bool IsRpc;
internal readonly bool IsOneWay;
internal readonly bool RequestRequiresSerialization;
internal readonly bool ReplyRequiresSerialization;
readonly string keyBase;
MessageInfo request;
MessageInfo reply;
SynchronizedCollection<XmlSerializerFaultContractInfo> xmlSerializerFaultContractInfos;
internal OperationReflector(Reflector parent, OperationDescription operation, XmlSerializerFormatAttribute attr, bool reflectOnDemand)
{
Fx.Assert(parent != null, "");
Fx.Assert(operation != null, "");
Fx.Assert(attr != null, "");
OperationFormatter.Validate(operation, attr.Style == OperationFormatStyle.Rpc, attr.IsEncoded);
this.parent = parent;
Operation = operation;
Attribute = attr;
IsEncoded = attr.IsEncoded;
IsRpc = (attr.Style == OperationFormatStyle.Rpc);
IsOneWay = operation.Messages.Count == 1;
RequestRequiresSerialization = !operation.Messages[0].IsUntypedMessage;
ReplyRequiresSerialization = !IsOneWay && !operation.Messages[1].IsUntypedMessage;
MethodInfo methodInfo = operation.OperationMethod;
if (methodInfo == null)
{
// keyBase needs to be unique within the scope of the parent reflector
keyBase = string.Empty;
if (operation.DeclaringContract != null)
{
keyBase = operation.DeclaringContract.Name + "," + operation.DeclaringContract.Namespace + ":";
}
keyBase = keyBase + operation.Name;
}
else
keyBase = methodInfo.DeclaringType.FullName + ":" + methodInfo.ToString();
foreach (MessageDescription message in operation.Messages)
foreach (MessageHeaderDescription header in message.Headers)
SetUnknownHeaderInDescription(header);
if (!reflectOnDemand)
{
EnsureMessageInfos();
}
}
private void SetUnknownHeaderInDescription(MessageHeaderDescription header)
{
if (IsEncoded) //XmlAnyElementAttribute does not apply
return;
if (header.AdditionalAttributesProvider != null)
{
object[] attrs = header.AdditionalAttributesProvider.GetCustomAttributes(false).ToArray();
bool isUnknown = false;
bool xmlIgnore = false;
foreach (var attr in attrs)
{
if (attr is XmlAnyElementAttribute)
{
if (string.IsNullOrEmpty(((XmlAnyElementAttribute)attr).Name))
{
isUnknown = true;
}
}
// In the original full framework code using XmlAttributes, the XmlAnyElements collection is cleared
// if the XmlIgnore attribute is present.
if (attr is XmlIgnoreAttribute)
{
xmlIgnore = true;
break; // XmlIgnore overrides all so no need to continue if found.
}
}
header.IsUnknownHeaderCollection = isUnknown && !xmlIgnore;
}
}
string ContractName
{
get { return Operation.DeclaringContract.Name; }
}
string ContractNamespace
{
get { return Operation.DeclaringContract.Namespace; }
}
internal MessageInfo Request
{
get
{
parent.EnsureMessageInfos();
return request;
}
}
internal MessageInfo Reply
{
get
{
parent.EnsureMessageInfos();
return reply;
}
}
internal SynchronizedCollection<XmlSerializerFaultContractInfo> XmlSerializerFaultContractInfos
{
get
{
parent.EnsureMessageInfos();
return xmlSerializerFaultContractInfos;
}
}
internal void EnsureMessageInfos()
{
if (request == null)
{
foreach (Type knownType in Operation.KnownTypes)
{
if (knownType == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxKnownTypeNull, Operation.Name)));
parent.importer.IncludeType(knownType, IsEncoded);
}
request = CreateMessageInfo(Operation.Messages[0], ":Request");
if (request != null && IsRpc && Operation.IsValidateRpcWrapperName && request.BodyMapping.XsdElementName != Operation.Name)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxRpcMessageBodyPartNameInvalid, Operation.Name, Operation.Messages[0].MessageName, request.BodyMapping.XsdElementName, Operation.Name)));
if (!IsOneWay)
{
reply = CreateMessageInfo(Operation.Messages[1], ":Response");
XmlName responseName = TypeLoader.GetBodyWrapperResponseName(Operation.Name);
if (reply != null && IsRpc && Operation.IsValidateRpcWrapperName && reply.BodyMapping.XsdElementName != responseName.EncodedName)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxRpcMessageBodyPartNameInvalid, Operation.Name, Operation.Messages[1].MessageName, reply.BodyMapping.XsdElementName, responseName.EncodedName)));
}
if (Attribute.SupportFaults)
{
GenerateXmlSerializerFaultContractInfos();
}
}
}
void GenerateXmlSerializerFaultContractInfos()
{
SynchronizedCollection<XmlSerializerFaultContractInfo> faultInfos = new SynchronizedCollection<XmlSerializerFaultContractInfo>();
for (int i = 0; i < Operation.Faults.Count; i++)
{
FaultDescription fault = Operation.Faults[i];
FaultContractInfo faultContractInfo = new FaultContractInfo(fault.Action, fault.DetailType, fault.ElementName, fault.Namespace, Operation.KnownTypes);
XmlQualifiedName elementName;
XmlMembersMapping xmlMembersMapping = ImportFaultElement(fault, out elementName);
SerializerStub serializerStub = parent.generation.AddSerializer(xmlMembersMapping);
faultInfos.Add(new XmlSerializerFaultContractInfo(faultContractInfo, serializerStub, elementName));
}
xmlSerializerFaultContractInfos = faultInfos;
}
MessageInfo CreateMessageInfo(MessageDescription message, string key)
{
if (message.IsUntypedMessage)
return null;
MessageInfo info = new MessageInfo();
if (message.IsTypedMessage)
key = message.MessageType.FullName + ":" + IsEncoded + ":" + IsRpc;
XmlMembersMapping headersMapping = LoadHeadersMapping(message, key + ":Headers");
info.SetHeaders(parent.generation.AddSerializer(headersMapping));
MessagePartDescriptionCollection rpcEncodedTypedMessgeBodyParts;
info.SetBody(parent.generation.AddSerializer(LoadBodyMapping(message, key, out rpcEncodedTypedMessgeBodyParts)), rpcEncodedTypedMessgeBodyParts);
CreateHeaderDescriptionTable(message, info, headersMapping);
return info;
}
private void CreateHeaderDescriptionTable(MessageDescription message, MessageInfo info, XmlMembersMapping headersMapping)
{
int headerNameIndex = 0;
OperationFormatter.MessageHeaderDescriptionTable headerDescriptionTable = new OperationFormatter.MessageHeaderDescriptionTable();
info.SetHeaderDescriptionTable(headerDescriptionTable);
foreach (MessageHeaderDescription header in message.Headers)
{
if (header.IsUnknownHeaderCollection)
info.SetUnknownHeaderDescription(header);
else if (headersMapping != null)
{
XmlMemberMapping memberMapping = headersMapping[headerNameIndex++];
string headerName, headerNs;
if (IsEncoded)
{
headerName = memberMapping.TypeName;
headerNs = memberMapping.TypeNamespace;
}
else
{
headerName = memberMapping.XsdElementName;
headerNs = memberMapping.Namespace;
}
if (headerName != header.Name)
{
if (message.MessageType != null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxHeaderNameMismatchInMessageContract, message.MessageType, header.MemberInfo.Name, header.Name, headerName)));
else
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxHeaderNameMismatchInOperation, Operation.Name, Operation.DeclaringContract.Name, Operation.DeclaringContract.Namespace, header.Name, headerName)));
}
if (headerNs != header.Namespace)
{
if (message.MessageType != null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxHeaderNamespaceMismatchInMessageContract, message.MessageType, header.MemberInfo.Name, header.Namespace, headerNs)));
else
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxHeaderNamespaceMismatchInOperation, Operation.Name, Operation.DeclaringContract.Name, Operation.DeclaringContract.Namespace, header.Namespace, headerNs)));
}
headerDescriptionTable.Add(headerName, headerNs, header);
}
}
}
XmlMembersMapping LoadBodyMapping(MessageDescription message, string mappingKey, out MessagePartDescriptionCollection rpcEncodedTypedMessageBodyParts)
{
MessagePartDescription returnPart;
string wrapperName, wrapperNs;
MessagePartDescriptionCollection bodyParts;
if (IsEncoded && message.IsTypedMessage && message.Body.WrapperName == null)
{
MessagePartDescription wrapperPart = GetWrapperPart(message);
returnPart = null;
rpcEncodedTypedMessageBodyParts = bodyParts = GetWrappedParts(wrapperPart);
wrapperName = wrapperPart.Name;
wrapperNs = wrapperPart.Namespace;
}
else
{
rpcEncodedTypedMessageBodyParts = null;
returnPart = OperationFormatter.IsValidReturnValue(message.Body.ReturnValue) ? message.Body.ReturnValue : null;
bodyParts = message.Body.Parts;
wrapperName = message.Body.WrapperName;
wrapperNs = message.Body.WrapperNamespace;
}
bool isWrapped = (wrapperName != null);
bool hasReturnValue = returnPart != null;
int paramCount = bodyParts.Count + (hasReturnValue ? 1 : 0);
if (paramCount == 0 && !isWrapped) // no need to create serializer
{
return null;
}
XmlReflectionMember[] members = new XmlReflectionMember[paramCount];
int paramIndex = 0;
if (hasReturnValue)
members[paramIndex++] = XmlSerializerHelper.GetXmlReflectionMember(returnPart, IsRpc, IsEncoded, isWrapped);
for (int i = 0; i < bodyParts.Count; i++)
members[paramIndex++] = XmlSerializerHelper.GetXmlReflectionMember(bodyParts[i], IsRpc, IsEncoded, isWrapped);
if (!isWrapped)
wrapperNs = ContractNamespace;
return ImportMembersMapping(wrapperName, wrapperNs, members, isWrapped, IsRpc, mappingKey);
}
private MessagePartDescription GetWrapperPart(MessageDescription message)
{
if (message.Body.Parts.Count != 1)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxRpcMessageMustHaveASingleBody, Operation.Name, message.MessageName)));
MessagePartDescription bodyPart = message.Body.Parts[0];
Type bodyObjectType = bodyPart.Type;
if (bodyObjectType.GetTypeInfo().BaseType != null && bodyObjectType.GetTypeInfo().BaseType != typeof(object))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxBodyObjectTypeCannotBeInherited, bodyObjectType.FullName)));
if (typeof(IEnumerable).IsAssignableFrom(bodyObjectType))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxBodyObjectTypeCannotBeInterface, bodyObjectType.FullName, typeof(IEnumerable).FullName)));
if (typeof(IXmlSerializable).IsAssignableFrom(bodyObjectType))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxBodyObjectTypeCannotBeInterface, bodyObjectType.FullName, typeof(IXmlSerializable).FullName)));
return bodyPart;
}
private MessagePartDescriptionCollection GetWrappedParts(MessagePartDescription bodyPart)
{
Type bodyObjectType = bodyPart.Type;
MessagePartDescriptionCollection partList = new MessagePartDescriptionCollection();
foreach (MemberInfo member in bodyObjectType.GetMembers(BindingFlags.Instance | BindingFlags.Public))
{
if ((member as PropertyInfo) == null && (member as FieldInfo) == null)
continue;
// TODO: SoapIgnoreAttribute is in 1.7
//if (member.IsDefined(typeof(SoapIgnoreAttribute), false/*inherit*/))
// continue;
XmlName xmlName = new XmlName(member.Name);
MessagePartDescription part = new MessagePartDescription(xmlName.EncodedName, string.Empty);
part.AdditionalAttributesProvider = part.MemberInfo = member;
part.Index = part.SerializationPosition = partList.Count;
part.Type = (member is PropertyInfo) ? ((PropertyInfo)member).PropertyType : ((FieldInfo)member).FieldType;
partList.Add(part);
}
return partList;
}
XmlMembersMapping LoadHeadersMapping(MessageDescription message, string mappingKey)
{
int headerCount = message.Headers.Count;
if (headerCount == 0)
return null;
if (IsEncoded)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxHeadersAreNotSupportedInEncoded, message.MessageName)));
int unknownHeaderCount = 0, headerIndex = 0;
XmlReflectionMember[] members = new XmlReflectionMember[headerCount];
for (int i = 0; i < headerCount; i++)
{
MessageHeaderDescription header = message.Headers[i];
if (!header.IsUnknownHeaderCollection)
{
members[headerIndex++] = XmlSerializerHelper.GetXmlReflectionMember(header, false/*isRpc*/, IsEncoded, false/*isWrapped*/);
}
else
{
unknownHeaderCount++;
}
}
if (unknownHeaderCount == headerCount)
{
return null;
}
if (unknownHeaderCount > 0)
{
XmlReflectionMember[] newMembers = new XmlReflectionMember[headerCount - unknownHeaderCount];
Array.Copy(members, newMembers, newMembers.Length);
members = newMembers;
}
return ImportMembersMapping(ContractName, ContractNamespace, members, false /*isWrapped*/, false /*isRpc*/, mappingKey);
}
internal XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, string mappingKey)
{
string key = mappingKey.StartsWith(":", StringComparison.Ordinal) ? keyBase + mappingKey : mappingKey;
return parent.importer.ImportMembersMapping(new XmlName(elementName, true /*isEncoded*/), ns, members, hasWrapperElement, rpc, IsEncoded, key);
}
internal XmlMembersMapping ImportFaultElement(FaultDescription fault, out XmlQualifiedName elementName)
{
// the number of reflection members is always 1 because there is only one fault detail type
XmlReflectionMember[] members = new XmlReflectionMember[1];
XmlName faultElementName = fault.ElementName;
string faultNamespace = fault.Namespace;
if (faultElementName == null)
{
XmlTypeMapping mapping = parent.importer.ImportTypeMapping(fault.DetailType, IsEncoded);
faultElementName = new XmlName(mapping.ElementName, IsEncoded);
faultNamespace = mapping.Namespace;
if (faultElementName == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxFaultTypeAnonymous, Operation.Name, fault.DetailType.FullName)));
}
elementName = new XmlQualifiedName(faultElementName.DecodedName, faultNamespace);
members[0] = XmlSerializerHelper.GetXmlReflectionMember(null /*memberName*/, faultElementName, faultNamespace, fault.DetailType,
null /*additionalAttributesProvider*/, false /*isMultiple*/, IsEncoded, false /*isWrapped*/);
string mappingKey = "fault:" + faultElementName.DecodedName + ":" + faultNamespace;
return ImportMembersMapping(faultElementName.EncodedName, faultNamespace, members, false /*hasWrapperElement*/, IsRpc, mappingKey);
}
}
class XmlSerializerImporter
{
readonly string defaultNs;
XmlReflectionImporter xmlImporter;
// TODO: Available in 1.7
//SoapReflectionImporter soapImporter;
Dictionary<string, XmlMembersMapping> xmlMappings;
internal XmlSerializerImporter(string defaultNs)
{
this.defaultNs = defaultNs;
xmlImporter = null;
//this.soapImporter = null;
}
//SoapReflectionImporter SoapImporter
//{
// get
// {
// if (this.soapImporter == null)
// {
// this.soapImporter = new SoapReflectionImporter(NamingHelper.CombineUriStrings(defaultNs, "encoded"));
// }
// return this.soapImporter;
// }
//}
XmlReflectionImporter XmlImporter
{
get
{
if (xmlImporter == null)
{
xmlImporter = new XmlReflectionImporter(defaultNs);
}
return xmlImporter;
}
}
Dictionary<string, XmlMembersMapping> XmlMappings
{
get
{
if (xmlMappings == null)
{
xmlMappings = new Dictionary<string, XmlMembersMapping>();
}
return xmlMappings;
}
}
internal XmlMembersMapping ImportMembersMapping(XmlName elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool isEncoded, string mappingKey)
{
XmlMembersMapping mapping;
string mappingName = elementName.DecodedName;
if (XmlMappings.TryGetValue(mappingKey, out mapping))
{
return mapping;
}
if (isEncoded)
throw new PlatformNotSupportedException();
//mapping = this.SoapImporter.ImportMembersMapping(mappingName, ns, members, hasWrapperElement, rpc);
else
mapping = XmlImporter.ImportMembersMapping(mappingName, ns, members, hasWrapperElement, rpc);
mapping.SetKey(mappingKey);
XmlMappings.Add(mappingKey, mapping);
return mapping;
}
internal XmlTypeMapping ImportTypeMapping(Type type, bool isEncoded)
{
if (isEncoded)
throw new PlatformNotSupportedException();
//return this.SoapImporter.ImportTypeMapping(type);
else
return XmlImporter.ImportTypeMapping(type);
}
internal void IncludeType(Type knownType, bool isEncoded)
{
if (isEncoded)
throw new PlatformNotSupportedException();
//this.SoapImporter.IncludeType(knownType);
else
XmlImporter.IncludeType(knownType);
}
}
internal class SerializerGenerationContext
{
List<XmlMembersMapping> Mappings = new List<XmlMembersMapping>();
XmlSerializer[] serializers = null;
Type type;
object thisLock = new object();
internal SerializerGenerationContext(Type type)
{
this.type = type;
}
// returns a stub to a serializer
internal SerializerStub AddSerializer(XmlMembersMapping mapping)
{
int handle = -1;
if (mapping != null)
{
handle = ((IList)Mappings).Add(mapping);
}
return new SerializerStub(this, mapping, handle);
}
internal XmlSerializer GetSerializer(int handle)
{
if (handle < 0)
{
return null;
}
if (serializers == null)
{
lock (thisLock)
{
if (serializers == null)
{
serializers = GenerateSerializers();
}
}
}
return serializers[handle];
}
XmlSerializer[] GenerateSerializers()
{
//this.Mappings may have duplicate mappings (for e.g. samed message contract is used by more than one operation)
//XmlSerializer.FromMappings require unique mappings. The following code uniquifies, calls FromMappings and deuniquifies
List<XmlMembersMapping> uniqueMappings = new List<XmlMembersMapping>();
int[] uniqueIndexes = new int[Mappings.Count];
for (int srcIndex = 0; srcIndex < Mappings.Count; srcIndex++)
{
XmlMembersMapping mapping = Mappings[srcIndex];
int uniqueIndex = uniqueMappings.IndexOf(mapping);
if (uniqueIndex < 0)
{
uniqueMappings.Add(mapping);
uniqueIndex = uniqueMappings.Count - 1;
}
uniqueIndexes[srcIndex] = uniqueIndex;
}
XmlSerializer[] uniqueSerializers = CreateSerializersFromMappings(uniqueMappings.ToArray(), type);
if (uniqueMappings.Count == Mappings.Count)
return uniqueSerializers;
XmlSerializer[] serializers = new XmlSerializer[Mappings.Count];
for (int i = 0; i < Mappings.Count; i++)
{
serializers[i] = uniqueSerializers[uniqueIndexes[i]];
}
return serializers;
}
XmlSerializer[] CreateSerializersFromMappings(XmlMapping[] mappings, Type type)
{
return XmlSerializer.FromMappings(mappings, type);
}
}
internal struct SerializerStub
{
readonly SerializerGenerationContext context;
internal readonly XmlMembersMapping Mapping;
internal readonly int Handle;
internal SerializerStub(SerializerGenerationContext context, XmlMembersMapping mapping, int handle)
{
this.context = context;
Mapping = mapping;
Handle = handle;
}
internal XmlSerializer GetSerializer()
{
return context.GetSerializer(Handle);
}
}
internal class XmlSerializerFaultContractInfo
{
FaultContractInfo faultContractInfo;
SerializerStub serializerStub;
XmlQualifiedName faultContractElementName;
XmlSerializerObjectSerializer serializer;
internal XmlSerializerFaultContractInfo(FaultContractInfo faultContractInfo, SerializerStub serializerStub,
XmlQualifiedName faultContractElementName)
{
if (faultContractInfo == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("faultContractInfo");
}
if (faultContractElementName == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("faultContractElementName");
}
this.faultContractInfo = faultContractInfo;
this.serializerStub = serializerStub;
this.faultContractElementName = faultContractElementName;
}
internal FaultContractInfo FaultContractInfo
{
get { return faultContractInfo; }
}
internal XmlQualifiedName FaultContractElementName
{
get { return faultContractElementName; }
}
internal XmlSerializerObjectSerializer Serializer
{
get
{
if (serializer == null)
serializer = new XmlSerializerObjectSerializer(faultContractInfo.Detail, faultContractElementName, serializerStub.GetSerializer());
return serializer;
}
}
}
internal class MessageInfo : XmlSerializerOperationFormatter.MessageInfo
{
SerializerStub headers;
SerializerStub body;
OperationFormatter.MessageHeaderDescriptionTable headerDescriptionTable;
MessageHeaderDescription unknownHeaderDescription;
MessagePartDescriptionCollection rpcEncodedTypedMessageBodyParts;
internal XmlMembersMapping BodyMapping
{
get { return body.Mapping; }
}
internal override XmlSerializer BodySerializer
{
get { return body.GetSerializer(); }
}
internal XmlMembersMapping HeadersMapping
{
get { return headers.Mapping; }
}
internal override XmlSerializer HeaderSerializer
{
get { return headers.GetSerializer(); }
}
internal override OperationFormatter.MessageHeaderDescriptionTable HeaderDescriptionTable
{
get { return headerDescriptionTable; }
}
internal override MessageHeaderDescription UnknownHeaderDescription
{
get { return unknownHeaderDescription; }
}
internal override MessagePartDescriptionCollection RpcEncodedTypedMessageBodyParts
{
get { return rpcEncodedTypedMessageBodyParts; }
}
internal void SetBody(SerializerStub body, MessagePartDescriptionCollection rpcEncodedTypedMessageBodyParts)
{
this.body = body;
this.rpcEncodedTypedMessageBodyParts = rpcEncodedTypedMessageBodyParts;
}
internal void SetHeaders(SerializerStub headers)
{
this.headers = headers;
}
internal void SetHeaderDescriptionTable(OperationFormatter.MessageHeaderDescriptionTable headerDescriptionTable)
{
this.headerDescriptionTable = headerDescriptionTable;
}
internal void SetUnknownHeaderDescription(MessageHeaderDescription unknownHeaderDescription)
{
this.unknownHeaderDescription = unknownHeaderDescription;
}
}
}
}
static class XmlSerializerHelper
{
static internal XmlReflectionMember GetXmlReflectionMember(MessagePartDescription part, bool isRpc, bool isEncoded, bool isWrapped)
{
string ns = isRpc ? null : part.Namespace;
MemberInfo additionalAttributesProvider = null;
if (part.AdditionalAttributesProvider.MemberInfo != null)
additionalAttributesProvider = part.AdditionalAttributesProvider.MemberInfo;
XmlName memberName = string.IsNullOrEmpty(part.UniquePartName) ? null : new XmlName(part.UniquePartName, true /*isEncoded*/);
XmlName elementName = part.XmlName;
return GetXmlReflectionMember(memberName, elementName, ns, part.Type, additionalAttributesProvider, part.Multiple, isEncoded, isWrapped);
}
static internal XmlReflectionMember GetXmlReflectionMember(XmlName memberName, XmlName elementName, string ns, Type type, MemberInfo additionalAttributesProvider, bool isMultiple, bool isEncoded, bool isWrapped)
{
if (isEncoded && isMultiple)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxMultiplePartsNotAllowedInEncoded, elementName.DecodedName, ns)));
XmlReflectionMember member = new XmlReflectionMember();
member.MemberName = (memberName ?? elementName).DecodedName;
member.MemberType = type;
if (member.MemberType.IsByRef)
member.MemberType = member.MemberType.GetElementType();
if (isMultiple)
member.MemberType = member.MemberType.MakeArrayType();
if (additionalAttributesProvider != null)
{
if (isEncoded)
throw new PlatformNotSupportedException();
//member.SoapAttributes = new SoapAttributes(additionalAttributesProvider);
else
member.XmlAttributes = new XmlAttributes(additionalAttributesProvider);
}
if (isEncoded)
{
throw new PlatformNotSupportedException();
}
else
{
if (member.XmlAttributes == null)
member.XmlAttributes = new XmlAttributes();
else
{
Type invalidAttributeType = null;
if (member.XmlAttributes.XmlAttribute != null)
invalidAttributeType = typeof(XmlAttributeAttribute);
else if (member.XmlAttributes.XmlAnyAttribute != null && !isWrapped)
invalidAttributeType = typeof(XmlAnyAttributeAttribute);
else if (member.XmlAttributes.XmlChoiceIdentifier != null)
invalidAttributeType = typeof(XmlChoiceIdentifierAttribute);
else if (member.XmlAttributes.XmlIgnore)
invalidAttributeType = typeof(XmlIgnoreAttribute);
else if (member.XmlAttributes.Xmlns)
invalidAttributeType = typeof(XmlNamespaceDeclarationsAttribute);
else if (member.XmlAttributes.XmlText != null)
invalidAttributeType = typeof(XmlTextAttribute);
else if (member.XmlAttributes.XmlEnum != null)
invalidAttributeType = typeof(XmlEnumAttribute);
if (invalidAttributeType != null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(isWrapped ? SR.SFxInvalidXmlAttributeInWrapped : SR.SFxInvalidXmlAttributeInBare, invalidAttributeType, elementName.DecodedName)));
if (member.XmlAttributes.XmlArray != null && isMultiple)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxXmlArrayNotAllowedForMultiple, elementName.DecodedName, ns)));
}
bool isArray = member.MemberType.IsArray;
if ((isArray && !isMultiple && member.MemberType != typeof(byte[])) ||
(!isArray && typeof(IEnumerable).IsAssignableFrom(member.MemberType) && member.MemberType != typeof(string) && !typeof(XmlNode).IsAssignableFrom(member.MemberType) && !typeof(IXmlSerializable).IsAssignableFrom(member.MemberType)))
{
if (member.XmlAttributes.XmlArray != null)
{
if (member.XmlAttributes.XmlArray.ElementName == string.Empty)
member.XmlAttributes.XmlArray.ElementName = elementName.DecodedName;
if (member.XmlAttributes.XmlArray.Namespace == null)
member.XmlAttributes.XmlArray.Namespace = ns;
}
else if (HasNoXmlParameterAttributes(member.XmlAttributes))
{
member.XmlAttributes.XmlArray = new XmlArrayAttribute();
member.XmlAttributes.XmlArray.ElementName = elementName.DecodedName;
member.XmlAttributes.XmlArray.Namespace = ns;
}
}
else
{
if (member.XmlAttributes.XmlElements == null || member.XmlAttributes.XmlElements.Count == 0)
{
if (HasNoXmlParameterAttributes(member.XmlAttributes))
{
XmlElementAttribute elementAttribute = new XmlElementAttribute();
elementAttribute.ElementName = elementName.DecodedName;
elementAttribute.Namespace = ns;
member.XmlAttributes.XmlElements.Add(elementAttribute);
}
}
else
{
foreach (XmlElementAttribute elementAttribute in member.XmlAttributes.XmlElements)
{
if (elementAttribute.ElementName == string.Empty)
elementAttribute.ElementName = elementName.DecodedName;
if (elementAttribute.Namespace == null)
elementAttribute.Namespace = ns;
}
}
}
}
return member;
}
static bool HasNoXmlParameterAttributes(XmlAttributes xmlAttributes)
{
return xmlAttributes.XmlAnyAttribute == null &&
(xmlAttributes.XmlAnyElements == null || xmlAttributes.XmlAnyElements.Count == 0) &&
xmlAttributes.XmlArray == null &&
xmlAttributes.XmlAttribute == null &&
!xmlAttributes.XmlIgnore &&
xmlAttributes.XmlText == null &&
xmlAttributes.XmlChoiceIdentifier == null &&
(xmlAttributes.XmlElements == null || xmlAttributes.XmlElements.Count == 0) &&
!xmlAttributes.Xmlns;
}
}
} | 48.951382 | 295 | 0.55739 | [
"MIT"
] | 0x53A/CoreWCF | src/CoreWCF.Primitives/src/CoreWCF/Description/XmlSerializerOperationBehavior.cs | 51,352 | C# |
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Gov.Jag.PillPressRegistry.Interfaces
{
using Microsoft.Rest;
using Models;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Complaintqueueitems operations.
/// </summary>
public partial class Complaintqueueitems : IServiceOperations<DynamicsClient>, IComplaintqueueitems
{
/// <summary>
/// Initializes a new instance of the Complaintqueueitems class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public Complaintqueueitems(DynamicsClient client)
{
if (client == null)
{
throw new System.ArgumentNullException("client");
}
Client = client;
}
/// <summary>
/// Gets a reference to the DynamicsClient
/// </summary>
public DynamicsClient Client { get; private set; }
/// <summary>
/// Get bcgov_complaint_QueueItems from bcgov_complaints
/// </summary>
/// <param name='bcgovComplaintid'>
/// key: bcgov_complaintid of bcgov_complaint
/// </param>
/// <param name='top'>
/// </param>
/// <param name='skip'>
/// </param>
/// <param name='search'>
/// </param>
/// <param name='filter'>
/// </param>
/// <param name='count'>
/// </param>
/// <param name='orderby'>
/// Order items by property values
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse<MicrosoftDynamicsCRMqueueitemCollection>> GetWithHttpMessagesAsync(string bcgovComplaintid, int? top = default(int?), int? skip = default(int?), string search = default(string), string filter = default(string), bool? count = default(bool?), IList<string> orderby = default(IList<string>), IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (bcgovComplaintid == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "bcgovComplaintid");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("bcgovComplaintid", bcgovComplaintid);
tracingParameters.Add("top", top);
tracingParameters.Add("skip", skip);
tracingParameters.Add("search", search);
tracingParameters.Add("filter", filter);
tracingParameters.Add("count", count);
tracingParameters.Add("orderby", orderby);
tracingParameters.Add("select", select);
tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "bcgov_complaints({bcgov_complaintid})/bcgov_complaint_QueueItems").ToString();
_url = _url.Replace("{bcgov_complaintid}", System.Uri.EscapeDataString(bcgovComplaintid));
List<string> _queryParameters = new List<string>();
if (top != null)
{
_queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
}
if (skip != null)
{
_queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
}
if (search != null)
{
_queryParameters.Add(string.Format("$search={0}", System.Uri.EscapeDataString(search)));
}
if (filter != null)
{
_queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter)));
}
if (count != null)
{
_queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"'))));
}
if (orderby != null)
{
_queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(string.Join(",", orderby))));
}
if (select != null)
{
_queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(string.Join(",", select))));
}
if (expand != null)
{
_queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(string.Join(",", expand))));
}
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
if (_httpResponse.Content != null) {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
}
else {
_responseContent = string.Empty;
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new HttpOperationResponse<MicrosoftDynamicsCRMqueueitemCollection>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<MicrosoftDynamicsCRMqueueitemCollection>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
/// <summary>
/// Get bcgov_complaint_QueueItems from bcgov_complaints
/// </summary>
/// <param name='bcgovComplaintid'>
/// key: bcgov_complaintid of bcgov_complaint
/// </param>
/// <param name='queueitemid'>
/// key: queueitemid of queueitem
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse<MicrosoftDynamicsCRMqueueitem>> QueueItemsByKeyWithHttpMessagesAsync(string bcgovComplaintid, string queueitemid, IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (bcgovComplaintid == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "bcgovComplaintid");
}
if (queueitemid == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "queueitemid");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("bcgovComplaintid", bcgovComplaintid);
tracingParameters.Add("queueitemid", queueitemid);
tracingParameters.Add("select", select);
tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "QueueItemsByKey", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "bcgov_complaints({bcgov_complaintid})/bcgov_complaint_QueueItems({queueitemid})").ToString();
_url = _url.Replace("{bcgov_complaintid}", System.Uri.EscapeDataString(bcgovComplaintid));
_url = _url.Replace("{queueitemid}", System.Uri.EscapeDataString(queueitemid));
List<string> _queryParameters = new List<string>();
if (select != null)
{
_queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(string.Join(",", select))));
}
if (expand != null)
{
_queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(string.Join(",", expand))));
}
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
if (_httpResponse.Content != null) {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
}
else {
_responseContent = string.Empty;
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new HttpOperationResponse<MicrosoftDynamicsCRMqueueitem>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<MicrosoftDynamicsCRMqueueitem>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
}
}
| 44.618267 | 551 | 0.565662 | [
"Apache-2.0"
] | GeorgeWalker/jag-pill-press-registry | pill-press-interfaces/Dynamics-Autorest/Complaintqueueitems.cs | 19,052 | C# |
//namespace Tests.Linx.AsyncEnumerable
//{
// using global::Linx.AsyncEnumerable;
// using global::Linx.Testing;
// using System.Collections.Generic;
// using System.Diagnostics.CodeAnalysis;
// using System.Linq;
// using System.Text;
// using System.Threading;
// using System.Threading.Tasks;
// using Xunit;
// public sealed class GroupByTests
// {
// private static Task<string> Stringify(IAsyncEnumerable<(char, int)> source, CancellationToken token)
// => source.Aggregate(
// new StringBuilder(),
// (sb, x) =>
// {
// sb.Append(x.Item1);
// sb.Append(x.Item2);
// return sb;
// },
// sb => sb.ToString(),
// token);
// [Fact]
// public async Task Success()
// {
// var source = "Abracadabra".ToAsyncEnumerable().GroupBy(char.ToUpperInvariant);
// // run to end
// var r = await Stringify(source.Parallel(async (g, t) => (g.Key, Count: await g.Count(t)), true), default);
// Assert.Equal("A5B2R2C1D1", r);
// // dispose group early
// r = await Stringify(source.Parallel(async (g, t) => (g.Key, Count: await g.Take(3).Count(t)), true), default);
// Assert.Equal("A3B2R2C1D1", r);
// // dispose GroupBy early
// r = await Stringify(source.Take(3).Parallel(async (g, t) => (g.Key, Count: await g.Count(t)), true), default);
// Assert.Equal("A5B2R2", r);
// // cancel GroupBy
// r = await Stringify(source.Take(2).Parallel(async (g, t) => (g.Key, Count: await g.Take(1).Count(t)), true), default);
// Assert.Equal("A1B1", r);
// }
// [Fact]
// public async Task Error()
// {
// var source = TestSequence.Parse("Abracadabra#").GroupBy(char.ToUpperInvariant);
// var groups = new List<char>();
// async ValueTask<bool> Selector(IAsyncGrouping<char, char> g, CancellationToken t)
// {
// try
// {
// await g.IgnoreElements(t).ConfigureAwait(false);
// return false;
// }
// catch (TestException)
// {
// groups.Add(g.Key);
// throw;
// }
// }
// await Assert.ThrowsAsync<TestException>(() => source.Parallel(Selector).Any(default));
// groups.Sort();
// Assert.Equal("ABCDR", new string(groups.ToArray()));
// }
// [Fact]
// public async Task WhileEnumerated()
// {
// var result = await "ABabABababABababab".ToAsyncEnumerable()
// .GroupByWhileEnumerated(char.ToUpper)
// .Parallel(async (g, t) => new string(await g.TakeUntil(char.IsUpper).ToArray(t).ConfigureAwait(false)), true)
// .ToList(default);
// var expected = new[] { "A", "B", "aA", "bB", "aaA", "bbB", "aaa", "bbb" };
// Assert.True(expected.SequenceEqual(result));
// }
// }
//}
| 36.988506 | 132 | 0.500622 | [
"MIT"
] | tinudu/Linx | tests/Tests.Linx/AsyncEnumerable/GroupByTests.cs | 3,220 | C# |
using Sandbox;
using Sandbox.Hooks;
using Sandbox.UI;
using Sandbox.UI.Construct;
using System;
using System.Collections.Generic;
public partial class ScoreBoard<T> : Panel where T : ScoreBoardEntry, new()
{
public class ListGroup
{
public Panel Separator { get; set; }
public Label SeparatorLabel { get; set; }
public Panel ListCanvas { get; set; }
private string Name { get; set; }
public int Value { get; set; } = 0;
public ListGroup(string name)
{
Name = name;
}
public void UpdateValue(int value)
{
SeparatorLabel.SetText( Name + $" ({value})" );
if ( value == 0 )
ListCanvas.Style.Display = DisplayMode.None;
else ListCanvas.Style.Display = DisplayMode.Flex;
ListCanvas.Style.Dirty();
}
public void Init(string className)
{
Separator = ListCanvas.Add.Panel( "separator" );
SeparatorLabel = Separator.Add.Label( "", "separatorLabel" );
Separator.SetClass( className, true );
}
}
public Panel Canvas { get; protected set; }
Dictionary<int, T> Entries = new();
public Panel Header { get; protected set; }
public ListGroup TerrorListGroup { get; protected set; } = new("Terrorists");
public ListGroup MissingListGroup { get; protected set; } = new ("Missing In Action");
public ListGroup ConfirmedListGroup { get; protected set; } = new ("Confirmed Dead");
public ListGroup SpectatorListGroup { get; protected set; } = new ("Spectators");
public ScoreBoard()
{
StyleSheet.Load( "/ui/ScoreBoard.scss" );
AddClass( "scoreboard" );
Add.Label( "You are playing on...", "playingOn" );
var serverBar = Add.Panel( "serverBar" );
serverBar.Add.Label( "Trouble In Terrorist Town", "serverName" );
// edit that later?
Add.Image( "images/logo.png", "logo" );
AddHeader();
Canvas = Add.Panel( "canvas" );
PlayerScore.OnPlayerAdded += AddPlayer;
PlayerScore.OnPlayerUpdated += UpdatePlayer;
PlayerScore.OnPlayerRemoved += RemovePlayer;
TerrorListGroup.ListCanvas = Canvas.Add.Panel( "playersList" );
MissingListGroup.ListCanvas = Canvas.Add.Panel( "playersList" );
ConfirmedListGroup.ListCanvas = Canvas.Add.Panel( "playersList" );
SpectatorListGroup.ListCanvas = Canvas.Add.Panel( "playersList" );
TerrorListGroup.Init( "terror" );
MissingListGroup.Init( "mia" );
ConfirmedListGroup.Init( "confirmed" );
SpectatorListGroup.Init( "spectators" );
TerrorListGroup.UpdateValue( 0 );
MissingListGroup.UpdateValue( 0 );
ConfirmedListGroup.UpdateValue( 0 );
SpectatorListGroup.UpdateValue( 0 );
foreach ( var player in PlayerScore.All )
{
AddPlayer( player );
}
}
public override void Tick()
{
base.Tick();
SetClass( "open", Input.Down( InputButton.Score ) );
}
protected virtual void AddHeader()
{
Header = Add.Panel( "header" );
Header.Add.Panel( "name" );
var Details = Header.Add.Panel( "detailsList" );
Details.Add.Label( "Karma", "karma" ).SetClass("noBack", true);
Details.Add.Label( "Score", "score" ).SetClass( "noBack", true );
Details.Add.Label( "Deaths", "deaths" ).SetClass( "noBack", true );
Details.Add.Label( "Ping", "ping" ).SetClass( "noBack", true );
}
protected virtual void AddPlayer( Sandbox.PlayerScore.Entry entry )
{
var scoreboardGroup = entry.Get<Player.ScoreboardGroup>( "state", Player.ScoreboardGroup.Spectator );
ListGroup targetPanel = SpectatorListGroup;
switch ( scoreboardGroup )
{
case Player.ScoreboardGroup.Terror:
targetPanel = TerrorListGroup;
break;
case Player.ScoreboardGroup.Found:
targetPanel = ConfirmedListGroup;
break;
case Player.ScoreboardGroup.NotFound:
targetPanel = MissingListGroup;
break;
case Player.ScoreboardGroup.Spectator:
targetPanel = SpectatorListGroup;
break;
}
targetPanel.UpdateValue( ++targetPanel.Value );
var p = targetPanel.ListCanvas.AddChild<T>();
p.UpdateFrom( entry );
Entries[entry.Id] = p;
}
protected virtual void UpdatePlayer( Sandbox.PlayerScore.Entry entry )
{
var scoreboardGroup = entry.Get<Player.ScoreboardGroup>( "state", Player.ScoreboardGroup.Spectator );
if ( Entries.TryGetValue( entry.Id, out var panel ) )
{
ListGroup targetPanel = SpectatorListGroup;
switch(scoreboardGroup)
{
case Player.ScoreboardGroup.Terror:
targetPanel = TerrorListGroup;
break;
case Player.ScoreboardGroup.Found:
targetPanel = ConfirmedListGroup;
break;
case Player.ScoreboardGroup.NotFound:
targetPanel = MissingListGroup;
break;
case Player.ScoreboardGroup.Spectator:
targetPanel = SpectatorListGroup;
break;
}
RemovePlayer( entry );
AddPlayer( entry );
panel.UpdateFrom( entry );
}
}
protected virtual void RemovePlayer( Sandbox.PlayerScore.Entry entry )
{
if ( Entries.TryGetValue( entry.Id, out var panel ) )
{
if ( TerrorListGroup.ListCanvas == panel.Parent ) TerrorListGroup.UpdateValue( --TerrorListGroup.Value );
if ( MissingListGroup.ListCanvas == panel.Parent ) MissingListGroup.UpdateValue( --MissingListGroup.Value );
if ( ConfirmedListGroup.ListCanvas == panel.Parent ) ConfirmedListGroup.UpdateValue( --ConfirmedListGroup.Value );
if ( SpectatorListGroup.ListCanvas == panel.Parent ) SpectatorListGroup.UpdateValue( --SpectatorListGroup.Value );
panel.Delete();
Entries.Remove( entry.Id );
}
}
}
| 29.588889 | 117 | 0.704281 | [
"MIT"
] | Wubsy/SBox-TTT | code/ui/ScoreBoard.cs | 5,328 | C# |
#if WORKINPROGRESS
using System.Windows.Markup;
#if MIGRATION
namespace System.Windows.Media.Animation
#else
namespace Windows.UI.Xaml.Media.Animation
#endif
{
[ContentProperty("KeyFrames")]
public sealed class PointAnimationUsingKeyFrames : Timeline
{
private PointKeyFrameCollection _keyFrames;
/// <summary>
/// Initializes a new instance of the <see cref="PointAnimationUsingKeyFrames"/>
/// class.
/// </summary>
public PointAnimationUsingKeyFrames()
{
}
/// <summary>
/// Gets the collection of <see cref="PointKeyFrame"/> objects that
/// define the animation.
/// </summary>
/// <returns>
/// The collection of <see cref="PointKeyFrame"/> objects that define
/// the animation. The default is an empty collection.
/// </returns>
public PointKeyFrameCollection KeyFrames
{
get
{
if (this._keyFrames == null)
{
this._keyFrames = new PointKeyFrameCollection();
}
return this._keyFrames;
}
}
}
}
#endif
| 25.270833 | 88 | 0.560594 | [
"MIT"
] | Talentia-Software-OSS/OpenSilver | src/Runtime/Runtime/Windows.UI.Xaml.Media.Animation/WORKINPROGRESS/PointAnimationUsingKeyFrames.cs | 1,215 | C# |
using SFA.DAS.AssessorService.Application.Api.External.Models.Internal;
using SFA.DAS.AssessorService.Application.Api.External.Models.Response;
using SFA.DAS.AssessorService.Application.Api.External.Models.Response.Standards;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace SFA.DAS.AssessorService.Application.Api.External.Infrastructure
{
public interface IApiClient
{
Task<GetLearnerResponse> GetLearner(GetBatchLearnerRequest request);
Task<IEnumerable<CreateEpaResponse>> CreateEpas(IEnumerable<CreateBatchEpaRequest> request);
Task<IEnumerable<UpdateEpaResponse>> UpdateEpas(IEnumerable<UpdateBatchEpaRequest> request);
Task<ApiResponse> DeleteEpa(DeleteBatchEpaRequest request);
Task<GetCertificateResponse> GetCertificate(GetBatchCertificateRequest request);
Task<IEnumerable<CreateCertificateResponse>> CreateCertificates(IEnumerable<CreateBatchCertificateRequest> request);
Task<IEnumerable<UpdateCertificateResponse>> UpdateCertificates(IEnumerable<UpdateBatchCertificateRequest> request);
Task<IEnumerable<SubmitCertificateResponse>> SubmitCertificates(IEnumerable<SubmitBatchCertificateRequest> request);
Task<ApiResponse> DeleteCertificate(DeleteBatchCertificateRequest request);
Task<IEnumerable<StandardOptions>> GetStandardOptionsForLatestStandardVersions();
Task<StandardOptions> GetStandardOptionsByStandard(string standard);
Task<StandardOptions> GetStandardOptionsByStandardIdAndVersion(string standard, string version);
}
} | 58.62963 | 124 | 0.81554 | [
"MIT"
] | SkillsFundingAgency/das-assessor-service | src/SFA.DAS.AssessorService.Application.Api.External/Infrastructure/IApiClient.cs | 1,585 | C# |
using System.Windows;
using bytePassion.CodeLineCounter.ViewModel;
namespace bytePassion.CodeLineCounter
{
public partial class App
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var mainWindowViewModel = new MainWindowViewModel();
var mainWindow = new MainWindow
{
DataContext = mainWindowViewModel
};
mainWindow.Show();
}
}
}
| 21.695652 | 64 | 0.579158 | [
"Apache-2.0"
] | bytePassion/CodeLineCounter | CodeLineCounter/App.xaml.cs | 501 | C# |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Models;
namespace ModelTests
{
[TestClass]
public class BreadTests
{
[TestMethod]
public void AddItems_AddThreeToQuantity_3()
{
Bread newBread = new Bread();
newBread.AddItems(3);
Assert.AreEqual(3, newBread.Quantity);
}
[TestMethod]
public void CalculateOrder_CalculateTotalCostOf3Breads_15()
{
Bread newBread = new Bread();
newBread.AddItems(3);
newBread.CalculateOrder();
Assert.AreEqual(15, newBread.TotalCost);
}
}
} | 22.48 | 63 | 0.679715 | [
"MIT"
] | jamisoncozart/Console-Bakery | Console-Bakery.Tests/ModelTests/BreadTests.cs | 562 | C# |
using J2N.Collections;
using Lucene.Net.Support;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace Lucene.Net.Search.Grouping
{
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <summary>
/// Represents result returned by a grouping search.
///
/// @lucene.experimental
/// </summary>
public class TopGroups<TGroupValue> : ITopGroups<TGroupValue>
{
/// <summary>
/// Number of documents matching the search </summary>
public int TotalHitCount { get; private set; }
/// <summary>
/// Number of documents grouped into the topN groups </summary>
public int TotalGroupedHitCount { get; private set; }
/// <summary>
/// The total number of unique groups. If <c>null</c> this value is not computed. </summary>
public int? TotalGroupCount { get; private set; }
/// <summary>
/// Group results in groupSort order </summary>
[WritableArray]
[SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
public IGroupDocs<TGroupValue>[] Groups { get; private set; }
/// <summary>
/// How groups are sorted against each other </summary>
[WritableArray]
[SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
public SortField[] GroupSort { get; private set; }
/// <summary>
/// How docs are sorted within each group </summary>
[WritableArray]
[SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
public SortField[] WithinGroupSort { get; private set; }
/// <summary>
/// Highest score across all hits, or
/// <see cref="float.NaN"/> if scores were not computed.
/// </summary>
public float MaxScore { get; private set; }
public TopGroups(SortField[] groupSort, SortField[] withinGroupSort, int totalHitCount, int totalGroupedHitCount, IGroupDocs<TGroupValue>[] groups, float maxScore)
{
GroupSort = groupSort;
WithinGroupSort = withinGroupSort;
TotalHitCount = totalHitCount;
TotalGroupedHitCount = totalGroupedHitCount;
Groups = groups;
TotalGroupCount = null;
MaxScore = maxScore;
}
public TopGroups(ITopGroups<TGroupValue> oldTopGroups, int? totalGroupCount)
{
GroupSort = oldTopGroups.GroupSort;
WithinGroupSort = oldTopGroups.WithinGroupSort;
TotalHitCount = oldTopGroups.TotalHitCount;
TotalGroupedHitCount = oldTopGroups.TotalGroupedHitCount;
Groups = oldTopGroups.Groups;
MaxScore = oldTopGroups.MaxScore;
TotalGroupCount = totalGroupCount;
}
}
/// <summary>
/// LUCENENET specific class used to nest types to mimic the syntax used
/// by Lucene (that is, without specifying the generic closing type of <see cref="TopGroups{TGroupValue}"/>)
/// </summary>
public class TopGroups
{
/// <summary>
/// Prevent direct creation
/// </summary>
private TopGroups() { }
/// <summary>
/// How the GroupDocs score (if any) should be merged. </summary>
public enum ScoreMergeMode
{
/// <summary>
/// Set score to Float.NaN
/// </summary>
None,
/// <summary>
/// Sum score across all shards for this group.
/// </summary>
Total,
/// <summary>
/// Avg score across all shards for this group.
/// </summary>
Avg,
}
/// <summary>
/// Merges an array of TopGroups, for example obtained from the second-pass
/// collector across multiple shards. Each TopGroups must have been sorted by the
/// same groupSort and docSort, and the top groups passed to all second-pass
/// collectors must be the same.
///
/// <b>NOTE</b>: We can't always compute an exact totalGroupCount.
/// Documents belonging to a group may occur on more than
/// one shard and thus the merged totalGroupCount can be
/// higher than the actual totalGroupCount. In this case the
/// totalGroupCount represents a upper bound. If the documents
/// of one group do only reside in one shard then the
/// totalGroupCount is exact.
///
/// <b>NOTE</b>: the topDocs in each GroupDocs is actually
/// an instance of TopDocsAndShards
/// </summary>
public static TopGroups<T> Merge<T>(ITopGroups<T>[] shardGroups, Sort groupSort, Sort docSort, int docOffset, int docTopN, ScoreMergeMode scoreMergeMode)
{
//System.out.println("TopGroups.merge");
if (shardGroups.Length == 0)
{
return null;
}
// LUCENENET specific - store whether T is value type
// for optimization of GetHashCode() and Equals()
bool shardGroupsIsValueType = typeof(T).IsValueType;
int totalHitCount = 0;
int totalGroupedHitCount = 0;
// Optionally merge the totalGroupCount.
int? totalGroupCount = null;
int numGroups = shardGroups[0].Groups.Length;
foreach (var shard in shardGroups)
{
if (numGroups != shard.Groups.Length)
{
throw new ArgumentException("number of groups differs across shards; you must pass same top groups to all shards' second-pass collector");
}
totalHitCount += shard.TotalHitCount;
totalGroupedHitCount += shard.TotalGroupedHitCount;
if (shard.TotalGroupCount != null)
{
if (totalGroupCount == null)
{
totalGroupCount = 0;
}
totalGroupCount += shard.TotalGroupCount;
}
}
var mergedGroupDocs = new GroupDocs<T>[numGroups];
TopDocs[] shardTopDocs = new TopDocs[shardGroups.Length];
float totalMaxScore = float.MinValue;
for (int groupIDX = 0; groupIDX < numGroups; groupIDX++)
{
T groupValue = shardGroups[0].Groups[groupIDX].GroupValue;
//System.out.println(" merge groupValue=" + groupValue + " sortValues=" + Arrays.toString(shardGroups[0].groups[groupIDX].groupSortValues));
float maxScore = float.MinValue;
int totalHits = 0;
double scoreSum = 0.0;
for (int shardIdx = 0; shardIdx < shardGroups.Length; shardIdx++)
{
//System.out.println(" shard=" + shardIDX);
ITopGroups<T> shard = shardGroups[shardIdx];
var shardGroupDocs = shard.Groups[groupIDX];
if (groupValue == null)
{
if (shardGroupDocs.GroupValue != null)
{
throw new ArgumentException("group values differ across shards; you must pass same top groups to all shards' second-pass collector");
}
}
// LUCENENET specific - use StructuralEqualityComparer.Default.Equals() if we have a reference type
// to ensure if it is a collection its contents are compared
else if (!(shardGroupsIsValueType ? groupValue.Equals(shardGroupDocs.GroupValue) : StructuralEqualityComparer.Default.Equals(groupValue, shardGroupDocs.GroupValue)))
{
throw new ArgumentException("group values differ across shards; you must pass same top groups to all shards' second-pass collector");
}
/*
for(ScoreDoc sd : shardGroupDocs.scoreDocs) {
System.out.println(" doc=" + sd.doc);
}
*/
shardTopDocs[shardIdx] = new TopDocs(shardGroupDocs.TotalHits, shardGroupDocs.ScoreDocs, shardGroupDocs.MaxScore);
maxScore = Math.Max(maxScore, shardGroupDocs.MaxScore);
totalHits += shardGroupDocs.TotalHits;
scoreSum += shardGroupDocs.Score;
}
TopDocs mergedTopDocs = TopDocs.Merge(docSort, docOffset + docTopN, shardTopDocs);
// Slice;
ScoreDoc[] mergedScoreDocs;
if (docOffset == 0)
{
mergedScoreDocs = mergedTopDocs.ScoreDocs;
}
else if (docOffset >= mergedTopDocs.ScoreDocs.Length)
{
mergedScoreDocs = new ScoreDoc[0];
}
else
{
mergedScoreDocs = new ScoreDoc[mergedTopDocs.ScoreDocs.Length - docOffset];
Array.Copy(mergedTopDocs.ScoreDocs, docOffset, mergedScoreDocs, 0, mergedTopDocs.ScoreDocs.Length - docOffset);
}
float groupScore;
switch (scoreMergeMode)
{
case ScoreMergeMode.None:
groupScore = float.NaN;
break;
case ScoreMergeMode.Avg:
if (totalHits > 0)
{
groupScore = (float)(scoreSum / totalHits);
}
else
{
groupScore = float.NaN;
}
break;
case ScoreMergeMode.Total:
groupScore = (float)scoreSum;
break;
default:
throw new ArgumentException("can't handle ScoreMergeMode " + scoreMergeMode);
}
//System.out.println("SHARDS=" + Arrays.toString(mergedTopDocs.shardIndex));
mergedGroupDocs[groupIDX] = new GroupDocs<T>(groupScore, maxScore, totalHits, mergedScoreDocs, groupValue, shardGroups[0].Groups[groupIDX].GroupSortValues);
totalMaxScore = Math.Max(totalMaxScore, maxScore);
}
if (totalGroupCount != null)
{
var result = new TopGroups<T>(groupSort.GetSort(), docSort == null ? null : docSort.GetSort(), totalHitCount, totalGroupedHitCount, mergedGroupDocs, totalMaxScore);
return new TopGroups<T>(result, totalGroupCount);
}
return new TopGroups<T>(groupSort.GetSort(), docSort == null ? null : docSort.GetSort(), totalHitCount, totalGroupedHitCount, mergedGroupDocs, totalMaxScore);
}
}
/// <summary>
/// LUCENENET specific interface used to provide covariance
/// with the TGroupValue type to simulate Java's wildcard generics.
/// </summary>
/// <typeparam name="TGroupValue"></typeparam>
public interface ITopGroups<out TGroupValue>
{
/// <summary>
/// Number of documents matching the search </summary>
int TotalHitCount { get; }
/// <summary>
/// Number of documents grouped into the topN groups </summary>
int TotalGroupedHitCount { get; }
/// <summary>
/// The total number of unique groups. If <c>null</c> this value is not computed. </summary>
int? TotalGroupCount { get; }
/// <summary>
/// Group results in groupSort order </summary>
IGroupDocs<TGroupValue>[] Groups { get; }
/// <summary>
/// How groups are sorted against each other </summary>
SortField[] GroupSort { get; }
/// <summary>
/// How docs are sorted within each group </summary>
SortField[] WithinGroupSort { get; }
/// <summary>
/// Highest score across all hits, or
/// <see cref="float.NaN"/> if scores were not computed.
/// </summary>
float MaxScore { get; }
}
} | 42.359873 | 185 | 0.566875 | [
"Apache-2.0"
] | Ref12/lucenenet | src/Lucene.Net.Grouping/TopGroups.cs | 13,303 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using NBi.Xml.Decoration.Condition;
namespace NBi.Xml.Decoration
{
public class ConditionXml
{
[
XmlElement(Type = typeof(ServiceRunningXml), ElementName = "service-running"),
XmlElement(Type = typeof(CustomConditionXml), ElementName = "custom")
]
public List<DecorationConditionXml> Predicates { get; set; }
public ConditionXml()
{
Predicates = new List<DecorationConditionXml>();
}
}
}
| 26.434783 | 91 | 0.628289 | [
"Apache-2.0"
] | CoolsJoris/NBi | NBi.Xml/Decoration/ConditionXml.cs | 610 | C# |
using Microsoft.VisualBasic.Activities;
using OpenRPA.Interfaces;
using System;
using System.Activities;
using System.Activities.Expressions;
using System.Activities.Presentation.Model;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace OpenRPA.Activities
{
public partial class OpenApplicationDesigner
{
public OpenApplicationDesigner()
{
InitializeComponent();
DataContext = this;
Loaded += (sender, e) =>
{
var Variables = ModelItem.Properties[nameof(OpenApplication.Variables)].Collection;
if (Variables != null && Variables.Count == 0)
{
Variables.Add(new Variable<int>("Index", 0));
Variables.Add(new Variable<int>("Total", 0));
}
};
}
private void Open_Selector(object sender, RoutedEventArgs e)
{
string SelectorString = ModelItem.GetValue<string>("Selector");
int maxresult = 1;
if (string.IsNullOrEmpty(SelectorString)) SelectorString = "[{Selector: 'Windows'}]";
var selector = new Interfaces.Selector.Selector(SelectorString);
var pluginname = selector.First().Selector;
var selectors = new Interfaces.Selector.SelectorWindow(pluginname, selector, maxresult);
// selectors.Owner = GenericTools.MainWindow; -- Locks up and never returns ?
if (selectors.ShowDialog() == true)
{
ModelItem.Properties["Selector"].SetValue(new InArgument<string>() { Expression = new Literal<string>(selectors.vm.json) });
var Plugin = Interfaces.Plugins.recordPlugins.Where(x => x.Name == pluginname).First();
var _base = Plugin.GetElementsWithSelector(selector, null, 10);
if (_base == null || _base.Length == 0) return;
var ele = _base[0];
if (ele != null && !(ele is UIElement))
{
var automation = AutomationUtil.getAutomation();
var p = new System.Drawing.Point(ele.Rectangle.X + 10, ele.Rectangle.Y + 10);
if (p.X > 0 && p.Y > 0)
{
var _temp = automation.FromPoint(p);
if (_temp != null)
{
ele = new UIElement(_temp);
}
}
}
if (ele is UIElement ui)
{
var window = ui.GetWindow();
if (window == null) return;
if (!string.IsNullOrEmpty(window.Name))
{
ModelItem.Properties["DisplayName"].SetValue(window.Name);
}
if (window.Properties.BoundingRectangle.IsSupported)
{
var bound = window.BoundingRectangle;
ModelItem.Properties["X"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.X) });
ModelItem.Properties["Y"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.Y) });
ModelItem.Properties["Width"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.Width) });
ModelItem.Properties["Height"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.Height) });
}
}
}
}
private async void Highlight_Click(object sender, RoutedEventArgs e)
{
string SelectorString = ModelItem.GetValue<string>("Selector");
int maxresults = 1;
var selector = new Interfaces.Selector.Selector(SelectorString);
var pluginname = selector.First().Selector;
var Plugin = Interfaces.Plugins.recordPlugins.Where(x => x.Name == pluginname).First();
var elements = Plugin.GetElementsWithSelector(selector, null, maxresults);
foreach (var ele in elements) await ele.Highlight(false, System.Drawing.Color.Red, TimeSpan.FromSeconds(1));
}
private void Select_Click(object sender, RoutedEventArgs e)
{
Interfaces.GenericTools.Minimize();
StartRecordPlugins();
}
private void StartRecordPlugins()
{
var p = Interfaces.Plugins.recordPlugins.Where(x => x.Name == "Windows").First();
p.OnUserAction += OnUserAction;
p.Start();
}
private void StopRecordPlugins()
{
var p = Interfaces.Plugins.recordPlugins.Where(x => x.Name == "Windows").First();
p.OnUserAction -= OnUserAction;
p.Stop();
}
public void OnUserAction(Interfaces.IRecordPlugin sender, Interfaces.IRecordEvent e)
{
StopRecordPlugins();
AutomationHelper.syncContext.Post(o =>
{
Interfaces.GenericTools.Restore();
foreach (var p in Interfaces.Plugins.recordPlugins)
{
if (p.Name != sender.Name)
{
if (p.ParseUserAction(ref e)) continue;
}
}
e.Selector.RemoveRange(2, e.Selector.Count - 2);
ModelItem.Properties["Selector"].SetValue(new InArgument<string>() { Expression = new Literal<string>(e.Selector.ToString()) });
var ele = e.Element;
if (ele != null && !(ele is UIElement))
{
var automation = AutomationUtil.getAutomation();
var p = new System.Drawing.Point(ele.Rectangle.X + 10, ele.Rectangle.Y + 10);
if (p.X > 0 && p.Y > 0)
{
var _temp = automation.FromPoint(p);
if (_temp != null)
{
ele = new UIElement(_temp);
}
}
}
if (ele is UIElement ui)
{
var window = ui.GetWindow();
if (window == null) return;
if (!string.IsNullOrEmpty(window.Name))
{
ModelItem.Properties["DisplayName"].SetValue(window.Name);
}
if (window.Properties.BoundingRectangle.IsSupported)
{
var bound = window.BoundingRectangle;
ModelItem.Properties["X"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.X) });
ModelItem.Properties["Y"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.Y) });
ModelItem.Properties["Width"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.Width) });
ModelItem.Properties["Height"].SetValue(new InArgument<int>() { Expression = new Literal<int>(bound.Height) });
}
}
}, null);
}
}
} | 45.808642 | 144 | 0.521763 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | SynergERP/openrpa | OpenRPA/Activities/OpenApplicationDesigner.xaml.cs | 7,423 | C# |
using System;
using NetOffice;
namespace NetOffice.VisioApi.Enums
{
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
[EntityTypeAttribute(EntityType.IsEnum)]
public enum VisGetSetArgs
{
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>0</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visGetFloats = 0,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>1</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visGetTruncatedInts = 1,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>2</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visGetRoundedInts = 2,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>3</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visGetStrings = 3,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>4</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visGetFormulas = 4,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>5</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visGetFormulasU = 5,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>1</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visSetFormulas = 1,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>2</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visSetBlastGuards = 2,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>4</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visSetTestCircular = 4,
/// <summary>
/// SupportByVersion Visio 11, 12, 14, 15, 16
/// </summary>
/// <remarks>8</remarks>
[SupportByVersionAttribute("Visio", 11,12,14,15,16)]
visSetUniversalSyntax = 8
}
} | 27.036585 | 55 | 0.617501 | [
"MIT"
] | Engineerumair/NetOffice | Source/Visio/Enums/VisGetSetArgs.cs | 2,217 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.