content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
using System.Collections.Generic;
using ESFA.DC.ILR.Tests.Model;
using ESFA.DC.ILR.ValidationService.Data.File.FileData.Interface;
using ESFA.DC.ILR.ValidationService.Interface;
using ESFA.DC.ILR.ValidationService.Rules.LearningDelivery.PartnerUKPRN;
using ESFA.DC.ILR.ValidationService.Rules.Tests.Abstract;
using FluentAssertions;
using Moq;
using Xunit;
namespace ESFA.DC.ILR.ValidationService.Rules.Tests.LearningDelivery.PartnerUKPRN
{
public class PartnerUKPRN_03RuleTests : AbstractRuleTests<PartnerUKPRN_03Rule>
{
[Fact]
public void RuleName()
{
NewRule().RuleName.Should().Be("PartnerUKPRN_03");
}
[Fact]
public void NullConditionMet_True()
{
NewRule().NullConditionMet(1).Should().BeTrue();
}
[Fact]
public void NullConditionMet_False()
{
NewRule().NullConditionMet(null).Should().BeFalse();
}
[Fact]
public void UKPRNConditionMet_False()
{
NewRule().UKPRNConditionMet(1, 2).Should().BeFalse();
}
[Fact]
public void UKPRNConditionMet_True()
{
NewRule().UKPRNConditionMet(1, 1).Should().BeTrue();
}
[Fact]
public void ConditionMet_False()
{
NewRule().ConditionMet(1, 2).Should().BeFalse();
}
[Fact]
public void ConditionMet_True()
{
NewRule().ConditionMet(1, 1).Should().BeTrue();
}
[Fact]
public void ConditionMet_False_NullUkprn()
{
NewRule().ConditionMet(1, null).Should().BeFalse();
}
[Fact]
public void Validate_Error()
{
var learner = new TestLearner
{
LearningDeliveries = new List<TestLearningDelivery>
{
new TestLearningDelivery()
{
PartnerUKPRNNullable = 1
}
}
};
var fileDataServiceMock = new Mock<IFileDataService>();
fileDataServiceMock.Setup(ds => ds.UKPRN()).Returns(1);
using (var validationErrorHandlerMock = BuildValidationErrorHandlerMockForError())
{
NewRule(fileDataServiceMock.Object, validationErrorHandlerMock.Object).Validate(learner);
}
}
[Fact]
public void Validate_NoError()
{
var learner = new TestLearner
{
LearningDeliveries = new List<TestLearningDelivery>
{
new TestLearningDelivery()
{
PartnerUKPRNNullable = 1
}
}
};
var fileDataServiceMock = new Mock<IFileDataService>();
fileDataServiceMock.Setup(ds => ds.UKPRN()).Returns(2);
using (var validationErrorHandlerMock = BuildValidationErrorHandlerMockForNoError())
{
NewRule(fileDataServiceMock.Object, validationErrorHandlerMock.Object).Validate(learner);
}
}
[Fact]
public void BuildErrorMessageParameters()
{
long ukprn = 1;
long? partnerUKPRN = 1;
var validationErrorHandlerMock = new Mock<IValidationErrorHandler>();
validationErrorHandlerMock.Setup(veh => veh.BuildErrorMessageParameter("UKPRN", ukprn)).Verifiable();
validationErrorHandlerMock.Setup(veh => veh.BuildErrorMessageParameter("PartnerUKPRN", partnerUKPRN)).Verifiable();
NewRule(validationErrorHandler: validationErrorHandlerMock.Object).BuildErrorMessageParameters(ukprn, partnerUKPRN);
validationErrorHandlerMock.Verify();
}
private PartnerUKPRN_03Rule NewRule(IFileDataService fileDatService = null, IValidationErrorHandler validationErrorHandler = null)
{
return new PartnerUKPRN_03Rule(fileDatService, validationErrorHandler);
}
}
}
| 30.759398 | 138 | 0.58592 | [
"MIT"
] | SkillsFundingAgency/DC-ILR-1819-ValidationService | src/ESFA.DC.ILR.ValidationService.Rules.Tests/LearningDelivery/PartnerUKPRN/PartnerUKPRN_03RuleTests.cs | 4,093 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BFF.Model;
using BFF.Model.Models;
using BFF.Persistence.Realm.ORM.Interfaces;
using BFF.Persistence.Realm.Repositories.ModelRepositories;
using MrMeeseeks.Extensions;
namespace BFF.Persistence.Realm.Models.Domain
{
internal class BudgetCategory : Model.Models.BudgetCategory
{
private readonly IBudgetOrm _budgetOrm;
private readonly IRealmBudgetEntryRepository _budgetEntryRepository;
public BudgetCategory(
// parameters
ICategory category,
// dependencies
IBudgetOrm budgetOrm,
IRealmBudgetEntryRepository budgetEntryRepository,
IObserveUpdateBudgetCategory observeUpdateBudgetCategory) : base(category, observeUpdateBudgetCategory)
{
_budgetOrm = budgetOrm;
_budgetEntryRepository = budgetEntryRepository;
}
public override async Task<IEnumerable<IBudgetEntry>> GetBudgetEntriesFor(int year)
{
var realmCategory = (Category as Category)?.RealmObject ?? throw new InvalidCastException("Should be the Realm type, but isn't.");
return await (await _budgetOrm.FindAsync(year, realmCategory).ConfigureAwait(false))
.Select(t =>
_budgetEntryRepository.Convert(
t.Entry,
realmCategory,
t.Data.Month,
t.Data.Budget,
t.Data.Outflow,
t.Data.Balance,
t.Data.AggregatedBudget,
t.Data.AggregatedOutflow,
t.Data.AggregatedBalance))
.ToAwaitableEnumerable()
.ConfigureAwait(false);
}
}
} | 37.6 | 142 | 0.610638 | [
"MIT"
] | Yeah69/BFF | Persistence/Realm/Models/Domain/BudgetCategory.cs | 1,880 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace Demo.Function.Movies.API.Data
{
public class Category
{
public int id { get; set; }
public string CategoryName { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
}
| 17.421053 | 48 | 0.628399 | [
"MIT"
] | rutzsco/nosql-openhack | Demo.Function.Movies.API/Data/Movie.cs | 333 | C# |
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using SteveTheTradeBot.Api.AppStartup;
using SteveTheTradeBot.Core.Components.Users;
using SteveTheTradeBot.Dal.Models.Auth;
using SteveTheTradeBot.Dal.Models.Users;
using Bumbershoot.Utilities.Helpers;
using IdentityModel;
using IdentityServer4;
using IdentityServer4.Extensions;
using IdentityServer4.Models;
using IdentityServer4.Services;
using IdentityServer4.Validation;
namespace SteveTheTradeBot.Api.Security
{
public class UserClaimProvider : IProfileService, IResourceOwnerPasswordValidator
{
private readonly IRoleManager _roleManager;
private readonly IUserLookup _userLookup;
public UserClaimProvider(IUserLookup userLookup, IRoleManager roleManager)
{
_userLookup = userLookup;
_roleManager = roleManager;
}
#region IProfileService Members
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
{
var sub = context.Subject.GetSubjectId();
var user = await _userLookup.GetUserByEmail(sub);
var claims = BuildClaimListForUser(user);
context.IssuedClaims = claims;
}
public async Task IsActiveAsync(IsActiveContext context)
{
var sub = context.Subject.GetSubjectId();
var user = await _userLookup.GetUserByEmail(sub);
context.IsActive = user != null;
}
#endregion
#region IResourceOwnerPasswordValidator Members
#region Implementation of IResourceOwnerPasswordValidator
public async Task ValidateAsync(ResourceOwnerPasswordValidationContext context)
{
var user = await _userLookup.GetUserByEmailAndPassword(context.UserName, context.Password);
if (user != null)
{
var claims = BuildClaimListForUser(user);
context.Result = new GrantValidationResult(
user.Id,
"password",
claims
);
}
}
#endregion
#endregion
public static string ToPolicyName(Activity claim)
{
return claim.ToString().ToLower();
}
#region Private Methods
private List<Claim> BuildClaimListForUser(User user)
{
var claims = new List<Claim>
{
new Claim(JwtClaimTypes.Name, user.Email),
new Claim(JwtClaimTypes.Id, user.Id),
new Claim(JwtClaimTypes.GivenName, user.Name),
new Claim(IdentityServerConstants.StandardScopes.Email, user.Email),
new Claim(JwtClaimTypes.Scope, IocApi.Instance.Resolve<OpenIdSettings>().ScopeApi),
user.Roles.Contains(RoleManager.Admin.Name)
? new Claim(JwtClaimTypes.Role, RoleManager.Admin.Name)
: new Claim(JwtClaimTypes.Role, RoleManager.Guest.Name)
};
var selectMany = user.Roles.Select(r => _roleManager.GetRoleByName(r).Result).SelectMany(x => x.Activities)
.Distinct().ToList();
foreach (var claim in selectMany) claims.Add(new Claim(JwtClaimTypes.Role, ToPolicyName(claim)));
return claims;
}
#endregion
}
} | 33.711538 | 120 | 0.619224 | [
"Apache-2.0"
] | rolfwessels/SteveTheTradeBot | src/SteveTheTradeBot.Api/Security/UserClaimProvider.cs | 3,403 | C# |
namespace Todo.Extensions
{
public static class StringExtension
{
public static bool HasContent(this string content) =>
content?.Trim().Length > 0;
}
}
| 20.555556 | 61 | 0.627027 | [
"MIT"
] | niteshrestha/todo-mobile | Todo/Todo/Extensions/StringExtension.cs | 187 | C# |
using System;
using System.Timers;
using Melanchall.DryWetMidi.Common;
namespace Melanchall.DryWetMidi.Devices
{
/// <summary>
/// Tick generator which uses <see cref="Timer"/> for ticking.
/// </summary>
public sealed class RegularPrecisionTickGenerator : TickGenerator
{
#region Constants
/// <summary>
/// The smallest possible interval.
/// </summary>
public static readonly TimeSpan MinInterval = TimeSpan.FromMilliseconds(1);
/// <summary>
/// The largest possible interval.
/// </summary>
public static readonly TimeSpan MaxInterval = TimeSpan.FromMilliseconds(int.MaxValue);
#endregion
#region Fields
private Timer _timer;
private bool _disposed = false;
#endregion
#region Overrides
/// <summary>
/// Starts a tick generator.
/// </summary>
/// <param name="interval">Interval between ticks.</param>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="interval"/> is out of
/// [<see cref="MinInterval"/>; <see cref="MaxInterval"/>] range.</exception>
protected override void Start(TimeSpan interval)
{
ThrowIfArgument.IsOutOfRange(nameof(interval),
interval,
MinInterval,
MaxInterval,
"Interval is out of [{0}, {1}] range.",
MinInterval,
MaxInterval);
_timer = new Timer(interval.TotalMilliseconds);
_timer.Elapsed += OnElapsed;
_timer.Start();
}
/// <summary>
/// Stops a tick generator.
/// </summary>
protected override void Stop()
{
_timer.Stop();
}
#endregion
#region Methods
private void OnElapsed(object sender, ElapsedEventArgs e)
{
if (!IsRunning || _disposed)
return;
GenerateTick();
}
#endregion
#region IDisposable
/// <summary>
/// Releases all resources used by the current tick generator.
/// </summary>
protected override void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing && IsRunning)
{
_timer.Stop();
_timer.Elapsed -= OnElapsed;
_timer.Dispose();
}
_disposed = true;
}
#endregion
}
}
| 26.861386 | 95 | 0.50387 | [
"MIT"
] | jrdndj/drywetmidi | DryWetMidi/Devices/Clock/TickGenerator/RegularPrecisionTickGenerator.cs | 2,715 | C# |
using Lesarde.Frogui.Media;
using System.Collections.Generic;
using System.Linq;
namespace Demo
{
/***************************************************************************************************
SolidColorBrushes class
***************************************************************************************************/
/// <summary>
/// Implements a set of predefined solid color brushes.
/// </summary>
public class SolidColorBrushes : Brushes
{
static readonly IList<BrushInfo> all = new List<BrushInfo>();
public override IList<BrushInfo> All => all;
public override BrushVariety Variety => BrushVariety.Solid;
/***********************************************************
Singleton property
***********************************************************/
public static SolidColorBrushes Singleton { get; } = new SolidColorBrushes();
/***********************************************************
the brushes
***********************************************************/
public static BrushInfo AliceBlue { get; } = Add(Colors.AliceBlue);
public static BrushInfo AntiqueWhite { get; } = Add(Colors.AntiqueWhite);
public static BrushInfo Aqua { get; } = Add(Colors.Aqua);
public static BrushInfo AquaMarine { get; } = Add(Colors.AquaMarine);
public static BrushInfo Azure { get; } = Add(Colors.Azure);
public static BrushInfo Beige { get; } = Add(Colors.Beige);
public static BrushInfo Bisque { get; } = Add(Colors.Bisque);
public static BrushInfo Black { get; } = Add(Colors.Black);
public static BrushInfo BlanchedAlmond { get; } = Add(Colors.BlanchedAlmond);
public static BrushInfo Blue { get; } = Add(Colors.Blue);
public static BrushInfo BlueViolet { get; } = Add(Colors.BlueViolet);
public static BrushInfo Brown { get; } = Add(Colors.Brown);
public static BrushInfo BurlyWood { get; } = Add(Colors.BurlyWood);
public static BrushInfo CadetBlue { get; } = Add(Colors.CadetBlue);
public static BrushInfo Chartreuse { get; } = Add(Colors.Chartreuse);
public static BrushInfo Chocolate { get; } = Add(Colors.Chocolate);
public static BrushInfo Coral { get; } = Add(Colors.Coral);
public static BrushInfo CornFlowerBlue { get; } = Add(Colors.CornFlowerBlue);
public static BrushInfo CornSilk { get; } = Add(Colors.CornSilk);
public static BrushInfo Crimson { get; } = Add(Colors.Crimson);
public static BrushInfo Cyan { get; } = Add(Colors.Cyan);
public static BrushInfo DarkBlue { get; } = Add(Colors.DarkBlue);
public static BrushInfo DarkCyan { get; } = Add(Colors.DarkCyan);
public static BrushInfo DarkGoldenRod { get; } = Add(Colors.DarkGoldenRod);
public static BrushInfo DarkGray { get; } = Add(Colors.DarkGray);
public static BrushInfo DarkGreen { get; } = Add(Colors.DarkGreen);
public static BrushInfo DarkKhaki { get; } = Add(Colors.DarkKhaki);
public static BrushInfo DarkMagenta { get; } = Add(Colors.DarkMagenta);
public static BrushInfo DarkOliveGreen { get; } = Add(Colors.DarkOliveGreen);
public static BrushInfo DarkOrange { get; } = Add(Colors.DarkOrange);
public static BrushInfo DarkOrchid { get; } = Add(Colors.DarkOrchid);
public static BrushInfo DarkRed { get; } = Add(Colors.DarkRed);
public static BrushInfo DarkSalmon { get; } = Add(Colors.DarkSalmon);
public static BrushInfo DarkSeaGreen { get; } = Add(Colors.DarkSeaGreen);
public static BrushInfo DarkSlateBlue { get; } = Add(Colors.DarkSlateBlue);
public static BrushInfo DarkSlateGray { get; } = Add(Colors.DarkSlateGray);
public static BrushInfo DarkTurquoise { get; } = Add(Colors.DarkTurquoise);
public static BrushInfo DarkViolet { get; } = Add(Colors.DarkViolet);
public static BrushInfo DeepPink { get; } = Add(Colors.DeepPink);
public static BrushInfo DeepSkyBlue { get; } = Add(Colors.DeepSkyBlue);
public static BrushInfo DimGray { get; } = Add(Colors.DimGray);
public static BrushInfo DodgerBlue { get; } = Add(Colors.DodgerBlue);
public static BrushInfo FireBrick { get; } = Add(Colors.FireBrick);
public static BrushInfo FloralWhite { get; } = Add(Colors.FloralWhite);
public static BrushInfo ForestGreen { get; } = Add(Colors.ForestGreen);
public static BrushInfo Fuchsia { get; } = Add(Colors.Fuchsia);
public static BrushInfo Gainsboro { get; } = Add(Colors.Gainsboro);
public static BrushInfo GhostWhite { get; } = Add(Colors.GhostWhite);
public static BrushInfo Gold { get; } = Add(Colors.Gold);
public static BrushInfo GoldenRod { get; } = Add(Colors.GoldenRod);
public static BrushInfo Gray { get; } = Add(Colors.Gray);
public static BrushInfo Green { get; } = Add(Colors.Green);
public static BrushInfo GreenYellow { get; } = Add(Colors.GreenYellow);
public static BrushInfo HoneyDew { get; } = Add(Colors.HoneyDew);
public static BrushInfo HotPink { get; } = Add(Colors.HotPink);
public static BrushInfo IndianRed { get; } = Add(Colors.IndianRed);
public static BrushInfo Indigo { get; } = Add(Colors.Indigo);
public static BrushInfo Ivory { get; } = Add(Colors.Ivory);
public static BrushInfo Khaki { get; } = Add(Colors.Khaki);
public static BrushInfo Lavender { get; } = Add(Colors.Lavender);
public static BrushInfo LavenderBlush { get; } = Add(Colors.LavenderBlush);
public static BrushInfo LawnGreen { get; } = Add(Colors.LawnGreen);
public static BrushInfo LemonChiffon { get; } = Add(Colors.LemonChiffon);
public static BrushInfo LightBlue { get; } = Add(Colors.LightBlue);
public static BrushInfo LightCoral { get; } = Add(Colors.LightCoral);
public static BrushInfo LightCyan { get; } = Add(Colors.LightCyan);
public static BrushInfo LightGoldenRodYellow { get; } = Add(Colors.LightGoldenRodYellow);
public static BrushInfo LightGreen { get; } = Add(Colors.LightGreen);
public static BrushInfo LightGray { get; } = Add(Colors.LightGray);
public static BrushInfo LightPink { get; } = Add(Colors.LightPink);
public static BrushInfo LightSalmon { get; } = Add(Colors.LightSalmon);
public static BrushInfo LightSeaGreen { get; } = Add(Colors.LightSeaGreen);
public static BrushInfo LightSkyBlue { get; } = Add(Colors.LightSkyBlue);
public static BrushInfo LightSlateGray { get; } = Add(Colors.LightSlateGray);
public static BrushInfo LightSteelBlue { get; } = Add(Colors.LightSteelBlue);
public static BrushInfo LightYellow { get; } = Add(Colors.LightYellow);
public static BrushInfo Lime { get; } = Add(Colors.Lime);
public static BrushInfo LimeGreen { get; } = Add(Colors.LimeGreen);
public static BrushInfo Linen { get; } = Add(Colors.Linen);
public static BrushInfo Magenta { get; } = Add(Colors.Magenta);
public static BrushInfo Maroon { get; } = Add(Colors.Maroon);
public static BrushInfo MediumAquaMarine { get; } = Add(Colors.MediumAquaMarine);
public static BrushInfo MediumBlue { get; } = Add(Colors.MediumBlue);
public static BrushInfo MediumOrchid { get; } = Add(Colors.MediumOrchid);
public static BrushInfo MediumPurple { get; } = Add(Colors.MediumPurple);
public static BrushInfo MediumSeaGreen { get; } = Add(Colors.MediumSeaGreen);
public static BrushInfo MediumSlateBlue { get; } = Add(Colors.MediumSlateBlue);
public static BrushInfo MediumSpringGreen { get; } = Add(Colors.MediumSpringGreen);
public static BrushInfo MediumTurquoise { get; } = Add(Colors.MediumTurquoise);
public static BrushInfo MediumVioletRed { get; } = Add(Colors.MediumVioletRed);
public static BrushInfo MidnightBlue { get; } = Add(Colors.MidnightBlue);
public static BrushInfo MintCream { get; } = Add(Colors.MintCream);
public static BrushInfo MistyRose { get; } = Add(Colors.MistyRose);
public static BrushInfo Moccasin { get; } = Add(Colors.Moccasin);
public static BrushInfo NavajoWhite { get; } = Add(Colors.NavajoWhite);
public static BrushInfo Navy { get; } = Add(Colors.Navy);
public static BrushInfo OldLace { get; } = Add(Colors.OldLace);
public static BrushInfo Olive { get; } = Add(Colors.Olive);
public static BrushInfo OliveDrab { get; } = Add(Colors.OliveDrab);
public static BrushInfo Orange { get; } = Add(Colors.Orange);
public static BrushInfo OrangeRed { get; } = Add(Colors.OrangeRed);
public static BrushInfo Orchid { get; } = Add(Colors.Orchid);
public static BrushInfo PaleGoldenRod { get; } = Add(Colors.PaleGoldenRod);
public static BrushInfo PaleGreen { get; } = Add(Colors.PaleGreen);
public static BrushInfo PaleTurquoise { get; } = Add(Colors.PaleTurquoise);
public static BrushInfo PaleVioletRed { get; } = Add(Colors.PaleVioletRed);
public static BrushInfo PapayaWhip { get; } = Add(Colors.PapayaWhip);
public static BrushInfo PeachPuff { get; } = Add(Colors.PeachPuff);
public static BrushInfo Peru { get; } = Add(Colors.Peru);
public static BrushInfo Pink { get; } = Add(Colors.Pink);
public static BrushInfo Plum { get; } = Add(Colors.Plum);
public static BrushInfo PowderBlue { get; } = Add(Colors.PowderBlue);
public static BrushInfo Purple { get; } = Add(Colors.Purple);
public static BrushInfo Red { get; } = Add(Colors.Red);
public static BrushInfo RosyBrown { get; } = Add(Colors.RosyBrown);
public static BrushInfo RoyalBlue { get; } = Add(Colors.RoyalBlue);
public static BrushInfo SaddleBrown { get; } = Add(Colors.SaddleBrown);
public static BrushInfo Salmon { get; } = Add(Colors.Salmon);
public static BrushInfo SandyBrown { get; } = Add(Colors.SandyBrown);
public static BrushInfo SeaGreen { get; } = Add(Colors.SeaGreen);
public static BrushInfo SeaShell { get; } = Add(Colors.SeaShell);
public static BrushInfo Sienna { get; } = Add(Colors.Sienna);
public static BrushInfo Silver { get; } = Add(Colors.Silver);
public static BrushInfo SkyBlue { get; } = Add(Colors.SkyBlue);
public static BrushInfo SlateBlue { get; } = Add(Colors.SlateBlue);
public static BrushInfo SlateGray { get; } = Add(Colors.SlateGray);
public static BrushInfo Snow { get; } = Add(Colors.Snow);
public static BrushInfo SpringGreen { get; } = Add(Colors.SpringGreen);
public static BrushInfo SteelBlue { get; } = Add(Colors.SteelBlue);
public static BrushInfo Tan { get; } = Add(Colors.Tan);
public static BrushInfo Teal { get; } = Add(Colors.Teal);
public static BrushInfo Thistle { get; } = Add(Colors.Thistle);
public static BrushInfo Tomato { get; } = Add(Colors.Tomato);
public static BrushInfo Transparent { get; } = Add(Colors.Transparent);
public static BrushInfo Turquoise { get; } = Add(Colors.Turquoise);
public static BrushInfo Violet { get; } = Add(Colors.Violet);
public static BrushInfo Wheat { get; } = Add(Colors.Wheat);
public static BrushInfo White { get; } = Add(Colors.White);
public static BrushInfo WhiteSmoke { get; } = Add(Colors.WhiteSmoke);
public static BrushInfo Yellow { get; } = Add(Colors.Yellow);
public static BrushInfo YellowGreen { get; } = Add(Colors.YellowGreen);
/*******************************************************************************
! $
*******************************************************************************/
static SolidColorBrushes()
{
Init(typeof(SolidColorBrushes), all);
}
/*******************************************************************************
$
*******************************************************************************/
private SolidColorBrushes() { }
/*******************************************************************************
Add()
*******************************************************************************/
static BrushInfo Add(Color color) => Add(new SolidColorBrush(color), all);
}
}
| 59.056122 | 101 | 0.666523 | [
"Apache-2.0"
] | lesarde-co/frogui | Samples/Demo/Shared/SolidColorBrushes.cs | 11,577 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
using Lucene.Net.Store;
namespace ActivityLibrary
{
public class LuceneService
{
private static Analyzer analyzer = new StandardAnalyzer();
private static Directory luceneIndexDirectory;
private static IndexWriter writer;
//private static string indexPath = @"c:\temp\LuceneIndex";
static LuceneService()
{
//InitialiseLucene();
}
public static void InitialiseLucene()
{
var indexPath = AppDomain.CurrentDomain.BaseDirectory + @"\APKDecompile\LuceneIndex";
if (System.IO.Directory.Exists(indexPath))
{
try
{
System.IO.Directory.Delete(indexPath, true);
}
catch (Exception ex) { }
}
Analyzer analyzer = new StandardAnalyzer();
luceneIndexDirectory = FSDirectory.GetDirectory(indexPath);
writer = new IndexWriter(luceneIndexDirectory, analyzer, true);
}
public static void BuildIndex()
{
var sDir = AppDomain.CurrentDomain.BaseDirectory + @"\APKDecompile\apkcode\src";
var Files=DirSearch(sDir);
foreach (var file in Files)
{
string data=System.IO.File.ReadAllText(file);
System.Text.RegularExpressions.Regex rgx = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9]");
data = rgx.Replace(data, " ");
Document doc = new Document();
doc.Add(new Field("FileName", file.Substring(file.LastIndexOf('\\') + 1), Field.Store.YES, Field.Index.UN_TOKENIZED));
doc.Add(new Field("Data", data, Field.Store.YES, Field.Index.TOKENIZED));
writer.AddDocument(doc);
}
writer.Optimize();
writer.Flush();
writer.Close();
luceneIndexDirectory.Close();
}
public static IList<string> Search(string searchTerm)
{
System.Text.RegularExpressions.Regex rgx = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9]");
searchTerm = rgx.Replace(searchTerm, " ");
IndexSearcher searcher = new IndexSearcher(luceneIndexDirectory);
QueryParser parser = new QueryParser("Data", analyzer);
Query query = parser.Parse(searchTerm.ToLower());
Hits hitsFound = searcher.Search(query);
IList<string> results = new List<string>();
for (int i = 0; i < hitsFound.Length(); i++)
{
Document doc = hitsFound.Doc(i);
float score = hitsFound.Score(i);
string fileName = doc.Get("FileName");
if(score>0.6)
results.Add(doc.Get("FileName"));
}
searcher.Close();
return results;
}
private static List<String> DirSearch(string sDir)
{
List<String> files = new List<String>();
try
{
foreach (string f in System.IO.Directory.GetFiles(sDir))
{
files.Add(f);
}
foreach (string d in System.IO.Directory.GetDirectories(sDir))
{
if (!d.Contains("APKDecompile\\apkcode\\src\\android"))
files.AddRange(DirSearch(d));
}
}
catch (System.Exception excpt)
{
//MessageBox.Show(excpt.Message);
}
return files;
}
}
} | 31.52 | 134 | 0.541117 | [
"Apache-2.0"
] | neerajmathur/UMETRIX | ActivityLibrary/Lucene/LuceneService.cs | 3,942 | C# |
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/d2d1effects.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
namespace TerraFX.Interop
{
public enum D2D1_COLORMATRIX_ALPHA_MODE : uint
{
D2D1_COLORMATRIX_ALPHA_MODE_PREMULTIPLIED = 1,
D2D1_COLORMATRIX_ALPHA_MODE_STRAIGHT = 2,
D2D1_COLORMATRIX_ALPHA_MODE_FORCE_DWORD = 0xffffffff,
}
}
| 36.666667 | 145 | 0.756364 | [
"MIT"
] | DaZombieKiller/terrafx.interop.windows | sources/Interop/Windows/um/d2d1effects/D2D1_COLORMATRIX_ALPHA_MODE.cs | 552 | C# |
// Copyright (c) Huy Hoang. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using System;
using System.Threading.Tasks;
namespace Dash.Engine
{
public interface IUriResourceRepository
{
Task Add(Uri uri);
Task Add(Uri uri, string fileName, byte[] contents);
Task<string> Get(Uri uri);
Task<bool> Exists(Uri uri);
Task<string> GetContents(Uri uri);
Task<int> Count();
}
} | 22.565217 | 107 | 0.65896 | [
"Apache-2.0"
] | dotnet-dash/dash | src/Dash/src/Dash/Engine/IUriResourceRepository.cs | 521 | C# |
using System.Collections.Generic;
namespace EnderPi.Genetics.Linear8099
{
/// <summary>
/// Class to clean the program. Specifically, remove statements that don't do anything.
/// </summary>
/// <remarks>
/// 8099 syntax is much more expressive than tree-based genetic programming, but it is also much
/// easier to produce commands that have no effect. For instance, if the output register has
/// not been modified yet, multiplying the output by any value doesn't do anything.
/// This class provides a method for stripping out those commands, which can help guide the
/// algorithm.
/// </remarks>
public static class Machine8099ProgramCleaner
{
/// <summary>
/// Cleans the program, removing statements that don't do anything.
/// </summary>
/// <param name="program"></param>
/// <returns></returns>
public static List<Command8099> CleanProgram(Command8099[] program)
{
List<Command8099> reducedProgram = new List<Command8099>(program.Length);
bool[] IsNonZero = new bool[8] { true, true, false, false, false, false, false, false };
for (int i = 0; i < program.Length; i++)
{
if (program[i].IsForwardConsistent(ref IsNonZero))
{
reducedProgram.Add(program[i]);
}
}
bool[] affectsStateOrOutput = new bool[8] { true, true, false, false, false, false, false, true };
var forwardConsistentProgram = reducedProgram.ToArray();
var reducedProgram2 = new List<Command8099>(forwardConsistentProgram.Length);
for (int j = forwardConsistentProgram.Length - 1; j >= 0; j--)
{
if (forwardConsistentProgram[j].IsBackwardsConsistent(ref affectsStateOrOutput))
{
reducedProgram2.Add(forwardConsistentProgram[j]);
}
//so we walk backwards, and a command is only valid if it affects the forward chain - move dx, 102; move op, s1; - the first is not valid.
//we make a list of all those commands, then we reverse them
}
reducedProgram2.Reverse();
return reducedProgram2;
}
}
}
| 45.254902 | 154 | 0.600953 | [
"MIT"
] | EnderPi/FlemishGiant | Jabba/Framework/Genetics/Linear8099/Machine8099ProgramCleaner.cs | 2,310 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("terminar_comida.iOS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("terminar_comida.iOS")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.135135 | 84 | 0.746279 | [
"MIT"
] | camilo727/terminar_comida | terminar_comida/terminar_comida.iOS/Properties/AssemblyInfo.cs | 1,414 | C# |
#if NET35
namespace AgileObjects.ReadableExpressions.Translations
{
using System;
using System.Collections.Generic;
using System.Reflection;
using Extensions;
using Microsoft.Scripting.Ast;
using LinqExp = System.Linq.Expressions;
/// <summary>
/// Converts a .NET 3.5 Linq Expression object into a DynamicLanguageRuntime Expression object.
/// </summary>
public static class LinqExpressionToDlrExpressionConverter
{
/// <summary>
/// Converts the given <paramref name="linqLambda"/> into a DynamicLanguageRuntime Lambda Expression.
/// </summary>
/// <param name="linqLambda">The Linq Lambda Expression to convert.</param>
/// <returns>The given <paramref name="linqLambda"/> converted into a DynamicLanguageRuntime Lambda Expression.</returns>
public static LambdaExpression Convert(LinqExp.LambdaExpression linqLambda)
=> (LambdaExpression)new Converter().ConvertExp(linqLambda);
/// <summary>
/// Converts the given <paramref name="linqExpression"/> into a DynamicLanguageRuntime Expression.
/// </summary>
/// <param name="linqExpression">The Linq Expression to convert.</param>
/// <returns>The given <paramref name="linqExpression"/> converted into a DynamicLanguageRuntime Expression.</returns>
public static Expression Convert(LinqExp.Expression linqExpression)
=> new Converter().ConvertExp(linqExpression);
private class Converter
{
private readonly Dictionary<LinqExp.ParameterExpression, ParameterExpression> _parameters;
public Converter()
{
_parameters = new Dictionary<LinqExp.ParameterExpression, ParameterExpression>();
}
public Expression ConvertExp(LinqExp.Expression linqExpression)
{
if (linqExpression == null)
{
return null;
}
switch (linqExpression.NodeType)
{
case LinqExp.ExpressionType.Add:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Add);
case LinqExp.ExpressionType.AddChecked:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.AddChecked);
case LinqExp.ExpressionType.And:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.And);
case LinqExp.ExpressionType.AndAlso:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.AndAlso);
case LinqExp.ExpressionType.ArrayLength:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.ArrayLength);
case LinqExp.ExpressionType.ArrayIndex:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.ArrayIndex);
case LinqExp.ExpressionType.Call:
return Convert((LinqExp.MethodCallExpression)linqExpression);
case LinqExp.ExpressionType.Coalesce:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.Coalesce);
case LinqExp.ExpressionType.Conditional:
return Convert((LinqExp.ConditionalExpression)linqExpression);
case LinqExp.ExpressionType.Constant:
return Convert((LinqExp.ConstantExpression)linqExpression);
case LinqExp.ExpressionType.Convert:
return ConvertCast((LinqExp.UnaryExpression)linqExpression, Expression.Convert);
case LinqExp.ExpressionType.ConvertChecked:
return ConvertCast((LinqExp.UnaryExpression)linqExpression, Expression.ConvertChecked);
case LinqExp.ExpressionType.Divide:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Divide);
case LinqExp.ExpressionType.Equal:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.Equal);
case LinqExp.ExpressionType.ExclusiveOr:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.ExclusiveOr);
case LinqExp.ExpressionType.GreaterThan:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.GreaterThan);
case LinqExp.ExpressionType.GreaterThanOrEqual:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.GreaterThanOrEqual);
case LinqExp.ExpressionType.Invoke:
return Convert((LinqExp.InvocationExpression)linqExpression);
case LinqExp.ExpressionType.Lambda:
return ConvertLambda((LinqExp.LambdaExpression)linqExpression);
case LinqExp.ExpressionType.LeftShift:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.LeftShift);
case LinqExp.ExpressionType.LessThan:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.LessThan);
case LinqExp.ExpressionType.LessThanOrEqual:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.LessThanOrEqual);
case LinqExp.ExpressionType.ListInit:
return Convert((LinqExp.ListInitExpression)linqExpression);
case LinqExp.ExpressionType.MemberAccess:
return Convert((LinqExp.MemberExpression)linqExpression);
case LinqExp.ExpressionType.MemberInit:
return Convert((LinqExp.MemberInitExpression)linqExpression);
case LinqExp.ExpressionType.Modulo:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Modulo);
case LinqExp.ExpressionType.Multiply:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Multiply);
case LinqExp.ExpressionType.MultiplyChecked:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.MultiplyChecked);
case LinqExp.ExpressionType.Negate:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.Negate);
case LinqExp.ExpressionType.UnaryPlus:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.NegateChecked);
case LinqExp.ExpressionType.NegateChecked:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.NegateChecked);
case LinqExp.ExpressionType.New:
return Convert((LinqExp.NewExpression)linqExpression);
case LinqExp.ExpressionType.NewArrayBounds:
return Convert((LinqExp.NewArrayExpression)linqExpression, Expression.NewArrayBounds);
case LinqExp.ExpressionType.NewArrayInit:
return Convert((LinqExp.NewArrayExpression)linqExpression, Expression.NewArrayInit);
case LinqExp.ExpressionType.Not:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.Not);
case LinqExp.ExpressionType.NotEqual:
return ConvertImplicit((LinqExp.BinaryExpression)linqExpression, Expression.NotEqual);
case LinqExp.ExpressionType.Or:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Or);
case LinqExp.ExpressionType.OrElse:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.OrElse);
case LinqExp.ExpressionType.Parameter:
return Convert((LinqExp.ParameterExpression)linqExpression);
case LinqExp.ExpressionType.Power:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Power);
case LinqExp.ExpressionType.Quote:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.Quote);
case LinqExp.ExpressionType.RightShift:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.RightShift);
case LinqExp.ExpressionType.Subtract:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.Subtract);
case LinqExp.ExpressionType.SubtractChecked:
return Convert((LinqExp.BinaryExpression)linqExpression, Expression.SubtractChecked);
case LinqExp.ExpressionType.TypeAs:
return Convert((LinqExp.UnaryExpression)linqExpression, Expression.TypeAs);
case LinqExp.ExpressionType.TypeIs:
return Convert((LinqExp.TypeBinaryExpression)linqExpression);
}
throw new NotSupportedException("Can't convert a " + linqExpression.NodeType);
}
private Expression Convert(LinqExp.InvocationExpression linqInvoke)
{
return Expression.Invoke(
ConvertExp(linqInvoke.Expression),
Convert(linqInvoke.Arguments));
}
private Expression Convert(LinqExp.TypeBinaryExpression linqTypeBinary)
=> Expression.TypeIs(ConvertExp(linqTypeBinary.Expression), linqTypeBinary.TypeOperand);
private Expression Convert(LinqExp.ListInitExpression linqListInit)
{
return Expression.ListInit(
Convert(linqListInit.NewExpression),
linqListInit.Initializers.Project(Convert));
}
private NewExpression Convert(LinqExp.NewExpression linqNew)
{
return (linqNew.Members != null)
? Expression.New(
linqNew.Constructor,
Convert(linqNew.Arguments),
linqNew.Members)
: Expression.New(
linqNew.Constructor,
Convert(linqNew.Arguments));
}
private ElementInit Convert(LinqExp.ElementInit linqElementInit)
{
return Expression.ElementInit(
linqElementInit.AddMethod,
Convert(linqElementInit.Arguments));
}
private Expression Convert(LinqExp.NewArrayExpression linqNewArray, Func<Type, IEnumerable<Expression>, Expression> factory)
{
return factory.Invoke(
linqNewArray.Type.GetElementType(),
Convert(linqNewArray.Expressions));
}
private Expression Convert(LinqExp.ConditionalExpression linqConditional)
{
return Expression.Condition(
ConvertExp(linqConditional.Test),
ConvertExp(linqConditional.IfTrue),
ConvertExp(linqConditional.IfFalse));
}
private MemberInitExpression Convert(LinqExp.MemberInitExpression linqMemberInit)
{
return Expression.MemberInit(
Convert(linqMemberInit.NewExpression),
linqMemberInit.Bindings.Project(Convert));
}
private MemberBinding Convert(LinqExp.MemberBinding linqBinding)
{
switch (linqBinding.BindingType)
{
case LinqExp.MemberBindingType.Assignment:
var linqMemberAssignment = (LinqExp.MemberAssignment)linqBinding;
return Expression.Bind(
linqMemberAssignment.Member,
ConvertExp(linqMemberAssignment.Expression));
case LinqExp.MemberBindingType.MemberBinding:
var linqMemberBinding = (LinqExp.MemberMemberBinding)linqBinding;
return Expression.MemberBind(
linqMemberBinding.Member,
linqMemberBinding.Bindings.Project(Convert));
case LinqExp.MemberBindingType.ListBinding:
var linqListBinding = (LinqExp.MemberListBinding)linqBinding;
return Expression.ListBind(
linqListBinding.Member,
linqListBinding.Initializers.Project(Convert));
default:
throw new ArgumentOutOfRangeException();
}
}
private Expression ConvertCast(LinqExp.UnaryExpression linqConvert, Func<Expression, Type, MethodInfo, Expression> factory)
{
return factory.Invoke(
ConvertExp(linqConvert.Operand),
linqConvert.Type,
linqConvert.Method);
}
private Expression Convert(LinqExp.UnaryExpression linqUnary, Func<Expression, Expression> factory)
{
return factory.Invoke(ConvertExp(linqUnary.Operand));
}
private Expression Convert(LinqExp.UnaryExpression linqUnary, Func<Expression, Type, Expression> factory)
{
return factory.Invoke(ConvertExp(linqUnary.Operand), linqUnary.Type);
}
private Expression ConvertImplicit(LinqExp.BinaryExpression linqBinary, Func<Expression, Expression, Expression> factory)
{
return factory.Invoke(ConvertExp(linqBinary.Left), ConvertExp(linqBinary.Right));
}
private Expression Convert(
LinqExp.BinaryExpression linqBinary,
Func<Expression, Expression, MethodInfo, Expression> factory)
{
return factory.Invoke(
ConvertExp(linqBinary.Left),
ConvertExp(linqBinary.Right),
linqBinary.Method);
}
private static Expression Convert(LinqExp.ConstantExpression linqConstant)
=> Expression.Constant(linqConstant.Value, linqConstant.Type);
private Expression Convert(LinqExp.MethodCallExpression linqCall)
{
return Expression.Call(
ConvertExp(linqCall.Object),
linqCall.Method,
Convert(linqCall.Arguments));
}
private Expression Convert(LinqExp.MemberExpression linqMemberAccess)
{
return Expression.MakeMemberAccess(
ConvertExp(linqMemberAccess.Expression),
linqMemberAccess.Member);
}
private Expression ConvertLambda(LinqExp.LambdaExpression linqLambda)
{
return Expression.Lambda(
linqLambda.Type,
ConvertExp(linqLambda.Body),
linqLambda.Parameters.Project(Convert));
}
private ParameterExpression Convert(LinqExp.ParameterExpression linqParam)
{
if (_parameters.TryGetValue(linqParam, out var param))
{
return param;
}
return _parameters[linqParam] = Expression.Parameter(linqParam.Type, linqParam.Name);
}
private IEnumerable<Expression> Convert(IEnumerable<LinqExp.Expression> linqExpressions)
{
return linqExpressions.Project(arg =>
(arg.NodeType == LinqExp.ExpressionType.Quote)
? Expression.Constant(((LinqExp.UnaryExpression)arg).Operand, arg.Type)
: ConvertExp(arg));
}
}
}
}
#endif | 45.855153 | 136 | 0.5961 | [
"MIT"
] | rikimaru0345/ReadableExpressions | ReadableExpressions/Translations/LinqExpressionToDlrExpressionConverter.cs | 16,464 | C# |
// Copyright (c) 2012, Event Store LLP
// 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 the Event Store LLP nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
using System;
using System.Security.Principal;
using EventStore.Core.Bus;
using EventStore.Core.Messaging;
using EventStore.Core.Services;
using EventStore.Core.Services.UserManagement;
using EventStore.Projections.Core.Services;
using EventStore.Projections.Core.Services.Processing;
namespace EventStore.Projections.Core.Messages
{
public static class ProjectionManagementMessage
{
public class OperationFailed : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _reason;
public OperationFailed(string reason)
{
_reason = reason;
}
public string Reason
{
get { return _reason; }
}
}
public class NotFound : OperationFailed
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
public NotFound()
: base("Not Found")
{
}
}
public class NotAuthorized : OperationFailed
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
public NotAuthorized()
: base("Not authorized")
{
}
}
public sealed class RunAs
{
private readonly IPrincipal _runAs;
public RunAs(IPrincipal runAs)
{
_runAs = runAs;
}
private static readonly RunAs _anonymous = new RunAs(null);
private static readonly RunAs _system = new RunAs(SystemAccount.Principal);
public static RunAs Anonymous
{
get { return _anonymous; }
}
public static RunAs System
{
get { return _system; }
}
public IPrincipal Principal
{
get { return _runAs; }
}
public static bool ValidateRunAs(ProjectionMode mode, ReadWrite readWrite, IPrincipal existingRunAs, ControlMessage message, bool replace = false)
{
if (mode > ProjectionMode.Transient && readWrite == ReadWrite.Write
&& (message.RunAs == null || message.RunAs.Principal == null
|| !message.RunAs.Principal.IsInRole(SystemRoles.Admins)))
{
message.Envelope.ReplyWith(new NotAuthorized());
return false;
}
if (replace && message.RunAs.Principal == null)
{
message.Envelope.ReplyWith(new NotAuthorized());
return false;
}
if (replace && message.RunAs.Principal != null)
return true; // enable this operation while no projection permissions are defined
return true;
//if (existingRunAs == null)
// return true;
//if (message.RunAs.Principal == null
// || !string.Equals(
// existingRunAs.Identity.Name, message.RunAs.Principal.Identity.Name,
// StringComparison.OrdinalIgnoreCase))
//{
// message.Envelope.ReplyWith(new NotAuthorized());
// return false;
//}
//return true;
}
}
public abstract class ControlMessage: Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly IEnvelope _envelope;
public readonly RunAs RunAs;
protected ControlMessage(IEnvelope envelope, RunAs runAs)
{
_envelope = envelope;
RunAs = runAs;
}
public IEnvelope Envelope
{
get { return _envelope; }
}
}
public class Post : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly ProjectionMode _mode;
private readonly string _name;
private readonly string _handlerType;
private readonly string _query;
private readonly bool _enabled;
private readonly bool _checkpointsEnabled;
private readonly bool _emitEnabled;
private readonly bool _enableRunAs;
public Post(
IEnvelope envelope, ProjectionMode mode, string name, RunAs runAs, string handlerType, string query,
bool enabled, bool checkpointsEnabled, bool emitEnabled, bool enableRunAs = false)
: base(envelope, runAs)
{
_name = name;
_handlerType = handlerType;
_mode = mode;
_query = query;
_enabled = enabled;
_checkpointsEnabled = checkpointsEnabled;
_emitEnabled = emitEnabled;
_enableRunAs = enableRunAs;
}
public Post(
IEnvelope envelope, ProjectionMode mode, string name, RunAs runAs, Type handlerType, string query,
bool enabled, bool checkpointsEnabled, bool emitEnabled, bool enableRunAs = false)
: base(envelope, runAs)
{
_name = name;
_handlerType = "native:" + handlerType.Namespace + "." + handlerType.Name;
_mode = mode;
_query = query;
_enabled = enabled;
_checkpointsEnabled = checkpointsEnabled;
_emitEnabled = emitEnabled;
_enableRunAs = enableRunAs;
}
// shortcut for posting ad-hoc JS queries
public Post(IEnvelope envelope, RunAs runAs, string query, bool enabled)
: base(envelope, runAs)
{
_name = Guid.NewGuid().ToString("D");
_handlerType = "JS";
_mode = ProjectionMode.Transient;
_query = query;
_enabled = enabled;
_checkpointsEnabled = false;
_emitEnabled = false;
}
public ProjectionMode Mode
{
get { return _mode; }
}
public string Query
{
get { return _query; }
}
public string Name
{
get { return _name; }
}
public string HandlerType
{
get { return _handlerType; }
}
public bool Enabled
{
get { return _enabled; }
}
public bool EmitEnabled
{
get { return _emitEnabled; }
}
public bool CheckpointsEnabled
{
get { return _checkpointsEnabled; }
}
public bool EnableRunAs
{
get { return _enableRunAs; }
}
}
public class Disable : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
public Disable(IEnvelope envelope, string name, RunAs runAs)
: base(envelope, runAs)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
public class Enable : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
public Enable(IEnvelope envelope, string name, RunAs runAs)
: base(envelope, runAs)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
public class Abort : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
public Abort(IEnvelope envelope, string name, RunAs runAs)
: base(envelope, runAs)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
public class SetRunAs : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
public enum SetRemove
{
Set,
Rmeove
};
private readonly string _name;
private readonly SetRemove _action;
public SetRunAs(IEnvelope envelope, string name, RunAs runAs, SetRemove action)
: base(envelope, runAs)
{
_name = name;
_action = action;
}
public string Name
{
get { return _name; }
}
public SetRemove Action
{
get { return _action; }
}
}
public class UpdateQuery : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
private readonly string _handlerType;
private readonly string _query;
private readonly bool? _emitEnabled;
public UpdateQuery(
IEnvelope envelope, string name, RunAs runAs, string handlerType, string query, bool? emitEnabled)
: base(envelope, runAs)
{
_name = name;
_handlerType = handlerType;
_query = query;
_emitEnabled = emitEnabled;
}
public string Query
{
get { return _query; }
}
public string Name
{
get { return _name; }
}
public string HandlerType
{
get { return _handlerType; }
}
public bool? EmitEnabled
{
get { return _emitEnabled; }
}
}
public class Reset : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
public Reset(IEnvelope envelope, string name, RunAs runAs)
: base(envelope, runAs)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
public class Delete : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
private readonly bool _deleteCheckpointStream;
private readonly bool _deleteStateStream;
public Delete(
IEnvelope envelope, string name, RunAs runAs, bool deleteCheckpointStream, bool deleteStateStream)
: base(envelope, runAs)
{
_name = name;
_deleteCheckpointStream = deleteCheckpointStream;
_deleteStateStream = deleteStateStream;
}
public string Name
{
get { return _name; }
}
public bool DeleteCheckpointStream
{
get { return _deleteCheckpointStream; }
}
public bool DeleteStateStream
{
get { return _deleteStateStream; }
}
}
public class GetQuery : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
public GetQuery(IEnvelope envelope, string name, RunAs runAs):
base(envelope, runAs)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
public class Updated : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
public Updated(string name)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
public class GetStatistics : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly IEnvelope _envelope;
private readonly ProjectionMode? _mode;
private readonly string _name;
private readonly bool _includeDeleted;
public GetStatistics(IEnvelope envelope, ProjectionMode? mode, string name, bool includeDeleted)
{
_envelope = envelope;
_mode = mode;
_name = name;
_includeDeleted = includeDeleted;
}
public ProjectionMode? Mode
{
get { return _mode; }
}
public string Name
{
get { return _name; }
}
public bool IncludeDeleted
{
get { return _includeDeleted; }
}
public IEnvelope Envelope
{
get { return _envelope; }
}
}
public class GetState : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly IEnvelope _envelope;
private readonly string _name;
private readonly string _partition;
public GetState(IEnvelope envelope, string name, string partition)
{
if (envelope == null) throw new ArgumentNullException("envelope");
if (name == null) throw new ArgumentNullException("name");
if (partition == null) throw new ArgumentNullException("partition");
_envelope = envelope;
_name = name;
_partition = partition;
}
public string Name
{
get { return _name; }
}
public IEnvelope Envelope
{
get { return _envelope; }
}
public string Partition
{
get { return _partition; }
}
}
public class GetResult : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly IEnvelope _envelope;
private readonly string _name;
private readonly string _partition;
public GetResult(IEnvelope envelope, string name, string partition)
{
if (envelope == null) throw new ArgumentNullException("envelope");
if (name == null) throw new ArgumentNullException("name");
if (partition == null) throw new ArgumentNullException("partition");
_envelope = envelope;
_name = name;
_partition = partition;
}
public string Name
{
get { return _name; }
}
public IEnvelope Envelope
{
get { return _envelope; }
}
public string Partition
{
get { return _partition; }
}
}
public class Statistics : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly ProjectionStatistics[] _projections;
public Statistics(ProjectionStatistics[] projections)
{
_projections = projections;
}
public ProjectionStatistics[] Projections
{
get { return _projections; }
}
}
public abstract class ProjectionDataBase : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
private readonly string _partition;
private readonly CheckpointTag _position;
private readonly Exception _exception;
protected ProjectionDataBase(
string name, string partition, CheckpointTag position, Exception exception = null)
{
_name = name;
_partition = partition;
_position = position;
_exception = exception;
}
public string Name
{
get { return _name; }
}
public Exception Exception
{
get { return _exception; }
}
public string Partition
{
get { return _partition; }
}
public CheckpointTag Position
{
get { return _position; }
}
}
public class ProjectionState : ProjectionDataBase
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _state;
public ProjectionState(
string name, string partition, string state, CheckpointTag position, Exception exception = null)
: base(name, partition, position, exception)
{
_state = state;
}
public string State
{
get { return _state; }
}
}
public class ProjectionResult : ProjectionDataBase
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _result;
public ProjectionResult(
string name, string partition, string result, CheckpointTag position, Exception exception = null)
: base(name, partition, position, exception)
{
_result = result;
}
public string Result
{
get { return _result; }
}
}
public class ProjectionQuery : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
private readonly string _query;
private readonly bool _emitEnabled;
private readonly ProjectionSourceDefinition _definition;
public ProjectionQuery(string name, string query, bool emitEnabled, ProjectionSourceDefinition definition)
{
_name = name;
_query = query;
_emitEnabled = emitEnabled;
_definition = definition;
}
public string Name
{
get { return _name; }
}
public string Query
{
get { return _query; }
}
public bool EmitEnabled
{
get { return _emitEnabled; }
}
public ProjectionSourceDefinition Definition
{
get { return _definition; }
}
}
public static class Internal
{
public class CleanupExpired: Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
}
public class RegularTimeout : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
}
public class Deleted : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
private readonly Guid _id;
public Deleted(string name, Guid id)
{
_name = name;
_id = id;
}
public string Name
{
get { return _name; }
}
public Guid Id
{
get { return _id; }
}
}
}
public sealed class RequestSystemProjections : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
public readonly IEnvelope Envelope;
public RequestSystemProjections(IEnvelope envelope)
{
Envelope = envelope;
}
}
public sealed class RegisterSystemProjection : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
public readonly string Name;
public readonly string Handler;
public readonly string Query;
public RegisterSystemProjection(string name, string handler, string query)
{
Name = name;
Handler = handler;
Query = query;
}
}
public class StartSlaveProjections : ControlMessage
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly string _name;
private readonly SlaveProjectionDefinitions _slaveProjections;
private readonly IPublisher _resultsPublisher;
private readonly Guid _masterCorrelationId;
public StartSlaveProjections(
IEnvelope envelope, RunAs runAs, string name, SlaveProjectionDefinitions slaveProjections,
IPublisher resultsPublisher, Guid masterCorrelationId)
: base(envelope, runAs)
{
_name = name;
_slaveProjections = slaveProjections;
_resultsPublisher = resultsPublisher;
_masterCorrelationId = masterCorrelationId;
}
public string Name
{
get { return _name; }
}
public SlaveProjectionDefinitions SlaveProjections
{
get { return _slaveProjections; }
}
public IPublisher ResultsPublisher
{
get { return _resultsPublisher; }
}
public Guid MasterCorrelationId
{
get { return _masterCorrelationId; }
}
}
public class SlaveProjectionsStarted : Message
{
private static readonly int TypeId = System.Threading.Interlocked.Increment(ref NextMsgId);
public override int MsgTypeId { get { return TypeId; } }
private readonly Guid _coreProjectionCorrelationId;
private readonly SlaveProjectionCommunicationChannels _slaveProjections;
public SlaveProjectionsStarted(Guid coreProjectionCorrelationId, SlaveProjectionCommunicationChannels slaveProjections)
{
_coreProjectionCorrelationId = coreProjectionCorrelationId;
_slaveProjections = slaveProjections;
}
public Guid CoreProjectionCorrelationId
{
get { return _coreProjectionCorrelationId; }
}
public SlaveProjectionCommunicationChannels SlaveProjections
{
get { return _slaveProjections; }
}
}
}
} | 32.551963 | 158 | 0.53785 | [
"BSD-3-Clause"
] | ianbattersby/EventStore | src/EventStore/EventStore.Projections.Core/Messages/ProjectionManagementMessage.cs | 28,190 | C# |
//
// IMonsterInfo.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using NosSmooth.Data.Abstractions.Language;
namespace NosSmooth.Data.Abstractions.Infos;
/// <summary>
/// The NosTale monster information.
/// </summary>
public interface IMonsterInfo : IVNumInfo
{
/// <summary>
/// Gets the name of the monster.
/// </summary>
TranslatableString Name { get; }
/// <summary>
/// Gets the default level of the monster.
/// </summary>
ushort Level { get; }
} | 24.56 | 102 | 0.674267 | [
"MIT"
] | Rutherther/NosSmooth | Data/NosSmooth.Data.Abstractions/Infos/IMonsterInfo.cs | 619 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.ApplicationModel.DataTransfer
{
#if false || false || false || false || false || false || false
[global::Uno.NotImplemented]
#endif
public partial class DataProviderRequest
{
// Skipping already declared property Deadline
// Skipping already declared property FormatId
// Forced skipping of method Windows.ApplicationModel.DataTransfer.DataProviderRequest.FormatId.get
// Forced skipping of method Windows.ApplicationModel.DataTransfer.DataProviderRequest.Deadline.get
// Skipping already declared method Windows.ApplicationModel.DataTransfer.DataProviderRequest.GetDeferral()
// Skipping already declared method Windows.ApplicationModel.DataTransfer.DataProviderRequest.SetData(object)
}
}
| 46.055556 | 111 | 0.803378 | [
"Apache-2.0"
] | AbdalaMask/uno | src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.DataTransfer/DataProviderRequest.cs | 829 | C# |
using NSpec;
using NUnit.Framework;
namespace Coypu.Drivers.Tests
{
internal class When_choosing : DriverSpecs
{
[Test]
public void Chooses_radio_button_from_list()
{
var radioButton1 = Field("chooseRadio1");
radioButton1.Selected.should_be_false();
// Choose 1
Driver.Choose(radioButton1);
var radioButton2 = Field("chooseRadio2");
radioButton2.Selected.should_be_false();
// Choose 2
Driver.Choose(radioButton2);
// New choice is now selected
radioButton2 = Field("chooseRadio2");
radioButton2.Selected.should_be_true();
// Originally selected is no longer selected
radioButton1 = Field("chooseRadio1");
radioButton1.Selected.should_be_false();
}
[Test]
public void Fires_onclick_event()
{
var radio = Field("chooseRadio2");
radio.Value.should_be("Radio buttons - 2nd value");
Driver.Choose(radio);
Field("chooseRadio2", Root).Value.should_be("Radio buttons - 2nd value - clicked");
}
}
} | 28.090909 | 96 | 0.56068 | [
"MIT",
"Unlicense"
] | Jetski5822/coypu | src/Coypu.Drivers.Tests/When_choosing.cs | 1,238 | C# |
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Exit Games GmbH"/>
// <summary>Demo code for Photon Chat in Unity.</summary>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using Photon.Realtime;
namespace Photon.Chat.Demo
{
public static class AppSettingsExtensions
{
public static ChatAppSettings GetChatSettings(this AppSettings appSettings)
{
return new ChatAppSettings
{
AppIdChat = appSettings.AppIdChat,
AppVersion = appSettings.AppVersion,
FixedRegion = appSettings.IsBestRegion ? null : appSettings.FixedRegion,
NetworkLogging = appSettings.NetworkLogging,
Protocol = appSettings.Protocol,
EnableProtocolFallback = appSettings.EnableProtocolFallback,
Server = appSettings.IsDefaultNameServer ? null : appSettings.Server,
Port = (ushort)appSettings.Port
};
}
}
} | 41.866667 | 120 | 0.476911 | [
"Unlicense"
] | 23SAMY23/Meet-and-Greet-MR | Meet & Greet MR (AR)/Assets/Photon/PhotonChat/Demos/DemoChat/AppSettingsExtensions.cs | 1,258 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SampleWithUnity.Models
{
public class FooDto
{
}
} | 14.454545 | 33 | 0.72956 | [
"MIT"
] | raychiutw/ioc-di-sample | src/SampleWithUnity/Models/FooDto.cs | 161 | C# |
using AccountingNote.Auth;
using AccountingNote.DBSource;
using AccountingNote.ORM.DBModel;
using AccountingNote1.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace AccountingNote.SystemAdmin
{
public partial class AccountingDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//if (this.Session["UserLoginInfo"] == null)
if(!AuthManager.IsLogined())
{
Response.Redirect("/Login.aspx");
return;
}
string account = this.Session["UserLoginInfo"] as string;
var currentUser = AuthManager.GetCurrentUser();
if (currentUser == null)
{
this.Session["UserLoginInfo"] = null;
Response.Redirect("/Login.aspx");
return;
}
if (!this.IsPostBack)
{
//check is create made or edit mode
if (this.Request.QueryString["ID"] == null)
{
this.btnDel.Visible = false;
}
else
{
this.btnDel.Visible = true;
string idText = this.Request.QueryString["ID"]; //由網址頁取得ID
int id;
if (int.TryParse(idText, out id)) //確認能否轉型成數字
{
var accounting = AccountingManager.GetAccounting(id, currentUser.ID); //再轉型成內容
if (accounting == null) //點了超連結進來
{
this.Itmsg.Text = "Data doesn't exit";
this.btnsave.Visible = false;
this.btnDel.Visible = false;
}
else
{
this.ddlActType.SelectedValue = accounting.ActType.ToString();
this.TxtAmount.Text = accounting.Amount.ToString();
this.TxtCap.Text = accounting.Caption;
this.TxtDesc.Text = accounting.Body;
}
}
else
{
this.Itmsg.Text = "ID is Required!";
this.btnsave.Visible = false;
this.btnDel.Visible = false;
}
}
}
}
protected void btnsave_Click(object sender, EventArgs e)
{
List<string> msgList = new List<string>();
if (!this.CheckInput(out msgList)) //如果沒檢查到錯誤就不會執行
{
// 假設檢查失敗就執行下列
this.Itmsg.Text = string.Join("<br/>", msgList); //執行字串結合
return; //停掉程式
}
//取值
UserInfoModel currentUser = AuthManager.GetCurrentUser();
//string account = this.Session["UserLoginInfo"] as string;
//var dr = UserInfoManager.GetUserInfoByAccount(account);
if (currentUser == null)
{
Response.Redirect("/Login.aspx");
return;
}
//通過即一個一個取得輸入值
Guid userID = currentUser.ID;
string actTypeText = this.ddlActType.SelectedValue; //需要注意轉型
string amountText = this.TxtAmount.Text; //需要注意轉型
int amount = Convert.ToInt32(amountText);
int actType = Convert.ToInt32(actTypeText);
string idText = this.Request.QueryString["ID"]; //由網址頁取得ID
int id = Convert.ToInt32(idText);
Accounting accounting = new Accounting()
{
UserID = userID,
ID = id,
ActType = actType,
Amount = amount,
Caption = this.TxtCap.Text,
Body = this.TxtDesc.Text
};
if (string.IsNullOrWhiteSpace(idText))
{
//新增模式
// Execute 'Insert into db'
//AccountingManager.CreateAccounting(userID, caption, amount, actType, body);
AccountingManager.CreateAccounting(accounting);
}
else
{
//編輯修改模式
if (int.TryParse(idText, out id))
{
// Execute 'update db'
// 如果是修改模式 如何拿到使用者id? ==> 使用Session取得現在登入的是誰,再取得其userID
AccountingManager.UpdateAccounting(accounting);
}
}
Response.Redirect("/SystemAdmin/AccountingList.aspx");
}
private bool CheckInput(out List<string> errorMsgList) //out字串 回傳錯誤訊息 //回傳值為布林,代表通過或不通過
{
List<string> msgList = new List<string>(); //字串清單存放提示文字
// Type檢查
if (this.ddlActType.SelectedValue != "0"
&& this.ddlActType.SelectedValue != "1")
{
msgList.Add("Type must be 0 or 1");
}
//Amount檢查是否為空字串
if (string.IsNullOrWhiteSpace(this.TxtAmount.Text))
{
msgList.Add("Amount is required");
}
else
{
//如果不是空字串就轉型成整數
int tempInt;
if(!int.TryParse(this.TxtAmount.Text, out tempInt))
{
msgList.Add("Amount must be a number."); //如果轉換失敗就出現提示文字
}
if(tempInt < 0 || tempInt > 1000000)
{
msgList.Add("Amount is out of range");
}
}
errorMsgList = msgList; //因為使用了out所以一定要初始化
if (msgList.Count == 0) //沒有任何錯誤訊息
return true;
else
return false;
}
protected void btnDel_Click(object sender, EventArgs e)
{
string idtext = this.Request.QueryString["ID"];
if (string.IsNullOrWhiteSpace(idtext))
return;
// if 我用string id 刪除,容易透過client端修改造成程式問題
int id; //確認方法的指定型別
if(int.TryParse(idtext, out id))
{
AccountingManager.DeleteAccounting_ORM(id);
}
Response.Redirect("/SystemAdmin/AccountingList.aspx");
}
}
} | 34.851852 | 103 | 0.46607 | [
"MIT"
] | UserKen-first/WebFormMiniDataBase | WebDB/AccountingNote1/SystemAdmin/AccountingDetail.aspx.cs | 7,091 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace _02.SimpleWebFormsApp
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
} | 18.294118 | 60 | 0.691318 | [
"MIT"
] | ni4ka7a/TelerikAcademyHomeworks | ASP.NET-WebForms/02.WebFormsIntro/02.SimpleWebFormsApp/Default.aspx.cs | 313 | C# |
using Discord.Commands;
using Discord.WebSocket;
using DragonLore.MagicNumbers.Roles;
using DragonLore.Managers;
using DragonLore.Models;
using Newtonsoft.Json;
using System;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace DragonLore.Modules
{
public class CsgoModule : ModuleBase<SocketCommandContext>
{
private readonly IBotMessageManager _botMessage;
private readonly IRoles _roles;
public CsgoModule(IBotMessageManager botMessage, IRoles roles)
{
_botMessage = botMessage;
_roles = roles;
}
[Command("Inventory", RunMode = RunMode.Async)]
[Summary("Get inventory value of player")]
public async Task Inventory(string steamId)
{
var user = Context.Message.Author as SocketGuildUser;
using (var webClient = new HttpClient())
{
var result = await webClient.GetAsync($"http://csgobackpack.net/api/GetInventoryValue/?id={steamId}");
string jsonContent = await result.Content.ReadAsStringAsync();
var inventoryData = JsonConvert.DeserializeObject<Inventory>(jsonContent);
var messageContent = inventoryData.Success ?
$"**Player:** {steamId}{Environment.NewLine}**Inventory value:** {inventoryData.Value} {inventoryData.Currency}{Environment.NewLine}**Items:** {inventoryData.Items}" :
$"**Error** {Environment.NewLine}Are you sure you entered a correct steamID?{Environment.NewLine}You can get your steamID from your profile url.";
await _botMessage.SendAndRemoveEmbedAsync(messageContent, Context, user);
}
}
[Command("Faceit", RunMode = RunMode.Async)]
[Summary("Add or remove the Faceit role")]
public async Task Faceit(string state = "on")
{
// FaceIt role ID 285441809709137921
var user = Context.Message.Author as SocketGuildUser;
string messageContent;
switch (state.ToLower())
{
case "on":
if (!user.Roles.Contains(_roles.FaceIt))
{
await user.AddRoleAsync(_roles.FaceIt);
messageContent = "Now has the FaceIt role.";
}
else
messageContent = "Already has the FaceIt role.";
break;
case "off":
if (user.Roles.Contains(_roles.FaceIt))
{
await user.RemoveRoleAsync(_roles.FaceIt);
messageContent = "Removed the FaceIt role";
}
else
messageContent = "Does not have the FaceIt role.";
break;
default:
messageContent = $"**Error**{Environment.NewLine}Make sure you specify if you want to put the FaceIt role on or off.";
break;
}
await _botMessage.SendAndRemoveEmbedAsync(messageContent, Context, user);
}
[Command("Esea", RunMode = RunMode.Async)]
[Summary("Add or remove the ESEA role")]
public async Task Esea(string state = "on")
{
// ESEA role ID 285441890126397450
var user = Context.Message.Author as SocketGuildUser;
string messageContent;
switch (state.ToLower())
{
case "on":
if (!user.Roles.Contains(_roles.Esea))
{
await user.AddRoleAsync(_roles.Esea);
messageContent = "Now has the ESEA role.";
}
else
messageContent = "Already has the ESEA role.";
break;
case "off":
if (user.Roles.Contains(_roles.Esea))
{
await user.RemoveRoleAsync(_roles.Esea);
messageContent = "Removed the ESEA role";
}
else
messageContent = "Does not have the ESEA role.";
break;
default:
messageContent = $"**Error**{Environment.NewLine}Make sure you specify if you want to put the ESEA role on or off.";
break;
}
await _botMessage.SendAndRemoveEmbedAsync(messageContent, Context, user);
}
}
} | 40.271186 | 188 | 0.522517 | [
"MIT"
] | RyadaProductions/DragonLoreV2 | DragonLore/Modules/CsgoModule.cs | 4,754 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
namespace PeteLazuran
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
| 21.92 | 64 | 0.572993 | [
"MIT"
] | NaruzaL/PeteLazuran.com | src/PeteLazuran/Program.cs | 550 | C# |
// Collect : Collect, Store and Forward industrial data
// Copyright SPIA Tech India, www.spiatech.com
// MIT License
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace Collect.Service
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
}
protected override void OnStop()
{
}
}
}
| 19.176471 | 56 | 0.657975 | [
"MIT"
] | SPIATECH/Collect | Collect/Collect.Service/Collect.Common.svc/Service1.cs | 652 | C# |
// Copyright 2017-2021 Elringus (Artyom Sovetnikov). All rights reserved.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Naninovel
{
public class ProjectResourceLocator<TResource> : LocateResourcesRunner<TResource>
where TResource : UnityEngine.Object
{
private readonly IReadOnlyDictionary<string, Type> projectResources;
public ProjectResourceLocator (IResourceProvider provider, string resourcesPath,
IReadOnlyDictionary<string, Type> projectResources) : base(provider, resourcesPath ?? string.Empty)
{
this.projectResources = projectResources;
}
public override UniTask RunAsync ()
{
var locatedResourcePaths = LocateProjectResources(Path, projectResources);
SetResult(locatedResourcePaths);
return UniTask.CompletedTask;
}
public static IReadOnlyCollection<string> LocateProjectResources (string resourcesPath, IReadOnlyDictionary<string, Type> projectResources)
{
return projectResources.Keys.LocateResourcePathsAtFolder(resourcesPath).ToArray();
}
}
}
| 35.333333 | 147 | 0.71012 | [
"Unlicense"
] | ChrisKindred/CartomancyGame | CartomancyGame/Assets/Naninovel/Runtime/Common/ResourceProvider/ProjectResourceLocator.cs | 1,166 | C# |
namespace Chartreuse.Today.App.VoiceCommand
{
internal static class CortanaConstants
{
internal const string VoiceCommandDefinitionVersionKey = "VoiceCommandVersion";
internal const string PhraseListFolder = "folder";
internal const string PhraseListView = "view";
internal const string PhraseListSmartView = "smartview";
internal const string PhraseListTag = "tag";
internal const string PhraseListContext = "context";
internal const string VoiceCommandFilename = "VoiceCommands.xml";
internal const string BackgroundServiceName = "VoiceCommandBackgroundService";
}
}
| 37.5 | 87 | 0.697778 | [
"MIT"
] | 2DayApp/2day | src/2Day.App.VoiceCommand/CortanaConstants.cs | 677 | C# |
using Microsoft.Xna.Framework;
namespace ShooterGame.Windows.Core
{
public interface IAnimationFactory
{
IAnimation Build(ITexture2D spriteStrip, int frameWidth, int frameTime, int frameCount, bool looping = true,
float scale = 1.0f, Color color = default(Color));
}
} | 30.1 | 116 | 0.707641 | [
"Apache-2.0"
] | becdetat/monogame-tw-tutorial | src/ShooterGame.Windows/Core/IAnimationFactory.cs | 301 | C# |
using System.IO;
using System.Runtime.Serialization;
using WolvenKit.CR2W.Reflection;
using FastMember;
using static WolvenKit.CR2W.Types.Enums;
namespace WolvenKit.CR2W.Types
{
[DataContract(Namespace = "")]
[REDMeta]
public class CBTCondIsActionTargetPlayerDef : IBehTreeReactionTaskDefinition
{
public CBTCondIsActionTargetPlayerDef(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name){ }
public static new CVariable Create(CR2WFile cr2w, CVariable parent, string name) => new CBTCondIsActionTargetPlayerDef(cr2w, parent, name);
public override void Read(BinaryReader file, uint size) => base.Read(file, size);
public override void Write(BinaryWriter file) => base.Write(file);
}
} | 32.391304 | 142 | 0.759732 | [
"MIT"
] | DerinHalil/CP77Tools | CP77.CR2W/Types/W3/RTTIConvert/CBTCondIsActionTargetPlayerDef.cs | 723 | C# |
/*
* Generated code file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
*/
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
// Image 36: Newtonsoft.Json.dll - Assembly: Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed - Types 5284-5564
namespace Newtonsoft.Json.Serialization
{
public class CamelCaseNamingStrategy : NamingStrategy // TypeDefIndex: 5424
{
// Constructors
public CamelCaseNamingStrategy(); // 0x00000001802686E0-0x00000001802686F0
// Methods
[NullableContext] // 0x0000000180014D90-0x0000000180014DB0
protected override string ResolvePropertyName(string name); // 0x00000001803C6330-0x00000001803C6340
}
}
| 31.555556 | 146 | 0.794601 | [
"MIT"
] | TotalJTM/PrimitierModdingFramework | Dumps/PrimitierDumpV1.0.1/Newtonsoft/Json/Serialization/CamelCaseNamingStrategy.cs | 854 | C# |
/*
* CLR版本: 4.0.30319.42000
* 命名空间名称/文件名: Volo.Abp.AuditLogging.HttpApi.Volo.Abp.AuditLogging/AuditLoggingHttpApiModule
* 创建者:天上有木月
* 创建时间:2019/4/2 12:19:33
* 邮箱:igeekfan@foxmail.com
* 文件功能描述:
*
* 修改人:
* 时间:
* 修改说明:
*/
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AuditLogging.Application.Contracts.Volo.Abp.AuditLogging;
using Volo.Abp.Modularity;
namespace Volo.Abp.AuditLogging.HttpApi.Volo.Abp.AuditLogging
{
[DependsOn(
typeof(AuditLoggingApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class AuditLoggingHttpApiModule:AbpModule
{
}
}
| 23.5 | 94 | 0.728314 | [
"Apache-2.0"
] | burningmyself/microservice | modules/audit-logging/src/Volo.Abp.AuditLogging.HttpApi/Volo/Abp/AuditLogging/AuditLoggingHttpApiModule.cs | 707 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Swiss_Tournament.Language {
using System;
/// <summary>
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
/// </summary>
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
// 클래스에서 자동으로 생성되었습니다.
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class en_US {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal en_US() {
}
/// <summary>
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Swiss_Tournament.Language.en-US", typeof(en_US).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
/// 재정의합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string count_games {
get {
return ResourceManager.GetString("count_games", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string count_participants {
get {
return ResourceManager.GetString("count_participants", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string count_remain_games {
get {
return ResourceManager.GetString("count_remain_games", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string create_date {
get {
return ResourceManager.GetString("create_date", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string description {
get {
return ResourceManager.GetString("description", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string remain_job {
get {
return ResourceManager.GetString("remain_job", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string tab_participants_manage {
get {
return ResourceManager.GetString("tab_participants_manage", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string tab_round_manage {
get {
return ResourceManager.GetString("tab_round_manage", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string tab_summary {
get {
return ResourceManager.GetString("tab_summary", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string tab_tournament_manage {
get {
return ResourceManager.GetString("tab_tournament_manage", resourceCulture);
}
}
/// <summary>
/// 스위스 토너먼트 시뮬레이터과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string title {
get {
return ResourceManager.GetString("title", resourceCulture);
}
}
}
}
| 33.932515 | 172 | 0.528295 | [
"MIT",
"Unlicense"
] | rollrat/swiss-tournament | Swiss Tournament/Language/en-US.Designer.cs | 6,413 | C# |
#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif
using XLua;
using System.Collections.Generic;
namespace XLua.CSObjectWrap
{
using Utils = XLua.Utils;
public partial class SystemRuntimeCompilerServicesAsyncMethodBuilderAttributeWrap
{
public static void __Register(RealStatePtr L)
{
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.Type type = typeof(System.Runtime.CompilerServices.AsyncMethodBuilderAttribute);
Utils.BeginObjectRegister(type, L, translator, 0, 1, 1, 0);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "getBuilderType", _g_get_BuilderType);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "BuilderType", _g_get_BuilderType);
Utils.EndObjectRegister(type, L, translator, null, null,
null, null, null);
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
Utils.EndClassRegister(type, L, translator);
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int __CreateInstance(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<System.Type>(L, 2))
{
System.Type _builderType = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
System.Runtime.CompilerServices.AsyncMethodBuilderAttribute gen_ret = new System.Runtime.CompilerServices.AsyncMethodBuilderAttribute(_builderType);
translator.Push(L, gen_ret);
return 1;
}
}
catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return LuaAPI.luaL_error(L, "invalid arguments to System.Runtime.CompilerServices.AsyncMethodBuilderAttribute constructor!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_BuilderType(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.Runtime.CompilerServices.AsyncMethodBuilderAttribute gen_to_be_invoked = (System.Runtime.CompilerServices.AsyncMethodBuilderAttribute)translator.FastGetCSObj(L, 1);
translator.Push(L, gen_to_be_invoked.BuilderType);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 1;
}
}
}
| 23.601563 | 187 | 0.620986 | [
"MIT"
] | dayfox5317/ET_Lua | Unity/Assets/Cold/XLua/Gen/SystemRuntimeCompilerServicesAsyncMethodBuilderAttributeWrap.cs | 3,023 | C# |
using CnGalWebSite.DataModel.Application.Dtos;
namespace CnGalWebSite.APIServer.Application.Entries.Dtos
{
public class GetEntryInput : PagedSortedAndFilterInput
{
public GetEntryInput()
{
Sorting = "Id";
ScreeningConditions = "全部";
}
}
}
| 20.133333 | 58 | 0.63245 | [
"MIT"
] | CharacterRevolution/CnGalWebSite | CnGalWebSite/CnGalWebSite.APIServer/Application/Entries/Dtos/GetEntryInput.cs | 308 | C# |
using System;
using System.ComponentModel;
using CoreGraphics;
using Foundation;
using Microsoft.Maui.Graphics;
using UIKit;
namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS
{
internal class ChildViewController : UIViewController
{
public override void ViewDidLayoutSubviews()
{
foreach (var vc in ChildViewControllers)
vc.View.Frame = View.Bounds;
}
}
internal class EventedViewController : ChildViewController
{
FlyoutView _flyoutView;
event EventHandler _didAppear;
event EventHandler _willDisappear;
public EventedViewController()
{
_flyoutView = new FlyoutView();
}
public event EventHandler DidAppear
{
add
{
_flyoutView.DidAppear += value;
_didAppear += value;
}
remove
{
_flyoutView.DidAppear -= value;
_didAppear -= value;
}
}
public event EventHandler WillDisappear
{
add
{
_flyoutView.WillDisappear += value;
_willDisappear += value;
}
remove
{
_flyoutView.WillDisappear -= value;
_willDisappear -= value;
}
}
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
_didAppear?.Invoke(this, EventArgs.Empty);
}
public override void ViewWillDisappear(bool animated)
{
base.ViewWillDisappear(animated);
_willDisappear?.Invoke(this, EventArgs.Empty);
}
public override void ViewDidDisappear(bool animated)
{
base.ViewDidDisappear(animated);
_willDisappear?.Invoke(this, EventArgs.Empty);
}
public override void LoadView()
{
View = _flyoutView;
}
public class FlyoutView : UIView
{
public bool IsCollapsed => Center.X <= 0;
bool _previousIsCollapsed = true;
public event EventHandler DidAppear;
public event EventHandler WillDisappear;
// this only gets called on iOS12 everytime it's collapsed or expanded
// I haven't found an override on iOS13 that gets called but it doesn't seem
// to matter because the DidAppear and WillDisappear seem more consistent on iOS 13
public override void LayoutSubviews()
{
base.LayoutSubviews();
UpdateCollapsedSetting();
}
void UpdateCollapsedSetting()
{
if (_previousIsCollapsed != IsCollapsed)
{
_previousIsCollapsed = IsCollapsed;
if (IsCollapsed)
WillDisappear?.Invoke(this, EventArgs.Empty);
else
DidAppear?.Invoke(this, EventArgs.Empty);
}
}
}
}
public class TabletFlyoutPageRenderer : UISplitViewController, IVisualElementRenderer, IEffectControlProvider
{
UIViewController _detailController;
bool _disposed;
EventTracker _events;
InnerDelegate _innerDelegate;
nfloat _flyoutWidth = 0;
EventedViewController _flyoutController;
FlyoutPage _flyoutPage;
VisualElementTracker _tracker;
CGSize _previousSize = CGSize.Empty;
CGSize _previousViewDidLayoutSize = CGSize.Empty;
UISplitViewControllerDisplayMode _previousDisplayMode = UISplitViewControllerDisplayMode.Automatic;
Page PageController => Element as Page;
Element ElementController => Element as Element;
bool IsFlyoutVisible => !(_flyoutController?.View as EventedViewController.FlyoutView).IsCollapsed;
protected FlyoutPage FlyoutPage => _flyoutPage ?? (_flyoutPage = (FlyoutPage)Element);
[Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)]
public TabletFlyoutPageRenderer()
{
}
protected override void Dispose(bool disposing)
{
if (_disposed)
{
return;
}
_disposed = true;
if (disposing)
{
if (Element != null)
{
PageController.SendDisappearing();
Element.PropertyChanged -= HandlePropertyChanged;
if (FlyoutPage?.Flyout != null)
{
FlyoutPage.Flyout.PropertyChanged -= HandleFlyoutPropertyChanged;
}
Element = null;
}
if (_tracker != null)
{
_tracker.Dispose();
_tracker = null;
}
if (_events != null)
{
_events.Dispose();
_events = null;
}
if (_flyoutController != null)
{
_flyoutController.DidAppear -= FlyoutControllerDidAppear;
_flyoutController.WillDisappear -= FlyoutControllerWillDisappear;
}
ClearControllers();
}
base.Dispose(disposing);
}
public VisualElement Element { get; private set; }
public event EventHandler<VisualElementChangedEventArgs> ElementChanged;
public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
{
return NativeView.GetSizeRequest(widthConstraint, heightConstraint);
}
public UIView NativeView
{
get { return View; }
}
public void SetElement(VisualElement element)
{
var oldElement = Element;
Element = element;
ViewControllers = new[] { _flyoutController = new EventedViewController(), _detailController = new ChildViewController() };
if (!Forms.IsiOS9OrNewer)
Delegate = _innerDelegate = new InnerDelegate(FlyoutPage.FlyoutLayoutBehavior);
UpdateControllers();
_flyoutController.DidAppear += FlyoutControllerDidAppear;
_flyoutController.WillDisappear += FlyoutControllerWillDisappear;
PresentsWithGesture = FlyoutPage.IsGestureEnabled;
OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
EffectUtilities.RegisterEffectControlProvider(this, oldElement, element);
if (element != null)
element.SendViewInitialized(NativeView);
}
public void SetElementSize(Size size)
{
Element.Layout(new Rectangle(Element.X, Element.Width, size.Width, size.Height));
}
public UIViewController ViewController
{
get { return this; }
}
public override void ViewDidAppear(bool animated)
{
PageController.SendAppearing();
base.ViewDidAppear(animated);
ToggleFlyout();
}
public override void ViewDidDisappear(bool animated)
{
base.ViewDidDisappear(animated);
PageController?.SendDisappearing();
}
public override void ViewDidLayoutSubviews()
{
base.ViewDidLayoutSubviews();
bool layoutFlyout = false;
bool layoutDetails = false;
if (Forms.IsiOS13OrNewer)
{
layoutFlyout = _flyoutController?.View?.Superview != null;
layoutDetails = _detailController?.View?.Superview != null;
}
else if (View.Subviews.Length < 2)
{
return;
}
else
{
layoutFlyout = true;
layoutDetails = true;
}
if (layoutFlyout)
{
var flyoutBounds = _flyoutController.View.Frame;
if (Forms.IsiOS13OrNewer)
_flyoutWidth = flyoutBounds.Width;
else
_flyoutWidth = (nfloat)Math.Max(_flyoutWidth, flyoutBounds.Width);
if (!flyoutBounds.IsEmpty)
FlyoutPage.FlyoutBounds = new Rectangle(0, 0, _flyoutWidth, flyoutBounds.Height);
}
if (layoutDetails)
{
var detailsBounds = _detailController.View.Frame;
if (!detailsBounds.IsEmpty)
FlyoutPage.DetailBounds = new Rectangle(0, 0, detailsBounds.Width, detailsBounds.Height);
}
if (_previousViewDidLayoutSize == CGSize.Empty)
_previousViewDidLayoutSize = View.Bounds.Size;
// Is this being called from a rotation
if (_previousViewDidLayoutSize != View.Bounds.Size)
{
_previousViewDidLayoutSize = View.Bounds.Size;
// make sure IsPresented matches state of Flyout View
if (FlyoutPage.CanChangeIsPresented && FlyoutPage.IsPresented != IsFlyoutVisible)
ElementController.SetValueFromRenderer(Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty, IsFlyoutVisible);
}
if (_previousDisplayMode != PreferredDisplayMode)
{
_previousDisplayMode = PreferredDisplayMode;
// make sure IsPresented matches state of Flyout View
if (FlyoutPage.CanChangeIsPresented && FlyoutPage.IsPresented != IsFlyoutVisible)
ElementController.SetValueFromRenderer(Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty, IsFlyoutVisible);
}
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
UpdateBackground();
UpdateFlowDirection();
UpdateFlyoutLayoutBehavior(View.Bounds.Size);
_tracker = new VisualElementTracker(this);
_events = new EventTracker(this);
_events.LoadEvents(NativeView);
}
void UpdateFlyoutLayoutBehavior(CGSize newBounds)
{
FlyoutPage flyoutDetailPage = _flyoutPage ?? Element as FlyoutPage;
if (flyoutDetailPage == null)
return;
bool isPortrait = newBounds.Height > newBounds.Width;
var previous = PreferredDisplayMode;
switch (flyoutDetailPage.FlyoutLayoutBehavior)
{
case FlyoutLayoutBehavior.Split:
PreferredDisplayMode = UISplitViewControllerDisplayMode.AllVisible;
break;
case FlyoutLayoutBehavior.Popover:
PreferredDisplayMode = UISplitViewControllerDisplayMode.PrimaryHidden;
break;
case FlyoutLayoutBehavior.SplitOnPortrait:
PreferredDisplayMode = (isPortrait) ? UISplitViewControllerDisplayMode.AllVisible : UISplitViewControllerDisplayMode.PrimaryHidden;
break;
case FlyoutLayoutBehavior.SplitOnLandscape:
PreferredDisplayMode = (!isPortrait) ? UISplitViewControllerDisplayMode.AllVisible : UISplitViewControllerDisplayMode.PrimaryHidden;
break;
default:
PreferredDisplayMode = UISplitViewControllerDisplayMode.Automatic;
break;
}
if (previous == PreferredDisplayMode)
return;
if (!FlyoutPage.ShouldShowSplitMode)
FlyoutPage.CanChangeIsPresented = true;
FlyoutPage.UpdateFlyoutLayoutBehavior();
}
public override void ViewWillDisappear(bool animated)
{
if (IsFlyoutVisible && !FlyoutPage.ShouldShowSplitMode)
PerformButtonSelector();
base.ViewWillDisappear(animated);
}
public override void ViewWillLayoutSubviews()
{
base.ViewWillLayoutSubviews();
_flyoutController.View.BackgroundColor = ColorExtensions.BackgroundColor;
}
public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)
{
// I tested this code on iOS9+ and it's never called
if (!Forms.IsiOS9OrNewer)
{
if (!FlyoutPage.ShouldShowSplitMode && IsFlyoutVisible)
{
FlyoutPage.CanChangeIsPresented = true;
PreferredDisplayMode = UISplitViewControllerDisplayMode.PrimaryHidden;
PreferredDisplayMode = UISplitViewControllerDisplayMode.Automatic;
}
FlyoutPage.UpdateFlyoutLayoutBehavior();
MessagingCenter.Send<IVisualElementRenderer>(this, NavigationRenderer.UpdateToolbarButtons);
}
base.WillRotate(toInterfaceOrientation, duration);
}
public override UIViewController ChildViewControllerForStatusBarHidden()
{
if (((FlyoutPage)Element).Detail != null)
return (UIViewController)Platform.GetRenderer(((FlyoutPage)Element).Detail);
else
return base.ChildViewControllerForStatusBarHidden();
}
public override UIViewController ChildViewControllerForHomeIndicatorAutoHidden
{
get
{
if (((FlyoutPage)Element).Detail != null)
return (UIViewController)Platform.GetRenderer(((FlyoutPage)Element).Detail);
else
return base.ChildViewControllerForHomeIndicatorAutoHidden;
}
}
protected virtual void OnElementChanged(VisualElementChangedEventArgs e)
{
if (e.OldElement != null)
e.OldElement.PropertyChanged -= HandlePropertyChanged;
if (e.NewElement != null)
e.NewElement.PropertyChanged += HandlePropertyChanged;
var changed = ElementChanged;
if (changed != null)
changed(this, e);
_flyoutWidth = 0;
}
void ClearControllers()
{
foreach (var controller in _flyoutController.ChildViewControllers)
{
controller.View.RemoveFromSuperview();
controller.RemoveFromParentViewController();
}
foreach (var controller in _detailController.ChildViewControllers)
{
controller.View.RemoveFromSuperview();
controller.RemoveFromParentViewController();
}
}
void HandleFlyoutPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == Page.IconImageSourceProperty.PropertyName || e.PropertyName == Page.TitleProperty.PropertyName)
MessagingCenter.Send<IVisualElementRenderer>(this, NavigationRenderer.UpdateToolbarButtons);
}
void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (_tracker == null)
return;
if (e.PropertyName == "Flyout" || e.PropertyName == "Detail")
UpdateControllers();
else if (e.PropertyName == Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty.PropertyName)
ToggleFlyout();
else if (e.PropertyName == Microsoft.Maui.Controls.FlyoutPage.IsGestureEnabledProperty.PropertyName)
base.PresentsWithGesture = this.FlyoutPage.IsGestureEnabled;
else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName || e.PropertyName == VisualElement.BackgroundProperty.PropertyName)
UpdateBackground();
else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
UpdateFlowDirection();
else if (e.Is(Microsoft.Maui.Controls.FlyoutPage.FlyoutLayoutBehaviorProperty))
UpdateFlyoutLayoutBehavior(base.View.Bounds.Size);
MessagingCenter.Send<IVisualElementRenderer>(this, NavigationRenderer.UpdateToolbarButtons);
}
public override void ViewWillTransitionToSize(CGSize toSize, IUIViewControllerTransitionCoordinator coordinator)
{
base.ViewWillTransitionToSize(toSize, coordinator);
if (_previousSize != toSize)
{
_previousSize = toSize;
UpdateFlyoutLayoutBehavior(toSize);
}
}
void FlyoutControllerDidAppear(object sender, EventArgs e)
{
if (FlyoutPage.CanChangeIsPresented && IsFlyoutVisible)
ElementController.SetValueFromRenderer(Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty, true);
}
void FlyoutControllerWillDisappear(object sender, EventArgs e)
{
if (FlyoutPage.CanChangeIsPresented && !IsFlyoutVisible)
ElementController.SetValueFromRenderer(Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty, false);
}
void PerformButtonSelector()
{
DisplayModeButtonItem.Target.PerformSelector(DisplayModeButtonItem.Action, DisplayModeButtonItem, 0);
}
void ToggleFlyout()
{
if (IsFlyoutVisible == FlyoutPage.IsPresented || FlyoutPage.ShouldShowSplitMode)
return;
PerformButtonSelector();
}
void UpdateBackground()
{
_ = this.ApplyNativeImageAsync(Page.BackgroundImageSourceProperty, bgImage =>
{
if (bgImage != null)
View.BackgroundColor = UIColor.FromPatternImage(bgImage);
else
{
Brush background = Element.Background;
if (!Brush.IsNullOrEmpty(background))
View.UpdateBackground(Element.Background);
else
{
if (Element.BackgroundColor == null)
View.BackgroundColor = UIColor.White;
else
View.BackgroundColor = Element.BackgroundColor.ToUIColor();
}
}
});
}
void UpdateControllers()
{
FlyoutPage.Flyout.PropertyChanged -= HandleFlyoutPropertyChanged;
if (Platform.GetRenderer(FlyoutPage.Flyout) == null)
Platform.SetRenderer(FlyoutPage.Flyout, Platform.CreateRenderer(FlyoutPage.Flyout));
if (Platform.GetRenderer(FlyoutPage.Detail) == null)
Platform.SetRenderer(FlyoutPage.Detail, Platform.CreateRenderer(FlyoutPage.Detail));
ClearControllers();
FlyoutPage.Flyout.PropertyChanged += HandleFlyoutPropertyChanged;
var flyout = Platform.GetRenderer(FlyoutPage.Flyout).ViewController;
var detail = Platform.GetRenderer(FlyoutPage.Detail).ViewController;
_flyoutController.View.AddSubview(flyout.View);
_flyoutController.AddChildViewController(flyout);
_detailController.View.AddSubview(detail.View);
_detailController.AddChildViewController(detail);
}
void UpdateFlowDirection()
{
if (NativeView.UpdateFlowDirection(Element) && Forms.IsiOS13OrNewer && NativeView.Superview != null)
{
var view = NativeView.Superview;
NativeView.RemoveFromSuperview();
view.AddSubview(NativeView);
}
}
class InnerDelegate : UISplitViewControllerDelegate
{
readonly FlyoutLayoutBehavior _flyoutPresentedDefaultState;
public InnerDelegate(FlyoutLayoutBehavior flyoutPresentedDefaultState)
{
_flyoutPresentedDefaultState = flyoutPresentedDefaultState;
}
public override bool ShouldHideViewController(UISplitViewController svc, UIViewController viewController, UIInterfaceOrientation inOrientation)
{
bool willHideViewController;
switch (_flyoutPresentedDefaultState)
{
case FlyoutLayoutBehavior.Split:
willHideViewController = false;
break;
case FlyoutLayoutBehavior.Popover:
willHideViewController = true;
break;
case FlyoutLayoutBehavior.SplitOnPortrait:
willHideViewController = !(inOrientation == UIInterfaceOrientation.Portrait || inOrientation == UIInterfaceOrientation.PortraitUpsideDown);
break;
default:
willHideViewController = inOrientation == UIInterfaceOrientation.Portrait || inOrientation == UIInterfaceOrientation.PortraitUpsideDown;
break;
}
return willHideViewController;
}
}
void IEffectControlProvider.RegisterEffect(Effect effect)
{
VisualElementRenderer<VisualElement>.RegisterEffect(effect, View);
}
}
public class TabletMasterDetailRenderer : TabletFlyoutPageRenderer
{
[Preserve(Conditional = true)]
public TabletMasterDetailRenderer()
{
}
[Obsolete("MasterDetailPage is obsolete as of version 5.0.0. Please use FlyoutPage instead.")]
protected MasterDetailPage MasterDetailPage => (MasterDetailPage)base.FlyoutPage;
}
} | 28.097561 | 148 | 0.744792 | [
"MIT"
] | Amir-Hossin-pr/maui | src/Compatibility/Core/src/iOS/Renderers/TabletFlyoutPageRenderer.cs | 17,282 | C# |
using GraphQLToQueryable.TestData.Entities;
using Microsoft.EntityFrameworkCore;
namespace GraphQLToQueryable.EfCore
{
public class Context : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=GTQCore;Integrated Security=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<RootEntity>().ToTable("RootEntities");
}
}
}
| 29.590909 | 131 | 0.669739 | [
"MIT"
] | martinhjulstrom/GraphQLToQueryable | GraphQLToQueryable.EfCore/Context.cs | 653 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace zooperdan.AtlasMaker
{
[CreateAssetMenu(fileName = "Atlas", menuName = "zooperdan/AtlasMaker/Atlas", order = 1)]
public class Atlas : ScriptableObject
{
public string id;
[HideInInspector]
public bool enabled = true;
public List<AtlasLayer> layers = new List<AtlasLayer>();
}
} | 24.823529 | 93 | 0.677725 | [
"CC0-1.0"
] | zooperdan/AtlasMaker-for-2D-Dungeon-Crawlers | AtlasMaker/AtlasMaker/Atlas.cs | 424 | C# |
namespace iayos.intrinioapi.servicemodel.flag
{
public enum HistoricalDataType
{
/// <summary>
/// Default: Did you forget to specify which Historical Data Type to use? I bet you did...
/// </summary>
IaYoS_Warning_Unset,
/// <summary>
/// Financial year
/// </summary>
FY,
/// <summary>
/// Quarterly
/// </summary>
QTR,
/// <summary>
/// Trailing 12 months
/// </summary>
TTM,
/// <summary>
/// Year to Date
/// </summary>
YTD
}
} | 16 | 92 | 0.589583 | [
"MIT"
] | daleholborow/iayos.intrinioapi | src/iayos.intrinioapi.servicemodel.flag/HistoricalDataType.cs | 482 | 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 elasticmapreduce-2009-03-31.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.ElasticMapReduce.Model
{
/// <summary>
/// The execution status details of the cluster step.
/// </summary>
public partial class StepStatus
{
private StepState _state;
private StepStateChangeReason _stateChangeReason;
private StepTimeline _timeline;
/// <summary>
/// Gets and sets the property State.
/// <para>
/// The execution state of the cluster step.
/// </para>
/// </summary>
public StepState State
{
get { return this._state; }
set { this._state = value; }
}
// Check to see if State property is set
internal bool IsSetState()
{
return this._state != null;
}
/// <summary>
/// Gets and sets the property StateChangeReason.
/// <para>
/// The reason for the step execution status change.
/// </para>
/// </summary>
public StepStateChangeReason StateChangeReason
{
get { return this._stateChangeReason; }
set { this._stateChangeReason = value; }
}
// Check to see if StateChangeReason property is set
internal bool IsSetStateChangeReason()
{
return this._stateChangeReason != null;
}
/// <summary>
/// Gets and sets the property Timeline.
/// <para>
/// The timeline of the cluster step status over time.
/// </para>
/// </summary>
public StepTimeline Timeline
{
get { return this._timeline; }
set { this._timeline = value; }
}
// Check to see if Timeline property is set
internal bool IsSetTimeline()
{
return this._timeline != null;
}
}
} | 29.021277 | 114 | 0.601906 | [
"Apache-2.0"
] | SaschaHaertel/AmazonAWS | sdk/src/Services/ElasticMapReduce/Generated/Model/StepStatus.cs | 2,728 | C# |
/**
* This file is part of OmniAPI, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 Helion3 http://helion3.com/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
namespace OmniAPI.Entities {
/// <summary>
/// Represents a combustion generator.
/// </summary>
public interface ICombustionGeneratorEntity : IInteractable, IPlacedEntity, IReturnable {
}
}
| 45.774194 | 93 | 0.7463 | [
"MIT"
] | OutpostOmni/OmniAPI | OmniAPI/Entities/Placeable/ICombustionGeneratorEntity.cs | 1,421 | C# |
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(LanguageSchoolApp.App_Start.NinjectWebCommon), "Start")]
[assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(LanguageSchoolApp.App_Start.NinjectWebCommon), "Stop")]
namespace LanguageSchoolApp.App_Start
{
using System;
using System.Web;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
using Ninject;
using Ninject.Web.Common;
using Ninject.Extensions.Conventions;
using Data.Repositories;
using Data;
using System.Data.Entity;
using Services.Contracts;
using Services;
using Data.SaveContext;
using AutoMapper;
using Microsoft.AspNet.Identity;
using Data.Model;
using Microsoft.AspNet.Identity.Owin;
public static class NinjectWebCommon
{
private static readonly Bootstrapper bootstrapper = new Bootstrapper();
/// <summary>
/// Starts the application
/// </summary>
public static void Start()
{
DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
bootstrapper.Initialize(CreateKernel);
}
/// <summary>
/// Stops the application.
/// </summary>
public static void Stop()
{
bootstrapper.ShutDown();
}
/// <summary>
/// Creates the kernel that will manage your application.
/// </summary>
/// <returns>The created kernel.</returns>
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
try
{
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
RegisterServices(kernel);
return kernel;
}
catch
{
kernel.Dispose();
throw;
}
}
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Bind(x =>
{
x.FromThisAssembly()
.SelectAllClasses()
.BindDefaultInterface();
});
kernel.Bind(typeof(DbContext), typeof(MsSqlDbContext), typeof(IMsSqlDbContext)).To<MsSqlDbContext>().InRequestScope();
kernel.Bind(typeof(IEfRepository<>)).To(typeof(EfRepository<>));
kernel.Bind(typeof(ICourseService)).To(typeof(CourseService));
kernel.Bind(typeof(IUserService)).To(typeof(UserService));
kernel.Bind<ISaveContext>().To<SaveContext>();
kernel.Bind<IMapper>().ToMethod(x => Mapper.Instance).InSingletonScope();
kernel.Bind<IUserManagementService>().ToMethod(_ => HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>());
kernel.Bind<ISignInService>().ToMethod(_ => HttpContext.Current.GetOwinContext().Get<ApplicationSignInManager>());
}
}
}
| 36.462366 | 144 | 0.591271 | [
"MIT"
] | vasilvalkov/LanguageSchool | LanguageSchoolApp/LanguageSchoolApp/App_Start/NinjectWebCommon.cs | 3,391 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _4.Variable_in_Hexadecimal_Format
{
class Program
{
static void Main(string[] args)
{
string inputNumber = Console.ReadLine();
int number = Convert.ToInt32(inputNumber, 16);
Console.WriteLine(number);
}
}
}
| 21.421053 | 58 | 0.643735 | [
"MIT"
] | bobo4aces/02.SoftUni-TechModule | 01. PF - 98. Labs/01.30.2018/4. Variable in Hexadecimal Format/04. Variable in Hexadecimal Format.cs | 409 | C# |
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace AerisWeather.Net.Models.Responses
{
public class TidesResponse : BaseAerisResponse
{
[JsonProperty("periods")]
public List<Tide> Tides { get; set; }
}
}
| 20.307692 | 50 | 0.693182 | [
"MIT"
] | EasyIntegration/AerisWeather.Net | AerisWeather.Net/Models/Responses/TidesResponse.cs | 266 | C# |
/*
Copyright 2012-2021 Marco De Salvo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using RDFSharp.Query;
using System.Collections.Generic;
namespace RDFSharp.Model
{
/// <summary>
/// RDFAndConstraint represents a SHACL constraint requiring all the given shapes for a given RDF term
/// </summary>
public class RDFAndConstraint : RDFConstraint
{
#region Properties
/// <summary>
/// Shapes required for the given RDF term
/// </summary>
internal Dictionary<long, RDFResource> AndShapes { get; set; }
#endregion
#region Ctors
/// <summary>
/// Default-ctor to build an and constraint
/// </summary>
public RDFAndConstraint() : base()
{
this.AndShapes = new Dictionary<long, RDFResource>();
}
#endregion
#region Methods
/// <summary>
/// Adds the given shape to the required shapes of this constraint
/// </summary>
public RDFAndConstraint AddShape(RDFResource shapeUri)
{
if (shapeUri != null && !this.AndShapes.ContainsKey(shapeUri.PatternMemberID))
{
this.AndShapes.Add(shapeUri.PatternMemberID, shapeUri);
}
return this;
}
/// <summary>
/// Evaluates this constraint against the given data graph
/// </summary>
internal override RDFValidationReport ValidateConstraint(RDFShapesGraph shapesGraph, RDFGraph dataGraph, RDFShape shape, RDFPatternMember focusNode, List<RDFPatternMember> valueNodes)
{
RDFValidationReport report = new RDFValidationReport();
//Search for given and shapes
List<RDFShape> andShapes = new List<RDFShape>();
foreach (RDFResource andShapeUri in this.AndShapes.Values)
{
RDFShape andShape = shapesGraph.SelectShape(andShapeUri.ToString());
if (andShape != null)
andShapes.Add(andShape);
}
#region Evaluation
foreach (RDFPatternMember valueNode in valueNodes)
{
bool valueNodeConforms = true;
foreach (RDFShape andShape in andShapes)
{
RDFValidationReport andShapeReport = RDFValidationEngine.ValidateShape(shapesGraph, dataGraph, andShape, new List<RDFPatternMember>() { valueNode });
if (!andShapeReport.Conforms)
{
valueNodeConforms = false;
break;
}
}
if (!valueNodeConforms)
report.AddResult(new RDFValidationResult(shape,
RDFVocabulary.SHACL.AND_CONSTRAINT_COMPONENT,
focusNode,
shape is RDFPropertyShape ? ((RDFPropertyShape)shape).Path : null,
valueNode,
shape.Messages,
shape.Severity));
}
#endregion
return report;
}
/// <summary>
/// Gets a graph representation of this constraint
/// </summary>
internal override RDFGraph ToRDFGraph(RDFShape shape)
{
RDFGraph result = new RDFGraph();
if (shape != null)
{
//Get collection from andShapes
RDFCollection andShapes = new RDFCollection(RDFModelEnums.RDFItemTypes.Resource) { InternalReificationSubject = this };
foreach (RDFResource andShape in this.AndShapes.Values)
andShapes.AddItem(andShape);
result.AddCollection(andShapes);
//sh:and
result.AddTriple(new RDFTriple(shape, RDFVocabulary.SHACL.AND, andShapes.ReificationSubject));
}
return result;
}
#endregion
}
} | 37.404762 | 191 | 0.552939 | [
"Apache-2.0"
] | mdesalvo/RDFSharp | RDFSharp/Model/Validation/Abstractions/Constraints/RDFAndConstraint.cs | 4,715 | C# |
// 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.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by google-apis-code-generator 1.5.1
// C# generator version: 1.31.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
/**
* \brief
* YouTube Analytics API Version v1
*
* \section ApiInfo API Version Information
* <table>
* <tr><th>API
* <td><a href='http://developers.google.com/youtube/analytics/'>YouTube Analytics API</a>
* <tr><th>API Version<td>v1
* <tr><th>API Rev<td>20171211 (1075)
* <tr><th>API Docs
* <td><a href='http://developers.google.com/youtube/analytics/'>
* http://developers.google.com/youtube/analytics/</a>
* <tr><th>Discovery Name<td>youtubeAnalytics
* </table>
*
* \section ForMoreInfo For More Information
*
* The complete API documentation for using YouTube Analytics API can be found at
* <a href='http://developers.google.com/youtube/analytics/'>http://developers.google.com/youtube/analytics/</a>.
*
* For more information about the Google APIs Client Library for .NET, see
* <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
* https://developers.google.com/api-client-library/dotnet/get_started</a>
*/
namespace Google.Apis.YouTubeAnalytics.v1
{
/// <summary>The YouTubeAnalytics Service.</summary>
public class YouTubeAnalyticsService : Google.Apis.Services.BaseClientService
{
/// <summary>The API version.</summary>
public const string Version = "v1";
/// <summary>The discovery version used to generate this service.</summary>
public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
Google.Apis.Discovery.DiscoveryVersion.Version_1_0;
/// <summary>Constructs a new service.</summary>
public YouTubeAnalyticsService() :
this(new Google.Apis.Services.BaseClientService.Initializer()) {}
/// <summary>Constructs a new service.</summary>
/// <param name="initializer">The service initializer.</param>
public YouTubeAnalyticsService(Google.Apis.Services.BaseClientService.Initializer initializer)
: base(initializer)
{
groupItems = new GroupItemsResource(this);
groups = new GroupsResource(this);
reports = new ReportsResource(this);
}
/// <summary>Gets the service supported features.</summary>
public override System.Collections.Generic.IList<string> Features
{
get { return new string[0]; }
}
/// <summary>Gets the service name.</summary>
public override string Name
{
get { return "youtubeAnalytics"; }
}
/// <summary>Gets the service base URI.</summary>
public override string BaseUri
{
get { return "https://www.googleapis.com/youtube/analytics/v1/"; }
}
/// <summary>Gets the service base path.</summary>
public override string BasePath
{
get { return "youtube/analytics/v1/"; }
}
#if !NET40
/// <summary>Gets the batch base URI; <c>null</c> if unspecified.</summary>
public override string BatchUri
{
get { return "https://www.googleapis.com/batch/youtubeAnalytics/v1"; }
}
/// <summary>Gets the batch base path; <c>null</c> if unspecified.</summary>
public override string BatchPath
{
get { return "batch/youtubeAnalytics/v1"; }
}
#endif
/// <summary>Available OAuth 2.0 scopes for use with the YouTube Analytics API.</summary>
public class Scope
{
/// <summary>Manage your YouTube account</summary>
public static string Youtube = "https://www.googleapis.com/auth/youtube";
/// <summary>View your YouTube account</summary>
public static string YoutubeReadonly = "https://www.googleapis.com/auth/youtube.readonly";
/// <summary>View and manage your assets and associated content on YouTube</summary>
public static string Youtubepartner = "https://www.googleapis.com/auth/youtubepartner";
/// <summary>View monetary and non-monetary YouTube Analytics reports for your YouTube content</summary>
public static string YtAnalyticsMonetaryReadonly = "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";
/// <summary>View YouTube Analytics reports for your YouTube content</summary>
public static string YtAnalyticsReadonly = "https://www.googleapis.com/auth/yt-analytics.readonly";
}
private readonly GroupItemsResource groupItems;
/// <summary>Gets the GroupItems resource.</summary>
public virtual GroupItemsResource GroupItems
{
get { return groupItems; }
}
private readonly GroupsResource groups;
/// <summary>Gets the Groups resource.</summary>
public virtual GroupsResource Groups
{
get { return groups; }
}
private readonly ReportsResource reports;
/// <summary>Gets the Reports resource.</summary>
public virtual ReportsResource Reports
{
get { return reports; }
}
}
///<summary>A base abstract class for YouTubeAnalytics requests.</summary>
public abstract class YouTubeAnalyticsBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
{
///<summary>Constructs a new YouTubeAnalyticsBaseServiceRequest instance.</summary>
protected YouTubeAnalyticsBaseServiceRequest(Google.Apis.Services.IClientService service)
: base(service)
{
}
/// <summary>Data format for the response.</summary>
/// [default: json]
[Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<AltEnum> Alt { get; set; }
/// <summary>Data format for the response.</summary>
public enum AltEnum
{
/// <summary>Responses with Content-Type of text/csv</summary>
[Google.Apis.Util.StringValueAttribute("csv")]
Csv,
/// <summary>Responses with Content-Type of application/json</summary>
[Google.Apis.Util.StringValueAttribute("json")]
Json,
}
/// <summary>Selector specifying which fields to include in a partial response.</summary>
[Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Fields { get; set; }
/// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
/// Required unless you provide an OAuth 2.0 token.</summary>
[Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Key { get; set; }
/// <summary>OAuth 2.0 token for the current user.</summary>
[Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OauthToken { get; set; }
/// <summary>Returns response with indentations and line breaks.</summary>
/// [default: true]
[Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<bool> PrettyPrint { get; set; }
/// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
/// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
[Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
public virtual string QuotaUser { get; set; }
/// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
/// limits.</summary>
[Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
public virtual string UserIp { get; set; }
/// <summary>Initializes YouTubeAnalytics parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"alt", new Google.Apis.Discovery.Parameter
{
Name = "alt",
IsRequired = false,
ParameterType = "query",
DefaultValue = "json",
Pattern = null,
});
RequestParameters.Add(
"fields", new Google.Apis.Discovery.Parameter
{
Name = "fields",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"key", new Google.Apis.Discovery.Parameter
{
Name = "key",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"oauth_token", new Google.Apis.Discovery.Parameter
{
Name = "oauth_token",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"prettyPrint", new Google.Apis.Discovery.Parameter
{
Name = "prettyPrint",
IsRequired = false,
ParameterType = "query",
DefaultValue = "true",
Pattern = null,
});
RequestParameters.Add(
"quotaUser", new Google.Apis.Discovery.Parameter
{
Name = "quotaUser",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"userIp", new Google.Apis.Discovery.Parameter
{
Name = "userIp",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>The "groupItems" collection of methods.</summary>
public class GroupItemsResource
{
private const string Resource = "groupItems";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public GroupItemsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
}
/// <summary>Removes an item from a group.</summary>
/// <param name="id">The id parameter specifies the YouTube group item ID for the group that is being
/// deleted.</param>
public virtual DeleteRequest Delete(string id)
{
return new DeleteRequest(service, id);
}
/// <summary>Removes an item from a group.</summary>
public class DeleteRequest : YouTubeAnalyticsBaseServiceRequest<string>
{
/// <summary>Constructs a new Delete request.</summary>
public DeleteRequest(Google.Apis.Services.IClientService service, string id)
: base(service)
{
Id = id;
InitParameters();
}
/// <summary>The id parameter specifies the YouTube group item ID for the group that is being
/// deleted.</summary>
[Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Id { get; private set; }
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "delete"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "DELETE"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groupItems"; }
}
/// <summary>Initializes Delete parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"id", new Google.Apis.Discovery.Parameter
{
Name = "id",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Creates a group item.</summary>
/// <param name="body">The body of the request.</param>
public virtual InsertRequest Insert(Google.Apis.YouTubeAnalytics.v1.Data.GroupItem body)
{
return new InsertRequest(service, body);
}
/// <summary>Creates a group item.</summary>
public class InsertRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1.Data.GroupItem>
{
/// <summary>Constructs a new Insert request.</summary>
public InsertRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeAnalytics.v1.Data.GroupItem body)
: base(service)
{
Body = body;
InitParameters();
}
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.YouTubeAnalytics.v1.Data.GroupItem Body { get; set; }
///<summary>Returns the body of the request.</summary>
protected override object GetBody() { return Body; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "insert"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "POST"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groupItems"; }
}
/// <summary>Initializes Insert parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Returns a collection of group items that match the API request parameters.</summary>
/// <param name="groupId">The id parameter specifies the unique ID of the group for which you want to retrieve group
/// items.</param>
public virtual ListRequest List(string groupId)
{
return new ListRequest(service, groupId);
}
/// <summary>Returns a collection of group items that match the API request parameters.</summary>
public class ListRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1.Data.GroupItemListResponse>
{
/// <summary>Constructs a new List request.</summary>
public ListRequest(Google.Apis.Services.IClientService service, string groupId)
: base(service)
{
GroupId = groupId;
InitParameters();
}
/// <summary>The id parameter specifies the unique ID of the group for which you want to retrieve group
/// items.</summary>
[Google.Apis.Util.RequestParameterAttribute("groupId", Google.Apis.Util.RequestParameterType.Query)]
public virtual string GroupId { get; private set; }
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "list"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "GET"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groupItems"; }
}
/// <summary>Initializes List parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"groupId", new Google.Apis.Discovery.Parameter
{
Name = "groupId",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
}
/// <summary>The "groups" collection of methods.</summary>
public class GroupsResource
{
private const string Resource = "groups";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public GroupsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
}
/// <summary>Deletes a group.</summary>
/// <param name="id">The id parameter specifies the YouTube group ID for the group that is being deleted.</param>
public virtual DeleteRequest Delete(string id)
{
return new DeleteRequest(service, id);
}
/// <summary>Deletes a group.</summary>
public class DeleteRequest : YouTubeAnalyticsBaseServiceRequest<string>
{
/// <summary>Constructs a new Delete request.</summary>
public DeleteRequest(Google.Apis.Services.IClientService service, string id)
: base(service)
{
Id = id;
InitParameters();
}
/// <summary>The id parameter specifies the YouTube group ID for the group that is being deleted.</summary>
[Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Id { get; private set; }
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "delete"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "DELETE"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groups"; }
}
/// <summary>Initializes Delete parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"id", new Google.Apis.Discovery.Parameter
{
Name = "id",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Creates a group.</summary>
/// <param name="body">The body of the request.</param>
public virtual InsertRequest Insert(Google.Apis.YouTubeAnalytics.v1.Data.Group body)
{
return new InsertRequest(service, body);
}
/// <summary>Creates a group.</summary>
public class InsertRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1.Data.Group>
{
/// <summary>Constructs a new Insert request.</summary>
public InsertRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeAnalytics.v1.Data.Group body)
: base(service)
{
Body = body;
InitParameters();
}
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.YouTubeAnalytics.v1.Data.Group Body { get; set; }
///<summary>Returns the body of the request.</summary>
protected override object GetBody() { return Body; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "insert"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "POST"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groups"; }
}
/// <summary>Initializes Insert parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Returns a collection of groups that match the API request parameters. For example, you can retrieve
/// all groups that the authenticated user owns, or you can retrieve one or more groups by their unique
/// IDs.</summary>
public virtual ListRequest List()
{
return new ListRequest(service);
}
/// <summary>Returns a collection of groups that match the API request parameters. For example, you can retrieve
/// all groups that the authenticated user owns, or you can retrieve one or more groups by their unique
/// IDs.</summary>
public class ListRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1.Data.GroupListResponse>
{
/// <summary>Constructs a new List request.</summary>
public ListRequest(Google.Apis.Services.IClientService service)
: base(service)
{
InitParameters();
}
/// <summary>The id parameter specifies a comma-separated list of the YouTube group ID(s) for the
/// resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube
/// group ID.</summary>
[Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Id { get; set; }
/// <summary>Set this parameter's value to true to instruct the API to only return groups owned by the
/// authenticated user.</summary>
[Google.Apis.Util.RequestParameterAttribute("mine", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<bool> Mine { get; set; }
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
/// <summary>The pageToken parameter identifies a specific page in the result set that should be returned.
/// In an API response, the nextPageToken property identifies the next page that can be retrieved.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
public virtual string PageToken { get; set; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "list"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "GET"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groups"; }
}
/// <summary>Initializes List parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"id", new Google.Apis.Discovery.Parameter
{
Name = "id",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"mine", new Google.Apis.Discovery.Parameter
{
Name = "mine",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"pageToken", new Google.Apis.Discovery.Parameter
{
Name = "pageToken",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Modifies a group. For example, you could change a group's title.</summary>
/// <param name="body">The body of the request.</param>
public virtual UpdateRequest Update(Google.Apis.YouTubeAnalytics.v1.Data.Group body)
{
return new UpdateRequest(service, body);
}
/// <summary>Modifies a group. For example, you could change a group's title.</summary>
public class UpdateRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1.Data.Group>
{
/// <summary>Constructs a new Update request.</summary>
public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeAnalytics.v1.Data.Group body)
: base(service)
{
Body = body;
InitParameters();
}
/// <summary>Note: This parameter is intended exclusively for YouTube content partners.
///
/// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a
/// YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This
/// parameter is intended for YouTube content partners that own and manage many different YouTube channels.
/// It allows content owners to authenticate once and get access to all their video and channel data,
/// without having to provide authentication credentials for each individual channel. The CMS account that
/// the user authenticates with must be linked to the specified YouTube content owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.YouTubeAnalytics.v1.Data.Group Body { get; set; }
///<summary>Returns the body of the request.</summary>
protected override object GetBody() { return Body; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "update"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "PUT"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "groups"; }
}
/// <summary>Initializes Update parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
{
Name = "onBehalfOfContentOwner",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
}
/// <summary>The "reports" collection of methods.</summary>
public class ReportsResource
{
private const string Resource = "reports";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public ReportsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
}
/// <summary>Retrieve your YouTube Analytics reports.</summary>
/// <param name="ids">Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics
/// data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID
/// specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter
/// value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner.</param>
/// <param
/// name="startDate">The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD
/// format.</param>
/// <param name="endDate">The end date for fetching YouTube Analytics data. The value should be
/// in YYYY-MM-DD format.</param>
/// <param name="metrics">A comma-separated list of YouTube Analytics metrics,
/// such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve
/// and the metrics available in each report, and see the Metrics document for definitions of those
/// metrics.</param>
public virtual QueryRequest Query(string ids, string startDate, string endDate, string metrics)
{
return new QueryRequest(service, ids, startDate, endDate, metrics);
}
/// <summary>Retrieve your YouTube Analytics reports.</summary>
public class QueryRequest : YouTubeAnalyticsBaseServiceRequest<Google.Apis.YouTubeAnalytics.v1.Data.ResultTable>
{
/// <summary>Constructs a new Query request.</summary>
public QueryRequest(Google.Apis.Services.IClientService service, string ids, string startDate, string endDate, string metrics)
: base(service)
{
Ids = ids;
StartDate = startDate;
EndDate = endDate;
Metrics = metrics;
InitParameters();
}
/// <summary>Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics
/// data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where
/// CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner,
/// set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content
/// owner.</summary>
[Google.Apis.Util.RequestParameterAttribute("ids", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Ids { get; private set; }
/// <summary>The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD
/// format.</summary>
[Google.Apis.Util.RequestParameterAttribute("start-date", Google.Apis.Util.RequestParameterType.Query)]
public virtual string StartDate { get; private set; }
/// <summary>The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD
/// format.</summary>
[Google.Apis.Util.RequestParameterAttribute("end-date", Google.Apis.Util.RequestParameterType.Query)]
public virtual string EndDate { get; private set; }
/// <summary>A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the
/// Available Reports document for a list of the reports that you can retrieve and the metrics available in
/// each report, and see the Metrics document for definitions of those metrics.</summary>
[Google.Apis.Util.RequestParameterAttribute("metrics", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Metrics { get; private set; }
/// <summary>The currency to which financial metrics should be converted. The default is US Dollar (USD). If
/// the result contains no financial metrics, this flag will be ignored. Responds with an error if the
/// specified currency is not recognized.</summary>
[Google.Apis.Util.RequestParameterAttribute("currency", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Currency { get; set; }
/// <summary>A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See
/// the Available Reports document for a list of the reports that you can retrieve and the dimensions used
/// for those reports. Also see the Dimensions document for definitions of those dimensions.</summary>
[Google.Apis.Util.RequestParameterAttribute("dimensions", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Dimensions { get; set; }
/// <summary>A list of filters that should be applied when retrieving YouTube Analytics data. The Available
/// Reports document identifies the dimensions that can be used to filter each report, and the Dimensions
/// document defines those dimensions. If a request uses multiple filters, join them together with a
/// semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter
/// value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in
/// Italy.</summary>
[Google.Apis.Util.RequestParameterAttribute("filters", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Filters { get; set; }
/// <summary>If set to true historical data (i.e. channel data from before the linking of the channel to the
/// content owner) will be retrieved.</summary>
[Google.Apis.Util.RequestParameterAttribute("include-historical-channel-data", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<bool> IncludeHistoricalChannelData { get; set; }
/// <summary>The maximum number of rows to include in the response.</summary>
/// [minimum: 1]
[Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<int> MaxResults { get; set; }
/// <summary>A comma-separated list of dimensions or metrics that determine the sort order for YouTube
/// Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort
/// order.</summary>
[Google.Apis.Util.RequestParameterAttribute("sort", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Sort { get; set; }
/// <summary>An index of the first entity to retrieve. Use this parameter as a pagination mechanism along
/// with the max-results parameter (one-based, inclusive).</summary>
/// [minimum: 1]
[Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<int> StartIndex { get; set; }
///<summary>Gets the method name.</summary>
public override string MethodName
{
get { return "query"; }
}
///<summary>Gets the HTTP method.</summary>
public override string HttpMethod
{
get { return "GET"; }
}
///<summary>Gets the REST path.</summary>
public override string RestPath
{
get { return "reports"; }
}
/// <summary>Initializes Query parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add(
"ids", new Google.Apis.Discovery.Parameter
{
Name = "ids",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[a-zA-Z]+==[a-zA-Z0-9_+-]+",
});
RequestParameters.Add(
"start-date", new Google.Apis.Discovery.Parameter
{
Name = "start-date",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[0-9]{4}-[0-9]{2}-[0-9]{2}",
});
RequestParameters.Add(
"end-date", new Google.Apis.Discovery.Parameter
{
Name = "end-date",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[0-9]{4}-[0-9]{2}-[0-9]{2}",
});
RequestParameters.Add(
"metrics", new Google.Apis.Discovery.Parameter
{
Name = "metrics",
IsRequired = true,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[0-9a-zA-Z,]+",
});
RequestParameters.Add(
"currency", new Google.Apis.Discovery.Parameter
{
Name = "currency",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[A-Z]{3}",
});
RequestParameters.Add(
"dimensions", new Google.Apis.Discovery.Parameter
{
Name = "dimensions",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[0-9a-zA-Z,]+",
});
RequestParameters.Add(
"filters", new Google.Apis.Discovery.Parameter
{
Name = "filters",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"include-historical-channel-data", new Google.Apis.Discovery.Parameter
{
Name = "include-historical-channel-data",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"max-results", new Google.Apis.Discovery.Parameter
{
Name = "max-results",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add(
"sort", new Google.Apis.Discovery.Parameter
{
Name = "sort",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = @"[-0-9a-zA-Z,]+",
});
RequestParameters.Add(
"start-index", new Google.Apis.Discovery.Parameter
{
Name = "start-index",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
}
}
namespace Google.Apis.YouTubeAnalytics.v1.Data
{
public class Group : Google.Apis.Requests.IDirectResponseSchema
{
[Newtonsoft.Json.JsonPropertyAttribute("contentDetails")]
public virtual Group.ContentDetailsData ContentDetails { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("etag")]
public virtual string ETag { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("id")]
public virtual string Id { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("kind")]
public virtual string Kind { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("snippet")]
public virtual Group.SnippetData Snippet { get; set; }
public class ContentDetailsData
{
[Newtonsoft.Json.JsonPropertyAttribute("itemCount")]
public virtual System.Nullable<ulong> ItemCount { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("itemType")]
public virtual string ItemType { get; set; }
}
public class SnippetData
{
[Newtonsoft.Json.JsonPropertyAttribute("publishedAt")]
public virtual string PublishedAtRaw { get; set; }
/// <summary><seealso cref="System.DateTime"/> representation of <see cref="PublishedAtRaw"/>.</summary>
[Newtonsoft.Json.JsonIgnore]
public virtual System.Nullable<System.DateTime> PublishedAt
{
get
{
return Google.Apis.Util.Utilities.GetDateTimeFromString(PublishedAtRaw);
}
set
{
PublishedAtRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
}
}
[Newtonsoft.Json.JsonPropertyAttribute("title")]
public virtual string Title { get; set; }
}
}
public class GroupItem : Google.Apis.Requests.IDirectResponseSchema
{
[Newtonsoft.Json.JsonPropertyAttribute("etag")]
public virtual string ETag { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("groupId")]
public virtual string GroupId { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("id")]
public virtual string Id { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("kind")]
public virtual string Kind { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("resource")]
public virtual GroupItem.ResourceData Resource { get; set; }
public class ResourceData
{
[Newtonsoft.Json.JsonPropertyAttribute("id")]
public virtual string Id { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("kind")]
public virtual string Kind { get; set; }
}
}
/// <summary>A paginated list of grouList resources returned in response to a youtubeAnalytics.groupApi.list
/// request.</summary>
public class GroupItemListResponse : Google.Apis.Requests.IDirectResponseSchema
{
[Newtonsoft.Json.JsonPropertyAttribute("etag")]
public virtual string ETag { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("items")]
public virtual System.Collections.Generic.IList<GroupItem> Items { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("kind")]
public virtual string Kind { get; set; }
}
/// <summary>A paginated list of grouList resources returned in response to a youtubeAnalytics.groupApi.list
/// request.</summary>
public class GroupListResponse : Google.Apis.Requests.IDirectResponseSchema
{
[Newtonsoft.Json.JsonPropertyAttribute("etag")]
public virtual string ETag { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("items")]
public virtual System.Collections.Generic.IList<Group> Items { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("kind")]
public virtual string Kind { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
public virtual string NextPageToken { get; set; }
}
/// <summary>Contains a single result table. The table is returned as an array of rows that contain the values for
/// the cells of the table. Depending on the metric or dimension, the cell can contain a string (video ID, country
/// code) or a number (number of views or number of likes).</summary>
public class ResultTable : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>This value specifies information about the data returned in the rows fields. Each item in the
/// columnHeaders list identifies a field returned in the rows value, which contains a list of comma-delimited
/// data. The columnHeaders list will begin with the dimensions specified in the API request, which will be
/// followed by the metrics specified in the API request. The order of both dimensions and metrics will match
/// the ordering in the API request. For example, if the API request contains the parameters
/// dimensions=ageGroup,gender=viewerPercentage, the API response will return columns in this order:
/// ageGroup,gender,viewerPercentage.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("columnHeaders")]
public virtual System.Collections.Generic.IList<ResultTable.ColumnHeadersData> ColumnHeaders { get; set; }
/// <summary>This value specifies the type of data included in the API response. For the query method, the kind
/// property value will be youtubeAnalytics#resultTable.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("kind")]
public virtual string Kind { get; set; }
/// <summary>The list contains all rows of the result table. Each item in the list is an array that contains
/// comma-delimited data corresponding to a single row of data. The order of the comma-delimited data fields
/// will match the order of the columns listed in the columnHeaders field. If no data is available for the given
/// query, the rows element will be omitted from the response. The response for a query with the day dimension
/// will not contain rows for the most recent days.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("rows")]
public virtual System.Collections.Generic.IList<System.Collections.Generic.IList<object>> Rows { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
public class ColumnHeadersData
{
/// <summary>The type of the column (DIMENSION or METRIC).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("columnType")]
public virtual string ColumnType { get; set; }
/// <summary>The type of the data in the column (STRING, INTEGER, FLOAT, etc.).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("dataType")]
public virtual string DataType { get; set; }
/// <summary>The name of the dimension or metric.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("name")]
public virtual string Name { get; set; }
}
}
}
| 44.891188 | 138 | 0.579247 | [
"Apache-2.0"
] | Jimmy-Hu/google-api-dotnet-client | Src/Generated/Google.Apis.YouTubeAnalytics.v1/Google.Apis.YouTubeAnalytics.v1.cs | 58,583 | C# |
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Machine.Specifications;
namespace Dolittle.Runtime.DependencyInversion.for_BindingBuilder
{
public class when_binding_to_generic_type : given.a_null_binding
{
static Binding result;
Because of = () =>
{
builder.To<string>();
result = builder.Build();
};
It should_have_a_type_strategy = () => result.Strategy.ShouldBeOfExactType<Strategies.Type>();
It should_hold_the_type_in_the_strategy = () => ((Strategies.Type)result.Strategy).Target.ShouldEqual(typeof(string));
It should_have_transient_scope = () => result.Scope.ShouldBeAssignableTo<Scopes.Transient>();
}
} | 35.565217 | 126 | 0.694377 | [
"MIT"
] | dolittle/Runtime | Specifications/DependencyInversion/for_BindingBuilder/when_binding_to_generic_type.cs | 818 | C# |
using QuestionnaireSystem.Auth;
using QuestionnaireSystem.DBSource;
using QuestionnaireSystem.ORM.DBModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace QuestionnaireSystem
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.input_search_title.Attributes.Add("placeholder", "問卷標題");
this.ltlStartDate.Text = "<input type='date' class='form-control myValidation' id='input_search_start' />";
this.ltlEndDate.Text = "<input type='date' class='form-control myValidation' id='input_search_end' />";
//檢查登入狀態
if (this.Request.IsAuthenticated)
{
string strId = (HttpContext.Current.User.Identity as FormsIdentity).Ticket.UserData;
string errMsg;
UserInfo currentUser = AuthManager.AuthUserInfo(strId, out errMsg);
this.ltlLogin.Text = $"使用者:{currentUser.Name}<a class='btn btn-outline-info' href='/SystemAdmin/QuestionnaireList.aspx' role='button'>後台管理</a>";
}
else
{
this.ltlLogin.Text = "<a class='btn btn-info' href='Login.aspx' role='button'>登入</a>";
}
if (this.IsPostBack)
{
this.Response.Redirect($"Default.aspx?SearchTitle={this.input_search_title.Text}" +
$"&sDate={this.HFStartDate.Value}&eDate={this.HFEndDate.Value}");
}
else
{
this.ltlQList.Text = "";
bool isSearch = false;
// 處理QueryString
string strQueryTitle = this.Request.QueryString["SearchTitle"];
string strQueryStartDate = this.Request.QueryString["sDate"];
string strQueryEndDate = this.Request.QueryString["eDate"];
DateTime? queryStartDate = this.CheckDateQuery(strQueryStartDate);
DateTime? queryEndDate = this.CheckDateQuery(strQueryEndDate);
if (strQueryTitle != null || queryStartDate != null || queryEndDate != null)
isSearch = true;
if (strQueryTitle == "" && queryStartDate == null && queryEndDate == null)
isSearch = false;
// 狀態還原
this.input_search_title.Text = strQueryTitle;
if(queryStartDate != null)
this.ltlStartDate.Text = $"<input type='date' class='form-control myValidation' id='input_search_start' " +
$"value={queryStartDate?.ToString("yyyy-MM-dd")} />";
if (queryEndDate != null)
this.ltlEndDate.Text = $"<input type='date' class='form-control myValidation' id='input_search_end' " +
$"value={queryEndDate?.ToString("yyyy-MM-dd")} />";
// 建立等等要Render的Qlist;
List<Questionnaire> Qlist = new List<Questionnaire>();
if (isSearch)
{
Qlist = QuestionManager.SearchQuestionnaire(strQueryTitle, queryStartDate, queryEndDate);
}
else
{
Qlist = QuestionManager.GetQuestionnaireList();
}
if (Qlist == null)
{
this.ltlQList.Text = "<tr><td colspan='6' class='no_data_msg'>錯誤</td></tr>";
return;
}
Qlist = Qlist.Where(obj => obj.Status != 3).ToList();
if(Qlist.Count == 0)
{
this.ltlQList.Text = "<tr><td colspan='6' class='no_data_msg'>無結果</td></tr>";
return;
}
this.ucPager.TotalItemSize = Qlist.Count;
int currentPage = this.ucPager.GetCurrentPage();
int sizeInPage = this.ucPager.ItemSizeInPage;
int startIndex = sizeInPage * (currentPage - 1);
// 按開始日期排序,再按所在頁數切割
Qlist = Qlist.OrderBy(item => item.StartDate).Skip(startIndex).Take(sizeInPage).ToList();
// Render Qlist
foreach (Questionnaire item in Qlist)
{
string Qtitle = item.Status == 1
? $"<a href='{"AnswerPage.aspx?QID=" + item.QuestionnaireID}'>{item.Title}</a>"
: item.Title;
string endDate = item.EndDate != null ? item.EndDate?.ToString("yyyy-MM-dd") : "--";
string link = (item.Status == 1 || item.Status == 2)
? $"<a href='Statistic.aspx?QID={item.QuestionnaireID.ToString()}'>前往</a>"
: "前往";
this.ltlQList.Text +=
$"<tr>" +
$"<th scope='row'>{item.QuestionnaireID.ToString().Split('-')[0]}</th>" +
$"<td>{Qtitle}</td>" +
$"<td>{this.GetStatusString(item.Status)}</td>" +
$"<td>{item.StartDate.ToString("yyyy-MM-dd")}</td>" +
$"<td>{endDate}</td>" +
$"<td>{link}</td>" +
$"</tr>";
}
this.ucPager.Bind();
}
}
private string GetStatusString(int status)
{
switch (status)
{
case 0:
return "未開始";
case 1:
return "投票中";
case 2:
return "已結束";
case 3:
return "關閉中";
default:
return "--";
}
}
private DateTime? CheckDateQuery(string strDate)
{
try
{
if (strDate == null)
return null;
string[] strStart = strDate.Split('-');
if (strStart.Length != 3)
throw new Exception("StartDate bad Query.");
int sy = Convert.ToInt32(strStart[0]);
int sm = Convert.ToInt32(strStart[1]);
int sd = Convert.ToInt32(strStart[2]);
return new DateTime(sy, sm, sd);
}
catch (Exception ex)
{
return null;
}
}
}
} | 39.202381 | 160 | 0.484968 | [
"MIT"
] | implife/QuestionnaireSystem | QuestionnaireSystem/QuestionnaireSystem/Default.aspx.cs | 6,726 | C# |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated code. DO NOT EDIT!
namespace Google.Ads.GoogleAds.V7.Services.Snippets
{
using Google.Ads.GoogleAds.V7.Resources;
using Google.Ads.GoogleAds.V7.Services;
using System.Threading.Tasks;
public sealed partial class GeneratedAdGroupFeedServiceClientStandaloneSnippets
{
/// <summary>Snippet for GetAdGroupFeedAsync</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 GetAdGroupFeedRequestObjectAsync()
{
// Create client
AdGroupFeedServiceClient adGroupFeedServiceClient = await AdGroupFeedServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdGroupFeedRequest request = new GetAdGroupFeedRequest
{
ResourceNameAsAdGroupFeedName = AdGroupFeedName.FromCustomerAdGroupFeed("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[FEED_ID]"),
};
// Make the request
AdGroupFeed response = await adGroupFeedServiceClient.GetAdGroupFeedAsync(request);
}
}
}
| 40.795455 | 135 | 0.698607 | [
"Apache-2.0"
] | googleapis/googleapis-gen | google/ads/googleads/v7/googleads-csharp/Google.Ads.GoogleAds.V7.Services.StandaloneSnippets/AdGroupFeedServiceClient.GetAdGroupFeedRequestObjectAsyncSnippet.g.cs | 1,795 | C# |
namespace Godot {
public static partial class Signals {
public class KinematicBody : CollisionObject { }
}
}
| 21 | 56 | 0.666667 | [
"MIT"
] | ItsJustGeek/Godot.Signals | Godot.Signals/Node/Spatial/CollisionObject/PhysicsBody/KinematicBody.cs | 128 | C# |
#nullable enable
using System;
using System.Threading;
using System.Threading.Tasks;
using PrimeFuncPack.UnitTest;
using Xunit;
using static PrimeFuncPack.UnitTest.TestData;
namespace PrimeFuncPack.Core.Tests;
partial class AsyncFuncTest
{
[Fact]
public void From_06_SourceFuncIsNull_ExpectArgumentNullException()
{
var sourceFunc = (Func<RefType?, StructType, string, RecordType?, DateTimeKind, object, CancellationToken, Task<RecordType>>)null!;
var ex = Assert.Throws<ArgumentNullException>(() => _ = AsyncFunc.From(sourceFunc));
Assert.Equal("funcAsync", ex.ParamName);
}
[Theory]
[InlineData(null)]
[InlineData(EmptyString)]
[InlineData(WhiteSpaceString)]
[InlineData(TabString)]
[InlineData(LowerSomeString)]
[InlineData(SomeString)]
public async Task From_06_ThenInvokeAsync_ExpectResultOfSourceFunc(
string? sourceFuncResult)
{
var actual = AsyncFunc.From<RefType, string, StructType?, object, RecordType, int, string?>(
(_, _, _, _, _, _, _) => Task.FromResult(sourceFuncResult));
var cancellationToken = new CancellationToken();
var actualResult = await actual.InvokeAsync(
MinusFifteenIdRefType, null!, new(), new(), PlusFifteenIdLowerSomeStringNameRecord, int.MaxValue, cancellationToken);
Assert.Equal(sourceFuncResult, actualResult);
}
}
| 32.627907 | 139 | 0.712758 | [
"MIT"
] | pfpack/pfpack-core | src/core-func-ext/Func.Extensions.Tests/Test.AsyncFunc/AsyncFuncTest.06.cs | 1,403 | C# |
using System;
using System.Numerics;
using System.Threading.Tasks;
using Nethereum.Hex.HexConvertors.Extensions;
using Nethereum.RLP;
namespace Nethereum.Signer
{
public class Transaction : TransactionBase
{
public Transaction(byte[] rawData)
{
SimpleRlpSigner = new RLPSigner(rawData, NUMBER_ENCODING_ELEMENTS);
ValidateValidV(SimpleRlpSigner);
}
public Transaction(RLPSigner rlpSigner)
{
ValidateValidV(rlpSigner);
SimpleRlpSigner = rlpSigner;
}
private static void ValidateValidV(RLPSigner rlpSigner)
{
if (rlpSigner.IsVSignatureForChain())
throw new Exception("TransactionChainId should be used instead of Transaction");
}
public Transaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress, byte[] value,
byte[] data)
{
SimpleRlpSigner = new RLPSigner(GetElementsInOrder(nonce, gasPrice, gasLimit, receiveAddress, value, data));
}
public Transaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress, byte[] value,
byte[] data, byte[] r, byte[] s, byte v)
{
SimpleRlpSigner = new RLPSigner(GetElementsInOrder(nonce, gasPrice, gasLimit, receiveAddress, value, data),
r, s, v);
}
public Transaction(string to, BigInteger amount, BigInteger nonce)
: this(to, amount, nonce, DEFAULT_GAS_PRICE, DEFAULT_GAS_LIMIT)
{
}
public Transaction(string to, BigInteger amount, BigInteger nonce, string data)
: this(to, amount, nonce, DEFAULT_GAS_PRICE, DEFAULT_GAS_LIMIT, data)
{
}
public Transaction(string to, BigInteger amount, BigInteger nonce, BigInteger gasPrice, BigInteger gasLimit)
: this(to, amount, nonce, gasPrice, gasLimit, "")
{
}
public Transaction(string to, BigInteger amount, BigInteger nonce, BigInteger gasPrice,
BigInteger gasLimit, string data) : this(nonce.ToBytesForRLPEncoding(), gasPrice.ToBytesForRLPEncoding(),
gasLimit.ToBytesForRLPEncoding(), to.HexToByteArray(), amount.ToBytesForRLPEncoding(), data.HexToByteArray()
)
{
}
public string ToJsonHex()
{
var s = "['{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}']";
return string.Format(s, Nonce.ToHex(),
GasPrice.ToHex(), GasLimit.ToHex(), ReceiveAddress.ToHex(), Value.ToHex(), ToHex(Data),
Signature.V.ToHex(),
Signature.R.ToHex(),
Signature.S.ToHex());
}
private byte[][] GetElementsInOrder(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress,
byte[] value,
byte[] data)
{
if (receiveAddress == null)
receiveAddress = EMPTY_BYTE_ARRAY;
//order nonce, gasPrice, gasLimit, receiveAddress, value, data
return new[] {nonce, gasPrice, gasLimit, receiveAddress, value, data};
}
public override EthECKey Key => EthECKey.RecoverFromSignature(SimpleRlpSigner.Signature, SimpleRlpSigner.RawHash);
#if !DOTNET35
public override async Task SignExternallyAsync(IEthExternalSigner externalSigner)
{
await externalSigner.SignAsync(this).ConfigureAwait(false);
}
#endif
}
} | 37.623656 | 122 | 0.613604 | [
"MIT"
] | Ali8668/Nethereum | src/Nethereum.Signer/Transaction.cs | 3,501 | C# |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace AlgoTest.LeetCode.Permute
{
[TestClass]
public class PermuteProblem
{
[TestMethod]
public void Test() {
var t = new int[] {1,2,3 };
Permute(t);
}
public IList<IList<int>> Permute(int[] nums)
{
Perm(nums, 0, new List<int>());
return ret;
}
IList<IList<int>> ret = new List<IList<int>>();
private void Perm(int[] nums, int index, List<int> cur) {
if (index == nums.Length)
{
ret.Add(new List<int>(cur));
return;
}
for (var i = 0; i < nums.Length; i++) {
if (cur.Contains(nums[i]))
continue;
cur.Add(nums[i]);
Perm(nums, index + 1, cur);
cur.RemoveAt(cur.Count - 1);
}
}
}
}
| 24.930233 | 65 | 0.491604 | [
"MIT"
] | sagasu/Algo-DataStructures | AlgoTest/LeetCode/Permute/Permute.cs | 1,074 | C# |
/*
* DevOps Vault API
*
* The purpose of this application is to provide a simple service for storing and getting secrets
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = DevOpsVault.SDK.Core.Client.OpenAPIDateConverter;
namespace DevOpsVault.SDK.Core.Model
{
/// <summary>
/// MemberResponse for member response
/// </summary>
[DataContract]
public partial class MemberResponse : IEquatable<MemberResponse>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="MemberResponse" /> class.
/// </summary>
/// <param name="groups">Groups information.</param>
/// <param name="name">Name.</param>
public MemberResponse(List<GroupMemberInfo> groups = default(List<GroupMemberInfo>), string name = default(string))
{
this.Groups = groups;
this.Name = name;
}
/// <summary>
/// Groups information
/// </summary>
/// <value>Groups information</value>
[DataMember(Name="groups", EmitDefaultValue=false)]
public List<GroupMemberInfo> Groups { get; set; }
/// <summary>
/// Name
/// </summary>
/// <value>Name</value>
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class MemberResponse {\n");
sb.Append(" Groups: ").Append(Groups).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as MemberResponse);
}
/// <summary>
/// Returns true if MemberResponse instances are equal
/// </summary>
/// <param name="input">Instance of MemberResponse to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(MemberResponse input)
{
if (input == null)
return false;
return
(
this.Groups == input.Groups ||
this.Groups != null &&
input.Groups != null &&
this.Groups.SequenceEqual(input.Groups)
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Groups != null)
hashCode = hashCode * 59 + this.Groups.GetHashCode();
if (this.Name != null)
hashCode = hashCode * 59 + this.Name.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 32.496552 | 140 | 0.558786 | [
"Apache-2.0"
] | thycotic/dsv-netcore-sdk | src/DevOpsVault.SDK.Core/Model/MemberResponse.cs | 4,712 | 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("CommonShared")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("CommonShared")]
[assembly: System.Reflection.AssemblyTitleAttribute("CommonShared")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
| 41.083333 | 80 | 0.649087 | [
"MIT"
] | Urgen-Dorjee/MyBlogPage | CommonShared/obj/Debug/netstandard2.0/CommonShared.AssemblyInfo.cs | 986 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using DiagramDesigner;
using Caliburn.Micro;
using System.ComponentModel.Composition;
using System.Collections.ObjectModel;
using System.Windows.Input;
namespace DemoApp
{
[Export(typeof(ShellViewModel))]
public class ShellViewModel : Screen
{
private List<int> _savedDiagrams = new List<int>();
private List<VisualElement> _itemsToRemove;
private IMessageBoxService _messageBoxService;
private Diagram _diagramViewModel = new Diagram();
public ShellViewModel()
{
_messageBoxService = ApplicationServicesProvider.Instance.Provider.MessageBoxService;
Diagram = new Diagram();
DeleteSelectedItemsCommand = new RelayCommand(ExecuteDeleteSelectedItemsCommand);
CreateNewDiagramCommand = new RelayCommand(ExecuteCreateNewDiagramCommand);
SettingsDesignerItemViewModel item1 = new SettingsDesignerItemViewModel();
item1.Parent = Diagram;
item1.Left = 100;
item1.Top = 100;
Diagram.Items.Add(item1);
PersistDesignerItemViewModel item2 = new PersistDesignerItemViewModel();
item2.Parent = Diagram;
item2.Left = 300;
item2.Top = 300;
Diagram.Items.Add(item2);
item1.Connect(item2, ConnectorOrientation.Right, ConnectorOrientation.Left);
this.Tools.Add(new SettingsDesignerItemViewModel());
this.Tools.Add(new PersistDesignerItemViewModel());
this.Tools.Add(new FanViewModel());
this.Tools.Add(new LightViewModel());
this.Tools.Add(new TankViewModel { Percent=20});
this.Tools.Add(new ThermometerViewModel { Value = 50 });
}
public ICommand DeleteSelectedItemsCommand { get; private set; }
public ICommand CreateNewDiagramCommand { get; private set; }
public ICommand SaveDiagramCommand { get; private set; }
public ICommand GroupCommand { get; private set; }
public ICommand LoadDiagramCommand { get; private set; }
public Diagram Diagram
{
get => _diagramViewModel;
set => this.Set(ref _diagramViewModel, value);
}
private void ExecuteDeleteSelectedItemsCommand()=> Diagram.DeleteSelectedItems();
private void ExecuteCreateNewDiagramCommand( )
{
_itemsToRemove = new List<VisualElement>();
Diagram.CreateNewDiagramCommand.Execute(null);
}
public ConnectorLineType? LineType
{
get
{
if (this.Diagram.SelectedItems.Count == 0) return null;
if (this.Diagram.SelectedItems.Any(x => !(x is Connector))) return null;
var connectors = this.Diagram.SelectedItems.OfType<Connector>().ToList();
if (connectors.GroupBy(x => x.LineType).Count() > 1) return null;
return connectors.First().LineType;
}
set
{
if (value != null)
this.Diagram.SelectedItems.OfType<Connector>().ToList().ForEach(x =>
{
x.LineType = value.Value;
});
}
}
private bool _showLineArrow;
public bool ShowLineArrow
{
get => _showLineArrow;
set
{
this.Diagram.SelectedItems.OfType<Connector>().ToList()
.ForEach(x=>
{
x.ShowArrow = value;
});
this.Set(ref _showLineArrow, value);
}
}
private bool _showGridLines;
public bool ShowGridLines
{
get => _showGridLines;
set => this.Set(ref _showGridLines, value);
}
public ObservableCollection<DesignerElement> Tools { get; private set; } = new ObservableCollection<DesignerElement>();
}
}
| 36.787611 | 127 | 0.580467 | [
"MIT"
] | nwilliamfeng/MVVMDiagramDesigner | src/DemoApp/ViewModels/ShellViewModel.cs | 4,159 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программным средством.
// Версия среды выполнения: 4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
// код создан повторно.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WantedDeadOrAlive.Properties
{
/// <summary>
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
/// </summary>
// Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
// класс с помощью таких средств, как ResGen или Visual Studio.
// Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
// с параметром /str или заново постройте свой 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("WantedDeadOrAlive.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Переопределяет свойство CurrentUICulture текущего потока для всех
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
| 40.676056 | 183 | 0.61946 | [
"MIT"
] | KriptYashka/LiveModel | WantedDeadOrAlive/Properties/Resources.Designer.cs | 3,419 | C# |
#region copyright
/*
* Copyright (c) 2018 Sveriges Radio AB, Stockholm, Sweden
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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
using System;
namespace CodecControl.Client.Exceptions
{
public abstract class CodecException : ApplicationException { }
} | 46.628571 | 76 | 0.765931 | [
"BSD-3-Clause"
] | IrisBroadcast/CodecControl | src/CodecControl.Client/Exceptions/CodecException.cs | 1,634 | C# |
using Microsoft.Maui.Controls.CustomAttributes;
using Microsoft.Maui.Controls.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues
{
#if UITEST
[NUnit.Framework.Category(Compatibility.UITests.UITestCategories.Github5000)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 2837, " Exception thrown during NavigationPage.Navigation.PopAsync", PlatformAffected.Android)]
public class Issue2837 : TestNavigationPage // or TestFlyoutPage, etc ...
{
string _labelText = "worked";
protected override async void Init()
{
// Initialize ui here instead of ctor
await PushAsync(new ContentPage() { Title = "MainPage" });
}
protected override async void OnAppearing()
{
var nav = (NavigationPage)this;
nav.Navigation.InsertPageBefore(new ContentPage() { Title = "SecondPage ", Content = new Label { Text = _labelText } }, nav.CurrentPage);
await nav.Navigation.PopAsync(false);
base.OnAppearing();
}
#if UITEST
[Test]
public void Issue2837Test()
{
RunningApp.WaitForElement(q => q.Text(_labelText));
}
#endif
}
} | 27.642857 | 140 | 0.743325 | [
"MIT"
] | 10088/maui | src/Compatibility/ControlGallery/src/Issues.Shared/Issue2837.cs | 1,163 | C# |
using System;
using System.Collections.Generic;
namespace CopyDetection
{
public static class ListICopyItenExtension
{
public static List<string> DetectCopied(this IList<string> source, Predicate<int> copiedLengthPredicate )
{
var result = new List<string>();
for(var index = 0; index < source.Count; index ++)
{
var item = source[index];
if (item.ContainCopyString(copiedLengthPredicate)
&& !result.Contains(item))
{
result.Add(item);
}
for (var subIndex = index + 1; subIndex < source.Count; subIndex++)
{
var containCopyItem = source[subIndex];
if (item.ContainCopyString(containCopyItem, copiedLengthPredicate))
{
if (!result.Contains(item))
{
result.Add(item);
}
if (!result.Contains(containCopyItem))
{
result.Add(containCopyItem);
}
}
}
}
return result;
}
}
} | 30.255814 | 113 | 0.441968 | [
"MIT"
] | phuocquach/csharp-practicing | Extension/CopyDetection/ListICopyItemDetectionExtension.cs | 1,301 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpellCollision : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnCollisionEnter(Collision collision)
{
}
}
| 15.208333 | 52 | 0.619178 | [
"MIT"
] | albertec1/Eldrich-Invasion | Eldrich Invasion/Assets/Scripts/SpellCollision.cs | 365 | C# |
namespace OpenGLBindings
{
/// <summary>
/// Used in GL.Arb.TexBuffer, GL.ColorTable and 32 other functions
/// </summary>
public enum InternalFormat
{
/// <summary>
/// Original was GL_DEPTH_COMPONENT = 0x1902
/// </summary>
DepthComponent = 6402,
/// <summary>
/// Original was GL_RED = 0x1903
/// </summary>
Red = 6403,
/// <summary>
/// Original was GL_RED_EXT = 0x1903
/// </summary>
RedExt = 6403,
/// <summary>
/// Original was GL_RGB = 0x1907
/// </summary>
Rgb = 6407,
/// <summary>
/// Original was GL_RGBA = 0x1908
/// </summary>
Rgba = 6408,
/// <summary>
/// Original was GL_R3_G3_B2 = 0x2A10
/// </summary>
R3G3B2 = 10768,
/// <summary>
/// Original was GL_RGB2_EXT = 0x804E
/// </summary>
Rgb2Ext = 32846,
/// <summary>
/// Original was GL_RGB4 = 0x804F
/// </summary>
Rgb4 = 32847,
/// <summary>
/// Original was GL_RGB4_EXT = 0x804F
/// </summary>
Rgb4Ext = 32847,
/// <summary>
/// Original was GL_RGB5 = 0x8050
/// </summary>
Rgb5 = 32848,
/// <summary>
/// Original was GL_RGB5_EXT = 0x8050
/// </summary>
Rgb5Ext = 32848,
/// <summary>
/// Original was GL_RGB8 = 0x8051
/// </summary>
Rgb8 = 32849,
/// <summary>
/// Original was GL_RGB8_EXT = 0x8051
/// </summary>
Rgb8Ext = 32849,
/// <summary>
/// Original was GL_RGB8_OES = 0x8051
/// </summary>
Rgb8Oes = 32849,
/// <summary>
/// Original was GL_RGB10 = 0x8052
/// </summary>
Rgb10 = 32850,
/// <summary>
/// Original was GL_RGB10_EXT = 0x8052
/// </summary>
Rgb10Ext = 32850,
/// <summary>
/// Original was GL_RGB12 = 0x8053
/// </summary>
Rgb12 = 32851,
/// <summary>
/// Original was GL_RGB12_EXT = 0x8053
/// </summary>
Rgb12Ext = 32851,
/// <summary>
/// Original was GL_RGB16 = 0x8054
/// </summary>
Rgb16 = 32852,
/// <summary>
/// Original was GL_RGB16_EXT = 0x8054
/// </summary>
Rgb16Ext = 32852,
/// <summary>
/// Original was GL_RGBA4 = 0x8056
/// </summary>
Rgba4 = 32854,
/// <summary>
/// Original was GL_RGBA4_EXT = 0x8056
/// </summary>
Rgba4Ext = 32854,
/// <summary>
/// Original was GL_RGBA4_OES = 0x8056
/// </summary>
Rgba4Oes = 32854,
/// <summary>
/// Original was GL_RGB5_A1 = 0x8057
/// </summary>
Rgb5A1 = 32855,
/// <summary>
/// Original was GL_RGB5_A1_EXT = 0x8057
/// </summary>
Rgb5A1Ext = 32855,
/// <summary>
/// Original was GL_RGB5_A1_OES = 0x8057
/// </summary>
Rgb5A1Oes = 32855,
/// <summary>
/// Original was GL_RGBA8 = 0x8058
/// </summary>
Rgba8 = 32856,
/// <summary>
/// Original was GL_RGBA8_EXT = 0x8058
/// </summary>
Rgba8Ext = 32856,
/// <summary>
/// Original was GL_RGBA8_OES = 0x8058
/// </summary>
Rgba8Oes = 32856,
/// <summary>
/// Original was GL_RGB10_A2 = 0x8059
/// </summary>
Rgb10A2 = 32857,
/// <summary>
/// Original was GL_RGB10_A2_EXT = 0x8059
/// </summary>
Rgb10A2Ext = 32857,
/// <summary>
/// Original was GL_RGBA12 = 0x805A
/// </summary>
Rgba12 = 32858,
/// <summary>
/// Original was GL_RGBA12_EXT = 0x805A
/// </summary>
Rgba12Ext = 32858,
/// <summary>
/// Original was GL_RGBA16 = 0x805B
/// </summary>
Rgba16 = 32859,
/// <summary>
/// Original was GL_RGBA16_EXT = 0x805B
/// </summary>
Rgba16Ext = 32859,
/// <summary>
/// Original was GL_DUAL_ALPHA4_SGIS = 0x8110
/// </summary>
DualAlpha4Sgis = 33040,
/// <summary>
/// Original was GL_DUAL_ALPHA8_SGIS = 0x8111
/// </summary>
DualAlpha8Sgis = 33041,
/// <summary>
/// Original was GL_DUAL_ALPHA12_SGIS = 0x8112
/// </summary>
DualAlpha12Sgis = 33042,
/// <summary>
/// Original was GL_DUAL_ALPHA16_SGIS = 0x8113
/// </summary>
DualAlpha16Sgis = 33043,
/// <summary>
/// Original was GL_DUAL_LUMINANCE4_SGIS = 0x8114
/// </summary>
DualLuminance4Sgis = 33044,
/// <summary>
/// Original was GL_DUAL_LUMINANCE8_SGIS = 0x8115
/// </summary>
DualLuminance8Sgis = 33045,
/// <summary>
/// Original was GL_DUAL_LUMINANCE12_SGIS = 0x8116
/// </summary>
DualLuminance12Sgis = 33046,
/// <summary>
/// Original was GL_DUAL_LUMINANCE16_SGIS = 0x8117
/// </summary>
DualLuminance16Sgis = 33047,
/// <summary>
/// Original was GL_DUAL_INTENSITY4_SGIS = 0x8118
/// </summary>
DualIntensity4Sgis = 33048,
/// <summary>
/// Original was GL_DUAL_INTENSITY8_SGIS = 0x8119
/// </summary>
DualIntensity8Sgis = 33049,
/// <summary>
/// Original was GL_DUAL_INTENSITY12_SGIS = 0x811A
/// </summary>
DualIntensity12Sgis = 33050,
/// <summary>
/// Original was GL_DUAL_INTENSITY16_SGIS = 0x811B
/// </summary>
DualIntensity16Sgis = 33051,
/// <summary>
/// Original was GL_DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C
/// </summary>
DualLuminanceAlpha4Sgis = 33052,
/// <summary>
/// Original was GL_DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D
/// </summary>
DualLuminanceAlpha8Sgis = 33053,
/// <summary>
/// Original was GL_QUAD_ALPHA4_SGIS = 0x811E
/// </summary>
QuadAlpha4Sgis = 33054,
/// <summary>
/// Original was GL_QUAD_ALPHA8_SGIS = 0x811F
/// </summary>
QuadAlpha8Sgis = 33055,
/// <summary>
/// Original was GL_QUAD_LUMINANCE4_SGIS = 0x8120
/// </summary>
QuadLuminance4Sgis = 33056,
/// <summary>
/// Original was GL_QUAD_LUMINANCE8_SGIS = 0x8121
/// </summary>
QuadLuminance8Sgis = 33057,
/// <summary>
/// Original was GL_QUAD_INTENSITY4_SGIS = 0x8122
/// </summary>
QuadIntensity4Sgis = 33058,
/// <summary>
/// Original was GL_QUAD_INTENSITY8_SGIS = 0x8123
/// </summary>
QuadIntensity8Sgis = 33059,
/// <summary>
/// Original was GL_DEPTH_COMPONENT16 = 0x81A5
/// </summary>
DepthComponent16 = 33189,
/// <summary>
/// Original was GL_DEPTH_COMPONENT16_ARB = 0x81A5
/// </summary>
DepthComponent16Arb = 33189,
/// <summary>
/// Original was GL_DEPTH_COMPONENT16_OES = 0x81A5
/// </summary>
DepthComponent16Oes = 33189,
/// <summary>
/// Original was GL_DEPTH_COMPONENT16_SGIX = 0x81A5
/// </summary>
DepthComponent16Sgix = 33189,
/// <summary>
/// Original was GL_DEPTH_COMPONENT24_ARB = 0x81A6
/// </summary>
DepthComponent24Arb = 33190,
/// <summary>
/// Original was GL_DEPTH_COMPONENT24_OES = 0x81A6
/// </summary>
DepthComponent24Oes = 33190,
/// <summary>
/// Original was GL_DEPTH_COMPONENT24_SGIX = 0x81A6
/// </summary>
DepthComponent24Sgix = 33190,
/// <summary>
/// Original was GL_DEPTH_COMPONENT32_ARB = 0x81A7
/// </summary>
DepthComponent32Arb = 33191,
/// <summary>
/// Original was GL_DEPTH_COMPONENT32_OES = 0x81A7
/// </summary>
DepthComponent32Oes = 33191,
/// <summary>
/// Original was GL_DEPTH_COMPONENT32_SGIX = 0x81A7
/// </summary>
DepthComponent32Sgix = 33191,
/// <summary>
/// Original was GL_COMPRESSED_RED = 0x8225
/// </summary>
CompressedRed = 33317,
/// <summary>
/// Original was GL_COMPRESSED_RG = 0x8226
/// </summary>
CompressedRg = 33318,
/// <summary>
/// Original was GL_RG = 0x8227
/// </summary>
Rg = 33319,
/// <summary>
/// Original was GL_R8 = 0x8229
/// </summary>
R8 = 33321,
/// <summary>
/// Original was GL_R8_EXT = 0x8229
/// </summary>
R8Ext = 33321,
/// <summary>
/// Original was GL_R16 = 0x822A
/// </summary>
R16 = 33322,
/// <summary>
/// Original was GL_R16_EXT = 0x822A
/// </summary>
R16Ext = 33322,
/// <summary>
/// Original was GL_RG8 = 0x822B
/// </summary>
Rg8 = 33323,
/// <summary>
/// Original was GL_RG8_EXT = 0x822B
/// </summary>
Rg8Ext = 33323,
/// <summary>
/// Original was GL_RG16 = 0x822C
/// </summary>
Rg16 = 33324,
/// <summary>
/// Original was GL_RG16_EXT = 0x822C
/// </summary>
Rg16Ext = 33324,
/// <summary>
/// Original was GL_R16F = 0x822D
/// </summary>
R16f = 33325,
/// <summary>
/// Original was GL_R16F_EXT = 0x822D
/// </summary>
R16fExt = 33325,
/// <summary>
/// Original was GL_R32F = 0x822E
/// </summary>
R32f = 33326,
/// <summary>
/// Original was GL_R32F_EXT = 0x822E
/// </summary>
R32fExt = 33326,
/// <summary>
/// Original was GL_RG16F = 0x822F
/// </summary>
Rg16f = 33327,
/// <summary>
/// Original was GL_RG16F_EXT = 0x822F
/// </summary>
Rg16fExt = 33327,
/// <summary>
/// Original was GL_RG32F = 0x8230
/// </summary>
Rg32f = 33328,
/// <summary>
/// Original was GL_RG32F_EXT = 0x8230
/// </summary>
Rg32fExt = 33328,
/// <summary>
/// Original was GL_R8I = 0x8231
/// </summary>
R8i = 33329,
/// <summary>
/// Original was GL_R8UI = 0x8232
/// </summary>
R8ui = 33330,
/// <summary>
/// Original was GL_R16I = 0x8233
/// </summary>
R16i = 33331,
/// <summary>
/// Original was GL_R16UI = 0x8234
/// </summary>
R16ui = 33332,
/// <summary>
/// Original was GL_R32I = 0x8235
/// </summary>
R32i = 33333,
/// <summary>
/// Original was GL_R32UI = 0x8236
/// </summary>
R32ui = 33334,
/// <summary>
/// Original was GL_RG8I = 0x8237
/// </summary>
Rg8i = 33335,
/// <summary>
/// Original was GL_RG8UI = 0x8238
/// </summary>
Rg8ui = 33336,
/// <summary>
/// Original was GL_RG16I = 0x8239
/// </summary>
Rg16i = 33337,
/// <summary>
/// Original was GL_RG16UI = 0x823A
/// </summary>
Rg16ui = 33338,
/// <summary>
/// Original was GL_RG32I = 0x823B
/// </summary>
Rg32i = 33339,
/// <summary>
/// Original was GL_RG32UI = 0x823C
/// </summary>
Rg32ui = 33340,
/// <summary>
/// Original was GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0
/// </summary>
CompressedRgbS3tcDxt1Ext = 33776,
/// <summary>
/// Original was GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1
/// </summary>
CompressedRgbaS3tcDxt1Ext = 33777,
/// <summary>
/// Original was GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2
/// </summary>
CompressedRgbaS3tcDxt3Ext = 33778,
/// <summary>
/// Original was GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3
/// </summary>
CompressedRgbaS3tcDxt5Ext = 33779,
/// <summary>
/// Original was GL_COMPRESSED_RGB = 0x84ED
/// </summary>
CompressedRgb = 34029,
/// <summary>
/// Original was GL_COMPRESSED_RGBA = 0x84EE
/// </summary>
CompressedRgba = 34030,
/// <summary>
/// Original was GL_DEPTH_STENCIL = 0x84F9
/// </summary>
DepthStencil = 34041,
/// <summary>
/// Original was GL_DEPTH_STENCIL_EXT = 0x84F9
/// </summary>
DepthStencilExt = 34041,
/// <summary>
/// Original was GL_DEPTH_STENCIL_NV = 0x84F9
/// </summary>
DepthStencilNv = 34041,
/// <summary>
/// Original was GL_DEPTH_STENCIL_OES = 0x84F9
/// </summary>
DepthStencilOes = 34041,
/// <summary>
/// Original was GL_DEPTH_STENCIL_MESA = 0x8750
/// </summary>
DepthStencilMesa = 34640,
/// <summary>
/// Original was GL_RGBA32F = 0x8814
/// </summary>
Rgba32f = 34836,
/// <summary>
/// Original was GL_RGBA32F_ARB = 0x8814
/// </summary>
Rgba32fArb = 34836,
/// <summary>
/// Original was GL_RGBA32F_EXT = 0x8814
/// </summary>
Rgba32fExt = 34836,
/// <summary>
/// Original was GL_RGBA16F = 0x881A
/// </summary>
Rgba16f = 34842,
/// <summary>
/// Original was GL_RGBA16F_ARB = 0x881A
/// </summary>
Rgba16fArb = 34842,
/// <summary>
/// Original was GL_RGBA16F_EXT = 0x881A
/// </summary>
Rgba16fExt = 34842,
/// <summary>
/// Original was GL_RGB16F = 0x881B
/// </summary>
Rgb16f = 34843,
/// <summary>
/// Original was GL_RGB16F_ARB = 0x881B
/// </summary>
Rgb16fArb = 34843,
/// <summary>
/// Original was GL_RGB16F_EXT = 0x881B
/// </summary>
Rgb16fExt = 34843,
/// <summary>
/// Original was GL_DEPTH24_STENCIL8 = 0x88F0
/// </summary>
Depth24Stencil8 = 35056,
/// <summary>
/// Original was GL_DEPTH24_STENCIL8_EXT = 0x88F0
/// </summary>
Depth24Stencil8Ext = 35056,
/// <summary>
/// Original was GL_DEPTH24_STENCIL8_OES = 0x88F0
/// </summary>
Depth24Stencil8Oes = 35056,
/// <summary>
/// Original was GL_R11F_G11F_B10F = 0x8C3A
/// </summary>
R11fG11fB10f = 35898,
/// <summary>
/// Original was GL_R11F_G11F_B10F_APPLE = 0x8C3A
/// </summary>
R11fG11fB10fApple = 35898,
/// <summary>
/// Original was GL_R11F_G11F_B10F_EXT = 0x8C3A
/// </summary>
R11fG11fB10fExt = 35898,
/// <summary>
/// Original was GL_RGB9_E5 = 0x8C3D
/// </summary>
Rgb9E5 = 35901,
/// <summary>
/// Original was GL_RGB9_E5_APPLE = 0x8C3D
/// </summary>
Rgb9E5Apple = 35901,
/// <summary>
/// Original was GL_RGB9_E5_EXT = 0x8C3D
/// </summary>
Rgb9E5Ext = 35901,
/// <summary>
/// Original was GL_SRGB = 0x8C40
/// </summary>
Srgb = 35904,
/// <summary>
/// Original was GL_SRGB_EXT = 0x8C40
/// </summary>
SrgbExt = 35904,
/// <summary>
/// Original was GL_SRGB8 = 0x8C41
/// </summary>
Srgb8 = 35905,
/// <summary>
/// Original was GL_SRGB8_EXT = 0x8C41
/// </summary>
Srgb8Ext = 35905,
/// <summary>
/// Original was GL_SRGB8_NV = 0x8C41
/// </summary>
Srgb8Nv = 35905,
/// <summary>
/// Original was GL_SRGB_ALPHA = 0x8C42
/// </summary>
SrgbAlpha = 35906,
/// <summary>
/// Original was GL_SRGB_ALPHA_EXT = 0x8C42
/// </summary>
SrgbAlphaExt = 35906,
/// <summary>
/// Original was GL_SRGB8_ALPHA8 = 0x8C43
/// </summary>
Srgb8Alpha8 = 35907,
/// <summary>
/// Original was GL_SRGB8_ALPHA8_EXT = 0x8C43
/// </summary>
Srgb8Alpha8Ext = 35907,
/// <summary>
/// Original was GL_COMPRESSED_SRGB = 0x8C48
/// </summary>
CompressedSrgb = 35912,
/// <summary>
/// Original was GL_COMPRESSED_SRGB_ALPHA = 0x8C49
/// </summary>
CompressedSrgbAlpha = 35913,
/// <summary>
/// Original was GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C
/// </summary>
CompressedSrgbS3tcDxt1Ext = 35916,
/// <summary>
/// Original was GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D
/// </summary>
CompressedSrgbAlphaS3tcDxt1Ext = 35917,
/// <summary>
/// Original was GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E
/// </summary>
CompressedSrgbAlphaS3tcDxt3Ext = 35918,
/// <summary>
/// Original was GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F
/// </summary>
CompressedSrgbAlphaS3tcDxt5Ext = 35919,
/// <summary>
/// Original was GL_DEPTH_COMPONENT32F = 0x8CAC
/// </summary>
DepthComponent32f = 36012,
/// <summary>
/// Original was GL_DEPTH32F_STENCIL8 = 0x8CAD
/// </summary>
Depth32fStencil8 = 36013,
/// <summary>
/// Original was GL_RGBA32UI = 0x8D70
/// </summary>
Rgba32ui = 36208,
/// <summary>
/// Original was GL_RGB32UI = 0x8D71
/// </summary>
Rgb32ui = 36209,
/// <summary>
/// Original was GL_RGBA16UI = 0x8D76
/// </summary>
Rgba16ui = 36214,
/// <summary>
/// Original was GL_RGB16UI = 0x8D77
/// </summary>
Rgb16ui = 36215,
/// <summary>
/// Original was GL_RGBA8UI = 0x8D7C
/// </summary>
Rgba8ui = 36220,
/// <summary>
/// Original was GL_RGB8UI = 0x8D7D
/// </summary>
Rgb8ui = 36221,
/// <summary>
/// Original was GL_RGBA32I = 0x8D82
/// </summary>
Rgba32i = 36226,
/// <summary>
/// Original was GL_RGB32I = 0x8D83
/// </summary>
Rgb32i = 36227,
/// <summary>
/// Original was GL_RGBA16I = 0x8D88
/// </summary>
Rgba16i = 36232,
/// <summary>
/// Original was GL_RGB16I = 0x8D89
/// </summary>
Rgb16i = 36233,
/// <summary>
/// Original was GL_RGBA8I = 0x8D8E
/// </summary>
Rgba8i = 36238,
/// <summary>
/// Original was GL_RGB8I = 0x8D8F
/// </summary>
Rgb8i = 36239,
/// <summary>
/// Original was GL_DEPTH_COMPONENT32F_NV = 0x8DAB
/// </summary>
DepthComponent32fNv = 36267,
/// <summary>
/// Original was GL_DEPTH32F_STENCIL8_NV = 0x8DAC
/// </summary>
Depth32fStencil8Nv = 36268,
/// <summary>
/// Original was GL_COMPRESSED_RED_RGTC1 = 0x8DBB
/// </summary>
CompressedRedRgtc1 = 36283,
/// <summary>
/// Original was GL_COMPRESSED_RED_RGTC1_EXT = 0x8DBB
/// </summary>
CompressedRedRgtc1Ext = 36283,
/// <summary>
/// Original was GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC
/// </summary>
CompressedSignedRedRgtc1 = 36284,
/// <summary>
/// Original was GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC
/// </summary>
CompressedSignedRedRgtc1Ext = 36284,
/// <summary>
/// Original was GL_COMPRESSED_RG_RGTC2 = 0x8DBD
/// </summary>
CompressedRgRgtc2 = 36285,
/// <summary>
/// Original was GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE
/// </summary>
CompressedSignedRgRgtc2 = 36286,
/// <summary>
/// Original was GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C
/// </summary>
CompressedRgbaBptcUnorm = 36492,
/// <summary>
/// Original was GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D
/// </summary>
CompressedSrgbAlphaBptcUnorm = 36493,
/// <summary>
/// Original was GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E
/// </summary>
CompressedRgbBptcSignedFloat = 36494,
/// <summary>
/// Original was GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F
/// </summary>
CompressedRgbBptcUnsignedFloat = 36495,
/// <summary>
/// Original was GL_R8_SNORM = 0x8F94
/// </summary>
R8Snorm = 36756,
/// <summary>
/// Original was GL_RG8_SNORM = 0x8F95
/// </summary>
Rg8Snorm = 36757,
/// <summary>
/// Original was GL_RGB8_SNORM = 0x8F96
/// </summary>
Rgb8Snorm = 36758,
/// <summary>
/// Original was GL_RGBA8_SNORM = 0x8F97
/// </summary>
Rgba8Snorm = 36759,
/// <summary>
/// Original was GL_R16_SNORM = 0x8F98
/// </summary>
R16Snorm = 36760,
/// <summary>
/// Original was GL_R16_SNORM_EXT = 0x8F98
/// </summary>
R16SnormExt = 36760,
/// <summary>
/// Original was GL_RG16_SNORM = 0x8F99
/// </summary>
Rg16Snorm = 36761,
/// <summary>
/// Original was GL_RG16_SNORM_EXT = 0x8F99
/// </summary>
Rg16SnormExt = 36761,
/// <summary>
/// Original was GL_RGB16_SNORM = 0x8F9A
/// </summary>
Rgb16Snorm = 36762,
/// <summary>
/// Original was GL_RGB16_SNORM_EXT = 0x8F9A
/// </summary>
Rgb16SnormExt = 36762,
/// <summary>
/// Original was GL_RGB10_A2UI = 0x906F
/// </summary>
Rgb10A2ui = 36975,
/// <summary>
/// Original was GL_COMPRESSED_R11_EAC = 0x9270
/// </summary>
CompressedR11Eac = 37488,
/// <summary>
/// Original was GL_COMPRESSED_SIGNED_R11_EAC = 0x9271
/// </summary>
CompressedSignedR11Eac = 37489,
/// <summary>
/// Original was GL_COMPRESSED_RG11_EAC = 0x9272
/// </summary>
CompressedRg11Eac = 37490,
/// <summary>
/// Original was GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273
/// </summary>
CompressedSignedRg11Eac = 37491,
/// <summary>
/// Original was GL_COMPRESSED_RGB8_ETC2 = 0x9274
/// </summary>
CompressedRgb8Etc2 = 37492,
/// <summary>
/// Original was GL_COMPRESSED_SRGB8_ETC2 = 0x9275
/// </summary>
CompressedSrgb8Etc2 = 37493,
/// <summary>
/// Original was GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276
/// </summary>
CompressedRgb8PunchthroughAlpha1Etc2 = 37494,
/// <summary>
/// Original was GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277
/// </summary>
CompressedSrgb8PunchthroughAlpha1Etc2 = 37495,
/// <summary>
/// Original was GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278
/// </summary>
CompressedRgba8Etc2Eac = 37496,
/// <summary>
/// Original was GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279
/// </summary>
CompressedSrgb8Alpha8Etc2Eac = 37497
}
} | 31.595773 | 78 | 0.512501 | [
"MIT"
] | DeKaDeNcE/WoWDatabaseEditor | Rendering/OpenGLBindings/InternalFormat.cs | 23,918 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace ApiService.Controllers
{
//client_id:client.api.service
//client_secret:clientsecret
//grant_type:password
//username:edison@hotmail.com
//password:edisonpassword
/// <summary>
/// 这是注释
/// </summary>
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class ValuesController : ControllerBase
{
// GET api/values
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
return "value";
}
// POST api/values
[HttpPost]
public void Post([FromBody] UserLikeDto userLikeDto)
{
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value)
{
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
public class UserLikeDto
{
public SubjectType SubjectType { get; set; }
public long SubjectId { get; set; }
}
public enum SubjectType
{
A=1,
B=2
}
}
| 21.411765 | 60 | 0.559753 | [
"MIT"
] | MaybeEleven/dotnetcore-examples | Authentication-and-Authorization/ApiService/Controllers/ValuesController.cs | 1,466 | C# |
/*
* Demo program for ListView Sorting
* Created by Li Gao, 2007
*
* Modified for demo purposes only.
* This program is provided as is and no warranty or support.
* Use it as your own risk
* */
using System;
using System.Collections;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.ComponentModel;
namespace SamplePrism.Presentation.Controls.ListViewEx
{
static public class ListViewSorter
{
public static DependencyProperty CustomSorterProperty = DependencyProperty.RegisterAttached(
"CustomSorter",
typeof(IComparer),
typeof(ListViewSorter));
public static IComparer GetCustomSorter(DependencyObject obj)
{
return (IComparer)obj.GetValue(CustomSorterProperty);
}
public static void SetCustomSorter(DependencyObject obj, IComparer value)
{
obj.SetValue(CustomSorterProperty, value);
}
public static DependencyProperty SortBindingMemberProperty = DependencyProperty.RegisterAttached(
"SortBindingMember",
typeof(BindingBase),
typeof(ListViewSorter));
public static BindingBase GetSortBindingMember(DependencyObject obj)
{
return (BindingBase)obj.GetValue(SortBindingMemberProperty);
}
public static void SetSortBindingMember(DependencyObject obj, BindingBase value)
{
obj.SetValue(SortBindingMemberProperty, value);
}
public readonly static DependencyProperty IsListviewSortableProperty = DependencyProperty.RegisterAttached(
"IsListviewSortable",
typeof(Boolean),
typeof(ListViewSorter),
new FrameworkPropertyMetadata(false, OnRegisterSortableGrid));
public static Boolean GetIsListviewSortable(DependencyObject obj)
{
//return true;
return (Boolean)obj.GetValue(IsListviewSortableProperty);
}
public static void SetIsListviewSortable(DependencyObject obj, Boolean value)
{
obj.SetValue(IsListviewSortableProperty, value);
}
private static GridViewColumnHeader _lastHeaderClicked;
private static ListSortDirection _lastDirection = ListSortDirection.Ascending;
private static ListView _lv;
private static void OnRegisterSortableGrid(DependencyObject obj,
DependencyPropertyChangedEventArgs args)
{
var grid = obj as ListView;
if (grid != null)
{
_lv = grid;
RegisterSortableGridView(grid, args);
}
}
private static void RegisterSortableGridView(ListView grid,
DependencyPropertyChangedEventArgs args)
{
if (args.NewValue is Boolean && (Boolean)args.NewValue)
{
grid.AddHandler(ButtonBase.ClickEvent,
new RoutedEventHandler(GridViewColumnHeaderClickedHandler));
}
else
{
grid.AddHandler(ButtonBase.ClickEvent,
new RoutedEventHandler(GridViewColumnHeaderClickedHandler));
}
}
private static void GridViewColumnHeaderClickedHandler(object sender, RoutedEventArgs e)
{
var headerClicked = e.OriginalSource as GridViewColumnHeader;
if (headerClicked != null)
{
ListSortDirection direction;
if (!Equals(headerClicked, _lastHeaderClicked))
{
direction = ListSortDirection.Ascending;
}
else
{
direction = _lastDirection == ListSortDirection.Ascending ? ListSortDirection.Descending : ListSortDirection.Ascending;
}
string header = String.Empty;
try
{
header = ((Binding)GetSortBindingMember(headerClicked.Column)).Path.Path;
}
catch (Exception)
{
}
if (header == String.Empty)
return;
Sort(header, direction);
string resourceTypeName = String.Empty;
//if (_lastHeaderClicked != null)
//{
// ResourceTypeName = "HeaderTemplateSortNon";
// tmpTemplate = lv.TryFindResource(ResourceTypeName) as DataTemplate;
// _lastHeaderClicked.Column.HeaderTemplate = tmpTemplate;
//}
switch (direction)
{
case ListSortDirection.Ascending: resourceTypeName = "HeaderTemplateSortAsc"; break;
case ListSortDirection.Descending: resourceTypeName = "HeaderTemplateSortDesc"; break;
}
var tmpTemplate = _lv.TryFindResource(resourceTypeName) as DataTemplate;
if (tmpTemplate != null)
{
headerClicked.Column.HeaderTemplate = tmpTemplate;
}
_lastHeaderClicked = headerClicked;
_lastDirection = direction;
}
}
private static void Sort(string sortBy, ListSortDirection direction)
{
var view = (ListCollectionView ) CollectionViewSource.GetDefaultView(_lv.ItemsSource);
if (view != null)
{
try
{
var sorter = (ListViewCustomComparer)GetCustomSorter(_lv);
if (sorter != null)
{
// measuring timing of custom sort
int tick1 = Environment.TickCount;
sorter.AddSort(sortBy, direction);
view.CustomSort = sorter;
_lv.Items.Refresh();
int tick2 = Environment.TickCount;
double elapsed1 = (tick2 - tick1)/1000.0;
MessageBox.Show(elapsed1.ToString(CultureInfo.InvariantCulture) + " seconds.");
}
else
{
//measuring timem of SortDescriptions sort
int tick3 = Environment.TickCount;
_lv.Items.SortDescriptions.Clear();
var sd = new SortDescription(sortBy, direction);
_lv.Items.SortDescriptions.Add(sd);
_lv.Items.Refresh();
int tick4 = Environment.TickCount;
double elapsed2 = (tick4 - tick3) / 1000.0;
MessageBox.Show(elapsed2.ToString(CultureInfo.InvariantCulture) + " seconds.");
}
}
catch (Exception)
{
}
}
}
}
}
| 32.212389 | 139 | 0.544368 | [
"Apache-2.0"
] | XYRYTeam/SimplePrism | SamplePrism.Controls/ListViewEx/ListViewSorter.cs | 7,280 | 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 Microsoft.CodeAnalysis.Editor.Shared.Utilities;
namespace Microsoft.CodeAnalysis.Editor.FindUsages
{
internal abstract partial class AbstractFindUsagesService
: IFindUsagesService,
IFindUsagesLSPService
{
}
}
| 30.066667 | 71 | 0.756098 | [
"MIT"
] | belav/roslyn | src/EditorFeatures/Core/FindUsages/AbstractFindUsagesService.cs | 453 | C# |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: EntityCollectionPage.cs.tt
namespace Microsoft.Graph
{
using System;
/// <summary>
/// The type ServiceAnnouncementMessagesCollectionPage.
/// </summary>
public partial class ServiceAnnouncementMessagesCollectionPage : CollectionPage<ServiceUpdateMessage>, IServiceAnnouncementMessagesCollectionPage
{
/// <summary>
/// Gets the next page <see cref="IServiceAnnouncementMessagesCollectionRequest"/> instance.
/// </summary>
public IServiceAnnouncementMessagesCollectionRequest NextPageRequest { get; private set; }
/// <summary>
/// Initializes the NextPageRequest property.
/// </summary>
public void InitializeNextPageRequest(IBaseClient client, string nextPageLinkString)
{
if (!string.IsNullOrEmpty(nextPageLinkString))
{
this.NextPageRequest = new ServiceAnnouncementMessagesCollectionRequest(
nextPageLinkString,
client,
null);
}
}
}
}
| 38.692308 | 153 | 0.590457 | [
"MIT"
] | ScriptBox21/msgraph-sdk-dotnet | src/Microsoft.Graph/Generated/requests/ServiceAnnouncementMessagesCollectionPage.cs | 1,509 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Dynamo.Graph;
using Dynamo.Graph.Nodes;
using Dynamo.Graph.Nodes.CustomNodes;
using Dynamo.Interfaces;
using Dynamo.Models;
namespace Dynamo.Search.SearchElements
{
/// <summary>
/// Search element for custom nodes.
/// </summary>
public class CustomNodeSearchElement : NodeSearchElement
{
private readonly ICustomNodeSource customNodeManager;
public Guid ID { get; private set; }
private string path;
/// <summary>
/// Path to this custom node in disk, used in the Edit context menu.
/// </summary>
public string Path
{
get { return path; }
private set
{
if (value == path) return;
path = value;
}
}
public CustomNodeSearchElement(ICustomNodeSource customNodeManager, CustomNodeInfo info)
{
this.customNodeManager = customNodeManager;
inputParameters = new List<Tuple<string, string>>();
outputParameters = new List<string>();
SyncWithCustomNodeInfo(info);
}
/// <summary>
/// Updates the properties of this search element.
/// </summary>
/// <param name="info"></param>
public void SyncWithCustomNodeInfo(CustomNodeInfo info)
{
ID = info.FunctionId;
Name = info.Name;
FullCategoryName = info.Category;
Description = info.Description;
Path = info.Path;
iconName = ID.ToString();
ElementType = ElementTypes.CustomNode;
if (info.IsPackageMember)
ElementType |= ElementTypes.Packaged; // Add one more flag.
}
protected override NodeModel ConstructNewNodeModel()
{
return customNodeManager.CreateCustomNodeInstance(ID);
}
private void TryLoadDocumentation()
{
if (inputParameters.Any() || outputParameters.Any())
return;
try
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Path);
XmlNodeList elNodes = xmlDoc.GetElementsByTagName("Elements");
if (elNodes.Count == 0)
elNodes = xmlDoc.GetElementsByTagName("dynElements");
XmlNode elNodesList = elNodes[0];
foreach (XmlNode elNode in elNodesList.ChildNodes)
{
foreach (var subNode in
elNode.ChildNodes.Cast<XmlNode>()
.Where(subNode => (subNode.Name == "Symbol")))
{
var parameter = subNode.Attributes[0].Value;
if (parameter != string.Empty)
{
if ((subNode.ParentNode.Name == "Dynamo.Graph.Nodes.Symbol") ||
(subNode.ParentNode.Name == "Dynamo.Graph.Nodes.dynSymbol"))
inputParameters.Add(Tuple.Create(parameter, ""));
if ((subNode.ParentNode.Name == "Dynamo.Graph.Nodes.Output") ||
(subNode.ParentNode.Name == "Dynamo.Graph.Nodes.dynOutput"))
outputParameters.Add(parameter);
}
}
}
}
catch
{
}
}
protected override IEnumerable<Tuple<string, string>> GenerateInputParameters()
{
TryLoadDocumentation();
if (!inputParameters.Any())
inputParameters.Add(Tuple.Create("", "none"));
return inputParameters;
}
protected override IEnumerable<string> GenerateOutputParameters()
{
TryLoadDocumentation();
if (!outputParameters.Any())
outputParameters.Add("none");
return outputParameters;
}
}
}
| 32.382813 | 96 | 0.520869 | [
"Apache-2.0",
"MIT"
] | frankfralick/Dynamo | src/DynamoCore/Search/SearchElements/CustomNodeSearchElement.cs | 4,147 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.DynamicProxy;
using SimpleInjector;
using Xunit;
namespace RedSheeps.SimpleInjector.DynamicProxy.Tests
{
public class WhenMethodTypeParameterFixture
{
[Fact]
public void WhenCreateClassProxyWithTarget()
{
var container = new Container();
container.Register<IncrementInterceptor>();
container.InterceptWith<IncrementInterceptor>(x => x != typeof(IncrementInterceptor));
container.Register<NotImplementInterface>();
container.Verify();
var instance = container.GetInstance<NotImplementInterface>();
Assert.Equal(3, instance.Increment(1));
}
[Fact]
public void WhenCreateInterfaceProxyWithTarget()
{
var container = new Container();
container.Register<IncrementInterceptor>();
container.Register<IInterface, ImplementInterface>();
container.InterceptWith<IncrementInterceptor>(x => x != typeof(IncrementInterceptor));
container.Verify();
var instance = container.GetInstance<IInterface>();
Assert.Equal(3, instance.Increment(1));
}
[Fact]
public void WhenNotWeaving()
{
var container = new Container();
container.Register<IncrementInterceptor>();
container.Register<NotImplementInterface>();
container.InterceptWith<IncrementInterceptor>(x => false);
container.Verify();
var instance = container.GetInstance<NotImplementInterface>();
Assert.Equal(2, instance.Increment(1));
}
[Fact]
public void WhenNotRegisterdInterceptor()
{
var container = new Container();
container.InterceptWith<IncrementInterceptor>(x => true);
container.Register<NotImplementInterface>();
Assert.Throws<InvalidOperationException>(() => container.Verify());
}
public class IncrementInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
invocation.Proceed();
invocation.ReturnValue = (int)invocation.ReturnValue + 1;
}
}
public class NotImplementInterface
{
public virtual int Increment(int value)
{
return ++value;
}
}
public interface IInterface
{
int Increment(int value);
}
public class ImplementInterface : IInterface
{
public virtual int Increment(int value)
{
return ++value;
}
}
}
}
| 30.580645 | 98 | 0.591069 | [
"MIT"
] | RedSheeps/RedSheeps.SimpleInjector.DynamicProxy | Source/RedSheeps.SimpleInjector.DynamicProxy.Tests/WhenMethodTypeParameterFixture.cs | 2,846 | C# |
using Entitas;
public sealed class UpdateTimeSystem : IExecuteSystem, IInitializeSystem
{
private readonly Contexts _contexts;
private readonly ITimeService _timeService;
public UpdateTimeSystem(Contexts contexts, Services services)
{
_contexts = contexts;
_timeService = services.TimeService;
}
public void Initialize()
{
//Make it bulletproof
Execute();
}
public void Execute()
{
_contexts.input.ReplaceFixedDeltaTime(_timeService.FixedDeltaTime());
_contexts.input.ReplaceDeltaTime(_timeService.DeltaTime());
_contexts.input.ReplaceRealtimeSinceStartup(_timeService.RealtimeSinceStartup());
}
} | 27 | 89 | 0.705128 | [
"MIT"
] | Master-Maniac/Endless-Runner-Entitas-ECS | Assets/Sources/Input/Time/UpdateTimeSystem.cs | 704 | C# |
using System;
using System.ComponentModel.DataAnnotations;
using Abp.Application.Services.Dto;
using Abp.Authorization.Users;
using Abp.AutoMapper;
using iMasterEnglishNG.Authorization.Users;
namespace iMasterEnglishNG.Users.Dto
{
[AutoMapFrom(typeof(User))]
public class UserDto : EntityDto<long>
{
[Required]
[StringLength(AbpUserBase.MaxUserNameLength)]
public string UserName { get; set; }
[Required]
[StringLength(AbpUserBase.MaxNameLength)]
public string Name { get; set; }
[Required]
[StringLength(AbpUserBase.MaxSurnameLength)]
public string Surname { get; set; }
[Required]
[EmailAddress]
[StringLength(AbpUserBase.MaxEmailAddressLength)]
public string EmailAddress { get; set; }
public bool IsActive { get; set; }
public string FullName { get; set; }
public DateTime? LastLoginTime { get; set; }
public DateTime CreationTime { get; set; }
public string[] RoleNames { get; set; }
}
}
| 25.902439 | 57 | 0.656309 | [
"MIT"
] | RenJieJiang/iMasterEnglishNG | aspnet-core/src/iMasterEnglishNG.Application/Users/Dto/UserDto.cs | 1,062 | C# |
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable ClassNeverInstantiated.Global
#nullable disable
namespace Lambdy.Tests.TestModels.NorthwindTables
{
public partial class Region
{
public long Id { get; set; }
public string RegionDescription { get; set; }
}
}
| 25.857143 | 55 | 0.745856 | [
"MIT"
] | vladimirbelyayev/Lambdy | Lambdy.Tests/TestModels/NorthwindTables/Region.cs | 364 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Cofoundry.Domain;
using Cofoundry.Domain.CQS;
namespace Cofoundry.Web.Admin
{
public class CustomEntityRoutingRulesApiController : BaseAdminApiController
{
private readonly IApiResponseHelper _apiResponseHelper;
public CustomEntityRoutingRulesApiController(
IApiResponseHelper apiResponseHelper
)
{
_apiResponseHelper = apiResponseHelper;
}
public async Task<JsonResult> Get()
{
return await _apiResponseHelper.RunQueryAsync(new GetAllCustomEntityRoutingRulesQuery());
}
}
} | 27 | 101 | 0.710562 | [
"MIT"
] | BearerPipelineTest/cofoundry | src/Cofoundry.Web.Admin/Admin/Api/CustomEntities/CustomEntityRoutingRulesApiController.cs | 731 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MostrarJoinha")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MostrarJoinha")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7545f131-ddb4-4e59-bd8f-73ed6f14bbcc")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.675676 | 84 | 0.748207 | [
"MIT"
] | Pixke/HBSIS | 22-26_07/MostrarJoinha/Properties/AssemblyInfo.cs | 1,397 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
namespace BungieNet.Destiny
{
/// <summary>
/// Indicates the type of filter to apply to Vendor results.
/// </summary>
public enum DestinyVendorFilter
{
None = 0,
ApiPurchasable = 1
}
}
| 23.833333 | 81 | 0.480769 | [
"BSD-3-Clause"
] | madreflection/MadReflection.BungieNetApi | src/MadReflection.BungieNetApi.Entities/Generated_/Destiny/DestinyVendorFilter.cs | 574 | C# |
using EPiServer.Commerce.Order;
using EPiServer.Framework.Localization;
using EPiServer.ServiceLocation;
using Foundation.Cms.Attributes;
using Foundation.Commerce.Markets;
using Foundation.Features.MyAccount.CreditCard;
using Mediachase.Commerce;
using Mediachase.Commerce.Customers;
using Mediachase.Commerce.Orders;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Web.Mvc;
namespace Foundation.Features.Checkout.Payments
{
public class GenericCreditCardPaymentOption : PaymentOptionBase, IDataErrorInfo
{
private static readonly string[] ValidatedProperties =
{
"CreditCardNumber",
"CreditCardSecurityCode",
"ExpirationYear",
"ExpirationMonth",
};
public override string SystemKeyword => "GenericCreditCard";
public List<SelectListItem> Months { get; set; }
public List<SelectListItem> Years { get; set; }
public List<SelectListItem> AvaiableCreditCards { get; set; }
[LocalizedRequired("/Checkout/Payment/Methods/CreditCard/Empty/SelectCreditCard")]
public string SelectedCreditCardId { get; set; }
[DefaultValue(true)]
public bool UseSelectedCreditCard { get; set; }
[LocalizedDisplay("/Checkout/Payment/Methods/CreditCard/Labels/CreditCardName")]
[LocalizedRequired("/Checkout/Payment/Methods/CreditCard/Empty/CreditCardName")]
public string CreditCardName { get; set; }
[LocalizedDisplay("/Checkout/Payment/Methods/CreditCard/Labels/CreditCardNumber")]
[LocalizedRequired("/Checkout/Payment/Methods/CreditCard/Empty/CreditCardNumber")]
public string CreditCardNumber { get; set; }
[LocalizedDisplay("/Checkout/Payment/Methods/CreditCard/Labels/CreditCardSecurityCode")]
[LocalizedRequired("/Checkout/Payment/Methods/CreditCard/Empty/CreditCardSecurityCode")]
public string CreditCardSecurityCode { get; set; }
[LocalizedDisplay("/Checkout/Payment/Methods/CreditCard/Labels/ExpirationMonth")]
[LocalizedRequired("/Checkout/Payment/Methods/CreditCard/Empty/ExpirationMonth")]
public int ExpirationMonth { get; set; }
[LocalizedDisplay("/Checkout/Payment/Methods/CreditCard/Labels/ExpirationYear")]
[LocalizedRequired("/Checkout/Payment/Methods/CreditCard/Empty/ExpirationYear")]
public int ExpirationYear { get; set; }
public string CardType { get; set; }
public CreditCard.eCreditCardType CreditCardType { get; set; }
string IDataErrorInfo.Error => null;
string IDataErrorInfo.this[string columnName] => GetValidationError(columnName);
public GenericCreditCardPaymentOption()
: this(LocalizationService.Current, ServiceLocator.Current.GetInstance<IOrderGroupFactory>(), ServiceLocator.Current.GetInstance<ICurrentMarket>(), ServiceLocator.Current.GetInstance<LanguageService>(), ServiceLocator.Current.GetInstance<IPaymentService>(), ServiceLocator.Current.GetInstance<ICreditCardService>())
{
}
private readonly ICreditCardService _creditCardService;
public GenericCreditCardPaymentOption(LocalizationService localizationService,
IOrderGroupFactory orderGroupFactory,
ICurrentMarket currentMarket,
LanguageService languageService,
IPaymentService paymentService,
ICreditCardService creditCardService)
: base(localizationService, orderGroupFactory, currentMarket, languageService, paymentService)
{
_creditCardService = creditCardService;
InitializeValues();
ExpirationMonth = DateTime.Now.Month;
CreditCardSecurityCode = "212";
CardType = "Generic";
CreditCardNumber = "4662519843660534";
}
public override IPayment CreatePayment(decimal amount, IOrderGroup orderGroup)
{
var payment = orderGroup.CreateCardPayment(OrderGroupFactory);
payment.CardType = "Credit card";
payment.PaymentMethodId = PaymentMethodId;
payment.PaymentMethodName = SystemKeyword;
payment.Amount = amount;
if (UseSelectedCreditCard && !string.IsNullOrEmpty(SelectedCreditCardId))
{
var creditCard = _creditCardService.GetCreditCard(SelectedCreditCardId);
payment.CreditCardNumber = creditCard.CreditCardNumber;
payment.CreditCardSecurityCode = creditCard.SecurityCode;
payment.ExpirationMonth = creditCard.ExpirationMonth ?? 1;
payment.ExpirationYear = creditCard.ExpirationYear ?? DateTime.Now.Year;
}
else
{
payment.CreditCardNumber = CreditCardNumber;
payment.CreditCardSecurityCode = CreditCardSecurityCode;
payment.ExpirationMonth = ExpirationMonth;
payment.ExpirationYear = ExpirationYear;
}
payment.Status = PaymentStatus.Pending.ToString();
payment.CustomerName = CreditCardName;
payment.TransactionType = TransactionType.Authorization.ToString();
return payment;
}
public override bool ValidateData() => IsValid;
private bool IsValid
{
get
{
foreach (var property in ValidatedProperties)
{
if (GetValidationError(property) != null)
{
return false;
}
}
return true;
}
}
private string GetValidationError(string property)
{
string error = null;
switch (property)
{
case "SelectedCreditCardId":
error = ValidateSelectedCreditCard();
break;
case "CreditCardNumber":
error = ValidateCreditCardNumber();
break;
case "CreditCardSecurityCode":
error = ValidateCreditCardSecurityCode();
break;
case "ExpirationYear":
error = ValidateExpirationYear();
break;
case "ExpirationMonth":
error = ValidateExpirationMonth();
break;
default:
break;
}
return error;
}
private string ValidateExpirationMonth()
{
if (!UseSelectedCreditCard && ExpirationYear == DateTime.Now.Year && ExpirationMonth < DateTime.Now.Month)
{
return LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/ValidationErrors/ExpirationMonth");
}
return null;
}
private string ValidateExpirationYear()
{
if (!UseSelectedCreditCard && ExpirationYear < DateTime.Now.Year)
{
return LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/ValidationErrors/ExpirationYear");
}
return null;
}
private string ValidateCreditCardSecurityCode()
{
if (!UseSelectedCreditCard)
{
if (string.IsNullOrEmpty(CreditCardSecurityCode))
{
return LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/Empty/CreditCardSecurityCode");
}
if (!Regex.IsMatch(CreditCardSecurityCode, "^[0-9]{3}$"))
{
return LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/ValidationErrors/CreditCardSecurityCode");
}
}
return null;
}
private string ValidateCreditCardNumber()
{
if (!UseSelectedCreditCard && string.IsNullOrEmpty(CreditCardNumber))
{
return LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/Empty/CreditCardNumber");
}
return null;
}
private string ValidateSelectedCreditCard()
{
if (UseSelectedCreditCard && !_creditCardService.IsReadyToUse(SelectedCreditCardId))
{
return LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/ValidationErrors/InvalidCreditCard");
}
return null;
}
public void InitializeValues()
{
UseSelectedCreditCard = true;
Months = new List<SelectListItem>();
Years = new List<SelectListItem>();
AvaiableCreditCards = new List<SelectListItem>();
for (var i = 1; i < 13; i++)
{
Months.Add(new SelectListItem
{
Text = i.ToString(CultureInfo.InvariantCulture),
Value = i.ToString(CultureInfo.InvariantCulture)
});
}
for (var i = 0; i < 7; i++)
{
var year = (DateTime.Now.Year + i).ToString(CultureInfo.InvariantCulture);
Years.Add(new SelectListItem
{
Text = year,
Value = year
});
}
var creditCards = _creditCardService.List(false, true);
AvaiableCreditCards.Add(new SelectListItem
{
Text = LocalizationService.GetString("/Checkout/Payment/Methods/CreditCard/Labels/SelectCreditCard"),
Value = ""
});
for (var i = 0; i < creditCards.Count; i++)
{
var cc = creditCards[i];
AvaiableCreditCards.Add(new SelectListItem
{
Text = $"({(cc.CurrentContact != null ? 'P' : 'O')}) ******{cc.CreditCardNumber.Substring(cc.CreditCardNumber.Length - 4)} - {cc.CreditCardType}",
Value = cc.CreditCardId
});
}
}
}
} | 37.104693 | 327 | 0.601576 | [
"Apache-2.0"
] | CalinL/Foundation | src/Foundation/Features/Checkout/Payments/GenericCreditCardPaymentOption.cs | 10,280 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.Devices.WiFi
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
#endif
public enum WiFiConnectionStatus
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
UnspecifiedFailure,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
Success,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
AccessRevoked,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
InvalidCredential,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
NetworkNotAvailable,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
Timeout,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
UnsupportedAuthenticationProtocol,
#endif
}
#endif
}
| 28.657143 | 63 | 0.701894 | [
"Apache-2.0"
] | 06needhamt/uno | src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.WiFi/WiFiConnectionStatus.cs | 1,003 | C# |
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/guide/setguidecardmaterial 接口的请求。</para>
/// </summary>
public class CgibinGuideSetGuideCardMaterialRequest : WechatApiRequest, IMapResponse<CgibinGuideSetGuideCardMaterialRequest, CgibinGuideSetGuideCardMaterialResponse>
{
/// <summary>
/// 获取或设置操作类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置小程序 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置小程序卡片名字。
/// </summary>
[Newtonsoft.Json.JsonProperty("title")]
[System.Text.Json.Serialization.JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
/// <summary>
/// 获取或设置小程序路径。
/// </summary>
[Newtonsoft.Json.JsonProperty("path")]
[System.Text.Json.Serialization.JsonPropertyName("path")]
public string Path { get; set; } = string.Empty;
/// <summary>
/// 获取或设置小程序封面媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("media_id")]
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
public string MediaId { get; set; } = string.Empty;
}
}
| 35.340909 | 169 | 0.607074 | [
"MIT"
] | vst-h/DotNetCore.SKIT.FlurlHttpClient.Wechat | src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinGuide/Material/CgibinGuideSetGuideCardMaterialRequest.cs | 1,693 | C# |
//
// Test the generated API selectors against typos or non-existing cases
//
// Authors:
// Sebastien Pouliot <sebastien@xamarin.com>
//
// Copyright 2012-2013 Xamarin Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.Reflection;
using NUnit.Framework;
using Foundation;
using ObjCRuntime;
#if !NET
using NativeHandle = System.IntPtr;
#endif
namespace Introspection {
public abstract class ApiSelectorTest : ApiBaseTest {
// not everything should be even tried
protected virtual bool Skip (Type type)
{
if (type.ContainsGenericParameters)
return true;
// skip delegate (and other protocol references)
foreach (object ca in type.GetCustomAttributes (false)) {
if (ca is ProtocolAttribute)
return true;
if (ca is ModelAttribute)
return true;
}
switch (type.FullName) {
case "MetalPerformanceShaders.MPSCommandBuffer":
// The reflectable type metadata contains no selectors.
return true;
}
return SkipDueToAttribute (type);
}
protected virtual bool Skip (Type type, string selectorName)
{
// The MapKit types/selectors are optional protocol members pulled in from MKAnnotation/MKOverlay.
// These concrete (wrapper) subclasses do not implement all of those optional members, but we
// still need to provide a binding for them, so that user subclasses can implement those members.
switch (type.Name) {
case "AVAggregateAssetDownloadTask":
switch (selectorName) {
case "URLAsset": // added in Xcode 9 and it is present.
return true;
}
break;
case "AVAssetDownloadStorageManager":
switch (selectorName) {
case "sharedDownloadStorageManager": // added in Xcode 9 and it is present.
return true;
}
break;
case "MKCircle":
case "MKPolygon":
case "MKPolyline":
switch (selectorName) {
case "canReplaceMapContent":
return true;
}
break;
case "MKShape":
switch (selectorName) {
case "setCoordinate:":
return true;
}
break;
case "MKPlacemark":
switch (selectorName) {
case "setCoordinate:":
case "subtitle":
return true;
}
break;
case "MKTileOverlay":
switch (selectorName) {
case "intersectsMapRect:":
return true;
}
break;
// AVAudioChannelLayout and AVAudioFormat started conforming to NSSecureCoding in OSX 10.11 and iOS 9
case "AVAudioChannelLayout":
case "AVAudioFormat":
// NSSecureCoding added in iOS 10 / macOS 10.12
case "CNContactFetchRequest":
case "GKEntity":
case "GKPolygonObstacle":
case "GKComponent":
case "GKGraphNode":
case "WKUserContentController":
case "WKProcessPool":
case "WKWebViewConfiguration":
case "WKWebsiteDataStore":
switch (selectorName) {
case "encodeWithCoder:":
return true;
}
break;
// SKTransition started conforming to NSCopying in OSX 10.11 and iOS 9
case "SKTransition":
// iOS 10 beta 2
case "GKBehavior":
case "MDLTransform":
// UISceneActivationRequestOptions started conforming to NSCopying oin Xcode 13
case "UISceneActivationRequestOptions":
switch (selectorName) {
case "copyWithZone:":
return true;
}
break;
case "MDLMaterialProperty":
switch (selectorName) {
case "copyWithZone:":
// not working before iOS 10, macOS 10.12
return !TestRuntime.CheckXcodeVersion (8, 0);
}
break;
// Xcode 8 beta 2
case "GKGraph":
case "GKAgent":
case "GKAgent2D":
case "NEFlowMetaData":
case "NWEndpoint":
switch (selectorName) {
case "copyWithZone:":
case "encodeWithCoder:":
return true;
}
break;
// now conforms to MDLName
case "MTKMeshBuffer":
switch (selectorName) {
case "name":
case "setName:":
return true;
}
break;
// Xcode 9
case "CIQRCodeFeature":
switch (selectorName) {
case "copyWithZone:":
case "encodeWithCoder:":
return !TestRuntime.CheckXcodeVersion (9, 0);
}
break;
case "CKFetchRecordZoneChangesOptions":
switch (selectorName) {
case "copyWithZone:":
return !TestRuntime.CheckXcodeVersion (9, 0);
}
break;
#if !NET
case "NSUrl":
case "ARQuickLookPreviewItem":
switch (selectorName) {
case "previewItemTitle":
// 'previewItemTitle' is inlined from the QLPreviewItem protocol and should be optional (fixed in .NET)
return true;
}
break;
#endif
case "MKMapItem": // Selector not available on iOS 32-bit
switch (selectorName) {
case "encodeWithCoder:":
return !TestRuntime.CheckXcodeVersion (9, 0);
}
break;
#if !MONOMAC
case "MTLCaptureManager":
case "NEHotspotEapSettings": // Wireless Accessory Configuration is not supported in the simulator.
case "NEHotspotConfigurationManager":
case "NEHotspotHS20Settings":
if (TestRuntime.IsSimulatorOrDesktop)
return true;
break;
case "ARBodyTrackingConfiguration":
case "ARGeoTrackingConfiguration":
switch (selectorName) {
case "supportsAppClipCodeTracking": // Only available on device
return TestRuntime.IsSimulatorOrDesktop;
}
break;
case "CSImportExtension":
switch (selectorName) {
case "beginRequestWithExtensionContext:":
case "updateAttributes:forFileAtURL:error:":
if (TestRuntime.IsSimulatorOrDesktop) // not available in the sim
return true;
break;
}
break;
case "HKQuery":
switch (selectorName) {
case "predicateForVerifiableClinicalRecordsWithRelevantDateWithinDateInterval:": // not available in the sim
if (TestRuntime.IsSimulatorOrDesktop) // not available in the sim
return true;
break;
}
break;
#endif
case "WKPreferences":
switch (selectorName) {
case "encodeWithCoder:": // from iOS 10
return true;
case "textInteractionEnabled": // xcode 13 renamed this to `isTextInteractionEnabled` but does not respond to the old one
return true;
}
break;
}
// This ctors needs to be manually bound
switch (type.Name) {
case "AVCaptureVideoPreviewLayer":
switch (selectorName) {
case "initWithSession:":
case "initWithSessionWithNoConnection:":
return true;
}
break;
case "GKPath":
switch (selectorName) {
case "initWithPoints:count:radius:cyclical:":
case "initWithFloat3Points:count:radius:cyclical:":
return true;
}
break;
case "GKPolygonObstacle":
switch (selectorName) {
case "initWithPoints:count:":
return true;
}
break;
case "MDLMesh":
switch (selectorName) {
case "initCapsuleWithExtent:cylinderSegments:hemisphereSegments:inwardNormals:geometryType:allocator:":
case "initConeWithExtent:segments:inwardNormals:cap:geometryType:allocator:":
case "initHemisphereWithExtent:segments:inwardNormals:cap:geometryType:allocator:":
case "initMeshBySubdividingMesh:submeshIndex:subdivisionLevels:allocator:":
case "initSphereWithExtent:segments:inwardNormals:geometryType:allocator:":
case "initBoxWithExtent:segments:inwardNormals:geometryType:allocator:":
case "initCylinderWithExtent:segments:inwardNormals:topCap:bottomCap:geometryType:allocator:":
case "initIcosahedronWithExtent:inwardNormals:geometryType:allocator:":
case "initPlaneWithExtent:segments:geometryType:allocator:":
return true;
}
break;
case "MDLNoiseTexture":
switch (selectorName) {
case "initCellularNoiseWithFrequency:name:textureDimensions:channelEncoding:":
case "initVectorNoiseWithSmoothness:name:textureDimensions:channelEncoding:":
return true;
}
break;
case "NSOperationQueue":
switch (selectorName) {
case "progress":
// The "progress" property comes from the NSProgressReporting protocol, where it was introduced a long time ago.
// Then NSOperationQueue started implementing the NSProgressReporting, but only in iOS 13, which means that
// this selector does not exist on earlier iOS versions, even to the managed property (from the protocol) claims so.
if (!TestRuntime.CheckXcodeVersion (11, 0))
return true;
break;
}
break;
case "NSImage":
switch (selectorName) {
case "initByReferencingFile:":
return true;
}
break;
case "OSLogMessageComponent":
switch (selectorName) {
case "encodeWithCoder:":
if (!TestRuntime.CheckXcodeVersion (13, 0))
return true;
break;
}
break;
// Conform to SKWarpable
case "SKEffectNode":
case "SKSpriteNode":
switch (selectorName) {
case "setSubdivisionLevels:":
case "setWarpGeometry:":
return true;
}
break;
case "SKAttribute":
case "SKAttributeValue":
switch (selectorName) {
case "encodeWithCoder:":
if (!TestRuntime.CheckXcodeVersion (8, 0))
return true;
break;
}
break;
case "SKUniform":
switch (selectorName) {
// New selectors
case "initWithName:vectorFloat2:":
case "initWithName:vectorFloat3:":
case "initWithName:vectorFloat4:":
case "initWithName:matrixFloat2x2:":
case "initWithName:matrixFloat3x3:":
case "initWithName:matrixFloat4x4:":
// Old selectors
case "initWithName:floatVector2:":
case "initWithName:floatVector3:":
case "initWithName:floatVector4:":
case "initWithName:floatMatrix2:":
case "initWithName:floatMatrix3:":
case "initWithName:floatMatrix4:":
return true;
}
break;
case "SKVideoNode":
switch (selectorName) {
case "initWithFileNamed:":
case "initWithURL:":
case "initWithVideoFileNamed:":
case "initWithVideoURL:":
case "videoNodeWithFileNamed:":
case "videoNodeWithURL:":
return true;
}
break;
case "SKWarpGeometryGrid":
switch (selectorName) {
case "initWithColumns:rows:sourcePositions:destPositions:":
return true;
}
break;
case "INPriceRange":
switch (selectorName) {
case "initWithMaximumPrice:currencyCode:":
case "initWithMinimumPrice:currencyCode:":
return true;
}
break;
case "CKUserIdentityLookupInfo":
switch (selectorName) {
case "initWithEmailAddress:":
case "initWithPhoneNumber:":
case "lookupInfosWithRecordIDs:": // FAILs on watch yet we do have a unittest for it
case "lookupInfosWithEmails:": // FAILs on watch yet we do have a unittest for it
case "lookupInfosWithPhoneNumbers:": // FAILs on watch yet we do have a unittest for it
return true;
}
break;
case "AVPlayerItemVideoOutput":
switch (selectorName) {
case "initWithOutputSettings:":
case "initWithPixelBufferAttributes:":
return true;
}
break;
case "MTLBufferLayoutDescriptor": // We do have unit tests under monotouch-tests for this properties
switch (selectorName){
case "stepFunction":
case "setStepFunction:":
case "stepRate":
case "setStepRate:":
case "stride":
case "setStride:":
return true;
}
break;
case "MTLFunctionConstant": // we do have unit tests under monotouch-tests for this properties
switch (selectorName){
case "name":
case "type":
case "index":
case "required":
return true;
}
break;
case "MTLStageInputOutputDescriptor": // we do have unit tests under monotouch-tests for this properties
switch (selectorName){
case "attributes":
case "indexBufferIndex":
case "setIndexBufferIndex:":
case "indexType":
case "setIndexType:":
case "layouts":
return true;
}
break;
case "MTLAttributeDescriptor": // we do have unit tests under monotouch-tests for this properties
switch (selectorName){
case "bufferIndex":
case "setBufferIndex:":
case "format":
case "setFormat:":
case "offset":
case "setOffset:":
return true;
}
break;
case "MTLAttribute": // we do have unit tests under monotouch-tests for this properties
switch (selectorName){
case "isActive":
case "attributeIndex":
case "attributeType":
case "isPatchControlPointData":
case "isPatchData":
case "name":
case "isDepthTexture":
return true;
}
break;
case "MTLArgument": // we do have unit tests under monotouch-tests for this properties
switch (selectorName){
case "isDepthTexture":
return true;
}
break;
case "MTLArgumentDescriptor":
switch (selectorName) {
case "access":
case "setAccess:":
case "arrayLength":
case "setArrayLength:":
case "constantBlockAlignment":
case "setConstantBlockAlignment:":
case "dataType":
case "setDataType:":
case "index":
case "setIndex:":
case "textureType":
case "setTextureType:":
return true;
}
break;
case "MTLHeapDescriptor":
switch (selectorName) {
case "cpuCacheMode":
case "setCpuCacheMode:":
case "size":
case "setSize:":
case "storageMode":
case "setStorageMode:":
return true;
}
break;
case "MTLIndirectCommandBufferDescriptor": // we do have unit tests under monotouch-tests for this properties
switch (selectorName) {
case "commandTypes":
case "setCommandTypes:":
case "inheritPipelineState":
case "setInheritPipelineState:":
case "inheritBuffers":
case "setInheritBuffers:":
case "maxFragmentBufferBindCount":
case "setMaxFragmentBufferBindCount:":
case "maxVertexBufferBindCount":
case "setMaxVertexBufferBindCount:":
return true;
}
break;
case "MTLPipelineBufferDescriptor":
switch (selectorName) {
case "mutability":
case "setMutability:":
return true;
}
break;
case "MTLPointerType":
switch (selectorName) {
case "access":
case "alignment":
case "dataSize":
case "elementIsArgumentBuffer":
case "elementType":
return true;
}
break;
case "MTLSharedEventListener":
switch (selectorName) {
case "dispatchQueue":
return true;
}
break;
case "MTLTextureReferenceType":
switch (selectorName) {
case "access":
case "isDepthTexture":
case "textureDataType":
case "textureType":
return true;
}
break;
case "MTLType":
switch (selectorName) {
case "dataType":
return true;
}
break;
case "MTLTileRenderPipelineColorAttachmentDescriptor":
switch (selectorName) {
case "pixelFormat":
case "setPixelFormat:":
return true;
}
break;
case "MTLTileRenderPipelineDescriptor":
switch (selectorName) {
case "colorAttachments":
case "label":
case "setLabel:":
case "rasterSampleCount":
case "setRasterSampleCount:":
case "threadgroupSizeMatchesTileSize":
case "setThreadgroupSizeMatchesTileSize:":
case "tileBuffers":
case "tileFunction":
case "setTileFunction:":
case "maxTotalThreadsPerThreadgroup":
case "setMaxTotalThreadsPerThreadgroup:":
case "binaryArchives":
case "setBinaryArchives:":
return true;
}
break;
case "MTLBlitPassDescriptor":
switch (selectorName) {
case "sampleBufferAttachments":
return true;
}
break;
case "MTLBlitPassSampleBufferAttachmentDescriptor":
switch (selectorName) {
case "endOfEncoderSampleIndex":
case "setEndOfEncoderSampleIndex:":
case "sampleBuffer":
case "setSampleBuffer:":
case "startOfEncoderSampleIndex":
case "setStartOfEncoderSampleIndex:":
return true;
}
break;
case "MTLComputePassDescriptor":
switch (selectorName) {
case "dispatchType":
case "setDispatchType:":
case "sampleBufferAttachments":
return true;
}
break;
case "MTLComputePassSampleBufferAttachmentDescriptor":
switch (selectorName) {
case "sampleBuffer":
case "setSampleBuffer:":
case "startOfEncoderSampleIndex":
case "setStartOfEncoderSampleIndex:":
case "endOfEncoderSampleIndex":
case "setEndOfEncoderSampleIndex:":
return true;
}
break;
case "MTLCounterSampleBufferDescriptor":
switch (selectorName) {
case "counterSet":
case "setCounterSet:":
case "label":
case "setLabel:":
case "sampleCount":
case "setSampleCount:":
case "storageMode":
case "setStorageMode:":
return true;
}
break;
case "MTLLinkedFunctions":
switch (selectorName) {
case "binaryFunctions":
case "setBinaryFunctions:":
case "functions":
case "setFunctions:":
case "groups":
case "setGroups:":
return true;
}
break;
case "MTLRenderPassSampleBufferAttachmentDescriptor":
switch (selectorName) {
case "endOfFragmentSampleIndex":
case "setEndOfFragmentSampleIndex:":
case "endOfVertexSampleIndex":
case "setEndOfVertexSampleIndex:":
case "sampleBuffer":
case "setSampleBuffer:":
case "startOfFragmentSampleIndex":
case "setStartOfFragmentSampleIndex:":
case "startOfVertexSampleIndex":
case "setStartOfVertexSampleIndex:":
return true;
}
break;
case "MTLIntersectionFunctionTableDescriptor":
switch (selectorName) {
case "functionCount":
case "setFunctionCount:":
return true;
}
break;
case "MTLResourceStatePassDescriptor":
switch (selectorName) {
case "sampleBufferAttachments":
return true;
}
break;
case "MTLResourceStatePassSampleBufferAttachmentDescriptor":
switch (selectorName) {
case "endOfEncoderSampleIndex":
case "setEndOfEncoderSampleIndex:":
case "sampleBuffer":
case "setSampleBuffer:":
case "startOfEncoderSampleIndex":
case "setStartOfEncoderSampleIndex:":
return true;
}
break;
case "MTLVisibleFunctionTableDescriptor":
switch (selectorName) {
case "functionCount":
case "setFunctionCount:":
return true;
}
break;
case "AVPlayerLooper": // This API got introduced in Xcode 8.0 binding but is not currently present nor in Xcode 8.3 or Xcode 9.0 needs research
switch (selectorName) {
case "isLoopingEnabled":
return true;
}
break;
case "NSQueryGenerationToken": // A test was added in monotouch tests to ensure the selector works
switch (selectorName) {
case "encodeWithCoder:":
return true;
}
break;
case "INSpeakableString":
switch (selectorName) {
case "initWithVocabularyIdentifier:spokenPhrase:pronunciationHint:":
case "initWithIdentifier:spokenPhrase:pronunciationHint:":
return true;
}
break;
case "HMCharacteristicEvent":
switch (selectorName) {
case "copyWithZone:":
case "mutableCopyWithZone:":
// Added in Xcode9 (i.e. only 64 bits) so skip 32 bits
return !TestRuntime.CheckXcodeVersion (9,0);
}
break;
case "MPSCnnConvolution":
switch (selectorName) {
case "initWithDevice:convolutionDescriptor:kernelWeights:biasTerms:flags:":
return true;
}
break;
case "MPSCnnFullyConnected":
switch (selectorName) {
case "initWithDevice:convolutionDescriptor:kernelWeights:biasTerms:flags:":
return true;
}
break;
case "MPSImageConversion":
switch (selectorName) {
case "initWithDevice:srcAlpha:destAlpha:backgroundColor:conversionInfo:":
return true;
}
break;
case "MPSImageDilate":
switch (selectorName) {
case "initWithDevice:kernelWidth:kernelHeight:values:":
return true;
}
break;
case "MPSImageGaussianPyramid":
switch (selectorName) {
case "initWithDevice:kernelWidth:kernelHeight:weights:":
return true;
}
break;
case "MPSImagePyramid":
switch (selectorName) {
case "initWithDevice:kernelWidth:kernelHeight:weights:":
return true;
}
break;
case "MPSImageSobel":
switch (selectorName) {
case "initWithDevice:linearGrayColorTransform:":
return true;
}
break;
case "MPSImageThresholdBinary":
switch (selectorName) {
case "initWithDevice:thresholdValue:maximumValue:linearGrayColorTransform:":
return true;
}
break;
case "MPSImageThresholdBinaryInverse":
switch (selectorName) {
case "initWithDevice:thresholdValue:maximumValue:linearGrayColorTransform:":
return true;
}
break;
case "MPSImageThresholdToZero":
switch (selectorName) {
case "initWithDevice:thresholdValue:linearGrayColorTransform:":
return true;
}
break;
case "MPSImageThresholdToZeroInverse":
switch (selectorName) {
case "initWithDevice:thresholdValue:linearGrayColorTransform:":
return true;
}
break;
case "MPSImageThresholdTruncate":
switch (selectorName) {
case "initWithDevice:thresholdValue:linearGrayColorTransform:":
return true;
}
break;
case "MPSCnnBinaryKernel":
switch (selectorName) {
// Xcode 9.4 removed both selectors from MPSCnnBinaryKernel, reported radar https://trello.com/c/7EAM0qk1
// but apple says this was intentional.
case "kernelHeight":
case "kernelWidth":
return true;
}
break;
case "MPSImageLaplacianPyramid":
case "MPSImageLaplacianPyramidSubtract":
case "MPSImageLaplacianPyramidAdd":
switch (selectorName) {
case "initWithDevice:kernelWidth:kernelHeight:weights:":
return true;
}
break;
case "CPMessageListItem":
switch (selectorName) {
case "initWithConversationIdentifier:text:leadingConfiguration:trailingConfiguration:detailText:trailingText:":
case "initWithFullName:phoneOrEmailAddress:leadingConfiguration:trailingConfiguration:detailText:trailingText:":
return true;
}
break;
case "VNFaceLandmarkRegion":
case "VNFaceLandmarks":
case "PHLivePhoto":
switch (selectorName) {
case "copyWithZone:":
case "encodeWithCoder:":
case "requestRevision":
// Conformance added in Xcode 11
if (!TestRuntime.CheckXcodeVersion (11, 0))
return true;
break;
}
break;
case "MPSNNNeuronDescriptor":
case "MLDictionaryConstraint":
case "MLFeatureDescription":
case "MLImageConstraint":
case "MLImageSize":
case "MLImageSizeConstraint":
case "MLModelConfiguration":
case "MLModelDescription":
case "MLMultiArrayConstraint":
case "MLMultiArrayShapeConstraint":
case "MLSequenceConstraint":
switch (selectorName) {
case "encodeWithCoder:":
// Conformance added in Xcode 11
if (!TestRuntime.CheckXcodeVersion (11, 0))
return true;
break;
}
break;
#if __MACOS__ || __MACCATALYST__ || __WATCHOS__
case "MLDictionaryFeatureProvider":
case "MLMultiArray":
case "MLFeatureValue":
case "MLSequence":
switch (selectorName) {
case "encodeWithCoder:":
if (!TestRuntime.CheckXcodeVersion (12, TestRuntime.MinorXcode12APIMismatch))
return true;
break;
}
break;
#endif
case "BGTaskScheduler":
switch (selectorName) {
case "sharedScheduler":
return true;
}
break;
#if !__MACOS__
case "ARSkeletonDefinition":
switch (selectorName) {
case "indexForJointName:":
case "defaultBody2DSkeletonDefinition":
case "defaultBody3DSkeletonDefinition":
// This selector does not exist in the simulator
if (TestRuntime.IsSimulatorOrDesktop)
return true;
break;
}
break;
#endif
case "INParameter":
switch (selectorName) {
case "copyWithZone:":
if (!TestRuntime.CheckXcodeVersion (10, 0))
return true;
break;
}
break;
case "MTLCommandBufferDescriptor":
switch (selectorName) {
case "errorOptions":
case "setErrorOptions:":
case "retainedReferences":
case "setRetainedReferences:":
// iOS 15 sim (and macOS 12) fails, API added in 14.0
if (TestRuntime.CheckXcodeVersion (13, 0))
return true;
break;
}
break;
case "NSTask":
// category, NSTask won't respond -> @interface NSTask (NSTaskConveniences)
if (selectorName == "waitUntilExit")
return true;
break;
case "NSTextStorage":
switch (selectorName) {
// declared in a superclass, and implemented in a concrete subclass, so it doesn't show up during inspection of NSTextStorage itself.
case "initWithString:":
return true;
}
break;
case "MPSImageDescriptor":
switch (selectorName) {
case "copyWithZone:":
if (!TestRuntime.CheckXcodeVersion (10, 0))
return true;
break;
}
break;
}
// old binding mistake
return (selectorName == "initWithCoder:");
}
protected virtual bool CheckResponse (bool value, Type actualType, MethodBase method, ref string name)
{
if (value)
return true;
var mname = method.Name;
// properties getter and setter will be methods in the _Extensions type
if (method.IsSpecialName)
mname = mname.Replace ("get_", "Get").Replace ("set_", "Set");
// it's possible that the selector was inlined for an OPTIONAL protocol member
// we do not want those reported (too many false positives) and we have other tests to find such mistakes
foreach (var intf in actualType.GetInterfaces ()) {
if (intf.GetCustomAttributes<ProtocolAttribute> () == null)
continue;
var ext = Type.GetType (intf.Namespace + "." + intf.Name.Remove (0, 1) + "_Extensions, " + intf.Assembly.FullName);
if (ext == null)
continue;
foreach (var m in ext.GetMethods ()) {
if (mname != m.Name)
continue;
var parameters = method.GetParameters ();
var ext_params = m.GetParameters ();
// first parameters is `this XXX This`
if (parameters.Length == ext_params.Length - 1) {
bool match = true;
for (int i = 1; i < ext_params.Length; i++) {
match |= (parameters [i - 1].ParameterType == ext_params [i].ParameterType);
}
if (match)
return true;
}
}
}
name = actualType.FullName + " : " + name;
return false;
}
static IntPtr responds_handle = Selector.GetHandle ("instancesRespondToSelector:");
[Test]
public void Protocols ()
{
Errors = 0;
int n = 0;
foreach (Type t in Assembly.GetTypes ()) {
if (t.IsNested || !NSObjectType.IsAssignableFrom (t))
continue;
foreach (object ca in t.GetCustomAttributes (false)) {
if (ca is ProtocolAttribute) {
foreach (var c in t.GetConstructors (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)) {
ProcessProtocolMember (t, c, ref n);
}
foreach (var m in t.GetMethods (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)) {
ProcessProtocolMember (t, m, ref n);
}
}
}
}
Assert.AreEqual (0, Errors, "{0} errors found in {1} protocol selectors validated", Errors, n);
}
void ProcessProtocolMember (Type t, MethodBase m, ref int n)
{
if (SkipDueToAttribute (m))
return;
foreach (object ca in m.GetCustomAttributes (true)) {
ExportAttribute export = (ca as ExportAttribute);
if (export == null)
continue;
string name = export.Selector;
if (Skip (t, name))
continue;
CheckInit (t, m, name);
n++;
}
}
protected virtual IntPtr GetClassForType (Type type)
{
var fi = type.GetField ("class_ptr", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
if (fi == null)
return IntPtr.Zero; // e.g. *Delegate
#if NET
return (NativeHandle) fi.GetValue (null);
#else
return (IntPtr) fi.GetValue (null);
#endif
}
[Test]
public void InstanceMethods ()
{
Errors = 0;
ErrorData.Clear ();
int n = 0;
foreach (Type t in Assembly.GetTypes ()) {
if (t.IsNested || !NSObjectType.IsAssignableFrom (t))
continue;
if (Skip (t) || SkipDueToAttribute (t))
continue;
IntPtr class_ptr = GetClassForType (t);
if (class_ptr == IntPtr.Zero)
continue;
foreach (var c in t.GetConstructors (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)) {
Process (class_ptr, t, c, ref n);
}
foreach (var m in t.GetMethods (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)) {
Process (class_ptr, t, m, ref n);
}
}
Assert.AreEqual (0, Errors, "{0} errors found in {1} instance selector validated{2}", Errors, n, Errors == 0 ? string.Empty : ":\n" + ErrorData.ToString () + "\n");
}
void Process (IntPtr class_ptr, Type t, MethodBase m, ref int n)
{
if (m.DeclaringType != t || SkipDueToAttribute (m))
return;
foreach (object ca in m.GetCustomAttributes (true)) {
ExportAttribute export = (ca as ExportAttribute);
if (export == null)
continue;
string name = export.Selector;
if (Skip (t, name))
continue;
CheckInit (t, m, name);
bool result = bool_objc_msgSend_IntPtr (class_ptr, responds_handle, Selector.GetHandle (name));
bool response = CheckResponse (result, t, m, ref name);
if (!response)
ReportError ("Selector not found for {0} in {1} on {2}", name, m, t.FullName);
n++;
}
}
void CheckInit (Type t, MethodBase m, string name)
{
if (SkipInit (name, m))
return;
bool init = IsInitLike (name);
if (m is ConstructorInfo) {
if (!init)
ReportError ("Selector {0} used on a constructor (not a method) on {1}", name, t.FullName);
} else {
if (init)
ReportError ("Selector {0} used on a method (not a constructor) on {1}", name, t.FullName);
}
}
bool IsInitLike (string selector)
{
if (!selector.StartsWith ("init", StringComparison.OrdinalIgnoreCase))
return false;
return selector.Length < 5 || Char.IsUpper (selector [4]);
}
protected virtual bool SkipInit (string selector, MethodBase m)
{
switch (selector) {
// NSAttributedString
case "initWithHTML:documentAttributes:":
case "initWithRTF:documentAttributes:":
case "initWithRTFD:documentAttributes:":
case "initWithURL:options:documentAttributes:error:":
case "initWithFileURL:options:documentAttributes:error:":
// AVAudioRecorder
case "initWithURL:settings:error:":
case "initWithURL:format:error:":
// NSUrlProtectionSpace
case "initWithHost:port:protocol:realm:authenticationMethod:":
case "initWithProxyHost:port:type:realm:authenticationMethod:":
// NSUserDefaults
case "initWithSuiteName:":
case "initWithUser:":
// GKScore
case "initWithCategory:":
case "initWithLeaderboardIdentifier:":
// MCSession
case "initWithPeer:securityIdentity:encryptionPreference:":
// INSetProfileInCarIntent and INSaveProfileInCarIntent
case "initWithProfileNumber:profileName:defaultProfile:":
case "initWithProfileNumber:profileLabel:defaultProfile:":
case "initWithProfileNumber:profileName:":
case "initWithProfileNumber:profileLabel:":
// MPSCnnBinaryConvolutionNode and MPSCnnBinaryFullyConnectedNode
case "initWithSource:weights:outputBiasTerms:outputScaleTerms:inputBiasTerms:inputScaleTerms:type:flags:":
// UISegmentedControl
case "initWithItems:":
// CLBeaconRegion
case "initWithUUID:identifier:":
case "initWithUUID:major:identifier:":
case "initWithUUID:major:minor:identifier:":
// Intents
case "initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:suggestionType:":
case "initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isContactSuggestion:suggestionType:":
// NEHotspotConfiguration
case "initWithSSID:":
case "initWithSSID:passphrase:isWEP:":
case "initWithSSIDPrefix:":
case "initWithSSIDPrefix:passphrase:isWEP:":
// MapKit
case "initWithMaxCenterCoordinateDistance:":
case "initWithMinCenterCoordinateDistance:":
case "initExcludingCategories:":
case "initIncludingCategories:":
// Vision
case "initWithCenter:diameter:":
case "initWithCenter:radius:":
case "initWithR:theta:":
// NSImage
case "initWithDataIgnoringOrientation:":
var mi = m as MethodInfo;
return mi != null && !mi.IsPublic && mi.ReturnType.Name == "IntPtr";
// NSAppleEventDescriptor
case "initListDescriptor":
case "initRecordDescriptor":
return true;
default:
return false;
}
}
protected virtual void Dispose (NSObject obj, Type type)
{
obj.Dispose ();
}
// funny, this is how I envisioned the instance version... before hitting run :|
protected virtual bool CheckStaticResponse (bool value, Type actualType, Type declaredType, ref string name)
{
if (value)
return true;
name = actualType.FullName + " : " + name;
return false;
}
[Test]
public void StaticMethods ()
{
Errors = 0;
ErrorData.Clear ();
int n = 0;
IntPtr responds_handle = Selector.GetHandle ("respondsToSelector:");
foreach (Type t in Assembly.GetTypes ()) {
if (t.IsNested || !NSObjectType.IsAssignableFrom (t))
continue;
if (Skip (t) || SkipDueToAttribute (t))
continue;
FieldInfo fi = t.GetField ("class_ptr", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
if (fi == null)
continue; // e.g. *Delegate
IntPtr class_ptr = (IntPtr) (NativeHandle) fi.GetValue (null);
foreach (var m in t.GetMethods (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)) {
if (SkipDueToAttribute (m))
continue;
foreach (object ca in m.GetCustomAttributes (true)) {
if (ca is ExportAttribute) {
string name = (ca as ExportAttribute).Selector;
if (Skip (t, name))
continue;
bool result = bool_objc_msgSend_IntPtr (class_ptr, responds_handle, Selector.GetHandle (name));
bool response = CheckStaticResponse (result, t, m.DeclaringType, ref name);
if (!response)
ReportError (name);
n++;
}
}
}
}
Assert.AreEqual (0, Errors, "{0} errors found in {1} static selector validated{2}", Errors, n, Errors == 0 ? string.Empty : ":\n" + ErrorData.ToString () + "\n");
}
}
}
| 29.083474 | 167 | 0.67721 | [
"BSD-3-Clause"
] | NormanChiflen/xamarin-all-IOS | tests/introspection/ApiSelectorTest.cs | 34,493 | C# |
using Microsoft.Extensions.DependencyInjection;
namespace Zhongli.Services.Image;
public static class ImageSetup
{
public static IServiceCollection AddImages(this IServiceCollection services) =>
services.AddScoped<IImageService, ImageService>();
} | 29.111111 | 83 | 0.801527 | [
"MIT"
] | WFP-Doobelepers/Zhongli | Zhongli.Services/Image/ImageSetup.cs | 264 | C# |
using System;
using System.Collections.Generic;
namespace ParkIt.Models
{
public class PagedResponse <T> : Response<T>
{
public int PageNumber {get; set;}
public int PageSize {get; set;}
public Uri FirstPage {get; set;}
public Uri LastPage {get; set;}
public int TotalPages {get; set;}
public int TotalRecords {get; set;}
public Uri NextPage {get; set;}
public Uri PreviousPage {get; set;}
public PagedResponse (T data, int pageNumber, int pageSize)
{
this.PageNumber = pageNumber;
this.PageSize = pageSize;
this.Data = data;
this.Message = null;
this.Succeeded = true;
this.Errors = null;
}
}
} | 25.296296 | 63 | 0.647145 | [
"MIT"
] | MaxBrockbank/ParkItAPI | ParkIt/Models/PagedResponse.cs | 683 | C# |
namespace Machete.X12Schema.V5010.Maps
{
using X12;
using X12.Configuration;
public class LoopL5_110Map :
X12LayoutMap<LoopL5_110, X12Entity>
{
public LoopL5_110Map()
{
Id = "Loop_L5_110";
Name = "Loop L5";
Segment(x => x.DescriptionMarksAndNumbers, 0);
Segment(x => x.LineItemQuantityAndWeight, 1);
Segment(x => x.Measurement, 2);
Segment(x => x.WeightInformation, 3);
Segment(x => x.TariffDetails, 4);
Layout(x => x.LoopL1, 5);
}
}
} | 26 | 58 | 0.5301 | [
"Apache-2.0"
] | ahives/Machete | src/Machete.X12Schema/V5010/Layouts/Maps/LoopL5_110Map.cs | 598 | C# |
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using NBXplorer.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Extensions.Logging;
using System.Net;
using System.Threading.Tasks;
using NBitcoin;
using System.Text;
using CommandLine;
namespace NBXplorer.Configuration
{
public class DefaultConfiguration : StandardConfiguration.DefaultConfiguration
{
protected override CommandLineApplication CreateCommandLineApplicationCore()
{
var provider = new NBXplorerNetworkProvider(NetworkType.Mainnet);
var chains = string.Join(",", provider.GetAll().Select(n => n.CryptoCode.ToLowerInvariant()).ToArray());
CommandLineApplication app = new CommandLineApplication(true)
{
FullName = "NBXplorer\r\nLightweight block explorer for tracking HD wallets",
Name = "NBXplorer"
};
app.HelpOption("-? | -h | --help");
app.Option("-n | --network", $"Set the network among (mainnet,testnet,regtest) (default: mainnet)", CommandOptionType.SingleValue);
app.Option("--testnet | -testnet", $"Use testnet", CommandOptionType.BoolValue);
app.Option("--regtest | -regtest", $"Use regtest", CommandOptionType.BoolValue);
app.Option("--chains", $"Chains to support comma separated (default: btc, available: {chains})", CommandOptionType.SingleValue);
foreach(var network in provider.GetAll())
{
var crypto = network.CryptoCode.ToLowerInvariant();
app.Option($"--{crypto}rescan", $"Rescan from startheight", CommandOptionType.BoolValue);
app.Option($"--{crypto}rpcuser", $"RPC authentication method 1: The RPC user (default: using cookie auth from default network folder)", CommandOptionType.SingleValue);
app.Option($"--{crypto}rpcpassword", $"RPC authentication method 1: The RPC password (default: using cookie auth from default network folder)", CommandOptionType.SingleValue);
app.Option($"--{crypto}rpccookiefile", $"RPC authentication method 2: The RPC cookiefile (default: using cookie auth from default network folder)", CommandOptionType.SingleValue);
app.Option($"--{crypto}rpcauth", $"RPC authentication method 3: user:password or cookiefile=path (default: using cookie auth from default network folder)", CommandOptionType.SingleValue);
app.Option($"--{crypto}rpcurl", $"The RPC server url (default: default rpc server depended on the network)", CommandOptionType.SingleValue);
app.Option($"--{crypto}startheight", $"The height where starting the scan (default: where your rpc server was synched when you first started this program)", CommandOptionType.SingleValue);
app.Option($"--{crypto}nodeendpoint", $"The p2p connection to a Bitcoin node, make sure you are whitelisted (default: default p2p node on localhost, depends on network)", CommandOptionType.SingleValue);
app.Option($"--{crypto}hastxindex", "If true, NBXplorer will try to fetch missing transactions from the local node (default: false)", CommandOptionType.BoolValue);
}
app.Option("--asbcnstr", "[For Azure Service Bus] Azure Service Bus Connection string. New Block and New Transaction messages will be pushed to queues when this values is set", CommandOptionType.SingleValue);
app.Option("--asbblockq", "[For Azure Service Bus] Name of Queue to push new block message to. Leave blank to turn off", CommandOptionType.SingleValue);
app.Option("--asbtranq", "[For Azure Service Bus] Name of Queue to push new transaction message to. Leave blank to turn off", CommandOptionType.SingleValue);
app.Option("--asbblockt", "[For Azure Service Bus] Name of Topic to push new block message to. Leave blank to turn off", CommandOptionType.SingleValue);
app.Option("--asbtrant", "[For Azure Service Bus] Name of Topic to push new transaction message to. Leave blank to turn off", CommandOptionType.SingleValue);
app.Option("--customkeypathtemplate", $"Define an additional derivation path tracked by NBXplorer (Format: m/1/392/*/29, default: empty)", CommandOptionType.SingleValue);
app.Option("--maxgapsize", $"The maximum gap address count on which the explorer will track derivation schemes (default: 30)", CommandOptionType.SingleValue);
app.Option("--mingapsize", $"The minimum gap address count on which the explorer will track derivation schemes (default: 20)", CommandOptionType.SingleValue);
app.Option("--signalfilesdir", $"The directory where files signaling if a chain is ready is created (default: the network specific datadir)", CommandOptionType.SingleValue);
app.Option("--noauth", $"Disable cookie authentication", CommandOptionType.BoolValue);
app.Option("--autopruning", $"EXPERIMENTAL: If getting UTXOs takes more than x seconds, NBXplorer will prune old transactions, disabled if set to -1 (default: -1)", CommandOptionType.SingleValue);
app.Option("--cachechain", $"Whether the chain of header is locally cached for faster startup (default: true)", CommandOptionType.SingleValue);
app.Option("--rpcnotest", $"Faster start because RPC connection testing skipped (default: false)", CommandOptionType.SingleValue);
app.Option("-v | --verbose", $"Verbose logs (default: true)", CommandOptionType.SingleValue);
return app;
}
public override string EnvironmentVariablePrefix => "NBXPLORER_";
protected override string GetDefaultDataDir(IConfiguration conf)
{
return GetDefaultSettings(conf).DefaultDataDirectory;
}
protected override string GetDefaultConfigurationFile(IConfiguration conf)
{
var network = GetDefaultSettings(conf);
var dataDir = conf["datadir"];
if(dataDir == null)
return network.DefaultConfigurationFile;
var fileName = Path.GetFileName(network.DefaultConfigurationFile);
var chainDir = Path.GetFileName(Path.GetDirectoryName(network.DefaultConfigurationFile));
chainDir = Path.Combine(dataDir, chainDir);
try
{
if(!Directory.Exists(chainDir))
Directory.CreateDirectory(chainDir);
}
catch { }
return Path.Combine(chainDir, fileName);
}
public static NetworkType GetNetworkType(IConfiguration conf)
{
var network = conf.GetOrDefault<string>("network", null);
if(network != null)
{
var n = Network.GetNetwork(network);
if(n == null)
{
throw new ConfigException($"Invalid network parameter '{network}'");
}
return n.NetworkType;
}
var net = conf.GetOrDefault<bool>("regtest", false) ? NetworkType.Regtest :
conf.GetOrDefault<bool>("testnet", false) ? NetworkType.Testnet : NetworkType.Mainnet;
return net;
}
protected override string GetDefaultConfigurationFileTemplate(IConfiguration conf)
{
var settings = GetDefaultSettings(conf);
var networkType = GetNetworkType(conf);
StringBuilder builder = new StringBuilder();
builder.AppendLine("####Common Commands####");
builder.AppendLine("####If Bitcoin Core is running with default settings, you should not need to modify this file####");
builder.AppendLine("####All those options can be passed by through command like arguments (ie `-port=19382`)####");
foreach(var network in new NBXplorerNetworkProvider(networkType).GetAll())
{
var cryptoCode = network.CryptoCode.ToLowerInvariant();
builder.AppendLine("## This is the RPC Connection to your node");
builder.AppendLine($"#{cryptoCode}.rpc.url=http://127.0.0.1:" + network.NBitcoinNetwork.RPCPort + "/");
builder.AppendLine("#By user name and password");
builder.AppendLine($"#{cryptoCode}.rpc.user=bitcoinuser");
builder.AppendLine($"#{cryptoCode}.rpc.password=bitcoinpassword");
builder.AppendLine("#By cookie file");
builder.AppendLine($"#{cryptoCode}.rpc.cookiefile=yourbitcoinfolder/.cookie");
builder.AppendLine("#By raw authentication string");
builder.AppendLine($"#{cryptoCode}.rpc.auth=walletuser:password");
builder.AppendLine();
builder.AppendLine("## This is the connection to your node through P2P");
builder.AppendLine($"#{cryptoCode}.node.endpoint=127.0.0.1:" + network);
builder.AppendLine();
builder.AppendLine("## startheight defines from which block you will start scanning, if -1 is set, it will use current blockchain height");
builder.AppendLine($"#{cryptoCode}.startheight=-1");
builder.AppendLine("## rescan forces a rescan from startheight");
builder.AppendLine($"#{cryptoCode}.rescan=0");
}
builder.AppendLine("## Disable cookie, local ip authorization (unsecured)");
builder.AppendLine("#noauth=0");
builder.AppendLine("## What crypto currencies is supported");
var chains = string.Join(',', new NBXplorerNetworkProvider(NetworkType.Mainnet)
.GetAll()
.Select(c => c.CryptoCode.ToLowerInvariant())
.ToArray());
builder.AppendLine($"#chains={chains}");
builder.AppendLine("## Activate or disable verbose logs");
builder.AppendLine("#verbose=0");
builder.AppendLine();
builder.AppendLine();
builder.AppendLine("####Server Commands####");
builder.AppendLine("#port=" + settings.DefaultPort);
builder.AppendLine("#bind=127.0.0.1");
builder.AppendLine($"#{networkType.ToString().ToLowerInvariant()}=1");
builder.AppendLine();
builder.AppendLine();
builder.AppendLine("####Azure Service Bus####");
builder.AppendLine("## Azure Service Bus configuration - set connection string to use Service Bus. Set Queue and / or Topic names to publish message to queues / topics");
builder.AppendLine("#asbcnstr=Endpoint=sb://<yourdomain>.servicebus.windows.net/;SharedAccessKeyName=<your key name here>;SharedAccessKey=<your key here>");
builder.AppendLine("#asbblockq=<new block queue name>");
builder.AppendLine("#asbtranq=<new transaction queue name>");
builder.AppendLine("#asbblockt=<new block topic name>");
builder.AppendLine("#asbtrant=<new transaction topic name>");
return builder.ToString();
}
private NBXplorerDefaultSettings GetDefaultSettings(IConfiguration conf)
{
return NBXplorerDefaultSettings.GetDefaultSettings(GetNetworkType(conf));
}
protected override IPEndPoint GetDefaultEndpoint(IConfiguration conf)
{
return new IPEndPoint(IPAddress.Parse("127.0.0.1"), GetDefaultSettings(conf).DefaultPort);
}
}
}
| 56.237569 | 211 | 0.73966 | [
"MIT"
] | codingteks/NBXplorer | NBXplorer/Configuration/DefaultConfiguration.cs | 10,181 | C# |
//-----------------------------------------------------------------------
// <copyright company="CoApp Project">
// Changes Copyright (c) 2011 Garrett Serack . All rights reserved.
// TaskScheduler Original Code from http://taskscheduler.codeplex.com/
// </copyright>
// <license>
// The software is licensed under the Apache 2.0 License (the "License")
// You may not use the software except in compliance with the License.
// </license>
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Original Code:
// * Copyright (c) 2003-2011 David Hall
// 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.
namespace ClrPlus.Platform.Scheduling.V2 {
using System;
using System.Collections;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using V1;
using TaskTriggerType = Scheduling.TaskTriggerType;
internal enum TaskEnumFlags {
Hidden = 1
}
[ComImport, Guid("BAE54997-48B1-4CBE-9965-D6BE263EBEA4"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IAction {
[DispId(1)]
string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
TaskActionType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
}
[ComImport, Guid("02820E19-7B98-4ED2-B2E8-FDCCCEFF619B"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IActionCollection : IEnumerable {
[DispId(1)]
int Count {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
IAction this[int index] {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(-4)]
new IEnumerator GetEnumerator();
[DispId(2)]
string XmlText {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)]
IAction Create([In] TaskActionType Type);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
void Remove([In, MarshalAs(UnmanagedType.Struct)] object index);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)]
void Clear();
[DispId(6)]
string Context {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
}
[ComImport, Guid("2A9C35DA-D357-41F4-BBC1-207AC1B1F3CB"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IBootTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(20)]
string Delay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
[ComImport, Guid("6D2FD252-75C5-4F66-90BA-2A7D8CC3039F"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IComHandlerAction : IAction {
[DispId(1)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
new TaskActionType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
[DispId(10)]
string ClassId {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] set;}
[DispId(11)]
string Data {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("126C5CD8-B288-41D5-8DBF-E491446ADC5C"), SuppressUnmanagedCodeSecurity]
internal interface IDailyTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(0x19)]
short DaysInterval {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] set;}
[DispId(20)]
string RandomDelay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
[ComImport, Guid("10F62C64-7E16-4314-A0C2-0C3683F99D40"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IEmailAction : IAction {
[DispId(1)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
new TaskActionType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
[DispId(10)]
string Server {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] set;}
[DispId(11)]
string Subject {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
[DispId(12)]
string To {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] set;}
[DispId(13)]
string Cc {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] set;}
[DispId(14)]
string Bcc {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] set;}
[DispId(15)]
string ReplyTo {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(15)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(15)] set;}
[DispId(0x10)]
string From {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x10)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x10)] set;}
[DispId(0x11)]
ITaskNamedValueCollection HeaderFields {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x11)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x11)] set;}
[DispId(0x12)]
string Body {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x12)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x12)] set;}
[DispId(0x13)]
object[] Attachments {[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x13)] get; [param: In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x13)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("D45B0167-9653-4EEF-B94F-0732CA7AF251"), SuppressUnmanagedCodeSecurity]
internal interface IEventTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(20)]
string Subscription {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
[DispId(0x15)]
string Delay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] set;}
[DispId(0x16)]
ITaskNamedValueCollection ValueQueries {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x16)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x16)] set;}
}
[ComImport, Guid("4C3D624D-FD6B-49A3-B9B7-09CB3CD3F047"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IExecAction : IAction {
[DispId(1)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
new TaskActionType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
[DispId(10)]
string Path {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] set;}
[DispId(11)]
string Arguments {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
[DispId(12)]
string WorkingDirectory {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("84594461-0053-4342-A8FD-088FABF11F32"), SuppressUnmanagedCodeSecurity]
internal interface IIdleSettings {
[DispId(1)]
string IdleDuration {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
string WaitTimeout {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
bool StopOnIdleEnd {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
bool RestartOnIdle {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
}
[ComImport, Guid("D537D2B0-9FB3-4D34-9739-1FF5CE7B1EF3"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IIdleTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
}
[ComImport, Guid("72DADE38-FAE4-4B3E-BAF4-5D009AF02B1C"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface ILogonTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(20)]
string Delay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
[DispId(0x15)]
string UserId {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("77D025A3-90FA-43AA-B52E-CDA5499B946A"), SuppressUnmanagedCodeSecurity]
internal interface IMonthlyDOWTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(0x19)]
short DaysOfWeek {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] set;}
[DispId(0x1a)]
short WeeksOfMonth {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1a)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1a)] set;}
[DispId(0x1b)]
short MonthsOfYear {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1b)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1b)] set;}
[DispId(0x1c)]
bool RunOnLastWeekOfMonth {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1c)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1c)] set;}
[DispId(20)]
string RandomDelay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
[ComImport, Guid("97C45EF1-6B02-4A1A-9C0E-1EBFBA1500AC"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IMonthlyTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(0x19)]
int DaysOfMonth {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] set;}
[DispId(0x1a)]
short MonthsOfYear {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1a)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1a)] set;}
[DispId(0x1b)]
bool RunOnLastDayOfMonth {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1b)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1b)] set;}
[DispId(20)]
string RandomDelay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("9F7DEA84-C30B-4245-80B6-00E9F646F1B4"), SuppressUnmanagedCodeSecurity]
internal interface INetworkSettings {
[DispId(1)]
string Name {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("D98D51E5-C9B4-496A-A9C1-18980261CF0F"), SuppressUnmanagedCodeSecurity]
internal interface IPrincipal {
[DispId(1)]
string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
string DisplayName {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
string UserId {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
TaskLogonType LogonType {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
string GroupId {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
TaskRunLevel RunLevel {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("248919AE-E345-4A6D-8AEB-E0D3165C904E"), SuppressUnmanagedCodeSecurity]
internal interface IPrincipal2 {
[DispId(7)]
TaskProcessTokenSidType ProcessTokenSidType {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(8)]
long RequiredPrivilegeCount {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)] get;}
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)]
string GetRequiredPrivilege(long index);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)]
void AddRequiredPrivilege([In, MarshalAs(UnmanagedType.BStr)] string privilege);
}
[ComImport, TypeLibType((short)0x10c0), Guid("9C86F320-DEE3-4DD1-B972-A303F26B061E"), ComConversionLoss, DefaultMember("Path"),
SuppressUnmanagedCodeSecurity]
internal interface IRegisteredTask {
[DispId(1)]
string Name {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
string Path {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[DispId(2)]
TaskState State {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
[DispId(3)]
bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)]
IRunningTask Run([In, MarshalAs(UnmanagedType.Struct)] object parameters);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)]
IRunningTask RunEx([In, MarshalAs(UnmanagedType.Struct)] object parameters, [In] int flags, [In] int sessionID,
[In, MarshalAs(UnmanagedType.BStr)] string user);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)]
IRunningTaskCollection GetInstances(int flags);
[DispId(8)]
DateTime LastRunTime {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)] get;}
[DispId(9)]
int LastTaskResult {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)] get;}
[DispId(11)]
int NumberOfMissedRuns {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get;}
[DispId(12)]
DateTime NextRunTime {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] get;}
[DispId(13)]
ITaskDefinition Definition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] get;}
[DispId(14)]
string Xml {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] get;}
[return: MarshalAs(UnmanagedType.BStr)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(15)]
string GetSecurityDescriptor(int securityInformation);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x10)]
void SetSecurityDescriptor([In, MarshalAs(UnmanagedType.BStr)] string sddl, [In] int flags);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x11)]
void Stop(int flags);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), TypeLibFunc((short)0x41), DispId(0x60020011)]
void GetRunTimes([In] ref SystemTime pstStart, [In] ref SystemTime pstEnd, [In, Out] ref uint pCount, [In, Out] ref IntPtr pRunTimes);
}
[ComImport, Guid("86627EB4-42A7-41E4-A4D9-AC33A72F2D52"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IRegisteredTaskCollection : IEnumerable {
[DispId(0x60020000)]
int Count {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020000)] get;}
[DispId(0)]
IRegisteredTask this[object index] {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(-4)]
new IEnumerator GetEnumerator();
}
[ComImport, TypeLibType((short)0x10c0), Guid("416D8B73-CB41-4EA1-805C-9BE9A5AC4A74"), SuppressUnmanagedCodeSecurity]
internal interface IRegistrationInfo {
[DispId(1)]
string Description {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
string Author {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(4)]
string Version {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
string Date {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
string Documentation {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(9)]
string XmlText {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)] set;}
[DispId(10)]
string URI {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] set;}
[DispId(11)]
object SecurityDescriptor {[return: MarshalAs(UnmanagedType.Struct)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.Struct)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
[DispId(12)]
string Source {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] set;}
}
[ComImport, Guid("4C8FEC3A-C218-4E0C-B23D-629024DB91A2"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IRegistrationTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(20)]
string Delay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
[ComImport, Guid("7FB9ACF1-26BE-400E-85B5-294B9C75DFD6"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IRepetitionPattern {
[DispId(1)]
string Interval {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
string Duration {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
bool StopAtDurationEnd {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
}
[ComImport, TypeLibType((short)0x10c0), DefaultMember("InstanceGuid"), Guid("653758FB-7B9A-4F1E-A471-BEEB8E9B834E"),
SuppressUnmanagedCodeSecurity]
internal interface IRunningTask {
[DispId(1)]
string Name {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
string InstanceGuid {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[DispId(2)]
string Path {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
[DispId(3)]
TaskState State {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get;}
[DispId(4)]
string CurrentAction {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get;}
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)]
void Stop();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)]
void Refresh();
[DispId(7)]
uint EnginePID {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get;}
}
[ComImport, Guid("6A67614B-6828-4FEC-AA54-6D52E8F1F2DB"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IRunningTaskCollection : IEnumerable {
[DispId(1)]
int Count {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
IRunningTask this[object index] {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(-4)]
new IEnumerator GetEnumerator();
}
[ComImport, TypeLibType((short)0x10c0), Guid("754DA71B-4385-4475-9DD9-598294FA3641"), SuppressUnmanagedCodeSecurity]
internal interface ISessionStateChangeTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(20)]
string Delay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
[DispId(0x15)]
string UserId {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] set;}
[DispId(0x16)]
TaskSessionStateChangeType StateChange {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x16)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x16)] set;}
}
[ComImport, Guid("505E9E68-AF89-46B8-A30F-56162A83D537"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface IShowMessageAction : IAction {
[DispId(1)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
new TaskActionType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get;}
[DispId(10)]
string Title {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] set;}
[DispId(11)]
string MessageBody {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
}
[ComImport, Guid("F5BC8FC5-536D-4F77-B852-FBC1356FDEB6"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface ITaskDefinition {
[DispId(1)]
IRegistrationInfo RegistrationInfo {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
[DispId(2)]
ITriggerCollection Triggers {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(7)]
ITaskSettings Settings {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(11)]
string Data {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
[DispId(12)]
IPrincipal Principal {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] set;}
[DispId(13)]
IActionCollection Actions {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] set;}
[DispId(14)]
string XmlText {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] set;}
}
[ComImport, Guid("8CFAC062-A080-4C15-9A88-AA7C2AF80DFC"), DefaultMember("Path"), TypeLibType((short)0x10c0),
SuppressUnmanagedCodeSecurity]
internal interface ITaskFolder {
[DispId(1)]
string Name {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
string Path {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)]
ITaskFolder GetFolder([MarshalAs(UnmanagedType.BStr)] string Path);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
ITaskFolderCollection GetFolders(int flags);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)]
ITaskFolder CreateFolder([In, MarshalAs(UnmanagedType.BStr)] string subFolderName,
[In, Optional, MarshalAs(UnmanagedType.Struct)] object sddl);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)]
void DeleteFolder([MarshalAs(UnmanagedType.BStr)] string subFolderName, [In] int flags);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)]
IRegisteredTask GetTask([MarshalAs(UnmanagedType.BStr)] string Path);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)]
IRegisteredTaskCollection GetTasks(int flags);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)]
void DeleteTask([In, MarshalAs(UnmanagedType.BStr)] string Name, [In] int flags);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)]
IRegisteredTask RegisterTask([In, MarshalAs(UnmanagedType.BStr)] string Path, [In, MarshalAs(UnmanagedType.BStr)] string XmlText,
[In] int flags, [In, MarshalAs(UnmanagedType.Struct)] object UserId, [In, MarshalAs(UnmanagedType.Struct)] object password,
[In] TaskLogonType LogonType, [In, Optional, MarshalAs(UnmanagedType.Struct)] object sddl);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)]
IRegisteredTask RegisterTaskDefinition([In, MarshalAs(UnmanagedType.BStr)] string Path,
[In, MarshalAs(UnmanagedType.Interface)] ITaskDefinition pDefinition, [In] int flags,
[In, MarshalAs(UnmanagedType.Struct)] object UserId, [In, MarshalAs(UnmanagedType.Struct)] object password,
[In] TaskLogonType LogonType, [In, Optional, MarshalAs(UnmanagedType.Struct)] object sddl);
[return: MarshalAs(UnmanagedType.BStr)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)]
string GetSecurityDescriptor(int securityInformation);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)]
void SetSecurityDescriptor([In, MarshalAs(UnmanagedType.BStr)] string sddl, [In] int flags);
}
[ComImport, TypeLibType((short)0x10c0), Guid("79184A66-8664-423F-97F1-637356A5D812"), SuppressUnmanagedCodeSecurity]
internal interface ITaskFolderCollection : IEnumerable {
[DispId(0x60020000)]
int Count {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020000)] get;}
[DispId(0)]
ITaskFolder this[object index] {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(-4)]
new IEnumerator GetEnumerator();
}
[ComImport, TypeLibType((short)0x10c0), Guid("B4EF826B-63C3-46E4-A504-EF69E4F7EA4D"), SuppressUnmanagedCodeSecurity]
internal interface ITaskNamedValueCollection : IEnumerable {
[DispId(1)]
int Count {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
ITaskNamedValuePair this[int index] {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(-4)]
new IEnumerator GetEnumerator();
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)]
ITaskNamedValuePair Create([In, MarshalAs(UnmanagedType.BStr)] string Name, [In, MarshalAs(UnmanagedType.BStr)] string Value);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
void Remove([In] int index);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)]
void Clear();
}
[ComImport, TypeLibType((short)0x10c0), Guid("39038068-2B46-4AFD-8662-7BB6F868D221"), DefaultMember("Name"),
SuppressUnmanagedCodeSecurity]
internal interface ITaskNamedValuePair {
[DispId(0)]
string Name {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] set;}
[DispId(1)]
string Value {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] set;}
}
[ComImport, TypeLibType((short)0x10c0), DefaultMember("TargetServer"), Guid("2FABA4C7-4DA9-4013-9697-20CC3FD40F85"),
SuppressUnmanagedCodeSecurity]
internal interface ITaskService {
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)]
ITaskFolder GetFolder([In, MarshalAs(UnmanagedType.BStr)] string Path);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)]
IRunningTaskCollection GetRunningTasks(int flags);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)]
ITaskDefinition NewTask([In] uint flags);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
void Connect([In, Optional, MarshalAs(UnmanagedType.Struct)] object serverName,
[In, Optional, MarshalAs(UnmanagedType.Struct)] object user, [In, Optional, MarshalAs(UnmanagedType.Struct)] object domain,
[In, Optional, MarshalAs(UnmanagedType.Struct)] object password);
[DispId(5)]
bool Connected {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get;}
[DispId(0)]
string TargetServer {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[DispId(6)]
string ConnectedUser {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get;}
[DispId(7)]
string ConnectedDomain {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get;}
[DispId(8)]
uint HighestVersion {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)] get;}
}
[ComImport, CoClass(typeof (TaskSchedulerClass)), Guid("2FABA4C7-4DA9-4013-9697-20CC3FD40F85"), SuppressUnmanagedCodeSecurity]
internal interface TaskScheduler : ITaskService {
}
[ComImport, DefaultMember("TargetServer"), Guid("0F87369F-A4E5-4CFC-BD3E-73E6154572DD"), TypeLibType((short)2),
ClassInterface((short)0), SuppressUnmanagedCodeSecurity]
internal class TaskSchedulerClass : TaskScheduler {
// Methods
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
public virtual extern void Connect([In, Optional, MarshalAs(UnmanagedType.Struct)] object serverName,
[In, Optional, MarshalAs(UnmanagedType.Struct)] object user, [In, Optional, MarshalAs(UnmanagedType.Struct)] object domain,
[In, Optional, MarshalAs(UnmanagedType.Struct)] object password);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)]
public virtual extern ITaskFolder GetFolder([In, MarshalAs(UnmanagedType.BStr)] string Path);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)]
public virtual extern IRunningTaskCollection GetRunningTasks(int flags);
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)]
public virtual extern ITaskDefinition NewTask([In] uint flags);
// Properties
[DispId(5)]
public virtual extern bool Connected {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get;}
[DispId(7)]
public virtual extern string ConnectedDomain {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get;}
[DispId(6)]
public virtual extern string ConnectedUser {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get;}
[DispId(8)]
public virtual extern uint HighestVersion {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)] get;}
[DispId(0)]
public virtual extern string TargetServer {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("8FD4711D-2D02-4C8C-87E3-EFF699DE127E"), SuppressUnmanagedCodeSecurity]
internal interface ITaskSettings {
[DispId(3)]
bool AllowDemandStart {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
string RestartInterval {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
int RestartCount {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
TaskInstancesPolicy MultipleInstances {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
bool StopIfGoingOnBatteries {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(8)]
bool DisallowStartIfOnBatteries {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(8)] set;}
[DispId(9)]
bool AllowHardTerminate {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(9)] set;}
[DispId(10)]
bool StartWhenAvailable {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(10)] set;}
[DispId(11)]
string XmlText {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(11)] set;}
[DispId(12)]
bool RunOnlyIfNetworkAvailable {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(12)] set;}
[DispId(13)]
string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(13)] set;}
[DispId(14)]
bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(14)] set;}
[DispId(15)]
string DeleteExpiredTaskAfter {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(15)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(15)] set;}
[DispId(0x10)]
int Priority {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x10)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x10)] set;}
[DispId(0x11)]
TaskCompatibility Compatibility {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x11)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x11)] set;}
[DispId(0x12)]
bool Hidden {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x12)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x12)] set;}
[DispId(0x13)]
IIdleSettings IdleSettings {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x13)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x13)] set;}
[DispId(20)]
bool RunOnlyIfIdle {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
[DispId(0x15)]
bool WakeToRun {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x15)] set;}
[DispId(0x16)]
INetworkSettings NetworkSettings {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x16)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x16)] set;}
}
[ComImport, TypeLibType((short)0x10c0), Guid("2C05C3F0-6EED-4c05-A15F-ED7D7A98A369"), SuppressUnmanagedCodeSecurity]
internal interface ITaskSettings2 {
[DispId(30)]
bool DisallowStartOnRemoteAppSession {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(30)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(30)] set;}
[DispId(0x1f)]
bool UseUnifiedSchedulingEngine {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1f)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1f)] set;}
}
[ComImport, Guid("3E4C9351-D966-4B8B-BB87-CEBA68BB0107"), InterfaceType((short)1), SuppressUnmanagedCodeSecurity]
internal interface ITaskVariables {
[return: MarshalAs(UnmanagedType.BStr)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
string GetInput();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void SetOutput([In, MarshalAs(UnmanagedType.BStr)] string input);
[return: MarshalAs(UnmanagedType.BStr)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
string GetContext();
}
[ComImport, TypeLibType((short)0x10c0), Guid("B45747E0-EBA7-4276-9F29-85C5BB300006"), SuppressUnmanagedCodeSecurity]
internal interface ITimeTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(20)]
string RandomDelay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
[ComImport, Guid("09941815-EA89-4B5B-89E0-2A773801FAC3"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface ITrigger {
[DispId(1)]
TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
}
[ComImport, Guid("85DF5081-1B24-4F32-878A-D9D14DF4CB77"), TypeLibType((short)0x10c0), SuppressUnmanagedCodeSecurity]
internal interface ITriggerCollection : IEnumerable {
[DispId(1)]
int Count {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(0)]
ITrigger this[int index] {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0)] get;}
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(-4)]
new IEnumerator GetEnumerator();
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)]
ITrigger Create([In] TaskTriggerType Type);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
void Remove([In, MarshalAs(UnmanagedType.Struct)] object index);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)]
void Clear();
}
[ComImport, TypeLibType((short)0x10c0), Guid("5038FC98-82FF-436D-8728-A512A57C9DC1"), SuppressUnmanagedCodeSecurity]
internal interface IWeeklyTrigger : ITrigger {
[DispId(1)]
new TaskTriggerType Type {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)] get;}
[DispId(2)]
new string Id {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)] set;}
[DispId(3)]
new IRepetitionPattern Repetition {[return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; [param: In, MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)] set;}
[DispId(4)]
new string ExecutionTimeLimit {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)] set;}
[DispId(5)]
new string StartBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(5)] set;}
[DispId(6)]
new string EndBoundary {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(6)] set;}
[DispId(7)]
new bool Enabled {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)] set;}
[DispId(0x19)]
short DaysOfWeek {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x19)] set;}
[DispId(0x1a)]
short WeeksInterval {[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1a)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x1a)] set;}
[DispId(20)]
string RandomDelay {[return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(20)] set;}
}
} | 83.594925 | 412 | 0.74211 | [
"Apache-2.0"
] | Jaykul/clrplus | Platform/Scheduling/V2/TaskSchedulerV2Interop.cs | 88,947 | C# |
using Newtonsoft.Json;
using System;
using TheSaga.Exceptions;
namespace TheSaga.Utils
{
internal static class SagaExceptionExtensions
{
internal static Exception ToSagaStepException(this Exception exception)
{
if (exception == null)
return null;
if (isSerializable(exception))
return exception;
return new SagaStepException(
exception);
}
static bool isSerializable(Exception ex)
{
/*Type exceptionType = ex.GetType();
if (exceptionType.IsSerializable)
return true;*/
try
{
var json = JsonConvert.SerializeObject(ex,
new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All });
var obj = JsonConvert.DeserializeObject(json,
new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All });
return true;
}
catch
{
return false;
}
}
}
} | 26.093023 | 92 | 0.535651 | [
"MIT"
] | b-y-t-e/TheSaga | TheSaga/TheSaga/Utils/SagaExceptionExtensions.cs | 1,124 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
namespace ILRuntime.Runtime.Generated
{
unsafe class System_Runtime_CompilerServices_TaskAwaiter_1_Dictionary_2_Int32_Google_Protobuf_Adapt_IMessage_Binding_Adaptor_Binding
{
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
{
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
MethodBase method;
Type[] args;
Type type = typeof(System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>);
args = new Type[]{};
method = type.GetMethod("get_IsCompleted", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, get_IsCompleted_0);
args = new Type[]{};
method = type.GetMethod("GetResult", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, GetResult_1);
app.RegisterCLRCreateDefaultInstance(type, () => new System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>());
}
static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>> instance_of_this_method)
{
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
switch(ptr_of_this_method->ObjectType)
{
case ObjectTypes.Object:
{
__mStack[ptr_of_this_method->Value] = instance_of_this_method;
}
break;
case ObjectTypes.FieldReference:
{
var ___obj = __mStack[ptr_of_this_method->Value];
if(___obj is ILTypeInstance)
{
((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
}
else
{
var t = __domain.GetType(___obj.GetType()) as CLRType;
t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
}
}
break;
case ObjectTypes.StaticFieldReference:
{
var t = __domain.GetType(ptr_of_this_method->Value);
if(t is ILType)
{
((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
}
else
{
((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
}
}
break;
case ObjectTypes.ArrayReference:
{
var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>[];
instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
}
break;
}
}
static StackObject* get_IsCompleted_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>> instance_of_this_method = (System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>)typeof(System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
var result_of_this_method = instance_of_this_method.IsCompleted;
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
__intp.Free(ptr_of_this_method);
__ret->ObjectType = ObjectTypes.Integer;
__ret->Value = result_of_this_method ? 1 : 0;
return __ret + 1;
}
static StackObject* GetResult_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>> instance_of_this_method = (System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>)typeof(System.Runtime.CompilerServices.TaskAwaiter<System.Collections.Generic.Dictionary<System.Int32, Google.Protobuf.Adapt_IMessage.Adaptor>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
var result_of_this_method = instance_of_this_method.GetResult();
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
__intp.Free(ptr_of_this_method);
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
}
}
| 54.496063 | 534 | 0.663632 | [
"MIT"
] | lantuma/DDZ | Unity/Assets/Model/ILBinding/System_Runtime_CompilerServices_TaskAwaiter_1_Dictionary_2_Int32_Google_Proto_t.cs | 6,921 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SolderingRobotController
{
public class AppConfig
{
public AppSettings SetDefaultConfig()
{
AppSettings settings = new AppSettings();
SolderHeadSettings solderhead1 = new SolderHeadSettings();
SolderHeadSettings solderhead2 = new SolderHeadSettings();
solderhead1.IronTargetTemperature = 380;
solderhead1.IronTargetTemperature = 380;
settings.PinsToSolder = 40;
settings.PCBLocation1 = true;
settings.PCBLocation2 = true;
settings.PCBLocation3 = true;
settings.PCBLocation4 = true;
settings.PCBLocation5 = true;
// setup solder head 1
solderhead1.HeadRunEnable = true;
solderhead1.MMPerJoint = 8;
solderhead1.HeatingTime = 100;
solderhead1.LoadSolderDistance = 300;
solderhead1.RetractDistance = 10;
solderhead1.PCBHeight = 26;
solderhead1.SolderRetractDistance = 8;
solderhead1.HeadCPM = 225.0;
solderhead1.HeadVelocity = 4e8;
solderhead1.HeadAcceleration = 4e5;
solderhead1.HeadJerk = 4e6;
solderhead1.FeedCPM = 193.0;
solderhead1.FeedVelocity = 2e3;
solderhead1.FeedAcceleration = 2e3;
solderhead1.FeedJerk = 4e6;
solderhead1.LoadingFeedVelocity = 4e3;
solderhead1.LoadingFeedAcceleration = 5e3;
solderhead1.LoadingFeedJerk = 4e6;
// setup solder head 2
solderhead2.HeadRunEnable = true;
solderhead2.MMPerJoint = 8;
solderhead2.HeatingTime = 100;
solderhead2.LoadSolderDistance = 300;
solderhead2.RetractDistance = 10;
solderhead2.PCBHeight = 26;
solderhead2.SolderRetractDistance = 8;
solderhead2.HeadCPM = 233.0;
solderhead2.HeadVelocity = 4e8;
solderhead2.HeadAcceleration = 4e5;
solderhead2.HeadJerk = 4e6;
solderhead2.FeedCPM = 193.0;
solderhead2.FeedVelocity = 2e3;
solderhead2.FeedAcceleration = 2e3;
solderhead2.FeedJerk = 4e6;
solderhead2.LoadingFeedVelocity = 4e3;
solderhead2.LoadingFeedAcceleration = 5e3;
solderhead2.LoadingFeedJerk = 4e6;
settings.SolderHead1 = solderhead1;
settings.SolderHead2 = solderhead2;
return settings;
}
}
}
| 31.4 | 70 | 0.603222 | [
"MIT"
] | briandorey/Soldering-Robot-Project | Windows Software/SolderingRobotController/SolderingRobotController/AppConfig.cs | 2,671 | 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.DataFactory.Outputs
{
[OutputType]
public sealed class OraclePartitionSettingsResponse
{
/// <summary>
/// The name of the column in integer type that will be used for proceeding range partitioning. Type: string (or Expression with resultType string).
/// </summary>
public readonly object? PartitionColumnName;
/// <summary>
/// The minimum value of column specified in partitionColumnName that will be used for proceeding range partitioning. Type: string (or Expression with resultType string).
/// </summary>
public readonly object? PartitionLowerBound;
/// <summary>
/// Names of the physical partitions of Oracle table.
/// </summary>
public readonly ImmutableArray<object> PartitionNames;
/// <summary>
/// The maximum value of column specified in partitionColumnName that will be used for proceeding range partitioning. Type: string (or Expression with resultType string).
/// </summary>
public readonly object? PartitionUpperBound;
[OutputConstructor]
private OraclePartitionSettingsResponse(
object? partitionColumnName,
object? partitionLowerBound,
ImmutableArray<object> partitionNames,
object? partitionUpperBound)
{
PartitionColumnName = partitionColumnName;
PartitionLowerBound = partitionLowerBound;
PartitionNames = partitionNames;
PartitionUpperBound = partitionUpperBound;
}
}
}
| 38.06 | 178 | 0.677877 | [
"Apache-2.0"
] | pulumi-bot/pulumi-azure-native | sdk/dotnet/DataFactory/Outputs/OraclePartitionSettingsResponse.cs | 1,903 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.Management.Network.Models
{
/// <summary> Bastion Shareable Link. </summary>
public partial class BastionShareableLink
{
/// <summary> Initializes a new instance of BastionShareableLink. </summary>
/// <param name="vm"> Reference of the virtual machine resource. </param>
public BastionShareableLink(Resource vm)
{
if (vm == null)
{
throw new ArgumentNullException(nameof(vm));
}
Vm = vm;
}
/// <summary> Initializes a new instance of BastionShareableLink. </summary>
/// <param name="vm"> Reference of the virtual machine resource. </param>
/// <param name="bsl"> The unique Bastion Shareable Link to the virtual machine. </param>
/// <param name="createdAt"> The time when the link was created. </param>
/// <param name="message"> Optional field indicating the warning or error message related to the vm in case of partial failure. </param>
internal BastionShareableLink(Resource vm, string bsl, string createdAt, string message)
{
Vm = vm;
Bsl = bsl;
CreatedAt = createdAt;
Message = message;
}
/// <summary> Reference of the virtual machine resource. </summary>
public Resource Vm { get; set; }
/// <summary> The unique Bastion Shareable Link to the virtual machine. </summary>
public string Bsl { get; }
/// <summary> The time when the link was created. </summary>
public string CreatedAt { get; }
/// <summary> Optional field indicating the warning or error message related to the vm in case of partial failure. </summary>
public string Message { get; }
}
}
| 38.64 | 144 | 0.622153 | [
"MIT"
] | AzureDataBox/azure-sdk-for-net | sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/BastionShareableLink.cs | 1,932 | C# |
using YourBrand.Documents.Domain;
using Microsoft.EntityFrameworkCore;
using YourBrand.Documents.Infrastructure.Persistence.Interceptors;
namespace YourBrand.Documents.Infrastructure.Persistence;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddPersistence(this IServiceCollection services, IConfiguration configuration)
{
const string ConnectionStringKey = "mssql";
var connectionString = YourBrand.Documents.ConfigurationExtensions.GetConnectionString(configuration, ConnectionStringKey, "Documents")
?? configuration.GetConnectionString("DefaultConnection");
Console.WriteLine(connectionString);
services.AddDbContext<DocumentsContext>((sp, options) =>
{
options.UseSqlServer(connectionString, o => o.EnableRetryOnFailure());
#if DEBUG
options.EnableSensitiveDataLogging();
#endif
});
services.AddScoped<IDocumentsContext>(sp => sp.GetRequiredService<DocumentsContext>());
services.AddScoped<AuditableEntitySaveChangesInterceptor>();
return services;
}
} | 35.030303 | 145 | 0.728374 | [
"MIT"
] | marinasundstrom/YourCompany | Documents/Documents/Infrastructure/Persistence/ServiceCollectionExtensions.cs | 1,156 | 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.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Threading;
using Microsoft.Templates.Core;
using Microsoft.Templates.Core.Gen;
using Microsoft.Templates.Core.Locations;
using Microsoft.Templates.Fakes;
namespace Microsoft.Templates.Test
{
public sealed class BuildRightClickWithLegacyFixture : BaseGenAndBuildFixture, IDisposable
{
private string testExecutionTimeStamp = DateTime.Now.FormatAsDateHoursMinutes();
public override string GetTestRunPath() => $"{Path.GetPathRoot(Environment.CurrentDirectory)}\\UIT\\LEG\\{testExecutionTimeStamp}\\";
public TemplatesSource Source => new LegacyTemplatesSourceV2(ProgrammingLanguages.CSharp);
public TemplatesSource VBSource => new LegacyTemplatesSourceV2(ProgrammingLanguages.VisualBasic);
public TemplatesSource LocalSource => new LocalTemplatesSource(null, "BldRClickLegacy");
private static bool syncExecuted;
public static IEnumerable<object[]> GetProjectTemplates()
{
List<object[]> result = new List<object[]>();
foreach (var language in ProgrammingLanguages.GetAllLanguages())
{
Configuration.Current.CdnUrl = "https://wtsrepository.blob.core.windows.net/pro/";
InitializeTemplates(new LegacyTemplatesSourceV2(ProgrammingLanguages.CSharp), language);
// TODO: Re-enable for all platforms when there are more than just UWP which have legacy templates
////foreach (var language in Platforms.GetAllPlatforms())
var projectTypes = GenContext.ToolBox.Repo.GetProjectTypes()
.Where(m => !string.IsNullOrEmpty(m.Description))
.Select(m => m.Name);
foreach (var projectType in projectTypes)
{
// TODO: Re-enable for all platforms
// var projectFrameworks = GenComposer.GetSupportedFx(projectType, string.Empty);
var targetFrameworks = GenContext.ToolBox.Repo.GetFrameworks()
.Select(m => m.Name).ToList();
foreach (var framework in targetFrameworks)
{
result.Add(new object[] { projectType, framework, Platforms.Uwp, language });
}
}
}
return result;
}
[SuppressMessage(
"Usage",
"VSTHRD002:Synchronously waiting on tasks or awaiters may cause deadlocks",
Justification = "Required for unit testing.")]
private static void InitializeTemplates(TemplatesSource source, string language)
{
Configuration.Current.CdnUrl = "https://wtsrepository.blob.core.windows.net/pro/";
source.LoadConfigAsync(default(CancellationToken)).Wait();
var version = new Version(source.Config.Latest.Version.Major, source.Config.Latest.Version.Minor);
GenContext.Bootstrap(source, new FakeGenShell(Platforms.Uwp, language), version, Platforms.Uwp, language);
if (!syncExecuted)
{
GenContext.ToolBox.Repo.SynchronizeAsync(true, true).Wait();
syncExecuted = true;
}
}
[SuppressMessage(
"Usage",
"VSTHRD002:Synchronously waiting on tasks or awaiters may cause deadlocks",
Justification = "Required for unit testing.")]
public void ChangeTemplatesSource(TemplatesSource source, string language, string platform)
{
GenContext.Bootstrap(source, new FakeGenShell(platform, language), new Version(GenContext.ToolBox.WizardVersion), platform, language);
GenContext.ToolBox.Repo.SynchronizeAsync(true, true).Wait();
}
[SuppressMessage(
"Usage",
"VSTHRD002:Synchronously waiting on tasks or awaiters may cause deadlocks",
Justification = "Required for unit testing.")]
public void ChangeToLocalTemplatesSource(TemplatesSource source, string language, string platform)
{
GenContext.Bootstrap(source, new FakeGenShell(platform, language), platform, language);
GenContext.ToolBox.Repo.SynchronizeAsync(true, true).Wait();
}
// Renamed second parameter as this fixture needs the language while others don't
public override void InitializeFixture(IContextProvider contextProvider, string language = "")
{
GenContext.Current = contextProvider;
Configuration.Current.Environment = "Pro";
Configuration.Current.CdnUrl = "https://wtsrepository.blob.core.windows.net/pro/";
InitializeTemplates(Source, language);
}
}
}
| 44.104348 | 146 | 0.651222 | [
"MIT"
] | Surfndez/WindowsTemplateStudio | code/test/Templates.Test/BuildRightClickWithLegacy/BuildRightClickWithLegacyFixture.cs | 5,074 | C# |
using NBitcoin;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Bases;
using WalletWasabi.Helpers;
using WalletWasabi.Interfaces;
using WalletWasabi.JsonConverters;
using WalletWasabi.Logging;
namespace WalletWasabi.CoinJoin.Coordinator.Rounds
{
[JsonObject(MemberSerialization.OptIn)]
public class CoordinatorRoundConfig : ConfigBase
{
public CoordinatorRoundConfig() : base()
{
}
public CoordinatorRoundConfig(string filePath) : base(filePath)
{
}
[JsonProperty(PropertyName = "Denomination")]
[JsonConverter(typeof(MoneyBtcJsonConverter))]
public Money Denomination { get; internal set; } = Money.Coins(0.1m);
[DefaultValue(Constants.OneDayConfirmationTarget)]
[JsonProperty(PropertyName = "ConfirmationTarget", DefaultValueHandling = DefaultValueHandling.Populate)]
public int ConfirmationTarget { get; internal set; }
[DefaultValue(0.7)]
[JsonProperty(PropertyName = "ConfirmationTargetReductionRate", DefaultValueHandling = DefaultValueHandling.Populate)]
public double ConfirmationTargetReductionRate { get; internal set; }
[DefaultValue(0.003)] // Coordinator fee percent is per anonymity set.
[JsonProperty(PropertyName = "CoordinatorFeePercent", DefaultValueHandling = DefaultValueHandling.Populate)]
public decimal CoordinatorFeePercent { get; internal set; }
[DefaultValue(100)]
[JsonProperty(PropertyName = "AnonymitySet", DefaultValueHandling = DefaultValueHandling.Populate)]
public int AnonymitySet { get; internal set; }
[DefaultValue(604800)] // One week
[JsonProperty(PropertyName = "InputRegistrationTimeout", DefaultValueHandling = DefaultValueHandling.Populate)]
public long InputRegistrationTimeout { get; internal set; }
[DefaultValue(60)]
[JsonProperty(PropertyName = "ConnectionConfirmationTimeout", DefaultValueHandling = DefaultValueHandling.Populate)]
public long ConnectionConfirmationTimeout { get; internal set; }
[DefaultValue(60)]
[JsonProperty(PropertyName = "OutputRegistrationTimeout", DefaultValueHandling = DefaultValueHandling.Populate)]
public long OutputRegistrationTimeout { get; internal set; }
[DefaultValue(60)]
[JsonProperty(PropertyName = "SigningTimeout", DefaultValueHandling = DefaultValueHandling.Populate)]
public long SigningTimeout { get; internal set; }
[DefaultValue(1)]
[JsonProperty(PropertyName = "DosSeverity", DefaultValueHandling = DefaultValueHandling.Populate)]
public int DosSeverity { get; internal set; }
[DefaultValue(730)] // 1 month
[JsonProperty(PropertyName = "DosDurationHours", DefaultValueHandling = DefaultValueHandling.Populate)]
public long DosDurationHours { get; internal set; }
[DefaultValue(true)]
[JsonProperty(PropertyName = "DosNoteBeforeBan", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool DosNoteBeforeBan { get; internal set; }
[DefaultValue(11)]
[JsonProperty(PropertyName = "MaximumMixingLevelCount", DefaultValueHandling = DefaultValueHandling.Populate)]
public int MaximumMixingLevelCount { get; internal set; }
[JsonProperty(PropertyName = "CoordinatorExtPubKey")]
[JsonConverter(typeof(ExtPubKeyJsonConverter))]
public ExtPubKey CoordinatorExtPubKey { get; private set; } = Constants.FallBackCoordinatorExtPubKey;
[DefaultValue(0)]
[JsonProperty(PropertyName = "CoordinatorExtPubKeyCurrentDepth", DefaultValueHandling = DefaultValueHandling.Populate)]
public int CoordinatorExtPubKeyCurrentDepth { get; private set; }
public Script GetNextCleanCoordinatorScript() => DeriveCoordinatorScript(CoordinatorExtPubKeyCurrentDepth);
public Script DeriveCoordinatorScript(int index) => CoordinatorExtPubKey.Derive(0, false).Derive(index, false).PubKey.WitHash.ScriptPubKey;
public void MakeNextCoordinatorScriptDirty()
{
CoordinatorExtPubKeyCurrentDepth++;
ToFile();
}
public void UpdateOrDefault(CoordinatorRoundConfig config, bool toFile)
{
Denomination = config.Denomination ?? Denomination;
var configSerialized = JsonConvert.SerializeObject(config);
JsonConvert.PopulateObject(configSerialized, this);
if (toFile)
{
ToFile();
}
}
}
}
| 38.279279 | 141 | 0.787244 | [
"MIT"
] | Groestlcoin/WalletWasabi | WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRoundConfig.cs | 4,249 | C# |
// -----------------------------------------------------------------------
// <auto-generated>
// 此代码由代码生成器生成。
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,对此文件的任何修改都会丢失。
// 如果需要扩展此类,可以遵守如下规则进行扩展:
// 1. 横向扩展:如需给当前模块添加方法接口,可新建文件“IInStorManagerContract.cs”的分部接口“public partial interface IInStorManagerContract”添加方法,并添加相应新的分部基类 abstract partial class InStorManagerServiceBase 实现新方法
// </auto-generated>
//
// <copyright file="IInStorManagerContract.generated.cs" company="teng.kun">
// teng.kun
// </copyright>
// <site>http://teng.kun</site>
// <last-editor>teng.kun</last-editor>
// -----------------------------------------------------------------------
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using OSharp.Data;
using OSharp.Extensions;
using teng.kun.InStorManager.Dtos;
using teng.kun.InStorManager.Entities;
namespace teng.kun.InStorManager
{
/// <summary>
/// 业务契约接口:入库管理模块
/// </summary>
public partial interface IInStorManagerContract
{
#region 入库信息业务
/// <summary>
/// 获取 入库信息查询数据集
/// </summary>
IQueryable<InStor> InStors { get; }
/// <summary>
/// 检查入库信息信息是否存在
/// </summary>
/// <param name="predicate">检查谓语表达式</param>
/// <param name="id">更新的入库信息编号</param>
/// <returns>入库信息是否存在</returns>
Task<bool> CheckInStorExists(Expression<Func<InStor, bool>> predicate, int id = default(int));
/// <summary>
/// 添加入库信息信息
/// </summary>
/// <param name="dtos">要添加的入库信息DTO信息</param>
/// <returns>业务操作结果</returns>
Task<OperationResult> CreateInStors(params InStorInputDto[] dtos);
/// <summary>
/// 更新入库信息信息
/// </summary>
/// <param name="dtos">包含更新信息的入库信息DTO信息</param>
/// <returns>业务操作结果</returns>
Task<OperationResult> UpdateInStors(params InStorInputDto[] dtos);
/// <summary>
/// 更新入库审核信息信息
/// </summary>
/// <param name="dtos">包含更新信息的入库信息DTO信息</param>
/// <returns>业务操作结果</returns>
Task<OperationResult> UpdateVerifyInStors(params InStorInputDto[] dtos);
/// <summary>
/// 更新入库反冲信息信息
/// </summary>
/// <param name="dtos">包含更新信息的入库信息DTO信息</param>
/// <returns>业务操作结果</returns>
Task<OperationResult> UpdateRecoilInStors(params InStorInputDto[] dtos);
/// <summary>
/// 删除入库信息信息
/// </summary>
/// <param name="ids">要删除的入库信息编号</param>
/// <returns>业务操作结果</returns>
Task<OperationResult> DeleteInStors(params int[] ids);
#endregion
}
}
| 29.75 | 186 | 0.569236 | [
"Apache-2.0"
] | zhongw2020/teng.kun | src/teng.kun.Core/InStorManager/IInStorManagerContract.generated.cs | 3,403 | C# |
using Engine.Contracts;
using Engine;
namespace Game.Acts
{
public class AttackAct : BaseAct
{
private IActor Target;
public AttackAct (string name, IActor actor)
{
Name = name;
Self = actor;
}
public override ActResult Do (IScene scene)
{
(scene as IStage).Attack (Self as IPlacableActor, Name);
return new ActResult {
TimePassed = 10,
Message = string.Format ("{0} attacked {1}", Self.Name, Target.Name)
};
}
public override bool CanDo (IActor actor, IScene scene)
{
Target = (scene as IStage).ActorInDirection (Self as IPlacableActor, Name);
return Target != null;
}
}
}
| 19.757576 | 78 | 0.648773 | [
"MIT"
] | sheix/GameEngine | Game/Acts/AttackAct.cs | 654 | C# |
using Discord;
using Discord.WebSocket;
namespace BonusBot.AudioModule.Models
{
internal class EmbedInfo
{
public ISocketMessageChannel Channel { get; init; }
public Embed? Embed { get; set; }
public IMessage? Message { get; init; }
public EmbedInfo(ISocketMessageChannel channel, Embed? embed = null, IMessage? message = null)
=> (Channel, Embed, Message) = (channel, embed, message);
}
} | 29.866667 | 102 | 0.65625 | [
"MIT"
] | emre1702/BonusBo | Modules/AudioModule/Models/EmbedInfo.cs | 450 | C# |
using System;
using System.Collections.Generic;
using System.Data.Common;
namespace Sylvan.Data
{
partial class Schema
{
/// <summary>
/// Builder for creating Schema.
/// </summary>
public class Builder
{
List<Column.Builder>? columns;
List<Column.Builder> Columns => columns ?? throw new InvalidOperationException();
/// <summary>
/// Creates a new Builder.
/// </summary>
public Builder()
{
this.columns = new List<Column.Builder>();
}
/// <summary>
/// Creates a new Builder.
/// </summary>
public Builder(IEnumerable<DbColumn> schema)
{
this.columns = new List<Column.Builder>();
foreach(var col in schema)
{
this.columns.Add(new Column.Builder(col));
}
}
public Builder Add(Column.Builder columnBuilder)
{
var builders = this.Columns;
var ordinal = builders.Count;
columnBuilder.BaseColumnOrdinal = columnBuilder.BaseColumnOrdinal ?? columnBuilder.ColumnOrdinal;
columnBuilder.ColumnOrdinal = ordinal;
builders.Add(columnBuilder);
return this;
}
public Builder Add<T>(string? name = null, bool allowNull = false) {
var t = typeof(T);
var underlying = Nullable.GetUnderlyingType(t);
if(underlying != null) {
t = underlying;
allowNull = true;
}
var cb = new Column.Builder(name ?? "", t, allowNull);
return Add(cb);
}
/// <summary>
/// Builds an immutable Schema instance.
/// </summary>
public Schema Build()
{
var builders = this.Columns;
var cols = new Column[builders.Count];
for (int i = 0; i < builders.Count; i++)
{
cols[i] = builders[i].Build();
}
this.columns = null;
return new Schema(cols);
}
}
}
}
| 22.282051 | 101 | 0.625432 | [
"MIT"
] | 0xced/Sylvan | source/Sylvan.Data/Schema.Builder.cs | 1,740 | C# |
using ESI.NET.Models.Mail;
using ESI.NET.Models.SSO;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using static ESI.NET.EsiRequest;
namespace ESI.NET.Logic
{
public class MailLogic
{
private readonly HttpClient _client;
private readonly EsiConfig _config;
private readonly AuthorizedCharacterData _data;
private readonly int character_id;
public MailLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData data = null)
{
_client = client;
_config = config;
_data = data;
if (data != null)
character_id = data.CharacterID;
}
/// <summary>
/// /characters/{character_id}/mail/
/// </summary>
/// <returns></returns>
public async Task<EsiResponse<List<Header>>> Headers(long[] labels = null, int last_mail_id = 0)
{
var parameters = new List<string>();
if (labels != null)
parameters.Add($"labels={string.Join(",", labels)}");
if (last_mail_id > 0)
parameters.Add($"last_mail_id={last_mail_id}");
var response = await Execute<List<Header>>(_client, _config, RequestSecurity.Authenticated, RequestMethod.GET, "/characters/{character_id}/mail/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() }
}, parameters: parameters.ToArray(), token: _data.Token);
return response;
}
/// <summary>
/// /characters/{character_id}/mail/
/// </summary>
/// <param name="recipients"></param>
/// <param name="subject"></param>
/// <param name="body"></param>
/// <param name="approved_cost"></param>
/// <returns></returns>
public async Task<EsiResponse<int>> New(object[] recipients, string subject, string body, int approved_cost = 0)
=> await Execute<int>(_client, _config, RequestSecurity.Authenticated, RequestMethod.POST, "/characters/{character_id}/mail/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() }
}, body: new
{
recipients,
subject,
body,
approved_cost
}, token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/labels/
/// </summary>
/// <returns></returns>
public async Task<EsiResponse<LabelCounts>> Labels()
=> await Execute<LabelCounts>(_client, _config, RequestSecurity.Authenticated, RequestMethod.GET, "/characters/{character_id}/mail/labels/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() }
}, token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/labels/
/// </summary>
/// <param name="name"></param>
/// <param name="color"></param>
/// <returns></returns>
public async Task<EsiResponse<long>> NewLabel(string name, string color)
=> await Execute<long>(_client, _config, RequestSecurity.Authenticated, RequestMethod.POST, "/characters/{character_id}/mail/labels/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() }
}, body: new
{
name,
color
}, token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/labels/{label_id}/
/// </summary>
/// <param name="label_id"></param>
/// <returns></returns>
public async Task<EsiResponse<string>> DeleteLabel(long label_id)
=> await Execute<string>(_client, _config, RequestSecurity.Authenticated, RequestMethod.DELETE, "/characters/{character_id}/mail/labels/{label_id}/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() },
{ "label_id", label_id.ToString() }
}, token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/lists/
/// </summary>
/// <returns></returns>
public async Task<EsiResponse<List<MailingList>>> MailingLists()
=> await Execute<List<MailingList>>(_client, _config, RequestSecurity.Authenticated, RequestMethod.GET, "/characters/{character_id}/mail/lists/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() }
}, token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/{mail_id}/
/// </summary>
/// <param name="mail_id"></param>
/// <returns></returns>
public async Task<EsiResponse<Message>> Retrieve(int mail_id)
=> await Execute<Message>(_client, _config, RequestSecurity.Authenticated, RequestMethod.GET, "/characters/{character_id}/mail/{mail_id}/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() },
{ "mail_id", mail_id.ToString() }
}, token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/{mail_id}/
/// </summary>
/// <param name="mail_id"></param>
/// <param name="is_read"></param>
/// <param name="labels"></param>
/// <returns></returns>
public async Task<EsiResponse<Message>> Update(int mail_id, bool? is_read = null, int[] labels = null)
=> await Execute<Message>(_client, _config, RequestSecurity.Authenticated, RequestMethod.PUT, "/characters/{character_id}/mail/{mail_id}/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() },
{ "mail_id", mail_id.ToString() }
}, body: BuildUpdateObject(is_read, labels), token: _data.Token);
/// <summary>
/// /characters/{character_id}/mail/{mail_id}/
/// </summary>
/// <param name="mail_id"></param>
/// <returns></returns>
public async Task<EsiResponse<Message>> Delete(int mail_id)
=> await Execute<Message>(_client, _config, RequestSecurity.Authenticated, RequestMethod.DELETE, "/characters/{character_id}/mail/{mail_id}/", replacements: new Dictionary<string, string>()
{
{ "character_id", character_id.ToString() },
{ "mail_id", mail_id.ToString() }
}, token: _data.Token);
/// <summary>
///
/// </summary>
/// <param name="is_read"></param>
/// <param name="labels"></param>
/// <returns></returns>
private static dynamic BuildUpdateObject(bool? is_read, int[] labels = null)
{
dynamic body = null;
if (is_read != null && labels == null)
body = new { is_read };
else if (is_read == null && labels != null)
body = new { labels };
else
body = new { is_read, labels };
return body;
}
}
} | 42.362069 | 208 | 0.565459 | [
"MIT"
] | changshuzf/ESI.NET | ESI.NET/Logic/MailLogic.cs | 7,373 | 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.Security.PrivateCA.V1.Snippets
{
// [START privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async_flattened_resourceNames]
using Google.Cloud.Security.PrivateCA.V1;
using System.Threading.Tasks;
public sealed partial class GeneratedCertificateAuthorityServiceClientSnippets
{
/// <summary>Snippet for GetCertificateTemplateAsync</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 GetCertificateTemplateResourceNamesAsync()
{
// Create client
CertificateAuthorityServiceClient certificateAuthorityServiceClient = await CertificateAuthorityServiceClient.CreateAsync();
// Initialize request argument(s)
CertificateTemplateName name = CertificateTemplateName.FromProjectLocationCertificateTemplate("[PROJECT]", "[LOCATION]", "[CERTIFICATE_TEMPLATE]");
// Make the request
CertificateTemplate response = await certificateAuthorityServiceClient.GetCertificateTemplateAsync(name);
}
}
// [END privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async_flattened_resourceNames]
}
| 47.119048 | 159 | 0.746337 | [
"Apache-2.0"
] | AlexandrTrf/google-cloud-dotnet | apis/Google.Cloud.Security.PrivateCA.V1/Google.Cloud.Security.PrivateCA.V1.GeneratedSnippets/CertificateAuthorityServiceClient.GetCertificateTemplateResourceNamesAsyncSnippet.g.cs | 1,979 | C# |
//---------------------------------------------------------
// <auto-generated>
// This code was generated by a tool. Changes to this
// file may cause incorrect behavior and will be lost
// if the code is regenerated.
//
// Generated on 2020 October 09 05:47:03 UTC
// </auto-generated>
//---------------------------------------------------------
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using static go.builtin;
using bytes = go.bytes_package;
using json = go.encoding.json_package;
using errors = go.errors_package;
using fmt = go.fmt_package;
using io = go.io_package;
using ioutil = go.io.ioutil_package;
using os = go.os_package;
using filepath = go.path.filepath_package;
using strings = go.strings_package;
using @base = go.cmd.go.@internal.@base_package;
using cfg = go.cmd.go.@internal.cfg_package;
using lockedfile = go.cmd.go.@internal.lockedfile_package;
using codehost = go.cmd.go.@internal.modfetch.codehost_package;
using par = go.cmd.go.@internal.par_package;
using renameio = go.cmd.go.@internal.renameio_package;
using module = go.golang.org.x.mod.module_package;
using semver = go.golang.org.x.mod.semver_package;
using go;
#nullable enable
namespace go {
namespace cmd {
namespace go {
namespace @internal
{
public static partial class modfetch_package
{
[GeneratedCode("go2cs", "0.1.0.0")]
public partial struct DownloadDirPartialError
{
// Constructors
public DownloadDirPartialError(NilType _)
{
this.Dir = default;
this.Err = default;
}
public DownloadDirPartialError(@string Dir = default, error Err = default)
{
this.Dir = Dir;
this.Err = Err;
}
// Enable comparisons between nil and DownloadDirPartialError struct
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(DownloadDirPartialError value, NilType nil) => value.Equals(default(DownloadDirPartialError));
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(DownloadDirPartialError value, NilType nil) => !(value == nil);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(NilType nil, DownloadDirPartialError value) => value == nil;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(NilType nil, DownloadDirPartialError value) => value != nil;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator DownloadDirPartialError(NilType nil) => default(DownloadDirPartialError);
}
[GeneratedCode("go2cs", "0.1.0.0")]
public static DownloadDirPartialError DownloadDirPartialError_cast(dynamic value)
{
return new DownloadDirPartialError(value.Dir, value.Err);
}
}
}}}} | 37.144578 | 137 | 0.657152 | [
"MIT"
] | GridProtectionAlliance/go2cs | src/go-src-converted/cmd/go/internal/modfetch/cache_DownloadDirPartialErrorStruct.cs | 3,083 | C# |
using MYOB.AccountRight.SDK.Contracts.Version2.Contact;
namespace MYOB.AccountRight.SDK.Contracts.Version2.GeneralLedger
{
/// <summary>
/// The different tax code types
/// </summary>
public enum TaxCodeType
{
/// <summary>
/// Consolidated
/// </summary>
Consolidated,
/// <summary>
/// ImportDuty
/// </summary>
ImportDuty,
/// <summary>
/// SalesTax
/// </summary>
SalesTax,
/// <summary>
/// GST_VAT (Goods and Services Tax)
/// </summary>
GST_VAT,
/// <summary>
/// InputTaxed
/// </summary>
InputTaxed,
/// <summary>
/// QST
/// </summary>
QST,
/// <summary>
/// LuxuryCarTax
/// </summary>
LuxuryCarTax,
/// <summary>
/// WithholdingsTax (negative rate)
/// </summary>
WithholdingsTax,
/// <summary>
/// NoABN_TFN (negative rate)
/// </summary>
NoABN_TFN,
/// <summary>
/// ECPurchVAT
/// </summary>
ECPurchVAT,
/// <summary>
/// ECSalesVAT
/// </summary>
ECSalesVAT,
}
/// <summary>
/// Describes a tax code resource
/// </summary>
public class TaxCode : BaseEntity
{
/// <summary>
/// 3 digit code assigned to the tax code.
/// </summary>
public string Code { get; set; }
/// <summary>
/// Description given to the tax code.
/// </summary>
public string Description { get; set; }
/// <summary>
/// The tax types
/// </summary>
public TaxCodeType Type { get; set; }
/// <summary>
/// Rate of tax assigned
/// </summary>
public double Rate { get; set; }
/// <summary>
/// Indicates if the rate will be treated as a negative number i.e. see <see cref="TaxCodeType.WithholdingsTax"/> and <see cref="TaxCodeType.NoABN_TFN"/>
/// </summary>
public bool IsRateNegative { get; set; }
/// <summary>
/// A link to the <see cref="Account"/> resource to use for tax collected
/// </summary>
public AccountLink TaxCollectedAccount { get; set; }
/// <summary>
/// A link to the <see cref="Account"/> resource to use for tax paid
/// </summary>
public AccountLink TaxPaidAccount { get; set; }
/// <summary>
/// /// <summary>
/// A link to the <see cref="Account"/> resource to use for withholding credit
/// </summary>
/// </summary>
public AccountLink WithholdingCreditAccount { get; set; }
/// <summary>
/// A link to the <see cref="Account"/> resource to use for withholding payable
/// </summary>
public AccountLink WithholdingPayableAccount { get; set; }
/// <summary>
/// A link to the <see cref="Account"/> resource to use for import duty payable
/// </summary>
public AccountLink ImportDutyPayableAccount { get; set; }
/// <summary>
/// A link to a <see cref="Supplier"/> resource
/// </summary>
public SupplierLink LinkedSupplier { get; set; }
/// <summary>
/// Value which must be exceeded before tax is calculated using this tax code.
/// </summary>
public decimal LuxuryCarTaxThreshold { get; set; }
}
} | 27.172932 | 161 | 0.502767 | [
"MIT"
] | AnshumanSaurabhMYOB/AccountRight_Live_API_.Net_SDK | MYOB.API.SDK/SDK/Contracts/Version2/GeneralLedger/TaxCode.cs | 3,616 | C# |
using WalletWasabi.JsonConverters;
using WalletWasabi.Helpers;
using NBitcoin;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace WalletWasabi.KeyManagement
{
[JsonObject(MemberSerialization.OptIn)]
public class KeyManager
{
[JsonProperty(Order = 1)]
[JsonConverter(typeof(BitcoinEncryptedSecretNoECJsonConverter))]
public BitcoinEncryptedSecretNoEC EncryptedSecret { get; }
[JsonProperty(Order = 2)]
[JsonConverter(typeof(ByteArrayJsonConverter))]
public byte[] ChainCode { get; }
[JsonProperty(Order = 3)]
[JsonConverter(typeof(ExtPubKeyJsonConverter))]
public ExtPubKey ExtPubKey { get; }
[JsonProperty(Order = 4)]
private List<HdPubKey> HdPubKeys { get; }
// BIP84-ish derivation scheme
// m / purpose' / coin_type' / account' / change / address_index
// https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki
private static readonly KeyPath AccountKeyPath = new KeyPath("m/84'/0'/0'");
private readonly object HdPubKeysLock;
public string FilePath { get; private set; }
private object ToFileLock { get; }
[JsonConstructor]
public KeyManager(BitcoinEncryptedSecretNoEC encryptedSecret, byte[] chainCode, ExtPubKey extPubKey, string filePath = null)
{
HdPubKeys = new List<HdPubKey>();
HdPubKeysLock = new object();
EncryptedSecret = Guard.NotNull(nameof(encryptedSecret), encryptedSecret);
ChainCode = Guard.NotNull(nameof(chainCode), chainCode);
ExtPubKey = Guard.NotNull(nameof(extPubKey), extPubKey);
SetFilePath(filePath);
ToFileLock = new object();
ToFile();
}
public KeyManager(BitcoinEncryptedSecretNoEC encryptedSecret, byte[] chainCode, string password, string filePath = null)
{
HdPubKeys = new List<HdPubKey>();
HdPubKeysLock = new object();
if (password == null)
{
password = "";
}
EncryptedSecret = Guard.NotNull(nameof(encryptedSecret), encryptedSecret);
ChainCode = Guard.NotNull(nameof(chainCode), chainCode);
var extKey = new ExtKey(encryptedSecret.GetKey(password), chainCode);
ExtPubKey = extKey.Derive(AccountKeyPath).Neuter();
SetFilePath(filePath);
ToFileLock = new object();
ToFile();
}
public static KeyManager CreateNew(out Mnemonic mnemonic, string password, string filePath = null)
{
if (password == null)
{
password = "";
}
mnemonic = new Mnemonic(Wordlist.English, WordCount.Twelve);
ExtKey extKey = mnemonic.DeriveExtKey(password);
var encryptedSecret = extKey.PrivateKey.GetEncryptedBitcoinSecret(password, Network.Main);
return new KeyManager(encryptedSecret, extKey.ChainCode, extKey.Derive(AccountKeyPath).Neuter(), filePath);
}
public static KeyManager Recover(Mnemonic mnemonic, string password, string filePath = null)
{
Guard.NotNull(nameof(mnemonic), mnemonic);
if (password == null)
{
password = "";
}
ExtKey extKey = mnemonic.DeriveExtKey(password);
var encryptedSecret = extKey.PrivateKey.GetEncryptedBitcoinSecret(password, Network.Main);
return new KeyManager(encryptedSecret, extKey.ChainCode, extKey.Derive(AccountKeyPath).Neuter(), filePath);
}
public void SetFilePath(string filePath)
{
FilePath = string.IsNullOrWhiteSpace(filePath) ? null : filePath;
if (FilePath == null) return;
var directoryPath = Path.GetDirectoryName(Path.GetFullPath(filePath));
Directory.CreateDirectory(directoryPath);
}
public void ToFile()
{
if (FilePath == null) return;
lock (ToFileLock)
{
string jsonString = JsonConvert.SerializeObject(this, Formatting.Indented);
File.WriteAllText(FilePath,
jsonString,
Encoding.UTF8);
}
}
public static KeyManager FromFile(string filePath)
{
filePath = Guard.NotNullOrEmptyOrWhitespace(nameof(filePath), filePath);
if (!File.Exists(filePath))
{
throw new FileNotFoundException($"Walle file not found at: `{filePath}`.");
}
string jsonString = File.ReadAllText(filePath, Encoding.UTF8);
var km = JsonConvert.DeserializeObject<KeyManager>(jsonString);
km.SetFilePath(filePath);
return km;
}
public HdPubKey GenerateNewKey(string label, KeyState keyState, bool isInternal, bool toFile = true)
{
// BIP44-ish derivation scheme
// m / purpose' / coin_type' / account' / change / address_index
lock (HdPubKeysLock)
{
var change = isInternal ? 1 : 0;
IEnumerable<HdPubKey> relevantHdPubKeys;
if (isInternal)
{
relevantHdPubKeys = HdPubKeys.Where(x => x.IsInternal());
}
else
{
relevantHdPubKeys = HdPubKeys.Where(x => !x.IsInternal());
}
KeyPath path;
if (!relevantHdPubKeys.Any())
{
path = new KeyPath($"{change}/0");
}
else
{
path = relevantHdPubKeys.OrderBy(x => x.GetIndex()).Last().GetNonHardenedKeyPath().Increment();
}
var fullPath = AccountKeyPath.Derive(path);
var pubKey = ExtPubKey.Derive(path).PubKey;
var hdPubKey = new HdPubKey(pubKey, fullPath, label, keyState);
HdPubKeys.Add(hdPubKey);
if (toFile)
{
ToFile();
}
return hdPubKey;
}
}
public IEnumerable<HdPubKey> GetKeys(KeyState? keyState = null, bool? isInternal = null)
{
// BIP44-ish derivation scheme
// m / purpose' / coin_type' / account' / change / address_index
lock (HdPubKeysLock)
{
if (keyState == null && isInternal == null)
{
return HdPubKeys;
}
if (keyState != null && isInternal == null)
{
return HdPubKeys.Where(x => x.KeyState == keyState);
}
else if (keyState == null)
{
return HdPubKeys.Where(x => x.IsInternal() == isInternal);
}
return HdPubKeys.Where(x => x.KeyState == keyState && x.IsInternal() == isInternal);
}
}
public IEnumerable<ExtKey> GetSecrets(string password, params Script[] scripts)
{
Key secret = EncryptedSecret.GetKey(password);
var extKey = new ExtKey(secret, ChainCode);
var extKeys = new List<ExtKey>();
lock (HdPubKeysLock)
{
foreach (HdPubKey key in HdPubKeys.Where(x =>
scripts.Contains(x.GetP2wpkhScript())
|| scripts.Contains(x.GetP2shOverP2wpkhScript())
|| scripts.Contains(x.GetP2pkhScript())
|| scripts.Contains(x.GetP2pkScript())))
{
ExtKey ek = extKey.Derive(key.FullKeyPath);
extKeys.Add(ek);
}
return extKeys;
}
}
}
}
| 28.092511 | 126 | 0.69343 | [
"MIT"
] | r0otChiXor/WalletWasabi | WalletWasabi/KeyManagement/KeyManager.cs | 6,379 | C# |
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E0228F2EB31D70EF0930F82B58F8081AC8A07A76"
//------------------------------------------------------------------------------
// <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 DogeKit_Serializer;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace DogeKit_Serializer {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
#line 5 "..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
DogeKit_Serializer.App app = new DogeKit_Serializer.App();
app.InitializeComponent();
app.Run();
}
}
}
| 32.112676 | 118 | 0.620614 | [
"Unlicense"
] | squabbi/DogeKit-Pixel2 | DogeKit Serializer/obj/Debug/App.g.cs | 2,282 | C# |
using Microsoft.Extensions.DependencyInjection;
using NLog;
using ReconNess.Core.Models;
using ReconNess.Core.Services;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace ReconNess.Services
{
/// <summary>
/// This class implement <see cref="IAgentBackgroundService"/>
/// </summary>
public class AgentBackgroundService : IAgentBackgroundService
{
protected static readonly ILogger _logger = LogManager.GetCurrentClassLogger();
private readonly IServiceProvider serviceProvider;
/// <summary>
/// Initializes a new instance of the <see cref="AgentBackgroundService" /> class
/// </summary>
/// <param name="serviceProvider"><see cref="IServiceProvider"/></param>
public AgentBackgroundService(IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
}
/// <inheritdoc/>
public async Task SaveOutputParseOnScopeAsync(AgentRunner agentRun, string agentRunType, ScriptOutput terminalOutputParse, CancellationToken cancellationToken = default)
{
using var scope = this.serviceProvider.CreateScope();
if (AgentRunnerTypes.ALL_TARGETS.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase) ||
AgentRunnerTypes.CURRENT_TARGET.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase))
{
var targetService = scope.ServiceProvider.GetRequiredService<ITargetService>();
await targetService.SaveTerminalOutputParseAsync(agentRun.Target, agentRun.Agent.Name, agentRun.ActivateNotification, terminalOutputParse, cancellationToken);
}
else if (AgentRunnerTypes.ALL_ROOTDOMAINS.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase) ||
AgentRunnerTypes.CURRENT_ROOTDOMAIN.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase))
{
var rootDomainService = scope.ServiceProvider.GetRequiredService<IRootDomainService>();
await rootDomainService.SaveTerminalOutputParseAsync(agentRun.RootDomain, agentRun.Agent.Name, agentRun.ActivateNotification, terminalOutputParse, cancellationToken);
}
else if (AgentRunnerTypes.ALL_SUBDOMAINS.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase) ||
AgentRunnerTypes.CURRENT_SUBDOMAIN.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase))
{
var subdomainService = scope.ServiceProvider.GetRequiredService<ISubdomainService>();
await subdomainService.SaveTerminalOutputParseAsync(agentRun.Subdomain, agentRun.Agent.Name, agentRun.ActivateNotification, terminalOutputParse, cancellationToken);
}
}
/// <inheritdoc/>
public async Task UpdateAgentOnScopeAsync(AgentRunner agentRun, string agentRunType, CancellationToken cancellationToken = default)
{
using var scope = this.serviceProvider.CreateScope();
if (AgentRunnerTypes.ALL_TARGETS.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase) ||
AgentRunnerTypes.CURRENT_TARGET.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase))
{
var targetService = scope.ServiceProvider.GetRequiredService<ITargetService>();
await targetService.UpdateAgentRanAsync(agentRun.Target, agentRun.Agent.Name, cancellationToken);
}
else if (AgentRunnerTypes.ALL_ROOTDOMAINS.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase) ||
AgentRunnerTypes.CURRENT_ROOTDOMAIN.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase))
{
var rootDomainService = scope.ServiceProvider.GetRequiredService<IRootDomainService>();
await rootDomainService.UpdateAgentRanAsync(agentRun.RootDomain, agentRun.Agent.Name, cancellationToken);
}
else if (AgentRunnerTypes.ALL_SUBDOMAINS.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase) ||
AgentRunnerTypes.CURRENT_SUBDOMAIN.Equals(agentRunType, StringComparison.CurrentCultureIgnoreCase))
{
var subdomainService = scope.ServiceProvider.GetRequiredService<ISubdomainService>();
await subdomainService.UpdateAgentRanAsync(agentRun.Subdomain, agentRun.Agent.Name, cancellationToken);
}
}
}
} | 57.481013 | 182 | 0.714821 | [
"MIT"
] | STEALTH-Z/reconness | src/ReconNess/Services/AgentBackgroundService.cs | 4,543 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.