commit
stringlengths 40
40
| subject
stringlengths 4
1.73k
| repos
stringlengths 5
127k
| old_file
stringlengths 2
751
| new_file
stringlengths 2
751
| new_contents
stringlengths 1
8.98k
| old_contents
stringlengths 0
6.59k
| license
stringclasses 13
values | lang
stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
4531e79db69e1a348a2dacb23e58e91800aa0661
|
Add exception handling.
|
Pliner/EasyGelf
|
Source/EasyGelf.Core/Transports/Udp/UdpTransport.cs
|
Source/EasyGelf.Core/Transports/Udp/UdpTransport.cs
|
using System;
using System.Net.Sockets;
using EasyGelf.Core.Encoders;
namespace EasyGelf.Core.Transports.Udp
{
public sealed class UdpTransport : ITransport
{
private readonly UdpTransportConfiguration configuration;
private readonly ITransportEncoder encoder;
private readonly IGelfMessageSerializer messageSerializer;
private UdpClient udpClient;
public UdpTransport(
UdpTransportConfiguration configuration,
ITransportEncoder encoder,
IGelfMessageSerializer messageSerializer)
{
this.configuration = configuration;
this.encoder = encoder;
this.messageSerializer = messageSerializer;
}
private void EstablishConnection()
{
if (udpClient != null) return;
var host = configuration.GetHost();
try
{
udpClient = new UdpClient();
udpClient.Connect(host);
}
catch (Exception exception)
{
Close();
throw new CannotConnectException(string.Format("Cannot connect to {0}", host), exception);
}
}
public void Send(GelfMessage message)
{
EstablishConnection();
var serialzed = messageSerializer.Serialize(message);
var encoded = encoder.Encode(serialzed);
foreach (var bytes in encoded)
{
udpClient.Send(bytes, bytes.Length, configuration.GetHost());
}
}
public void Close()
{
if (udpClient == null) return;
udpClient.Close();
udpClient = null;
}
}
}
|
using System;
using System.Net.Sockets;
using EasyGelf.Core.Encoders;
namespace EasyGelf.Core.Transports.Udp
{
public sealed class UdpTransport : ITransport, IDisposable
{
private readonly UdpTransportConfiguration configuration;
private readonly ITransportEncoder encoder;
private readonly IGelfMessageSerializer messageSerializer;
private readonly UdpClient udpClient;
private bool disposed;
public UdpTransport(
UdpTransportConfiguration configuration,
ITransportEncoder encoder,
IGelfMessageSerializer messageSerializer)
{
this.configuration = configuration;
this.encoder = encoder;
this.messageSerializer = messageSerializer;
this.udpClient = new UdpClient();
}
public void Send(GelfMessage message)
{
var serialzed = messageSerializer.Serialize(message);
var encoded = encoder.Encode(serialzed);
foreach (var bytes in encoded)
{
udpClient.Send(bytes, bytes.Length, configuration.GetHost());
}
}
public void Close()
{
Dispose();
}
public void Dispose()
{
if (!disposed)
{
udpClient.Close();
disposed = true;
}
}
}
}
|
mit
|
C#
|
75687902e82e56c9029a3a208f22995cbe58c5de
|
Add original constructor signature as there is Inception code which looks for it
|
east-sussex-county-council/Escc.Umbraco.Inception
|
Umbraco.Inception/Attributes/UmbracoTabAttribute.cs
|
Umbraco.Inception/Attributes/UmbracoTabAttribute.cs
|
using System;
namespace Umbraco.Inception.Attributes
{
[AttributeUsage(AttributeTargets.Property)]
public class UmbracoTabAttribute : Attribute
{
public string Name { get; set; }
public int SortOrder { get; set; }
public UmbracoTabAttribute(string name)
{
Name = name;
SortOrder = 0;
}
public UmbracoTabAttribute(string name, int sortOrder = 0)
{
Name = name;
SortOrder = sortOrder;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Inception.Attributes
{
[AttributeUsage(AttributeTargets.Property)]
public class UmbracoTabAttribute : Attribute
{
public string Name { get; set; }
public int SortOrder { get; set; }
public UmbracoTabAttribute(string name, int sortOrder = 0)
{
Name = name;
SortOrder = sortOrder;
}
}
}
|
mit
|
C#
|
81be2a231629c3e7af8f333bdfa89268eaeb3b59
|
Test commit
|
chefarbeiter/QuickIEnumerableToExcelExporter
|
src/QuickIEnumerableToExcelExporter/Extension.cs
|
src/QuickIEnumerableToExcelExporter/Extension.cs
|
using System.Collections.Generic;
namespace QuickIEnumerableToExcelExporter
{
public static class Extension
{
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="enumerable"></param>
/// <param name="target"></param>
public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target)
=> ExportToExcel(enumerable, target, new ExportConfiguration());
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="enumerable"></param>
/// <param name="target"></param>
/// <param name="configuration"></param>
public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target, ExportConfiguration configuration)
{
// get metadata
// write to intermediate
// convert intermediate to excel
}
}
}
|
using System.Collections.Generic;
namespace QuickIEnumerableToExcelExporter
{
public static class Extension
{
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="enumerable"></param>
/// <param name="target"></param>
public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target)
=> ExportToExcel(enumerable, target, new ExportConfiguration());
public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target, ExportConfiguration configuration)
{
// get metadata
// write to intermediate
// convert intermediate to excel
}
}
}
|
mit
|
C#
|
b7c0280cc90debe55f0b79f03ca34bf7b73e4dcf
|
fix interface for last commit
|
collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists
|
src/FilterLists.Data/Models/Contracts/IFilterList.cs
|
src/FilterLists.Data/Models/Contracts/IFilterList.cs
|
using System;
namespace FilterLists.Data.Models.Contracts
{
public interface IFilterList
{
string Author { get; set; }
string Description { get; set; }
string DescriptionSourceUrl { get; set; }
string DonateUrl { get; set; }
string Email { get; set; }
string ForumUrl { get; set; }
string HomeUrl { get; set; }
string IssuesUrl { get; set; }
string Name { get; set; }
string ViewUrl { get; set; }
long Id { get; set; }
DateTime CreatedDateUtc { get; set; }
DateTime? ModifiedDateUtc { get; set; }
}
}
|
using System;
namespace FilterLists.Data.Models.Contracts
{
public interface IFilterList
{
string Author { get; set; }
string Description { get; set; }
string DescriptionSourceUrl { get; set; }
string DonateUrl { get; set; }
string Email { get; set; }
string ForumUrl { get; set; }
string HomeUrl { get; set; }
string IssuesUrl { get; set; }
string Name { get; set; }
string ViewUrl { get; set; }
long Id { get; set; }
DateTime AddedDateUtc { get; set; }
DateTime? ModifiedDateUtc { get; set; }
}
}
|
mit
|
C#
|
9a3ddfd2773d7bdac0dc35364dfd3029e024aff0
|
enable MetadataFacts for CSX
|
OmniSharp/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn
|
tests/OmniSharp.Roslyn.CSharp.Tests/MetadataFacts.cs
|
tests/OmniSharp.Roslyn.CSharp.Tests/MetadataFacts.cs
|
using System.Threading.Tasks;
using OmniSharp.Models.Metadata;
using OmniSharp.Roslyn.CSharp.Services.Navigation;
using TestUtility;
using Xunit;
using Xunit.Abstractions;
namespace OmniSharp.Roslyn.CSharp.Tests
{
public class MetadataFacts : AbstractSingleRequestHandlerTestFixture<MetadataService>
{
public MetadataFacts(ITestOutputHelper output)
: base(output)
{
}
protected override string EndpointName => OmniSharpEndpoints.Metadata;
[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
public async Task ReturnsSource_ForSpecialType(string filename)
{
var assemblyName = AssemblyHelpers.CorLibName;
var typeName = "System.String";
await TestMetadataAsync(filename, assemblyName, typeName);
}
[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
public async Task ReturnsSource_ForNormalType(string filename)
{
#if NETCOREAPP1_1
var assemblyName = "System.Linq";
#else
var assemblyName = "System.Core";
#endif
var typeName = "System.Linq.Enumerable";
await TestMetadataAsync(filename, assemblyName, typeName);
}
[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
public async Task ReturnsSource_ForGenericType(string filename)
{
var assemblyName = AssemblyHelpers.CorLibName;
var typeName = "System.Collections.Generic.List`1";
await TestMetadataAsync(filename, assemblyName, typeName);
}
private async Task TestMetadataAsync(string filename, string assemblyName, string typeName)
{
var testFile = new TestFile(filename, "class C {}");
using (var host = CreateOmniSharpHost(testFile))
{
var requestHandler = GetRequestHandler(host);
var request = new MetadataRequest
{
AssemblyName = assemblyName,
TypeName = typeName,
Timeout = 60000
};
var response = await requestHandler.Handle(request);
Assert.NotNull(response.Source);
}
}
}
}
|
using System.Threading.Tasks;
using OmniSharp.Models.Metadata;
using OmniSharp.Roslyn.CSharp.Services.Navigation;
using TestUtility;
using Xunit;
using Xunit.Abstractions;
namespace OmniSharp.Roslyn.CSharp.Tests
{
public class MetadataFacts : AbstractSingleRequestHandlerTestFixture<MetadataService>
{
public MetadataFacts(ITestOutputHelper output)
: base(output)
{
}
protected override string EndpointName => OmniSharpEndpoints.Metadata;
[Fact]
public async Task ReturnsSource_ForSpecialType()
{
var assemblyName = AssemblyHelpers.CorLibName;
var typeName = "System.String";
await TestMetadataAsync(assemblyName, typeName);
}
[Fact]
public async Task ReturnsSource_ForNormalType()
{
#if NETCOREAPP1_1
var assemblyName = "System.Linq";
#else
var assemblyName = "System.Core";
#endif
var typeName = "System.Linq.Enumerable";
await TestMetadataAsync(assemblyName, typeName);
}
[Fact]
public async Task ReturnsSource_ForGenericType()
{
var assemblyName = AssemblyHelpers.CorLibName;
var typeName = "System.Collections.Generic.List`1";
await TestMetadataAsync(assemblyName, typeName);
}
private async Task TestMetadataAsync(string assemblyName, string typeName)
{
var testFile = new TestFile("dummy.cs", "class C {}");
using (var host = CreateOmniSharpHost(testFile))
{
var requestHandler = GetRequestHandler(host);
var request = new MetadataRequest
{
AssemblyName = assemblyName,
TypeName = typeName,
Timeout = 60000
};
var response = await requestHandler.Handle(request);
Assert.NotNull(response.Source);
}
}
}
}
|
mit
|
C#
|
ff50c44609b0d0938683e1e2f90ac86946ccf0c1
|
change parameters name of method
|
ivayloivanof/Libbon_Tank_Game
|
TankGame/Wall.cs
|
TankGame/Wall.cs
|
namespace TankGame
{
using System.Text;
public class Wall
{
private int vertical;
private int horizontal;
public Wall(int horizontal, int vertical)
{
this.Horizontal = horizontal;
this.Vertical = vertical;
}
// Property for vertical position
public int Vertical
{
get
{
return this.vertical;
}
set
{
// TODO Validation
this.vertical = value;
}
}
// Property for horizontal position
public int Horizontal
{
get
{
return this.horizontal;
}
set
{
// TODO Validation
this.horizontal = value;
}
}
// Override toString
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("Wall - Location: ");
stringBuilder.Append(this.Horizontal);
stringBuilder.Append(",");
stringBuilder.Append(this.Vertical);
return stringBuilder.ToString();
}
}
}
|
namespace TankGame
{
using System.Text;
public class Wall
{
private int vertical;
private int horizontal;
public Wall(int h, int v)
{
this.Horizontal = h;
this.Vertical = v;
}
// Property for vertical position
public int Vertical
{
get
{
return this.vertical;
}
set
{
// TODO Validation
this.vertical = value;
}
}
// Property for horizontal position
public int Horizontal
{
get
{
return this.horizontal;
}
set
{
// TODO Validation
this.horizontal = value;
}
}
// Override toString
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("Wall - Location: ");
stringBuilder.Append(this.Horizontal);
stringBuilder.Append(",");
stringBuilder.Append(this.Vertical);
return stringBuilder.ToString();
}
}
}
|
cc0-1.0
|
C#
|
dc31524912c1162612ae6fcb9325bd98368ec0c2
|
Revert "Revert "Added "final door count" comment at return value.""
|
n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations
|
100_Doors_Problem/C#/Davipb/HundredDoors.cs
|
100_Doors_Problem/C#/Davipb/HundredDoors.cs
|
using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with 101 values, all of them false. We'll only use 1~100 to simplify it
bool[] doors = Enumerable.Repeat(false, 101).ToArray();
// We'll pass 100 times, each pass we'll start at door #pass and increment by pass, toggling the current door
for (int pass = 1; pass <= 100; pass++)
for (int i = pass; i < doors.Length; i += pass)
doors[i] = !doors[i];
return doors; //final door count
}
}
}
|
using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with 101 values, all of them false. We'll only use 1~100 to simplify it
bool[] doors = Enumerable.Repeat(false, 101).ToArray();
// We'll pass 100 times, each pass we'll start at door #pass and increment by pass, toggling the current door
for (int pass = 1; pass <= 100; pass++)
for (int i = pass; i < doors.Length; i += pass)
doors[i] = !doors[i];
return doors;
}
}
}
|
mit
|
C#
|
df9e0dbd1339636969bc572a8aeb6880bddf164e
|
Fix log command and return log lines
|
MihaMarkic/Cake.Docker
|
src/Cake.Docker/Container/Logs/Docker.Aliases.Logs.cs
|
src/Cake.Docker/Container/Logs/Docker.Aliases.Logs.cs
|
using Cake.Core;
using Cake.Core.Annotations;
using System;
using System.Linq;
using System.Collections.Generic;
namespace Cake.Docker
{
partial class DockerAliases
{
/// <summary>
/// Logs <paramref name="container"/> using default settings.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="container">The list of containers.</param>
[CakeMethodAlias]
public static IEnumerable<string> DockerLogs(this ICakeContext context, string container)
{
return DockerLogs(context, new DockerContainerLogsSettings(), container);
}
/// <summary>
/// Logs <paramref name="container"/> using the given <paramref name="settings"/>.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="container">The list of containers.</param>
/// <param name="settings">The settings.</param>
[CakeMethodAlias]
public static IEnumerable<string> DockerLogs(this ICakeContext context, DockerContainerLogsSettings settings, string container)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (container == null)
{
throw new ArgumentNullException("container");
}
var runner = new GenericDockerRunner<DockerContainerLogsSettings>(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
return runner.RunWithResult("logs", settings ?? new DockerContainerLogsSettings(), r => r.ToArray(), new string[] { container });
}
}
}
|
using Cake.Core;
using Cake.Core.Annotations;
using System;
namespace Cake.Docker
{
partial class DockerAliases
{
/// <summary>
/// Logs <paramref name="container"/> using default settings.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="container">The list of containers.</param>
[CakeMethodAlias]
public static void DockerLogs(this ICakeContext context, string container)
{
DockerLogs(context, new DockerContainerLogsSettings(), container);
}
/// <summary>
/// Logs <paramref name="container"/> using the given <paramref name="settings"/>.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="container">The list of containers.</param>
/// <param name="settings">The settings.</param>
[CakeMethodAlias]
public static void DockerLogs(this ICakeContext context, DockerContainerLogsSettings settings, string container)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (container == null)
{
throw new ArgumentNullException("container");
}
var runner = new GenericDockerRunner<DockerContainerLogsSettings>(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
runner.Run("start", settings ?? new DockerContainerLogsSettings(), new string[] { container });
}
}
}
|
mit
|
C#
|
7410c156ec5609be94813db6a4a4f4f73866041a
|
Change equality comparison code
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi/Crypto/Mac.cs
|
WalletWasabi/Crypto/Mac.cs
|
using System;
using System.Text;
using NBitcoin.Secp256k1;
using WalletWasabi.Crypto.Groups;
using WalletWasabi.Helpers;
namespace WalletWasabi.Crypto
{
public class MAC : IEquatable<MAC>
{
private MAC(Scalar t, GroupElement v)
{
T = CryptoGuard.NotZero(nameof(t), t);
V = CryptoGuard.NotNullOrInfinity(nameof(v), v);
}
public Scalar T { get; }
public GroupElement V { get; }
public static bool operator ==(MAC a, MAC b) => a.Equals(b);
public static bool operator !=(MAC a, MAC b) => !a.Equals(b);
public bool Equals(MAC? other) =>
(this?.T, this?.V) == (other?.T, other?.V);
public override bool Equals(object? obj) =>
Equals(obj as MAC);
public override int GetHashCode() =>
HashCode.Combine(T, V).GetHashCode();
public static MAC ComputeMAC(CoordinatorSecretKey sk, GroupElement ma, Scalar t)
{
Guard.NotNull(nameof(sk), sk);
CryptoGuard.NotZero(nameof(t), t);
CryptoGuard.NotNullOrInfinity(nameof(ma), ma);
return ComputeAlgebraicMAC((sk.X0, sk.X1), (sk.W * Generators.Gw) + (sk.Ya * ma), t);
}
public bool VerifyMAC(CoordinatorSecretKey sk, GroupElement ma) =>
ComputeMAC(sk, ma, T) == this;
private static MAC ComputeAlgebraicMAC((Scalar x0, Scalar x1) sk, GroupElement m, Scalar t) =>
new MAC(t, (sk.x0 + sk.x1 * t) * GenerateU(t) + m);
private static GroupElement GenerateU(Scalar t) =>
Generators.FromBuffer(t.ToBytes());
}
}
|
using System;
using System.Text;
using NBitcoin.Secp256k1;
using WalletWasabi.Crypto.Groups;
using WalletWasabi.Helpers;
namespace WalletWasabi.Crypto
{
public class MAC : IEquatable<MAC>
{
private MAC(Scalar t, GroupElement v)
{
T = CryptoGuard.NotZero(nameof(t), t);
V = CryptoGuard.NotNullOrInfinity(nameof(v), v);
}
public Scalar T { get; }
public GroupElement V { get; }
public static bool operator ==(MAC a, MAC b) => a.Equals(b);
public static bool operator !=(MAC a, MAC b) => !a.Equals(b);
public bool Equals(MAC? other) =>
(this, other) switch
{
(null, null) => true,
(null, { }) => false,
({ }, null) => false,
({ } a, { } b) when ReferenceEquals(a, b) => true,
({ } a, { } b) => (a.T, a.V) == (b.T, b.V)
};
public override bool Equals(object? obj) =>
Equals(obj as MAC);
public override int GetHashCode() =>
HashCode.Combine(T, V).GetHashCode();
public static MAC ComputeMAC(CoordinatorSecretKey sk, GroupElement ma, Scalar t)
{
Guard.NotNull(nameof(sk), sk);
CryptoGuard.NotZero(nameof(t), t);
CryptoGuard.NotNullOrInfinity(nameof(ma), ma);
return ComputeAlgebraicMAC((sk.X0, sk.X1), (sk.W * Generators.Gw) + (sk.Ya * ma), t);
}
public bool VerifyMAC(CoordinatorSecretKey sk, GroupElement ma) =>
ComputeMAC(sk, ma, T) == this;
private static MAC ComputeAlgebraicMAC((Scalar x0, Scalar x1) sk, GroupElement m, Scalar t) =>
new MAC(t, (sk.x0 + sk.x1 * t) * GenerateU(t) + m);
private static GroupElement GenerateU(Scalar t) =>
Generators.FromBuffer(t.ToBytes());
}
}
|
mit
|
C#
|
739c118cef2350e0395a58b04aa385c2a20f57af
|
Bump version.
|
JohanLarsson/Gu.Wpf.DataGrid2D,mennowo/Gu.Wpf.DataGrid2D
|
Gu.Wpf.DataGrid2D/Properties/AssemblyInfo.cs
|
Gu.Wpf.DataGrid2D/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Markup;
[assembly: AssemblyTitle("Gu.Wpf.DataGrid2D")]
[assembly: AssemblyDescription("Attached properties for DataGrid to enable binding to 2D sources.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Johan Larsson")]
[assembly: AssemblyProduct("Gu.Wpf.DataGrid2D")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("f04cba4d-f4f6-4dfd-99bb-de7679060281")]
[assembly: AssemblyVersion("0.2.2.0")]
[assembly: AssemblyFileVersion("0.2.2.0")]
[assembly: XmlnsDefinition("http://gu.se/DataGrid2D", "Gu.Wpf.DataGrid2D")]
[assembly: XmlnsPrefix("http://gu.se/DataGrid2D", "dataGrid2D")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: InternalsVisibleTo("Gu.Wpf.DataGrid2D.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001000D790C1903DF2D575149C55D658639B3EBDD93809BC07A552E0AED21AC80BCF33448B1DE940C7DEE7A93FF2E77C2B720DD9A5C9D146D8FA01785B02A55BCC04030DB5A95BF54EC544235B70C6F224F414D823D9BA2DC6FFB9872EF1F41DD016DE00B8E0B692594F0CA9D03266BA36BFFD94382B48ED3F9CE826205938C44BBBC", AllInternalsVisible = true)]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Markup;
[assembly: AssemblyTitle("Gu.Wpf.DataGrid2D")]
[assembly: AssemblyDescription("Attached properties for DataGrid to enable binding to 2D sources.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Johan Larsson")]
[assembly: AssemblyProduct("Gu.Wpf.DataGrid2D")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("f04cba4d-f4f6-4dfd-99bb-de7679060281")]
[assembly: AssemblyVersion("0.2.1.6")]
[assembly: AssemblyFileVersion("0.2.1.6")]
[assembly: XmlnsDefinition("http://gu.se/DataGrid2D", "Gu.Wpf.DataGrid2D")]
[assembly: XmlnsPrefix("http://gu.se/DataGrid2D", "dataGrid2D")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: InternalsVisibleTo("Gu.Wpf.DataGrid2D.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001000D790C1903DF2D575149C55D658639B3EBDD93809BC07A552E0AED21AC80BCF33448B1DE940C7DEE7A93FF2E77C2B720DD9A5C9D146D8FA01785B02A55BCC04030DB5A95BF54EC544235B70C6F224F414D823D9BA2DC6FFB9872EF1F41DD016DE00B8E0B692594F0CA9D03266BA36BFFD94382B48ED3F9CE826205938C44BBBC", AllInternalsVisible = true)]
|
mit
|
C#
|
cd71a4dd743bc35f42cded119f7a2263afb07eb2
|
remove --hft from instructions docs
|
greggman/hft-unity3d,greggman/hft-unity3d,greggman/hft-unity3d,greggman/hft-unity3d
|
Assets/HappyFunTimes/Scripts/Editor/HFTInstructionsEditor.cs
|
Assets/HappyFunTimes/Scripts/Editor/HFTInstructionsEditor.cs
|
using UnityEditor;
using UnityEngine;
using System.Collections;
[CustomEditor(typeof(HappyFunTimes.HFTInstructions))]
[CanEditMultipleObjects]
public class HFTInstructionsEditor : Editor {
public override void OnInspectorGUI() {
string help =
@"You can set these from the command line with
--instructions=""your instructions""
and
--bottom
Leave 'show' unchecked except for testing.";
EditorGUILayout.HelpBox(help, MessageType.Info);
GUILayout.Space(5);
DrawDefaultInspector();
}
}
|
using UnityEditor;
using UnityEngine;
using System.Collections;
[CustomEditor(typeof(HappyFunTimes.HFTInstructions))]
[CanEditMultipleObjects]
public class HFTInstructionsEditor : Editor {
public override void OnInspectorGUI() {
string help =
@"You can set these from the command line with
--hft-instructions=""your instructions""
and
--hft-instuctions-bottom
Leave 'show' unchecked except for testing.";
EditorGUILayout.HelpBox(help, MessageType.Info);
GUILayout.Space(5);
DrawDefaultInspector();
}
}
|
bsd-3-clause
|
C#
|
a0eb631d488448480fb75fcc9b6edb0242637320
|
Update missed file
|
abdulapopoola/matasanoChallenges,abdulapopoola/matasanoChallenges,abdulapopoola/matasanoChallenges
|
Matasano/Matasano/Properties/AssemblyInfo.cs
|
Matasano/Matasano/Properties/AssemblyInfo.cs
|
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("Matasano")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Matasano")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("02829703-5a6f-49a4-b854-f67db910284c")]
// 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")]
|
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("Matasano")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Matasano")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
// 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")]
|
mit
|
C#
|
34f59cde9b07e142596eb255173260a243694e44
|
Make DropdDownNavigationWorks more reliable and use new test methods.
|
larshg/Bonobo-Git-Server,crowar/Bonobo-Git-Server,gencer/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,willdean/Bonobo-Git-Server,gencer/Bonobo-Git-Server,crowar/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,larshg/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,larshg/Bonobo-Git-Server,gencer/Bonobo-Git-Server,willdean/Bonobo-Git-Server,crowar/Bonobo-Git-Server,gencer/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,lkho/Bonobo-Git-Server,crowar/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,willdean/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,lkho/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,willdean/Bonobo-Git-Server,lkho/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,crowar/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,lkho/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,willdean/Bonobo-Git-Server,larshg/Bonobo-Git-Server,crowar/Bonobo-Git-Server,forgetz/Bonobo-Git-Server
|
Bonobo.Git.Server.Test/IntegrationTests/SharedLayoutTests.cs
|
Bonobo.Git.Server.Test/IntegrationTests/SharedLayoutTests.cs
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Bonobo.Git.Server.Controllers;
using Bonobo.Git.Server.Test.Integration.Web;
using Bonobo.Git.Server.Test.IntegrationTests.Helpers;
using SpecsFor.Mvc;
namespace Bonobo.Git.Server.Test.IntegrationTests
{
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium;
using System.Threading;
[TestClass]
public class SharedLayoutTests : IntegrationTestBase
{
[TestMethod, TestCategory(TestCategories.WebIntegrationTest)]
public void DropdownNavigationWorks()
{
var reponame = ITH.MakeName();
var otherreponame = ITH.MakeName(reponame + "_other");
var repoId = ITH.CreateRepositoryOnWebInterface(reponame);
var otherrepoId = ITH.CreateRepositoryOnWebInterface(otherreponame);
app.NavigateTo<RepositoryController>(c => c.Detail(otherrepoId));
var element = app.Browser.FindElementByCssSelector("select#Repositories");
var dropdown = new SelectElement(element);
dropdown.SelectByText(reponame);
Thread.Sleep(2000);
app.UrlMapsTo<RepositoryController>(c => c.Detail(repoId));
app.WaitForElementToBeVisible(By.CssSelector("select#Repositories"), TimeSpan.FromSeconds(10));
dropdown = new SelectElement(app.Browser.FindElementByCssSelector("select#Repositories"));
dropdown.SelectByText(otherreponame);
Thread.Sleep(2000);
app.UrlMapsTo<RepositoryController>(c => c.Detail(otherrepoId));
}
}
}
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Bonobo.Git.Server.Controllers;
using Bonobo.Git.Server.Test.Integration.Web;
using Bonobo.Git.Server.Test.IntegrationTests.Helpers;
using SpecsFor.Mvc;
namespace Bonobo.Git.Server.Test.IntegrationTests
{
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium;
[TestClass]
public class SharedLayoutTests : IntegrationTestBase
{
[TestMethod, TestCategory(TestCategories.WebIntegrationTest)]
public void DropdownNavigationWorks()
{
var reponame = "A_Nice_Repo";
var id1 = ITH.CreateRepositoryOnWebInterface(reponame);
var id2 = ITH.CreateRepositoryOnWebInterface("other_name");
app.NavigateTo<RepositoryController>(c => c.Detail(id2));
var element = app.Browser.FindElementByCssSelector("select#Repositories");
var dropdown = new SelectElement(element);
dropdown.SelectByText(reponame);
app.UrlMapsTo<RepositoryController>(c => c.Detail(id1));
app.WaitForElementToBeVisible(By.CssSelector("select#Repositories"), TimeSpan.FromSeconds(10));
dropdown = new SelectElement(app.Browser.FindElementByCssSelector("select#Repositories"));
dropdown.SelectByText("other_name");
app.UrlMapsTo<RepositoryController>(c => c.Detail(id2));
}
}
}
|
mit
|
C#
|
50c1838d31ad748b700403bfd9e3fb56e5a25716
|
Use getter setter
|
DerTieran/MyQuizAdmin
|
MyQuizAdmin/MyQuizAdmin/Models/GroupModel.cs
|
MyQuizAdmin/MyQuizAdmin/Models/GroupModel.cs
|
namespace MyQuizAdmin.Models
{
public class Group
{
public int id { get; set; }
public string title { get; set; }
}
}
|
namespace MyQuizAdmin.Models
{
public class Group
{
public int id;
public string title;
}
}
|
mit
|
C#
|
3727696c0114199ff688c0faf2f347d83c605da3
|
Fix vow of silence popup spam (#8974)
|
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
|
Content.Server/Chat/TypingIndicator/TypingIndicatorSystem.cs
|
Content.Server/Chat/TypingIndicator/TypingIndicatorSystem.cs
|
using Content.Shared.ActionBlocker;
using Content.Shared.Chat.TypingIndicator;
using Robust.Server.GameObjects;
namespace Content.Server.Chat.TypingIndicator;
// Server-side typing system
// It receives networked typing events from clients
// And sync typing indicator using appearance component
public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
{
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<TypingIndicatorComponent, PlayerDetachedEvent>(OnPlayerDetached);
SubscribeNetworkEvent<TypingChangedEvent>(OnClientTypingChanged);
}
private void OnPlayerAttached(PlayerAttachedEvent ev)
{
// when player poses entity we want to make sure that there is typing indicator
EnsureComp<TypingIndicatorComponent>(ev.Entity);
// we also need appearance component to sync visual state
EnsureComp<ServerAppearanceComponent>(ev.Entity);
}
private void OnPlayerDetached(EntityUid uid, TypingIndicatorComponent component, PlayerDetachedEvent args)
{
// player left entity body - hide typing indicator
SetTypingIndicatorEnabled(uid, false);
}
private void OnClientTypingChanged(TypingChangedEvent ev)
{
// make sure that this entity still exist
if (!Exists(ev.Uid))
{
Logger.Warning($"Client attached entity {ev.Uid} from TypingChangedEvent doesn't exist on server.");
return;
}
// check if this entity can speak or emote
if (!_actionBlocker.CanEmote(ev.Uid) && !_actionBlocker.CanSpeak(ev.Uid))
{
// nah, make sure that typing indicator is disabled
SetTypingIndicatorEnabled(ev.Uid, false);
return;
}
SetTypingIndicatorEnabled(ev.Uid, ev.IsTyping);
}
private void SetTypingIndicatorEnabled(EntityUid uid, bool isEnabled, AppearanceComponent? appearance = null)
{
if (!Resolve(uid, ref appearance, false))
return;
appearance.SetData(TypingIndicatorVisuals.IsTyping, isEnabled);
}
}
|
using Content.Shared.ActionBlocker;
using Content.Shared.Chat.TypingIndicator;
using Robust.Server.GameObjects;
namespace Content.Server.Chat.TypingIndicator;
// Server-side typing system
// It receives networked typing events from clients
// And sync typing indicator using appearance component
public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
{
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<TypingIndicatorComponent, PlayerDetachedEvent>(OnPlayerDetached);
SubscribeNetworkEvent<TypingChangedEvent>(OnClientTypingChanged);
}
private void OnPlayerAttached(PlayerAttachedEvent ev)
{
// when player poses entity we want to make sure that there is typing indicator
EnsureComp<TypingIndicatorComponent>(ev.Entity);
// we also need appearance component to sync visual state
EnsureComp<ServerAppearanceComponent>(ev.Entity);
}
private void OnPlayerDetached(EntityUid uid, TypingIndicatorComponent component, PlayerDetachedEvent args)
{
// player left entity body - hide typing indicator
SetTypingIndicatorEnabled(uid, false);
}
private void OnClientTypingChanged(TypingChangedEvent ev)
{
// make sure that this entity still exist
if (!Exists(ev.Uid))
{
Logger.Warning($"Client attached entity {ev.Uid} from TypingChangedEvent doesn't exist on server.");
return;
}
// check if this entity can speak or emote
if (!_actionBlocker.CanSpeak(ev.Uid) && !_actionBlocker.CanEmote(ev.Uid))
{
// nah, make sure that typing indicator is disabled
SetTypingIndicatorEnabled(ev.Uid, false);
return;
}
SetTypingIndicatorEnabled(ev.Uid, ev.IsTyping);
}
private void SetTypingIndicatorEnabled(EntityUid uid, bool isEnabled, AppearanceComponent? appearance = null)
{
if (!Resolve(uid, ref appearance, false))
return;
appearance.SetData(TypingIndicatorVisuals.IsTyping, isEnabled);
}
}
|
mit
|
C#
|
220f890eed25833c695059f9dc96a814ac9e09f5
|
Rework exception asserts to improve failure messages.
|
sharpjs/PSql,sharpjs/PSql
|
PSql.Tests/Tests.Support/StringExtensions.cs
|
PSql.Tests/Tests.Support/StringExtensions.cs
|
using System;
using System.Linq;
using System.Linq.Expressions;
using FluentAssertions;
namespace PSql.Tests
{
using static ScriptExecutor;
internal static class StringExtensions
{
internal static void
ShouldOutput(
this string script,
params object[] expected
)
{
if (script is null)
throw new ArgumentNullException(nameof(script));
if (expected is null)
throw new ArgumentNullException(nameof(expected));
var (objects, exception) = Execute(script);
exception.Should().BeNull();
objects.Should().HaveCount(expected.Length);
objects
.Select(o => o?.BaseObject)
.Should().BeEquivalentTo(expected, x => x.IgnoringCyclicReferences());
}
internal static void
ShouldThrow<T>(this string script, string messagePart)
where T : Exception
{
var exception = script.ShouldThrow<T>();
exception.Message.Should().Contain(messagePart);
}
internal static T ShouldThrow<T>(this string script)
where T : Exception
{
if (script is null)
throw new ArgumentNullException(nameof(script));
var (_, exception) = Execute(script);
return exception
.Should().NotBeNull()
.And .BeAssignableTo<T>()
.Subject;
}
}
}
|
using System;
using System.Linq;
using System.Linq.Expressions;
using FluentAssertions;
namespace PSql.Tests
{
using static ScriptExecutor;
internal static class StringExtensions
{
internal static void
ShouldOutput(
this string script,
params object[] expected
)
{
if (script is null)
throw new ArgumentNullException(nameof(script));
if (expected is null)
throw new ArgumentNullException(nameof(expected));
var (objects, exception) = Execute(script);
exception.Should().BeNull();
objects.Should().HaveCount(expected.Length);
objects
.Select(o => o?.BaseObject)
.Should().BeEquivalentTo(expected, x => x.IgnoringCyclicReferences());
}
internal static void
ShouldThrow<T>(
this string script,
string messagePart
)
where T : Exception
{
script.ShouldThrow<T>(
e => e.Message.Contains(messagePart, StringComparison.OrdinalIgnoreCase)
);
}
internal static void
ShouldThrow<T>(
this string script,
Expression<Func<T, bool>>? predicate = null
)
where T : Exception
{
if (script is null)
throw new ArgumentNullException(nameof(script));
var (_, exception) = Execute(script);
exception.Should().NotBeNull().And.BeAssignableTo<T>();
if (predicate is not null)
exception.Should().Match<T>(predicate);
}
}
}
|
isc
|
C#
|
117e0790111c0b250c46cba360270a45552cf80f
|
Fix build when targeting .NET Framework 3.5 as Func only supports covariance on .NET Framework 4.0 and higher.
|
GenericHero/SSH.NET,sshnet/SSH.NET,miniter/SSH.NET,Bloomcredit/SSH.NET
|
Renci.SshClient/Renci.SshNet.Tests/Classes/CipherInfoTest.cs
|
Renci.SshClient/Renci.SshNet.Tests/Classes/CipherInfoTest.cs
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Renci.SshNet.Security.Cryptography;
using Renci.SshNet.Tests.Common;
using System;
namespace Renci.SshNet.Tests.Classes
{
/// <summary>
/// Holds information about key size and cipher to use
/// </summary>
[TestClass]
public class CipherInfoTest : TestBase
{
/// <summary>
///A test for CipherInfo Constructor
///</summary>
[TestMethod()]
public void CipherInfoConstructorTest()
{
int keySize = 0; // TODO: Initialize to an appropriate value
Func<byte[], byte[], Cipher> cipher = null; // TODO: Initialize to an appropriate value
CipherInfo target = new CipherInfo(keySize, cipher);
Assert.Inconclusive("TODO: Implement code to verify target");
}
}
}
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Renci.SshNet.Security.Cryptography;
using Renci.SshNet.Tests.Common;
using System;
namespace Renci.SshNet.Tests.Classes
{
/// <summary>
/// Holds information about key size and cipher to use
/// </summary>
[TestClass]
public class CipherInfoTest : TestBase
{
/// <summary>
///A test for CipherInfo Constructor
///</summary>
[TestMethod()]
public void CipherInfoConstructorTest()
{
int keySize = 0; // TODO: Initialize to an appropriate value
Func<byte[], byte[], BlockCipher> cipher = null; // TODO: Initialize to an appropriate value
CipherInfo target = new CipherInfo(keySize, cipher);
Assert.Inconclusive("TODO: Implement code to verify target");
}
}
}
|
mit
|
C#
|
cfc1fcafdf2cf758705aa5e9051507d475cb61ab
|
Remove useless region.
|
ketiko/rhino-esb,hibernating-rhinos/rhino-esb
|
Rhino.ServiceBus/Msmq/QueueCreationModule.cs
|
Rhino.ServiceBus/Msmq/QueueCreationModule.cs
|
using System;
using Rhino.ServiceBus.Exceptions;
namespace Rhino.ServiceBus.Msmq
{
public class QueueCreationModule : IServiceBusAware
{
private readonly IQueueStrategy queueStrategy;
public QueueCreationModule(IQueueStrategy queueStrategy)
{
this.queueStrategy = queueStrategy;
}
public void BusStarting(IServiceBus bus)
{
try
{
queueStrategy.InitializeQueue(bus.Endpoint, QueueType.Standard);
}
catch (Exception e)
{
throw new TransportException(
"Could not open queue: " + bus.Endpoint + Environment.NewLine +
"Queue path: " + MsmqUtil.GetQueuePath(bus.Endpoint), e);
}
}
public void BusStarted(IServiceBus bus)
{
}
public void BusDisposing(IServiceBus bus)
{
}
public void BusDisposed(IServiceBus bus)
{
}
}
}
|
using System;
using Rhino.ServiceBus.Exceptions;
namespace Rhino.ServiceBus.Msmq
{
public class QueueCreationModule : IServiceBusAware
{
private readonly IQueueStrategy queueStrategy;
public QueueCreationModule(IQueueStrategy queueStrategy)
{
this.queueStrategy = queueStrategy;
}
#region IServiceBusAware Members
public void BusStarting(IServiceBus bus)
{
try
{
queueStrategy.InitializeQueue(bus.Endpoint, QueueType.Standard);
}
catch (Exception e)
{
throw new TransportException(
"Could not open queue: " + bus.Endpoint + Environment.NewLine +
"Queue path: " + MsmqUtil.GetQueuePath(bus.Endpoint), e);
}
}
public void BusStarted(IServiceBus bus)
{
}
public void BusDisposing(IServiceBus bus)
{
}
public void BusDisposed(IServiceBus bus)
{
}
#endregion
}
}
|
bsd-3-clause
|
C#
|
3631b183c1ee8cf7971664656bafa26bb991bacc
|
Correct RenderSprite terminology.
|
LipkeGu/OpenRPG
|
Traits/RenderSprite.cs
|
Traits/RenderSprite.cs
|
using System;
using Microsoft.Xna.Framework;
using OpenRPG.Graphics;
namespace OpenRPG.Traits
{
public class RenderSpriteInfo : ITraitInfo
{
public readonly string Animation = null;
public object CreateTrait(Actor actor) { return new RenderSprite(actor, this); }
}
public class RenderSprite : ITrait, ITickRender
{
public Sequence CurrentSequence { get; private set; }
readonly string image;
readonly Sequence[] sequences;
readonly int ticksPerFrame;
int currentFrame;
int ticks;
public RenderSprite(Actor self, RenderSpriteInfo info)
{
image = info.Animation ?? self.Info.Name;
sequences = self.World.Game.Animations[image].Sequences;
if (sequences.Length == 0)
throw new MetadataException("Animation `{0}` has no sequences.".F(image));
CurrentSequence = sequences[0];
ticksPerFrame = CurrentSequence.Ticks;
currentFrame = 0;
ticks = ticksPerFrame;
}
public void TickRender(Actor self)
{
var world = self.World;
var sprite = CurrentSequence.Sprite;
var frameSize = CurrentSequence.FrameSize;
var row = Math.Floor((double)currentFrame / CurrentSequence.FramesPerRow);
var col = Math.Floor((double)currentFrame % CurrentSequence.FramesPerRow);
var sourceRect = new Rectangle(
(int)(col * frameSize.Width),
(int)(row * frameSize.Height),
frameSize.Width,
frameSize.Height);
if (--ticks == 0)
{
currentFrame++;
ticks = ticksPerFrame;
}
if (currentFrame > CurrentSequence.Length - 1)
currentFrame = 0;
// TODO: World -> Screen
var pos = new Point(self.Position.X, self.Position.Y);
world.RenderImage(sprite, sourceRect, pos);
}
}
}
|
using System;
using Microsoft.Xna.Framework;
using OpenRPG.Graphics;
namespace OpenRPG.Traits
{
public class RenderSpriteInfo : ITraitInfo
{
public readonly string Image = null;
public object CreateTrait(Actor actor) { return new RenderSprite(actor, this); }
}
public class RenderSprite : ITrait, ITickRender
{
public Sequence CurrentSequence { get; private set; }
readonly string image;
readonly Sequence[] sequences;
readonly int ticksPerFrame;
int currentFrame;
int ticks;
public RenderSprite(Actor self, RenderSpriteInfo info)
{
image = info.Image ?? self.Info.Name;
sequences = self.World.Game.Animations[image].Sequences;
if (sequences.Length == 0)
throw new MetadataException("Animation `{0}` has no sequences.".F(image));
CurrentSequence = sequences[0];
ticksPerFrame = CurrentSequence.Ticks;
currentFrame = 0;
ticks = ticksPerFrame;
}
public void TickRender(Actor self)
{
var world = self.World;
var sprite = CurrentSequence.Sprite;
var frameSize = CurrentSequence.FrameSize;
var row = Math.Floor((double)currentFrame / CurrentSequence.FramesPerRow);
var col = Math.Floor((double)currentFrame % CurrentSequence.FramesPerRow);
var sourceRect = new Rectangle(
(int)(col * frameSize.Width),
(int)(row * frameSize.Height),
frameSize.Width,
frameSize.Height);
if (--ticks == 0)
{
currentFrame++;
ticks = ticksPerFrame;
}
if (currentFrame > CurrentSequence.Length - 1)
currentFrame = 0;
// TODO: World -> Screen
var pos = new Point(self.Position.X, self.Position.Y);
world.RenderImage(sprite, sourceRect, pos);
}
}
}
|
isc
|
C#
|
901c93ef0c226baba6a7438d05519532b15424ea
|
Fix a warning about a cref in an XML doc comment.
|
KamalRathnayake/roslyn,dotnet/roslyn,aelij/roslyn,nguerrera/roslyn,russpowers/roslyn,danielcweber/roslyn,paladique/roslyn,panopticoncentral/roslyn,marksantos/roslyn,AmadeusW/roslyn,khellang/roslyn,ahmedshuhel/roslyn,weltkante/roslyn,AlekseyTs/roslyn,BugraC/roslyn,AlexisArce/roslyn,mavasani/roslyn,stebet/roslyn,akrisiun/roslyn,thomaslevesque/roslyn,tsdl2013/roslyn,CyrusNajmabadi/roslyn,amcasey/roslyn,ManishJayaswal/roslyn,dotnet/roslyn,dpoeschl/roslyn,ilyes14/roslyn,DustinCampbell/roslyn,khyperia/roslyn,dsplaisted/roslyn,CaptainHayashi/roslyn,supriyantomaftuh/roslyn,paladique/roslyn,panopticoncentral/roslyn,akoeplinger/roslyn,dsplaisted/roslyn,antonssonj/roslyn,Inverness/roslyn,mattscheffer/roslyn,ErikSchierboom/roslyn,bbarry/roslyn,TyOverby/roslyn,KevinH-MS/roslyn,AnthonyDGreen/roslyn,stjeong/roslyn,srivatsn/roslyn,stebet/roslyn,jonatassaraiva/roslyn,ErikSchierboom/roslyn,bkoelman/roslyn,Maxwe11/roslyn,dpen2000/roslyn,JohnHamby/roslyn,paulvanbrenk/roslyn,sharwell/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,nagyistoce/roslyn,mattscheffer/roslyn,3F/roslyn,AmadeusW/roslyn,jroggeman/roslyn,YOTOV-LIMITED/roslyn,FICTURE7/roslyn,sharwell/roslyn,davkean/roslyn,AlexisArce/roslyn,evilc0des/roslyn,MattWindsor91/roslyn,MichalStrehovsky/roslyn,tang7526/roslyn,vcsjones/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,srivatsn/roslyn,sharadagrawal/Roslyn,doconnell565/roslyn,gafter/roslyn,reaction1989/roslyn,bkoelman/roslyn,TyOverby/roslyn,devharis/roslyn,VPashkov/roslyn,3F/roslyn,TyOverby/roslyn,MichalStrehovsky/roslyn,ManishJayaswal/roslyn,v-codeel/roslyn,JohnHamby/roslyn,drognanar/roslyn,nagyistoce/roslyn,tmat/roslyn,chenxizhang/roslyn,taylorjonl/roslyn,eriawan/roslyn,bartdesmet/roslyn,MatthieuMEZIL/roslyn,robinsedlaczek/roslyn,mgoertz-msft/roslyn,akoeplinger/roslyn,jkotas/roslyn,ericfe-ms/roslyn,jeffanders/roslyn,vslsnap/roslyn,zmaruo/roslyn,mirhagk/roslyn,heejaechang/roslyn,jroggeman/roslyn,tmat/roslyn,JakeGinnivan/roslyn,khyperia/roslyn,mirhagk/roslyn,Giftednewt/roslyn,davkean/roslyn,michalhosala/roslyn,OmniSharp/roslyn,bbarry/roslyn,leppie/roslyn,ericfe-ms/roslyn,mavasani/roslyn,jkotas/roslyn,tsdl2013/roslyn,abock/roslyn,DavidKarlas/roslyn,Maxwe11/roslyn,ManishJayaswal/roslyn,GuilhermeSa/roslyn,aelij/roslyn,Giftednewt/roslyn,kienct89/roslyn,ilyes14/roslyn,akoeplinger/roslyn,cybernet14/roslyn,Felorati/roslyn,jramsay/roslyn,natgla/roslyn,swaroop-sridhar/roslyn,paladique/roslyn,physhi/roslyn,akrisiun/roslyn,sharwell/roslyn,VShangxiao/roslyn,rgani/roslyn,sharadagrawal/Roslyn,kuhlenh/roslyn,dovzhikova/roslyn,FICTURE7/roslyn,MattWindsor91/roslyn,CaptainHayashi/roslyn,Shiney/roslyn,DustinCampbell/roslyn,ahmedshuhel/roslyn,russpowers/roslyn,zmaruo/roslyn,brettfo/roslyn,CyrusNajmabadi/roslyn,yeaicc/roslyn,dovzhikova/roslyn,vslsnap/roslyn,pjmagee/roslyn,garryforreg/roslyn,nemec/roslyn,huoxudong125/roslyn,rgani/roslyn,budcribar/roslyn,pjmagee/roslyn,a-ctor/roslyn,rgani/roslyn,jramsay/roslyn,xoofx/roslyn,AnthonyDGreen/roslyn,rchande/roslyn,KevinH-MS/roslyn,jrharmon/roslyn,antonssonj/roslyn,kelltrick/roslyn,KevinRansom/roslyn,physhi/roslyn,Pvlerick/roslyn,antonssonj/roslyn,DanielRosenwasser/roslyn,agocke/roslyn,xoofx/roslyn,EricArndt/roslyn,orthoxerox/roslyn,jbhensley/roslyn,mirhagk/roslyn,jbhensley/roslyn,stephentoub/roslyn,VShangxiao/roslyn,mseamari/Stuff,AmadeusW/roslyn,Hosch250/roslyn,lisong521/roslyn,stjeong/roslyn,genlu/roslyn,khyperia/roslyn,michalhosala/roslyn,EricArndt/roslyn,balajikris/roslyn,enginekit/roslyn,poizan42/roslyn,ValentinRueda/roslyn,a-ctor/roslyn,VSadov/roslyn,oberxon/roslyn,mmitche/roslyn,bbarry/roslyn,drognanar/roslyn,natgla/roslyn,1234-/roslyn,kienct89/roslyn,DanielRosenwasser/roslyn,Giten2004/roslyn,AnthonyDGreen/roslyn,xoofx/roslyn,swaroop-sridhar/roslyn,jeremymeng/roslyn,thomaslevesque/roslyn,JakeGinnivan/roslyn,dpoeschl/roslyn,furesoft/roslyn,vcsjones/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,jeffanders/roslyn,mmitche/roslyn,danielcweber/roslyn,KirillOsenkov/roslyn,jmarolf/roslyn,aelij/roslyn,devharis/roslyn,shyamnamboodiripad/roslyn,genlu/roslyn,DustinCampbell/roslyn,Shiney/roslyn,mgoertz-msft/roslyn,VShangxiao/roslyn,VitalyTVA/roslyn,jramsay/roslyn,gafter/roslyn,lisong521/roslyn,mseamari/Stuff,basoundr/roslyn,cston/roslyn,KashishArora/Roslyn,hanu412/roslyn,Giten2004/roslyn,yjfxfjch/roslyn,GuilhermeSa/roslyn,OmarTawfik/roslyn,danielcweber/roslyn,ahmedshuhel/roslyn,YOTOV-LIMITED/roslyn,DinoV/roslyn,MavenRain/roslyn,stebet/roslyn,jrharmon/roslyn,vcsjones/roslyn,wvdd007/roslyn,hanu412/roslyn,natidea/roslyn,Felorati/roslyn,jgglg/roslyn,jbhensley/roslyn,jasonmalinowski/roslyn,KiloBravoLima/roslyn,sharadagrawal/TestProject2,tmeschter/roslyn,marksantos/roslyn,jeffanders/roslyn,jaredpar/roslyn,srivatsn/roslyn,jhendrixMSFT/roslyn,wschae/roslyn,agocke/roslyn,1234-/roslyn,paulvanbrenk/roslyn,BugraC/roslyn,leppie/roslyn,ManishJayaswal/roslyn,OmniSharp/roslyn,managed-commons/roslyn,hanu412/roslyn,garryforreg/roslyn,yetangye/roslyn,HellBrick/roslyn,ljw1004/roslyn,michalhosala/roslyn,balajikris/roslyn,chenxizhang/roslyn,EricArndt/roslyn,swaroop-sridhar/roslyn,jgglg/roslyn,JohnHamby/roslyn,zmaruo/roslyn,zooba/roslyn,VSadov/roslyn,KirillOsenkov/roslyn,diryboy/roslyn,Pvlerick/roslyn,yetangye/roslyn,jkotas/roslyn,jrharmon/roslyn,jgglg/roslyn,lorcanmooney/roslyn,moozzyk/roslyn,tvand7093/roslyn,stephentoub/roslyn,khellang/roslyn,cston/roslyn,dovzhikova/roslyn,droyad/roslyn,SeriaWei/roslyn,SeriaWei/roslyn,taylorjonl/roslyn,jasonmalinowski/roslyn,VPashkov/roslyn,AArnott/roslyn,mattwar/roslyn,REALTOBIZ/roslyn,budcribar/roslyn,RipCurrent/roslyn,KashishArora/Roslyn,mono/roslyn,jmarolf/roslyn,xasx/roslyn,poizan42/roslyn,CaptainHayashi/roslyn,wvdd007/roslyn,OmniSharp/roslyn,heejaechang/roslyn,huoxudong125/roslyn,weltkante/roslyn,marksantos/roslyn,eriawan/roslyn,budcribar/roslyn,sharadagrawal/TestProject2,Felorati/roslyn,Maxwe11/roslyn,jamesqo/roslyn,kelltrick/roslyn,v-codeel/roslyn,nemec/roslyn,DavidKarlas/roslyn,tang7526/roslyn,managed-commons/roslyn,kuhlenh/roslyn,genlu/roslyn,oocx/roslyn,kelltrick/roslyn,natidea/roslyn,AArnott/roslyn,droyad/roslyn,mono/roslyn,moozzyk/roslyn,Inverness/roslyn,huoxudong125/roslyn,oberxon/roslyn,tannergooding/roslyn,evilc0des/roslyn,OmarTawfik/roslyn,antiufo/roslyn,poizan42/roslyn,agocke/roslyn,aanshibudhiraja/Roslyn,shyamnamboodiripad/roslyn,antiufo/roslyn,ValentinRueda/roslyn,khellang/roslyn,jaredpar/roslyn,mattwar/roslyn,MatthieuMEZIL/roslyn,weltkante/roslyn,yjfxfjch/roslyn,tannergooding/roslyn,jeremymeng/roslyn,pdelvo/roslyn,v-codeel/roslyn,magicbing/roslyn,Pvlerick/roslyn,heejaechang/roslyn,ValentinRueda/roslyn,zooba/roslyn,magicbing/roslyn,1234-/roslyn,diryboy/roslyn,tang7526/roslyn,lorcanmooney/roslyn,xasx/roslyn,jcouv/roslyn,paulvanbrenk/roslyn,oocx/roslyn,dotnet/roslyn,rchande/roslyn,dpoeschl/roslyn,dpen2000/roslyn,sharadagrawal/Roslyn,lisong521/roslyn,robinsedlaczek/roslyn,managed-commons/roslyn,jonatassaraiva/roslyn,abock/roslyn,oocx/roslyn,devharis/roslyn,MattWindsor91/roslyn,sharadagrawal/TestProject2,grianggrai/roslyn,DavidKarlas/roslyn,mattscheffer/roslyn,kienct89/roslyn,AlekseyTs/roslyn,REALTOBIZ/roslyn,tvand7093/roslyn,Giten2004/roslyn,DinoV/roslyn,KirillOsenkov/roslyn,evilc0des/roslyn,ericfe-ms/roslyn,DinoV/roslyn,mavasani/roslyn,vslsnap/roslyn,jcouv/roslyn,mmitche/roslyn,ljw1004/roslyn,amcasey/roslyn,grianggrai/roslyn,supriyantomaftuh/roslyn,aanshibudhiraja/Roslyn,krishnarajbb/roslyn,ilyes14/roslyn,enginekit/roslyn,rchande/roslyn,oberxon/roslyn,KamalRathnayake/roslyn,jhendrixMSFT/roslyn,VitalyTVA/roslyn,nemec/roslyn,VitalyTVA/roslyn,MichalStrehovsky/roslyn,AArnott/roslyn,garryforreg/roslyn,jamesqo/roslyn,doconnell565/roslyn,tmeschter/roslyn,VSadov/roslyn,furesoft/roslyn,diryboy/roslyn,KashishArora/Roslyn,MavenRain/roslyn,yeaicc/roslyn,stjeong/roslyn,tannergooding/roslyn,gafter/roslyn,taylorjonl/roslyn,jmarolf/roslyn,AlexisArce/roslyn,jcouv/roslyn,Hosch250/roslyn,furesoft/roslyn,natgla/roslyn,CyrusNajmabadi/roslyn,dsplaisted/roslyn,doconnell565/roslyn,REALTOBIZ/roslyn,yjfxfjch/roslyn,brettfo/roslyn,balajikris/roslyn,VPashkov/roslyn,KevinH-MS/roslyn,BugraC/roslyn,OmarTawfik/roslyn,Giftednewt/roslyn,RipCurrent/roslyn,cybernet14/roslyn,orthoxerox/roslyn,reaction1989/roslyn,jasonmalinowski/roslyn,a-ctor/roslyn,physhi/roslyn,tmeschter/roslyn,ErikSchierboom/roslyn,brettfo/roslyn,wschae/roslyn,KiloBravoLima/roslyn,enginekit/roslyn,Inverness/roslyn,eriawan/roslyn,yetangye/roslyn,mgoertz-msft/roslyn,magicbing/roslyn,SeriaWei/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,nguerrera/roslyn,Hosch250/roslyn,KamalRathnayake/roslyn,russpowers/roslyn,AlekseyTs/roslyn,pjmagee/roslyn,wvdd007/roslyn,MihaMarkic/roslyn-prank,panopticoncentral/roslyn,nagyistoce/roslyn,KevinRansom/roslyn,aanshibudhiraja/Roslyn,shyamnamboodiripad/roslyn,bartdesmet/roslyn,zooba/roslyn,basoundr/roslyn,JakeGinnivan/roslyn,wschae/roslyn,jeremymeng/roslyn,HellBrick/roslyn,cybernet14/roslyn,lorcanmooney/roslyn,jonatassaraiva/roslyn,jhendrixMSFT/roslyn,pdelvo/roslyn,stephentoub/roslyn,mono/roslyn,amcasey/roslyn,krishnarajbb/roslyn,abock/roslyn,davkean/roslyn,robinsedlaczek/roslyn,MihaMarkic/roslyn-prank,cston/roslyn,drognanar/roslyn,bkoelman/roslyn,jaredpar/roslyn,jamesqo/roslyn,tmat/roslyn,HellBrick/roslyn,supriyantomaftuh/roslyn,KiloBravoLima/roslyn,RipCurrent/roslyn,GuilhermeSa/roslyn,mseamari/Stuff,leppie/roslyn,basoundr/roslyn,thomaslevesque/roslyn,antiufo/roslyn,tvand7093/roslyn,xasx/roslyn,DavidKarlas/roslyn,3F/roslyn,kuhlenh/roslyn,MihaMarkic/roslyn-prank,MattWindsor91/roslyn,droyad/roslyn,FICTURE7/roslyn,natidea/roslyn,krishnarajbb/roslyn,chenxizhang/roslyn,reaction1989/roslyn,pdelvo/roslyn,yetangye/roslyn,JohnHamby/roslyn,jroggeman/roslyn,mattwar/roslyn,tsdl2013/roslyn,moozzyk/roslyn,grianggrai/roslyn,MatthieuMEZIL/roslyn,YOTOV-LIMITED/roslyn,dpen2000/roslyn,orthoxerox/roslyn,MavenRain/roslyn,nguerrera/roslyn,akrisiun/roslyn,ljw1004/roslyn,yeaicc/roslyn,DanielRosenwasser/roslyn,Shiney/roslyn
|
Src/Compilers/Core/Source/Diagnostic/IMessageSerializable.cs
|
Src/Compilers/Core/Source/Diagnostic/IMessageSerializable.cs
|
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis
{
/// <summary>
/// Indicates that the implementing type can be serialized via <see cref="object.ToString"/>
/// for diagnostic message purposes.
/// </summary>
/// <remarks>
/// Not appropriate on types that require localization, since localization should
/// happen after serialization.
/// </remarks>
internal interface IMessageSerializable
{
}
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis
{
/// <summary>
/// Indicates that the implementing type can be serialized via <see cref="ToString"/>
/// for diagnostic message purposes.
/// </summary>
/// <remarks>
/// Not appropriate on types that require localization, since localization should
/// happen after serialization.
/// </remarks>
internal interface IMessageSerializable
{
}
}
|
mit
|
C#
|
eaf1e45cd3acaa8bf3d07a5461198ede2f21e598
|
Update version due to previous bugfix
|
Baltasarq/Colorado
|
Core/AppInfo.cs
|
Core/AppInfo.cs
|
namespace Colorado.Core {
public class AppInfo {
public const string Name = "Colorado";
public const string Version = "v1.0.2 20150831";
public const string Author = "baltasarq@gmail.com";
public const string Website = "http://baltasarq.info/dev/";
public const string Comments = "A simple tool to view&edit CSV files";
public const string License = @"
Copyright (c) 2015 dev::baltasarq (baltasarq@gmail.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 Colorado.Core {
public class AppInfo {
public const string Name = "Colorado";
public const string Version = "v1.0.1 20150831";
public const string Author = "baltasarq@gmail.com";
public const string Website = "http://baltasarq.info/dev/";
public const string Comments = "A simple tool to view&edit CSV files";
public const string License = @"
Copyright (c) 2015 dev::baltasarq (baltasarq@gmail.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.
";
}
}
|
mit
|
C#
|
dd2bbce3f9c42935b6e3d10faa88b62dd6fc46b9
|
Update MobSpawnControlScript.cs
|
fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,krille90/unitystation,fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,fomalsd/unitystation
|
UnityProject/Assets/Scripts/Gateway/MobSpawnControlScript.cs
|
UnityProject/Assets/Scripts/Gateway/MobSpawnControlScript.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
public class MobSpawnControlScript : NetworkBehaviour
{
public List<GameObject> MobSpawners;
public bool DetectViaMatrix;
private bool SpawnedMobs;
private float timeElapsedServer = 0;
private const float PlayerCheckTime = 1f;
[Server]
public void SpawnMobs()
{
if (SpawnedMobs) return;
SpawnedMobs = true;
foreach (GameObject Spawner in MobSpawners)
{
if (Spawner != null)
{
Spawner.GetComponent<MobSpawnScript>().SpawnMob();
}
}
}
protected virtual void UpdateMe()
{
if (isServer)
{
timeElapsedServer += Time.deltaTime;
if (timeElapsedServer > PlayerCheckTime && !SpawnedMobs)
{
DetectPlayer();
timeElapsedServer = 0;
}
}
}
private void OnEnable()
{
if (!DetectViaMatrix) return;
UpdateManager.Add(CallbackType.UPDATE, UpdateMe);
}
void OnDisable()
{
UpdateManager.Remove(CallbackType.UPDATE, UpdateMe);
}
[Server]
private void DetectPlayer()
{
if (PlayerList.Instance.GetPlayersOnMatrix(MatrixManager.Get(gameObject)).Count > 0)
{
SpawnMobs();
UpdateManager.Remove(CallbackType.UPDATE, UpdateMe);
return;
}
}
void OnDrawGizmosSelected()
{
var sprite = GetComponentInChildren<SpriteRenderer>();
if (sprite == null)
return;
//Highlighting all controlled lightSources
Gizmos.color = new Color(0.5f, 0.5f, 1, 1);
for (int i = 0; i < MobSpawners.Count; i++)
{
var mobSpawner = MobSpawners[i];
if (mobSpawner == null) continue;
Gizmos.DrawLine(sprite.transform.position, mobSpawner.transform.position);
Gizmos.DrawSphere(mobSpawner.transform.position, 0.25f);
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
public class MobSpawnControlScript : NetworkBehaviour
{
public List<GameObject> MobSpawners;
public bool DetectViaMatrix;
private bool SpawnedMobs;
private float timeElapsedServer = 0;
[Server]
public void SpawnMobs()
{
if (SpawnedMobs) return;
SpawnedMobs = true;
foreach (GameObject Spawner in MobSpawners)
{
if (Spawner != null)
{
Spawner.GetComponent<MobSpawnScript>().SpawnMob();
}
}
}
protected virtual void UpdateMe()
{
if (isServer)
{
timeElapsedServer += Time.deltaTime;
if (timeElapsedServer > 1f && !SpawnedMobs)
{
DetectPlayer();
timeElapsedServer = 0;
}
}
}
private void OnEnable()
{
if (!DetectViaMatrix) return;
UpdateManager.Add(CallbackType.UPDATE, UpdateMe);
}
void OnDisable()
{
UpdateManager.Remove(CallbackType.UPDATE, UpdateMe);
}
[Server]
private void DetectPlayer()
{
foreach (var player in PlayerList.Instance.InGamePlayers)
{
var playerScript = player.Script;
if (playerScript == null) return;
if (playerScript.registerTile.Matrix == gameObject.GetComponent<RegisterObject>().Matrix)
{
SpawnMobs();
UpdateManager.Remove(CallbackType.UPDATE, UpdateMe);
return;
}
}
}
void OnDrawGizmosSelected()
{
var sprite = GetComponentInChildren<SpriteRenderer>();
if (sprite == null)
return;
//Highlighting all controlled lightSources
Gizmos.color = new Color(0.5f, 0.5f, 1, 1);
for (int i = 0; i < MobSpawners.Count; i++)
{
var mobSpawner = MobSpawners[i];
if (mobSpawner == null) continue;
Gizmos.DrawLine(sprite.transform.position, mobSpawner.transform.position);
Gizmos.DrawSphere(mobSpawner.transform.position, 0.25f);
}
}
}
|
agpl-3.0
|
C#
|
15ed762e91f0b69dc6557914ea48572869938e49
|
Increase Version Number
|
BYteWareGmbH/XAF.ElasticSearch
|
BYteWare.XAF.ElasticSearch/Properties/AssemblyInfo.cs
|
BYteWare.XAF.ElasticSearch/Properties/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Resources;
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("BYteWare.XAF.ElasticSearch")]
[assembly: AssemblyDescription("BYteWare XAF Module")]
[assembly: AssemblyProduct("BYteWare.XAF.ElasticSearch")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("16.24.19")]
[assembly: AssemblyInformationalVersion("16.24.19.6")]
|
using System;
using System.Reflection;
using System.Resources;
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("BYteWare.XAF.ElasticSearch")]
[assembly: AssemblyDescription("BYteWare XAF Module")]
[assembly: AssemblyProduct("BYteWare.XAF.ElasticSearch")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("16.24.19")]
[assembly: AssemblyInformationalVersion("16.24.19.5")]
|
mpl-2.0
|
C#
|
f7581e42f3688388a77f0b5cad9ef9bbe8a6f4dc
|
Fix duplicated logs
|
martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode
|
tests/AdventOfCode.Tests/Api/HttpLambdaTestServer.cs
|
tests/AdventOfCode.Tests/Api/HttpLambdaTestServer.cs
|
// Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
using MartinCostello.Logging.XUnit;
using MartinCostello.Testing.AwsLambdaTestServer;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace MartinCostello.AdventOfCode.Api;
internal sealed class HttpLambdaTestServer : LambdaTestServer, IAsyncLifetime, ITestOutputHelperAccessor
{
private readonly CancellationTokenSource _cts = new();
private bool _disposed;
private IWebHost? _webHost;
public HttpLambdaTestServer()
: base()
{
}
public ITestOutputHelper? OutputHelper { get; set; }
public async Task DisposeAsync()
{
if (_webHost is not null)
{
await _webHost.StopAsync();
}
Dispose();
}
public async Task InitializeAsync()
=> await StartAsync(_cts.Token);
protected override IServer CreateServer(WebHostBuilder builder)
{
_webHost = builder
.UseKestrel()
.ConfigureServices((services) => services.AddLogging((builder) => builder.AddXUnit(this)))
.UseUrls("http://127.0.0.1:0")
.Build();
_webHost.Start();
return _webHost.Services.GetRequiredService<IServer>();
}
protected override void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
_webHost?.Dispose();
_cts.Cancel();
_cts.Dispose();
}
_disposed = true;
}
base.Dispose(disposing);
}
}
|
// Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
using MartinCostello.Logging.XUnit;
using MartinCostello.Testing.AwsLambdaTestServer;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace MartinCostello.AdventOfCode.Api;
internal sealed class HttpLambdaTestServer : LambdaTestServer, IAsyncLifetime, ITestOutputHelperAccessor
{
private readonly CancellationTokenSource _cts = new();
private bool _disposed;
private IWebHost? _webHost;
public HttpLambdaTestServer()
: base()
{
}
public ITestOutputHelper? OutputHelper { get; set; }
public async Task DisposeAsync()
{
if (_webHost is not null)
{
await _webHost.StopAsync();
}
Dispose();
}
public async Task InitializeAsync()
{
Options.Configure = (services) =>
services.AddLogging((builder) => builder.AddXUnit(this));
await StartAsync(_cts.Token);
}
protected override IServer CreateServer(WebHostBuilder builder)
{
_webHost = builder
.UseKestrel()
.ConfigureServices((services) => services.AddLogging((builder) => builder.AddXUnit(this)))
.UseUrls("http://127.0.0.1:0")
.Build();
_webHost.Start();
return _webHost.Services.GetRequiredService<IServer>();
}
protected override void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
_webHost?.Dispose();
_cts.Cancel();
_cts.Dispose();
}
_disposed = true;
}
base.Dispose(disposing);
}
}
|
apache-2.0
|
C#
|
31cfce5d3dca5071208367f9954fbf7ebe278dc9
|
Update HeaderUtilities.cs
|
hfurubotten/Heine.Mvc.ActionFilters
|
Heine.Mvc.ActionFilters/Extensions/HeaderUtilities.cs
|
Heine.Mvc.ActionFilters/Extensions/HeaderUtilities.cs
|
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Text;
namespace Heine.Mvc.ActionFilters.Extensions
{
public static class HeaderUtilities
{
public static ICollection<string> ObfuscatedHeaders { get; set; } = new List<string>
{
"Authorization"
};
public static ICollection<string> ExcludedHeaders { get; set; } = new List<string>();
internal static string DumpHeaders(params HttpHeaders[] headers)
{
var stringBuilder = new StringBuilder();
stringBuilder.Append("{\r\n");
foreach (var header in headers)
{
if (header != null)
{
foreach (var keyValuePair in header)
{
var headerKey = keyValuePair.Key;
if (ExcludedHeaders.Contains(headerKey)) continue;
foreach (var str in keyValuePair.Value)
{
var headerValue = str;
if (ObfuscatedHeaders.Contains(headerKey))
{
headerValue = new string('*', 10);
}
stringBuilder.Append(" ");
stringBuilder.Append(headerKey);
stringBuilder.Append(": ");
stringBuilder.Append(headerValue);
stringBuilder.Append("\r\n");
}
}
}
}
stringBuilder.Append('}');
return stringBuilder.ToString();
}
}
}
|
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Text;
namespace Heine.Mvc.ActionFilters.Extensions
{
public static class HeaderUtilities
{
public static ICollection<string> ObfuscatedHeaders { get; set; } = new List<string>
{
"Authorization"
};
public static ICollection<string> ExcludedHeaders { get; set; } = new List<string>();
internal static string DumpHeaders(params HttpHeaders[] headers)
{
var stringBuilder = new StringBuilder();
stringBuilder.Append("{\r\n");
foreach (var header in headers)
{
if (header != null)
{
foreach (var keyValuePair in header)
{
var headerKey = keyValuePair.Key;
if (ExcludedHeaders.Contains(headerKey)) continue;
foreach (var str in keyValuePair.Value)
{
var headerValue = str;
if (ObfuscatedHeaders.Contains(headerKey))
{
headerValue = new string('*', headerValue.Length);
}
stringBuilder.Append(" ");
stringBuilder.Append(headerKey);
stringBuilder.Append(": ");
stringBuilder.Append(headerValue);
stringBuilder.Append("\r\n");
}
}
}
}
stringBuilder.Append('}');
return stringBuilder.ToString();
}
}
}
|
mit
|
C#
|
c72922d57d0fa2f21d9fa477849ad34bd541bae9
|
Update AgreementTemplateExtensions.cs
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
src/SFA.DAS.EmployerAccounts.Web/Extensions/AgreementTemplateExtensions.cs
|
src/SFA.DAS.EmployerAccounts.Web/Extensions/AgreementTemplateExtensions.cs
|
using SFA.DAS.EmployerAccounts.Web.ViewModels;
using System.Collections.Generic;
using System.Linq;
namespace SFA.DAS.EmployerAccounts.Web.Extensions
{
public static class AgreementTemplateExtensions
{
public static readonly int[] VariationsOfv3Agreement = {3, 4, 5};
public static string InsetText(this AgreementTemplateViewModel agreementTemplate, ICollection<OrganisationAgreementViewModel> organisationAgreementViewModel)
{
switch (agreementTemplate.VersionNumber)
{
case 1:
return string.Empty;
case 2:
return "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).";
case 3:
return "This is a new agreement.";
case 4:
case 5:
return HasSignedVariationOfv3Agreement(organisationAgreementViewModel) ? "This is a variation to the agreement we published 9 January 2020. You only need to accept it if you want to access incentive payments for hiring a new apprentice." : "This is a new agreement.";
default:
return string.Empty;
}
}
private static bool HasSignedVariationOfv3Agreement(ICollection<OrganisationAgreementViewModel> organisationAgreementViewModel)
{
foreach (var organisation in organisationAgreementViewModel)
{
if (organisation.SignedDateText != string.Empty &&
VariationsOfv3Agreement.Contains(organisation.Template.VersionNumber))
{
return true;
}
}
return false;
}
}
}
|
using SFA.DAS.EmployerAccounts.Web.ViewModels;
using System.Collections.Generic;
namespace SFA.DAS.EmployerAccounts.Web.Extensions
{
public static class AgreementTemplateExtensions
{
public const int AgreementVersionV3 = 3;
public const int AgreementVersionV4 = 4;
public static string InsetText(this AgreementTemplateViewModel agreementTemplate, ICollection<OrganisationAgreementViewModel> organisationAgreementViewModel)
{
switch (agreementTemplate.VersionNumber)
{
case 1:
return string.Empty;
case 2:
return "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).";
case 3:
return "This is a new agreement.";
case 4:
case 5:
bool v3orv4Accepted = GetV3orV4AgreementStatus(organisationAgreementViewModel);
return v3orv4Accepted ? "This is a variation to the agreement we published 9 January 2020. You only need to accept it if you want to access incentive payments for hiring a new apprentice." : "This is a new agreement.";
default:
return string.Empty;
}
}
private static bool GetV3orV4AgreementStatus(ICollection<OrganisationAgreementViewModel> organisationAgreementViewModel)
{
bool v3Accepted = false;
foreach (var organisation in organisationAgreementViewModel)
{
if (organisation.SignedDateText != string.Empty &&
(organisation.Template.VersionNumber == AgreementVersionV3 ||
organisation.Template.VersionNumber == AgreementVersionV4))
{
v3Accepted = true;
}
}
return v3Accepted;
}
}
}
|
mit
|
C#
|
6ee7ae781f371420ec16fd62c971f22af3d53d7a
|
Use default credentials when getting feed items.
|
indsoft/NuGet2,rikoe/nuget,oliver-feng/nuget,chocolatey/nuget-chocolatey,mrward/nuget,oliver-feng/nuget,mrward/NuGet.V2,xoofx/NuGet,OneGet/nuget,rikoe/nuget,GearedToWar/NuGet2,pratikkagda/nuget,ctaggart/nuget,jholovacs/NuGet,xoofx/NuGet,zskullz/nuget,GearedToWar/NuGet2,jholovacs/NuGet,alluran/node.net,atheken/nuget,kumavis/NuGet,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,indsoft/NuGet2,akrisiun/NuGet,alluran/node.net,mrward/nuget,jmezach/NuGet2,antiufo/NuGet2,kumavis/NuGet,RichiCoder1/nuget-chocolatey,OneGet/nuget,jmezach/NuGet2,xoofx/NuGet,xero-github/Nuget,oliver-feng/nuget,jmezach/NuGet2,dolkensp/node.net,rikoe/nuget,mrward/nuget,zskullz/nuget,jholovacs/NuGet,mono/nuget,chocolatey/nuget-chocolatey,mrward/nuget,xoofx/NuGet,GearedToWar/NuGet2,chocolatey/nuget-chocolatey,antiufo/NuGet2,antiufo/NuGet2,xoofx/NuGet,RichiCoder1/nuget-chocolatey,alluran/node.net,mono/nuget,chocolatey/nuget-chocolatey,mrward/NuGet.V2,mono/nuget,OneGet/nuget,jholovacs/NuGet,jholovacs/NuGet,pratikkagda/nuget,mrward/NuGet.V2,pratikkagda/nuget,dolkensp/node.net,GearedToWar/NuGet2,mrward/NuGet.V2,RichiCoder1/nuget-chocolatey,alluran/node.net,chester89/nugetApi,chester89/nugetApi,RichiCoder1/nuget-chocolatey,anurse/NuGet,zskullz/nuget,pratikkagda/nuget,oliver-feng/nuget,oliver-feng/nuget,indsoft/NuGet2,indsoft/NuGet2,themotleyfool/NuGet,oliver-feng/nuget,ctaggart/nuget,jmezach/NuGet2,jholovacs/NuGet,akrisiun/NuGet,ctaggart/nuget,rikoe/nuget,indsoft/NuGet2,antiufo/NuGet2,ctaggart/nuget,mono/nuget,xoofx/NuGet,atheken/nuget,mrward/NuGet.V2,mrward/NuGet.V2,chocolatey/nuget-chocolatey,dolkensp/node.net,themotleyfool/NuGet,GearedToWar/NuGet2,jmezach/NuGet2,pratikkagda/nuget,OneGet/nuget,indsoft/NuGet2,pratikkagda/nuget,GearedToWar/NuGet2,zskullz/nuget,anurse/NuGet,RichiCoder1/nuget-chocolatey,antiufo/NuGet2,themotleyfool/NuGet,jmezach/NuGet2,mrward/nuget,antiufo/NuGet2,mrward/nuget,dolkensp/node.net
|
NuPack.Core/Repositories/AtomFeedPackageRepository.cs
|
NuPack.Core/Repositories/AtomFeedPackageRepository.cs
|
namespace NuPack {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.ServiceModel.Syndication;
using System.Xml;
using NuPack.Resources;
public class AtomFeedPackageRepository : PackageRepositoryBase {
private Uri _feedUri;
public AtomFeedPackageRepository(Uri feedUri) {
if (feedUri == null) {
throw new ArgumentNullException("feedUri");
}
_feedUri = feedUri;
}
public override IQueryable<IPackage> GetPackages() {
return (from item in GetFeedItems()
select new FeedPackage(item)).AsQueryable();
}
internal IEnumerable<PackageSyndicationItem> GetFeedItems() {
try {
// Manually create the request to the feed so we can
// set the default credentials
var request = WebRequest.Create(_feedUri);
request.UseDefaultCredentials = true;
WebResponse response = request.GetResponse();
using (var feedReader = XmlTextReader.Create(response.GetResponseStream())) {
return GetFeedItems(feedReader);
}
}
catch (WebException exception) {
throw new InvalidOperationException(NuPackResources.AtomFeedPackageRepo_InvalidFeedSource, exception);
}
}
internal static IEnumerable<PackageSyndicationItem> GetFeedItems(XmlReader xmlReader) {
try {
var feed = SyndicationFeed.Load<PackageSyndicationFeed>(xmlReader);
return from PackageSyndicationItem item in feed.Items
select item;
}
catch (XmlException exception) {
throw new InvalidOperationException(NuPackResources.AtomFeedPackageRepo_InvalidFeedContent, exception);
}
}
public override void AddPackage(IPackage package) {
throw new NotSupportedException();
}
public override void RemovePackage(IPackage package) {
throw new NotSupportedException();
}
}
}
|
namespace NuPack {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.ServiceModel.Syndication;
using System.Xml;
using NuPack.Resources;
public class AtomFeedPackageRepository : PackageRepositoryBase {
private Uri _feedUri;
public AtomFeedPackageRepository(Uri feedUri) {
if (feedUri == null) {
throw new ArgumentNullException("feedUri");
}
_feedUri = feedUri;
}
public override IQueryable<IPackage> GetPackages() {
return (from item in GetFeedItems()
select new FeedPackage(item)).AsQueryable();
}
internal IEnumerable<PackageSyndicationItem> GetFeedItems() {
try {
using (var feedReader = XmlTextReader.Create(_feedUri.OriginalString)) {
return GetFeedItems(feedReader);
}
}
catch (WebException exception) {
throw new InvalidOperationException(NuPackResources.AtomFeedPackageRepo_InvalidFeedSource, exception);
}
}
internal static IEnumerable<PackageSyndicationItem> GetFeedItems(XmlReader xmlReader) {
try {
var feed = SyndicationFeed.Load<PackageSyndicationFeed>(xmlReader);
return from PackageSyndicationItem item in feed.Items
select item;
}
catch (XmlException exception) {
throw new InvalidOperationException(NuPackResources.AtomFeedPackageRepo_InvalidFeedContent, exception);
}
}
public override void AddPackage(IPackage package) {
throw new NotSupportedException();
}
public override void RemovePackage(IPackage package) {
throw new NotSupportedException();
}
}
}
|
apache-2.0
|
C#
|
5e781873f239f5351324f95971586d83154b9d3c
|
remove required from SoundField
|
IUMDPI/IUMediaHelperApps
|
Packager/Models/PodMetadataModels/AudioPodMetadata.cs
|
Packager/Models/PodMetadataModels/AudioPodMetadata.cs
|
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Packager.Factories;
namespace Packager.Models.PodMetadataModels
{
public class AudioPodMetadata : AbstractPodMetadata
{
public string Brand { get; set; }
public string DirectionsRecorded { get; set; }
public string TrackConfiguration { get; set; }
public string SoundField { get; set; }
public string TapeThickness { get; set; }
public string TapeBase { get; set; }
public override void ImportFromXml(XElement element, IImportableFactory factory)
{
base.ImportFromXml(element, factory);
Brand = factory.ToStringValue(element,"data/tape_stock_brand");
DirectionsRecorded = factory.ToStringValue(element,"data/directions_recorded");
PlaybackSpeed = factory.ToStringValue(element, "data/playback_speed");
TrackConfiguration = factory.ToStringValue(element, "data/track_configuration");
SoundField = factory.ToStringValue(element, "data/sound_field");
TapeThickness = factory.ToStringValue(element,"data/tape_thickness");
TapeBase = factory.ToStringValue(element, "data/tape_base");
}
protected override List<AbstractDigitalFile> ImportFileProvenances(XElement element, string path,
IImportableFactory factory)
{
return factory.ToObjectList<DigitalAudioFile>(element, path)
.Cast<AbstractDigitalFile>().ToList();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Packager.Exceptions;
using Packager.Extensions;
using Packager.Factories;
using Packager.Validators.Attributes;
namespace Packager.Models.PodMetadataModels
{
public class AudioPodMetadata : AbstractPodMetadata
{
private const string LacquerDiscFormatIdentifier = "lacquer disc";
private const string OpenReelFormatIdentifier = "open reel audio tape";
public string Brand { get; set; }
public string DirectionsRecorded { get; set; }
//public string PlaybackSpeed { get; set; }
public string TrackConfiguration { get; set; }
[Required]
public string SoundField { get; set; }
public string TapeThickness { get; set; }
public string TapeBase { get; set; }
public override void ImportFromXml(XElement element, IImportableFactory factory)
{
base.ImportFromXml(element, factory);
Brand = factory.ToStringValue(element,"data/tape_stock_brand");
DirectionsRecorded = factory.ToStringValue(element,"data/directions_recorded");
PlaybackSpeed = factory.ToStringValue(element, "data/playback_speed");
TrackConfiguration = factory.ToStringValue(element, "data/track_configuration");
SoundField = factory.ToStringValue(element, "data/sound_field");
TapeThickness = factory.ToStringValue(element,"data/tape_thickness");
TapeBase = factory.ToStringValue(element, "data/tape_base");
}
protected override List<AbstractDigitalFile> ImportFileProvenances(XElement element, string path,
IImportableFactory factory)
{
return factory.ToObjectList<DigitalAudioFile>(element, path)
.Cast<AbstractDigitalFile>().ToList();
}
}
}
|
apache-2.0
|
C#
|
60ea1705d7d8e31eb1292e5bf785f818b9cbd0a2
|
Add printDiff in DisassemblyDiagnoserAttribute (#949)
|
alinasmirnova/BenchmarkDotNet,ig-sinicyn/BenchmarkDotNet,ig-sinicyn/BenchmarkDotNet,PerfDotNet/BenchmarkDotNet,ig-sinicyn/BenchmarkDotNet,adamsitnik/BenchmarkDotNet,adamsitnik/BenchmarkDotNet,PerfDotNet/BenchmarkDotNet,adamsitnik/BenchmarkDotNet,Ky7m/BenchmarkDotNet,Ky7m/BenchmarkDotNet,Ky7m/BenchmarkDotNet,alinasmirnova/BenchmarkDotNet,ig-sinicyn/BenchmarkDotNet,adamsitnik/BenchmarkDotNet,Ky7m/BenchmarkDotNet,PerfDotNet/BenchmarkDotNet,alinasmirnova/BenchmarkDotNet,alinasmirnova/BenchmarkDotNet
|
src/BenchmarkDotNet/Attributes/DisassemblyDiagnoserAttribute.cs
|
src/BenchmarkDotNet/Attributes/DisassemblyDiagnoserAttribute.cs
|
using System;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
namespace BenchmarkDotNet.Attributes
{
public class DisassemblyDiagnoserAttribute : Attribute, IConfigSource
{
/// <param name="printIL">IL will be printed. False by default.</param>
/// <param name="printAsm">ASM will be printed. True by default.</param>
/// <param name="printSource">C# source code will be printed. False by default.</param>
/// <param name="printPrologAndEpilog">ASM for prolog and epilog will be printed. False by default.</param>
/// <param name="recursiveDepth">Includes called methods to given level. 1 by default, indexed from 1. To print just benchmark set to 0</param>
/// <param name="printDiff">Diff will be printed. False by default.</param>
public DisassemblyDiagnoserAttribute(bool printAsm = true, bool printIL = false, bool printSource = false, bool printPrologAndEpilog = false, int recursiveDepth = 1, bool printDiff = false)
{
Config = ManualConfig.CreateEmpty().With(
DisassemblyDiagnoser.Create(
new DisassemblyDiagnoserConfig(printAsm, printIL, printSource, printPrologAndEpilog, recursiveDepth, printDiff)));
}
public IConfig Config { get; }
}
}
|
using System;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
namespace BenchmarkDotNet.Attributes
{
public class DisassemblyDiagnoserAttribute : Attribute, IConfigSource
{
/// <param name="printIL">IL will be printed. False by default.</param>
/// <param name="printAsm">ASM will be printed. True by default.</param>
/// <param name="printSource">C# source code will be printed. False by default.</param>
/// <param name="printPrologAndEpilog">ASM for prolog and epilog will be printed. False by default.</param>
/// <param name="recursiveDepth">Includes called methods to given level. 1 by default, indexed from 1. To print just benchmark set to 0</param>
public DisassemblyDiagnoserAttribute(bool printAsm = true, bool printIL = false, bool printSource = false, bool printPrologAndEpilog = false, int recursiveDepth = 1)
{
Config = ManualConfig.CreateEmpty().With(
DisassemblyDiagnoser.Create(
new DisassemblyDiagnoserConfig(printAsm, printIL, printSource, printPrologAndEpilog, recursiveDepth)));
}
public IConfig Config { get; }
}
}
|
mit
|
C#
|
91ff5bb1376ee112513b63bb6a374b992cc088f1
|
Change get method and add the new getter
|
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
|
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/IRepository.cs
|
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/IRepository.cs
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Data;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo
{
public interface IRepository<TEntity, TPk>
where TEntity : class, IEntity<TPk>
{
TEntity GetKey(TPk key, ISession session = null);
Task<TEntity> GetKeyAsync(TPk key, ISession session = null);
TEntity Get(TEntity entity, ISession session = null);
Task<TEntity> GetAsync(TEntity entity, ISession session = null)
IEnumerable<TEntity> GetAll(ISession session = null);
Task<IEnumerable<TEntity>> GetAllAsync(ISession session = null);
TPk SaveOrUpdate(TEntity entity, IUnitOfWork transaction);
Task<TPk> SaveOrUpdateAsync(TEntity entity, IUnitOfWork transaction);
}
}
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Data;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo
{
public interface IRepository<TEntity, TPk>
where TEntity : class, IEntity<TPk>
{
TEntity Get(TPk key, ISession session = null);
Task<TEntity> GetAsync(TPk key, ISession session = null);
IEnumerable<TEntity> GetAll(ISession session = null);
Task<IEnumerable<TEntity>> GetAllAsync(ISession session = null);
TPk SaveOrUpdate(TEntity entity, IUnitOfWork transaction);
Task<TPk> SaveOrUpdateAsync(TEntity entity, IUnitOfWork transaction);
}
}
|
mit
|
C#
|
86a190bce08547d9aabe111d7425929595806053
|
Update Shipping.cs
|
pagseguro/dotnet
|
source/Uol.PagSeguro/Domain/Shipping.cs
|
source/Uol.PagSeguro/Domain/Shipping.cs
|
// Copyright [2011] [PagSeguro Internet Ltda.]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace Uol.PagSeguro.Domain
{
/// <summary>
/// Shipping information
/// </summary>
public class Shipping
{
/// <summary>
/// Shipping address
/// </summary>
public Address Address { get; set; }
/// <summary>
/// Shipping type. See the ShippingType helper class for a list of known shipping
/// types.
/// </summary>
public int? ShippingType { get; set; }
/// <summary>
/// Total shipping cost. This is a read-only property and it is calculated by PagSeguro
/// based on the shipping information provided with the payment request.
/// </summary>
public decimal? Cost { get; set; }
/// <summary>
/// Initializes a new instance of the Shipping class
/// </summary>
// ReSharper disable once EmptyConstructor
}
}
|
// Copyright [2011] [PagSeguro Internet Ltda.]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace Uol.PagSeguro.Domain
{
/// <summary>
/// Shipping information
/// </summary>
public class Shipping
{
/// <summary>
/// Shipping address
/// </summary>
public Address Address { get; set; }
/// <summary>
/// Shipping type. See the ShippingType helper class for a list of known shipping
/// types.
/// </summary>
public int? ShippingType { get; set; }
/// <summary>
/// Total shipping cost. This is a read-only property and it is calculated by PagSeguro
/// based on the shipping information provided with the payment request.
/// </summary>
public decimal? Cost { get; set; }
/// <summary>
/// Initializes a new instance of the Shipping class
/// </summary>
// ReSharper disable once EmptyConstructor
public Shipping()
{
}
}
}
|
apache-2.0
|
C#
|
927f066cd7012abcaf56e0b7092dcd90fd545d7c
|
remove links for contact and about
|
jittuu/AzureLog,jittuu/AzureLog,jittuu/AzureLog
|
AzureLog.Web/Views/Shared/_Layout.cshtml
|
AzureLog.Web/Views/Shared/_Layout.cshtml
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - AzureLog</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("AzureLog", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
</ul>
@Html.Partial("_LoginPartial")
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - AzureLog</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("AzureLog", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
<li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
@Html.Partial("_LoginPartial")
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>
|
mit
|
C#
|
de42f3b31f19249802c594adf0f96b21b79f73ed
|
Fix issue #351. Resize Window event was not triggered when GameWindow.AllowUserResizing=true
|
tomba/Toolkit,sharpdx/Toolkit,sharpdx/Toolkit
|
Source/Toolkit/SharpDX.Toolkit.Game/GameWindowForm.cs
|
Source/Toolkit/SharpDX.Toolkit.Game/GameWindowForm.cs
|
// Copyright (c) 2010-2012 SharpDX - Alexandre Mutel
//
// 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.
#if !W8CORE
using System;
using System.Drawing;
using System.Windows.Forms;
using SharpDX.Windows;
namespace SharpDX.Toolkit
{
internal class GameWindowForm : RenderForm
{
private bool allowUserResizing;
public GameWindowForm() : this("SharpDX")
{
}
public GameWindowForm(string text)
: base(text)
{
// By default, non resizable
MaximizeBox = false;
FormBorderStyle = FormBorderStyle.FixedSingle;
}
internal bool AllowUserResizing
{
get
{
return allowUserResizing;
}
set
{
if (allowUserResizing != value)
{
allowUserResizing = value;
MaximizeBox = allowUserResizing;
FormBorderStyle = allowUserResizing ? FormBorderStyle.Sizable : FormBorderStyle.FixedSingle;
}
}
}
}
}
#endif
|
// Copyright (c) 2010-2012 SharpDX - Alexandre Mutel
//
// 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.
#if !W8CORE
using System.Windows.Forms;
using SharpDX.Windows;
namespace SharpDX.Toolkit
{
internal class GameWindowForm : RenderForm
{
private bool allowUserResizing;
private bool isFullScreenMaximized;
private bool isMouseVisible;
private bool isMouseCurrentlyHidden;
public GameWindowForm() : this("SharpDX")
{
}
public GameWindowForm(string text)
: base(text)
{
// By default, non resizable
MaximizeBox = false;
FormBorderStyle = FormBorderStyle.FixedSingle;
}
internal bool AllowUserResizing
{
get
{
return allowUserResizing;
}
set
{
if (allowUserResizing != value)
{
allowUserResizing = value;
MaximizeBox = allowUserResizing;
FormBorderStyle = allowUserResizing ? FormBorderStyle.Sizable : FormBorderStyle.FixedSingle;
}
}
}
}
}
#endif
|
mit
|
C#
|
86632a9d8ea57714dd1198982a0d078c1577a756
|
Fix typo.
|
modulexcite/DartVS,DartVS/DartVS,modulexcite/DartVS,DartVS/DartVS,modulexcite/DartVS,DartVS/DartVS
|
DanTup.DartAnalysis/Events/AnalysisErrorsEvent.cs
|
DanTup.DartAnalysis/Events/AnalysisErrorsEvent.cs
|
using System;
using System.Linq;
namespace DanTup.DartAnalysis
{
#region JSON deserialisation objects
class AnalysisErrorsEventJson
{
public string file = null;
public AnalysisErrorJson[] errors = null;
}
class AnalysisErrorJson
{
public string errorCode = null;
public string severity = null;
public string type = null;
public AnalysisLocationJson location = null;
public string message = null;
#region Equality checks
// Since we know these objects are serialisable, this is a quick-but-hacky way of checking for structural equality
public override bool Equals(object obj)
{
if (obj == null)
return false;
var serialiser = new JsonSerialiser();
return serialiser.Serialise(this).Equals(serialiser.Serialise(obj));
}
public override int GetHashCode()
{
var serialiser = new JsonSerialiser();
return serialiser.Serialise(this).GetHashCode();
}
#endregion
}
#endregion
public struct AnalysisErrorsNotification
{
public string File { get; internal set; }
public AnalysisError[] Errors { get; internal set; }
}
public struct AnalysisError
{
public string ErrorCode { get; internal set; }
public AnalysisErrorSeverity Severity { get; internal set; }
public AnalysisErrorType Type { get; internal set; }
public AnalysisLocation Location { get; internal set; }
public string Message { get; internal set; }
}
// TODO: Add all of these
public enum AnalysisErrorSeverity
{
None,
Info,
Warning,
Error
}
// TODO: Add all of these (inc. comments what they mean!)
public enum AnalysisErrorType
{
TODO,
Hint,
CompileTimeError,
PubSuggestion,
StaticWarning,
StaticTypeWarning,
SyntacticError,
Angular,
Polymer
}
internal static class AnalysisErrorsEventImplementation
{
static AnalysisErrorSeverity[] ErrorSeverities = Enum.GetValues(typeof(AnalysisErrorSeverity)).Cast<AnalysisErrorSeverity>().ToArray();
static AnalysisErrorType[] ErrorTypes = Enum.GetValues(typeof(AnalysisErrorType)).Cast<AnalysisErrorType>().ToArray();
public static AnalysisErrorsNotification AsNotification(this AnalysisErrorsEventJson notification)
{
return new AnalysisErrorsNotification
{
File = notification.file,
Errors = notification.errors.Select(e => new AnalysisError
{
ErrorCode = e.errorCode,
Severity = ErrorSeverities.FirstOrDefault(s => s.ToString().ToLowerInvariant() == e.severity.ToLowerInvariant().Replace("_", "")),
Type = ErrorTypes.FirstOrDefault(et => et.ToString().ToLowerInvariant() == e.type.ToLowerInvariant().Replace("_", "")),
Location = new AnalysisLocation
{
File = e.location.file,
Offset = e.location.offset,
Length = e.location.length,
StartLine = e.location.startLine,
StartColumn = e.location.startColumn,
},
Message = e.message,
}).ToArray(),
};
}
}
}
|
using System;
using System.Linq;
namespace DanTup.DartAnalysis
{
#region JSON deserialisation objects
class AnalysisErrorsEventJson
{
public string file = null;
public AnalysisErrorJson[] errors = null;
}
class AnalysisErrorJson
{
public string errorCode = null;
public string severity = null;
public string type = null;
public AnalysisLocationJson location = null;
public string message = null;
#region Equality checks
// Since we know these objects are serialisable, this is a quick-but-hacky way of checking for structural equality
public override bool Equals(object obj)
{
if (obj == null)
return false;
var serialiser = new JsonSerialiser();
return serialiser.Serialise(this).Equals(serialiser.Serialise(obj));
}
public override int GetHashCode()
{
var serialiser = new JsonSerialiser();
return serialiser.Serialise(this).GetHashCode();
}
#endregion
}
#endregion
public struct AnalysisErrorsNotification
{
public string File { get; internal set; }
public AnalysisError[] Errors { get; internal set; }
}
public struct AnalysisError
{
public string ErrorCode { get; internal set; }
public AnalysisErrorSeverity Severity { get; internal set; }
public AnalysisErrorType Type { get; internal set; }
public AnalysisLocation Location { get; internal set; }
public string Message { get; internal set; }
}
// TODO: Add all of these
public enum AnalysisErrorSeverity
{
None,
Info,
Warning,
Error
}
// TODO: Add all of these (inc. comments what they mean!)
public enum AnalysisErrorType
{
TODO,
Hint,
CompileTimeError,
PunSuggestion,
StaticWarning,
StaticTypeWarning,
SyntacticError,
Angular,
Polymer
}
internal static class AnalysisErrorsEventImplementation
{
static AnalysisErrorSeverity[] ErrorSeverities = Enum.GetValues(typeof(AnalysisErrorSeverity)).Cast<AnalysisErrorSeverity>().ToArray();
static AnalysisErrorType[] ErrorTypes = Enum.GetValues(typeof(AnalysisErrorType)).Cast<AnalysisErrorType>().ToArray();
public static AnalysisErrorsNotification AsNotification(this AnalysisErrorsEventJson notification)
{
return new AnalysisErrorsNotification
{
File = notification.file,
Errors = notification.errors.Select(e => new AnalysisError
{
ErrorCode = e.errorCode,
Severity = ErrorSeverities.FirstOrDefault(s => s.ToString().ToLowerInvariant() == e.severity.ToLowerInvariant().Replace("_", "")),
Type = ErrorTypes.FirstOrDefault(et => et.ToString().ToLowerInvariant() == e.type.ToLowerInvariant().Replace("_", "")),
Location = new AnalysisLocation
{
File = e.location.file,
Offset = e.location.offset,
Length = e.location.length,
StartLine = e.location.startLine,
StartColumn = e.location.startColumn,
},
Message = e.message,
}).ToArray(),
};
}
}
}
|
mit
|
C#
|
ccf599e545f2c9476a229c318ecefcf0e6b49895
|
Use enum for magic numbers in the BCRYPT_RSAKEY_BLOB struct
|
jmelosegui/pinvoke,AArnott/pinvoke,vbfox/pinvoke
|
src/BCrypt/BCrypt+BCRYPT_RSAKEY_BLOB.cs
|
src/BCrypt/BCrypt+BCRYPT_RSAKEY_BLOB.cs
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
/// <content>
/// Contains the <see cref="BCRYPT_RSAKEY_BLOB"/> nested type.
/// </content>
public partial class BCrypt
{
/// <summary>
/// A key blob format for transporting RSA keys.
/// </summary>
public struct BCRYPT_RSAKEY_BLOB
{
/// <summary>
/// Specifies the type of RSA key this BLOB represents.
/// </summary>
public MagicNumber Magic;
/// <summary>
/// The size, in bits, of the key.
/// </summary>
public uint BitLength;
/// <summary>
/// The size, in bytes, of the exponent of the key.
/// </summary>
public uint cbPublicExp;
/// <summary>
/// The size, in bytes, of the modulus of the key.
/// </summary>
public uint cbModulus;
/// <summary>
/// The size, in bytes, of the first prime number of the key. This is only used for private key BLOBs.
/// </summary>
public uint cbPrime1;
/// <summary>
/// The size, in bytes, of the second prime number of the key. This is only used for private key BLOBs.
/// </summary>
public uint cbPrime2;
/// <summary>
/// Enumerates the values that may be expected in the <see cref="Magic"/> field.
/// </summary>
public enum MagicNumber : uint
{
BCRYPT_RSAPUBLIC_MAGIC = 0x31415352, // RSA1
BCRYPT_RSAPRIVATE_MAGIC = 0x32415352, // RSA2
BCRYPT_RSAFULLPRIVATE_MAGIC = 0x33415352, // RSA3
}
}
}
}
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
/// <content>
/// Contains the <see cref="BCRYPT_RSAKEY_BLOB"/> nested type.
/// </content>
public partial class BCrypt
{
/// <summary>
/// A key blob format for transporting RSA keys.
/// </summary>
public struct BCRYPT_RSAKEY_BLOB
{
public const uint BCRYPT_RSAPUBLIC_MAGIC = 0x31415352; // RSA1
public const uint BCRYPT_RSAPRIVATE_MAGIC = 0x32415352; // RSA2
public const uint BCRYPT_RSAFULLPRIVATE_MAGIC = 0x33415352; // RSA3
/// <summary>
/// Specifies the type of RSA key this BLOB represents.
/// This can be one of the following values:
/// <see cref="BCRYPT_RSAPUBLIC_MAGIC"/>, <see cref="BCRYPT_RSAPRIVATE_MAGIC"/>, <see cref="BCRYPT_RSAFULLPRIVATE_MAGIC"/>.
/// </summary>
public uint Magic;
/// <summary>
/// The size, in bits, of the key.
/// </summary>
public uint BitLength;
/// <summary>
/// The size, in bytes, of the exponent of the key.
/// </summary>
public uint cbPublicExp;
/// <summary>
/// The size, in bytes, of the modulus of the key.
/// </summary>
public uint cbModulus;
/// <summary>
/// The size, in bytes, of the first prime number of the key. This is only used for private key BLOBs.
/// </summary>
public uint cbPrime1;
/// <summary>
/// The size, in bytes, of the second prime number of the key. This is only used for private key BLOBs.
/// </summary>
public uint cbPrime2;
}
}
}
|
mit
|
C#
|
869ef40b2c95b48707abec944497feb81d57bdd9
|
Remove use of <Nodes>.
|
JornWildt/Grapholizer,JornWildt/Grapholizer
|
Grapholizer.Core/Configuration/GraphDefinition.cs
|
Grapholizer.Core/Configuration/GraphDefinition.cs
|
using System.Xml.Serialization;
namespace Grapholizer.Core.Configuration
{
[XmlRoot("Graph", Namespace = Constants.Namespace)]
public class GraphDefinition
{
[XmlAttribute]
public string Title { get; set; }
[XmlElement("Node")]
public NodeDefinition[] Nodes { get; set; }
}
}
|
using System.Xml.Serialization;
namespace Grapholizer.Core.Configuration
{
[XmlRoot("Graph", Namespace = Constants.Namespace)]
public class GraphDefinition
{
[XmlAttribute]
public string Title { get; set; }
[XmlArray("Nodes")]
[XmlArrayItem("Node")]
public NodeDefinition[] Nodes { get; set; }
}
}
|
mit
|
C#
|
ee5c8e6c63551bf44dd87434834717a7b35897bf
|
重构rpc session
|
qifun/CSharpBcpRpc
|
RpcException.cs
|
RpcException.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rpc
{
public abstract class RpcException : Exception
{
public RpcException(string message, Exception cause) : base(message, cause)
{
}
}
public class IllegalRpcData : RpcException
{
public IllegalRpcData(string message = null, Exception cause = null)
: base(message, cause)
{
}
}
public class UnknowServiceName : RpcException
{
public UnknowServiceName(string message = null, Exception cause = null)
: base(message, cause)
{
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rpc
{
public abstract class RpcException : Exception
{
public RpcException(string message, Exception cause)
{
this.message = message;
this.cause = cause;
}
private string message = null;
private Exception cause = null;
new public string Message { get; set; }
public Exception Cause { get; set; }
}
public class IllegalRpcData : RpcException
{
public IllegalRpcData(string message = null, Exception cause = null)
: base(message, cause)
{
}
}
public class UnknowServiceName : RpcException
{
public UnknowServiceName(string message = null, Exception cause = null)
: base(message, cause)
{
}
}
}
|
apache-2.0
|
C#
|
cf2bd40567bce9bd301e5e4b6607a0a8e3f21274
|
fix DataReaderExtensions (not working with sqllite datatypes. these changes should better support all databases though.
|
AlonAmsalem/quartznet,sean-gilliam/quartznet,quartznet/quartznet,huoxudong125/quartznet,sean-gilliam/quartznet,xlgwr/quartznet,sean-gilliam/quartznet,sean-gilliam/quartznet,zhangjunhao/quartznet,RafalSladek/quartznet,andyshao/quartznet,AndreGleichner/quartznet,quartznet/quartznet,quartznet/quartznet,quartznet/quartznet,neuronesb/quartznet,quartznet/quartznet,sean-gilliam/quartznet
|
src/Quartz/Util/DataReaderExtensions.cs
|
src/Quartz/Util/DataReaderExtensions.cs
|
using System;
using System.Data;
using System.Globalization;
namespace Quartz.Util
{
public static class DataReaderExtensions
{
public static string GetString(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
if (columnValue == DBNull.Value)
{
return null;
}
return (string)columnValue;
}
public static int GetInt32(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
return Convert.ToInt32(columnValue, CultureInfo.InvariantCulture);
}
public static long GetInt64(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
return Convert.ToInt64(columnValue, CultureInfo.InvariantCulture);
}
public static decimal GetDecimal(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
return Convert.ToDecimal(columnValue,CultureInfo.InvariantCulture);
}
public static bool GetBoolean(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
// default to treat values as ints
if (columnValue != null)
{
return Convert.ToInt32(columnValue, CultureInfo.InvariantCulture) == 1;
}
throw new ArgumentException("Value must be non-null.");
}
}
}
|
using System;
using System.Data;
using System.Globalization;
namespace Quartz.Util
{
public static class DataReaderExtensions
{
public static string GetString(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
if (columnValue == DBNull.Value)
{
return null;
}
return (string) columnValue;
}
public static int GetInt32(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
return (int) columnValue;
}
public static long GetInt64(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
return (long) columnValue;
}
public static decimal GetDecimal(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
return (decimal) columnValue;
}
public static bool GetBoolean(this IDataReader reader, string columnName)
{
object columnValue = reader[columnName];
// default to treat values as ints
if (columnValue != null)
{
return Convert.ToInt32(columnValue, CultureInfo.InvariantCulture) == 1;
}
throw new ArgumentException("Value must be non-null.");
}
}
}
|
apache-2.0
|
C#
|
0051c89e79815da1eafeb913d7deb3fb10e1bd42
|
Move null check
|
rhynodegreat/CSharpGameLibrary,vazgriz/CSharpGameLibrary,rhynodegreat/CSharpGameLibrary,vazgriz/CSharpGameLibrary
|
CSGL.Vulkan/ShaderModule.cs
|
CSGL.Vulkan/ShaderModule.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using CSGL.Vulkan.Unmanaged;
namespace CSGL.Vulkan {
public class ShaderModuleCreateInfo {
public IList<byte> data;
}
public class ShaderModule : IDisposable, INative<VkShaderModule> {
VkShaderModule shaderModule;
bool disposed = false;
Device device;
vkCreateShaderModuleDelegate createShaderModule;
vkDestroyShaderModuleDelegate destroyShaderModule;
public VkShaderModule Native {
get {
return shaderModule;
}
}
public ShaderModule(Device device, ShaderModuleCreateInfo info) {
if (device == null) throw new ArgumentNullException(nameof(device));
if (info == null) throw new ArgumentNullException(nameof(info));
this.device = device;
createShaderModule = device.Commands.createShaderModule;
destroyShaderModule = device.Commands.destroyShaderModule;
CreateShader(info);
}
void CreateShader(ShaderModuleCreateInfo mInfo) {
if (mInfo.data == null) throw new ArgumentNullException(nameof(mInfo.data));
VkShaderModuleCreateInfo info = new VkShaderModuleCreateInfo();
info.sType = VkStructureType.ShaderModuleCreateInfo;
info.codeSize = (IntPtr)mInfo.data.Count;
var dataPinned = new NativeArray<byte>(mInfo.data);
info.pCode = dataPinned.Address;
using (dataPinned) {
var result = createShaderModule(device.Native, ref info, device.Instance.AllocationCallbacks, out shaderModule);
if (result != VkResult.Success) throw new ShaderModuleException(result, string.Format("Error creating shader module: {0}"));
}
}
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
void Dispose(bool disposing) {
if (disposed) return;
destroyShaderModule(device.Native, shaderModule, device.Instance.AllocationCallbacks);
disposed = true;
}
~ShaderModule() {
Dispose(false);
}
}
public class ShaderModuleException : VulkanException {
public ShaderModuleException(VkResult result, string message) : base(result, message) { }
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using CSGL.Vulkan.Unmanaged;
namespace CSGL.Vulkan {
public class ShaderModuleCreateInfo {
public IList<byte> data;
}
public class ShaderModule : IDisposable, INative<VkShaderModule> {
VkShaderModule shaderModule;
bool disposed = false;
Device device;
vkCreateShaderModuleDelegate createShaderModule;
vkDestroyShaderModuleDelegate destroyShaderModule;
public VkShaderModule Native {
get {
return shaderModule;
}
}
public ShaderModule(Device device, ShaderModuleCreateInfo info) {
if (device == null) throw new ArgumentNullException(nameof(device));
if (info == null) throw new ArgumentNullException(nameof(info));
if (info.data == null) throw new ArgumentNullException(nameof(info.data));
this.device = device;
createShaderModule = device.Commands.createShaderModule;
destroyShaderModule = device.Commands.destroyShaderModule;
CreateShader(info);
}
void CreateShader(ShaderModuleCreateInfo mInfo) {
VkShaderModuleCreateInfo info = new VkShaderModuleCreateInfo();
info.sType = VkStructureType.ShaderModuleCreateInfo;
info.codeSize = (IntPtr)mInfo.data.Count;
var dataPinned = new NativeArray<byte>(mInfo.data);
info.pCode = dataPinned.Address;
using (dataPinned) {
var result = createShaderModule(device.Native, ref info, device.Instance.AllocationCallbacks, out shaderModule);
if (result != VkResult.Success) throw new ShaderModuleException(result, string.Format("Error creating shader module: {0}"));
}
}
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
void Dispose(bool disposing) {
if (disposed) return;
destroyShaderModule(device.Native, shaderModule, device.Instance.AllocationCallbacks);
disposed = true;
}
~ShaderModule() {
Dispose(false);
}
}
public class ShaderModuleException : VulkanException {
public ShaderModuleException(VkResult result, string message) : base(result, message) { }
}
}
|
mit
|
C#
|
77e80c082c00114bdaac30e6be0879c040a9a946
|
Update HidingDisplayOfZeroValues.cs
|
maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET
|
Examples/CSharp/Articles/HidingDisplayOfZeroValues.cs
|
Examples/CSharp/Articles/HidingDisplayOfZeroValues.cs
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Articles
{
public class HidingDisplayOfZeroValues
{
public static void Main()
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Create a new Workbook object
Workbook workbook = new Workbook(dataDir+ "book1.xlsx");
//Get First worksheet of the workbook
Worksheet sheet = workbook.Worksheets[0];
//Hide the zero values in the sheet
sheet.DisplayZeros = false;
//Save the workbook
workbook.Save(dataDir+ "outputfile.out.xlsx");
//ExEnd:1
}
}
}
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Articles
{
public class HidingDisplayOfZeroValues
{
public static void Main()
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Create a new Workbook object
Workbook workbook = new Workbook(dataDir+ "book1.xlsx");
//Get First worksheet of the workbook
Worksheet sheet = workbook.Worksheets[0];
//Hide the zero values in the sheet
sheet.DisplayZeros = false;
//Save the workbook
workbook.Save(dataDir+ "outputfile.out.xlsx");
}
}
}
|
mit
|
C#
|
e3012b7c2941d6f28ac096e4011c78d0d9f89c5f
|
Revert "Exclude the first word"
|
BinaryTENSHi/mountain-thoughts
|
mountain-thoughts/Program.cs
|
mountain-thoughts/Program.cs
|
using System;
using System.Diagnostics;
namespace mountain_thoughts
{
public class Program
{
public static void Main(string[] args)
{
Process mountainProcess = NativeMethods.GetMountainProcess();
if (mountainProcess == null)
{
Console.WriteLine("Could not get process. Is Mountain running?");
Console.ReadLine();
Environment.Exit(1);
}
IntPtr handle = mountainProcess.Handle;
IntPtr address = NativeMethods.GetStringAddress(mountainProcess);
Twitter.Authenticate();
NativeMethods.StartReadingString(handle, address, Callback);
Console.ReadLine();
NativeMethods.StopReadingString();
}
private static void Callback(string thought)
{
string properThought = string.Empty;
foreach (string word in thought.Split(' '))
{
string lowerWord = word;
if (word != "I")
lowerWord = word.ToLowerInvariant();
properThought += lowerWord + " ";
}
properThought = properThought.Trim();
Console.WriteLine(properThought);
Twitter.Tweet(string.Format("\"{0}\"", properThought));
}
}
}
|
using System;
using System.Diagnostics;
using System.Linq;
namespace mountain_thoughts
{
public class Program
{
public static void Main(string[] args)
{
Process mountainProcess = NativeMethods.GetMountainProcess();
if (mountainProcess == null)
{
Console.WriteLine("Could not get process. Is Mountain running?");
Console.ReadLine();
Environment.Exit(1);
}
IntPtr handle = mountainProcess.Handle;
IntPtr address = NativeMethods.GetStringAddress(mountainProcess);
Twitter.Authenticate();
NativeMethods.StartReadingString(handle, address, Callback);
Console.ReadLine();
NativeMethods.StopReadingString();
}
private static void Callback(string thought)
{
string properThought = string.Empty;
foreach (string word in thought.Split(' ').Skip(1))
{
string lowerWord = word;
if (word != "I")
lowerWord = word.ToLowerInvariant();
properThought += lowerWord + " ";
}
properThought = properThought.Trim();
Console.WriteLine(properThought);
Twitter.Tweet(string.Format("\"{0}\"", properThought));
}
}
}
|
mit
|
C#
|
1c53cb63630e0889b2f0353bdd6d33630b5d1349
|
Upgrade version to 1.4.4
|
tangxuehua/ecommon,Aaron-Liu/ecommon
|
src/ECommon/Properties/AssemblyInfo.cs
|
src/ECommon/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ECommon")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ECommon")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b3edf459-8725-465e-a484-410b9a68df1f")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.4")]
[assembly: AssemblyFileVersion("1.4.4")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ECommon")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ECommon")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b3edf459-8725-465e-a484-410b9a68df1f")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.3")]
[assembly: AssemblyFileVersion("1.4.3")]
|
mit
|
C#
|
52594f8d221d19a54b75367aea614dc8df00c636
|
Fix to #88 - Add zero-padding (for Edge)
|
csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay
|
CSF.Screenplay.Web/Tasks/EnterTheDateIntoAnHtml5InputTypeDate.cs
|
CSF.Screenplay.Web/Tasks/EnterTheDateIntoAnHtml5InputTypeDate.cs
|
using System;
using System.Text.RegularExpressions;
using CSF.Screenplay.Actors;
using CSF.Screenplay.Performables;
using CSF.Screenplay.Web.Builders;
using CSF.Screenplay.Web.Models;
namespace CSF.Screenplay.Web.Tasks
{
/// <summary>
/// A task which manages the inputting of a date value into an HTML 5 <c><input type="date" /></c> element
/// as a locale-formatted string.
/// </summary>
public class EnterTheDateIntoAnHtml5InputTypeDate : Performable
{
const string
Numbers = @"\d+",
NonNumericCharacters = @"\D";
static readonly Regex
NumberMatcher = new Regex(Numbers, RegexOptions.Compiled),
NonNumericStripper = new Regex(NonNumericCharacters, RegexOptions.Compiled);
readonly DateTime date;
readonly ITarget target;
/// <summary>
/// Gets the report of the current instance, for the given actor.
/// </summary>
/// <returns>The human-readable report text.</returns>
/// <param name="actor">An actor for whom to write the report.</param>
protected override string GetReport(INamed actor)
=> $"{actor.Name} enters the date {date.ToString("yyyy-MM-dd")} into {target.GetName()} using the current locale's format";
/// <summary>
/// Performs this operation, as the given actor.
/// </summary>
/// <param name="actor">The actor performing this task.</param>
protected override void PerformAs(IPerformer actor)
{
var localeFormattedDate = actor.Perform(GetTheLocaleFormattedDate());
var keysToPress = GetTheKeysToPress(localeFormattedDate);
actor.Perform(Enter.TheText(keysToPress).Into(target));
}
IQuestion<string> GetTheLocaleFormattedDate()
=> new GetTheLocaleFormattedDate(date);
string GetTheKeysToPress(string formattedDate)
{
var zeroPaddedFormattedDate = GetZeroPaddedFormattedDate(formattedDate);
return NonNumericStripper.Replace(zeroPaddedFormattedDate, String.Empty);
}
string GetZeroPaddedFormattedDate(string formattedDate)
{
return NumberMatcher.Replace(formattedDate, match => {
if(match.Length > 1)
return match.Value;
return String.Concat("0", match.Value);
});
}
/// <summary>
/// Initializes a new instance of the <see cref="T:CSF.Screenplay.Web.Tasks.EnterTheDateIntoAnHtml5InputTypeDate"/> class.
/// </summary>
/// <param name="date">Date.</param>
/// <param name="target">Target.</param>
public EnterTheDateIntoAnHtml5InputTypeDate(DateTime date, ITarget target)
{
if(target == null)
throw new ArgumentNullException(nameof(target));
this.date = date;
this.target = target;
}
}
}
|
using System;
using System.Text.RegularExpressions;
using CSF.Screenplay.Actors;
using CSF.Screenplay.Performables;
using CSF.Screenplay.Web.Builders;
using CSF.Screenplay.Web.Models;
namespace CSF.Screenplay.Web.Tasks
{
/// <summary>
/// A task which manages the inputting of a date value into an HTML 5 <c><input type="date" /></c> element
/// as a locale-formatted string.
/// </summary>
public class EnterTheDateIntoAnHtml5InputTypeDate : Performable
{
const string NonNumericCharacters = @"\D";
static readonly Regex NonNumericStripper = new Regex(NonNumericCharacters, RegexOptions.Compiled);
readonly DateTime date;
readonly ITarget target;
/// <summary>
/// Gets the report of the current instance, for the given actor.
/// </summary>
/// <returns>The human-readable report text.</returns>
/// <param name="actor">An actor for whom to write the report.</param>
protected override string GetReport(INamed actor)
=> $"{actor.Name} enters the date {date.ToString("yyyy-MM-dd")} into {target.GetName()} using the current locale's format";
/// <summary>
/// Performs this operation, as the given actor.
/// </summary>
/// <param name="actor">The actor performing this task.</param>
protected override void PerformAs(IPerformer actor)
{
var localeFormattedDate = actor.Perform(GetTheLocaleFormattedDate());
var keysToPress = GetTheKeysToPress(localeFormattedDate);
actor.Perform(Enter.TheText(keysToPress).Into(target));
}
IQuestion<string> GetTheLocaleFormattedDate()
=> new GetTheLocaleFormattedDate(date);
string GetTheKeysToPress(string formattedDate) => NonNumericStripper.Replace(formattedDate, String.Empty);
/// <summary>
/// Initializes a new instance of the <see cref="T:CSF.Screenplay.Web.Tasks.EnterTheDateIntoAnHtml5InputTypeDate"/> class.
/// </summary>
/// <param name="date">Date.</param>
/// <param name="target">Target.</param>
public EnterTheDateIntoAnHtml5InputTypeDate(DateTime date, ITarget target)
{
if(target == null)
throw new ArgumentNullException(nameof(target));
this.date = date;
this.target = target;
}
}
}
|
mit
|
C#
|
d23bb93919057a9bffe96582214aa7e8797a04c6
|
Increment version to 2.0.1
|
rmwatson5/Unicorn,GuitarRich/Unicorn,PetersonDave/Unicorn,PetersonDave/Unicorn,kamsar/Unicorn,rmwatson5/Unicorn,MacDennis76/Unicorn,bllue78/Unicorn,bllue78/Unicorn,GuitarRich/Unicorn,kamsar/Unicorn,MacDennis76/Unicorn
|
src/Unicorn/Properties/AssemblyInfo.cs
|
src/Unicorn/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Unicorn")]
[assembly: AssemblyDescription("Sitecore serialization helper framework")]
// 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("c7d93d67-1319-4d3c-b2f8-f74fdff6fb07")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: AssemblyInformationalVersion("2.0.1")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Unicorn")]
[assembly: AssemblyDescription("Sitecore serialization helper framework")]
// 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("c7d93d67-1319-4d3c-b2f8-f74fdff6fb07")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
|
mit
|
C#
|
b58e65061199ed1df8d4315daadda6636dd712a5
|
Fix namespace
|
NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework
|
NakedLegacy/NakedLegacy.Rest.Test.Data/AppLib/LegacyAttribute.cs
|
NakedLegacy/NakedLegacy.Rest.Test.Data/AppLib/LegacyAttribute.cs
|
using System;
using NakedLegacy;
namespace NakedLegacy.Rest.Test.Data.AppLib;
public class LegacyAttribute : Attribute, IMemberOrderAttribute, IMaxLengthAttribute {
public int Order { get; set; }
public int MaxLength { get; set; }
}
|
using System;
using NakedLegacy.Types.Attributes;
namespace NakedLegacy.Rest.Test.Data.AppLib;
public class LegacyAttribute : Attribute, IMemberOrderAttribute, IMaxLengthAttribute {
public int Order { get; set; }
public int MaxLength { get; set; }
}
|
apache-2.0
|
C#
|
5d2520f892e6357e1a15ecacddaae1f74d5d057e
|
Add static dependency bindings.
|
RockFramework/Rock.Messaging,peteraritchie/Rock.Messaging,bfriesen/Rock.Messaging
|
Rock.Messaging/Rock.StaticDependencyInjection/CompositionRoot.cs
|
Rock.Messaging/Rock.StaticDependencyInjection/CompositionRoot.cs
|
using System.Configuration;
using Rock.Messaging.Defaults.Implementation;
using Rock.Messaging.NamedPipes;
using Rock.Messaging.Routing;
namespace Rock.Messaging.Rock.StaticDependencyInjection
{
internal partial class CompositionRoot : CompositionRootBase
{
public override void Bootstrap()
{
ImportFirst<IMessageParser>(x => Default.SetMessageParser(() => x));
ImportFirst<IMessagingScenarioFactory>(x => Default.SetMessagingScenarioFactory(() => x));
ImportFirst<INamedPipeConfigProvider>(x => Default.SetNamedPipeConfigProvider(() => x));
ImportFirst<ITypeLocator>(x => Default.SetTypeLocator(() => x));
}
/// <summary>
/// Gets a value indicating whether static dependency injection is enabled.
/// </summary>
public override bool IsEnabled
{
get
{
const string key = "Rock.StaticDependencyInjection.Enabled";
var enabledValue = ConfigurationManager.AppSettings.Get(key) ?? "true";
return enabledValue.ToLower() != "false";
}
}
}
}
|
using System.Configuration;
using Rock.Messaging.Defaults.Implementation;
using Rock.Messaging.Routing;
namespace Rock.Messaging.Rock.StaticDependencyInjection
{
internal partial class CompositionRoot : CompositionRootBase
{
public override void Bootstrap()
{
ImportFirst<IMessageParser>(x => Default.SetMessageParser(() => x));
ImportFirst<ITypeLocator>(x => Default.SetTypeLocator(() => x));
}
/// <summary>
/// Gets a value indicating whether static dependency injection is enabled.
/// </summary>
public override bool IsEnabled
{
get
{
const string key = "Rock.StaticDependencyInjection.Enabled";
var enabledValue = ConfigurationManager.AppSettings.Get(key) ?? "true";
return enabledValue.ToLower() != "false";
}
}
}
}
|
mit
|
C#
|
3f02fc82db7d494a848b6d434845eef555cbd594
|
Move part of comment above
|
smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework
|
osu.Framework/Audio/BassRelativeFrequencyHandler.cs
|
osu.Framework/Audio/BassRelativeFrequencyHandler.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using ManagedBass;
namespace osu.Framework.Audio
{
/// <summary>
/// A helper class for translating relative frequency values to absolute hertz values based on the initial channel frequency.
/// Also handles zero frequency value by requesting the component to pause the channel and maintain that until it's set back from zero.
/// </summary>
internal class BassRelativeFrequencyHandler
{
private int channel;
private float initialFrequency;
public Action RequestZeroFrequencyPause;
public Action RequestZeroFrequencyResume;
public bool ZeroFrequencyPauseRequested { get; private set; }
public void SetChannel(int c)
{
channel = c;
ZeroFrequencyPauseRequested = false;
Bass.ChannelGetAttribute(channel, ChannelAttribute.Frequency, out initialFrequency);
}
public void UpdateChannelFrequency(double relativeFrequency)
{
// http://bass.radio42.com/help/html/ff7623f0-6e9f-6be8-c8a7-17d3a6dc6d51.htm (BASS_ATTRIB_FREQ's description)
// Above documentation shows the frequency limits which the constants (min_bass_freq, max_bass_freq) came from.
const int min_bass_freq = 100;
const int max_bass_freq = 100000;
int channelFrequency = (int)Math.Clamp(Math.Abs(initialFrequency * relativeFrequency), min_bass_freq, max_bass_freq);
Bass.ChannelSetAttribute(channel, ChannelAttribute.Frequency, channelFrequency);
// Maintain internal pause on zero frequency due to BASS not supporting them (0 is took for original rate in BASS API)
if (!ZeroFrequencyPauseRequested && relativeFrequency == 0)
{
RequestZeroFrequencyPause?.Invoke();
ZeroFrequencyPauseRequested = true;
}
else if (ZeroFrequencyPauseRequested && relativeFrequency > 0)
{
ZeroFrequencyPauseRequested = false;
RequestZeroFrequencyResume?.Invoke();
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using ManagedBass;
namespace osu.Framework.Audio
{
/// <summary>
/// A helper class for translating relative frequency values to absolute hertz values based on the initial channel frequency.
/// Also handles zero frequency value by requesting the component to pause the channel and maintain that until it's set back from zero.
/// </summary>
internal class BassRelativeFrequencyHandler
{
private int channel;
private float initialFrequency;
public Action RequestZeroFrequencyPause;
public Action RequestZeroFrequencyResume;
public bool ZeroFrequencyPauseRequested { get; private set; }
public void SetChannel(int c)
{
channel = c;
ZeroFrequencyPauseRequested = false;
Bass.ChannelGetAttribute(channel, ChannelAttribute.Frequency, out initialFrequency);
}
public void UpdateChannelFrequency(double relativeFrequency)
{
// http://bass.radio42.com/help/html/ff7623f0-6e9f-6be8-c8a7-17d3a6dc6d51.htm (BASS_ATTRIB_FREQ's description)
const int min_bass_freq = 100;
const int max_bass_freq = 100000;
int channelFrequency = (int)Math.Clamp(Math.Abs(initialFrequency * relativeFrequency), min_bass_freq, max_bass_freq);
Bass.ChannelSetAttribute(channel, ChannelAttribute.Frequency, channelFrequency);
// Maintain internal pause on zero frequency due to BASS not supporting them (0 is took for original rate in BASS API)
// Above documentation shows the frequency limits which the constants (min_bass_freq, max_bass_freq) came from.
if (!ZeroFrequencyPauseRequested && relativeFrequency == 0)
{
RequestZeroFrequencyPause?.Invoke();
ZeroFrequencyPauseRequested = true;
}
else if (ZeroFrequencyPauseRequested && relativeFrequency > 0)
{
ZeroFrequencyPauseRequested = false;
RequestZeroFrequencyResume?.Invoke();
}
}
}
}
|
mit
|
C#
|
f8ca631be2746c181d6d261540a108ff7957036f
|
Remove use of protocol-relative URIs - #4563
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
samples/MvcSandbox/Views/Shared/_Layout.cshtml
|
samples/MvcSandbox/Views/Shared/_Layout.cshtml
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - MvcSandbox</title>
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/css/bootstrap.min.css" />
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-controller="Home" asp-action="Index" class="navbar-brand">MvcSandbox</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-controller="Home" asp-action="Index">Home</a></li>
</ul>
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© 2015 - MvcSandbox</p>
</footer>
</div>
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/bootstrap.min.js"></script>
@RenderSection("scripts", required: false)
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - MvcSandbox</title>
<link rel="stylesheet" href="//ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/css/bootstrap.min.css" />
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-controller="Home" asp-action="Index" class="navbar-brand">MvcSandbox</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-controller="Home" asp-action="Index">Home</a></li>
</ul>
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© 2015 - MvcSandbox</p>
</footer>
</div>
<script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/bootstrap.min.js"></script>
@RenderSection("scripts", required: false)
</body>
</html>
|
apache-2.0
|
C#
|
e42abc1c0aaa3320a65516ffc60af6c4598b354c
|
Update assembly version.
|
AlternativePayments/ap-net-sdk
|
src/AlternativePayments/Properties/AssemblyInfo.cs
|
src/AlternativePayments/Properties/AssemblyInfo.cs
|
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("Alternative Payments .Net SDK")]
[assembly: AssemblyDescription("UAB Alternative Payments .Net SDK")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("UAB Alternative Payments")]
[assembly: AssemblyProduct("AlternativePayments")]
[assembly: AssemblyCopyright("© 1999 - 2018 UAB Alternative Payments.All rights reserved.")]
[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("71bb1e46-df28-405b-86f9-94460db259b5")]
// 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.1.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
|
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("Alternative Payments .Net SDK")]
[assembly: AssemblyDescription("UAB Alternative Payments .Net SDK")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("UAB Alternative Payments")]
[assembly: AssemblyProduct("AlternativePayments")]
[assembly: AssemblyCopyright("© 1999 - 2018 UAB Alternative Payments.All rights reserved.")]
[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("71bb1e46-df28-405b-86f9-94460db259b5")]
// 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.4")]
[assembly: AssemblyFileVersion("1.0.4.0")]
|
mit
|
C#
|
2ce02f2532b7e7142091ae1f848607e4ad0d42f3
|
Update MainWindow.xaml.cs
|
reflection-emit/Cauldron,Virusface/Cauldron,Capgemini/Cauldron
|
Samples/Win32_WPF_ParameterPassing/MainWindow.xaml.cs
|
Samples/Win32_WPF_ParameterPassing/MainWindow.xaml.cs
|
using Cauldron.Core.Reflection;
using Cauldron;
using System.Diagnostics;
using System.Windows;
namespace Win32_WPF_ParameterPassing
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// This is only meant for Lazy people
// So that they don't have to open the console separately
// This has nothing to do with the sample implementation
var process = Process.Start(new ProcessStartInfo
{
FileName = "cmd",
WorkingDirectory = ApplicationInfo.ApplicationPath.FullName
});
this.Unloaded += (s, e) => process.Kill();
// This is the only relevant line here.
// This can be also added via Behaviour / Action
// As long as the Window is loaded and a Window handle exists,
// then everything is fine.
this.Loaded += (s, e) => this.AddHookParameterPassing();
}
}
}
|
using Cauldron.Core.Reflection;
using Cauldron;
using System.Diagnostics;
using System.Windows;
namespace Win32_WPF_ParameterPassing
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// This is only meant for Lazy people
// So that they don't have to open the console separately
var process = Process.Start(new ProcessStartInfo
{
FileName = "cmd",
WorkingDirectory = ApplicationInfo.ApplicationPath.FullName
});
this.Unloaded += (s, e) => process.Kill();
// This is the only relevant line here.
// This can be also added via Behaviour / Action
// As long as the Window is loaded and a Window handle exists,
// then everything is fine.
this.Loaded += (s, e) => this.AddHookParameterPassing();
}
}
}
|
mit
|
C#
|
a3ceb2e55567a73c8b6f8139c968f01f230e474a
|
Update FileSettingsServiceOptions.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Settings/FileSettingsServiceOptions.cs
|
TIKSN.Core/Settings/FileSettingsServiceOptions.cs
|
namespace TIKSN.Settings
{
public class FileSettingsServiceOptions
{
public string RelativePath { get; set; }
}
}
|
namespace TIKSN.Settings
{
public class FileSettingsServiceOptions
{
public string RelativePath { get; set; }
}
}
|
mit
|
C#
|
f5f16e979dee08ab805d7a7daee0c820a6d3d15a
|
Fix not to use expression-bodied constructors (cont.)
|
y-iihoshi/ThScoreFileConverter,y-iihoshi/ThScoreFileConverter
|
ThScoreFileConverter/Models/Th165/AllScoreData.cs
|
ThScoreFileConverter/Models/Th165/AllScoreData.cs
|
//-----------------------------------------------------------------------
// <copyright file="AllScoreData.cs" company="None">
// Copyright (c) IIHOSHI Yoshinori.
// Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information.
// </copyright>
//-----------------------------------------------------------------------
#pragma warning disable SA1600 // Elements should be documented
using System.Collections.Generic;
namespace ThScoreFileConverter.Models.Th165
{
internal class AllScoreData
{
private readonly List<IScore> scores;
public AllScoreData()
{
this.scores = new List<IScore>(Definitions.SpellCards.Count);
}
public Th095.HeaderBase Header { get; private set; }
public IReadOnlyList<IScore> Scores => this.scores;
public IStatus Status { get; private set; }
public void Set(Th095.HeaderBase header) => this.Header = header;
public void Set(IScore score) => this.scores.Add(score);
public void Set(IStatus status) => this.Status = status;
}
}
|
//-----------------------------------------------------------------------
// <copyright file="AllScoreData.cs" company="None">
// Copyright (c) IIHOSHI Yoshinori.
// Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information.
// </copyright>
//-----------------------------------------------------------------------
#pragma warning disable SA1600 // Elements should be documented
using System.Collections.Generic;
namespace ThScoreFileConverter.Models.Th165
{
internal class AllScoreData
{
private readonly List<IScore> scores;
public AllScoreData() => this.scores = new List<IScore>(Definitions.SpellCards.Count);
public Th095.HeaderBase Header { get; private set; }
public IReadOnlyList<IScore> Scores => this.scores;
public IStatus Status { get; private set; }
public void Set(Th095.HeaderBase header) => this.Header = header;
public void Set(IScore score) => this.scores.Add(score);
public void Set(IStatus status) => this.Status = status;
}
}
|
bsd-2-clause
|
C#
|
8bd91a52b72f0b3c1dd6e7798e5f47896199eb48
|
Update AssemblyInfo.cs
|
HangfireIO/Hangfire.Ninject,andyshao/Hangfire.Ninject
|
HangFire.Ninject/Properties/AssemblyInfo.cs
|
HangFire.Ninject/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HangFire.Ninject")]
[assembly: AssemblyDescription("Ninject IoC Container support for HangFire (background job system for ASP.NET applications).")]
[assembly: AssemblyProduct("HangFire")]
[assembly: AssemblyCopyright("Copyright © 2014 Sergey Odinokov")]
// 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("91f25a4e-65e7-4d9c-886e-33a6c82b14c4")]
[assembly: AssemblyVersion("0.1.2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HangFire.Ninject")]
[assembly: AssemblyDescription("Ninject IoC Container support for HangFire (background job system for ASP.NET applications).")]
[assembly: AssemblyProduct("HangFire")]
[assembly: AssemblyCopyright("Copyright © 2014 Sergey Odinokov")]
// 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("91f25a4e-65e7-4d9c-886e-33a6c82b14c4")]
[assembly: AssemblyVersion("0.1.1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
d389523a976d77cc15f835bb8306081e34d5d250
|
Update size to long
|
mfilippov/vimeo-dot-net
|
src/VimeoDotNet/Models/TusResumableUploadTicket.cs
|
src/VimeoDotNet/Models/TusResumableUploadTicket.cs
|
using System.Collections.Generic;
using JetBrains.Annotations;
using Newtonsoft.Json;
namespace VimeoDotNet.Models
{
/// <summary>
/// Upload ticket
/// </summary>
public class TusResumableUploadTicket : Video
{
/// <summary>
/// Upload status
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "upload")]
public ResumableUploadStatus Upload { get; set; }
}
public class ResumableUploadStatus
{
/// <summary>
/// Upload Approach
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "approach")]
public string Approach { get; set; }
/// <summary>
/// Upload Status
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "status")]
public string Status { get; set; }
/// <summary>
/// Upload link
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "upload_link")]
public string UploadLink { get; set; }
/// <summary>
/// Video Size in bytes
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "size")]
public long Size { get; set; }
}
}
|
using System.Collections.Generic;
using JetBrains.Annotations;
using Newtonsoft.Json;
namespace VimeoDotNet.Models
{
/// <summary>
/// Upload ticket
/// </summary>
public class TusResumableUploadTicket : Video
{
/// <summary>
/// Upload status
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "upload")]
public ResumableUploadStatus Upload { get; set; }
}
public class ResumableUploadStatus
{
/// <summary>
/// Upload Approach
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "approach")]
public string Approach { get; set; }
/// <summary>
/// Upload Status
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "status")]
public string Status { get; set; }
/// <summary>
/// Upload link
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "upload_link")]
public string UploadLink { get; set; }
/// <summary>
/// Video Size
/// </summary>
[PublicAPI]
[JsonProperty(PropertyName = "size")]
public int Size { get; set; }
}
}
|
mit
|
C#
|
01308769705362ac99ddee02d720cb2575a2ea5a
|
Set limits in MerkleBlockPayload (3x) (#1377)
|
AntShares/AntShares
|
src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs
|
src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs
|
using Neo.Cryptography;
using Neo.IO;
using System.Collections;
using System.IO;
using System.Linq;
namespace Neo.Network.P2P.Payloads
{
public class MerkleBlockPayload : BlockBase
{
public int ContentCount;
public UInt256[] Hashes;
public byte[] Flags;
public override int Size => base.Size + sizeof(int) + Hashes.GetVarSize() + Flags.GetVarSize();
public static MerkleBlockPayload Create(Block block, BitArray flags)
{
MerkleTree tree = new MerkleTree(block.Transactions.Select(p => p.Hash).Prepend(block.ConsensusData.Hash).ToArray());
byte[] buffer = new byte[(flags.Length + 7) / 8];
flags.CopyTo(buffer, 0);
return new MerkleBlockPayload
{
Version = block.Version,
PrevHash = block.PrevHash,
MerkleRoot = block.MerkleRoot,
Timestamp = block.Timestamp,
Index = block.Index,
NextConsensus = block.NextConsensus,
Witness = block.Witness,
ContentCount = block.Transactions.Length + 1,
Hashes = tree.ToHashArray(),
Flags = buffer
};
}
public override void Deserialize(BinaryReader reader)
{
base.Deserialize(reader);
ContentCount = (int)reader.ReadVarInt(Block.MaxTransactionsPerBlock + 1);
Hashes = reader.ReadSerializableArray<UInt256>(ContentCount);
Flags = reader.ReadVarBytes((ContentCount + 7) / 8);
}
public override void Serialize(BinaryWriter writer)
{
base.Serialize(writer);
writer.WriteVarInt(ContentCount);
writer.Write(Hashes);
writer.WriteVarBytes(Flags);
}
}
}
|
using Neo.Cryptography;
using Neo.IO;
using System.Collections;
using System.IO;
using System.Linq;
namespace Neo.Network.P2P.Payloads
{
public class MerkleBlockPayload : BlockBase
{
public int ContentCount;
public UInt256[] Hashes;
public byte[] Flags;
public override int Size => base.Size + sizeof(int) + Hashes.GetVarSize() + Flags.GetVarSize();
public static MerkleBlockPayload Create(Block block, BitArray flags)
{
MerkleTree tree = new MerkleTree(block.Transactions.Select(p => p.Hash).Prepend(block.ConsensusData.Hash).ToArray());
byte[] buffer = new byte[(flags.Length + 7) / 8];
flags.CopyTo(buffer, 0);
return new MerkleBlockPayload
{
Version = block.Version,
PrevHash = block.PrevHash,
MerkleRoot = block.MerkleRoot,
Timestamp = block.Timestamp,
Index = block.Index,
NextConsensus = block.NextConsensus,
Witness = block.Witness,
ContentCount = block.Transactions.Length + 1,
Hashes = tree.ToHashArray(),
Flags = buffer
};
}
public override void Deserialize(BinaryReader reader)
{
base.Deserialize(reader);
ContentCount = (int)reader.ReadVarInt(int.MaxValue);
Hashes = reader.ReadSerializableArray<UInt256>();
Flags = reader.ReadVarBytes();
}
public override void Serialize(BinaryWriter writer)
{
base.Serialize(writer);
writer.WriteVarInt(ContentCount);
writer.Write(Hashes);
writer.WriteVarBytes(Flags);
}
}
}
|
mit
|
C#
|
e0ece098e332031286bd2532b0f5e490b02048de
|
Fix warnings
|
msbahrul/EventStore,ianbattersby/EventStore,msbahrul/EventStore,ianbattersby/EventStore,msbahrul/EventStore,msbahrul/EventStore,msbahrul/EventStore,ianbattersby/EventStore,msbahrul/EventStore,ianbattersby/EventStore,ianbattersby/EventStore
|
src/EventStore/EventStore.Projections.Core.Tests/Services/core_projection/checkpoint_manager/multi_stream/TestFixtureWithMultiStreamCheckpointManager.cs
|
src/EventStore/EventStore.Projections.Core.Tests/Services/core_projection/checkpoint_manager/multi_stream/TestFixtureWithMultiStreamCheckpointManager.cs
|
// 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 EventStore.Projections.Core.Services.Processing;
namespace EventStore.Projections.Core.Tests.Services.core_projection.checkpoint_manager.multi_stream
{
public class TestFixtureWithMultiStreamCheckpointManager : TestFixtureWithCoreProjectionCheckpointManager
{
protected string[] _streams;
protected override void Given()
{
base.Given();
_projectionVersion = new ProjectionVersion(1, 0, 0);
_streams = new[] { "a", "b", "c" };
}
protected override DefaultCheckpointManager GivenCheckpointManager()
{
return new MultiStreamMultiOutputCheckpointManager(
_bus, _projectionCorrelationId, _projectionVersion, null, _ioDispatcher, _config, _projectionName,
new MultiStreamPositionTagger(0, _streams), _namingBuilder, _checkpointsEnabled, true, true,
_checkpointWriter);
}
}
}
|
// 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 EventStore.Projections.Core.Services.Processing;
namespace EventStore.Projections.Core.Tests.Services.core_projection.checkpoint_manager.multi_stream
{
public class TestFixtureWithMultiStreamCheckpointManager : TestFixtureWithCoreProjectionCheckpointManager
{
protected ProjectionVersion _projectionVersion;
protected string[] _streams;
protected override void Given()
{
base.Given();
_projectionVersion = new ProjectionVersion(1, 0, 0);
_streams = new[] { "a", "b", "c" };
}
protected override DefaultCheckpointManager GivenCheckpointManager()
{
return new MultiStreamMultiOutputCheckpointManager(
_bus, _projectionCorrelationId, _projectionVersion, null, _ioDispatcher, _config, _projectionName,
new MultiStreamPositionTagger(0, _streams), _namingBuilder, _checkpointsEnabled, true, true,
_checkpointWriter);
}
}
}
|
bsd-3-clause
|
C#
|
571005895101910945649fb23aa00ef67562401c
|
remove unused property
|
peppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework
|
osu.Framework/Graphics/UserInterface/DirectoryListingItem.cs
|
osu.Framework/Graphics/UserInterface/DirectoryListingItem.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osuTK;
namespace osu.Framework.Graphics.UserInterface
{
public abstract class DirectoryListingItem : CompositeDrawable
{
private readonly string displayName;
protected const float FONT_SIZE = 16;
protected abstract string FallbackName { get; }
protected abstract IconUsage? Icon { get; }
protected FillFlowContainer Flow;
protected DirectoryListingItem(string displayName = null)
{
this.displayName = displayName;
}
[BackgroundDependencyLoader]
private void load()
{
AutoSizeAxes = Axes.Both;
InternalChild = Flow = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Vertical = 2, Horizontal = 5 },
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
};
if (Icon.HasValue)
{
Flow.Add(new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Icon = Icon.Value,
Size = new Vector2(FONT_SIZE)
});
}
Flow.Add(new SpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Text = displayName ?? FallbackName,
Font = FrameworkFont.Regular.With(size: FONT_SIZE)
});
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osuTK;
namespace osu.Framework.Graphics.UserInterface
{
public abstract class DirectoryListingItem : CompositeDrawable
{
private readonly string displayName;
public const float HEIGHT = 20;
protected const float FONT_SIZE = 16;
protected abstract string FallbackName { get; }
protected abstract IconUsage? Icon { get; }
protected FillFlowContainer Flow;
protected DirectoryListingItem(string displayName = null)
{
this.displayName = displayName;
}
[BackgroundDependencyLoader]
private void load()
{
AutoSizeAxes = Axes.Both;
InternalChild = Flow = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Vertical = 2, Horizontal = 5 },
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
};
if (Icon.HasValue)
{
Flow.Add(new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Icon = Icon.Value,
Size = new Vector2(FONT_SIZE)
});
}
Flow.Add(new SpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Text = displayName ?? FallbackName,
Font = FrameworkFont.Regular.With(size: FONT_SIZE)
});
}
}
}
|
mit
|
C#
|
32a44aea0b9e41fd1876116d571712f2ff64a530
|
Update 01-CreateTable.cs
|
awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples
|
.dotnet/example_code/DynamoDB/TryDax/01-CreateTable.cs
|
.dotnet/example_code/DynamoDB/TryDax/01-CreateTable.cs
|
// snippet-sourcedescription:[ ]
// snippet-service:[dynamodb]
// snippet-keyword:[dotNET]
// snippet-keyword:[Amazon DynamoDB]
// snippet-keyword:[Code Sample]
// snippet-keyword:[ ]
// snippet-sourcetype:[full-example]
// snippet-sourcedate:[ ]
// snippet-sourceauthor:[AWS]
// snippet-start:[dynamodb.dotNET.trydax.01-CreateTable]
/**
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* This file is 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/
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
using Amazon.DynamoDBv2.Model;
using Amazon.DynamoDBv2;
namespace ClientTest
{
class Program
{
static void Main(string[] args)
{
AmazonDynamoDBClient client = new AmazonDynamoDBClient();
var tableName = "TryDaxTable";
var request = new CreateTableRequest()
{
TableName = tableName,
KeySchema = new List<KeySchemaElement>()
{
new KeySchemaElement{ AttributeName = "pk",KeyType = "HASH"},
new KeySchemaElement{ AttributeName = "sk",KeyType = "RANGE"}
},
AttributeDefinitions = new List<AttributeDefinition>() {
new AttributeDefinition{ AttributeName = "pk",AttributeType = "N"},
new AttributeDefinition{ AttributeName = "sk",AttributeType = "N"}
},
ProvisionedThroughput = new ProvisionedThroughput()
{
ReadCapacityUnits = 10,
WriteCapacityUnits = 10
}
};
var response = client.CreateTableAsync(request).Result;
Console.WriteLine("Hit <enter> to continue...");
Console.ReadLine();
}
}
}
// snippet-end:[dynamodb.dotNET.trydax.01-CreateTable]
|
// snippet-sourcedescription:[ ]
// snippet-service:[dynamodb]
// snippet-keyword:[dotNET]
// snippet-keyword:[Amazon DynamoDB]
// snippet-keyword:[Code Sample]
// snippet-keyword:[ ]
// snippet-sourcetype:[full-example]
// snippet-sourcedate:[ ]
// snippet-sourceauthor:[AWS]
// snippet-start:[dynamodb.dotNET.trydax.01-CreateTable]
/**
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* This file is 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/
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
using Amazon.DynamoDBv2.Model;
using System.Collections.Generic;
using System;
using Amazon.DynamoDBv2;
namespace ClientTest
{
class Program
{
static void Main(string[] args)
{
AmazonDynamoDBClient client = new AmazonDynamoDBClient();
var tableName = "TryDaxTable";
var request = new CreateTableRequest()
{
TableName = tableName,
KeySchema = new List<KeySchemaElement>()
{
new KeySchemaElement{ AttributeName = "pk",KeyType = "HASH"},
new KeySchemaElement{ AttributeName = "sk",KeyType = "RANGE"}
},
AttributeDefinitions = new List<AttributeDefinition>() {
new AttributeDefinition{ AttributeName = "pk",AttributeType = "N"},
new AttributeDefinition{ AttributeName = "sk",AttributeType = "N"}
},
ProvisionedThroughput = new ProvisionedThroughput()
{
ReadCapacityUnits = 10,
WriteCapacityUnits = 10
}
};
var response = client.CreateTableAsync(request).Result;
Console.WriteLine("Hit <enter> to continue...");
Console.ReadLine();
}
}
}
// snippet-end:[dynamodb.dotNET.trydax.01-CreateTable]
|
apache-2.0
|
C#
|
7c3ff3dfc34187151f66dbc11379b3596303e288
|
Update SelectionAdorner.cs
|
wieslawsoltes/AvaloniaBehaviors,wieslawsoltes/AvaloniaBehaviors
|
src/Avalonia.Xaml.Interactions/Draggable/SelectionAdorner.cs
|
src/Avalonia.Xaml.Interactions/Draggable/SelectionAdorner.cs
|
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Media;
namespace Avalonia.Xaml.Interactions.Draggable
{
/// <summary>
///
/// </summary>
public class SelectionAdorner : Control
{
/// <summary>
///
/// </summary>
/// <param name="context"></param>
public override void Render(DrawingContext context)
{
var adornedElement = GetValue(AdornerLayer.AdornedElementProperty);
if (adornedElement is null)
{
return;
}
var bounds = adornedElement.Bounds;
var brush = new SolidColorBrush(Colors.White) { Opacity = 0.5 };
var pen = new Pen(new SolidColorBrush(Colors.Black), 1.5);
var r = 5.0;
var topLeft = new RectangleGeometry(new Rect(-r, -r, r + r, r + r));
var topRight = new RectangleGeometry(new Rect(-r, bounds.Height - r, r + r, r + r));
var bottomLeft = new RectangleGeometry(new Rect(bounds.Width - r, -r, r + r, r + r));
var bottomRight = new RectangleGeometry(new Rect(bounds.Width - r, bounds.Height - r, r + r, r + r));
context.DrawGeometry(brush, pen, topLeft);
context.DrawGeometry(brush, pen, topRight);
context.DrawGeometry(brush, pen, bottomLeft);
context.DrawGeometry(brush, pen, bottomRight);
}
}
}
|
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Media;
namespace Avalonia.Xaml.Interactions.Draggable
{
/// <summary>
///
/// </summary>
public class SelectionAdorner : Control
{
/// <summary>
///
/// </summary>
/// <param name="context"></param>
public override void Render(DrawingContext context)
{
var adornedElement = GetValue(AdornerLayer.AdornedElementProperty);
if (adornedElement is null)
{
return;
}
var bounds = adornedElement.Bounds;
var brush = new SolidColorBrush(Colors.White) { Opacity = 0.5 };
var pen = new Pen(new SolidColorBrush(Colors.Black), 1.5);
var r = 5.0;
var topLeft = new EllipseGeometry(new Rect(-r, -r, r + r, r + r));
var topRight = new EllipseGeometry(new Rect(-r, bounds.Height - r, r + r, r + r));
var bottomLeft = new EllipseGeometry(new Rect(bounds.Width - r, -r, r + r, r + r));
var bottomRight = new EllipseGeometry(new Rect(bounds.Width - r, bounds.Height - r, r + r, r + r));
context.DrawGeometry(brush, pen, topLeft);
context.DrawGeometry(brush, pen, topRight);
context.DrawGeometry(brush, pen, bottomLeft);
context.DrawGeometry(brush, pen, bottomRight);
}
}
}
|
mit
|
C#
|
3e1c10e6e6b4fc75e2548103da8e79c7a2b38dd4
|
Remove dead code in Interop.LSAStructs.cs
|
MaggieTsang/corefx,jlin177/corefx,JosephTremoulet/corefx,lggomez/corefx,rjxby/corefx,fgreinacher/corefx,dotnet-bot/corefx,Petermarcu/corefx,the-dwyer/corefx,DnlHarvey/corefx,JosephTremoulet/corefx,BrennanConroy/corefx,DnlHarvey/corefx,ravimeda/corefx,ravimeda/corefx,billwert/corefx,YoupHulsebos/corefx,gkhanna79/corefx,axelheer/corefx,richlander/corefx,lggomez/corefx,rahku/corefx,JosephTremoulet/corefx,BrennanConroy/corefx,tijoytom/corefx,nchikanov/corefx,the-dwyer/corefx,stephenmichaelf/corefx,ViktorHofer/corefx,alexperovich/corefx,Petermarcu/corefx,weltkante/corefx,twsouthwick/corefx,cydhaselton/corefx,MaggieTsang/corefx,ptoonen/corefx,seanshpark/corefx,alphonsekurian/corefx,twsouthwick/corefx,nbarbettini/corefx,jlin177/corefx,Ermiar/corefx,alphonsekurian/corefx,dhoehna/corefx,shimingsg/corefx,nbarbettini/corefx,nbarbettini/corefx,krytarowski/corefx,marksmeltzer/corefx,shimingsg/corefx,tijoytom/corefx,rubo/corefx,JosephTremoulet/corefx,axelheer/corefx,mmitche/corefx,twsouthwick/corefx,twsouthwick/corefx,jlin177/corefx,seanshpark/corefx,shmao/corefx,zhenlan/corefx,DnlHarvey/corefx,alexperovich/corefx,stone-li/corefx,lggomez/corefx,krk/corefx,krytarowski/corefx,YoupHulsebos/corefx,richlander/corefx,jlin177/corefx,ViktorHofer/corefx,alexperovich/corefx,parjong/corefx,wtgodbe/corefx,parjong/corefx,billwert/corefx,krytarowski/corefx,MaggieTsang/corefx,Jiayili1/corefx,shimingsg/corefx,shmao/corefx,lggomez/corefx,weltkante/corefx,tijoytom/corefx,ViktorHofer/corefx,alexperovich/corefx,gkhanna79/corefx,dhoehna/corefx,parjong/corefx,marksmeltzer/corefx,fgreinacher/corefx,alphonsekurian/corefx,wtgodbe/corefx,zhenlan/corefx,ptoonen/corefx,cydhaselton/corefx,ericstj/corefx,ptoonen/corefx,seanshpark/corefx,wtgodbe/corefx,MaggieTsang/corefx,MaggieTsang/corefx,marksmeltzer/corefx,elijah6/corefx,seanshpark/corefx,mazong1123/corefx,the-dwyer/corefx,richlander/corefx,alphonsekurian/corefx,ViktorHofer/corefx,tijoytom/corefx,rubo/corefx,dotnet-bot/corefx,shmao/corefx,fgreinacher/corefx,rahku/corefx,mmitche/corefx,jlin177/corefx,mazong1123/corefx,weltkante/corefx,mazong1123/corefx,yizhang82/corefx,JosephTremoulet/corefx,alexperovich/corefx,twsouthwick/corefx,shmao/corefx,ericstj/corefx,Jiayili1/corefx,weltkante/corefx,nbarbettini/corefx,nbarbettini/corefx,shmao/corefx,dhoehna/corefx,shimingsg/corefx,jlin177/corefx,tijoytom/corefx,rahku/corefx,yizhang82/corefx,rubo/corefx,parjong/corefx,dhoehna/corefx,ravimeda/corefx,gkhanna79/corefx,parjong/corefx,YoupHulsebos/corefx,Jiayili1/corefx,rahku/corefx,tijoytom/corefx,alphonsekurian/corefx,shmao/corefx,marksmeltzer/corefx,stone-li/corefx,ericstj/corefx,nchikanov/corefx,dotnet-bot/corefx,cydhaselton/corefx,YoupHulsebos/corefx,lggomez/corefx,elijah6/corefx,marksmeltzer/corefx,nchikanov/corefx,ptoonen/corefx,the-dwyer/corefx,marksmeltzer/corefx,rjxby/corefx,tijoytom/corefx,rahku/corefx,shimingsg/corefx,mmitche/corefx,Ermiar/corefx,lggomez/corefx,Ermiar/corefx,krytarowski/corefx,stephenmichaelf/corefx,elijah6/corefx,zhenlan/corefx,YoupHulsebos/corefx,gkhanna79/corefx,stone-li/corefx,cydhaselton/corefx,krk/corefx,axelheer/corefx,rjxby/corefx,DnlHarvey/corefx,ravimeda/corefx,richlander/corefx,fgreinacher/corefx,Jiayili1/corefx,nbarbettini/corefx,krk/corefx,BrennanConroy/corefx,richlander/corefx,rahku/corefx,axelheer/corefx,mmitche/corefx,gkhanna79/corefx,marksmeltzer/corefx,mmitche/corefx,Petermarcu/corefx,stone-li/corefx,alphonsekurian/corefx,shimingsg/corefx,wtgodbe/corefx,Jiayili1/corefx,nbarbettini/corefx,Petermarcu/corefx,cydhaselton/corefx,the-dwyer/corefx,weltkante/corefx,JosephTremoulet/corefx,stephenmichaelf/corefx,the-dwyer/corefx,zhenlan/corefx,DnlHarvey/corefx,the-dwyer/corefx,cydhaselton/corefx,stone-li/corefx,parjong/corefx,Petermarcu/corefx,alexperovich/corefx,nchikanov/corefx,alphonsekurian/corefx,shimingsg/corefx,shmao/corefx,yizhang82/corefx,nchikanov/corefx,weltkante/corefx,ViktorHofer/corefx,krk/corefx,zhenlan/corefx,ravimeda/corefx,axelheer/corefx,mazong1123/corefx,ericstj/corefx,krytarowski/corefx,stephenmichaelf/corefx,axelheer/corefx,Ermiar/corefx,elijah6/corefx,nchikanov/corefx,rjxby/corefx,alexperovich/corefx,billwert/corefx,seanshpark/corefx,zhenlan/corefx,Jiayili1/corefx,stephenmichaelf/corefx,gkhanna79/corefx,zhenlan/corefx,jlin177/corefx,dotnet-bot/corefx,mazong1123/corefx,ericstj/corefx,ptoonen/corefx,wtgodbe/corefx,richlander/corefx,ravimeda/corefx,mmitche/corefx,krytarowski/corefx,Jiayili1/corefx,dhoehna/corefx,DnlHarvey/corefx,yizhang82/corefx,lggomez/corefx,mmitche/corefx,ericstj/corefx,Ermiar/corefx,dotnet-bot/corefx,YoupHulsebos/corefx,Ermiar/corefx,krytarowski/corefx,billwert/corefx,rahku/corefx,dhoehna/corefx,dhoehna/corefx,billwert/corefx,mazong1123/corefx,yizhang82/corefx,ericstj/corefx,ViktorHofer/corefx,krk/corefx,elijah6/corefx,elijah6/corefx,dotnet-bot/corefx,elijah6/corefx,stephenmichaelf/corefx,wtgodbe/corefx,stone-li/corefx,ptoonen/corefx,ViktorHofer/corefx,gkhanna79/corefx,rubo/corefx,twsouthwick/corefx,nchikanov/corefx,twsouthwick/corefx,ravimeda/corefx,rjxby/corefx,seanshpark/corefx,MaggieTsang/corefx,JosephTremoulet/corefx,krk/corefx,weltkante/corefx,Petermarcu/corefx,billwert/corefx,rjxby/corefx,DnlHarvey/corefx,yizhang82/corefx,seanshpark/corefx,krk/corefx,stephenmichaelf/corefx,Petermarcu/corefx,richlander/corefx,stone-li/corefx,YoupHulsebos/corefx,cydhaselton/corefx,ptoonen/corefx,billwert/corefx,wtgodbe/corefx,dotnet-bot/corefx,parjong/corefx,rubo/corefx,yizhang82/corefx,Ermiar/corefx,mazong1123/corefx,MaggieTsang/corefx,rjxby/corefx
|
src/Common/src/Interop/Windows/sspicli/Interop.LSAStructs.cs
|
src/Common/src/Interop/Windows/sspicli/Interop.LSAStructs.cs
|
// 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.Win32.SafeHandles;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
internal static partial class Interop
{
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_TRANSLATED_NAME
{
internal int Use;
internal UNICODE_INTPTR_STRING Name;
internal int DomainIndex;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_OBJECT_ATTRIBUTES
{
internal int Length;
internal IntPtr RootDirectory;
internal IntPtr ObjectName;
internal int Attributes;
internal IntPtr SecurityDescriptor;
internal IntPtr SecurityQualityOfService;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_TRANSLATED_SID2
{
internal int Use;
internal IntPtr Sid;
internal int DomainIndex;
uint Flags;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_TRUST_INFORMATION
{
internal UNICODE_INTPTR_STRING Name;
internal IntPtr Sid;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_REFERENCED_DOMAIN_LIST
{
internal int Entries;
internal IntPtr Domains;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct UNICODE_INTPTR_STRING
{
internal ushort Length;
internal ushort MaxLength;
internal IntPtr Buffer;
}
}
|
// 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.Win32.SafeHandles;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
internal static partial class Interop
{
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_TRANSLATED_NAME
{
internal int Use;
internal UNICODE_INTPTR_STRING Name;
internal int DomainIndex;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_OBJECT_ATTRIBUTES
{
internal int Length;
internal IntPtr RootDirectory;
internal IntPtr ObjectName;
internal int Attributes;
internal IntPtr SecurityDescriptor;
internal IntPtr SecurityQualityOfService;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_TRANSLATED_SID2
{
internal int Use;
internal IntPtr Sid;
internal int DomainIndex;
uint Flags;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_TRUST_INFORMATION
{
internal UNICODE_INTPTR_STRING Name;
internal IntPtr Sid;
}
[StructLayout(LayoutKind.Sequential)]
internal struct LSA_REFERENCED_DOMAIN_LIST
{
internal int Entries;
internal IntPtr Domains;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct UNICODE_INTPTR_STRING
{
/// <remarks>
/// Note - this constructor extracts the raw pointer from the safe handle, so any
/// strings created with this version of the constructor will be unsafe to use after the buffer
/// has been freed.
/// </remarks>
[System.Security.SecurityCritical] // auto-generated
internal UNICODE_INTPTR_STRING(int stringBytes, SafeLocalAllocHandle buffer)
{
Debug.Assert(buffer == null || (stringBytes >= 0 && (ulong)stringBytes <= buffer.ByteLength),
"buffer == null || (stringBytes >= 0 && stringBytes <= buffer.ByteLength)");
this.Length = (ushort)stringBytes;
this.MaxLength = (ushort)buffer.ByteLength;
// Marshaling with a SafePointer does not work correctly, so unfortunately we need to extract
// the raw handle here.
this.Buffer = buffer.DangerousGetHandle();
}
/// <remarks>
/// This constructor should be used for constructing UNICODE_STRING structures with pointers
/// into a block of memory managed by a SafeHandle or the GC. It shouldn't be used to own
/// any memory on its own.
/// </remarks>
internal UNICODE_INTPTR_STRING(int stringBytes, IntPtr buffer)
{
Debug.Assert((stringBytes == 0 && buffer == IntPtr.Zero) || (stringBytes > 0 && stringBytes <= UInt16.MaxValue && buffer != IntPtr.Zero),
"(stringBytes == 0 && buffer == IntPtr.Zero) || (stringBytes > 0 && stringBytes <= UInt16.MaxValue && buffer != IntPtr.Zero)");
this.Length = (ushort)stringBytes;
this.MaxLength = (ushort)stringBytes;
this.Buffer = buffer;
}
internal ushort Length;
internal ushort MaxLength;
internal IntPtr Buffer;
}
}
|
mit
|
C#
|
b86bf4f7cd44b47e33c97fe4a59b71b869369b44
|
Simplify FixDefaultParamValuesOfOverridesPass.VisitMethodDecl.
|
mono/CppSharp,u255436/CppSharp,mono/CppSharp,ktopouzi/CppSharp,ktopouzi/CppSharp,genuinelucifer/CppSharp,inordertotest/CppSharp,zillemarco/CppSharp,ddobrev/CppSharp,mohtamohit/CppSharp,mono/CppSharp,mohtamohit/CppSharp,genuinelucifer/CppSharp,ddobrev/CppSharp,inordertotest/CppSharp,u255436/CppSharp,mohtamohit/CppSharp,mohtamohit/CppSharp,inordertotest/CppSharp,genuinelucifer/CppSharp,genuinelucifer/CppSharp,mohtamohit/CppSharp,ddobrev/CppSharp,zillemarco/CppSharp,genuinelucifer/CppSharp,zillemarco/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,inordertotest/CppSharp,u255436/CppSharp,ktopouzi/CppSharp,mono/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,zillemarco/CppSharp,mono/CppSharp,mono/CppSharp,ddobrev/CppSharp,ddobrev/CppSharp,zillemarco/CppSharp,inordertotest/CppSharp
|
src/Generator/Passes/FixDefaultParamValuesOfOverridesPass.cs
|
src/Generator/Passes/FixDefaultParamValuesOfOverridesPass.cs
|
using CppSharp.AST;
namespace CppSharp.Passes
{
public class FixDefaultParamValuesOfOverridesPass : TranslationUnitPass
{
public override bool VisitMethodDecl(Method method)
{
if (!method.IsOverride || method.IsSynthetized)
return true;
Method rootBaseMethod = ((Class)method.Namespace).GetBaseMethod(method);
for (int i = 0; i < method.Parameters.Count; i++)
{
var rootBaseParameter = rootBaseMethod.Parameters[i];
var parameter = method.Parameters[i];
if (rootBaseParameter.DefaultArgument != null)
parameter.DefaultArgument = rootBaseParameter.DefaultArgument.Clone();
}
return true;
}
}
}
|
using CppSharp.AST;
namespace CppSharp.Passes
{
public class FixDefaultParamValuesOfOverridesPass : TranslationUnitPass
{
public override bool VisitMethodDecl(Method method)
{
if (method.IsOverride && !method.IsSynthetized)
{
Method rootBaseMethod = ((Class) method.Namespace).GetBaseMethod(method);
for (int i = 0; i < method.Parameters.Count; i++)
{
var rootBaseParameter = rootBaseMethod.Parameters[i];
var parameter = method.Parameters[i];
if (rootBaseParameter.DefaultArgument == null)
{
parameter.DefaultArgument = null;
}
else
{
parameter.DefaultArgument = rootBaseParameter.DefaultArgument.Clone();
}
}
}
return base.VisitMethodDecl(method);
}
}
}
|
mit
|
C#
|
2c8d7e7bfba72fef4d08f6cb7a93bb1aef006d7f
|
Improve GraphWithBlob benchmark competition
|
mijay/NClone
|
src/NClone.Benchmarks/GraphWithBlobReplicationCompetition.cs
|
src/NClone.Benchmarks/GraphWithBlobReplicationCompetition.cs
|
using System;
using System.Linq;
using GeorgeCloney;
using NClone.Benchmarks.Runner;
using NClone.MetadataProviders;
using NClone.ObjectReplication;
namespace NClone.Benchmarks
{
public class GraphWithBlobReplicationCompetition: CompetitionBase
{
private const int blobSize = 200000;
private static void Consume(SomeClass source)
{
source.Property.Sum(x => x.field.Length);
}
[Benchmark]
public Action ReplicatorClone()
{
SomeClass source = CreateData();
var replicator = new ObjectReplicator(new ConventionalMetadataProvider());
return () => {
source = replicator.Replicate(source);
Consume(source);
};
}
[Benchmark]
public Action ReflectionClone()
{
SomeClass source = CreateData();
return () => {
source = source.DeepClone();
Consume(source);
};
}
[Benchmark]
public Action SimpleDataCreation()
{
return () => {
SomeClass data = CreateData();
Consume(data);
};
}
private static SomeClass CreateData()
{
var source = new SomeClass
{
Property = Enumerable.Range(0, blobSize)
.Select(i => new SomeClass2 { field = i.ToString() })
.ToArray()
};
return source;
}
private class SomeClass
{
public SomeClass2[] Property { get; set; }
}
private class SomeClass2
{
public string field;
}
}
}
|
using System;
using System.Linq;
using GeorgeCloney;
using NClone.Benchmarks.Runner;
using NClone.MetadataProviders;
using NClone.ObjectReplication;
namespace NClone.Benchmarks
{
public class GraphWithBlobReplicationCompetition: CompetitionBase
{
private const int blobSize = 200000;
private static void Consume(SomeClass source)
{
source.Property.Sum(x => x.field.Length);
}
[Benchmark]
public Action ReplicatorClone()
{
var source = new SomeClass
{
Property = Enumerable.Range(0, blobSize)
.Select(i => new SomeClass2 { field = i.ToString() })
.ToArray()
};
var replicator = new ObjectReplicator(new ConventionalMetadataProvider());
return () => {
source = replicator.Replicate(source);
Consume(source);
};
}
[Benchmark]
public Action ReflectionClone()
{
var source = new SomeClass
{
Property = Enumerable.Range(0, blobSize)
.Select(i => new SomeClass2 { field = i.ToString() })
.ToArray()
};
return () => {
source = source.DeepClone();
Consume(source);
};
}
private class SomeClass
{
public SomeClass2[] Property { get; set; }
}
private class SomeClass2
{
public string field;
}
}
}
|
mit
|
C#
|
d30d33f5db1da9e0cfae6a671d80675c3d93b900
|
Remove unnecessary using
|
Augurk/Augurk,Augurk/Augurk,Augurk/Augurk,Augurk/Augurk
|
src/Augurk.UI/Services/ConfigurationService.cs
|
src/Augurk.UI/Services/ConfigurationService.cs
|
// Copyright (c) Augurk. All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Augurk.Entities;
using Microsoft.AspNetCore.Components.Forms;
namespace Augurk.UI.Services
{
public class ConfigurationService
{
private readonly HttpClient _client;
public ConfigurationService(HttpClient client)
{
_client = client ?? throw new ArgumentNullException(nameof(client));
}
public async Task<Configuration> GetConfigurationAsync()
{
return await _client.GetFromJsonAsync<Configuration>("/api/v2/configuration");
}
public async Task SaveConfigurationAsync(Configuration configuration)
{
await _client.PostAsJsonAsync("/api/v2/configuration", configuration);
}
public async Task<Customization> GetCustomizationAsync()
{
return await _client.GetFromJsonAsync<Customization>("/api/v2/customization");
}
public async Task SaveCustomizationAsync(Customization customization)
{
await _client.PostAsJsonAsync("/api/v2/customization", customization);
}
public async Task ImportBackupAsync(IBrowserFile backupFile)
{
var content = new MultipartFormDataContent();
var fileContent = new StreamContent(backupFile.OpenReadStream(int.MaxValue));
content.Add(fileContent, "file", backupFile.Name);
await _client.PostAsync("/api/v2/import", content);
}
}
}
|
// Copyright (c) Augurk. All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Augurk.Entities;
using Microsoft.AspNetCore.Components.Forms;
namespace Augurk.UI.Services
{
public class ConfigurationService
{
private readonly HttpClient _client;
public ConfigurationService(HttpClient client)
{
_client = client ?? throw new ArgumentNullException(nameof(client));
}
public async Task<Configuration> GetConfigurationAsync()
{
return await _client.GetFromJsonAsync<Configuration>("/api/v2/configuration");
}
public async Task SaveConfigurationAsync(Configuration configuration)
{
await _client.PostAsJsonAsync("/api/v2/configuration", configuration);
}
public async Task<Customization> GetCustomizationAsync()
{
return await _client.GetFromJsonAsync<Customization>("/api/v2/customization");
}
public async Task SaveCustomizationAsync(Customization customization)
{
await _client.PostAsJsonAsync("/api/v2/customization", customization);
}
public async Task ImportBackupAsync(IBrowserFile backupFile)
{
var content = new MultipartFormDataContent();
var fileContent = new StreamContent(backupFile.OpenReadStream(int.MaxValue));
content.Add(fileContent, "file", backupFile.Name);
await _client.PostAsync("/api/v2/import", content);
}
}
}
|
apache-2.0
|
C#
|
d5a6e1f5e4bc2fe97d53d69c8076148345c7b7a1
|
Add filename constructor to CustomSSSwithSDSL
|
libertyernie/BrawlManagerLib
|
CustomSSSwithSDSL.cs
|
CustomSSSwithSDSL.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BrawlManagerLib {
public class CustomSSSwithSDSL : CustomSSS {
public CustomSSSwithSDSL(string[] s) : base(s) {
SongsByStage = SDSLScanner.SongsByStage(this);
}
public CustomSSSwithSDSL(byte[] data) : base(data) {
SongsByStage = SDSLScanner.SongsByStage(this);
}
public CustomSSSwithSDSL(string filename) : base(filename) {
SongsByStage = SDSLScanner.SongsByStage(this);
}
public Dictionary<byte, Song> SongsByStage { get; private set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BrawlManagerLib {
public class CustomSSSwithSDSL : CustomSSS {
public CustomSSSwithSDSL(string[] s) : base(s) {
SongsByStage = SDSLScanner.SongsByStage(this);
}
public CustomSSSwithSDSL(byte[] data) : base(data) {
SongsByStage = SDSLScanner.SongsByStage(this);
}
public Dictionary<byte, Song> SongsByStage { get; private set; }
}
}
|
mit
|
C#
|
ed522e12ab95619e163aadc52196dd134cfb7cbb
|
update to working feed url (added atom/)
|
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
|
src/Firehose.Web/Authors/EmmanuelDemilliere.cs
|
src/Firehose.Web/Authors/EmmanuelDemilliere.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class EmmanuelDemilliere : IAmAMicrosoftMVP
{
public string FirstName => "Emmanuel";
public string LastName => "Demilliere";
public string ShortBioOrTagLine => "PowerShell MVP focused on AD & Office 365";
public string StateOrRegion => "France";
public string EmailAddress => "edemilliere@itfordummies.net";
public string TwitterHandle => "edemilliere";
public string GitHubHandle => "edemilliere";
public string GravatarHash => "";
public GeoPosition Position => new GeoPosition(45.750000, 4.850000);
public Uri WebSite => new Uri("https://itfordummies.net");
public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://itfordummies.net/feed/atom/"); } }
public bool Filter(SyndicationItem item)
{
return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell"));
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class EmmanuelDemilliere : IAmAMicrosoftMVP
{
public string FirstName => "Emmanuel";
public string LastName => "Demilliere";
public string ShortBioOrTagLine => "PowerShell MVP focused on AD & Office 365";
public string StateOrRegion => "France";
public string EmailAddress => "edemilliere@itfordummies.net";
public string TwitterHandle => "edemilliere";
public string GitHubHandle => "edemilliere";
public string GravatarHash => "";
public GeoPosition Position => new GeoPosition(45.750000, 4.850000);
public Uri WebSite => new Uri("https://itfordummies.net");
public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://itfordummies.net/feed/"); } }
public bool Filter(SyndicationItem item)
{
return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell"));
}
}
}
|
mit
|
C#
|
da15b900f7d628f4790dfd263c045382cdcd4f51
|
Remove virtual member from ModBlockFail
|
ZLima12/osu,smoogipooo/osu,NeoAdonis/osu,ppy/osu,peppy/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,ZLima12/osu,EVAST9919/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,EVAST9919/osu,smoogipoo/osu,ppy/osu,peppy/osu,ppy/osu,johnneijzen/osu,peppy/osu-new,2yangk23/osu,UselessToucan/osu,2yangk23/osu,UselessToucan/osu,johnneijzen/osu
|
osu.Game/Rulesets/Mods/ModBlockFail.cs
|
osu.Game/Rulesets/Mods/ModBlockFail.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
{
private Bindable<bool> showHealthBar;
/// <summary>
/// We never fail, 'yo.
/// </summary>
public bool AllowFail => false;
public bool RestartOnFail => false;
public void ReadFromConfig(OsuConfigManager config)
{
showHealthBar = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail);
}
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHealthbar.BindTo(showHealthBar);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
{
private Bindable<bool> showHealthBar;
/// <summary>
/// We never fail, 'yo.
/// </summary>
public bool AllowFail => false;
public virtual bool RestartOnFail => false;
public void ReadFromConfig(OsuConfigManager config)
{
showHealthBar = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail);
}
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHealthbar.BindTo(showHealthBar);
}
}
}
|
mit
|
C#
|
0f9978b34a8e250ba6458dd9ecee6eb90529a403
|
Use AddRange instead
|
EVAST9919/osu,NeoAdonis/osu,2yangk23/osu,UselessToucan/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,peppy/osu,johnneijzen/osu,ppy/osu,2yangk23/osu,smoogipoo/osu,peppy/osu-new,NeoAdonis/osu,johnneijzen/osu,UselessToucan/osu,peppy/osu,smoogipooo/osu,peppy/osu,UselessToucan/osu,ppy/osu,EVAST9919/osu
|
osu.Game/Skinning/SkinConfiguration.cs
|
osu.Game/Skinning/SkinConfiguration.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Beatmaps.Formats;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
/// <summary>
/// An empty skin configuration.
/// </summary>
public class SkinConfiguration : IHasComboColours, IHasCustomColours
{
public readonly SkinInfo SkinInfo = new SkinInfo();
/// <summary>
/// Whether to allow <see cref="DefaultComboColours"/> as a fallback list for when no combo colours are provided.
/// </summary>
internal bool AllowDefaultComboColoursFallback = true;
public static List<Color4> DefaultComboColours = new List<Color4>
{
new Color4(255, 192, 0, 255),
new Color4(0, 202, 0, 255),
new Color4(18, 124, 255, 255),
new Color4(242, 24, 57, 255),
};
private List<Color4> comboColours = new List<Color4>();
public IReadOnlyList<Color4> ComboColours
{
get
{
if (comboColours.Count > 0)
return comboColours;
if (AllowDefaultComboColoursFallback)
return DefaultComboColours;
return null;
}
set => comboColours = value.ToList();
}
public void AddComboColours(params Color4[] colours) => comboColours.AddRange(colours);
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public readonly Dictionary<string, string> ConfigDictionary = new Dictionary<string, string>();
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Beatmaps.Formats;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
/// <summary>
/// An empty skin configuration.
/// </summary>
public class SkinConfiguration : IHasComboColours, IHasCustomColours
{
public readonly SkinInfo SkinInfo = new SkinInfo();
/// <summary>
/// Whether to allow <see cref="DefaultComboColours"/> as a fallback list for when no combo colours are provided.
/// </summary>
internal bool AllowDefaultComboColoursFallback = true;
public static List<Color4> DefaultComboColours = new List<Color4>
{
new Color4(255, 192, 0, 255),
new Color4(0, 202, 0, 255),
new Color4(18, 124, 255, 255),
new Color4(242, 24, 57, 255),
};
private List<Color4> comboColours = new List<Color4>();
public IReadOnlyList<Color4> ComboColours
{
get
{
if (comboColours.Count > 0)
return comboColours;
if (AllowDefaultComboColoursFallback)
return DefaultComboColours;
return null;
}
set => comboColours = value.ToList();
}
public void AddComboColours(params Color4[] colours) => colours.ForEach(c => comboColours.Add(c));
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public readonly Dictionary<string, string> ConfigDictionary = new Dictionary<string, string>();
}
}
|
mit
|
C#
|
e36920e9e50f35b95b3e18e29d3e7c17ae5c9dc9
|
Add User.
|
App2Night/App2Night.Xamarin
|
App2Night/App2Night/ViewModel/DashboardViewModel.cs
|
App2Night/App2Night/ViewModel/DashboardViewModel.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using App2Night.Model.Model;
using App2Night.Service.Interface;
using App2Night.ViewModel.Subpages;
using MvvmNano;
namespace App2Night.ViewModel
{
public class DashboardViewModel : MvvmNanoViewModel
{
public bool InterestingPartieAvailable { get; set; }
public bool PartyHistoryAvailable { get; set; }
public bool SelectedpartiesAvailable { get; set; }
public ObservableCollection<Party> InterestingPartiesForUser => MvvmNanoIoC.Resolve<IDataService>().InterestingPartys;
public ObservableCollection<Party> PartyHistory => MvvmNanoIoC.Resolve<IDataService>().PartyHistory;
public ObservableCollection<Party> Selectedparties => MvvmNanoIoC.Resolve<IDataService>().SelectedPartys;
public MvvmNanoCommand MoveToUserEditCommand => new MvvmNanoCommand(() => NavigateTo<EditProfileViewModel>());
public MvvmNanoCommand MoveToMyPartiesCommand => new MvvmNanoCommand(() => NavigateTo<MyPartysViewModel>());
public MvvmNanoCommand MoveToHistoryCommand => new MvvmNanoCommand(() => NavigateTo<HistoryViewModel>());
public MvvmNanoCommand MoveToPartyPicker => new MvvmNanoCommand(() => NavigateTo<PartyPickerViewModel>());
IDataService _service;
public DashboardViewModel(IDataService service)
{
_service = service;
_service.PartiesUpdated += OnPartiesUpdated;
_User = _service.User;
SetAvailabilitys();
}
private void OnPartiesUpdated(object sender, EventArgs eventArgs)
{
SetAvailabilitys();
}
private Model.Model.User _User;
public Model.Model.User User
{
get { return _User; }
set
{
_User = value;
NotifyPropertyChanged();
NotifyPropertyChanged("IsFormValid");
}
}
public override void Initialize()
{
base.Initialize();
SetAvailabilitys();
}
void SetAvailabilitys()
{
InterestingPartieAvailable = InterestingPartiesForUser.Any();
PartyHistoryAvailable = PartyHistory.Any();
SelectedpartiesAvailable = Selectedparties.Any();
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using App2Night.Model.Model;
using App2Night.Service.Interface;
using App2Night.ViewModel.Subpages;
using MvvmNano;
namespace App2Night.ViewModel
{
public class DashboardViewModel : MvvmNanoViewModel
{
public bool InterestingPartieAvailable { get; set; }
public bool PartyHistoryAvailable { get; set; }
public bool SelectedpartiesAvailable { get; set; }
public ObservableCollection<Party> InterestingPartiesForUser => MvvmNanoIoC.Resolve<IDataService>().InterestingPartys;
public ObservableCollection<Party> PartyHistory => MvvmNanoIoC.Resolve<IDataService>().PartyHistory;
public ObservableCollection<Party> Selectedparties => MvvmNanoIoC.Resolve<IDataService>().SelectedPartys;
public MvvmNanoCommand MoveToUserEditCommand => new MvvmNanoCommand(() => NavigateTo<EditProfileViewModel>());
public MvvmNanoCommand MoveToMyPartiesCommand => new MvvmNanoCommand(() => NavigateTo<MyPartysViewModel>());
public MvvmNanoCommand MoveToHistoryCommand => new MvvmNanoCommand(() => NavigateTo<HistoryViewModel>());
public MvvmNanoCommand MoveToPartyPicker => new MvvmNanoCommand(() => NavigateTo<PartyPickerViewModel>());
public DashboardViewModel()
{
MvvmNanoIoC.Resolve<IDataService>().PartiesUpdated += OnPartiesUpdated;
SetAvailabilitys();
}
private void OnPartiesUpdated(object sender, EventArgs eventArgs)
{
SetAvailabilitys();
}
public override void Initialize()
{
base.Initialize();
SetAvailabilitys();
}
void SetAvailabilitys()
{
InterestingPartieAvailable = InterestingPartiesForUser.Any();
PartyHistoryAvailable = PartyHistory.Any();
SelectedpartiesAvailable = Selectedparties.Any();
}
}
}
|
mit
|
C#
|
b13db99213211e1ec027fe3843a447eb62c5988a
|
build error
|
mmooney/Sriracha.Deploy,mmooney/Sriracha.Deploy,mmooney/Sriracha.Deploy,mmooney/Sriracha.Deploy
|
Sriracha.Deploy.Data/Impl/BuildPublisher.cs
|
Sriracha.Deploy.Data/Impl/BuildPublisher.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NLog;
using ServiceStack.Common.Web;
using ServiceStack.ServiceClient.Web;
using Sriracha.Deploy.Data.Dto;
namespace Sriracha.Deploy.Data.Impl
{
public class BuildPublisher : IBuildPublisher
{
private readonly IZipper _zipper;
private readonly Logger _logger;
public BuildPublisher(IZipper zipper, Logger logger)
{
_zipper = DIHelper.VerifyParameter(zipper);
_logger = DIHelper.VerifyParameter(logger);
}
public void PublishDirectory(string directoryPath, string apiUrl)
{
_logger.Info("Start publishing directory {0} to URL {1}", directoryPath, apiUrl);
string zipPath = Path.ChangeExtension(Path.GetTempFileName(), ".zip");
if(!Directory.Exists(directoryPath))
{
throw new DirectoryNotFoundException(string.Format("Publish directory \"{0}\" not found", directoryPath));
}
_zipper.ZipDirectory(directoryPath, zipPath);
string url = apiUrl;
if(!url.EndsWith("/"))
{
url += "/";
}
if(!url.EndsWith("/api/", StringComparison.CurrentCultureIgnoreCase))
{
url += "api/";
}
url += "file";
var deployFile = new DeployFileDto
{
FileData = File.ReadAllBytes(zipPath),
FileName = Path.GetFileName(zipPath)
};
string fileId;
using(var client = new JsonServiceClient(url))
{
_logger.Debug("Posting file {0} to URL {1}", zipPath, url);
//var x = client.Send<DeployFileDto>(deployFile);
var fileToUpload = new FileInfo(zipPath);
var response = client.PostFile<DeployFileDto>(url,
fileToUpload, MimeTypes.GetMimeType(fileToUpload.Name));
_logger.Debug("Done posting file {0} to URL {1}, returned fileId {2} and fileStorageId {3}", zipPath, url, response.Id, response.FileStorageId);
}
throw new NotImplementedException("Still need to create build object...");
_logger.Info("Done publishing directory {0} to URL {1}", directoryPath, apiUrl);
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NLog;
using ServiceStack.Common.Web;
using ServiceStack.ServiceClient.Web;
using Sriracha.Deploy.Data.Dto;
namespace Sriracha.Deploy.Data.Impl
{
public class BuildPublisher : IBuildPublisher
{
private readonly IZipper _zipper;
private readonly Logger _logger;
public BuildPublisher(IZipper zipper, Logger logger)
{
_zipper = DIHelper.VerifyParameter(zipper);
_logger = DIHelper.VerifyParameter(logger);
}
public void PublishDirectory(string directoryPath, string apiUrl)
{
_logger.Info("Start publishing directory {0} to URL {1}", directoryPath, apiUrl);
string zipPath = Path.ChangeExtension(Path.GetTempFileName(), ".zip");
if(!Directory.Exists(directoryPath))
{
throw new DirectoryNotFoundException(string.Format("Publish directory \"{0}\" not found", directoryPath));
}
_zipper.ZipDirectory(directoryPath, zipPath);
string url = apiUrl;
if(!url.EndsWith("/"))
{
url += "/";
}
if(!url.EndsWith("/api/", StringComparison.CurrentCultureIgnoreCase))
{
url += "api/";
}
url += "file";
var deployFile = new DeployFileDto
{
FileData = File.ReadAllBytes(zipPath),
FileName = Path.GetFileName(zipPath)
};
string fileId;
using(var client = new JsonServiceClient(url))
{
_logger.Debug("Posting file {0} to URL {1}", zipPath, url);
//var x = client.Send<DeployFileDto>(deployFile);
var fileToUpload = new FileInfo(zipPath);
var response = client.PostFile<DeployFileDto>(url,
fileToUpload, MimeTypes.GetMimeType(fileToUpload.Name));
_logger.Debug("Done posting file {0} to URL {1}, returned fileId {2} and fileStorageId {3}", zipPath, url, response.Id, response.FileStorageId);
}
throw NotImplementedException("Still need to create build object...");
_logger.Info("Done publishing directory {0} to URL {1}", directoryPath, apiUrl);
}
}
}
|
mit
|
C#
|
71fcbcd1ff922586b1816aafc2a6a50c5f90302b
|
Change version.
|
mntone/TwitterVideoUploader
|
Mntone.TwitterVideoUploader/Properties/AssemblyInfo.cs
|
Mntone.TwitterVideoUploader/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Mntone.TwitterVideoUploader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("mntone")]
[assembly: AssemblyProduct("Mntone.TwitterVideoUploader")]
[assembly: AssemblyCopyright("Copyright © 2015 mntone")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Mntone.TwitterVideoUploader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("mntone")]
[assembly: AssemblyProduct("Mntone.TwitterVideoUploader")]
[assembly: AssemblyCopyright("Copyright © 2015 mntone")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
6857014720ba871e10c1f374972caa4573d4d8e4
|
Fix frmAnswers
|
Hli4S/TestMeApp
|
TestME/frmAnswers.cs
|
TestME/frmAnswers.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TestME
{
public partial class frmAnswers : Form
{
Question Q;
public frmAnswers(Question quest)
{
InitializeComponent();
Q = quest;
}
private void frmAnswers_Load(object sender, EventArgs e)
{
txtAddQ.Text = Q.question;
lblDifficultylvl.Text = Q.dlevel.ToString();
for (int i = 0; i < Q.anwsers.Count; i++)
{
dgvAnswerList.Rows.Add(Q.anwsers[i].text, Q.anwsers[i].correct);
}
switch (lblDifficultylvl.Text)
{
case "1":
lblDifficultylvl.ForeColor = Color.ForestGreen;
break;
case "2":
lblDifficultylvl.ForeColor = Color.ForestGreen;
break;
case "3":
lblDifficultylvl.ForeColor = Color.Goldenrod;
break;
case "4":
lblDifficultylvl.ForeColor = Color.OrangeRed;
break;
case "5":
lblDifficultylvl.ForeColor = Color.OrangeRed;
break;
}
}
private void btnMin_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TestME
{
public partial class frmAnswers : Form
{
public frmAnswers(Question quest)
{
InitializeComponent();
}
private void frmAnswers_Load(object sender, EventArgs e)
{
switch (lblDifficultylvl.Text)
{
case "1":
lblDifficultylvl.ForeColor = Color.ForestGreen;
break;
case "2":
lblDifficultylvl.ForeColor = Color.ForestGreen;
break;
case "3":
lblDifficultylvl.ForeColor = Color.Goldenrod;
break;
case "4":
lblDifficultylvl.ForeColor = Color.OrangeRed;
break;
case "5":
lblDifficultylvl.ForeColor = Color.OrangeRed;
break;
}
}
private void btnMin_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
|
mit
|
C#
|
e8215c3693341515d382d310f8f4bdc3ad852e89
|
Remove dead comments
|
tmds/Tmds.DBus
|
UnixMonoTransport.cs
|
UnixMonoTransport.cs
|
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using Mono.Unix;
using Mono.Unix.Native;
namespace NDesk.DBus
{
public class UnixMonoTransport : Transport, IAuthenticator
{
protected Socket socket;
public UnixMonoTransport (string path, bool @abstract)
{
if (@abstract)
socket = OpenAbstractUnix (path);
else
socket = OpenUnix (path);
socket.Blocking = true;
SocketHandle = (long)socket.Handle;
//Stream = new UnixStream ((int)socket.Handle);
Stream = new NetworkStream (socket);
}
public override string AuthString ()
{
long uid = UnixUserInfo.GetRealUserId ();
return uid.ToString ();
}
protected Socket OpenAbstractUnix (string path)
{
AbstractUnixEndPoint ep = new AbstractUnixEndPoint (path);
Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0);
client.Connect (ep);
return client;
}
public Socket OpenUnix (string path)
{
UnixEndPoint remoteEndPoint = new UnixEndPoint (path);
Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0);
client.Connect (remoteEndPoint);
return client;
}
}
}
|
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using Mono.Unix;
using Mono.Unix.Native;
namespace NDesk.DBus
{
public class UnixMonoTransport : Transport, IAuthenticator
{
/*
public UnixMonoTransport (int fd)
{
}
*/
protected Socket socket;
public UnixMonoTransport (string path, bool @abstract)
{
if (@abstract)
socket = OpenAbstractUnix (path);
else
socket = OpenUnix (path);
socket.Blocking = true;
SocketHandle = (long)socket.Handle;
//Stream = new UnixStream ((int)socket.Handle);
Stream = new NetworkStream (socket);
}
public override string AuthString ()
{
long uid = UnixUserInfo.GetRealUserId ();
return uid.ToString ();
}
protected Socket OpenAbstractUnix (string path)
{
/*
byte[] p = System.Text.Encoding.Default.GetBytes (path);
SocketAddress sa = new SocketAddress (AddressFamily.Unix, 2 + 1 + p.Length);
sa[2] = 0; //null prefix for abstract sockets, see unix(7)
for (int i = 0 ; i != p.Length ; i++)
sa[i+3] = p[i];
//TODO: this uglyness is a limitation of Mono.Unix
UnixEndPoint remoteEndPoint = new UnixEndPoint ("foo");
EndPoint ep = remoteEndPoint.Create (sa);
*/
AbstractUnixEndPoint ep = new AbstractUnixEndPoint (path);
Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0);
client.Connect (ep);
return client;
}
public Socket OpenUnix (string path)
{
UnixEndPoint remoteEndPoint = new UnixEndPoint (path);
Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0);
client.Connect (remoteEndPoint);
return client;
}
}
}
|
mit
|
C#
|
fab0ee9530775c953f4f4a436d94a19aeece0aed
|
Add a Table type arg to MDTable ctor
|
kiootic/dnlib,ilkerhalil/dnlib,Arthur2e5/dnlib,picrap/dnlib,modulexcite/dnlib,ZixiangBoy/dnlib,yck1509/dnlib,jorik041/dnlib,0xd4d/dnlib
|
src/DotNet/Writer/MDTable.cs
|
src/DotNet/Writer/MDTable.cs
|
using System.Collections.Generic;
using dot10.DotNet.MD;
namespace dot10.DotNet.Writer {
class MDTable<T> {
Table table;
Dictionary<T, uint> cachedDict;
List<T> cached;
/// <summary>
/// Gets the table type
/// </summary>
public Table Table {
get { return table; }
}
/// <summary>
/// <c>true</c> if the table is empty
/// </summary>
public bool IsEmpty {
get { return cached.Count == 0; }
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="table">The table type</param>
/// <param name="equalityComparer">Equality comparer</param>
public MDTable(Table table, IEqualityComparer<T> equalityComparer) {
this.table = table;
this.cachedDict = new Dictionary<T, uint>(equalityComparer);
this.cached = new List<T>();
}
/// <summary>
/// Adds a row. If the row already exists, returns a rid to the existing one, else
/// it's created and a new rid is returned.
/// </summary>
/// <param name="row">The row. It's now owned by us and can NOT be modified by the caller.</param>
/// <returns>The RID (row ID) of the row</returns>
public uint Add(T row) {
uint rid;
if (cachedDict.TryGetValue(row, out rid))
return rid;
return Create(row);
}
/// <summary>
/// Creates a new row even if this row already exists.
/// </summary>
/// <param name="row">The row. It's now owned by us and can NOT be modified by the caller.</param>
/// <returns>The RID (row ID) of the row</returns>
public uint Create(T row) {
uint rid = (uint)cached.Count + 1;
if (!cachedDict.ContainsKey(row))
cachedDict[row] = rid;
cached.Add(row);
return rid;
}
}
}
|
using System.Collections.Generic;
namespace dot10.DotNet.Writer {
class MDTable<T> {
Dictionary<T, uint> cachedDict;
List<T> cached;
/// <summary>
/// <c>true</c> if the table is empty
/// </summary>
public bool IsEmpty {
get { return cached.Count == 0; }
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="equalityComparer">Equality comparer</param>
public MDTable(IEqualityComparer<T> equalityComparer) {
cachedDict = new Dictionary<T, uint>(equalityComparer);
cached = new List<T>();
}
/// <summary>
/// Adds a row. If the row already exists, returns a rid to the existing one, else
/// it's created and a new rid is returned.
/// </summary>
/// <param name="row">The row. It's now owned by us and can NOT be modified by the caller.</param>
/// <returns>The RID (row ID) of the row</returns>
public uint Add(T row) {
uint rid;
if (cachedDict.TryGetValue(row, out rid))
return rid;
return Create(row);
}
/// <summary>
/// Creates a new row even if this row already exists.
/// </summary>
/// <param name="row">The row. It's now owned by us and can NOT be modified by the caller.</param>
/// <returns>The RID (row ID) of the row</returns>
public uint Create(T row) {
uint rid = (uint)cached.Count + 1;
if (!cachedDict.ContainsKey(row))
cachedDict[row] = rid;
cached.Add(row);
return rid;
}
}
}
|
mit
|
C#
|
866c3542487371bede9f9b5dcb8ba55fb6da0e85
|
Update access denied page
|
SkillsFundingAgency/das-providerapprenticeshipsservice,SkillsFundingAgency/das-providerapprenticeshipsservice,SkillsFundingAgency/das-providerapprenticeshipsservice
|
src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Error/_Error403.cshtml
|
src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Error/_Error403.cshtml
|
@{
ViewBag.Title = "Access denied - Error 403";
ViewBag.PageId = "error-403";
ViewBag.HideNavBar = true;
}
<main id="content" role="main" class="error-403">
<div class="grid-row">
<div class="column-two-thirds">
<div class="hgroup">
<h1 class="heading-xlarge">
You do not have permission to access this page
</h1>
</div>
<div class="inner">
<p>
If you think you should have permission to access this page or want to confirm what permissions you have, contact an account owner.
</p>
<p>
<a href="@Url.Action("Index", "Account")" target="_blank"> Go back to home page </a>
</p>
</div>
</div>
</div>
</main>
|
@{
ViewBag.Title = "Access denied - Error 403";
ViewBag.PageId = "error-403";
ViewBag.HideNavBar = true;
}
<main id="content" role="main" class="error-403">
<div class="grid-row">
<div class="column-two-thirds">
<div class="hgroup">
<h1 class="heading-xlarge">
Access denied
</h1>
</div>
<div class="inner">
<p>
You don’t have permission to access the Apprenticeship Service.
</p>
<p>
If you want to access the service, you’ll need to contact your organisation’s Information Management Services system (Idams) super user.
</p>
<h2 class="heading-medium">Help</h2>
<p>
You can contact the Apprenticeship Service for advice or help on how to use the service.
</p>
<h3 class="heading-small">Apprenticeship Service</h3>
<p>
Telephone: 0800 015 0600 <a href="https://www.gov.uk/call-charges" target="_blank">Find out about call charges</a>
</p>
</div>
</div>
</div>
</main>
|
mit
|
C#
|
fdee45a5d4396adbd9fb96fa2e488fbc39657924
|
Handle the TwoHour time interval for strategies - was defaulting to 15
|
nwoolls/MultiMiner,IWBWbiz/MultiMiner,nwoolls/MultiMiner,IWBWbiz/MultiMiner
|
MultiMiner.Win/Extensions/TimeIntervalExtensions.cs
|
MultiMiner.Win/Extensions/TimeIntervalExtensions.cs
|
namespace MultiMiner.Win.Extensions
{
static class TimeIntervalExtensions
{
public static int ToMinutes(this MultiMiner.Win.ApplicationConfiguration.TimerInterval timerInterval)
{
int coinStatsMinutes;
switch (timerInterval)
{
case ApplicationConfiguration.TimerInterval.FiveMinutes:
coinStatsMinutes = 5;
break;
case ApplicationConfiguration.TimerInterval.ThirtyMinutes:
coinStatsMinutes = 30;
break;
case ApplicationConfiguration.TimerInterval.OneHour:
coinStatsMinutes = 1 * 60;
break;
case ApplicationConfiguration.TimerInterval.TwoHours:
coinStatsMinutes = 2 * 60;
break;
case ApplicationConfiguration.TimerInterval.ThreeHours:
coinStatsMinutes = 3 * 60;
break;
case ApplicationConfiguration.TimerInterval.SixHours:
coinStatsMinutes = 6 * 60;
break;
case ApplicationConfiguration.TimerInterval.TwelveHours:
coinStatsMinutes = 12 * 60;
break;
default:
coinStatsMinutes = 15;
break;
}
return coinStatsMinutes;
}
}
}
|
namespace MultiMiner.Win.Extensions
{
static class TimeIntervalExtensions
{
public static int ToMinutes(this MultiMiner.Win.ApplicationConfiguration.TimerInterval timerInterval)
{
int coinStatsMinutes;
switch (timerInterval)
{
case ApplicationConfiguration.TimerInterval.FiveMinutes:
coinStatsMinutes = 5;
break;
case ApplicationConfiguration.TimerInterval.ThirtyMinutes:
coinStatsMinutes = 30;
break;
case ApplicationConfiguration.TimerInterval.OneHour:
coinStatsMinutes = 1 * 60;
break;
case ApplicationConfiguration.TimerInterval.ThreeHours:
coinStatsMinutes = 3 * 60;
break;
case ApplicationConfiguration.TimerInterval.SixHours:
coinStatsMinutes = 6 * 60;
break;
case ApplicationConfiguration.TimerInterval.TwelveHours:
coinStatsMinutes = 12 * 60;
break;
default:
coinStatsMinutes = 15;
break;
}
return coinStatsMinutes;
}
}
}
|
mit
|
C#
|
627114abeca6f0d6d7e5e0e0a5f9e463270bd59b
|
Improve test case.
|
NeoAdonis/osu,DrabWeb/osu,peppy/osu,2yangk23/osu,DrabWeb/osu,naoey/osu,peppy/osu,Damnae/osu,2yangk23/osu,osu-RP/osu-RP,smoogipoo/osu,EVAST9919/osu,ppy/osu,UselessToucan/osu,johnneijzen/osu,Nabile-Rahmani/osu,RedNesto/osu,Drezi126/osu,DrabWeb/osu,ppy/osu,tacchinotacchi/osu,UselessToucan/osu,naoey/osu,UselessToucan/osu,ZLima12/osu,Frontear/osuKyzer,peppy/osu,NeoAdonis/osu,EVAST9919/osu,johnneijzen/osu,nyaamara/osu,peppy/osu-new,ppy/osu,smoogipoo/osu,NeoAdonis/osu,naoey/osu,smoogipooo/osu,ZLima12/osu,smoogipoo/osu
|
osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs
|
osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Framework.Testing;
using osu.Framework.Timing;
using osu.Game.Modes.Objects;
using osu.Game.Screens.Play;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseSongProgress : TestCase
{
public override string Description => @"With fake data";
private SongProgress progress;
public override void Reset()
{
base.Reset();
Add(progress = new SongProgress
{
AudioClock = new StopwatchClock(true),
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
});
AddStep("Toggle Bar", progress.ToggleBar);
AddWaitStep(5);
AddStep("Toggle Bar", progress.ToggleBar);
AddWaitStep(2);
AddRepeatStep("New Values", displayNewValues, 5);
displayNewValues();
}
private void displayNewValues()
{
List<HitObject> objects = new List<HitObject>();
for (double i = 0; i < 5000; i += RNG.NextDouble() * 10 + i / 1000)
objects.Add(new HitObject { StartTime = i });
progress.Objects = objects;
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Framework.Testing;
using osu.Game.Modes.Objects;
using osu.Game.Screens.Play;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseSongProgress : TestCase
{
public override string Description => @"With fake data";
private SongProgress progress;
public override void Reset()
{
base.Reset();
Add(progress = new SongProgress
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
});
AddStep("Toggle Bar", progress.ToggleBar);
AddWaitStep(5);
//AddStep("Toggle Bar", progress.ToggleVisibility);
//AddStep("New Values", displayNewValues);
displayNewValues();
}
private void displayNewValues()
{
List<HitObject> objects = new List<HitObject>();
for (double i = 0; i < 2000; i += RNG.NextDouble() * 10 + i / 1000)
objects.Add(new HitObject { StartTime = i });
progress.Objects = objects;
}
}
}
|
mit
|
C#
|
b65031ce67432357e607037b99e53fb1f9109c4f
|
Update ActionCollection.cs
|
wieslawsoltes/AvaloniaBehaviors,wieslawsoltes/AvaloniaBehaviors
|
src/Avalonia.Xaml.Interactivity/ActionCollection.cs
|
src/Avalonia.Xaml.Interactivity/ActionCollection.cs
|
using System;
using System.Collections.Specialized;
using Avalonia.Collections;
namespace Avalonia.Xaml.Interactivity;
/// <summary>
/// Represents a collection of <see cref="IAction"/>'s.
/// </summary>
public class ActionCollection : AvaloniaList<IAvaloniaObject>
{
/// <summary>
/// Initializes a new instance of the <see cref="ActionCollection"/> class.
/// </summary>
public ActionCollection()
{
CollectionChanged += ActionCollection_CollectionChanged;
}
private void ActionCollection_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs eventArgs)
{
var collectionChangedAction = eventArgs.Action;
if (collectionChangedAction == NotifyCollectionChangedAction.Reset)
{
foreach (var item in this)
{
VerifyType(item);
}
}
else if (collectionChangedAction == NotifyCollectionChangedAction.Add
|| collectionChangedAction == NotifyCollectionChangedAction.Replace)
{
var changedItem = eventArgs.NewItems?[0] as IAvaloniaObject;
VerifyType(changedItem);
}
}
private static void VerifyType(IAvaloniaObject? item)
{
if (item is null)
{
return;
}
if (item is not IAction)
{
throw new InvalidOperationException(
$"Only {nameof(IAction)} types are supported in an {nameof(ActionCollection)}.");
}
}
}
|
using System;
using System.Collections.Specialized;
using Avalonia.Collections;
namespace Avalonia.Xaml.Interactivity;
/// <summary>
/// Represents a collection of <see cref="IAction"/>'s.
/// </summary>
public class ActionCollection : AvaloniaList<IAvaloniaObject>
{
/// <summary>
/// Initializes a new instance of the <see cref="ActionCollection"/> class.
/// </summary>
public ActionCollection()
{
CollectionChanged += ActionCollection_CollectionChanged;
}
private void ActionCollection_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs eventArgs)
{
var collectionChangedAction = eventArgs.Action;
if (collectionChangedAction == NotifyCollectionChangedAction.Reset)
{
foreach (var item in this)
{
VerifyType(item);
}
}
else if (collectionChangedAction is NotifyCollectionChangedAction.Add or NotifyCollectionChangedAction.Replace)
{
var changedItem = eventArgs.NewItems?[0] as IAvaloniaObject;
VerifyType(changedItem);
}
}
private static void VerifyType(IAvaloniaObject? item)
{
if (item is null)
{
return;
}
if (item is not IAction)
{
throw new InvalidOperationException(
$"Only {nameof(IAction)} types are supported in an {nameof(ActionCollection)}.");
}
}
}
|
mit
|
C#
|
94d9fa400ec79f52812b3ec1ff9c264090abb704
|
Add rule above form buttons for preferences
|
martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site
|
src/LondonTravel.Site/Views/Home/_UpdateForm.cshtml
|
src/LondonTravel.Site/Views/Home/_UpdateForm.cshtml
|
@model LinePreferencesViewModel
<form asp-route="@SiteRoutes.UpdateLinePreferences" class="js-preferences-container" method="post">
<input type="hidden" name="@(nameof(UpdateLinePreferencesViewModel.ETag))" value="@Model.ETag" />
@if (Model.HasFavourites)
{
<div class="row">
<h4 class="col-xs-offset-1">@SR.FavoriteLinesTitle("hide js-favorites-count", Model.FavouriteLines.Count())</h4>
@await Html.PartialAsync("_Lines", Model.FavouriteLines)
</div>
}
@if (Model.OtherLines.Any())
{
<div class="row">
@{
var classes = "hide js-other-count";
var count = Model.OtherLines.Count();
var otherTitle = Model.HasFavourites ?
SR.OtherLinesTitle(classes, count) :
SR.AvailableLinesTitle(classes, count);
}
<h4 class="col-xs-offset-1">@otherTitle</h4>
@await Html.PartialAsync("_Lines", Model.OtherLines)
</div>
}
<hr />
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-md-3 col-md-offset-1 btn-wrapper">
<button type="submit" class="btn btn-primary btn-block js-preferences-save" title="@SR.SavePreferencesButtonAltText" data-toggle="modal" data-target=".update-preferences-modal">@SR.SavePreferencesButtonText</button>
</div>
<div class="col-xs-10 col-xs-offset-1 col-md-3 col-md-offset-0 btn-wrapper">
<button type="button" class="btn btn-info hide btn-block js-preferences-clear" title="@SR.ClearPreferencesButtonAltText">@SR.ClearPreferencesButtonText</button>
</div>
<div class="col-xs-10 col-xs-offset-1 col-md-3 col-md-offset-0 btn-wrapper">
<button type="button" class="btn btn-info hide btn-block js-preferences-reset" title="@SR.ResetPreferencesButtonAltText">@SR.ResetPreferencesButtonText</button>
</div>
</div>
</form>
|
@model LinePreferencesViewModel
<form asp-route="@SiteRoutes.UpdateLinePreferences" class="js-preferences-container" method="post">
<input type="hidden" name="@(nameof(UpdateLinePreferencesViewModel.ETag))" value="@Model.ETag" />
@if (Model.HasFavourites)
{
<div class="row">
<h4 class="col-xs-offset-1">@SR.FavoriteLinesTitle("hide js-favorites-count", Model.FavouriteLines.Count())</h4>
@await Html.PartialAsync("_Lines", Model.FavouriteLines)
</div>
}
@if (Model.OtherLines.Any())
{
<div class="row">
@{
var classes = "hide js-other-count";
var count = Model.OtherLines.Count();
var otherTitle = Model.HasFavourites ?
SR.OtherLinesTitle(classes, count) :
SR.AvailableLinesTitle(classes, count);
}
<h4 class="col-xs-offset-1">@otherTitle</h4>
@await Html.PartialAsync("_Lines", Model.OtherLines)
</div>
}
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-md-3 col-md-offset-1 btn-wrapper">
<button type="submit" class="btn btn-primary btn-block js-preferences-save" title="@SR.SavePreferencesButtonAltText" data-toggle="modal" data-target=".update-preferences-modal">@SR.SavePreferencesButtonText</button>
</div>
<div class="col-xs-10 col-xs-offset-1 col-md-3 col-md-offset-0 btn-wrapper">
<button type="button" class="btn btn-info hide btn-block js-preferences-clear" title="@SR.ClearPreferencesButtonAltText">@SR.ClearPreferencesButtonText</button>
</div>
<div class="col-xs-10 col-xs-offset-1 col-md-3 col-md-offset-0 btn-wrapper">
<button type="button" class="btn btn-info hide btn-block js-preferences-reset" title="@SR.ResetPreferencesButtonAltText">@SR.ResetPreferencesButtonText</button>
</div>
</div>
</form>
|
apache-2.0
|
C#
|
7a9cd9451e8361189bef9d7bd3c7a0bbbd93115e
|
Update version to 1.3
|
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
|
src/resharper-unity/Properties/AssemblyInfo.cs
|
src/resharper-unity/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("resharper-unity")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("resharper-unity")]
[assembly: AssemblyCopyright("Copyright © JetBrains 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b75e013c-9390-422e-99e1-ba0e676d25c8")]
// 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.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("resharper-unity")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("resharper-unity")]
[assembly: AssemblyCopyright("Copyright © JetBrains 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b75e013c-9390-422e-99e1-ba0e676d25c8")]
// 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.2.2.0")]
[assembly: AssemblyFileVersion("1.2.2.0")]
[assembly: AssemblyInformationalVersion("1.2.2")]
|
apache-2.0
|
C#
|
7a23a9475c0b1b9d4d31f122baa1a279f46854a3
|
Update doc comment.
|
JohanLarsson/Gu.Reactive
|
Gu.Reactive/Internals/ItemsTracker/TrackedItemPropertyChangedEventHandler.cs
|
Gu.Reactive/Internals/ItemsTracker/TrackedItemPropertyChangedEventHandler.cs
|
namespace Gu.Reactive.Internals
{
using System.ComponentModel;
/// <summary>
/// Raised when a tracked property changes.
/// </summary>
/// <param name="item">The tracker that notified the event.</param>
/// <param name="sender">The instance that raised the event, can be the collection.</param>
/// <param name="e">The property changed event args.</param>
/// <param name="sourceAndValue">The source and of the value. Can be null.</param>
internal delegate void TrackedItemPropertyChangedEventHandler<in TItem, TProperty>(TItem item, object sender, PropertyChangedEventArgs e, SourceAndValue<INotifyPropertyChanged, TProperty> sourceAndValue);
}
|
namespace Gu.Reactive.Internals
{
using System.ComponentModel;
/// <summary>
/// Raised when a tracked property changes.
/// </summary>
/// <param name="item">The tracker that notified the event.</param>
/// <param name="sender">The instance that raised the event.</param>
/// <param name="e">The property changed event args.</param>
/// <param name="sourceAndValue">The source and of the value. Can be null.</param>
internal delegate void TrackedItemPropertyChangedEventHandler<in TItem, TProperty>(TItem item, object sender, PropertyChangedEventArgs e, SourceAndValue<INotifyPropertyChanged, TProperty> sourceAndValue);
}
|
mit
|
C#
|
ab45b29920247d56c3837f38aa64e849d8085116
|
bump version
|
Willster419/RelicModManager,Willster419/RelhaxModpack,Willster419/RelhaxModpack
|
RelhaxModpack/RelhaxModpack/Properties/AssemblyInfo.cs
|
RelhaxModpack/RelhaxModpack/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("Relhax Modpack")]
[assembly: AssemblyDescription("The fastest WoT modpack installer in the world")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Relic Gaming Community")]
[assembly: AssemblyProduct("Relhax Modpack Installer")]
[assembly: AssemblyCopyright("Copyright © 2020 Willard Wider")]
[assembly: AssemblyTrademark("The fastest WoT modpack installer in the world")]
[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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: NeutralResourcesLanguage("en-US")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("Relhax Modpack")]
[assembly: AssemblyDescription("The fastest WoT modpack installer in the world")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Relic Gaming Community")]
[assembly: AssemblyProduct("Relhax Modpack Installer")]
[assembly: AssemblyCopyright("Copyright © 2020 Willard Wider")]
[assembly: AssemblyTrademark("The fastest WoT modpack installer in the world")]
[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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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.2.4.1")]
[assembly: AssemblyFileVersion("1.2.4.1")]
[assembly: NeutralResourcesLanguage("en-US")]
|
apache-2.0
|
C#
|
8be3c33a1ce0856900ba301745e6c27cd8ee1044
|
switch create rule to post request
|
yoliva/game-of-drones,yoliva/game-of-drones,yoliva/game-of-drones
|
Source/GameOfDrones.API/Controllers/RulesController.cs
|
Source/GameOfDrones.API/Controllers/RulesController.cs
|
using System.Linq;
using System.Web.Http;
using GameOfDrones.API.Models;
using GameOfDrones.Domain.Entities;
using GameOfDrones.Domain.Repositories;
namespace GameOfDrones.API.Controllers
{
[RoutePrefix("api/v1/rules")]
public class RulesController : ApiController
{
private readonly IGameOfDronesRepository _gameOfDronesRepository;
public RulesController(IGameOfDronesRepository gameOfDronesRepository)
{
_gameOfDronesRepository = gameOfDronesRepository;
}
[Route("GetAll")]
public IHttpActionResult GetAllRules()
{
return Ok(_gameOfDronesRepository.GetAllRules());
}
[Route("UpdateDefault/{ruleId}")]
public IHttpActionResult PutUpdateDefaultRule(int ruleId)
{
var rule = _gameOfDronesRepository.GetRuleById(ruleId);
if (rule == null)
return NotFound();
_gameOfDronesRepository.GetCurrentRule().IsCurrent = false;
rule.IsCurrent = true;
_gameOfDronesRepository.SaveChanges();
return Ok(rule);
}
[Route("GetCurrent")]
public IHttpActionResult GetCurrentRule()
{
return Ok(_gameOfDronesRepository.GetAllRules().FirstOrDefault(x => x.IsCurrent));
}
[Route("create")]
public IHttpActionResult PostCreateRule([FromBody]RuleViewModel data)
{
if (!ModelState.IsValid)
return BadRequest();
var rule = new Rule()
{
Name = data.Name,
RuleDefinition = data.RuleDefinition
};
_gameOfDronesRepository.AddRule(rule);
_gameOfDronesRepository.SaveChanges();
return Ok(rule);
}
}
}
|
using System.Linq;
using System.Web.Http;
using GameOfDrones.API.Models;
using GameOfDrones.Domain.Entities;
using GameOfDrones.Domain.Repositories;
namespace GameOfDrones.API.Controllers
{
[RoutePrefix("api/v1/rules")]
public class RulesController : ApiController
{
private readonly IGameOfDronesRepository _gameOfDronesRepository;
public RulesController(IGameOfDronesRepository gameOfDronesRepository)
{
_gameOfDronesRepository = gameOfDronesRepository;
}
[Route("GetAll")]
public IHttpActionResult GetAllRules()
{
return Ok(_gameOfDronesRepository.GetAllRules());
}
[Route("UpdateDefault/{ruleId}")]
public IHttpActionResult PutUpdateDefaultRule(int ruleId)
{
var rule = _gameOfDronesRepository.GetRuleById(ruleId);
if (rule == null)
return NotFound();
_gameOfDronesRepository.GetCurrentRule().IsCurrent = false;
rule.IsCurrent = true;
_gameOfDronesRepository.SaveChanges();
return Ok(rule);
}
[Route("GetCurrent")]
public IHttpActionResult GetCurrentRule()
{
return Ok(_gameOfDronesRepository.GetAllRules().FirstOrDefault(x => x.IsCurrent));
}
[Route("create")]
public IHttpActionResult PutCreateRule([FromBody]RuleViewModel data)
{
if (!ModelState.IsValid)
return BadRequest();
var rule = new Rule()
{
Name = data.Name,
RuleDefinition = data.RuleDefinition
};
_gameOfDronesRepository.AddRule(rule);
_gameOfDronesRepository.SaveChanges();
return Ok(rule);
}
}
}
|
mit
|
C#
|
3a9e70a15358ae30fb32a85e1a2d1a5efa20a118
|
Add relative figure
|
whoknewdk/CardsApp,whoknewdk/CardsApp
|
CardsApp.Viewer/Views/Home/Index.cshtml
|
CardsApp.Viewer/Views/Home/Index.cshtml
|
<!DOCTYPE html>
<html data-ng-app="app">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
@Styles.Render("~/Content/css")
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/app/app.js"></script>
<script src="~/Scripts/app/home-controller.js"></script>
</head>
<body>
<nav>navigation</nav>
<div class="pure-g" data-ng-controller="homeController">
<aside class="pure-u-1-8" style="background-color: #FF0000"></aside>
<main class="pure-u-3-4" style="background-color: #00FF00">
<div class="wrapper" style="">
<article style="box-shadow: 3px 3px 5px 0px rgba(0,0,0,0.75); border: solid 1px #000">
<figure style="width: 30%; height: 20%; margin-left: 5%; margin-top: 5%; background-color: brown"></figure>
</article>
</div>
@*<ul>
<li data-ng-repeat="c in cards">{{ c }}</li>
</ul>*@
</main>
<aside class="pure-u-1-8" style="background-color: #FF0000"></aside>
</div>
<footer>footer</footer>
</body>
</html>
|
<!DOCTYPE html>
<html data-ng-app="app">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
@Styles.Render("~/Content/css")
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/app/app.js"></script>
<script src="~/Scripts/app/home-controller.js"></script>
</head>
<body>
<nav>navigation</nav>
<div class="pure-g" data-ng-controller="homeController">
<aside class="pure-u-1-8" style="background-color: #FF0000"></aside>
<main class="pure-u-3-4" style="background-color: #00FF00">
<div class="wrapper" style="max-height: 80%">
<article style="box-shadow: 3px 3px 5px 0px rgba(0,0,0,0.75); border: solid 1px #000">
Card 1
</article>
</div>
@*<ul>
<li data-ng-repeat="c in cards">{{ c }}</li>
</ul>*@
</main>
<aside class="pure-u-1-8" style="background-color: #FF0000"></aside>
</div>
<footer>footer</footer>
</body>
</html>
|
mit
|
C#
|
4b9fc41c212277171bfe44bb191382482eb4ff67
|
simplify confirmation words selection
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Fluent/ViewModels/CreateWallet/ConfirmRecoveryWordsViewModel.cs
|
WalletWasabi.Fluent/ViewModels/CreateWallet/ConfirmRecoveryWordsViewModel.cs
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Linq;
using System.Windows.Input;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.CreateWallet
{
public class ConfirmRecoveryWordsViewModel : RoutableViewModel
{
private readonly ReadOnlyObservableCollection<RecoveryWordViewModel> _confirmationWords;
private readonly SourceList<RecoveryWordViewModel> _confirmationWordsSourceList;
public ConfirmRecoveryWordsViewModel(NavigationStateViewModel navigationState, List<RecoveryWordViewModel> mnemonicWords, KeyManager keyManager, WalletManager walletManager)
: base(navigationState, NavigationTarget.Dialog)
{
_confirmationWordsSourceList = new SourceList<RecoveryWordViewModel>();
var finishCommandCanExecute =
_confirmationWordsSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.WhenValueChanged(x => x.IsConfirmed)
.Select(x => !_confirmationWordsSourceList.Items.Any(x => !x.IsConfirmed));
NextCommand = ReactiveCommand.Create(
() =>
{
walletManager.AddWallet(keyManager);
navigationState.DialogScreen?.Invoke().Router.NavigationStack.Clear();
},
finishCommandCanExecute);
CancelCommand = ReactiveCommand.Create(() => navigationState.DialogScreen?.Invoke().Router.NavigationStack.Clear());
_confirmationWordsSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.OnItemAdded(x => x.Reset())
.Sort(SortExpressionComparer<RecoveryWordViewModel>.Ascending(x => x.Index))
.Bind(out _confirmationWords)
.Subscribe();
// Select 4 random words to confirm.
_confirmationWordsSourceList.AddRange(mnemonicWords.OrderBy(x => new Random().NextDouble()).Take(4));
}
public ReadOnlyObservableCollection<RecoveryWordViewModel> ConfirmationWords => _confirmationWords;
public ICommand NextCommand { get; }
public ICommand CancelCommand { get; }
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Linq;
using System.Windows.Input;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.CreateWallet
{
public class ConfirmRecoveryWordsViewModel : RoutableViewModel
{
private readonly ReadOnlyObservableCollection<RecoveryWordViewModel> _confirmationWords;
private readonly SourceList<RecoveryWordViewModel> _confirmationWordsSourceList;
public ConfirmRecoveryWordsViewModel(NavigationStateViewModel navigationState, List<RecoveryWordViewModel> mnemonicWords, KeyManager keyManager, WalletManager walletManager)
: base(navigationState, NavigationTarget.Dialog)
{
_confirmationWordsSourceList = new SourceList<RecoveryWordViewModel>();
var finishCommandCanExecute =
_confirmationWordsSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.WhenValueChanged(x => x.IsConfirmed)
.Select(x => !_confirmationWordsSourceList.Items.Any(x => !x.IsConfirmed));
NextCommand = ReactiveCommand.Create(
() =>
{
walletManager.AddWallet(keyManager);
navigationState.DialogScreen?.Invoke().Router.NavigationStack.Clear();
},
finishCommandCanExecute);
CancelCommand = ReactiveCommand.Create(() => navigationState.DialogScreen?.Invoke().Router.NavigationStack.Clear());
_confirmationWordsSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.OnItemAdded(x => x.Reset())
.Sort(SortExpressionComparer<RecoveryWordViewModel>.Ascending(x => x.Index))
.Bind(out _confirmationWords)
.Subscribe();
SelectRandomConfirmationWords(mnemonicWords);
}
public ReadOnlyObservableCollection<RecoveryWordViewModel> ConfirmationWords => _confirmationWords;
public ICommand NextCommand { get; }
public ICommand CancelCommand { get; }
private void SelectRandomConfirmationWords(List<RecoveryWordViewModel> mnemonicWords)
{
var random = new Random();
while (_confirmationWordsSourceList.Count != 4)
{
var word = mnemonicWords[random.Next(0, 12)];
if (!_confirmationWordsSourceList.Items.Contains(word))
{
_confirmationWordsSourceList.Add(word);
}
}
}
}
}
|
mit
|
C#
|
84c0bba9db1855e0a0796848741fd20843e4edd2
|
Fix LazyFactoryTemplate description
|
DixonD-git/structuremap,DixonD-git/structuremap,DixonDs/structuremap,DixonDs/structuremap,DixonD-git/structuremap,DixonD-git/structuremap
|
src/StructureMap/Pipeline/Lazy/LazyFactoryTemplate.cs
|
src/StructureMap/Pipeline/Lazy/LazyFactoryTemplate.cs
|
using System;
using StructureMap.Building;
namespace StructureMap.Pipeline.Lazy
{
public class LazyFactoryTemplate : Instance
{
public override string Description
{
get { return "Open Generic Template for Lazy<>"; }
}
// This should never get called because it starts as an open type
public override IDependencySource ToDependencySource(Type pluginType)
{
throw new NotSupportedException();
}
public override IDependencySource ToBuilder(Type pluginType, Policies policies)
{
throw new NotSupportedException();
}
public override Type ReturnedType
{
get { return typeof (Lazy<>); }
}
public override Instance CloseType(Type[] types)
{
var instanceType = typeof (LazyInstance<>).MakeGenericType(types);
return Activator.CreateInstance(instanceType).As<Instance>();
}
}
}
|
using System;
using StructureMap.Building;
namespace StructureMap.Pipeline.Lazy
{
public class LazyFactoryTemplate : Instance
{
public override string Description
{
get { return "Open Generic Template for Func<>"; }
}
// This should never get called because it starts as an open type
public override IDependencySource ToDependencySource(Type pluginType)
{
throw new NotSupportedException();
}
public override IDependencySource ToBuilder(Type pluginType, Policies policies)
{
throw new NotSupportedException();
}
public override Type ReturnedType
{
get { return typeof (Lazy<>); }
}
public override Instance CloseType(Type[] types)
{
var instanceType = typeof (LazyInstance<>).MakeGenericType(types);
return Activator.CreateInstance(instanceType).As<Instance>();
}
}
}
|
apache-2.0
|
C#
|
594011aab84e206901361ea3106f4da1d26aa86f
|
Add missing XML docs to code. bugid: 272
|
MarimerLLC/csla,BrettJaner/csla,rockfordlhotka/csla,BrettJaner/csla,JasonBock/csla,MarimerLLC/csla,jonnybee/csla,BrettJaner/csla,rockfordlhotka/csla,JasonBock/csla,ronnymgm/csla-light,MarimerLLC/csla,ronnymgm/csla-light,jonnybee/csla,jonnybee/csla,rockfordlhotka/csla,JasonBock/csla,ronnymgm/csla-light
|
cslacs/Csla/Serialization/Mobile/NullPlaceholder.cs
|
cslacs/Csla/Serialization/Mobile/NullPlaceholder.cs
|
using System;
namespace Csla.Serialization.Mobile
{
/// <summary>
/// Placeholder for null child objects.
/// </summary>
[Serializable()]
public sealed class NullPlaceholder : IMobileObject
{
#region Constructors
/// <summary>
/// Creates an instance of the type.
/// </summary>
public NullPlaceholder()
{
// Nothing
}
#endregion
#region IMobileObject Members
/// <summary>
/// Method called by MobileFormatter when an object
/// should serialize its data. The data should be
/// serialized into the SerializationInfo parameter.
/// </summary>
/// <param name="info">
/// Object to contain the serialized data.
/// </param>
public void GetState(SerializationInfo info)
{
// Nothing
}
/// <summary>
/// Method called by MobileFormatter when an object
/// should serialize its child references. The data should be
/// serialized into the SerializationInfo parameter.
/// </summary>
/// <param name="info">
/// Object to contain the serialized data.
/// </param>
/// <param name="formatter">
/// Reference to the formatter performing the serialization.
/// </param>
public void GetChildren(SerializationInfo info, MobileFormatter formatter)
{
// Nothing
}
/// <summary>
/// Method called by MobileFormatter when an object
/// should be deserialized. The data should be
/// deserialized from the SerializationInfo parameter.
/// </summary>
/// <param name="info">
/// Object containing the serialized data.
/// </param>
public void SetState(SerializationInfo info)
{
// Nothing
}
/// <summary>
/// Method called by MobileFormatter when an object
/// should deserialize its child references. The data should be
/// deserialized from the SerializationInfo parameter.
/// </summary>
/// <param name="info">
/// Object containing the serialized data.
/// </param>
/// <param name="formatter">
/// Reference to the formatter performing the deserialization.
/// </param>
public void SetChildren(SerializationInfo info, MobileFormatter formatter)
{
// Nothing
}
#endregion
}
}
|
using System;
namespace Csla.Serialization.Mobile
{
/// <summary>
/// Placeholder for null child objects.
/// </summary>
[Serializable()]
public sealed class NullPlaceholder : IMobileObject
{
#region Constructors
public NullPlaceholder()
{
// Nothing
}
#endregion
#region IMobileObject Members
public void GetState(SerializationInfo info)
{
// Nothing
}
public void GetChildren(SerializationInfo info, MobileFormatter formatter)
{
// Nothing
}
public void SetState(SerializationInfo info)
{
// Nothing
}
public void SetChildren(SerializationInfo info, MobileFormatter formatter)
{
// Nothing
}
#endregion
}
}
|
mit
|
C#
|
69c199ccb521327cce0ee6793fecc59753f42507
|
Add assertion to compare LastTag.Count property
|
Brijen/lastfm,realworld666/lastfm
|
src/IF.Lastfm.Core.Tests/Api/Commands/Tag/GetInfoCommandTests.cs
|
src/IF.Lastfm.Core.Tests/Api/Commands/Tag/GetInfoCommandTests.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IF.Lastfm.Core.Api.Commands.Tag;
using IF.Lastfm.Core.Api.Enums;
using IF.Lastfm.Core.Objects;
using IF.Lastfm.Core.Tests.Resources;
using NUnit.Framework;
namespace IF.Lastfm.Core.Tests.Api.Commands.Tag
{
public class GetInfoCommandTests: CommandTestsBase
{
[Test]
public async Task HandleSuccessResponse()
{
//Arrange
const string tagName = "disco";
const string tagUri = "http://www.last.fm/tag/disco";
var command = new GetInfoCommand(MAuth.Object, tagName);
var expectedTag=new LastTag(tagName,tagUri)
{
Reach = 34671,
Count = 172224,
Streamable = true
};
//Act
var response = CreateResponseMessage(Encoding.UTF8.GetString(TagApiResponses.GetInfoSuccess));
var lastResponse = await command.HandleResponse(response);
var tag = lastResponse.Content;
//Assert
Assert.IsTrue(lastResponse.Success);
Assert.AreEqual(expectedTag.Reach,tag.Reach);
Assert.AreEqual(expectedTag.Name, tag.Name);
Assert.AreEqual(expectedTag.Count, tag.Count);
Assert.AreEqual(expectedTag.Streamable, tag.Streamable);
}
[Test]
public async Task HandleErrorResponse()
{
var command = new GetInfoCommand(MAuth.Object, "errorTag");
var response = CreateResponseMessage(Encoding.UTF8.GetString(TagApiResponses.GetInfoError));
var parsed = await command.HandleResponse(response);
Assert.IsFalse(parsed.Success);
Assert.IsTrue(parsed.Status == LastResponseStatus.MissingParameters);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IF.Lastfm.Core.Api.Commands.Tag;
using IF.Lastfm.Core.Api.Enums;
using IF.Lastfm.Core.Objects;
using IF.Lastfm.Core.Tests.Resources;
using NUnit.Framework;
namespace IF.Lastfm.Core.Tests.Api.Commands.Tag
{
public class GetInfoCommandTests: CommandTestsBase
{
[Test]
public async Task HandleSuccessResponse()
{
//Arrange
const string tagName = "disco";
const string tagUri = "http://www.last.fm/tag/disco";
var command = new GetInfoCommand(MAuth.Object, tagName);
var expectedTag=new LastTag(tagName,tagUri)
{
Reach = 34671,
Streamable = true
};
//Act
var response = CreateResponseMessage(Encoding.UTF8.GetString(TagApiResponses.GetInfoSuccess));
var lastResponse = await command.HandleResponse(response);
var tag = lastResponse.Content;
//Assert
Assert.IsTrue(lastResponse.Success);
Assert.AreEqual(expectedTag.Reach,tag.Reach);
Assert.AreEqual(expectedTag.Name, tag.Name);
Assert.AreEqual(expectedTag.Streamable, tag.Streamable);
}
[Test]
public async Task HandleErrorResponse()
{
var command = new GetInfoCommand(MAuth.Object, "errorTag");
var response = CreateResponseMessage(Encoding.UTF8.GetString(TagApiResponses.GetInfoError));
var parsed = await command.HandleResponse(response);
Assert.IsFalse(parsed.Success);
Assert.IsTrue(parsed.Status == LastResponseStatus.MissingParameters);
}
}
}
|
mit
|
C#
|
bf3936140f0cccdfcf5de58d06e850760055920f
|
Change user picture field to PictureUrl
|
comunity/crm
|
crm/CEP/UserProfile.cs
|
crm/CEP/UserProfile.cs
|
// Copyright (c) ComUnity 2015
// Hans Malherbe <hansm@comunity.co.za>
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace CEP
{
public class UserProfile
{
[Key, Required, StringLength(10, MinimumLength = 10, ErrorMessage = "Mobile number must be exactly 10 digits")]
public string Cell { get; set; }
[StringLength(50)]
public string Name { get; set; }
[StringLength(50)]
public string Surname { get; set; }
[StringLength(100)]
public string HouseNumberAndStreetName { get; set; }
[StringLength(10)]
public string PostalCode { get; set; }
[StringLength(50)]
public string Province { get; set; }
[StringLength(2000)]
public string PictureUrl { get; set; }
[StringLength(10)]
public string HomePhone { get; set; }
[StringLength(10)]
public string WorkPhone { get; set; }
[StringLength(350)]
public string Email { get; set; }
[StringLength(13)]
public string IdNumber { get; set; }
[StringLength(100)]
public string CrmContactId { get; set; }
public virtual ICollection<Feedback> Feedbacks { get; set; }
public virtual ICollection<FaultLog> Faults { get; set; }
}
}
|
// Copyright (c) ComUnity 2015
// Hans Malherbe <hansm@comunity.co.za>
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace CEP
{
public class UserProfile
{
[Key, Required, StringLength(10, MinimumLength = 10, ErrorMessage = "Mobile number must be exactly 10 digits")]
public string Cell { get; set; }
[StringLength(50)]
public string Name { get; set; }
[StringLength(50)]
public string Surname { get; set; }
[StringLength(100)]
public string HouseNumberAndStreetName { get; set; }
[StringLength(10)]
public string PostalCode { get; set; }
[StringLength(50)]
public string Province { get; set; }
[StringLength(100)]
public string Picture { get; set; }
[StringLength(10)]
public string HomePhone { get; set; }
[StringLength(10)]
public string WorkPhone { get; set; }
[StringLength(350)]
public string Email { get; set; }
[StringLength(13)]
public string IdNumber { get; set; }
[StringLength(100)]
public string CrmContactId { get; set; }
public virtual ICollection<Feedback> Feedbacks { get; set; }
public virtual ICollection<FaultLog> Faults { get; set; }
}
}
|
mit
|
C#
|
f6742b42c24a9fda597bec0ebd0d68063f00ed78
|
Increase default toleranceSeconds in StopwatchAsserter
|
atata-framework/atata,YevgeniyShunevych/Atata,atata-framework/atata,YevgeniyShunevych/Atata
|
src/Atata.Tests/StopwatchAsserter.cs
|
src/Atata.Tests/StopwatchAsserter.cs
|
using System;
using System.Diagnostics;
using NUnit.Framework;
namespace Atata.Tests
{
public sealed class StopwatchAsserter : IDisposable
{
private readonly Stopwatch watch;
private readonly TimeSpan expectedTime;
private readonly TimeSpan toleranceTime;
public StopwatchAsserter(TimeSpan expectedTime, TimeSpan toleranceTime)
{
this.expectedTime = expectedTime;
this.toleranceTime = toleranceTime;
watch = Stopwatch.StartNew();
}
public static StopwatchAsserter Within(TimeSpan time, TimeSpan toleranceTime)
{
return new StopwatchAsserter(time, toleranceTime);
}
public static StopwatchAsserter Within(double seconds, double toleranceSeconds = 0.8)
{
return new StopwatchAsserter(TimeSpan.FromSeconds(seconds), TimeSpan.FromSeconds(toleranceSeconds));
}
public void Dispose()
{
watch.Stop();
Assert.That(watch.Elapsed, Is.EqualTo(expectedTime).Within(toleranceTime));
}
}
}
|
using System;
using System.Diagnostics;
using NUnit.Framework;
namespace Atata.Tests
{
public sealed class StopwatchAsserter : IDisposable
{
private readonly Stopwatch watch;
private readonly TimeSpan expectedTime;
private readonly TimeSpan toleranceTime;
public StopwatchAsserter(TimeSpan expectedTime, TimeSpan toleranceTime)
{
this.expectedTime = expectedTime;
this.toleranceTime = toleranceTime;
watch = Stopwatch.StartNew();
}
public static StopwatchAsserter Within(TimeSpan time, TimeSpan toleranceTime)
{
return new StopwatchAsserter(time, toleranceTime);
}
public static StopwatchAsserter Within(double seconds, double toleranceSeconds = 0.4)
{
return new StopwatchAsserter(TimeSpan.FromSeconds(seconds), TimeSpan.FromSeconds(toleranceSeconds));
}
public void Dispose()
{
watch.Stop();
Assert.That(watch.Elapsed, Is.EqualTo(expectedTime).Within(toleranceTime));
}
}
}
|
apache-2.0
|
C#
|
e0fd3c21a3b5f7a5b5404c2a74c3a43641970dc1
|
change the http code when the request is completed from create to ok
|
marinoscar/article-parser,marinoscar/article-parser,marinoscar/article-parser
|
Code/api/Controllers/ParserController.cs
|
Code/api/Controllers/ParserController.cs
|
using api.core.Models;
using api.core.Provider;
using api.Security;
using Newtonsoft.Json;
using Swashbuckle.Swagger.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace api.Controllers
{
[TokenAuthentication]
public class ParserController : ApiController
{
[SwaggerOperation("Get")]
[SwaggerResponse(HttpStatusCode.OK)]
[SwaggerResponse(HttpStatusCode.NotFound)]
public HttpResponseMessage Get(string url)
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<ParserResult>(Request, () => {
return parser.ParseFromUrl(url);
});
}
[SwaggerOperation("GetArticles")]
[SwaggerResponse(HttpStatusCode.OK)]
[SwaggerResponse(HttpStatusCode.NotFound)]
[ActionName("GetArticles")]
[HttpGet]
public HttpResponseMessage GetArticles()
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.Execute<IEnumerable<ContentDto>>(Request, HttpStatusCode.OK, () => {
return parser.GetArticles();
});
}
[SwaggerOperation("Persist")]
[SwaggerResponse(HttpStatusCode.Created)]
public HttpResponseMessage Post(ParserResult value)
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<string>(Request, () => {
parser.Persist(value);
return value.Id;
});
}
[SwaggerOperation("Create")]
[SwaggerResponse(HttpStatusCode.Created)]
[HttpPost()]
[ActionName("Create")]
public HttpResponseMessage Create(ParseOptions value)
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<ParserResult>(Request, () => {
var result = parser.Parse(value);
parser.Persist(result);
return result;
});
}
}
}
|
using api.core.Models;
using api.core.Provider;
using api.Security;
using Newtonsoft.Json;
using Swashbuckle.Swagger.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace api.Controllers
{
[TokenAuthentication]
public class ParserController : ApiController
{
[SwaggerOperation("Get")]
[SwaggerResponse(HttpStatusCode.OK)]
[SwaggerResponse(HttpStatusCode.NotFound)]
public HttpResponseMessage Get(string url)
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<ParserResult>(Request, () => {
return parser.ParseFromUrl(url);
});
}
[SwaggerOperation("GetArticles")]
[SwaggerResponse(HttpStatusCode.OK)]
[SwaggerResponse(HttpStatusCode.NotFound)]
[ActionName("GetArticles")]
[HttpGet]
public HttpResponseMessage GetArticles()
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<IEnumerable<ContentDto>>(Request, () => {
return parser.GetArticles();
});
}
[SwaggerOperation("Persist")]
[SwaggerResponse(HttpStatusCode.Created)]
public HttpResponseMessage Post(ParserResult value)
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<string>(Request, () => {
parser.Persist(value);
return value.Id;
});
}
[SwaggerOperation("Create")]
[SwaggerResponse(HttpStatusCode.Created)]
[HttpPost()]
[ActionName("Create")]
public HttpResponseMessage Create(ParseOptions value)
{
var parser = new Parser(Map.I.Container);
return ErrorHandler.ExecuteCreate<ParserResult>(Request, () => {
var result = parser.Parse(value);
parser.Persist(result);
return result;
});
}
}
}
|
mit
|
C#
|
6efbb95e44b61f9189df80936523897da73cc02b
|
Add ILogger.
|
StephenClearyApps/DotNetApis,StephenClearyApps/DotNetApis,StephenClearyApps/DotNetApis,StephenClearyApps/DotNetApis
|
service/src/Common/Logger.cs
|
service/src/Common/Logger.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Internals;
using Microsoft.Azure.WebJobs.Host;
namespace Common
{
public interface ILogger
{
void Trace(string message);
}
/// <summary>
/// A logger that writes messages both to Ably (if possible) and the <see cref="TextWriter"/>
/// </summary>
public sealed class Logger : ILogger
{
private readonly TraceWriter _writer;
private readonly string _service;
private readonly AblyChannel _channel;
public Logger(TraceWriter writer, string service, Guid operation)
{
_writer = writer;
_service = service;
_channel = AblyService.Instance.LogChannel(operation);
}
public void Trace(string message) => Write("trace", message);
private void Write(string type, string message)
{
_writer?.Info($"{_service}: {type}: {message}", _service);
_channel.LogMessage(_service, type, message);
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Internals;
using Microsoft.Azure.WebJobs.Host;
namespace Common
{
/// <summary>
/// A logger that writes messages both to Ably (if possible) and the <see cref="TextWriter"/>
/// </summary>
public sealed class Logger
{
private readonly TraceWriter _writer;
private readonly string _service;
private readonly AblyChannel _channel;
public Logger(TraceWriter writer, string service, Guid operation)
{
_writer = writer;
_service = service;
_channel = AblyService.Instance.LogChannel(operation);
}
public void Trace(string message) => Write("trace", message);
private void Write(string type, string message)
{
_writer?.Info($"{_service}: {type}: {message}", _service);
_channel.LogMessage(_service, type, message);
}
}
}
|
mit
|
C#
|
490fd124cb723cbd9d4ae80d276d039f95564019
|
Tidy up.
|
TimCollins/Reddit.DailyProgrammer
|
src/12-Int-Factors/FactorCalculator.cs
|
src/12-Int-Factors/FactorCalculator.cs
|
using System;
using System.Collections.Generic;
namespace _12_Int_Factors
{
public class FactorCalculator
{
public List<int> GetFactors(int number)
{
var factors = new List<int>();
// Loop to the square root (rounded) of the number
var max = (int)Math.Sqrt(number);
for (var factor = 1; factor <= max; ++factor)
{
// If the remainder is 0 then add the factor to the list
// and also add the inverse e.g. starting with 1 so that always gets added
// but also add (number / 1) which is just the number itself
if (number % factor == 0)
{
factors.Add(factor);
if (factor != number / factor)
{
factors.Add(number / factor);
}
}
}
return factors;
}
}
}
|
using System;
using System.Collections.Generic;
namespace _12_Int_Factors
{
public class FactorCalculator
{
public List<int> GetFactors(int number)
{
var factors = new List<int>();
// Loop to the square root (rounded) of the number
var max = (int)Math.Sqrt(number);
for (var factor = 1; factor <= max; ++factor)
{
// If the remainder is 0 then add it to the list
// and also add
if (number % factor == 0)
{
factors.Add(factor);
if (factor != number / factor)
{
factors.Add(number / factor);
}
}
}
factors.Sort();
return factors;
}
}
}
|
mit
|
C#
|
fc2277bc580e53214c497210790067b3aa3137c9
|
Add custom char comparison to extension methods
|
mganss/AhoCorasick
|
AhoCorasick/Extensions.cs
|
AhoCorasick/Extensions.cs
|
using System.Collections.Generic;
namespace Ganss.Text
{
/// <summary>
/// Provides extension methods.
/// </summary>
public static class Extensions
{
/// <summary>
/// Determines whether this instance contains the specified words.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="words">The words.</param>
/// <returns>The matched words.</returns>
public static IEnumerable<WordMatch> Contains(this string text, IEnumerable<string> words)
{
return new AhoCorasick(words).Search(text);
}
/// <summary>
/// Determines whether this instance contains the specified words.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="words">The words.</param>
/// <returns>The matched words.</returns>
public static IEnumerable<WordMatch> Contains(this string text, params string[] words)
{
return new AhoCorasick(words).Search(text);
}
/// <summary>
/// Determines whether this instance contains the specified words.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="comparer">The comparer used to compare individual characters.</param>
/// <param name="words">The words.</param>
/// <returns>The matched words.</returns>
public static IEnumerable<WordMatch> Contains(this string text, IEqualityComparer<char> comparer, IEnumerable<string> words)
{
return new AhoCorasick(comparer, words).Search(text);
}
/// <summary>
/// Determines whether this instance contains the specified words.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="comparer">The comparer used to compare individual characters.</param>
/// <param name="words">The words.</param>
/// <returns>The matched words.</returns>
public static IEnumerable<WordMatch> Contains(this string text, IEqualityComparer<char> comparer, params string[] words)
{
return new AhoCorasick(comparer, words).Search(text);
}
}
}
|
using System.Collections.Generic;
namespace Ganss.Text
{
/// <summary>
/// Provides extension methods.
/// </summary>
public static class Extensions
{
/// <summary>
/// Determines whether this instance contains the specified words.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="words">The words.</param>
/// <returns>The matched words.</returns>
public static IEnumerable<WordMatch> Contains(this string text, IEnumerable<string> words)
{
return new AhoCorasick(words).Search(text);
}
/// <summary>
/// Determines whether this instance contains the specified words.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="words">The words.</param>
/// <returns>The matched words.</returns>
public static IEnumerable<WordMatch> Contains(this string text, params string[] words)
{
return new AhoCorasick(words).Search(text);
}
}
}
|
mit
|
C#
|
0c2981c993261cbdf50b4022b3a5f0e42fd5d448
|
Build and publish nuget package
|
bfriesen/Rock.Logging,RockFramework/Rock.Logging
|
Rock.Logging/Properties/AssemblyInfo.cs
|
Rock.Logging/Properties/AssemblyInfo.cs
|
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("Rock.Logging")]
[assembly: AssemblyDescription("Rock logger.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("Rock.Logging")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 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("71736a4b-21bc-46f3-9bb7-f9c9a260f723")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.3")]
[assembly: AssemblyInformationalVersion("0.9.3")]
|
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("Rock.Logging")]
[assembly: AssemblyDescription("Rock logger.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("Rock.Logging")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 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("71736a4b-21bc-46f3-9bb7-f9c9a260f723")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.2")]
[assembly: AssemblyInformationalVersion("0.9.2")]
|
mit
|
C#
|
5dae0c604cd5995245baeffc675d44850b00d1e0
|
Remove trailing comma
|
azubanov/elasticsearch-net,RossLieberman/NEST,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net,UdiBen/elasticsearch-net,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net,RossLieberman/NEST,TheFireCookie/elasticsearch-net,adam-mccoy/elasticsearch-net,TheFireCookie/elasticsearch-net,TheFireCookie/elasticsearch-net,CSGOpenSource/elasticsearch-net,cstlaurent/elasticsearch-net,jonyadamit/elasticsearch-net,KodrAus/elasticsearch-net,jonyadamit/elasticsearch-net,cstlaurent/elasticsearch-net,RossLieberman/NEST,jonyadamit/elasticsearch-net,adam-mccoy/elasticsearch-net,azubanov/elasticsearch-net,cstlaurent/elasticsearch-net,azubanov/elasticsearch-net,KodrAus/elasticsearch-net,UdiBen/elasticsearch-net,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net,KodrAus/elasticsearch-net
|
src/Nest/Enums/NumericIndexOption.cs
|
src/Nest/Enums/NumericIndexOption.cs
|
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Nest
{
[JsonConverter(typeof(StringEnumConverter))]
public enum NonStringIndexOption
{
[EnumMember(Value = "no")]
No
}
}
|
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Nest
{
[JsonConverter(typeof(StringEnumConverter))]
public enum NonStringIndexOption
{
[EnumMember(Value = "no")]
No,
}
}
|
apache-2.0
|
C#
|
2357236ab0852285f439e9f4b02e3bf0feb7121b
|
Fix PollAnswer
|
MrRoundRobin/telegram.bot,TelegramBots/telegram.bot
|
src/Telegram.Bot/Types/PollAnswer.cs
|
src/Telegram.Bot/Types/PollAnswer.cs
|
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Telegram.Bot.Types
{
/// <summary>
/// This object represents an answer of a user in a non-anonymous poll.
/// </summary>
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public class PollAnswer
{
/// <summary>
/// Unique poll identifier
/// </summary>
[JsonProperty(Required = Required.Always)]
public string PollId { get; set; }
/// <summary>
/// The user, who changed the answer to the poll
/// </summary>
[JsonProperty(Required = Required.Always)]
public User User { get; set; }
/// <summary>
/// 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
/// </summary>
[JsonProperty(Required = Required.Always)]
public int[] OptionIds { get; set; }
}
}
|
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Telegram.Bot.Types
{
/// <summary>
/// This object represents an answer of a user in a non-anonymous poll.
/// </summary>
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public class PollAnswer
{
/// <summary>
/// Unique poll identifier
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Id { get; set; }
/// <summary>
/// The user, who changed the answer to the poll
/// </summary>
[JsonProperty(Required = Required.Always)]
public User User { get; set; }
/// <summary>
/// 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
/// </summary>
[JsonProperty(Required = Required.Always)]
public int[] OptionIds { get; set; }
}
}
|
mit
|
C#
|
5c1877dcf9bc0ddccbdc0b7068a4dd320afbf156
|
Fix character display
|
jskeet/DemoCode,jskeet/DemoCode,jskeet/DemoCode,jskeet/DemoCode
|
Diagnostics/UnhelpfulDebugger/Program.cs
|
Diagnostics/UnhelpfulDebugger/Program.cs
|
using System;
namespace UnhelpfulDebugger
{
class Program
{
static void Main()
{
string awkward1 = "Foo\\Bar";
string awkward2 = "FindElement";
double awkward3 = 4.9999999999999995d;
Console.WriteLine(awkward1);
PrintString(awkward1);
Console.WriteLine(awkward2);
PrintString(awkward2);
Console.WriteLine(awkward3);
PrintDouble(awkward3);
}
static void PrintString(string text)
{
Console.WriteLine($"Text: '{text}'");
Console.WriteLine($"Length: {text.Length}");
for (int i = 0; i < text.Length; i++)
{
Console.WriteLine($"{i,2} U+{(int) text[i]:x4} '{text[i]}'");
}
}
static void PrintDouble(double value) =>
Console.WriteLine(DoubleConverter.ToExactString(value));
}
}
|
using System;
namespace UnhelpfulDebugger
{
class Program
{
static void Main()
{
string awkward1 = "Foo\\Bar";
string awkward2 = "FindElement";
double awkward3 = 4.9999999999999995d;
Console.WriteLine(awkward1);
PrintString(awkward1);
Console.WriteLine(awkward2);
PrintString(awkward2);
Console.WriteLine(awkward3);
PrintDouble(awkward3);
}
static void PrintString(string text)
{
Console.WriteLine($"Text: '{text}'");
Console.WriteLine($"Length: {text.Length}");
for (int i = 0; i < text.Length; i++)
{
Console.WriteLine($"{i,2} U+{((int)text[i]):0000} '{text[i]}'");
}
}
static void PrintDouble(double value) =>
Console.WriteLine(DoubleConverter.ToExactString(value));
}
}
|
apache-2.0
|
C#
|
b036d7a59620ad3812ca966f634e827a745f4475
|
Improve code coverage for System.IO.FileSystem.AccessControl (#15375)
|
parjong/corefx,marksmeltzer/corefx,ViktorHofer/corefx,seanshpark/corefx,seanshpark/corefx,ptoonen/corefx,axelheer/corefx,rjxby/corefx,Jiayili1/corefx,billwert/corefx,YoupHulsebos/corefx,nbarbettini/corefx,elijah6/corefx,shimingsg/corefx,zhenlan/corefx,billwert/corefx,dhoehna/corefx,billwert/corefx,ptoonen/corefx,dhoehna/corefx,stephenmichaelf/corefx,ptoonen/corefx,yizhang82/corefx,weltkante/corefx,nchikanov/corefx,seanshpark/corefx,mazong1123/corefx,weltkante/corefx,JosephTremoulet/corefx,fgreinacher/corefx,shimingsg/corefx,zhenlan/corefx,marksmeltzer/corefx,dotnet-bot/corefx,krytarowski/corefx,stone-li/corefx,ravimeda/corefx,YoupHulsebos/corefx,rjxby/corefx,krk/corefx,fgreinacher/corefx,Ermiar/corefx,dhoehna/corefx,rjxby/corefx,krytarowski/corefx,DnlHarvey/corefx,ravimeda/corefx,ptoonen/corefx,gkhanna79/corefx,Ermiar/corefx,YoupHulsebos/corefx,yizhang82/corefx,MaggieTsang/corefx,DnlHarvey/corefx,nbarbettini/corefx,Jiayili1/corefx,twsouthwick/corefx,shimingsg/corefx,axelheer/corefx,Ermiar/corefx,nchikanov/corefx,jlin177/corefx,stone-li/corefx,parjong/corefx,twsouthwick/corefx,cydhaselton/corefx,ericstj/corefx,Ermiar/corefx,MaggieTsang/corefx,rjxby/corefx,YoupHulsebos/corefx,ViktorHofer/corefx,the-dwyer/corefx,seanshpark/corefx,stone-li/corefx,parjong/corefx,mmitche/corefx,ericstj/corefx,the-dwyer/corefx,DnlHarvey/corefx,nbarbettini/corefx,ViktorHofer/corefx,krytarowski/corefx,rahku/corefx,yizhang82/corefx,Petermarcu/corefx,weltkante/corefx,shimingsg/corefx,stephenmichaelf/corefx,dotnet-bot/corefx,rahku/corefx,ptoonen/corefx,billwert/corefx,stephenmichaelf/corefx,ericstj/corefx,zhenlan/corefx,stone-li/corefx,zhenlan/corefx,richlander/corefx,seanshpark/corefx,richlander/corefx,wtgodbe/corefx,Petermarcu/corefx,tijoytom/corefx,shimingsg/corefx,ericstj/corefx,ViktorHofer/corefx,DnlHarvey/corefx,yizhang82/corefx,BrennanConroy/corefx,ravimeda/corefx,rjxby/corefx,rubo/corefx,JosephTremoulet/corefx,mazong1123/corefx,billwert/corefx,krk/corefx,krytarowski/corefx,tijoytom/corefx,billwert/corefx,Ermiar/corefx,parjong/corefx,yizhang82/corefx,rahku/corefx,ptoonen/corefx,rubo/corefx,shimingsg/corefx,mazong1123/corefx,weltkante/corefx,richlander/corefx,nbarbettini/corefx,alexperovich/corefx,lggomez/corefx,lggomez/corefx,dotnet-bot/corefx,ViktorHofer/corefx,mmitche/corefx,Jiayili1/corefx,twsouthwick/corefx,axelheer/corefx,nbarbettini/corefx,seanshpark/corefx,MaggieTsang/corefx,MaggieTsang/corefx,ViktorHofer/corefx,mmitche/corefx,nchikanov/corefx,JosephTremoulet/corefx,DnlHarvey/corefx,Petermarcu/corefx,ravimeda/corefx,elijah6/corefx,YoupHulsebos/corefx,tijoytom/corefx,mmitche/corefx,dhoehna/corefx,the-dwyer/corefx,twsouthwick/corefx,Petermarcu/corefx,JosephTremoulet/corefx,cydhaselton/corefx,axelheer/corefx,gkhanna79/corefx,stone-li/corefx,the-dwyer/corefx,krk/corefx,axelheer/corefx,rubo/corefx,wtgodbe/corefx,JosephTremoulet/corefx,mazong1123/corefx,ravimeda/corefx,stephenmichaelf/corefx,weltkante/corefx,ViktorHofer/corefx,mazong1123/corefx,Jiayili1/corefx,BrennanConroy/corefx,zhenlan/corefx,cydhaselton/corefx,wtgodbe/corefx,lggomez/corefx,cydhaselton/corefx,elijah6/corefx,gkhanna79/corefx,richlander/corefx,richlander/corefx,krk/corefx,krk/corefx,mmitche/corefx,MaggieTsang/corefx,elijah6/corefx,ravimeda/corefx,stephenmichaelf/corefx,cydhaselton/corefx,rubo/corefx,the-dwyer/corefx,rubo/corefx,gkhanna79/corefx,rahku/corefx,shimingsg/corefx,mazong1123/corefx,dhoehna/corefx,elijah6/corefx,wtgodbe/corefx,alexperovich/corefx,zhenlan/corefx,mmitche/corefx,wtgodbe/corefx,weltkante/corefx,JosephTremoulet/corefx,nbarbettini/corefx,alexperovich/corefx,DnlHarvey/corefx,cydhaselton/corefx,Jiayili1/corefx,parjong/corefx,nchikanov/corefx,gkhanna79/corefx,tijoytom/corefx,ravimeda/corefx,the-dwyer/corefx,yizhang82/corefx,richlander/corefx,krytarowski/corefx,MaggieTsang/corefx,Petermarcu/corefx,mmitche/corefx,DnlHarvey/corefx,tijoytom/corefx,alexperovich/corefx,twsouthwick/corefx,billwert/corefx,nbarbettini/corefx,richlander/corefx,marksmeltzer/corefx,jlin177/corefx,ericstj/corefx,wtgodbe/corefx,elijah6/corefx,dhoehna/corefx,wtgodbe/corefx,MaggieTsang/corefx,BrennanConroy/corefx,dotnet-bot/corefx,zhenlan/corefx,stephenmichaelf/corefx,rahku/corefx,dhoehna/corefx,Jiayili1/corefx,Petermarcu/corefx,the-dwyer/corefx,jlin177/corefx,twsouthwick/corefx,rjxby/corefx,rjxby/corefx,Ermiar/corefx,twsouthwick/corefx,lggomez/corefx,marksmeltzer/corefx,marksmeltzer/corefx,axelheer/corefx,gkhanna79/corefx,lggomez/corefx,marksmeltzer/corefx,Petermarcu/corefx,nchikanov/corefx,rahku/corefx,krk/corefx,jlin177/corefx,mazong1123/corefx,ptoonen/corefx,fgreinacher/corefx,Jiayili1/corefx,stephenmichaelf/corefx,weltkante/corefx,JosephTremoulet/corefx,krytarowski/corefx,marksmeltzer/corefx,dotnet-bot/corefx,YoupHulsebos/corefx,alexperovich/corefx,Ermiar/corefx,fgreinacher/corefx,tijoytom/corefx,alexperovich/corefx,seanshpark/corefx,YoupHulsebos/corefx,parjong/corefx,lggomez/corefx,dotnet-bot/corefx,jlin177/corefx,dotnet-bot/corefx,gkhanna79/corefx,nchikanov/corefx,alexperovich/corefx,krk/corefx,cydhaselton/corefx,stone-li/corefx,nchikanov/corefx,yizhang82/corefx,parjong/corefx,tijoytom/corefx,jlin177/corefx,rahku/corefx,elijah6/corefx,lggomez/corefx,ericstj/corefx,stone-li/corefx,krytarowski/corefx,jlin177/corefx,ericstj/corefx
|
src/System.IO.FileSystem.AccessControl/tests/FileSystemAclExtensionsTests.cs
|
src/System.IO.FileSystem.AccessControl/tests/FileSystemAclExtensionsTests.cs
|
// 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.Security.AccessControl;
using Xunit;
namespace System.IO
{
public class FileSystemAclExtensionsTests
{
[Fact]
public void GetAccessControl_DirectoryInfo_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((DirectoryInfo)null));
}
[Fact]
public void GetAccessControl_DirectoryInfo_AccessControlSections_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((DirectoryInfo)null, new AccessControlSections()));
}
[Fact]
public void GetAccessControl_FileInfo_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((FileInfo)null));
}
[Fact]
public void GetAccessControl_FileInfo_AccessControlSections_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((FileInfo)null, new AccessControlSections()));
}
[Fact]
public void GetAccessControl_Filestream_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((FileStream)null));
}
[Fact]
public void SetAccessControl_DirectoryInfo_DirectorySecurity_InvalidArguments()
{
DirectoryInfo directoryInfo = new DirectoryInfo("\\");
Assert.Throws<ArgumentNullException>("directorySecurity", () => FileSystemAclExtensions.SetAccessControl(directoryInfo, (DirectorySecurity)null));
}
[Fact]
public void SetAccessControl_FileInfo_FileSecurity_InvalidArguments()
{
FileInfo fileInfo = new FileInfo("\\");
Assert.Throws<ArgumentNullException>("fileSecurity", () => FileSystemAclExtensions.SetAccessControl(fileInfo, (FileSecurity)null));
}
[Fact]
public void SetAccessControl_FileStream_FileSecurity_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.SetAccessControl((FileStream)null, (FileSecurity)null));
}
}
}
|
// 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 Xunit;
namespace System.IO
{
public class FileSystemAclExtensionsTests
{
[Fact]
public void GetAccessControl_InvalidArguments()
{
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((DirectoryInfo)null));
}
}
}
|
mit
|
C#
|
26932d153cf2924314191056c1dff422e2a53a7a
|
Change the way we match args to property tokens to more closely match Serilog when you pass in too few or too many arguments
|
kekekeks/akka.net,jordansjones/akka.net,jordansjones/akka.net,dyanarose/akka.net,willieferguson/akka.net,vchekan/akka.net,Micha-kun/akka.net,nvivo/akka.net,d--g/akka.net,forki/akka.net,dbolkensteyn/akka.net,willieferguson/akka.net,neekgreen/akka.net,thelegendofando/akka.net,rogeralsing/akka.net,cpx/akka.net,JeffCyr/akka.net,silentnull/akka.net,d--g/akka.net,alexpantyukhin/akka.net,trbngr/akka.net,eloraiby/akka.net,thelegendofando/akka.net,ali-ince/akka.net,zbrad/akka.net,forki/akka.net,stefansedich/akka.net,GeorgeFocas/akka.net,numo16/akka.net,ashic/akka.net,Silv3rcircl3/akka.net,forki/akka.net,matiii/akka.net,neekgreen/akka.net,naveensrinivasan/akka.net,adamhathcock/akka.net,AntoineGa/akka.net,kstaruch/akka.net,billyxing/akka.net,kstaruch/akka.net,stefansedich/akka.net,alex-kondrashov/akka.net,KadekM/akka.net,heynickc/akka.net,eisendle/akka.net,simonlaroche/akka.net,silentnull/akka.net,chris-ray/akka.net,Silv3rcircl3/akka.net,nanderto/akka.net,skotzko/akka.net,Chinchilla-Software-Com/akka.net,kerryjiang/akka.net,dyanarose/akka.net,adamhathcock/akka.net,gwokudasam/akka.net,KadekM/akka.net,kerryjiang/akka.net,amichel/akka.net,cpx/akka.net,derwasp/akka.net,linearregression/akka.net,matiii/akka.net,JeffCyr/akka.net,akoshelev/akka.net,MAOliver/akka.net,tillr/akka.net,forki/akka.net,nvivo/akka.net,dbolkensteyn/akka.net,naveensrinivasan/akka.net,michal-franc/akka.net,kekekeks/akka.net,alexvaluyskiy/akka.net,rogeralsing/akka.net,heynickc/akka.net,ali-ince/akka.net,derwasp/akka.net,chris-ray/akka.net,zbrad/akka.net,akoshelev/akka.net,bruinbrown/akka.net,billyxing/akka.net,eloraiby/akka.net,amichel/akka.net,simonlaroche/akka.net,gwokudasam/akka.net,eisendle/akka.net,rodrigovidal/akka.net,alexpantyukhin/akka.net,numo16/akka.net,rodrigovidal/akka.net,michal-franc/akka.net,ashic/akka.net,AntoineGa/akka.net,skotzko/akka.net,alex-kondrashov/akka.net,cdmdotnet/akka.net,MAOliver/akka.net,tillr/akka.net,GeorgeFocas/akka.net,nanderto/akka.net,linearregression/akka.net,bruinbrown/akka.net,vchekan/akka.net,cdmdotnet/akka.net,trbngr/akka.net,alexvaluyskiy/akka.net,Chinchilla-Software-Com/akka.net,Micha-kun/akka.net
|
src/contrib/loggers/Akka.Serilog/Event/Serilog/SerilogLogMessageFormatter.cs
|
src/contrib/loggers/Akka.Serilog/Event/Serilog/SerilogLogMessageFormatter.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Akka.Event;
using Serilog.Events;
using Serilog.Parsing;
namespace Akka.Serilog.Event.Serilog
{
public class SerilogLogMessageFormatter : ILogMessageFormatter
{
private readonly MessageTemplateCache _templateCache;
public SerilogLogMessageFormatter()
{
_templateCache = new MessageTemplateCache(new MessageTemplateParser());
}
public string Format(string format, params object[] args)
{
var template = _templateCache.Parse(format);
var propertyTokens = template.Tokens.OfType<PropertyToken>().ToArray();
var properties = new Dictionary<string, LogEventPropertyValue>();
for (var i = 0; i < args.Length; i++)
{
var propertyToken = propertyTokens.ElementAtOrDefault(i);
if (propertyToken == null)
break;
properties.Add(propertyToken.PropertyName, new ScalarValue(args[i]));
}
return template.Render(properties);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Akka.Event;
using Serilog.Events;
using Serilog.Parsing;
namespace Akka.Serilog.Event.Serilog
{
public class SerilogLogMessageFormatter : ILogMessageFormatter
{
private readonly MessageTemplateCache _templateCache;
public SerilogLogMessageFormatter()
{
_templateCache = new MessageTemplateCache(new MessageTemplateParser());
}
public string Format(string format, params object[] args)
{
var template = _templateCache.Parse(format);
var propertyTokens = template.Tokens.OfType<PropertyToken>().ToArray();
var properties = new Dictionary<string, LogEventPropertyValue>();
if (propertyTokens.Length != args.Length)
throw new FormatException("Invalid number or arguments provided.");
for (var i = 0; i < propertyTokens.Length; i++)
{
var arg = args[i];
properties.Add(propertyTokens[i].PropertyName, new ScalarValue(arg));
}
return template.Render(properties);
}
}
}
|
apache-2.0
|
C#
|
54739e9c8cb78fdd6e1c2df4a681ee8734f26c32
|
build scripts
|
SharpeRAD/Cake.AWS.S3
|
build/scripts/imports.cake
|
build/scripts/imports.cake
|
//////////////////////////////////////////////////////////////////////
// IMPORTS
//////////////////////////////////////////////////////////////////////
#addin nuget:?package=Cake.AWS.S3
#addin nuget:?package=Cake.FileHelpers
#addin nuget:?package=Cake.Slack
#tool nuget:?package=ReportUnit
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
|
//////////////////////////////////////////////////////////////////////
// IMPORTS
//////////////////////////////////////////////////////////////////////
#addin nuget:?package=Cake.AWS.S3
#addin nuget:?package=Cake.FileHelpers
#addin nuget:?package=Cake.Slack
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.