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 |
|---|---|---|---|---|---|---|---|---|
764a4c93728ee1ec4033eb1581968f3168accbfb
|
Allow custom user agent
|
charlenni/Mapsui,charlenni/Mapsui,pauldendulk/Mapsui
|
Mapsui/Utilities/OpenStreetMap.cs
|
Mapsui/Utilities/OpenStreetMap.cs
|
using BruTile.Predefined;
using BruTile.Web;
using Mapsui.Layers;
namespace Mapsui.Utilities
{
public static class OpenStreetMap
{
private const string DefaultUserAgent = "Default Mapsui user-agent";
private static readonly BruTile.Attribution OpenStreetMapAttribution = new BruTile.Attribution(
"© OpenStreetMap contributors", "https://www.openstreetmap.org/copyright");
public static TileLayer CreateTileLayer()
{
return new TileLayer(CreateTileSource()) { Name = "OpenStreetMap" };
}
private static HttpTileSource CreateTileSource(string userAgent = DefaultUserAgent)
{
return new HttpTileSource(new GlobalSphericalMercator(),
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
new[] { "a", "b", "c" }, name: "OpenStreetMap",
attribution: OpenStreetMapAttribution, userAgent: userAgent);
}
}
}
|
using BruTile.Predefined;
using BruTile.Web;
using Mapsui.Layers;
namespace Mapsui.Utilities
{
public static class OpenStreetMap
{
private static readonly BruTile.Attribution OpenStreetMapAttribution = new BruTile.Attribution(
"© OpenStreetMap contributors", "https://www.openstreetmap.org/copyright");
public static TileLayer CreateTileLayer()
{
return new TileLayer(CreateTileSource()) { Name = "OpenStreetMap" };
}
private static HttpTileSource CreateTileSource()
{
return new HttpTileSource(new GlobalSphericalMercator(),
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
new[] { "a", "b", "c" }, name: "OpenStreetMap",
attribution: OpenStreetMapAttribution, userAgent:"OpenStreetMap in Mapsui");
}
}
}
|
mit
|
C#
|
c88d65d9acca8ff439f5c7480a8bf0bfff901c8b
|
add diagnositics to sample
|
mike-ward/Nancy.Pile,mike-ward/Nancy.Pile,mike-ward/Nancy.Pile,mike-ward/Nancy.Pile
|
Nancy.Pile.Sample/Bootstrapper.cs
|
Nancy.Pile.Sample/Bootstrapper.cs
|
using Nancy.Conventions;
using Nancy.Diagnostics;
namespace Nancy.Pile.Sample
{
using Nancy;
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureConventions(NancyConventions nancyConventions)
{
base.ConfigureConventions(nancyConventions);
nancyConventions.StaticContentsConventions.StyleBundle("styles.css",
new[]
{
"css/pure.css",
"css/*.less",
"css/*.scss"
});
nancyConventions.StaticContentsConventions.ScriptBundle("scripts.js",
new[]
{
"js/third-party/*.js",
"!js/third-party/bomb.js",
"js/app/*.js",
"js/coffee/*.coffee",
//"js/typescript/*.ts",
"js/app/templates/*.html"
});
}
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"secret" };
}
}
|
using Nancy.Conventions;
namespace Nancy.Pile.Sample
{
using Nancy;
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureConventions(NancyConventions nancyConventions)
{
base.ConfigureConventions(nancyConventions);
nancyConventions.StaticContentsConventions.StyleBundle("styles.css",
new[]
{
"css/pure.css",
"css/*.less",
"css/*.scss"
});
nancyConventions.StaticContentsConventions.ScriptBundle("scripts.js",
new[]
{
"js/third-party/*.js",
"!js/third-party/bomb.js",
"js/app/*.js",
"js/coffee/*.coffee",
//"js/typescript/*.ts",
"js/app/templates/*.html"
});
}
}
}
|
mit
|
C#
|
61a140d3f71eb30ed883026a68533379ce18b691
|
Change ImageStatus enum
|
interfax/interfax-dotnet,interfax/interfax-dotnet
|
InterFAX.Api/ListSortOrder.cs
|
InterFAX.Api/ListSortOrder.cs
|
namespace InterFAX.Api
{
public enum ListSortOrder { Ascending, Descending }
public enum ImageStatus
{
READ,
UNREAD,
DONT_EXIST
}
}
|
namespace InterFAX.Api
{
public enum ListSortOrder { Ascending, Descending }
public enum ImageStatus
{
READ,
UNREAD
}
}
|
mit
|
C#
|
a41aeb318c78a13d700c8611d879604ea4a65069
|
Fix tests
|
gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer
|
LMP.Tests/MessageStoreTest.cs
|
LMP.Tests/MessageStoreTest.cs
|
using LunaCommon.Message;
using LunaCommon.Message.Base;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Server;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace LMP.Tests
{
[TestClass]
public class MessageStoreTest
{
private static readonly ServerMessageFactory Factory = new ServerMessageFactory();
private static readonly Random Rnd = new Random();
[TestMethod]
public void TestMsgMessageStore()
{
var msg1 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
Assert.AreEqual(0, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(0, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
var msg2 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
Assert.AreEqual(0, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(0, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
//Set first message as "used"
msg1.Recycle(false);
Assert.AreEqual(1, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(1, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
//If we retrieve a new message the first one should be reused
var msg3 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
msg2.Recycle(false);
msg3.Recycle(false);
Assert.AreEqual(2, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(2, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
var msg4 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
Assert.AreEqual(1, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(1, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
}
}
}
|
using LunaCommon.Message;
using LunaCommon.Message.Base;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Server;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace LMP.Tests
{
[TestClass]
public class MessageStoreTest
{
private static readonly ServerMessageFactory Factory = new ServerMessageFactory();
private static readonly Random Rnd = new Random();
[TestMethod]
public void TestMsgMessageStore()
{
var msg1 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
Assert.AreEqual(0, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(0, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
var msg2 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
Assert.AreEqual(0, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(0, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
//Set first message as "used"
msg1.Recycle();
Assert.AreEqual(1, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(1, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
//If we retrieve a new message the first one should be reused
var msg3 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
msg2.Recycle();
msg3.Recycle();
Assert.AreEqual(2, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(2, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
var msg4 = Factory.CreateNew<VesselSrvMsg, VesselPositionMsgData>();
Assert.AreEqual(1, MessageStore.GetMessageCount(typeof(VesselSrvMsg)));
Assert.AreEqual(1, MessageStore.GetMessageDataCount(typeof(VesselPositionMsgData)));
}
}
}
|
mit
|
C#
|
fb7bedeebec4c5e903e60b11cc986b4c98942db3
|
Fix bad xml doc comment (#753)
|
Microsoft/dotnet-apiport,Microsoft/dotnet-apiport,mjrousos/dotnet-apiport,Microsoft/dotnet-apiport,mjrousos/dotnet-apiport
|
src/lib/Microsoft.Fx.Portability/Utils/JsonConverters/JsonMultiDictionaryConverter.cs
|
src/lib/Microsoft.Fx.Portability/Utils/JsonConverters/JsonMultiDictionaryConverter.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.Fx.Portability.Utils.JsonConverters
{
/// <summary>
/// Json.NET does not handle <see cref="IDictionary{TKey, TValue}"/> when TKey is a type other than string. This provides
/// a wrapper for these types to serialize in a Key/Value system (like DCJS).
/// </summary>
internal class JsonMultiDictionaryConverter<TKey, TValue> : JsonConverter<IDictionary<TKey, ICollection<TValue>>>
{
private class KeyValueHelper
{
public TKey Key { get; set; }
public ICollection<TValue> Value { get; set; }
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
return serializer
.Deserialize<IEnumerable<KeyValueHelper>>(reader)
.ToDictionary(t => t.Key, t => t.Value);
}
public override void WriteJson(JsonWriter writer, object obj, JsonSerializer serializer)
{
var data = (obj as IDictionary<TKey, ICollection<TValue>>)
.Select(d => new KeyValueHelper { Key = d.Key, Value = d.Value });
serializer.Serialize(writer, data);
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.Fx.Portability.Utils.JsonConverters
{
/// <summary>
/// Json.NET does not handle IDictionary.<TKey,TValue> when TKey is a type other than string. This provides
/// a wrapper for these types to serialize in a Key/Value system (like DCJS).
/// </summary>
internal class JsonMultiDictionaryConverter<TKey, TValue> : JsonConverter<IDictionary<TKey, ICollection<TValue>>>
{
private class KeyValueHelper
{
public TKey Key { get; set; }
public ICollection<TValue> Value { get; set; }
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
return serializer
.Deserialize<IEnumerable<KeyValueHelper>>(reader)
.ToDictionary(t => t.Key, t => t.Value);
}
public override void WriteJson(JsonWriter writer, object obj, JsonSerializer serializer)
{
var data = (obj as IDictionary<TKey, ICollection<TValue>>)
.Select(d => new KeyValueHelper { Key = d.Key, Value = d.Value });
serializer.Serialize(writer, data);
}
}
}
|
mit
|
C#
|
77737064457d5f2d30b82f8893cac11cf493558c
|
remove Result implicit operator
|
acple/ParsecSharp
|
ParsecSharp/Core/Result/Result.cs
|
ParsecSharp/Core/Result/Result.cs
|
using System;
namespace ParsecSharp
{
public abstract class Result<TToken, T>
{
public abstract T Value { get; }
protected IParsecStateStream<TToken> Rest { get; }
protected Result(IParsecStateStream<TToken> state)
{
this.Rest = state;
}
internal abstract Result<TToken, TResult> Next<TNext, TResult>(Func<T, Parser<TToken, TNext>> next, Func<Result<TToken, TNext>, Result<TToken, TResult>> cont);
public abstract TResult CaseOf<TResult>(Func<Fail<TToken, T>, TResult> fail, Func<Success<TToken, T>, TResult> success);
public abstract override string ToString();
internal Suspended Suspend()
=> new Suspended(this);
public readonly struct Suspended
{
private readonly Result<TToken, T> _result;
internal Suspended(Result<TToken, T> result)
{
this._result = result;
}
public void Deconstruct(out Result<TToken, T> result, out IParsecStateStream<TToken> rest)
{
result = this._result;
rest = this._result.Rest;
}
}
}
}
|
using System;
namespace ParsecSharp
{
public abstract class Result<TToken, T>
{
public abstract T Value { get; }
protected IParsecStateStream<TToken> Rest { get; }
protected Result(IParsecStateStream<TToken> state)
{
this.Rest = state;
}
internal abstract Result<TToken, TResult> Next<TNext, TResult>(Func<T, Parser<TToken, TNext>> next, Func<Result<TToken, TNext>, Result<TToken, TResult>> cont);
public abstract TResult CaseOf<TResult>(Func<Fail<TToken, T>, TResult> fail, Func<Success<TToken, T>, TResult> success);
public abstract override string ToString();
public static implicit operator T(Result<TToken, T> result)
=> result.Value;
internal Suspended Suspend()
=> new Suspended(this);
public readonly struct Suspended
{
private readonly Result<TToken, T> _result;
internal Suspended(Result<TToken, T> result)
{
this._result = result;
}
public void Deconstruct(out Result<TToken, T> result, out IParsecStateStream<TToken> rest)
{
result = this._result;
rest = this._result.Rest;
}
}
}
}
|
mit
|
C#
|
8a345a475312f0b4e917c1f275fd9fd89e1f1aa3
|
Improve the test in regards to \r\n
|
SteamDatabase/ValveKeyValue
|
ValveKeyValue/ValveKeyValue.Test/Text/CommentOnEndOfTheLine.cs
|
ValveKeyValue/ValveKeyValue.Test/Text/CommentOnEndOfTheLine.cs
|
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace ValveKeyValue.Test
{
class CommentOnEndOfTheLine
{
[Test]
public void CanHandleCommentOnEndOfTheLine()
{
var text = new StringBuilder();
text.Append(@"""test_kv""" + "\n");
text.Append("{" + "\n");
text.Append("//" + "\n");
text.Append(@"""test"" ""hello""" + "\n");
text.Append("}" + "\n");
var data = KVSerializer.Create(KVSerializationFormat.KeyValues1Text).Deserialize(text.ToString());
Assert.Multiple(() =>
{
Assert.That(data.Children.Count(), Is.EqualTo(1));
Assert.That((string)data["test"], Is.EqualTo("hello"));
});
}
}
}
|
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace ValveKeyValue.Test
{
class CommentOnEndOfTheLine
{
[Test]
public void CanHandleCommentOnEndOfTheLine()
{
var text = new StringBuilder();
text.AppendLine(@"""test_kv""");
text.AppendLine("{");
text.AppendLine("//");
text.AppendLine(@"""test"" ""hello""");
text.AppendLine("}");
var data = KVSerializer.Create(KVSerializationFormat.KeyValues1Text).Deserialize(text.ToString());
Assert.Multiple(() =>
{
Assert.That(data.Children.Count(), Is.EqualTo(1));
Assert.That((string)data["test"], Is.EqualTo("hello"));
});
}
}
}
|
mit
|
C#
|
8abaf017b9df162672c05e1a8803916777bc2f25
|
Use top-level program
|
martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode
|
tests/AdventOfCode.Benchmarks/Program.cs
|
tests/AdventOfCode.Benchmarks/Program.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 BenchmarkDotNet.Running;
using MartinCostello.AdventOfCode.Benchmarks;
BenchmarkRunner.Run<PuzzleBenchmarks>(args: args);
|
// 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 BenchmarkDotNet.Running;
namespace MartinCostello.AdventOfCode.Benchmarks;
/// <summary>
/// A console application that runs performance benchmarks for the puzzles. This class cannot be inherited.
/// </summary>
internal static class Program
{
/// <summary>
/// The main entry-point to the application.
/// </summary>
/// <param name="args">The arguments to the application.</param>
internal static void Main(string[] args)
=> BenchmarkRunner.Run<PuzzleBenchmarks>(args: args);
}
|
apache-2.0
|
C#
|
76bca3de32fcd28792d0630623aed078db9df715
|
Fix xaml docs
|
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
|
src/AsmResolver.PE/DotNet/Metadata/Tables/Rows/PropertyAttributes.cs
|
src/AsmResolver.PE/DotNet/Metadata/Tables/Rows/PropertyAttributes.cs
|
using System;
namespace AsmResolver.PE.DotNet.Metadata.Tables.Rows
{
/// <summary>
/// Provides members defining all flags that can be assigned to a property definition.
/// </summary>
[Flags]
public enum PropertyAttributes : ushort
{
/// <summary>
/// The property has no attribute.
/// </summary>
None = 0x0000,
/// <summary>
/// The property uses a special name.
/// </summary>
SpecialName = 0x0200,
/// <summary>
/// The runtime should check the name encoding.
/// </summary>
RuntimeSpecialName = 0x0400,
/// <summary>
/// The property has got a default value.
/// </summary>
HasDefault = 0x1000,
}
}
|
using System;
namespace AsmResolver.PE.DotNet.Metadata.Tables.Rows
{
/// <summary>
/// Provides members defining all flags that can be assigned to a property definition.
/// </summary>
[Flags]
public enum PropertyAttributes : ushort
{
/// <summary>
/// Specifies that no attributes are associated with a property.
/// </summary>
None = 0x0000,
/// <summary>
/// The property uses a special name.
/// </summary>
SpecialName = 0x0200,
/// <summary>
/// The runtime should check the name encoding.
/// </summary>
RuntimeSpecialName = 0x0400,
/// <summary>
/// The proeprty has got a default value.
/// </summary>
HasDefault = 0x1000,
}
}
|
mit
|
C#
|
d2ddbe3b2ea3e08099e5987bcfa7d68d34bd07ac
|
Improve test coverage for existing duration JSON converter.
|
malcolmr/nodatime,zaccharles/nodatime,malcolmr/nodatime,nodatime/nodatime,jskeet/nodatime,zaccharles/nodatime,zaccharles/nodatime,nodatime/nodatime,zaccharles/nodatime,jskeet/nodatime,BenJenkinson/nodatime,malcolmr/nodatime,zaccharles/nodatime,BenJenkinson/nodatime,malcolmr/nodatime,zaccharles/nodatime
|
src/NodaTime.Serialization.Test/JsonNet/NodaDurationConverterTest.cs
|
src/NodaTime.Serialization.Test/JsonNet/NodaDurationConverterTest.cs
|
// Copyright 2012 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using NUnit.Framework;
using Newtonsoft.Json;
using NodaTime.Serialization.JsonNet;
namespace NodaTime.Serialization.Test.JsonNet
{
[TestFixture]
public class NodaDurationConverterTest
{
private static readonly JsonConverter Converter = NodaConverters.DurationConverter;
private static void AssertRoundTrip(Duration value, string expectedJson)
{
var json = JsonConvert.SerializeObject(value, Formatting.None, Converter);
Assert.AreEqual(expectedJson, json);
var parsed = JsonConvert.DeserializeObject<Duration>(json, Converter);
Assert.AreEqual(value, parsed);
}
[Test]
public void WholeSeconds()
{
AssertRoundTrip(Duration.FromHours(48), "\"48:00:00\"");
}
[Test]
public void FractionalSeconds()
{
AssertRoundTrip(Duration.FromHours(48) + Duration.FromSeconds(3) + Duration.FromTicks(1234567), "\"48:00:03.1234567\"");
AssertRoundTrip(Duration.FromHours(48) + Duration.FromSeconds(3) + Duration.FromTicks(1230000), "\"48:00:03.123\"");
AssertRoundTrip(Duration.FromHours(48) + Duration.FromSeconds(3) + Duration.FromTicks(1234000), "\"48:00:03.1234000\"");
AssertRoundTrip(Duration.FromHours(48) + Duration.FromSeconds(3) + Duration.FromTicks(12345), "\"48:00:03.0012345\"");
}
[Test]
public void ParsePartialFractionalSeconds()
{
var parsed = JsonConvert.DeserializeObject<Duration>("\"25:10:00.1234\"", Converter);
Assert.AreEqual(Duration.FromHours(25) + Duration.FromMinutes(10) + Duration.FromTicks(1234000), parsed);
}
}
}
|
// Copyright 2012 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using NUnit.Framework;
using Newtonsoft.Json;
using NodaTime.Serialization.JsonNet;
namespace NodaTime.Serialization.Test.JsonNet
{
[TestFixture]
public class NodaDurationConverterTest
{
private readonly JsonConverter converter = NodaConverters.DurationConverter;
[Test]
public void Serialize()
{
var duration = Duration.FromHours(48);
var json = JsonConvert.SerializeObject(duration, Formatting.None, converter);
string expectedJson = "\"48:00:00\"";
Assert.AreEqual(expectedJson, json);
}
[Test]
public void Deserialize()
{
string json = "\"48:00:00\"";
var duration = JsonConvert.DeserializeObject<Duration>(json, converter);
var expectedDuration = Duration.FromHours(48);
Assert.AreEqual(expectedDuration, duration);
}
}
}
|
apache-2.0
|
C#
|
b6ef95143f32b445191bcbb942894bef80e25945
|
Improve xml-doc
|
DrabWeb/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ZLima12/osu-framework,paparony03/osu-framework,naoey/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,paparony03/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,default0/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,naoey/osu-framework,peppy/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,default0/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework
|
osu.Framework/Audio/Track/TrackAmplitudes.cs
|
osu.Framework/Audio/Track/TrackAmplitudes.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Audio.Track
{
public struct TrackAmplitudes
{
public float LeftChannel;
public float RightChannel;
public float Maximum => Math.Max(LeftChannel, RightChannel);
public float Average => (LeftChannel + RightChannel) / 2;
/// <summary>
/// 256 length array of bins containing the average frequency of both channels at every ~78Hz step of the audible spectrum (0Hz - 20,000Hz).
/// </summary>
public float[] FrequencyAmplitudes;
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Audio.Track
{
public struct TrackAmplitudes
{
public float LeftChannel;
public float RightChannel;
public float Maximum => Math.Max(LeftChannel, RightChannel);
public float Average => (LeftChannel + RightChannel) / 2;
/// <summary>
/// 256 length array containing bins after combining channels.
/// Each bin represents about 78 Hz of the audible spectrum (0Hz - 20,000Hz).
/// </summary>
public float[] FrequencyAmplitudes;
}
}
|
mit
|
C#
|
bbad70c3f0101fed3121bb894f28b3d6884a1322
|
Fix mod perfect test scenes failing due to null ruleset provided
|
UselessToucan/osu,smoogipoo/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,smoogipooo/osu,smoogipoo/osu,peppy/osu-new,UselessToucan/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu
|
osu.Game/Tests/Visual/ModPerfectTestScene.cs
|
osu.Game/Tests/Visual/ModPerfectTestScene.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.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Tests.Visual
{
public abstract class ModPerfectTestScene : ModTestScene
{
private readonly ModPerfect mod;
protected ModPerfectTestScene(ModPerfect mod)
{
this.mod = mod;
}
protected void CreateHitObjectTest(HitObjectTestData testData, bool shouldMiss) => CreateModTest(new ModTestData
{
Mod = mod,
Beatmap = new Beatmap
{
BeatmapInfo = { Ruleset = CreatePlayerRuleset().RulesetInfo },
HitObjects = { testData.HitObject }
},
Autoplay = !shouldMiss,
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testData.FailOnMiss)
});
protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer();
private class PerfectModTestPlayer : TestPlayer
{
public PerfectModTestPlayer()
: base(showResults: false)
{
}
protected override bool CheckModsAllowFailure() => true;
public bool CheckFailed(bool failed)
{
if (!failed)
return ScoreProcessor.HasCompleted.Value && !HealthProcessor.HasFailed;
return HealthProcessor.HasFailed;
}
}
protected class HitObjectTestData
{
public readonly HitObject HitObject;
public readonly bool FailOnMiss;
public HitObjectTestData(HitObject hitObject, bool failOnMiss = true)
{
HitObject = hitObject;
FailOnMiss = failOnMiss;
}
}
}
}
|
// 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.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Tests.Visual
{
public abstract class ModPerfectTestScene : ModTestScene
{
private readonly ModPerfect mod;
protected ModPerfectTestScene(ModPerfect mod)
{
this.mod = mod;
}
protected void CreateHitObjectTest(HitObjectTestData testData, bool shouldMiss) => CreateModTest(new ModTestData
{
Mod = mod,
Beatmap = new Beatmap
{
BeatmapInfo = { Ruleset = Ruleset.Value },
HitObjects = { testData.HitObject }
},
Autoplay = !shouldMiss,
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testData.FailOnMiss)
});
protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer();
private class PerfectModTestPlayer : TestPlayer
{
public PerfectModTestPlayer()
: base(showResults: false)
{
}
protected override bool CheckModsAllowFailure() => true;
public bool CheckFailed(bool failed)
{
if (!failed)
return ScoreProcessor.HasCompleted.Value && !HealthProcessor.HasFailed;
return HealthProcessor.HasFailed;
}
}
protected class HitObjectTestData
{
public readonly HitObject HitObject;
public readonly bool FailOnMiss;
public HitObjectTestData(HitObject hitObject, bool failOnMiss = true)
{
HitObject = hitObject;
FailOnMiss = failOnMiss;
}
}
}
}
|
mit
|
C#
|
96656055f07a385b156eeeb350e604bfc9ceee1f
|
Remove another unnecessary import
|
stefan-baumann/AeroSuite
|
AeroSuite/NativeMethods.cs
|
AeroSuite/NativeMethods.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace AeroSuite
{
/// <summary>
/// Provides some methods from the user32 and uxtheme libraries.
/// </summary>
internal static class NativeMethods
{
private const string user32 = "user32.dll";
private const string uxtheme = "uxtheme.dll";
[DllImport(user32)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
[DllImport(user32, CharSet = CharSet.Unicode)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam);
[DllImport(user32)]
public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
[DllImport(user32)]
public static extern IntPtr SetCursor(IntPtr hCursor);
[DllImport(uxtheme, CharSet = CharSet.Unicode)]
public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace AeroSuite
{
/// <summary>
/// Provides some methods from the user32 and uxtheme libraries.
/// </summary>
internal static class NativeMethods
{
private const string user32 = "user32.dll";
private const string uxtheme = "uxtheme.dll";
[DllImport(user32)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
[DllImport(user32, CharSet = CharSet.Unicode)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam);
[DllImport(user32)]
public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
[DllImport(user32)]
public static extern IntPtr SetCursor(IntPtr hCursor);
[DllImport(uxtheme, CharSet = CharSet.Unicode)]
public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
}
}
|
mit
|
C#
|
627caed3ab17b70815c16d0e434478a3926f5100
|
Add SaveOrUpdate
|
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
|
Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork/Repo/IRepository.cs
|
Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork/Repo/IRepository.cs
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Connection;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.UoW;
namespace Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Repo
{
public interface IRepository<TSession, TEntity, TPk>
where TEntity : class, ITEntity<TPk>
where TSession : ISession
{
TEntity Get(TPk key, IUnitOfWork<TSession> unitOfWork = null);
Task<TEntity> GetAsync(TPk key, IUnitOfWork<TSession> unitOfWork = null);
IEnumerable<TEntity> GetAll(IUnitOfWork<TSession> unitOfWork = null);
Task<IEnumerable<TEntity>> GetAllAsync(IUnitOfWork<TSession> unitOfWork = null);
TPk SaveOrUpdate(TEntity entity, IUnitOfWork<TSession> unitOfWork = null);
Task<TPk> SaveOrUpdateAsync(TEntity entity, IUnitOfWork<TSession> unitOfWork = null);
}
}
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Connection;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.UoW;
namespace Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Repo
{
public interface IRepository<TSession, TEntity, in TPk>
where TSession : ISession
where TEntity : class
{
TEntity Get(TPk key, IUnitOfWork<TSession> unitOfWork = null);
Task<TEntity> GetAsync(TPk key, IUnitOfWork<TSession> unitOfWork = null);
IEnumerable<TEntity> GetAll(IUnitOfWork<TSession> unitOfWork = null);
Task<IEnumerable<TEntity>> GetAllAsync(IUnitOfWork<TSession> unitOfWork = null);
}
}
|
mit
|
C#
|
78dcbbb6badb6e49830794771efadd05decc58f2
|
Add public ctor to DirectoryEntry
|
Priya91/corefx-1,alphonsekurian/corefx,elijah6/corefx,ericstj/corefx,janhenke/corefx,lggomez/corefx,krk/corefx,Petermarcu/corefx,the-dwyer/corefx,nbarbettini/corefx,krytarowski/corefx,ViktorHofer/corefx,richlander/corefx,YoupHulsebos/corefx,rubo/corefx,dsplaisted/corefx,jlin177/corefx,SGuyGe/corefx,shimingsg/corefx,the-dwyer/corefx,BrennanConroy/corefx,zhenlan/corefx,JosephTremoulet/corefx,krk/corefx,jlin177/corefx,cartermp/corefx,billwert/corefx,axelheer/corefx,ravimeda/corefx,benjamin-bader/corefx,janhenke/corefx,YoupHulsebos/corefx,mafiya69/corefx,nchikanov/corefx,janhenke/corefx,janhenke/corefx,benpye/corefx,alphonsekurian/corefx,kkurni/corefx,shimingsg/corefx,shmao/corefx,kkurni/corefx,mokchhya/corefx,jlin177/corefx,wtgodbe/corefx,YoupHulsebos/corefx,the-dwyer/corefx,ericstj/corefx,mellinoe/corefx,mazong1123/corefx,ellismg/corefx,MaggieTsang/corefx,zhenlan/corefx,richlander/corefx,dsplaisted/corefx,wtgodbe/corefx,weltkante/corefx,mokchhya/corefx,Jiayili1/corefx,dhoehna/corefx,stone-li/corefx,mmitche/corefx,dotnet-bot/corefx,ellismg/corefx,elijah6/corefx,iamjasonp/corefx,JosephTremoulet/corefx,cydhaselton/corefx,mafiya69/corefx,cydhaselton/corefx,Chrisboh/corefx,shahid-pk/corefx,mazong1123/corefx,shahid-pk/corefx,manu-silicon/corefx,janhenke/corefx,ptoonen/corefx,alexperovich/corefx,dsplaisted/corefx,gkhanna79/corefx,wtgodbe/corefx,mmitche/corefx,lggomez/corefx,Jiayili1/corefx,billwert/corefx,YoupHulsebos/corefx,ViktorHofer/corefx,jlin177/corefx,mazong1123/corefx,rahku/corefx,DnlHarvey/corefx,lggomez/corefx,jhendrixMSFT/corefx,cydhaselton/corefx,rjxby/corefx,ericstj/corefx,manu-silicon/corefx,SGuyGe/corefx,nbarbettini/corefx,tijoytom/corefx,stone-li/corefx,janhenke/corefx,krytarowski/corefx,alphonsekurian/corefx,tstringer/corefx,gkhanna79/corefx,kkurni/corefx,cydhaselton/corefx,twsouthwick/corefx,Ermiar/corefx,rahku/corefx,ViktorHofer/corefx,pallavit/corefx,iamjasonp/corefx,tijoytom/corefx,jhendrixMSFT/corefx,mafiya69/corefx,twsouthwick/corefx,ptoonen/corefx,MaggieTsang/corefx,richlander/corefx,ellismg/corefx,mazong1123/corefx,billwert/corefx,Jiayili1/corefx,parjong/corefx,khdang/corefx,marksmeltzer/corefx,ericstj/corefx,DnlHarvey/corefx,JosephTremoulet/corefx,twsouthwick/corefx,stephenmichaelf/corefx,zhenlan/corefx,Ermiar/corefx,SGuyGe/corefx,zhenlan/corefx,marksmeltzer/corefx,Priya91/corefx-1,the-dwyer/corefx,weltkante/corefx,ravimeda/corefx,rjxby/corefx,Petermarcu/corefx,marksmeltzer/corefx,parjong/corefx,yizhang82/corefx,cartermp/corefx,JosephTremoulet/corefx,weltkante/corefx,ptoonen/corefx,cartermp/corefx,the-dwyer/corefx,jhendrixMSFT/corefx,BrennanConroy/corefx,dotnet-bot/corefx,adamralph/corefx,stephenmichaelf/corefx,benpye/corefx,jcme/corefx,Priya91/corefx-1,gkhanna79/corefx,nbarbettini/corefx,shmao/corefx,Jiayili1/corefx,tstringer/corefx,khdang/corefx,lggomez/corefx,stephenmichaelf/corefx,Ermiar/corefx,marksmeltzer/corefx,tijoytom/corefx,shmao/corefx,seanshpark/corefx,pallavit/corefx,nchikanov/corefx,jlin177/corefx,shmao/corefx,stone-li/corefx,mokchhya/corefx,mazong1123/corefx,shmao/corefx,shmao/corefx,richlander/corefx,iamjasonp/corefx,nbarbettini/corefx,the-dwyer/corefx,josguil/corefx,the-dwyer/corefx,elijah6/corefx,dotnet-bot/corefx,zhenlan/corefx,adamralph/corefx,gkhanna79/corefx,Ermiar/corefx,nchikanov/corefx,Priya91/corefx-1,jhendrixMSFT/corefx,JosephTremoulet/corefx,josguil/corefx,pallavit/corefx,alphonsekurian/corefx,ravimeda/corefx,ViktorHofer/corefx,mazong1123/corefx,cydhaselton/corefx,rahku/corefx,billwert/corefx,weltkante/corefx,tijoytom/corefx,shahid-pk/corefx,parjong/corefx,fgreinacher/corefx,josguil/corefx,mokchhya/corefx,adamralph/corefx,cartermp/corefx,jcme/corefx,alexperovich/corefx,josguil/corefx,lggomez/corefx,jcme/corefx,dotnet-bot/corefx,twsouthwick/corefx,marksmeltzer/corefx,marksmeltzer/corefx,YoupHulsebos/corefx,benjamin-bader/corefx,alexperovich/corefx,gkhanna79/corefx,stone-li/corefx,benpye/corefx,SGuyGe/corefx,manu-silicon/corefx,rjxby/corefx,cartermp/corefx,axelheer/corefx,weltkante/corefx,iamjasonp/corefx,Chrisboh/corefx,jcme/corefx,seanshpark/corefx,ericstj/corefx,shimingsg/corefx,fgreinacher/corefx,Ermiar/corefx,rjxby/corefx,iamjasonp/corefx,cartermp/corefx,zhenlan/corefx,Jiayili1/corefx,Petermarcu/corefx,cydhaselton/corefx,YoupHulsebos/corefx,iamjasonp/corefx,dotnet-bot/corefx,nbarbettini/corefx,richlander/corefx,alphonsekurian/corefx,mafiya69/corefx,DnlHarvey/corefx,mokchhya/corefx,ellismg/corefx,rubo/corefx,shahid-pk/corefx,dhoehna/corefx,jhendrixMSFT/corefx,krk/corefx,benpye/corefx,nbarbettini/corefx,ptoonen/corefx,billwert/corefx,pallavit/corefx,iamjasonp/corefx,nchikanov/corefx,tstringer/corefx,billwert/corefx,BrennanConroy/corefx,seanshpark/corefx,seanshpark/corefx,ptoonen/corefx,rjxby/corefx,mmitche/corefx,Ermiar/corefx,shimingsg/corefx,parjong/corefx,Chrisboh/corefx,krk/corefx,DnlHarvey/corefx,benjamin-bader/corefx,Chrisboh/corefx,parjong/corefx,krytarowski/corefx,Petermarcu/corefx,wtgodbe/corefx,mellinoe/corefx,seanshpark/corefx,jcme/corefx,mellinoe/corefx,ellismg/corefx,mellinoe/corefx,richlander/corefx,rahku/corefx,alphonsekurian/corefx,Ermiar/corefx,rahku/corefx,yizhang82/corefx,mellinoe/corefx,benpye/corefx,jhendrixMSFT/corefx,krk/corefx,khdang/corefx,tstringer/corefx,ericstj/corefx,yizhang82/corefx,MaggieTsang/corefx,jcme/corefx,jhendrixMSFT/corefx,tijoytom/corefx,DnlHarvey/corefx,jlin177/corefx,dhoehna/corefx,shimingsg/corefx,stone-li/corefx,josguil/corefx,stone-li/corefx,krk/corefx,dhoehna/corefx,dhoehna/corefx,shahid-pk/corefx,shmao/corefx,alphonsekurian/corefx,MaggieTsang/corefx,tijoytom/corefx,wtgodbe/corefx,khdang/corefx,dotnet-bot/corefx,gkhanna79/corefx,lggomez/corefx,twsouthwick/corefx,mazong1123/corefx,tijoytom/corefx,Jiayili1/corefx,cydhaselton/corefx,wtgodbe/corefx,yizhang82/corefx,nchikanov/corefx,stephenmichaelf/corefx,stone-li/corefx,MaggieTsang/corefx,rahku/corefx,manu-silicon/corefx,dhoehna/corefx,fgreinacher/corefx,mmitche/corefx,yizhang82/corefx,ptoonen/corefx,SGuyGe/corefx,shimingsg/corefx,ericstj/corefx,kkurni/corefx,benjamin-bader/corefx,wtgodbe/corefx,yizhang82/corefx,twsouthwick/corefx,ravimeda/corefx,ravimeda/corefx,DnlHarvey/corefx,alexperovich/corefx,manu-silicon/corefx,shahid-pk/corefx,billwert/corefx,twsouthwick/corefx,kkurni/corefx,rubo/corefx,Priya91/corefx-1,josguil/corefx,Priya91/corefx-1,ViktorHofer/corefx,DnlHarvey/corefx,yizhang82/corefx,seanshpark/corefx,mokchhya/corefx,mafiya69/corefx,khdang/corefx,elijah6/corefx,khdang/corefx,alexperovich/corefx,rjxby/corefx,dhoehna/corefx,mmitche/corefx,rubo/corefx,mmitche/corefx,SGuyGe/corefx,ptoonen/corefx,alexperovich/corefx,alexperovich/corefx,shimingsg/corefx,axelheer/corefx,mafiya69/corefx,parjong/corefx,stephenmichaelf/corefx,seanshpark/corefx,axelheer/corefx,ravimeda/corefx,stephenmichaelf/corefx,manu-silicon/corefx,zhenlan/corefx,benpye/corefx,Petermarcu/corefx,weltkante/corefx,ellismg/corefx,axelheer/corefx,rahku/corefx,mellinoe/corefx,lggomez/corefx,elijah6/corefx,axelheer/corefx,nchikanov/corefx,rjxby/corefx,elijah6/corefx,Chrisboh/corefx,kkurni/corefx,krytarowski/corefx,parjong/corefx,MaggieTsang/corefx,krytarowski/corefx,mmitche/corefx,pallavit/corefx,krytarowski/corefx,gkhanna79/corefx,ViktorHofer/corefx,weltkante/corefx,pallavit/corefx,krk/corefx,YoupHulsebos/corefx,JosephTremoulet/corefx,tstringer/corefx,MaggieTsang/corefx,nbarbettini/corefx,benjamin-bader/corefx,benjamin-bader/corefx,Chrisboh/corefx,Jiayili1/corefx,manu-silicon/corefx,tstringer/corefx,stephenmichaelf/corefx,fgreinacher/corefx,richlander/corefx,JosephTremoulet/corefx,jlin177/corefx,elijah6/corefx,nchikanov/corefx,ViktorHofer/corefx,krytarowski/corefx,marksmeltzer/corefx,ravimeda/corefx,rubo/corefx,dotnet-bot/corefx,Petermarcu/corefx,Petermarcu/corefx
|
src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/DirectoryEntry.cs
|
src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/DirectoryEntry.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace System.Reflection.PortableExecutable
{
public struct DirectoryEntry
{
public readonly int RelativeVirtualAddress;
public readonly int Size;
public DirectoryEntry(int relativeVirtualAddress, int size)
{
RelativeVirtualAddress = relativeVirtualAddress;
Size = size;
}
internal DirectoryEntry(ref PEBinaryReader reader)
{
RelativeVirtualAddress = reader.ReadInt32();
Size = reader.ReadInt32();
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace System.Reflection.PortableExecutable
{
public struct DirectoryEntry
{
public readonly int RelativeVirtualAddress;
public readonly int Size;
internal DirectoryEntry(ref PEBinaryReader reader)
{
RelativeVirtualAddress = reader.ReadInt32();
Size = reader.ReadInt32();
}
}
}
|
mit
|
C#
|
0d804a4cba8d7ac6d8f87ae6b8d2f58e2676a8eb
|
set version number in assembly
|
sebastianhallen/Vostok,sebastianhallen/Vostok
|
Vostok/Properties/AssemblyInfo.cs
|
Vostok/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("Vostok")]
[assembly: AssemblyDescription("Vostok is a wrapper to Selenium webdriver that handles StaleElementReferenceException.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Vostok")]
[assembly: AssemblyCopyright("Copyright © Sebastian Hallén 2015")]
[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("6c93cd0e-829f-4072-af03-32f5b1a35d71")]
// 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.13.0.0")]
[assembly: AssemblyFileVersion("0.13.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("Vostok")]
[assembly: AssemblyDescription("Vostok is a wrapper to Selenium webdriver that handles StaleElementReferenceException.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Vostok")]
[assembly: AssemblyCopyright("Copyright © Sebastian Hallén 2015")]
[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("6c93cd0e-829f-4072-af03-32f5b1a35d71")]
// 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#
|
36c7aca0a95b069fb565e140a2f0917e45f68cca
|
remove array
|
Appleseed/base,Appleseed/base
|
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
|
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Appleseed.Base.Alerts.Model
{
class SolrResponseItem
{
public string id { get; set; }
public string item_type { get; set; }
public string address_1 { get; set; }
public string city { get; set; }
public string state { get; set; }
public string classification { get; set; }
public string country { get; set; }
public string postal_code { get; set; }
public string[] product_description { get; set; }
public string[] product_quantity { get; set; }
public string[] product_type { get; set; }
public string[] code_info { get; set; }
public string[] reason_for_recall { get; set; }
public DateTime recall_initiation_date { get; set; }
public string[] recall_number { get; set; }
public string recalling_firm { get; set; }
public string[] voluntary_mandated { get; set; }
public DateTime report_date { get; set; }
public string[] status { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Appleseed.Base.Alerts.Model
{
class SolrResponseItem
{
public string id { get; set; }
public string item_type { get; set; }
public string address_1 { get; set; }
public string city { get; set; }
public string state { get; set; }
public string classification { get; set; }
public string country { get; set; }
public string[] postal_code { get; set; }
public string[] product_description { get; set; }
public string[] product_quantity { get; set; }
public string[] product_type { get; set; }
public string[] code_info { get; set; }
public string[] reason_for_recall { get; set; }
public DateTime recall_initiation_date { get; set; }
public string[] recall_number { get; set; }
public string recalling_firm { get; set; }
public string[] voluntary_mandated { get; set; }
public DateTime report_date { get; set; }
public string[] status { get; set; }
}
}
|
apache-2.0
|
C#
|
d361c3a71606580dc6ec0317f9216c6c3dcf8601
|
Update `TagHelperSample` conditionalcomment page.
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
samples/TagHelperSample.Web/Views/TagHelper/ConditionalComment.cshtml
|
samples/TagHelperSample.Web/Views/TagHelper/ConditionalComment.cshtml
|
@using TagHelperSample.Web
@addTagHelper "*, TagHelperSample.Web"
<iecondition mode="DownlevelRevealed" condition="gt IE 7">
<p>Content visible to all browsers newer than Internet Explorer 7.</p>
</iecondition>
<iecondition mode="DownlevelHidden" condition="IE 7">
<p>Content visible only to Internet Explorer 7 users.</p>
</iecondition>
|
@using TagHelperSample.Web
@addTagHelper "*, TagHelperSample.Web"
<iecondition mode="CommentMode.DownlevelRevealed" condition="gt IE 7">
<p>Content visible to all browsers newer than Internet Explorer 7.</p>
</iecondition>
<iecondition mode="CommentMode.DownlevelHidden" condition="IE 7">
<p>Content visible only to Internet Explorer 7 users.</p>
</iecondition>
|
apache-2.0
|
C#
|
c4ea36ccdc8607c882c9dc8345eb07d21b300292
|
move Other above Tracked, added PositionOnly controller state
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,vladkol/MixedRealityToolkit-Unity,vladkol/MixedRealityToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,vladkol/MixedRealityToolkit-Unity,StephenHodgson/MixedRealityToolkit-Unity
|
Assets/MixedRealityToolkit/_Core/Definitions/Devices/ControllerState.cs
|
Assets/MixedRealityToolkit/_Core/Definitions/Devices/ControllerState.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices
{
/// <summary>
/// The Controller State defines how a controller or headset is currently being tracked.
/// This enables developers to be able to handle non-tracked situations and react accordingly
/// </summary>
public enum ControllerState
{
/// <summary>
/// No controller state provided by the SDK.
/// </summary>
None = 0,
/// <summary>
/// Reserved, for systems that provide alternate tracking.
/// </summary>
Other,
/// <summary>
/// The controller is currently fully tracked and has accurate positioning.
/// </summary>
Tracked,
/// <summary>
/// The controller is currently not tracked.
/// </summary>
NotTracked,
/// <summary>
/// The controller is currently only returning position data.
/// </summary>
PositionOnly,
/// <summary>
/// The controller is currently only returning orientation data.
/// </summary>
OrientationOnly
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices
{
/// <summary>
/// The Controller State defines how a controller or headset is currently being tracked.
/// This enables developers to be able to handle non-tracked situations and react accordingly
/// </summary>
public enum ControllerState
{
/// <summary>
/// No controller state provided by the SDK.
/// </summary>
None = 0,
/// <summary>
/// The controller is currently fully tracked and has accurate positioning.
/// </summary>
Tracked,
/// <summary>
/// The controller is currently not tracked.
/// </summary>
NotTracked,
/// <summary>
/// The controller is currently only returning orientation data.
/// </summary>
OrientationOnly,
/// <summary>
/// Reserved, for systems that provide alternate tracking.
/// </summary>
Other
}
}
|
mit
|
C#
|
6da14c506f924f658410b6d1fe3f4ec718c5dcc1
|
mark CLS compliant
|
OBeautifulCode/OBeautifulCode.String
|
OBeautifulCode.Libs.String/Properties/AssemblyInfo.cs
|
OBeautifulCode.Libs.String/Properties/AssemblyInfo.cs
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="OBeautifulCode">
// Copyright 2014 OBeautifulCode
// </copyright>
// <summary>
// Assembly information.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
using System;
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("OBeautifulCode.Libs.String")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OBeautifulCode.Libs.String")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("563d0c9f-7257-49a0-a91c-b910ae844d73")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: CLSCompliant(true)]
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="OBeautifulCode">
// Copyright 2014 OBeautifulCode
// </copyright>
// <summary>
// Assembly information.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
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("OBeautifulCode.Libs.String")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OBeautifulCode.Libs.String")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("563d0c9f-7257-49a0-a91c-b910ae844d73")]
// 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#
|
07d01c4672d5afcb5134923b06c201b44b5303a6
|
Fix for Ice cream help message being null.
|
samfun123/KtaneTwitchPlays,CaitSith2/KtaneTwitchPlays
|
TwitchPlaysAssembly/Src/ComponentSolvers/Modded/Misc/IceCreamConfirm.cs
|
TwitchPlaysAssembly/Src/ComponentSolvers/Modded/Misc/IceCreamConfirm.cs
|
using System;
using System.Collections;
using System.Reflection;
using Newtonsoft.Json;
public class IceCreamConfirm : ComponentSolver
{
public IceCreamConfirm(BombCommander bombCommander, BombComponent bombComponent) :
base(bombCommander, bombComponent)
{
_component = bombComponent.GetComponent(_componentType);
string help = (string)_HelpMessageField.GetValue(_component);
modInfo = ComponentSolverFactory.GetModuleInfo(GetModuleType(), help + " Check the opening hours with !{0} hours.");
KMModSettings modSettings = bombComponent.GetComponent<KMModSettings>();
try
{
settings = JsonConvert.DeserializeObject<Settings>(modSettings.Settings);
}
catch (Exception ex)
{
DebugHelper.LogException(ex, "Could not deserialize ice cream settings:");
TwitchPlaySettings.data.ShowHours = false;
TwitchPlaySettings.WriteDataToFile();
}
}
protected override IEnumerator RespondToCommandInternal(string inputCommand)
{
if (inputCommand.ToLowerInvariant().Equals("hours"))
{
yield return !TwitchPlaySettings.data.ShowHours
? "sendtochat Sorry, hours are currently unavailable. Enjoy your ice cream!"
: $"sendtochat {(settings.openingTimeEnabled ? "We are open every other hour today." : "We're open all day today!")}";
}
else
{
IEnumerator command = (IEnumerator)_ProcessCommandMethod.Invoke(_component, new object[] { inputCommand });
if (command == null) yield break;
while (command.MoveNext())
{
yield return command.Current;
}
}
}
static IceCreamConfirm()
{
_componentType = ReflectionHelper.FindType("IceCreamModule");
_ProcessCommandMethod = _componentType.GetMethod("ProcessTwitchCommand", BindingFlags.Public | BindingFlags.Instance);
_HelpMessageField = _componentType.GetField("TwitchHelpMessage", BindingFlags.Public | BindingFlags.Instance);
}
class Settings
{
#pragma warning disable 649
public bool openingTimeEnabled;
#pragma warning restore 649
}
private static Type _componentType = null;
private static MethodInfo _ProcessCommandMethod = null;
private static FieldInfo _HelpMessageField = null;
private object _component = null;
private Settings settings;
}
|
using System;
using System.Collections;
using System.Reflection;
using Newtonsoft.Json;
public class IceCreamConfirm : ComponentSolver
{
public IceCreamConfirm(BombCommander bombCommander, BombComponent bombComponent) :
base(bombCommander, bombComponent)
{
_component = bombComponent.GetComponent(_componentType);
modInfo = ComponentSolverFactory.GetModuleInfo(GetModuleType());
KMModSettings modSettings = bombComponent.GetComponent<KMModSettings>();
try
{
settings = JsonConvert.DeserializeObject<Settings>(modSettings.Settings);
}
catch (Exception ex)
{
DebugHelper.LogException(ex, "Could not deserialize ice cream settings:");
TwitchPlaySettings.data.ShowHours = false;
TwitchPlaySettings.WriteDataToFile();
}
}
protected override IEnumerator RespondToCommandInternal(string inputCommand)
{
if (inputCommand.ToLowerInvariant().Equals("hours"))
{
yield return null;
if (!TwitchPlaySettings.data.ShowHours)
{
yield return $"sendtochat Sorry, hours are currently unavailable. Enjoy your ice cream!";
yield break;
}
string hours = settings.openingTimeEnabled ? "We are open every other hour today." : "We're open all day today!";
yield return $"sendtochat {hours}";
}
else
{
IEnumerator command = (IEnumerator)_ProcessCommandMethod.Invoke(_component, new object[] { inputCommand });
if (command == null) yield break;
while (command.MoveNext())
{
yield return command.Current;
}
}
}
static IceCreamConfirm()
{
_componentType = ReflectionHelper.FindType("IceCreamModule");
_ProcessCommandMethod = _componentType.GetMethod("ProcessTwitchCommand", BindingFlags.Public | BindingFlags.Instance);
}
class Settings
{
#pragma warning disable 649
public bool openingTimeEnabled;
#pragma warning restore 649
}
private static Type _componentType = null;
private static MethodInfo _ProcessCommandMethod = null;
private object _component = null;
private Settings settings;
}
|
mit
|
C#
|
4ba41ddadefef6d0f578dc1e3fca7640c700d3f0
|
Add validation implementation in people module.
|
henrikfroehling/TraktApiSharp
|
Source/Lib/TraktApiSharp/Modules/TraktPeopleModule.cs
|
Source/Lib/TraktApiSharp/Modules/TraktPeopleModule.cs
|
namespace TraktApiSharp.Modules
{
using Objects.Basic;
using Objects.Get.People;
using Objects.Get.People.Credits;
using Requests;
using Requests.WithoutOAuth.People;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
public class TraktPeopleModule : TraktBaseModule
{
public TraktPeopleModule(TraktClient client) : base(client) { }
public async Task<TraktPerson> GetPersonAsync(string id, TraktExtendedOption extended = null)
{
Validate(id);
return await QueryAsync(new TraktPersonSummaryRequest(Client)
{
Id = id,
ExtendedOption = extended ?? new TraktExtendedOption()
});
}
public async Task<TraktListResult<TraktPerson>> GetPersonsAsync(string[] ids, TraktExtendedOption extended = null)
{
if (ids == null || ids.Length <= 0)
return null;
var persons = new List<TraktPerson>();
foreach (var id in ids)
{
var show = await GetPersonAsync(id, extended);
if (show != null)
persons.Add(show);
}
return new TraktListResult<TraktPerson> { Items = persons };
}
public async Task<TraktPersonMovieCredits> GetPersonMovieCreditsAsync(string id, TraktExtendedOption extended = null)
{
Validate(id);
return await QueryAsync(new TraktPersonMovieCreditsRequest(Client)
{
Id = id,
ExtendedOption = extended ?? new TraktExtendedOption()
});
}
public async Task<TraktPersonShowCredits> GetPersonShowCreditsAsync(string id, TraktExtendedOption extended = null)
{
Validate(id);
return await QueryAsync(new TraktPersonShowCreditsRequest(Client)
{
Id = id,
ExtendedOption = extended ?? new TraktExtendedOption()
});
}
private void Validate(string id)
{
if (string.IsNullOrEmpty(id))
throw new ArgumentException("person id not valid", "id");
}
}
}
|
namespace TraktApiSharp.Modules
{
using Objects.Basic;
using Objects.Get.People;
using Objects.Get.People.Credits;
using Requests;
using Requests.WithoutOAuth.People;
using System.Collections.Generic;
using System.Threading.Tasks;
public class TraktPeopleModule : TraktBaseModule
{
public TraktPeopleModule(TraktClient client) : base(client) { }
public async Task<TraktPerson> GetPersonAsync(string id, TraktExtendedOption extended = null)
{
return await QueryAsync(new TraktPersonSummaryRequest(Client)
{
Id = id,
ExtendedOption = extended ?? new TraktExtendedOption()
});
}
public async Task<TraktListResult<TraktPerson>> GetPersonsAsync(string[] ids, TraktExtendedOption extended = null)
{
if (ids == null || ids.Length <= 0)
return null;
var persons = new List<TraktPerson>();
foreach (var id in ids)
{
var show = await GetPersonAsync(id, extended);
if (show != null)
persons.Add(show);
}
return new TraktListResult<TraktPerson> { Items = persons };
}
public async Task<TraktPersonMovieCredits> GetPersonMovieCreditsAsync(string id, TraktExtendedOption extended = null)
{
return await QueryAsync(new TraktPersonMovieCreditsRequest(Client)
{
Id = id,
ExtendedOption = extended ?? new TraktExtendedOption()
});
}
public async Task<TraktPersonShowCredits> GetPersonShowCreditsAsync(string id, TraktExtendedOption extended = null)
{
return await QueryAsync(new TraktPersonShowCreditsRequest(Client)
{
Id = id,
ExtendedOption = extended ?? new TraktExtendedOption()
});
}
}
}
|
mit
|
C#
|
12f80cf95ab4d4144bf4f801ee016220c8223f05
|
Remove unused setters from IMapPresenterModel properties
|
MHeasell/Mappy,MHeasell/Mappy
|
Mappy/Models/IMapPresenterModel.cs
|
Mappy/Models/IMapPresenterModel.cs
|
namespace Mappy.Models
{
using System.ComponentModel;
using System.Drawing;
public interface IMapPresenterModel : INotifyPropertyChanged
{
IBindingMapModel Map { get; }
bool HeightmapVisible { get; }
bool FeaturesVisible { get; }
bool GridVisible { get; }
Size GridSize { get; }
Color GridColor { get; }
}
}
|
namespace Mappy.Models
{
using System.ComponentModel;
using System.Drawing;
public interface IMapPresenterModel : INotifyPropertyChanged
{
IBindingMapModel Map { get; }
bool HeightmapVisible { get; set; }
bool FeaturesVisible { get; set; }
bool GridVisible { get; set; }
Size GridSize { get; set; }
Color GridColor { get; set; }
}
}
|
mit
|
C#
|
2e3b9efbd58fc7d3ba7b0b97c796ff953d16ece1
|
Make NetworkConverter internal
|
maxmind/GeoIP2-dotnet
|
MaxMind.GeoIP2/NetworkConverter.cs
|
MaxMind.GeoIP2/NetworkConverter.cs
|
using MaxMind.Db;
using Newtonsoft.Json;
using System;
using System.Net;
namespace MaxMind.GeoIP2
{
internal class NetworkConverter : JsonConverter<Network>
{
public override void WriteJson(JsonWriter writer, Network value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override Network ReadJson(JsonReader reader, Type objectType, Network existingValue, bool hasExistingValue, JsonSerializer serializer)
{
// It'd probably be nice if we added an appropriate constructor
// to Network.
var parts = ((string)reader.Value).Split('/');
if (parts.Length != 2 || !int.TryParse(parts[1], out var prefixLength))
{
throw new JsonSerializationException("Network not in CIDR format: " + reader.Value);
}
return new Network(IPAddress.Parse(parts[0]), prefixLength);
}
}
}
|
using MaxMind.Db;
using Newtonsoft.Json;
using System;
using System.Net;
namespace MaxMind.GeoIP2
{
class NetworkConverter : JsonConverter<Network>
{
public override void WriteJson(JsonWriter writer, Network value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override Network ReadJson(JsonReader reader, Type objectType, Network existingValue, bool hasExistingValue, JsonSerializer serializer)
{
// It'd probably be nice if we added an appropriate constructor
// to Network.
var parts = ((string)reader.Value).Split('/');
if (parts.Length != 2 || !int.TryParse(parts[1], out var prefixLength))
{
throw new JsonSerializationException("Network not in CIDR format: " + reader.Value);
}
return new Network(IPAddress.Parse(parts[0]), prefixLength);
}
}
}
|
apache-2.0
|
C#
|
be236da54bfdfdcf3cadf3e025c1819d205caf4b
|
Remove unused flag
|
kzu/cecil,ttRevan/cecil,gluck/cecil,sailro/cecil,saynomoo/cecil,cgourlay/cecil,fnajera-rac-de/cecil,joj/cecil,jbevain/cecil,xen2/cecil,furesoft/cecil,mono/cecil,SiliconStudio/Mono.Cecil
|
Mono.Cecil/MethodImplAttributes.cs
|
Mono.Cecil/MethodImplAttributes.cs
|
//
// MethodImplAttributes.cs
//
// Author:
// Jb Evain (jbevain@gmail.com)
//
// Copyright (c) 2008 - 2011 Jb Evain
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Mono.Cecil {
[Flags]
public enum MethodImplAttributes : ushort {
CodeTypeMask = 0x0003,
IL = 0x0000, // Method impl is CIL
Native = 0x0001, // Method impl is native
OPTIL = 0x0002, // Reserved: shall be zero in conforming implementations
Runtime = 0x0003, // Method impl is provided by the runtime
ManagedMask = 0x0004, // Flags specifying whether the code is managed or unmanaged
Unmanaged = 0x0004, // Method impl is unmanaged, otherwise managed
Managed = 0x0000, // Method impl is managed
// Implementation info and interop
ForwardRef = 0x0010, // Indicates method is defined; used primarily in merge scenarios
PreserveSig = 0x0080, // Reserved: conforming implementations may ignore
InternalCall = 0x1000, // Reserved: shall be zero in conforming implementations
Synchronized = 0x0020, // Method is single threaded through the body
NoOptimization = 0x0040, // Method is not optimized by the JIT.
NoInlining = 0x0008, // Method may not be inlined
}
}
|
//
// MethodImplAttributes.cs
//
// Author:
// Jb Evain (jbevain@gmail.com)
//
// Copyright (c) 2008 - 2011 Jb Evain
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Mono.Cecil {
[Flags]
public enum MethodImplAttributes : ushort {
CodeTypeMask = 0x0003,
IL = 0x0000, // Method impl is CIL
Native = 0x0001, // Method impl is native
OPTIL = 0x0002, // Reserved: shall be zero in conforming implementations
Runtime = 0x0003, // Method impl is provided by the runtime
ManagedMask = 0x0004, // Flags specifying whether the code is managed or unmanaged
Unmanaged = 0x0004, // Method impl is unmanaged, otherwise managed
Managed = 0x0000, // Method impl is managed
// Implementation info and interop
ForwardRef = 0x0010, // Indicates method is defined; used primarily in merge scenarios
PreserveSig = 0x0080, // Reserved: conforming implementations may ignore
InternalCall = 0x1000, // Reserved: shall be zero in conforming implementations
Synchronized = 0x0020, // Method is single threaded through the body
NoOptimization = 0x0040, // Method is not optimized by the JIT.
NoInlining = 0x0008, // Method may not be inlined
MaxMethodImplVal = 0xffff // Range check value
}
}
|
mit
|
C#
|
2b36a3c2cca96a4143cbd2d854db08c9c4dea6f2
|
Update UnsignedBigIntegerBinarySerializer.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Serialization/Numerics/UnsignedBigIntegerBinarySerializer.cs
|
TIKSN.Core/Serialization/Numerics/UnsignedBigIntegerBinarySerializer.cs
|
using System;
using System.Linq;
using System.Numerics;
namespace TIKSN.Serialization.Numerics
{
/// <summary>
/// Custom (specialized or typed) serializer for unsigned <see cref="BigInteger"/>
/// </summary>
public class UnsignedBigIntegerBinarySerializer : ICustomSerializer<byte[], BigInteger>
{
/// <summary>
/// Serializes unsigned <see cref="BigInteger"/> to byte array
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public byte[] Serialize(BigInteger obj)
{
if (obj.Sign < 0)
throw new ArgumentOutOfRangeException(nameof(obj), obj, "Big integer must be non-negative number.");
var underlyingBytes = obj.ToByteArray();
var last = underlyingBytes[underlyingBytes.Length - 1];
if (last == 0b_0000_0000 && underlyingBytes.Length > 1)
return underlyingBytes.SkipLast(1).ToArray();
return underlyingBytes;
}
}
}
|
using System;
using System.Linq;
using System.Numerics;
namespace TIKSN.Serialization.Numerics
{
/// <summary>
/// Custom (specialized or typed) serializer for unsigned <see cref="BigInteger"/>
/// </summary>
public class UnsignedBigIntegerBinarySerializer : ICustomSerializer<byte[], BigInteger>
{
/// <summary>
/// Serializes unsigned <see cref="BigInteger"/> to byte array
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public byte[] Serialize(BigInteger obj)
{
if (obj.Sign < 0)
throw new ArgumentOutOfRangeException(nameof(obj), obj, "Big integer must be non-negative number.");
var underlyingBytes = obj.ToByteArray();
var last = underlyingBytes[underlyingBytes.Length - 1];
if (last == 0b_0000_0000 && underlyingBytes.Length > 1)
return underlyingBytes.SkipLast(1).ToArray();
return underlyingBytes;
}
}
}
|
mit
|
C#
|
390654a8854799eb453d02b56220f580d8facd8f
|
Remove old ServiceBusConnection declaration
|
dotnet-architecture/eShopOnContainers,albertodall/eShopOnContainers,andrelmp/eShopOnContainers,albertodall/eShopOnContainers,TypeW/eShopOnContainers,andrelmp/eShopOnContainers,dotnet-architecture/eShopOnContainers,productinfo/eShopOnContainers,albertodall/eShopOnContainers,productinfo/eShopOnContainers,albertodall/eShopOnContainers,dotnet-architecture/eShopOnContainers,dotnet-architecture/eShopOnContainers,albertodall/eShopOnContainers,productinfo/eShopOnContainers,skynode/eShopOnContainers,skynode/eShopOnContainers,TypeW/eShopOnContainers,andrelmp/eShopOnContainers,TypeW/eShopOnContainers,skynode/eShopOnContainers,productinfo/eShopOnContainers,productinfo/eShopOnContainers,TypeW/eShopOnContainers,productinfo/eShopOnContainers,skynode/eShopOnContainers,skynode/eShopOnContainers,TypeW/eShopOnContainers,dotnet-architecture/eShopOnContainers,andrelmp/eShopOnContainers,andrelmp/eShopOnContainers,andrelmp/eShopOnContainers
|
src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs
|
src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs
|
using Microsoft.Azure.ServiceBus;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus
{
public class DefaultServiceBusPersisterConnection :IServiceBusPersisterConnection
{
private readonly ILogger<DefaultServiceBusPersisterConnection> _logger;
private readonly ServiceBusConnectionStringBuilder _serviceBusConnectionStringBuilder;
private ITopicClient _topicClient;
bool _disposed;
public DefaultServiceBusPersisterConnection(ServiceBusConnectionStringBuilder serviceBusConnectionStringBuilder,
TimeSpan operationTimeout, RetryPolicy retryPolicy, ILogger<DefaultServiceBusPersisterConnection> logger)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_serviceBusConnectionStringBuilder = serviceBusConnectionStringBuilder ??
throw new ArgumentNullException(nameof(serviceBusConnectionStringBuilder));
_topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default);
}
public ServiceBusConnectionStringBuilder ServiceBusConnectionStringBuilder => _serviceBusConnectionStringBuilder;
public ITopicClient CreateModel()
{
if(_topicClient.IsClosedOrClosing)
{
_topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default);
}
return _topicClient;
}
public void Dispose()
{
if (_disposed) return;
_disposed = true;
}
}
}
|
using Microsoft.Azure.ServiceBus;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus
{
public class DefaultServiceBusPersisterConnection : ServiceBusConnection, IServiceBusPersisterConnection
{
private readonly ILogger<ServiceBusConnection> _logger;
private readonly ServiceBusConnectionStringBuilder _serviceBusConnectionStringBuilder;
private ITopicClient _topicClient;
bool _disposed;
object sync_root = new object();
public DefaultServiceBusPersisterConnection(ServiceBusConnectionStringBuilder serviceBusConnectionStringBuilder,
TimeSpan operationTimeout, RetryPolicy retryPolicy, ILogger<ServiceBusConnection> logger)
: base(operationTimeout, retryPolicy)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
InitializeConnection(serviceBusConnectionStringBuilder);
_serviceBusConnectionStringBuilder = serviceBusConnectionStringBuilder ??
throw new ArgumentNullException(nameof(serviceBusConnectionStringBuilder));
}
public bool IsConnected => _topicClient.IsClosedOrClosing;
public ServiceBusConnectionStringBuilder ServiceBusConnectionStringBuilder => _serviceBusConnectionStringBuilder;
public ITopicClient CreateModel()
{
if(_topicClient.IsClosedOrClosing)
{
_topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy);
}
return _topicClient;
}
public void Dispose()
{
if (_disposed) return;
_disposed = true;
}
}
}
|
mit
|
C#
|
7bc65ffd5a115da378e8f63d44ceb65f54959231
|
Revert "Fix up for 16.11"
|
KevinRansom/roslyn,eriawan/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,weltkante/roslyn,physhi/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,mavasani/roslyn,diryboy/roslyn,dotnet/roslyn,wvdd007/roslyn,mavasani/roslyn,mavasani/roslyn,AmadeusW/roslyn,weltkante/roslyn,AmadeusW/roslyn,shyamnamboodiripad/roslyn,bartdesmet/roslyn,eriawan/roslyn,KevinRansom/roslyn,wvdd007/roslyn,jasonmalinowski/roslyn,dotnet/roslyn,CyrusNajmabadi/roslyn,eriawan/roslyn,diryboy/roslyn,KevinRansom/roslyn,dotnet/roslyn,weltkante/roslyn,sharwell/roslyn,sharwell/roslyn,physhi/roslyn,sharwell/roslyn,wvdd007/roslyn,CyrusNajmabadi/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn
|
src/Tools/ExternalAccess/OmniSharp/Internal/PickMembers/OmniSharpPickMembersService.cs
|
src/Tools/ExternalAccess/OmniSharp/Internal/PickMembers/OmniSharpPickMembersService.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;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.PickMembers;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.PickMembers;
namespace Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Internal.PickMembers
{
[Shared]
[ExportWorkspaceService(typeof(IPickMembersService), ServiceLayer.Host)]
internal class OmniSharpPickMembersService : IPickMembersService
{
private readonly IOmniSharpPickMembersService _omniSharpPickMembersService;
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public OmniSharpPickMembersService(IOmniSharpPickMembersService omniSharpPickMembersService)
{
_omniSharpPickMembersService = omniSharpPickMembersService;
}
public PickMembersResult PickMembers(string title, ImmutableArray<ISymbol> members, ImmutableArray<PickMembersOption> options = default, bool selectAll = true)
{
var result = _omniSharpPickMembersService.PickMembers(title, members, options.SelectAsArray(o => new OmniSharpPickMembersOption(o)), selectAll);
return new(result.Members, result.Options.SelectAsArray(o => o.PickMembersOptionInternal), result.SelectedAll);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.PickMembers;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.PickMembers;
namespace Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Internal.PickMembers
{
[Shared]
[ExportWorkspaceService(typeof(IPickMembersService), ServiceLayer.Host)]
internal class OmniSharpPickMembersService : IPickMembersService
{
private readonly IOmniSharpPickMembersService _omniSharpPickMembersService;
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public OmniSharpPickMembersService(IOmniSharpPickMembersService omniSharpPickMembersService)
{
_omniSharpPickMembersService = omniSharpPickMembersService;
}
public PickMembersResult PickMembers(string title, ImmutableArray<ISymbol> members, ImmutableArray<PickMembersOption> options = default)
{
var result = _omniSharpPickMembersService.PickMembers(title, members, options.SelectAsArray(o => new OmniSharpPickMembersOption(o)), selectAll: true);
return new(result.Members, result.Options.SelectAsArray(o => o.PickMembersOptionInternal));
}
}
}
|
mit
|
C#
|
42b4d9a54bd1b24ef7cf132b9a9ff0802c2875f5
|
Fix bug when trying to create an User to a build that has no triggered by.
|
skahal/Buildron,skahal/Buildron,skahal/Buildron
|
src/Buildron/Assets/_Assets/Scripts/Controllers/Users/UsersManager.cs
|
src/Buildron/Assets/_Assets/Scripts/Controllers/Users/UsersManager.cs
|
#region Usings
using UnityEngine;
using System.Collections;
using Buildron.Domain;
using Zenject;
using Buildron.Domain.Builds;
using Buildron.Domain.Users;
#endregion
/// <summary>
/// Manages the UserController creations.
/// </summary>
[AddComponentMenu("Buildron/Controllers/UsersManager")]
public class UsersManager : MonoBehaviour
{
#region Fields
private Vector3 m_currentSpawnPosition;
private int m_currentRowUserCount;
private int m_rowsCount = 1;
[Inject]
private IBuildService m_buildService;
#endregion
#region Properties
public Vector3 FirstSpawnPosition = new Vector3(-10, -3, -10);
public Vector3 DistanceBetweenUsers = new Vector3(2, 0, 0);
public int NumberUserPerRows = 5;
public Vector3 DistanceBetweenUsersRows = new Vector3(0, 0, 2);
[Inject]
public UserController.Factory Factory { get; set; }
#endregion
#region Methods
private void Awake ()
{
m_buildService.BuildFound += (sender, e) => {
CreateUserGameObject(e.Build);
e.Build.StatusChanged += (sender1, e1) => {
CreateUserGameObject(e.Build);
};
};
m_currentSpawnPosition = FirstSpawnPosition;
}
void CreateUserGameObject (IBuild build)
{
if (build.TriggeredBy == null)
{
build.TriggeredByChanged += delegate {
CreateUserGameObject(build);
};
return;
}
var go = UserController.GetGameObject (build.TriggeredBy);
if (go != null) {
go.GetComponent<UserController> ().Data = build.TriggeredBy;
} else {
go = UserController.CreateGameObject (build.TriggeredBy, Factory);
go.transform.position = m_currentSpawnPosition;
go.transform.parent = transform;
m_currentSpawnPosition += DistanceBetweenUsers;
m_currentRowUserCount++;
if (m_currentRowUserCount >= NumberUserPerRows) {
m_currentRowUserCount = 0;
m_currentSpawnPosition = FirstSpawnPosition;
m_currentSpawnPosition += DistanceBetweenUsersRows * m_rowsCount;
m_rowsCount++;
}
}
}
#endregion
}
|
#region Usings
using UnityEngine;
using System.Collections;
using Buildron.Domain;
using Zenject;
using Buildron.Domain.Builds;
using Buildron.Domain.Users;
#endregion
/// <summary>
/// Manages the UserController creations.
/// </summary>
[AddComponentMenu("Buildron/Controllers/UsersManager")]
public class UsersManager : MonoBehaviour
{
#region Fields
private Vector3 m_currentSpawnPosition;
private int m_currentRowUserCount;
private int m_rowsCount = 1;
[Inject]
private IBuildService m_buildService;
#endregion
#region Properties
public Vector3 FirstSpawnPosition = new Vector3(-10, -3, -10);
public Vector3 DistanceBetweenUsers = new Vector3(2, 0, 0);
public int NumberUserPerRows = 5;
public Vector3 DistanceBetweenUsersRows = new Vector3(0, 0, 2);
[Inject]
public UserController.Factory Factory { get; set; }
#endregion
#region Methods
private void Awake ()
{
m_buildService.BuildFound += (sender, e) => {
CreateUserGameObject(e.Build);
e.Build.StatusChanged += (sender1, e1) => {
CreateUserGameObject(e.Build);
};
};
m_currentSpawnPosition = FirstSpawnPosition;
}
private void CreateUserGameObject (Build build)
{
if (build.TriggeredBy == null) {
build.TriggeredByChanged += delegate {
CreateUserGameObject (build);
};
} else {
CreateUserGameObject (build);
}
}
void CreateUserGameObject (IBuild build)
{
var go = UserController.GetGameObject (build.TriggeredBy);
if (go != null) {
go.GetComponent<UserController> ().Data = build.TriggeredBy;
} else {
go = UserController.CreateGameObject (build.TriggeredBy, Factory);
go.transform.position = m_currentSpawnPosition;
go.transform.parent = transform;
m_currentSpawnPosition += DistanceBetweenUsers;
m_currentRowUserCount++;
if (m_currentRowUserCount >= NumberUserPerRows) {
m_currentRowUserCount = 0;
m_currentSpawnPosition = FirstSpawnPosition;
m_currentSpawnPosition += DistanceBetweenUsersRows * m_rowsCount;
m_rowsCount++;
}
}
}
#endregion
}
|
mit
|
C#
|
6d9ee1b4931db77219168b20d1b6f502c5fecbb9
|
Add missing `Installments` option in `PaymentIntentPaymentMethodOptionsCardOptions`
|
stripe/stripe-dotnet
|
src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs
|
src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs
|
namespace Stripe
{
using System;
using Newtonsoft.Json;
public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions
{
/// <summary>
/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only).
/// </summary>
[JsonProperty("installments")]
public PaymentIntentPaymentMethodOptionsCardInstallmentsOptions Installments { get; set; }
/// <summary>
/// When specified, this parameter indicates that a transaction will be marked as MOTO
/// (Mail Order Telephone Order) and thus out of scope for SCA.
/// </summary>
[JsonProperty("moto")]
public bool? Moto { get; set; }
/// <summary>
/// Control when to request 3D Secure on this PaymentIntent.
/// </summary>
[JsonProperty("request_three_d_secure")]
public string RequestThreeDSecure { get; set; }
}
}
|
namespace Stripe
{
using System;
using Newtonsoft.Json;
public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions
{
/// <summary>
/// When specified, this parameter indicates that a transaction will be marked as MOTO
/// (Mail Order Telephone Order) and thus out of scope for SCA.
/// </summary>
[JsonProperty("moto")]
public bool? Moto { get; set; }
/// <summary>
/// Control when to request 3D Secure on this PaymentIntent.
/// </summary>
[JsonProperty("request_three_d_secure")]
public string RequestThreeDSecure { get; set; }
}
}
|
apache-2.0
|
C#
|
f29459b769be09c0d9fe5752e92073b52d1d56fb
|
Fix lines spaces
|
zebraxxl/Winium.Desktop,jorik041/Winium.Desktop,2gis/Winium.Desktop
|
src/Winium.Desktop.Driver/CommandExecutors/GetDataGridCellExecutor.cs
|
src/Winium.Desktop.Driver/CommandExecutors/GetDataGridCellExecutor.cs
|
namespace Winium.Desktop.Driver.CommandExecutors
{
#region using
using Winium.Cruciatus.Extensions;
using Winium.StoreApps.Common;
#endregion
internal class GetDataGridCellExecutor : CommandExecutorBase
{
#region Methods
protected override string DoImpl()
{
var registeredKey = this.ExecutedCommand.Parameters["ID"].ToString();
var column = int.Parse(this.ExecutedCommand.Parameters["COLUMN"].ToString());
var row = int.Parse(this.ExecutedCommand.Parameters["ROW"].ToString());
var dataGrid = this.Automator.Elements.GetRegisteredElement(registeredKey).ToDataGrid();
var elementId = this.Automator.Elements.RegisterElement(dataGrid.Item(row, column));
var webElement = new JsonWebElementContent(elementId);
return this.JsonResponse(ResponseStatus.Success, webElement);
}
#endregion
}
}
|
namespace Winium.Desktop.Driver.CommandExecutors
{
#region using
using Winium.Cruciatus.Extensions;
using Winium.StoreApps.Common;
#endregion
internal class GetDataGridCellExecutor : CommandExecutorBase
{
#region Methods
protected override string DoImpl()
{
var registeredKey = this.ExecutedCommand.Parameters["ID"].ToString();
var dataGrid = this.Automator.Elements.GetRegisteredElement(registeredKey).ToDataGrid();
var column = int.Parse(this.ExecutedCommand.Parameters["COLUMN"].ToString());
var row = int.Parse(this.ExecutedCommand.Parameters["ROW"].ToString());
var elementId = this.Automator.Elements.RegisterElement(dataGrid.Item(row, column));
var webElement = new JsonWebElementContent(elementId);
return this.JsonResponse(ResponseStatus.Success, webElement);
}
#endregion
}
}
|
mpl-2.0
|
C#
|
44c49dea2413243a153dc86200f5b9c367107144
|
Add name and value to Bootstrap components
|
roman-yagodin/R7.Epsilon,roman-yagodin/R7.Epsilon,roman-yagodin/R7.Epsilon
|
R7.Epsilon/Skins/PopupSkin.ascx.cs
|
R7.Epsilon/Skins/PopupSkin.ascx.cs
|
//
// PopupSkin.ascx.cs
//
// Author:
// Roman M. Yagodin <roman.yagodin@gmail.com>
//
// Copyright (c) 2017 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using DotNetNuke.Web.Client;
using DotNetNuke.Web.Client.ClientResourceManagement;
namespace R7.Epsilon.Skins
{
public class PopupSkin : EpsilonSkinBase
{
protected override void OnInit (EventArgs e)
{
base.OnInit (e);
var loadThemeParam = Request.QueryString ["loadTheme"];
if (loadThemeParam != null) {
bool loadTheme;
if (bool.TryParse (loadThemeParam, out loadTheme)) {
if (loadTheme) {
ClientResourceManager.RegisterStyleSheet (Page, SkinPath + "css/bootstrap.min.css", (int) FileOrder.Css.SkinCss - 1, "DnnPageHeaderProvider", "bootstrap", "3.3.7");
ClientResourceManager.RegisterStyleSheet (Page, SkinPath + "css/bootstrap-theme.min.css", (int) FileOrder.Css.SkinCss - 1, "DnnPageHeaderProvider", "bootstrap.theme", "3.3.7");
ClientResourceManager.RegisterStyleSheet (Page, SkinPath + Config.SkinCss);
ClientResourceManager.RegisterScript (Page, SkinPath + "js/bootstrap.min.js", (int) FileOrder.Js.jQueryUI, "DnnFormBottomProvider", "bootstrap", "3.3.7");
}
}
}
}
}
}
|
//
// PopupSkin.ascx.cs
//
// Author:
// Roman M. Yagodin <roman.yagodin@gmail.com>
//
// Copyright (c) 2017 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using DotNetNuke.Web.Client;
using DotNetNuke.Web.Client.ClientResourceManagement;
namespace R7.Epsilon.Skins
{
public class PopupSkin : EpsilonSkinBase
{
protected override void OnInit (EventArgs e)
{
base.OnInit (e);
var loadThemeParam = Request.QueryString ["loadTheme"];
if (loadThemeParam != null) {
bool loadTheme;
if (bool.TryParse (loadThemeParam, out loadTheme)) {
if (loadTheme) {
ClientResourceManager.RegisterStyleSheet (Page, SkinPath + "css/bootstrap.min.css", (int) FileOrder.Css.SkinCss - 1);
ClientResourceManager.RegisterStyleSheet (Page, SkinPath + "css/bootstrap-theme.min.css", (int) FileOrder.Css.SkinCss - 1);
ClientResourceManager.RegisterStyleSheet (Page, SkinPath + Config.SkinCss);
ClientResourceManager.RegisterScript (Page, SkinPath + "js/bootstrap.min.js", FileOrder.Js.jQueryUI, "DnnFormBottomProvider");
}
}
}
}
}
}
|
agpl-3.0
|
C#
|
9d8dac9d2e14d0b57f4d7025625eea3eb6d30798
|
Add benchmark for formatting a pattern with non-zero tick-of-second (ISO format).
|
nodatime/nodatime,BenJenkinson/nodatime,malcolmr/nodatime,zaccharles/nodatime,malcolmr/nodatime,zaccharles/nodatime,jskeet/nodatime,nodatime/nodatime,jskeet/nodatime,BenJenkinson/nodatime,zaccharles/nodatime,zaccharles/nodatime,zaccharles/nodatime,malcolmr/nodatime,zaccharles/nodatime,malcolmr/nodatime
|
src/NodaTime.Benchmarks/NodaTimeTests/Text/InstantPatternBenchmarks.cs
|
src/NodaTime.Benchmarks/NodaTimeTests/Text/InstantPatternBenchmarks.cs
|
// Copyright 2013 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using System.Globalization;
using NodaTime.Benchmarks.Framework;
using NodaTime.Text;
namespace NodaTime.Benchmarks.NodaTimeTests.Text
{
[Category("Text")]
class InstantPatternBenchmarks
{
private static readonly Instant Sample = Instant.FromUtc(2011, 8, 24, 12, 29, 30);
private static readonly Instant SampleWithTicks = Instant.FromUtc(2011, 8, 24, 12, 29, 30).PlusTicks(1234567);
private static readonly InstantPattern GeneralPattern = InstantPattern.CreateWithInvariantCulture("g");
private static readonly InstantPattern NumberPattern = InstantPattern.CreateWithInvariantCulture("n");
private static readonly string SampleStringGeneral = GeneralPattern.Format(Sample);
private static readonly string SampleStringNumber = NumberPattern.Format(Sample);
private static readonly string SampleStringExtendedIso = InstantPattern.ExtendedIsoPattern.Format(Sample);
private static readonly CultureInfo MutableInvariantCulture = (CultureInfo) CultureInfo.InvariantCulture.Clone();
[Benchmark]
public void NumberPatternFormat()
{
NumberPattern.Format(Sample);
}
[Benchmark]
public void GeneralPatternFormat()
{
GeneralPattern.Format(Sample);
}
[Benchmark]
public void ExtendedIsoPatternFormat()
{
InstantPattern.ExtendedIsoPattern.Format(Sample);
}
[Benchmark]
public void ExtendedIsoPatternFormatWithTicks()
{
InstantPattern.ExtendedIsoPattern.Format(SampleWithTicks);
}
[Benchmark]
public void NumberPatternParse()
{
NumberPattern.Parse(SampleStringNumber);
}
[Benchmark]
public void GeneralPatternParse()
{
GeneralPattern.Parse(SampleStringGeneral);
}
[Benchmark]
public void ExtendedIsoPatternParse()
{
InstantPattern.ExtendedIsoPattern.Parse(SampleStringExtendedIso);
}
[Benchmark]
public void ParsePatternExtendedIso()
{
// Use a mutable culture info to prevent caching
InstantPattern.Create(InstantPattern.ExtendedIsoPattern.PatternText, MutableInvariantCulture);
}
}
}
|
// Copyright 2013 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using System.Globalization;
using NodaTime.Benchmarks.Framework;
using NodaTime.Text;
namespace NodaTime.Benchmarks.NodaTimeTests.Text
{
[Category("Text")]
class InstantPatternBenchmarks
{
private static readonly Instant Sample = Instant.FromUtc(2011, 8, 24, 12, 29, 30);
private static readonly InstantPattern GeneralPattern = InstantPattern.CreateWithInvariantCulture("g");
private static readonly InstantPattern NumberPattern = InstantPattern.CreateWithInvariantCulture("n");
private static readonly string SampleStringGeneral = GeneralPattern.Format(Sample);
private static readonly string SampleStringNumber = NumberPattern.Format(Sample);
private static readonly string SampleStringExtendedIso = InstantPattern.ExtendedIsoPattern.Format(Sample);
private static readonly CultureInfo MutableInvariantCulture = (CultureInfo) CultureInfo.InvariantCulture.Clone();
[Benchmark]
public void NumberPatternFormat()
{
NumberPattern.Format(Sample);
}
[Benchmark]
public void GeneralPatternFormat()
{
GeneralPattern.Format(Sample);
}
[Benchmark]
public void ExtendedIsoPatternFormat()
{
InstantPattern.ExtendedIsoPattern.Format(Sample);
}
[Benchmark]
public void NumberPatternParse()
{
NumberPattern.Parse(SampleStringNumber);
}
[Benchmark]
public void GeneralPatternParse()
{
GeneralPattern.Parse(SampleStringGeneral);
}
[Benchmark]
public void ExtendedIsoPatternParse()
{
InstantPattern.ExtendedIsoPattern.Parse(SampleStringExtendedIso);
}
[Benchmark]
public void ParsePatternExtendedIso()
{
// Use a mutable culture info to prevent caching
InstantPattern.Create(InstantPattern.ExtendedIsoPattern.PatternText, MutableInvariantCulture);
}
}
}
|
apache-2.0
|
C#
|
544a0eb062842d2283272c08393802ebc8f0a189
|
fix enemy hp manager
|
SpanishArmada/shapemate,SpanishArmada/shapemate
|
Shapemate/Assets/EnemyHPManager.cs
|
Shapemate/Assets/EnemyHPManager.cs
|
using UnityEngine;
using System.Collections;
public class EnemyHPManager : MonoBehaviour {
public GameObject enemy;
private int enemyHP;
void Start()
{
enemyHP = 100;
}
// Use this for initialization
void DealDamage (int damage=1) {
enemyHP -= damage;
if(enemyHP <= 0)
{
Destroy(enemy);
}
}
void Update()
{
}
// Update is called once per frame
}
|
using UnityEngine;
using System.Collections;
public class EnemyHPManager : MonoBehaviour {
public GameObject enemy;
private int enemyHP;
// Use this for initialization
void DealDamage (int damage=1) {
enemyHP -= damage;
if(enemyHP < 0)
{
Destroy(enemy);
}
}
// Update is called once per frame
void Update () {
}
}
|
mit
|
C#
|
ad762cf239de0eea44d8fc88f23bfde72db39a11
|
Fix back link on payout confirm page
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer/Views/UILightningLikePayout/ConfirmLightningPayout.cshtml
|
BTCPayServer/Views/UILightningLikePayout/ConfirmLightningPayout.cshtml
|
@model System.Collections.Generic.List<BTCPayServer.Data.Payouts.LightningLike.UILightningLikePayoutController.ConfirmVM>
@{
Layout = "../Shared/_Layout.cshtml";
ViewData["Title"] = "Confirm Lightning Payout";
var cryptoCode = Context.GetRouteValue("cryptoCode");
}
<h2 class="mt-1 mb-4">@ViewData["Title"]</h2>
<div class="row">
<div class="col-md-12">
<ul class="list-group">
@foreach (var item in Model)
{
<li class="list-group-item d-flex justify-content-between align-items-center">
<div data-bs-toggle="tooltip" class="text-break" title="@item.Destination">@item.Destination</div>
<span class="text-capitalize badge bg-secondary">@item.Amount @cryptoCode</span>
</li>
<form method="post" class="list-group-item justify-content-center" id="pay-invoices-form">
<button type="submit" class="btn btn-primary xmx-2" style="min-width:25%;" id="Pay">Pay</button>
<a asp-controller="UIStorePullPayments" asp-action="Payouts" asp-route-storeId="@Context.GetStoreData().Id" class="btn btn-secondary mx-2 px-4">Cancel</a>
</form>
}
</ul>
</div>
</div>
@section PageFootContent {
<partial name="_ValidationScriptsPartial" />
<script>
document.addEventListener("DOMContentLoaded", function() {
$("#pay-invoices-form").on("submit", function() {
$(this).find("input[type='submit']").prop('disabled', true);
});
$("#pay-invoices-form input").on("input", function() {
// Give it a timeout to make sure all form validation has completed by the time we run our callback
setTimeout(function() {
var validationErrors = $('.field-validation-error');
if (validationErrors.length === 0) {
$("input[type='submit']#Create").removeAttr('disabled');
}
}, 100);
});
});
</script>
}
|
@model System.Collections.Generic.List<BTCPayServer.Data.Payouts.LightningLike.UILightningLikePayoutController.ConfirmVM>
@{
Layout = "../Shared/_Layout.cshtml";
ViewData["Title"] = "Confirm Lightning Payout";
var cryptoCode = Context.GetRouteValue("cryptoCode");
}
<h2 class="mt-1 mb-4">@ViewData["Title"]</h2>
<div class="row">
<div class="col-md-12">
<ul class="list-group">
@foreach (var item in Model)
{
<li class="list-group-item d-flex justify-content-between align-items-center">
<div data-bs-toggle="tooltip" class="text-break" title="@item.Destination">@item.Destination</div>
<span class="text-capitalize badge bg-secondary">@item.Amount @cryptoCode</span>
</li>
<form method="post" class="list-group-item justify-content-center" id="pay-invoices-form">
<button type="submit" class="btn btn-primary xmx-2" style="min-width:25%;" id="Pay">Pay</button>
<button type="button" class="btn btn-secondary mx-2" onclick="history.back(); return false;" style="min-width:25%;">Go back</button>
</form>
}
</ul>
</div>
</div>
@section PageFootContent {
<partial name="_ValidationScriptsPartial" />
<script>
document.addEventListener("DOMContentLoaded", function() {
$("#pay-invoices-form").on("submit", function() {
$(this).find("input[type='submit']").prop('disabled', true);
});
$("#pay-invoices-form input").on("input", function() {
// Give it a timeout to make sure all form validation has completed by the time we run our callback
setTimeout(function() {
var validationErrors = $('.field-validation-error');
if (validationErrors.length === 0) {
$("input[type='submit']#Create").removeAttr('disabled');
}
}, 100);
});
});
</script>
}
|
mit
|
C#
|
876d410fa1bece8a373c99b95d7fc148223c9a30
|
Add missing ;
|
naoey/osu,NeoAdonis/osu,DrabWeb/osu,DrabWeb/osu,ppy/osu,johnneijzen/osu,2yangk23/osu,naoey/osu,EVAST9919/osu,peppy/osu,UselessToucan/osu,peppy/osu,2yangk23/osu,peppy/osu-new,ZLima12/osu,smoogipoo/osu,smoogipooo/osu,ppy/osu,NeoAdonis/osu,naoey/osu,peppy/osu,johnneijzen/osu,smoogipoo/osu,UselessToucan/osu,ZLima12/osu,DrabWeb/osu,smoogipoo/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,EVAST9919/osu
|
osu.Game.Rulesets.Osu/Mods/OsuModArrange.cs
|
osu.Game.Rulesets.Osu/Mods/OsuModArrange.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Mods
{
internal class OsuModArrange : Mod, IApplicableToDrawableHitObjects
{
public override string Name => "Arrange";
public override string ShortenedName => "Arrange";
public override FontAwesome Icon => FontAwesome.fa_arrows;
public override ModType Type => ModType.Fun;
public override string Description => "Everything rotates. EVERYTHING";
public override double ScoreMultiplier => 1.05;
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
drawables.ForEach(drawable => drawable.ApplyCustomUpdateState += drawableOnApplyCustomUpdateState);
}
private float theta;
private void drawableOnApplyCustomUpdateState(DrawableHitObject drawable, ArmedState state)
{
var hitObject = (OsuHitObject) drawable.HitObject;
// repeat points get their position data from the slider.
if (hitObject is RepeatPoint)
return;
Vector2 originalPosition = drawable.Position;
// avoiding that the player can see the abroupt move.
const int pre_time_offset = 1000;
const float appearDistance = 250;
using (drawable.BeginAbsoluteSequence(hitObject.StartTime - hitObject.TimeFadeIn - pre_time_offset, true))
{
drawable
.MoveTo(originalPosition, hitObject.TimeFadeIn + pre_time_offset, Easing.InOutSine);
.MoveToOffset(new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * appearDistance);
}
// That way slider ticks come all from the same direction.
if (hitObject is HitCircle || hitObject is Slider)
theta += 0.4f;
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Mods
{
internal class OsuModArrange : Mod, IApplicableToDrawableHitObjects
{
public override string Name => "Arrange";
public override string ShortenedName => "Arrange";
public override FontAwesome Icon => FontAwesome.fa_arrows;
public override ModType Type => ModType.Fun;
public override string Description => "Everything rotates. EVERYTHING";
public override double ScoreMultiplier => 1.05;
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
drawables.ForEach(drawable => drawable.ApplyCustomUpdateState += drawableOnApplyCustomUpdateState);
}
private float theta;
private void drawableOnApplyCustomUpdateState(DrawableHitObject drawable, ArmedState state)
{
var hitObject = (OsuHitObject) drawable.HitObject;
// repeat points get their position data from the slider.
if (hitObject is RepeatPoint)
return;
Vector2 originalPosition = drawable.Position;
// avoiding that the player can see the abroupt move.
const int pre_time_offset = 1000;
const float appearDistance = 250;
using (drawable.BeginAbsoluteSequence(hitObject.StartTime - hitObject.TimeFadeIn - pre_time_offset, true))
{
drawable
.MoveTo(originalPosition, hitObject.TimeFadeIn + pre_time_offset, Easing.InOutSine);
.MoveToOffset(new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * appearDistance)
}
// That way slider ticks come all from the same direction.
if (hitObject is HitCircle || hitObject is Slider)
theta += 0.4f;
}
}
}
|
mit
|
C#
|
7a47b5cf20a3de37529b79e80edff356e67b57b6
|
switch expression
|
ufcpp/UfcppSample,ufcpp/UfcppSample,ufcpp/UfcppSample,ufcpp/UfcppSample,ufcpp/UfcppSample
|
Demo/2019/SwitchStatementToExpression/SwitchStatementToExpression/Program.cs
|
Demo/2019/SwitchStatementToExpression/SwitchStatementToExpression/Program.cs
|
using System;
namespace SwitchStatementToExpression
{
class Program
{
static void Main()
{
Console.WriteLine(M(true));
Console.WriteLine(M(false));
}
static int M(bool x)
=> x switch
{
true => 1,
false => 0,
};
}
}
|
using System;
namespace SwitchStatementToExpression
{
class Program
{
static void Main()
{
Console.WriteLine(M(true));
Console.WriteLine(M(false));
}
static int M(bool x)
{
switch(x)
{
case true: return 1;
case false: return 0;
}
}
}
}
|
apache-2.0
|
C#
|
17eb81bb7640e9e4616648b7d3390fe4445fb904
|
Document DrawNode
|
EVAST9919/osu-framework,RedNesto/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,default0/osu-framework,Tom94/osu-framework,DrabWeb/osu-framework,paparony03/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ZLima12/osu-framework,default0/osu-framework,naoey/osu-framework,Nabile-Rahmani/osu-framework,RedNesto/osu-framework,peppy/osu-framework,Nabile-Rahmani/osu-framework,naoey/osu-framework,EVAST9919/osu-framework,paparony03/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework
|
osu.Framework/Graphics/DrawNode.cs
|
osu.Framework/Graphics/DrawNode.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Graphics.OpenGL;
using System;
namespace osu.Framework.Graphics
{
public class DrawNode
{
/// <summary>
/// Contains a linear transformation, colour information, and blending information
/// of this draw node.
/// </summary>
public DrawInfo DrawInfo;
/// <summary>
/// Identifies the state of this draw node with an invalidation state of its corresponding
/// <see cref="Drawable"/>. Whenever the invalidation state of this draw node disagrees
/// with the state of its <see cref="Drawable"/> it has to be updated.
/// </summary>
public long InvalidationID;
/// <summary>
/// Draws this draw node to the screen.
/// </summary>
/// <param name="vertexAction">The action to be performed on each vertex of
/// the draw node in order to draw it if required. This is primarily used by
/// textured sprites.</param>
public virtual void Draw(Action<TexturedVertex2D> vertexAction)
{
GLWrapper.SetBlend(DrawInfo.Blending);
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Graphics.OpenGL;
using System;
namespace osu.Framework.Graphics
{
public class DrawNode
{
public DrawInfo DrawInfo;
public long InvalidationID;
public virtual void Draw(Action<TexturedVertex2D> vertexAction)
{
GLWrapper.SetBlend(DrawInfo.Blending);
}
}
}
|
mit
|
C#
|
4cb9563af20b43a6a9e64c1631c1ac2bcdaebfc5
|
Use ModelBackedDrawable in UpdateableAvatar
|
smoogipoo/osu,EVAST9919/osu,NeoAdonis/osu,peppy/osu,ppy/osu,2yangk23/osu,UselessToucan/osu,johnneijzen/osu,peppy/osu-new,UselessToucan/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,peppy/osu,peppy/osu,NeoAdonis/osu,2yangk23/osu,smoogipooo/osu,smoogipoo/osu,ZLima12/osu,EVAST9919/osu,ppy/osu,ZLima12/osu,johnneijzen/osu,NeoAdonis/osu
|
osu.Game/Users/UpdateableAvatar.cs
|
osu.Game/Users/UpdateableAvatar.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.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Users
{
/// <summary>
/// An avatar which can update to a new user when needed.
/// </summary>
public class UpdateableAvatar : ModelBackedDrawable<User>
{
/// <summary>
/// Whether to show a default guest representation on null user (as opposed to nothing).
/// </summary>
public bool ShowGuestOnNull = true;
public User User
{
get => Model;
set => Model = value;
}
/// <summary>
/// Whether to open the user's profile when clicked.
/// </summary>
public readonly BindableBool OpenOnClick = new BindableBool(true);
protected override Drawable CreateDrawable(User user)
{
if (user != null || ShowGuestOnNull)
{
var avatar = new Avatar(user)
{
RelativeSizeAxes = Axes.Both,
};
avatar.OnLoadComplete += d => d.FadeInFromZero(300, Easing.OutQuint);
avatar.OpenOnClick.BindTo(OpenOnClick);
return avatar;
}
return null;
}
}
}
|
// 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.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Users
{
/// <summary>
/// An avatar which can update to a new user when needed.
/// </summary>
public class UpdateableAvatar : Container
{
private Drawable displayedAvatar;
private User user;
/// <summary>
/// Whether to show a default guest representation on null user (as opposed to nothing).
/// </summary>
public bool ShowGuestOnNull = true;
public User User
{
get => user;
set
{
if (user?.Id == value?.Id)
return;
user = value;
if (IsLoaded)
updateAvatar();
}
}
/// <summary>
/// Whether to open the user's profile when clicked.
/// </summary>
public readonly BindableBool OpenOnClick = new BindableBool(true);
protected override void LoadComplete()
{
base.LoadComplete();
updateAvatar();
}
private void updateAvatar()
{
displayedAvatar?.FadeOut(300);
displayedAvatar?.Expire();
if (user != null || ShowGuestOnNull)
{
var avatar = new Avatar(user)
{
RelativeSizeAxes = Axes.Both,
};
avatar.OnLoadComplete += d => d.FadeInFromZero(300, Easing.OutQuint);
avatar.OpenOnClick.BindTo(OpenOnClick);
Add(displayedAvatar = new DelayedLoadWrapper(avatar));
}
}
}
}
|
mit
|
C#
|
272408c7c9fcbe522bbf529fe8e7919e848bd08b
|
refactor SingleElementOrThrowOnMultiple
|
OlegKleyman/Omego.Extensions
|
core/Omego.Extensions/EnumerableExtensions/SingleElementOrThrowOnMultiple.cs
|
core/Omego.Extensions/EnumerableExtensions/SingleElementOrThrowOnMultiple.cs
|
namespace Omego.Extensions.EnumerableExtensions
{
using System;
using System.Collections.Generic;
using Omego.Extensions.Poco;
/// <summary>
/// Contains extension methods for <see cref="IEnumerable{T}" />.
/// </summary>
public static partial class Enumerable
{
/// <summary>
/// Returns a single element of an <see cref="IEnumerable{T}" /> matching the given predicate
/// or throws an exception specified for the
/// <paramref name="multipleMatchesFoundException" /> parameter if multiple are found.
/// </summary>
/// <param name="enumerable">The enumerable to find the single element in.</param>
/// <param name="predicate">The predicate to use to find a single match.</param>
/// <param name="multipleMatchesFoundException">The exception to throw when multiple matches are found.</param>
/// <typeparam name="T">The type of the object to return.</typeparam>
/// <returns>An instance of <typeparamref name="T" />.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="enumerable" /> or <paramref name="predicate" /> argument is null.
/// </exception>
public static SingleElementResult<T> SingleElementOrThrowOnMultiple<T>(
this IEnumerable<T> enumerable,
Func<T, bool> predicate,
Exception multipleMatchesFoundException)
{
if (enumerable == null) throw new ArgumentNullException(nameof(enumerable));
var element = enumerable.SingleElement(predicate);
if (element == SingleElementResult<T>.MultipleElements)
{
if (multipleMatchesFoundException == null) throw new ArgumentNullException(nameof(multipleMatchesFoundException));
throw multipleMatchesFoundException;
}
return element;
}
}
}
|
namespace Omego.Extensions.EnumerableExtensions
{
using System;
using System.Collections.Generic;
using Omego.Extensions.Poco;
/// <summary>
/// Contains extension methods for <see cref="IEnumerable{T}" />.
/// </summary>
public static partial class Enumerable
{
/// <summary>
/// Returns a single element of an <see cref="IEnumerable{T}" /> matching the given predicate
/// or throws an exception specified for the
/// <paramref name="multipleMatchesFoundException" /> parameter if multiple are found.
/// </summary>
/// <param name="enumerable">The enumerable to find the single element in.</param>
/// <param name="predicate">The predicate to use to find a single match.</param>
/// <param name="multipleMatchesFoundException">The exception to throw when multiple matches are found.</param>
/// <typeparam name="T">The type of the object to return.</typeparam>
/// <returns>An instance of <typeparamref name="T" />.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="enumerable" /> or <paramref name="predicate" /> argument is null.
/// </exception>
public static SingleElementResult<T> SingleElementOrThrowOnMultiple<T>(
this IEnumerable<T> enumerable,
Func<T, bool> predicate,
Exception multipleMatchesFoundException)
{
if (enumerable == null) throw new ArgumentNullException(nameof(enumerable));
if (predicate == null) throw new ArgumentNullException(nameof(predicate));
var result = default(SingleElementResult<T>);
using (var e = enumerable.GetEnumerator())
{
while (e.MoveNext())
if (predicate(e.Current))
{
result = new SingleElementResult<T>(e.Current);
while (e.MoveNext())
if (predicate(e.Current))
{
if (multipleMatchesFoundException == null) throw new ArgumentNullException(nameof(multipleMatchesFoundException));
throw multipleMatchesFoundException;
}
}
}
return result;
}
}
}
|
unlicense
|
C#
|
07b738b87f47c6e5ec099f6ccff19768b1c761ad
|
Update Bootstrapper.cs
|
ballance/jsmate,ballance/jsmate,ballance/jsmate,ballance/jsmate
|
JsMate.Api/Bootstrapper.cs
|
JsMate.Api/Bootstrapper.cs
|
using Nancy.Bootstrapper;
using Nancy.TinyIoc;
using Newtonsoft.Json;
namespace JsMate.Api
{
using Nancy;
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
base.ConfigureApplicationContainer(container);
}
protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
{
base.RequestStartup(container, pipelines, context);
pipelines.AfterRequest.AddItemToEndOfPipeline(c =>
{
c.Response.Headers["Access-Control-Allow-Origin"] = "http://localhost:9995";
});
}
}
}
|
using Nancy.Bootstrapper;
using Nancy.TinyIoc;
using Newtonsoft.Json;
namespace JsMate.Api
{
using Nancy;
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
base.ConfigureApplicationContainer(container);
//container.Register<JsonSerializer, CustomJsonSerializer>();
}
protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
{
base.RequestStartup(container, pipelines, context);
pipelines.AfterRequest.AddItemToEndOfPipeline(c =>
{
c.Response.Headers["Access-Control-Allow-Origin"] = "http://localhost:9995";
});
}
}
}
|
mit
|
C#
|
c3e095f5a8cc3abb001fb6d3ffae04c13d923950
|
clean usings
|
JakeLunn/Landmine.Web,JakeLunn/Landmine.Web,JakeLunn/Landmine.Web,JakeLunn/Landmine.Web,akatakritos/Landmine.Web,akatakritos/Landmine.Web,akatakritos/Landmine.Web,akatakritos/Landmine.Web
|
LandmineWeb/Global.asax.cs
|
LandmineWeb/Global.asax.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Autofac;
using Autofac.Integration.Mvc;
using Autofac.Integration.WebApi;
using Landmine.Domain.Concrete;
namespace LandmineWeb
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
#if DEBUG
System.Web.Optimization.BundleTable.EnableOptimizations = false;
#endif
AutofacConfig.Register();
}
}
public static class AutofacConfig
{
public static void Register()
{
var builder = new ContainerBuilder();
RegisterServices(builder);
// Register your MVC controllers.
builder.RegisterControllers(typeof(MvcApplication).Assembly);
builder.RegisterApiControllers(typeof(MvcApplication).Assembly);
// OPTIONAL: Register model binders that require DI.
//builder.RegisterModelBinders(Assembly.GetExecutingAssembly());
//builder.RegisterModelBinderProvider();
// OPTIONAL: Register web abstractions like HttpContextBase.
//builder.RegisterModule<AutofacWebTypesModule>();
// OPTIONAL: Enable property injection in view pages.
//builder.RegisterSource(new ViewRegistrationSource());
// OPTIONAL: Enable property injection into action filters.
//builder.RegisterFilterProvider();
// Set the dependency resolver to be Autofac.
var container = builder.Build();
GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container);
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
}
private static void RegisterServices(ContainerBuilder builder)
{
builder.RegisterType<ScoreRepository>().AsImplementedInterfaces();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Autofac;
using Autofac.Integration.Mvc;
using Autofac.Integration.WebApi;
using Landmine.Domain.Abstract;
using Landmine.Domain.Concrete;
using LandmineWeb.App_Start;
namespace LandmineWeb
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
#if DEBUG
System.Web.Optimization.BundleTable.EnableOptimizations = false;
#endif
AutofacConfig.Register();
}
}
public static class AutofacConfig
{
public static void Register()
{
var builder = new ContainerBuilder();
RegisterServices(builder);
// Register your MVC controllers.
builder.RegisterControllers(typeof(MvcApplication).Assembly);
builder.RegisterApiControllers(typeof(MvcApplication).Assembly);
// OPTIONAL: Register model binders that require DI.
//builder.RegisterModelBinders(Assembly.GetExecutingAssembly());
//builder.RegisterModelBinderProvider();
// OPTIONAL: Register web abstractions like HttpContextBase.
//builder.RegisterModule<AutofacWebTypesModule>();
// OPTIONAL: Enable property injection in view pages.
//builder.RegisterSource(new ViewRegistrationSource());
// OPTIONAL: Enable property injection into action filters.
//builder.RegisterFilterProvider();
// Set the dependency resolver to be Autofac.
var container = builder.Build();
GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container);
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
}
private static void RegisterServices(ContainerBuilder builder)
{
builder.RegisterType<ScoreRepository>().AsImplementedInterfaces();
}
}
}
|
mit
|
C#
|
ae092a411381a9ba7178bcf3a5a8f1628451931e
|
Bump version
|
rileywhite/Cilador
|
src/CommonAssemblyInfo.cs
|
src/CommonAssemblyInfo.cs
|
/***************************************************************************/
// Copyright 2013-2014 Riley White
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/***************************************************************************/
using System.Reflection;
[assembly: AssemblyCompany("Riley White")]
[assembly: AssemblyProduct("Bix.Mixers.Fody")]
[assembly: AssemblyCopyright("Copyright © Riley White 2013-2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion(CommonAssemblyInfo.Version)]
[assembly: AssemblyFileVersion(CommonAssemblyInfo.Version)]
[assembly: AssemblyDescription(
@"Create your own custom, rich C# mixins with Bix.Mixers! Mixins are the perfect DRY solution for sharing code without abusing inheritance.
Supports:
Mixins containing fields, methods, properties, events, and nested types.
Generics mixins and mixin members, so long as the top-level mixin implementation is closed. (Members and nested types can be open.)
Public, private, protected, internal, and protected internal members.
Static members.
Custom attributes on members.
Virtual members.
Abstract nested types and abstract members within these nested types.
Generic nested types and generic members.
Parameterless constructors for mixin implementations.
Type initializers (i.e. static constructors) in mixin implementations
Unsupported:
Parameters on mixin implemenation constructors.
Unmanaged code calls (extern)
Security attributes
Mixins implementing multiple interfaces
Mixins with base types other than object
Value type mixins
Unhandled:
Naming collisions
Please consider this version of Bix.Mixers to be pre-release.")]
internal static class CommonAssemblyInfo
{
public const string Version = "0.1.6.0";
}
|
/***************************************************************************/
// Copyright 2013-2014 Riley White
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/***************************************************************************/
using System.Reflection;
[assembly: AssemblyCompany("Riley White")]
[assembly: AssemblyProduct("Bix.Mixers.Fody")]
[assembly: AssemblyCopyright("Copyright © Riley White 2013-2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion(CommonAssemblyInfo.Version)]
[assembly: AssemblyFileVersion(CommonAssemblyInfo.Version)]
[assembly: AssemblyDescription(
@"Create your own custom, rich C# mixins with Bix.Mixers! Mixins are the perfect DRY solution for sharing code without abusing inheritance.
Supports:
Mixins containing fields, methods, properties, events, and nested types.
Generics mixins and mixin members, so long as the top-level mixin implementation is closed. (Members and nested types can be open.)
Public, private, protected, internal, and protected internal members.
Static members.
Custom attributes on members.
Virtual members.
Abstract nested types and abstract members within these nested types.
Generic nested types and generic members.
Parameterless constructors for mixin implementations.
Type initializers (i.e. static constructors) in mixin implementations
Unsupported:
Parameters on mixin implemenation constructors.
Unmanaged code calls (extern)
Security attributes
Mixins implementing multiple interfaces
Mixins with base types other than object
Value type mixins
Unhandled:
Naming collisions")]
internal static class CommonAssemblyInfo
{
public const string Version = "0.1.5.0";
}
|
apache-2.0
|
C#
|
a3b75cd1e0ad131003524d1577a223ffaad58117
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.47.*")]
|
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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.46.*")]
|
mit
|
C#
|
d1e60e4c014917a73e6a070805ec5e07f3c38620
|
Bump version
|
lukakama/rimworld-mod-real-fow
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("RimWorldRealFoWMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RimWorldRealFoWMod")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("9e008b68-2b98-4ac2-9c65-832d13f94746")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("RimWorldRealFoWMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RimWorldRealFoWMod")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("9e008b68-2b98-4ac2-9c65-832d13f94746")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
|
apache-2.0
|
C#
|
a50bc4bb006d25ec83f539c88c985bcaa3d67e4a
|
Make IRadio implement IComponent
|
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/Radio/Components/IRadio.cs
|
Content.Server/Radio/Components/IRadio.cs
|
using Robust.Shared.GameObjects;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
namespace Content.Server.Radio.Components
{
public interface IRadio : IComponent
{
IReadOnlyList<int> Channels { get; }
void Receive(string message, int channel, EntityUid speaker);
void Broadcast(string message, EntityUid speaker);
}
}
|
using Robust.Shared.GameObjects;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
namespace Content.Server.Radio.Components
{
public interface IRadio
{
IReadOnlyList<int> Channels { get; }
void Receive(string message, int channel, EntityUid speaker);
void Broadcast(string message, EntityUid speaker);
}
}
|
mit
|
C#
|
f9b82eab689eb8f76ac9dfdaea1ed8466c612775
|
replace redundant code with NotImplementedException
|
saturn72/saturn72
|
src/Core/Saturn72.Core.Services/Localization/LocaleServiceExtensions.cs
|
src/Core/Saturn72.Core.Services/Localization/LocaleServiceExtensions.cs
|
using System;
using Saturn72.Extensions;
namespace Saturn72.Core.Services.Localization
{
public static class LocaleServiceExtensions
{
public static string GetLocaleResource(this ILocaleService localeService, string resourceKey)
{
var languageId = 0;
//get language ID from user context/defaults
return localeService.GetLocaleResource(resourceKey, languageId);
}
private const string LocaleResourceFormat = "{0}.{1}.{2}";
public static string GetLocaleResourceByCallerMethod(this ILocaleService localeService, string resourceKeySuffix)
{
throw new NotImplementedException();
//var method = localeService.GetStackTraceFrame(2).GetMethod();
//var resourceKey = LocaleResourceFormat.AsFormat(method.DeclaringType.FullName,
// method.Name, resourceKeySuffix);
//var languageId = 0;
//return localeService.GetLocaleResource(resourceKey, languageId);
}
}
}
|
using Saturn72.Extensions;
namespace Saturn72.Core.Services.Localization
{
public static class LocaleServiceExtensions
{
public static string GetLocaleResource(this ILocaleService localeService, string resourceKey)
{
var languageId = 0;
//get language ID from user context/defaults
return localeService.GetLocaleResource(resourceKey, languageId);
}
private const string LocaleResourceFormat = "{0}.{1}.{2}";
public static string GetLocaleResourceByCallerMethod(this ILocaleService localeService, string resourceKeySuffix)
{
var method = localeService.GetStackTraceFrame(2).GetMethod();
var resourceKey = LocaleResourceFormat.AsFormat(method.DeclaringType.FullName,
method.Name, resourceKeySuffix);
var languageId = 0;
return localeService.GetLocaleResource(resourceKey, languageId);
}
}
}
|
mit
|
C#
|
60fcbe7b1b79c226a0204cb7c40c9ffd760fcdbd
|
Work around failure in light bulb controller
|
shyamnamboodiripad/roslyn,jmarolf/roslyn,agocke/roslyn,nguerrera/roslyn,jasonmalinowski/roslyn,KirillOsenkov/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,reaction1989/roslyn,CyrusNajmabadi/roslyn,nguerrera/roslyn,mgoertz-msft/roslyn,bartdesmet/roslyn,mavasani/roslyn,ErikSchierboom/roslyn,weltkante/roslyn,heejaechang/roslyn,ErikSchierboom/roslyn,mavasani/roslyn,dotnet/roslyn,eriawan/roslyn,sharwell/roslyn,reaction1989/roslyn,agocke/roslyn,bartdesmet/roslyn,reaction1989/roslyn,agocke/roslyn,jmarolf/roslyn,davkean/roslyn,tmat/roslyn,aelij/roslyn,KirillOsenkov/roslyn,CyrusNajmabadi/roslyn,panopticoncentral/roslyn,aelij/roslyn,gafter/roslyn,weltkante/roslyn,physhi/roslyn,diryboy/roslyn,KevinRansom/roslyn,abock/roslyn,gafter/roslyn,tmat/roslyn,physhi/roslyn,mgoertz-msft/roslyn,AmadeusW/roslyn,sharwell/roslyn,jasonmalinowski/roslyn,wvdd007/roslyn,davkean/roslyn,genlu/roslyn,sharwell/roslyn,wvdd007/roslyn,aelij/roslyn,AlekseyTs/roslyn,tannergooding/roslyn,AmadeusW/roslyn,abock/roslyn,stephentoub/roslyn,diryboy/roslyn,eriawan/roslyn,diryboy/roslyn,stephentoub/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,brettfo/roslyn,mgoertz-msft/roslyn,davkean/roslyn,gafter/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,nguerrera/roslyn,tannergooding/roslyn,heejaechang/roslyn,KevinRansom/roslyn,physhi/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,brettfo/roslyn,AlekseyTs/roslyn,dotnet/roslyn,weltkante/roslyn,abock/roslyn,wvdd007/roslyn,genlu/roslyn,stephentoub/roslyn,jmarolf/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,AlekseyTs/roslyn,panopticoncentral/roslyn,genlu/roslyn,dotnet/roslyn,KevinRansom/roslyn,ErikSchierboom/roslyn,tmat/roslyn,heejaechang/roslyn,eriawan/roslyn
|
src/VisualStudio/IntegrationTest/TestSetup/TestExtensionErrorHandler.cs
|
src/VisualStudio/IntegrationTest/TestSetup/TestExtensionErrorHandler.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.VisualStudio.Text;
namespace Microsoft.VisualStudio.IntegrationTest.Setup
{
/// <summary>This class causes a crash if an exception is encountered by the editor.</summary>
[Shared, Export(typeof(IExtensionErrorHandler)), Export(typeof(TestExtensionErrorHandler))]
public class TestExtensionErrorHandler : IExtensionErrorHandler
{
public void HandleError(object sender, Exception exception)
{
if (exception is ArgumentOutOfRangeException argumentOutOfRangeException
&& argumentOutOfRangeException.ParamName == "index"
&& argumentOutOfRangeException.StackTrace.Contains("Microsoft.NodejsTools.Repl.ReplOutputClassifier.GetClassificationSpans"))
{
// Known issue https://github.com/Microsoft/nodejstools/issues/2138
return;
}
if (exception is ArgumentException argumentException
&& argumentException.Message.Contains("SnapshotPoint")
&& argumentException.StackTrace.Contains("Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.ValidateBufferPosition"))
{
// Known issue https://github.com/dotnet/roslyn/issues/35123
return;
}
FatalError.Report(exception);
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.VisualStudio.Text;
namespace Microsoft.VisualStudio.IntegrationTest.Setup
{
/// <summary>This class causes a crash if an exception is encountered by the editor.</summary>
[Shared, Export(typeof(IExtensionErrorHandler)), Export(typeof(TestExtensionErrorHandler))]
public class TestExtensionErrorHandler : IExtensionErrorHandler
{
public void HandleError(object sender, Exception exception)
{
if (exception is ArgumentOutOfRangeException argumentOutOfRangeException
&& argumentOutOfRangeException.ParamName == "index"
&& argumentOutOfRangeException.StackTrace.Contains("Microsoft.NodejsTools.Repl.ReplOutputClassifier.GetClassificationSpans"))
{
// Known issue https://github.com/Microsoft/nodejstools/issues/2138
return;
}
FatalError.Report(exception);
}
}
}
|
mit
|
C#
|
39d5ac957fe99913b765d36d5d8d379389cc0dc3
|
Fix test.
|
jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Perspex,wieslawsoltes/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,Perspex/Perspex,grokys/Perspex,akrisiun/Perspex,wieslawsoltes/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,MrDaedra/Avalonia,jkoritzinsky/Avalonia,Perspex/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,MrDaedra/Avalonia,wieslawsoltes/Perspex,grokys/Perspex,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia
|
tests/Avalonia.Visuals.UnitTests/VisualTree/TransformedBoundsTests.cs
|
tests/Avalonia.Visuals.UnitTests/VisualTree/TransformedBoundsTests.cs
|
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.VisualTree;
using Avalonia.Rendering;
using Xunit;
using Avalonia.Media;
using Moq;
using Avalonia.UnitTests;
using Avalonia.Platform;
namespace Avalonia.Visuals.UnitTests.VisualTree
{
public class TransformedBoundsTests
{
[Fact]
public void Should_Track_Bounds()
{
using (UnitTestApplication.Start(TestServices.StyledWindow))
{
var control = default(Rectangle);
var tree = new Decorator
{
Padding = new Thickness(10),
Child = new Decorator
{
Padding = new Thickness(5),
Child = control = new Rectangle
{
Width = 15,
Height = 15,
},
}
};
var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
tree.Measure(Size.Infinity);
tree.Arrange(new Rect(0, 0, 100, 100));
ImmediateRenderer.Render(tree, context);
var track = control.GetObservable(Visual.TransformedBoundsProperty);
var results = new List<TransformedBounds?>();
track.Subscribe(results.Add);
Assert.Equal(new Rect(0, 0, 15, 15), results[0].Value.Bounds);
Assert.Equal(Matrix.CreateTranslation(42, 42), results[0].Value.Transform);
}
}
}
}
|
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.VisualTree;
using Avalonia.Rendering;
using Xunit;
using Avalonia.Media;
using Moq;
using Avalonia.UnitTests;
using Avalonia.Platform;
namespace Avalonia.Visuals.UnitTests.VisualTree
{
public class TransformedBoundsTests
{
[Fact]
public void Should_Track_Bounds()
{
using (UnitTestApplication.Start(TestServices.StyledWindow))
{
var target = new BoundsTracker();
var control = default(Rectangle);
var tree = new Decorator
{
Padding = new Thickness(10),
Child = new Decorator
{
Padding = new Thickness(5),
Child = control = new Rectangle
{
Width = 15,
Height = 15,
},
}
};
var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
tree.Measure(Size.Infinity);
tree.Arrange(new Rect(0, 0, 100, 100));
ImmediateRenderer.Render(tree, context);
var track = control.GetObservable(Visual.TransformedBoundsProperty);
var results = new List<TransformedBounds?>();
track.Subscribe(results.Add);
Assert.Equal(new Rect(0, 0, 15, 15), results[0].Value.Bounds);
Assert.Equal(Matrix.CreateTranslation(42, 42), results[0].Value.Transform);
}
}
}
}
|
mit
|
C#
|
58cdff52be21c0a68b4dfd73cfbbedfb4936b766
|
add action
|
uliian/easyRBAC,uliian/easyRBAC,uliian/easyRBAC,uliian/easyRBAC
|
easyRBAC/src/EasyRbac.Web/Controllers/ApplicationController.cs
|
easyRBAC/src/EasyRbac.Web/Controllers/ApplicationController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyRbac.Application.Application;
using EasyRbac.Dto;
using EasyRbac.Dto.Application;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace EasyRbac.Web.Controllers
{
[Route("Application")]
public class ApplicationController : Controller
{
private IApplicationService _applicationService;
public ApplicationController(IApplicationService applicationService)
{
this._applicationService = applicationService;
}
// GET: api/Application
[HttpGet]
public Task<PagingList<ApplicationInfoDto>> Get(string appName,int pageIndex,int pageSize)
{
return this._applicationService.SearchAppAsync(appName, pageIndex, pageSize);
}
// GET: api/Application/5
[HttpGet("{id}", Name = "Get")]
public Task<ApplicationInfoDto> Get(long id)
{
return this._applicationService.GetOneAsync(id);
}
// POST: api/Application
[HttpPost]
public Task<ApplicationInfoDto> Post([FromBody]ApplicationInfoDto app)
{
return this._applicationService.AddAppAsync(app);
}
// PUT: api/Application/5
[HttpPut("{id}")]
public Task Put(long id, [FromBody]ApplicationInfoDto value)
{
return this._applicationService.EditAsync(id, value);
}
// DELETE: api/ApiWithActions/5
[HttpDelete("{id}")]
public Task Delete(long id)
{
return this._applicationService.DisableApp(id);
}
[HttpGet("/appSecret/{appId}")]
public Task<string> GetAppSecret(long appId)
{
return this._applicationService.GetAppScretAsync(appId);
}
[HttpPut("/appSecret/{appId}")]
public Task ChangeAppSecret(long appId)
{
return this._applicationService.EditAppScretAsync(appId);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyRbac.Application.Application;
using EasyRbac.Dto;
using EasyRbac.Dto.Application;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace EasyRbac.Web.Controllers
{
[Route("Application")]
public class ApplicationController : Controller
{
private IApplicationService _applicationService;
public ApplicationController(IApplicationService applicationService)
{
this._applicationService = applicationService;
}
// GET: api/Application
[HttpGet]
public Task<PagingList<ApplicationInfoDto>> Get(string appName,int pageIndex,int pageSize)
{
return this._applicationService.SearchAppAsync(appName, pageIndex, pageSize);
}
// GET: api/Application/5
[HttpGet("{id}", Name = "Get")]
public Task<ApplicationInfoDto> Get(long id)
{
return this._applicationService.GetOneAsync(id);
}
// POST: api/Application
[HttpPost]
public Task<ApplicationInfoDto> Post([FromBody]ApplicationInfoDto app)
{
return this._applicationService.AddAppAsync(app);
}
// PUT: api/Application/5
[HttpPut("{id}")]
public Task Put(long id, [FromBody]ApplicationInfoDto value)
{
return this._applicationService.EditAsync(id, value);
}
// DELETE: api/ApiWithActions/5
[HttpDelete("{id}")]
public Task Delete(long id)
{
return this._applicationService.DisableApp(id);
}
}
}
|
apache-2.0
|
C#
|
9c4262d7212a2556dbc5f84881a3a69e68b7c345
|
Update assembly info
|
sakapon/KLibrary.Linq
|
KLibrary3/Linq/Properties/AssemblyInfo.cs
|
KLibrary3/Linq/Properties/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("KLibrary.Linq")]
[assembly: AssemblyDescription("The library for LINQ.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Keiho Sakapon")]
[assembly: AssemblyProduct("KLibrary")]
[assembly: AssemblyCopyright("© 2016 Keiho Sakapon")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyMetadata("ProjectUrl", "https://github.com/sakapon/KLibrary.Linq")]
[assembly: AssemblyMetadata("LicenseUrl", "https://github.com/sakapon/KLibrary.Linq/blob/master/LICENSE")]
[assembly: AssemblyMetadata("Tags", "LINQ")]
[assembly: AssemblyMetadata("ReleaseNotes", "The first release.")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("4fd5f5d9-5dbd-4925-81c8-e13797db5ef8")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("UnitTest")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("Linq")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Linq")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("4fd5f5d9-5dbd-4925-81c8-e13797db5ef8")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
77c94e5eb30eec95159e99c365196f168e608198
|
Fix order of route registration.
|
puco/WebApiContrib.Formatting.Jsonp,puco/WebApiContrib.Formatting.Jsonp,WebApiContrib/WebApiContrib.Formatting.Jsonp,WebApiContrib/WebApiContrib.Formatting.Jsonp
|
samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Global.asax.cs
|
samples/WebApiContrib.Formatting.Jsonp.SampleWebHost/Global.asax.cs
|
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using WebApiContrib.Formatting.Jsonp;
using WebContribContrib.Formatting.Jsonp.SampleWebHost.App_Start;
namespace WebContribContrib.Formatting.Jsonp.SampleWebHost {
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class WebApiApplication : System.Web.HttpApplication {
protected void Application_Start() {
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(config => {
config.MapHttpAttributeRoutes();
FormatterConfig.RegisterFormatters(config.Formatters);
});
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
BundleConfig.RegisterBundles(BundleTable.Bundles);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
}
|
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using WebApiContrib.Formatting.Jsonp;
using WebContribContrib.Formatting.Jsonp.SampleWebHost.App_Start;
namespace WebContribContrib.Formatting.Jsonp.SampleWebHost {
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class WebApiApplication : System.Web.HttpApplication {
protected void Application_Start() {
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
BundleConfig.RegisterBundles(BundleTable.Bundles);
RouteConfig.RegisterRoutes(RouteTable.Routes);
GlobalConfiguration.Configure(config => {
config.MapHttpAttributeRoutes();
FormatterConfig.RegisterFormatters(config.Formatters);
});
}
}
}
|
mit
|
C#
|
8f157c1a5b6c043d3b7bd3239f4be075c5d220f3
|
Apply visual validation states to Add To-do form
|
jbrianskog/EventSourcingTodo,jbrianskog/EventSourcingTodo,jbrianskog/EventSourcingTodo
|
src/EventSourcingTodo/Views/Home/Index.cshtml
|
src/EventSourcingTodo/Views/Home/Index.cshtml
|
@model IndexViewModel
@{
ViewData["Title"] = "Home Page";
}
<div class="row">
<div class="col-sm-8">
<form asp-controller="Home" asp-action="AddTodo" method="post" role="form" id="addTodoForm" data-estd-ajax-jqval-submit-on-done="addToDoFormSubmitOnDone">
<div class="form-group" data-estd-form-group-invalid-class="has-error">
<label asp-for="AddTodoPostModel.Description" class="sr-only"></label>
<div class="input-group">
<input asp-for="AddTodoPostModel.Description" class="form-control" placeholder="What do you need to do?" autofocus />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" data-estd-form-group-valid-class="btn-success" data-estd-form-group-invalid-class="btn-danger" aria-label="Add To-do">
<span class="glyphicon glyphicon-plus" data-estd-form-group-valid-class="glyphicon-plus" data-estd-form-group-invalid-class="glyphicon-ban-circle" aria-hidden="true"></span>
</button>
</span>
</div>
<span asp-validation-for="AddTodoPostModel.Description" class="help-block"></span>
</div>
</form>
<br />
<div id="todoListAjaxTarget">
@{Html.RenderPartial("_TodoListPartial", Model.TodoListPartialViewModel);}
</div>
</div>
<div class="col-sm-4">
<div id="eventsAjaxTarget">
@{Html.RenderPartial("_EventsPartial", Model.EventsPartialViewModel);}
</div>
</div>
</div>
|
@model IndexViewModel
@{
ViewData["Title"] = "Home Page";
}
<div class="row">
<div class="col-sm-8">
<form asp-controller="Home" asp-action="AddTodo" method="post" role="form" id="addTodoForm" data-estd-ajax-jqval-submit-on-done="addToDoFormSubmitOnDone">
<div class="form-group">
<label asp-for="AddTodoPostModel.Description" class="sr-only"></label>
<div class="input-group">
<input asp-for="AddTodoPostModel.Description" class="form-control" placeholder="What do you need to do?" autofocus />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" aria-label="Add To-do">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
</span>
</div>
<span asp-validation-for="AddTodoPostModel.Description"></span>
</div>
</form>
<br />
<div id="todoListAjaxTarget">
@{Html.RenderPartial("_TodoListPartial", Model.TodoListPartialViewModel);}
</div>
</div>
<div class="col-sm-4">
<div id="eventsAjaxTarget">
@{Html.RenderPartial("_EventsPartial", Model.EventsPartialViewModel);}
</div>
</div>
</div>
|
mit
|
C#
|
86223189bd1427dcaff8515545ab0f96ea793d6f
|
Update AssemblyInfo.cs
|
dsarfati/OrleansTestKit
|
src/OrleansTestKit/Properties/AssemblyInfo.cs
|
src/OrleansTestKit/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("OrleansTestKit")]
[assembly: AssemblyDescription("An testing framework for Microsoft Orleans that does not use a real silo")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("OrleansContrib")]
[assembly: AssemblyProduct("OrleansTestKit")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0e2cb8b5-1cbc-4786-9c95-b75317e3c311")]
// 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.1.1.0")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyInformationalVersion("0.1.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("OrleansTestKit")]
[assembly: AssemblyDescription("An testing framework for Microsoft Orleans that does not use a real silo")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("OrleansContrib")]
[assembly: AssemblyProduct("OrleansTestKit")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0e2cb8b5-1cbc-4786-9c95-b75317e3c311")]
// 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.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
|
mit
|
C#
|
b576f349bbe755f51030b181f5d9e3ecd7b7374d
|
Tweak in Console VS Project Template.
|
NaosProject/Naos.Build
|
Conventions/VisualStudioProjectTemplates/Console/consoleabstraction.cs
|
Conventions/VisualStudioProjectTemplates/Console/consoleabstraction.cs
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ConsoleAbstraction.cs" company="Naos Project">
// Copyright (c) Naos Project 2019. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace [PROJECT_NAME]
{
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using CLAP;
using Naos.Bootstrapper;
using Naos.Build.Analyzers;
/// <inheritdoc />
public class ConsoleAbstraction : ConsoleAbstractionBase
{
/// <summary>
/// Does some work.
/// </summary>
/// <param name="debug">Optional value indicating whether to launch the debugger from inside the application (default is false).</param>
/// <param name="requiredParameter">A required parameter to the operation.</param>
[Verb(Aliases = "do", IsDefault = false, Description = "Does some work.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = NaosSuppressBecause.CA1811_AvoidUncalledPrivateCode_MethodIsWiredIntoClapAsVerb)]
public static void DoSomeWork(
[Aliases("")] [Description("Launches the debugger.")] [DefaultValue(false)] bool debug,
[Aliases("")] [Required] [Description("A required parameter to the operation.")] string requiredParameter)
{
if (debug)
{
Debugger.Launch();
}
System.Console.WriteLine(requiredParameter);
}
}
}
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ConsoleAbstraction.cs" company="Naos Project">
// Copyright (c) Naos Project 2019. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace [PROJECT_NAME]
{
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using CLAP;
using Naos.Bootstrapper;
/// <inheritdoc />
public class ConsoleAbstraction : ConsoleAbstractionBase
{
/// <summary>
/// Does some work.
/// </summary>
/// <param name="debug">Optional value indicating whether to launch the debugger from inside the application (default is false).</param>
/// <param name="requiredParameter">A required parameter to the operation.</param>
[Verb(Aliases = "do", IsDefault = false, Description = "Does some work.")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = ObcSuppressBecause.CA1811_AvoidUncalledPrivateCode_MethodIsWiredIntoClapAsVerb)]
public static void DoSomeWork(
[Aliases("")] [Description("Launches the debugger.")] [DefaultValue(false)] bool debug,
[Aliases("")] [Required] [Description("A required parameter to the operation.")] string requiredParameter)
{
if (debug)
{
Debugger.Launch();
}
System.Console.WriteLine(requiredParameter);
}
}
}
|
mit
|
C#
|
ae5b87368754d45d18b6ffc235d1f4bf95195485
|
Add description constructor rokenrequest (#218)
|
Viincenttt/MollieApi,Viincenttt/MollieApi
|
Mollie.Api/Models/Connect/TokenRequest.cs
|
Mollie.Api/Models/Connect/TokenRequest.cs
|
using Newtonsoft.Json;
namespace Mollie.Api.Models.Connect {
public class TokenRequest {
/// <param name="code">This can be an authorization code or a refresh token. The correct grant type will be automatically selected</param>
/// <param name="redirectUri">The URL the merchant is sent back to once the request has been authorized. It must match the URL you set when registering your app. </param>
public TokenRequest(string code, string redirectUri) {
if (code.StartsWith("refresh_")) {
this.GrantType = "refresh_token";
this.RefreshToken = code;
}
else {
this.GrantType = "authorization_code";
this.Code = code;
}
this.RedirectUri = redirectUri;
}
/// <summary>
/// If you wish to exchange your auth code for an access token, use grant type authorization_code. If you wish to renew
/// your access token with your refresh token, use grant type refresh_token.
/// Possible values: authorization_code refresh_token
/// </summary>
[JsonProperty("grant_type")]
public string GrantType { get; }
/// <summary>
/// Optional – The auth code you've received when creating the authorization. Only use this field when using grant type
/// authorization_code.
/// </summary>
public string Code { get; }
/// <summary>
/// Optional – The refresh token you've received when creating the authorization. Only use this field when using grant
/// type refresh_token.
/// </summary>
[JsonProperty("refresh_token")]
public string RefreshToken { get; }
/// <summary>
/// The URL the merchant is sent back to once the request has been authorized. It must match the URL you set when
/// registering your app.
/// </summary>
[JsonProperty("redirect_uri")]
public string RedirectUri { get; }
}
}
|
using Newtonsoft.Json;
namespace Mollie.Api.Models.Connect {
public class TokenRequest {
public TokenRequest(string code, string redirectUri) {
if (code.StartsWith("refresh_")) {
this.GrantType = "refresh_token";
this.RefreshToken = code;
}
else {
this.GrantType = "authorization_code";
this.Code = code;
}
this.RedirectUri = redirectUri;
}
/// <summary>
/// If you wish to exchange your auth code for an access token, use grant type authorization_code. If you wish to renew
/// your access token with your refresh token, use grant type refresh_token.
/// Possible values: authorization_code refresh_token
/// </summary>
[JsonProperty("grant_type")]
public string GrantType { get; }
/// <summary>
/// Optional – The auth code you've received when creating the authorization. Only use this field when using grant type
/// authorization_code.
/// </summary>
public string Code { get; }
/// <summary>
/// Optional – The refresh token you've received when creating the authorization. Only use this field when using grant
/// type refresh_token.
/// </summary>
[JsonProperty("refresh_token")]
public string RefreshToken { get; }
/// <summary>
/// The URL the merchant is sent back to once the request has been authorized. It must match the URL you set when
/// registering your app.
/// </summary>
[JsonProperty("redirect_uri")]
public string RedirectUri { get; }
}
}
|
mit
|
C#
|
f2e99a69154232d677170f1cea3aa8b2802c8022
|
Update Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Script/ToggleHandVisualisation.cs
|
killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Script/ToggleHandVisualisation.cs
|
Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Script/ToggleHandVisualisation.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
public class ToggleHandVisualisation : MonoBehaviour
{
public bool isHandMeshVisible = false;
public bool isHandJointVisible = false;
private IMixedRealityInputSystem inputSystem = null;
protected IMixedRealityInputSystem InputSystem
{
get
{
if (inputSystem == null)
{
MixedRealityServiceRegistry.TryGetService<IMixedRealityInputSystem>(out inputSystem);
}
return inputSystem;
}
}
void updateHandVisibility()
{
MixedRealityHandTrackingProfile handTrackingProfile = InputSystem?.InputSystemProfile?.HandTrackingProfile;
if (handTrackingProfile != null)
{
handTrackingProfile.EnableHandMeshVisualization = isHandMeshVisible;
handTrackingProfile.EnableHandJointVisualization = isHandJointVisible;
}
}
/// <summary>
/// Initial setting of hand mesh visualization - default is disabled
/// </summary>
void Start()
{
updateHandVisibility();
}
/// <summary>
/// Toggles hand mesh visualization
/// </summary>
public void OnToggleHandMesh()
{
isHandMeshVisible = !isHandMeshVisible;
updateHandVisibility();
}
/// <summary>
/// Toggles hand joint visualization
/// </summary>
public void OnToggleHandJoint()
{
isHandJointVisible = !isHandJointVisible;
updateHandVisibility();
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
public class ToggleHandVisualisation : MonoBehaviour
{
public bool isHandMeshVisible = false;
public bool isHandJointVisible = false;
private IMixedRealityInputSystem inputSystem = null;
protected IMixedRealityInputSystem InputSystem
{
get
{
if (InputSystem == null)
{
MixedRealityServiceRegistry.TryGetService<IMixedRealityInputSystem>(out inputSystem);
}
return inputSystem;
}
}
void updateHandVisibility()
{
MixedRealityHandTrackingProfile handTrackingProfile = InputSystem?.InputSystemProfile?.HandTrackingProfile;
if (handTrackingProfile != null)
{
handTrackingProfile.EnableHandMeshVisualization = isHandMeshVisible;
handTrackingProfile.EnableHandJointVisualization = isHandJointVisible;
}
}
/// <summary>
/// Initial setting of hand mesh visualization - default is disabled
/// </summary>
void Start()
{
updateHandVisibility();
}
/// <summary>
/// Toggles hand mesh visualization
/// </summary>
public void OnToggleHandMesh()
{
isHandMeshVisible = !isHandMeshVisible;
updateHandVisibility();
}
/// <summary>
/// Toggles hand joint visualization
/// </summary>
public void OnToggleHandJoint()
{
isHandJointVisible = !isHandJointVisible;
updateHandVisibility();
}
}
}
|
mit
|
C#
|
e67de2e746cab21cae37d9cc84019dd3228f17f1
|
Update TestCompositionRootSetup.cs
|
tiksn/TIKSN-Framework
|
TIKSN.UnitTests.Shared/DependencyInjection/TestCompositionRootSetup.cs
|
TIKSN.UnitTests.Shared/DependencyInjection/TestCompositionRootSetup.cs
|
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using TIKSN.Analytics.Logging;
using Xunit.Abstractions;
namespace TIKSN.DependencyInjection.Tests
{
public class TestCompositionRootSetup : CompositionRootSetupBase
{
private readonly ITestOutputHelper _testOutputHelper;
private readonly Action<IServiceCollection> _configureServices;
private readonly Action<IServiceCollection, IConfigurationRoot> _configureOptions;
public TestCompositionRootSetup(ITestOutputHelper testOutputHelper, Action<IServiceCollection> configureServices = null, Action<IServiceCollection, IConfigurationRoot> configureOptions = null) : base(new TestConfigurationRootSetup().GetConfigurationRoot())
{
_testOutputHelper = testOutputHelper;
_configureServices = configureServices;
_configureOptions = configureOptions;
}
protected override void ConfigureOptions(IServiceCollection services, IConfigurationRoot configuration)
{
_configureOptions?.Invoke(services, configuration);
}
protected override void ConfigureServices(IServiceCollection services)
{
_configureServices?.Invoke(services);
}
protected override IEnumerable<ILoggingSetup> GetLoggingSetups()
{
yield return new TestSerilogLoggingSetup(_testOutputHelper);
}
}
}
|
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using TIKSN.Analytics.Logging;
using Xunit.Abstractions;
namespace TIKSN.DependencyInjection.Tests
{
public class TestCompositionRootSetup : CompositionRootSetupBase
{
private readonly ITestOutputHelper _testOutputHelper;
private readonly Action<IServiceCollection> _configureServices;
private readonly Action<IServiceCollection, IConfigurationRoot> _configureOptions;
public TestCompositionRootSetup(ITestOutputHelper testOutputHelper, Action<IServiceCollection> configureServices = null, Action<IServiceCollection, IConfigurationRoot> configureOptions = null) : base(new TestConfigurationRootSetup().GetConfigurationRoot())
{
_testOutputHelper = testOutputHelper;
_configureServices = configureServices;
_configureOptions = configureOptions;
}
protected override void ConfigureOptions(IServiceCollection services, IConfigurationRoot configuration)
{
_configureOptions?.Invoke(services, configuration);
}
protected override void ConfigureServices(IServiceCollection services)
{
services.AddSingleton(_testOutputHelper);
services.AddSingleton<ILoggingSetup, TestSerilogLoggingSetup>();
_configureServices?.Invoke(services);
}
}
}
|
mit
|
C#
|
41c002fb5e8f887df5f78c614b69e8364343f18a
|
fix für web
|
haskox/DotNetSiemensPLCToolBoxLibrary,devolegf/DotNetSiemensPLCToolBoxLibrary,devolegf/DotNetSiemensPLCToolBoxLibrary,dotnetprojects/DotNetSiemensPLCToolBoxLibrary,proemmer/DotNetSiemensPLCToolBoxLibrary,StefanHasensperling/DotNetSiemensPLCToolBoxLibrary,StefanHasensperling/DotNetSiemensPLCToolBoxLibrary,haskox/DotNetSiemensPLCToolBoxLibrary,Nick135/DotNetSiemensPLCToolBoxLibrary,Nick135/DotNetSiemensPLCToolBoxLibrary,Nick135/DotNetSiemensPLCToolBoxLibrary,StefanHasensperling/DotNetSiemensPLCToolBoxLibrary,devolegf/DotNetSiemensPLCToolBoxLibrary,haskox/DotNetSiemensPLCToolBoxLibrary,dotnetprojects/DotNetSiemensPLCToolBoxLibrary,jogibear9988/DotNetSiemensPLCToolBoxLibrary,jogibear9988/DotNetSiemensPLCToolBoxLibrary,dotnetprojects/DotNetSiemensPLCToolBoxLibrary,proemmer/DotNetSiemensPLCToolBoxLibrary,StefanHasensperling/DotNetSiemensPLCToolBoxLibrary,jogibear9988/DotNetSiemensPLCToolBoxLibrary
|
DotNetDatenbankProtokollerV2/ProtokollerLibrary/wcfService/ProtocolService.cs
|
DotNetDatenbankProtokollerV2/ProtokollerLibrary/wcfService/ProtocolService.cs
|
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using DotNetSimaticDatabaseProtokollerLibrary.Databases;
using DotNetSimaticDatabaseProtokollerLibrary.Databases.Interfaces;
using DotNetSimaticDatabaseProtokollerLibrary.wcfService;
namespace DotNetSimaticDatabaseProtokollerLibrary.Protocolling
{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public partial class ProtokollerInstance : IProtocolService
{
public IEnumerable<string> GetStorageNames()
{
return ProtokollerConfiguration.ActualConfigInstance.Datasets.Select(s => s.Name);
}
public IEnumerable<ProtocolRow> GetProtocolData(string storageName, int startRow, int maxRows, string filter, DateTime? FromDate, DateTime? ToDate)
{
var datasetConfig = ProtokollerConfiguration.ActualConfigInstance.Datasets.FirstOrDefault(s => s.Name == storageName);
IDBInterface dbInterface = StorageHelper.GetStorage(datasetConfig, null);
dbInterface.Connect_To_Database(datasetConfig.Storage);
IDBViewable dbViewable = dbInterface as IDBViewable;
List<ProtocolRow> list = new List<ProtocolRow>();
DataTable table = dbViewable.ReadData(datasetConfig, filter, startRow, maxRows, FromDate, ToDate);
foreach (DataRow row in table.Rows)
{
ProtocolRow storageLine = new ProtocolRow();
var date = row["datetime"];
if (date is DateTime)
storageLine.Timestamp = (DateTime)date;
else
storageLine.Timestamp = DateTime.ParseExact(row["datetime"].ToString(), "yyyy.MM.dd - HH:mm:ss.fff", null);
storageLine.Telegram = Convert.ToString(row["data"]);
list.Add(storageLine);
}
return list;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using DotNetSimaticDatabaseProtokollerLibrary.Databases;
using DotNetSimaticDatabaseProtokollerLibrary.Databases.Interfaces;
using DotNetSimaticDatabaseProtokollerLibrary.wcfService;
namespace DotNetSimaticDatabaseProtokollerLibrary.Protocolling
{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public partial class ProtokollerInstance : IProtocolService
{
public IEnumerable<string> GetStorageNames()
{
return ProtokollerConfiguration.ActualConfigInstance.Datasets.Select(s => s.Name);
}
public IEnumerable<ProtocolRow> GetProtocolData(string storageName, int startRow, int maxRows, string filter, DateTime? FromDate, DateTime? ToDate)
{
var datasetConfig = ProtokollerConfiguration.ActualConfigInstance.Datasets.FirstOrDefault(s => s.Name == storageName);
IDBInterface dbInterface = StorageHelper.GetStorage(datasetConfig, null);
dbInterface.Connect_To_Database(datasetConfig.Storage);
IDBViewable dbViewable = dbInterface as IDBViewable;
List<ProtocolRow> list = new List<ProtocolRow>();
DataTable table = dbViewable.ReadData(datasetConfig, filter, startRow, maxRows, FromDate, ToDate);
foreach (DataRow row in table.Rows)
{
ProtocolRow storageLine = new ProtocolRow();
var date = row["datetime"];
if (date is DateTime)
storageLine.Timestamp = (DateTime)date;
else
storageLine.Timestamp = DateTime.ParseExact(row["datetime"].ToString(), "yyyy.MM.dd - HH:mm:ss.fff", null);
storageLine.Telegram = Convert.ToString(row["row"]);
list.Add(storageLine);
}
return list;
}
}
}
|
lgpl-2.1
|
C#
|
e51d824f89fbc1a3243456527d82326a0b62ebc6
|
Use actually GremlinServer...
|
ExRam/ExRam.Gremlinq
|
ExRam.Gremlinq.Providers.GremlinServer.Tests/GremlinServerIntegrationTests.cs
|
ExRam.Gremlinq.Providers.GremlinServer.Tests/GremlinServerIntegrationTests.cs
|
#if RELEASE && NETCOREAPP3_1
using ExRam.Gremlinq.Core;
using ExRam.Gremlinq.Core.Tests;
using ExRam.Gremlinq.Providers.WebSocket;
using Xunit.Abstractions;
using static ExRam.Gremlinq.Core.GremlinQuerySource;
namespace ExRam.Gremlinq.Providers.GremlinServer.Tests
{
public class GremlinServerIntegrationTests : QueryExecutionTest
{
public GremlinServerIntegrationTests(ITestOutputHelper testOutputHelper) : base(
g
.ConfigureEnvironment(env => env
.UseGremlinServer(builder => builder
.AtLocalhost())
.UseDeserializer(GremlinQueryExecutionResultDeserializer.Identity)),
testOutputHelper)
{
}
}
}
#endif
|
#if RELEASE && NETCOREAPP3_1
using ExRam.Gremlinq.Core;
using ExRam.Gremlinq.Core.Tests;
using ExRam.Gremlinq.Providers.WebSocket;
using Xunit.Abstractions;
using static ExRam.Gremlinq.Core.GremlinQuerySource;
namespace ExRam.Gremlinq.Providers.GremlinServer.Tests
{
public class GremlinServerIntegrationTests : QueryExecutionTest
{
public GremlinServerIntegrationTests(ITestOutputHelper testOutputHelper) : base(
g
.ConfigureEnvironment(env => env
.UseWebSocket(builder => builder
.AtLocalhost())
.UseDeserializer(GremlinQueryExecutionResultDeserializer.Identity)),
testOutputHelper)
{
}
}
}
#endif
|
mit
|
C#
|
a1794fa476a73400e15a38f33bbcb330f24e7831
|
Remove MothershipSessionGuid from NewDiallerCallDto
|
Paymentsense/Dapper.SimpleSave
|
PS.Mothership.Core/PS.Mothership.Core.Common/Dto/Dialler/NewDiallerCallDto.cs
|
PS.Mothership.Core/PS.Mothership.Core.Common/Dto/Dialler/NewDiallerCallDto.cs
|
using System;
using System.Runtime.Serialization;
using PS.Mothership.Core.Common.Template.Dial;
namespace PS.Mothership.Core.Common.Dto.Dialler
{
[DataContract]
public class NewDiallerCallDto
{
[DataMember]
public Guid SipCallGuid { get; set; }
[DataMember]
public DialCallTypeEnum CallType { get; set; }
[DataMember]
public Guid SessionModeGuid { get; set; }
[DataMember]
public DateTimeOffset StartDateTime { get; set; }
[DataMember]
public string DialledNumber { get; set; }
[DataMember]
public Guid UserSipPhoneGuid { get; set; }
[DataMember]
public string CIDNumber { get; set; }
[DataMember]
public Guid MerchantGuid { get; set; }
[DataMember]
public Guid? ProspectingCampaignCallGuid { get; set; }
[DataMember]
public long? CampaignKey { get; set; }
[DataMember]
public Guid? ConsultOriginSipCallGuid { get; set; }
[DataMember]
public Guid? ProspectingCampaignResponseTapCallGuid { get; set; }
[DataMember]
public Guid InboundCampaignCallGuid { get; set; }
[DataMember]
public DialCallDispositionEnum CallDisposition { get; set; }
}
}
|
using System;
using System.Runtime.Serialization;
using PS.Mothership.Core.Common.Template.Dial;
namespace PS.Mothership.Core.Common.Dto.Dialler
{
[DataContract]
public class NewDiallerCallDto
{
[DataMember]
public Guid MothershipSessionGuid { get; set; }
[DataMember]
public Guid SipCallGuid { get; set; }
[DataMember]
public DialCallTypeEnum CallType { get; set; }
[DataMember]
public Guid SessionModeGuid { get; set; }
[DataMember]
public DateTimeOffset StartDateTime { get; set; }
[DataMember]
public string DialledNumber { get; set; }
[DataMember]
public Guid UserSipPhoneGuid { get; set; }
[DataMember]
public string CIDNumber { get; set; }
[DataMember]
public Guid MerchantGuid { get; set; }
[DataMember]
public Guid? ProspectingCampaignCallGuid { get; set; }
[DataMember]
public long? CampaignKey { get; set; }
[DataMember]
public Guid? ConsultOriginSipCallGuid { get; set; }
[DataMember]
public Guid? ProspectingCampaignResponseTapCallGuid { get; set; }
[DataMember]
public Guid InboundCampaignCallGuid { get; set; }
[DataMember]
public DialCallDispositionEnum CallDisposition { get; set; }
}
}
|
mit
|
C#
|
3bcfc914368f2cf8cd704d5dcf82d678af30fd4d
|
Sort usings in gotodef exports.
|
KevinRansom/roslyn,weltkante/roslyn,gafter/roslyn,dotnet/roslyn,gafter/roslyn,mgoertz-msft/roslyn,bartdesmet/roslyn,physhi/roslyn,mavasani/roslyn,jmarolf/roslyn,abock/roslyn,tannergooding/roslyn,AlekseyTs/roslyn,eriawan/roslyn,dotnet/roslyn,reaction1989/roslyn,wvdd007/roslyn,agocke/roslyn,brettfo/roslyn,sharwell/roslyn,sharwell/roslyn,heejaechang/roslyn,brettfo/roslyn,sharwell/roslyn,diryboy/roslyn,reaction1989/roslyn,heejaechang/roslyn,wvdd007/roslyn,reaction1989/roslyn,abock/roslyn,AmadeusW/roslyn,bartdesmet/roslyn,AmadeusW/roslyn,mavasani/roslyn,ErikSchierboom/roslyn,agocke/roslyn,weltkante/roslyn,AlekseyTs/roslyn,heejaechang/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,davkean/roslyn,jmarolf/roslyn,eriawan/roslyn,genlu/roslyn,tannergooding/roslyn,jmarolf/roslyn,ErikSchierboom/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,mavasani/roslyn,abock/roslyn,jasonmalinowski/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,aelij/roslyn,davkean/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,gafter/roslyn,ErikSchierboom/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,shyamnamboodiripad/roslyn,aelij/roslyn,stephentoub/roslyn,genlu/roslyn,tmat/roslyn,KirillOsenkov/roslyn,weltkante/roslyn,CyrusNajmabadi/roslyn,KevinRansom/roslyn,panopticoncentral/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,genlu/roslyn,diryboy/roslyn,wvdd007/roslyn,physhi/roslyn,AmadeusW/roslyn,tmat/roslyn,eriawan/roslyn,agocke/roslyn,tannergooding/roslyn,aelij/roslyn,davkean/roslyn,tmat/roslyn,panopticoncentral/roslyn,stephentoub/roslyn,KirillOsenkov/roslyn,mgoertz-msft/roslyn,AlekseyTs/roslyn,KirillOsenkov/roslyn,stephentoub/roslyn,dotnet/roslyn
|
src/VisualStudio/LiveShare/Impl/GotoDefinitionWithFarHandler.Exports.cs
|
src/VisualStudio/LiveShare/Impl/GotoDefinitionWithFarHandler.Exports.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDefinitionName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynGoToDefinitionHandler : AbstractGoToDefinitionWithFarHandler
{
[ImportingConstructor]
public RoslynGoToDefinitionHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService)
: base(metadataAsSourceService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDefinitionName)]
internal class TypeScriptGoToDefinitionHandler : AbstractGoToDefinitionWithFarHandler
{
[ImportingConstructor]
public TypeScriptGoToDefinitionHandler() : base(null)
{
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using System;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDefinitionName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynGoToDefinitionHandler : AbstractGoToDefinitionWithFarHandler
{
[ImportingConstructor]
public RoslynGoToDefinitionHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService)
: base(metadataAsSourceService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDefinitionName)]
internal class TypeScriptGoToDefinitionHandler : AbstractGoToDefinitionWithFarHandler
{
[ImportingConstructor]
public TypeScriptGoToDefinitionHandler() : base(null)
{
}
}
}
|
mit
|
C#
|
db6cd70ee61e7217b5dfca4c270bdc9eac9973ea
|
Update EvaluationOrderAttribute.cs
|
rmc00/gsf,rmc00/gsf,rmc00/gsf,GridProtectionAlliance/gsf,GridProtectionAlliance/gsf,GridProtectionAlliance/gsf,GridProtectionAlliance/gsf,rmc00/gsf,GridProtectionAlliance/gsf,rmc00/gsf,GridProtectionAlliance/gsf,rmc00/gsf,rmc00/gsf,GridProtectionAlliance/gsf,GridProtectionAlliance/gsf
|
Source/Libraries/GSF.Core/ComponentModel/EvaluationOrderAttribute.cs
|
Source/Libraries/GSF.Core/ComponentModel/EvaluationOrderAttribute.cs
|
//******************************************************************************************************
// EvaluationOrderAttribute.cs - Gbtc
//
// Copyright © 2016, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
// not use this file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 04/10/2017 - J. Ritchie Carroll
// Generated original version of source code.
//
//******************************************************************************************************
using System;
namespace GSF.ComponentModel
{
/// <summary>
/// Defines an attribute that will specify an evaluation order for properties.
/// </summary>
/// <remarks>
/// <para>
/// This is useful for providing an order of operations to evaluations of
/// <see cref="DefaultValueExpressionAttribute"/> attributes where one
/// expression may be dependent on another. Note that properties are normally
/// evaluated in the order in which they are defined in the class, using this
/// attribute allows the order of evaluation to be changed.
/// </para>
/// <para>
/// When no <see cref="EvaluationOrderAttribute"/> is specified, the sort
/// order for a property is assumed to be zero. Properties will be ordered
/// numerically based on the specified <see cref="OrderIndex"/>.
/// </para>
/// <para>
/// See <see cref="DefaultValueExpressionParser{T}.CreateInstance{TExpressionScope}"/>.
/// </para>
/// </remarks>
[AttributeUsage(AttributeTargets.Property)]
public sealed class EvaluationOrderAttribute : Attribute
{
/// <summary>
/// Gets the specified numeric evaluation order for a property.
/// </summary>
public int OrderIndex
{
get;
}
/// <summary>
/// Creates a new <see cref="EvaluationOrderAttribute"/>.
/// </summary>
/// <param name="orderIndex">Evaluation order for a property.</param>
public EvaluationOrderAttribute(int orderIndex)
{
OrderIndex = orderIndex;
}
}
}
|
//******************************************************************************************************
// EvaluationOrderAttribute.cs - Gbtc
//
// Copyright © 2016, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
// not use this file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 04/10/2017 - J. Ritchie Carroll
// Generated original version of source code.
//
//******************************************************************************************************
using System;
namespace GSF.ComponentModel
{
/// <summary>
/// Defines an attribute that will specify an evaluation order for properties.
/// </summary>
/// <remarks>
/// <para>
/// This is useful for providing an order of operations to evaluations of
/// <see cref="DefaultValueExpressionAttribute"/> attributes where one
/// expression may be dependent on another. Note that properties are normally
/// evaluated in the order in which they are defined in the class, using this
/// property allows the order of evaluation to be changed.
/// </para>
/// <para>
/// When no <see cref="EvaluationOrderAttribute"/> is specified, the sort
/// order for a property is assumed to be zero. Properties will be ordered
/// numerically based on the specified <see cref="OrderIndex"/>.
/// </para>
/// <para>
/// See <see cref="DefaultValueExpressionParser{T}.CreateInstance{TExpressionScope}"/>.
/// </para>
/// </remarks>
[AttributeUsage(AttributeTargets.Property)]
public sealed class EvaluationOrderAttribute : Attribute
{
/// <summary>
/// Gets the specified numeric evaluation order for a property.
/// </summary>
public int OrderIndex
{
get;
}
/// <summary>
/// Creates a new <see cref="EvaluationOrderAttribute"/>.
/// </summary>
/// <param name="orderIndex">Evaluation order for a property.</param>
public EvaluationOrderAttribute(int orderIndex)
{
OrderIndex = orderIndex;
}
}
}
|
mit
|
C#
|
60e718e1fffc6dc16e00e9eca210650547997325
|
Hide restore button if user not an administrator.
|
virtualdreams/notes-core,virtualdreams/notes-core,virtualdreams/notes-core,virtualdreams/notes-core
|
Views/Revision/View.cshtml
|
Views/Revision/View.cshtml
|
@model notes.Models.RevisionViewContainer
@using Microsoft.AspNetCore.Authorization
@inject IAuthorizationService AuthorizationService
@{
ViewBag.Title = $"Revision - ";
}
@functions{
public string FormatDate(DateTime? dt) {
return String.Format(new System.Globalization.CultureInfo("en-US"), "{0:ddd, dd MMM yyyy HH:mm:ss}", dt);
}
}
<div class="row">
<div class="col-lg-12">
<div class="pb-2 mt-4 mb-2 border-bottom">
@if((await AuthorizationService.AuthorizeAsync(User, "AdministratorOnly")).Succeeded) {
<div class="btn-toolbar pull-right">
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary" data-href="@Url.Action("restore", "revision", new { id = @Model.Revision.Id })"><i class="fa fa-fw fa-history"></i> Restore</button>
</div>
</div>
}
<h1>
Revision as of @FormatDate(Model.Revision.Dt)
</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<p>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#diffOutput" aria-expanded="false" aria-controls="diffOutput">Show differences to current version.</button>
</p>
<div class="collapse" id="diffOutput">
<pre class="diff hljs"><code>@Model.Diff</code></pre>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="pb-2 mt-4 mb-2 border-bottom">
<h1>
@Model.Revision.Title
</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<markdown>@Html.Raw(Model.Revision.Content)</markdown>
</div>
</div>
|
@model notes.Models.RevisionViewContainer
@{
ViewBag.Title = $"Revision - ";
}
@functions{
public string FormatDate(DateTime? dt) {
return String.Format(new System.Globalization.CultureInfo("en-US"), "{0:ddd, dd MMM yyyy HH:mm:ss}", dt);
}
}
<div class="row">
<div class="col-lg-12">
<div class="pb-2 mt-4 mb-2 border-bottom">
<div class="btn-toolbar pull-right">
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary" data-href="@Url.Action("restore", "revision", new { id = @Model.Revision.Id })"><i class="fa fa-fw fa-history"></i> Restore</button>
</div>
</div>
<h1>
Revision as of @FormatDate(Model.Revision.Dt)
</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<p>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#diffOutput" aria-expanded="false" aria-controls="diffOutput">Show differences to current version.</button>
</p>
<div class="collapse" id="diffOutput">
<pre class="diff hljs"><code>@Model.Diff</code></pre>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="pb-2 mt-4 mb-2 border-bottom">
<h1>
@Model.Revision.Title
</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<markdown>@Html.Raw(Model.Revision.Content)</markdown>
</div>
</div>
|
mit
|
C#
|
9bb999728867ab9cfc350dc89b1c2a7824c87e3b
|
Update src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs
|
abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS
|
src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs
|
src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs
|
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using System.IO;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Umbraco.Tests.Integration.Testing;
namespace Umbraco.Tests.Integration.Implementations
{
public static class HostBuilderExtensions
{
public static IHostBuilder UseLocalDb(this IHostBuilder hostBuilder, string dbFilePath)
{
// Need to register SqlClient manually
// TODO: Move this to someplace central
DbProviderFactories.RegisterFactory(Constants.DbProviderNames.SqlServer, SqlClientFactory.Instance);
hostBuilder.ConfigureAppConfiguration(x =>
{
if (!Directory.Exists(dbFilePath))
Directory.CreateDirectory(dbFilePath);
var dbName = Guid.NewGuid().ToString("N");
var instance = TestLocalDb.EnsureLocalDbInstanceAndDatabase(dbName, dbFilePath);
x.AddInMemoryCollection(new[]
{
new KeyValuePair<string, string>($"ConnectionStrings:{Constants.System.UmbracoConnectionName}", instance.GetConnectionString(dbName))
});
});
return hostBuilder;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using System.IO;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Umbraco.Tests.Integration.Testing;
namespace Umbraco.Tests.Integration.Implementations
{
public static class HostBuilderExtensions
{
public static IHostBuilder UseLocalDb(this IHostBuilder hostBuilder, string dbFilePath)
{
// Need to register SqlClient manually
// TODO: Move this to someplace central
DbProviderFactories.RegisterFactory(Constants.DbProviderNames.SqlServer, SqlClientFactory.Instance);
hostBuilder.ConfigureAppConfiguration(x =>
{
if (!Directory.Exists(dbFilePath))
Directory.CreateDirectory(dbFilePath);
var dbName = Guid.NewGuid().ToString("N");
var instance = TestLocalDb.EnsureLocalDbInstanceAndDatabase(dbName, dbFilePath);
x.AddInMemoryCollection(new[]
{
new KeyValuePair<string, string>("ConnectionStrings:umbracoDbDSN", instance.GetConnectionString(dbName))
});
});
return hostBuilder;
}
}
}
|
mit
|
C#
|
91c82abf726d8ce2acd5a32a09f30c718595e6ef
|
remove virtual on Initialize and add InitializeDictionaries
|
ilyhacker/aspnetboilerplate,luchaoshuai/aspnetboilerplate,luchaoshuai/aspnetboilerplate,ilyhacker/aspnetboilerplate,carldai0106/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,verdentk/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,verdentk/aspnetboilerplate,ryancyq/aspnetboilerplate,ilyhacker/aspnetboilerplate,carldai0106/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,ryancyq/aspnetboilerplate,verdentk/aspnetboilerplate
|
src/Abp/Localization/Dictionaries/LocalizationDictionaryProviderBase.cs
|
src/Abp/Localization/Dictionaries/LocalizationDictionaryProviderBase.cs
|
using System.Collections.Generic;
namespace Abp.Localization.Dictionaries
{
public abstract class LocalizationDictionaryProviderBase : ILocalizationDictionaryProvider
{
public string SourceName { get; private set; }
public ILocalizationDictionary DefaultDictionary { get; protected set; }
public IDictionary<string, ILocalizationDictionary> Dictionaries { get; private set; }
protected LocalizationDictionaryProviderBase()
{
Dictionaries = new Dictionary<string, ILocalizationDictionary>();
}
public void Initialize(string sourceName)
{
SourceName = sourceName;
InitializeDictionaries();
}
public void Extend(ILocalizationDictionary dictionary)
{
//Add
ILocalizationDictionary existingDictionary;
if (!Dictionaries.TryGetValue(dictionary.CultureInfo.Name, out existingDictionary))
{
Dictionaries[dictionary.CultureInfo.Name] = dictionary;
return;
}
//Override
var localizedStrings = dictionary.GetAllStrings();
foreach (var localizedString in localizedStrings)
{
existingDictionary[localizedString.Name] = localizedString.Value;
}
}
protected virtual void InitializeDictionaries()
{
}
}
}
|
using System.Collections.Generic;
namespace Abp.Localization.Dictionaries
{
public abstract class LocalizationDictionaryProviderBase : ILocalizationDictionaryProvider
{
public string SourceName { get; private set; }
public ILocalizationDictionary DefaultDictionary { get; protected set; }
public IDictionary<string, ILocalizationDictionary> Dictionaries { get; private set; }
protected LocalizationDictionaryProviderBase()
{
Dictionaries = new Dictionary<string, ILocalizationDictionary>();
}
public virtual void Initialize(string sourceName)
{
SourceName = sourceName;
}
public void Extend(ILocalizationDictionary dictionary)
{
//Add
ILocalizationDictionary existingDictionary;
if (!Dictionaries.TryGetValue(dictionary.CultureInfo.Name, out existingDictionary))
{
Dictionaries[dictionary.CultureInfo.Name] = dictionary;
return;
}
//Override
var localizedStrings = dictionary.GetAllStrings();
foreach (var localizedString in localizedStrings)
{
existingDictionary[localizedString.Name] = localizedString.Value;
}
}
}
}
|
mit
|
C#
|
afc4b940f17b8d6c721e141f4cda625b925363c6
|
Include a codebase for System.IO.FileSystem
|
KevinH-MS/roslyn,jamesqo/roslyn,tvand7093/roslyn,tmeschter/roslyn,TyOverby/roslyn,dpoeschl/roslyn,khellang/roslyn,managed-commons/roslyn,jaredpar/roslyn,panopticoncentral/roslyn,yeaicc/roslyn,stephentoub/roslyn,bbarry/roslyn,thomaslevesque/roslyn,mseamari/Stuff,reaction1989/roslyn,srivatsn/roslyn,gafter/roslyn,sharwell/roslyn,AnthonyDGreen/roslyn,lorcanmooney/roslyn,genlu/roslyn,physhi/roslyn,rgani/roslyn,xoofx/roslyn,orthoxerox/roslyn,akrisiun/roslyn,stephentoub/roslyn,agocke/roslyn,KirillOsenkov/roslyn,sharwell/roslyn,KevinRansom/roslyn,jaredpar/roslyn,KiloBravoLima/roslyn,orthoxerox/roslyn,SeriaWei/roslyn,budcribar/roslyn,nguerrera/roslyn,MichalStrehovsky/roslyn,antonssonj/roslyn,jeffanders/roslyn,mattscheffer/roslyn,ericfe-ms/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,thomaslevesque/roslyn,OmarTawfik/roslyn,mattwar/roslyn,yeaicc/roslyn,jaredpar/roslyn,Giftednewt/roslyn,jhendrixMSFT/roslyn,tannergooding/roslyn,diryboy/roslyn,CaptainHayashi/roslyn,ericfe-ms/roslyn,natgla/roslyn,natidea/roslyn,Giftednewt/roslyn,cston/roslyn,paulvanbrenk/roslyn,dotnet/roslyn,DustinCampbell/roslyn,ValentinRueda/roslyn,heejaechang/roslyn,tmat/roslyn,mmitche/roslyn,gafter/roslyn,ljw1004/roslyn,leppie/roslyn,bartdesmet/roslyn,physhi/roslyn,abock/roslyn,dpoeschl/roslyn,rgani/roslyn,MatthieuMEZIL/roslyn,antonssonj/roslyn,jmarolf/roslyn,dotnet/roslyn,aelij/roslyn,MattWindsor91/roslyn,pdelvo/roslyn,jcouv/roslyn,Giftednewt/roslyn,robinsedlaczek/roslyn,sharadagrawal/Roslyn,jhendrixMSFT/roslyn,xasx/roslyn,drognanar/roslyn,dpoeschl/roslyn,akrisiun/roslyn,mgoertz-msft/roslyn,HellBrick/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,KiloBravoLima/roslyn,Shiney/roslyn,HellBrick/roslyn,eriawan/roslyn,MatthieuMEZIL/roslyn,panopticoncentral/roslyn,mmitche/roslyn,panopticoncentral/roslyn,leppie/roslyn,swaroop-sridhar/roslyn,amcasey/roslyn,bkoelman/roslyn,VSadov/roslyn,DustinCampbell/roslyn,jkotas/roslyn,mseamari/Stuff,balajikris/roslyn,jasonmalinowski/roslyn,mgoertz-msft/roslyn,KirillOsenkov/roslyn,orthoxerox/roslyn,mgoertz-msft/roslyn,TyOverby/roslyn,kelltrick/roslyn,VPashkov/roslyn,khellang/roslyn,davkean/roslyn,jhendrixMSFT/roslyn,VSadov/roslyn,Inverness/roslyn,CaptainHayashi/roslyn,cston/roslyn,VSadov/roslyn,srivatsn/roslyn,AArnott/roslyn,mattwar/roslyn,natidea/roslyn,OmarTawfik/roslyn,tannergooding/roslyn,zooba/roslyn,Inverness/roslyn,jamesqo/roslyn,AlekseyTs/roslyn,bartdesmet/roslyn,KevinH-MS/roslyn,AnthonyDGreen/roslyn,AmadeusW/roslyn,tmeschter/roslyn,mattscheffer/roslyn,jmarolf/roslyn,brettfo/roslyn,wvdd007/roslyn,agocke/roslyn,sharadagrawal/Roslyn,AlekseyTs/roslyn,KiloBravoLima/roslyn,abock/roslyn,robinsedlaczek/roslyn,xoofx/roslyn,jkotas/roslyn,Pvlerick/roslyn,ljw1004/roslyn,MichalStrehovsky/roslyn,Maxwe11/roslyn,mseamari/Stuff,jcouv/roslyn,TyOverby/roslyn,AmadeusW/roslyn,KevinH-MS/roslyn,nguerrera/roslyn,heejaechang/roslyn,jkotas/roslyn,SeriaWei/roslyn,thomaslevesque/roslyn,tmat/roslyn,brettfo/roslyn,tvand7093/roslyn,AlekseyTs/roslyn,vcsjones/roslyn,Maxwe11/roslyn,mavasani/roslyn,Hosch250/roslyn,OmarTawfik/roslyn,khyperia/roslyn,Shiney/roslyn,tmeschter/roslyn,VPashkov/roslyn,shyamnamboodiripad/roslyn,srivatsn/roslyn,shyamnamboodiripad/roslyn,akrisiun/roslyn,mavasani/roslyn,AmadeusW/roslyn,MatthieuMEZIL/roslyn,amcasey/roslyn,jamesqo/roslyn,vcsjones/roslyn,CaptainHayashi/roslyn,mmitche/roslyn,Hosch250/roslyn,diryboy/roslyn,AnthonyDGreen/roslyn,ljw1004/roslyn,zooba/roslyn,natgla/roslyn,khellang/roslyn,natgla/roslyn,weltkante/roslyn,mattscheffer/roslyn,KevinRansom/roslyn,KirillOsenkov/roslyn,rgani/roslyn,Inverness/roslyn,MattWindsor91/roslyn,mavasani/roslyn,michalhosala/roslyn,antonssonj/roslyn,xasx/roslyn,agocke/roslyn,stephentoub/roslyn,aelij/roslyn,managed-commons/roslyn,khyperia/roslyn,nguerrera/roslyn,genlu/roslyn,basoundr/roslyn,jeffanders/roslyn,wvdd007/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,HellBrick/roslyn,heejaechang/roslyn,aelij/roslyn,ericfe-ms/roslyn,budcribar/roslyn,tvand7093/roslyn,AArnott/roslyn,jmarolf/roslyn,physhi/roslyn,sharwell/roslyn,jeffanders/roslyn,michalhosala/roslyn,dotnet/roslyn,yeaicc/roslyn,kelltrick/roslyn,ErikSchierboom/roslyn,AArnott/roslyn,Hosch250/roslyn,Pvlerick/roslyn,bbarry/roslyn,vslsnap/roslyn,brettfo/roslyn,kelltrick/roslyn,genlu/roslyn,MattWindsor91/roslyn,a-ctor/roslyn,wvdd007/roslyn,Shiney/roslyn,managed-commons/roslyn,CyrusNajmabadi/roslyn,leppie/roslyn,a-ctor/roslyn,amcasey/roslyn,CyrusNajmabadi/roslyn,shyamnamboodiripad/roslyn,budcribar/roslyn,DustinCampbell/roslyn,ValentinRueda/roslyn,jcouv/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,gafter/roslyn,MattWindsor91/roslyn,Maxwe11/roslyn,zooba/roslyn,reaction1989/roslyn,vslsnap/roslyn,Pvlerick/roslyn,xoofx/roslyn,abock/roslyn,eriawan/roslyn,bbarry/roslyn,sharadagrawal/Roslyn,basoundr/roslyn,drognanar/roslyn,bkoelman/roslyn,pdelvo/roslyn,weltkante/roslyn,ErikSchierboom/roslyn,eriawan/roslyn,xasx/roslyn,MichalStrehovsky/roslyn,bartdesmet/roslyn,robinsedlaczek/roslyn,VPashkov/roslyn,balajikris/roslyn,a-ctor/roslyn,ErikSchierboom/roslyn,vslsnap/roslyn,KevinRansom/roslyn,michalhosala/roslyn,mattwar/roslyn,lorcanmooney/roslyn,swaroop-sridhar/roslyn,CyrusNajmabadi/roslyn,SeriaWei/roslyn,swaroop-sridhar/roslyn,bkoelman/roslyn,cston/roslyn,jasonmalinowski/roslyn,lorcanmooney/roslyn,basoundr/roslyn,vcsjones/roslyn,balajikris/roslyn,davkean/roslyn,davkean/roslyn,ValentinRueda/roslyn,paulvanbrenk/roslyn,reaction1989/roslyn,paulvanbrenk/roslyn,weltkante/roslyn,natidea/roslyn,tmat/roslyn,pdelvo/roslyn,drognanar/roslyn,tannergooding/roslyn,khyperia/roslyn
|
src/VisualStudio/VisualStudioInteractiveComponents/AssemblyRedirects.cs
|
src/VisualStudio/VisualStudioInteractiveComponents/AssemblyRedirects.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.VisualStudio.Shell;
using Roslyn.VisualStudio.Setup;
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.Scripting.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.CSharp.Scripting.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.Scripting.VisualBasic.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.CSharp.InteractiveEditorFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.VisualBasic.InteractiveEditorFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.InteractiveFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.VisualStudio.InteractiveServices.dll")]
[assembly: ProvideRoslynBindingRedirection("InteractiveHost.exe")]
[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.FileSystem.dll")]
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.VisualStudio.Shell;
using Roslyn.VisualStudio.Setup;
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.Scripting.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.CSharp.Scripting.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.Scripting.VisualBasic.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.CSharp.InteractiveEditorFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.VisualBasic.InteractiveEditorFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.CodeAnalysis.InteractiveFeatures.dll")]
[assembly: ProvideRoslynBindingRedirection("Microsoft.VisualStudio.InteractiveServices.dll")]
[assembly: ProvideRoslynBindingRedirection("InteractiveHost.exe")]
|
apache-2.0
|
C#
|
1c62c1a16ea87dee67383a839413f00038129a25
|
Check if using SelectedItem pattern first
|
2gis/Winium.Desktop,zebraxxl/Winium.Desktop,jorik041/Winium.Desktop
|
src/Winium.Desktop.Driver/CommandExecutors/IsElementSelectedExecutor.cs
|
src/Winium.Desktop.Driver/CommandExecutors/IsElementSelectedExecutor.cs
|
namespace Winium.Desktop.Driver.CommandExecutors
{
#region using
using System.Windows.Automation;
using Winium.Cruciatus.Exceptions;
using Winium.Cruciatus.Extensions;
using Winium.StoreApps.Common;
#endregion
internal class IsElementSelectedExecutor : CommandExecutorBase
{
#region Methods
protected override string DoImpl()
{
var registeredKey = this.ExecutedCommand.Parameters["ID"].ToString();
var element = this.Automator.Elements.GetRegisteredElement(registeredKey);
var isSelected = false;
try
{
var isSelectedItemPattrenAvailable =
element.GetAutomationPropertyValue<bool>(AutomationElement.IsSelectionItemPatternAvailableProperty);
if (isSelectedItemPattrenAvailable)
{
var selectionItemProperty = SelectionItemPattern.IsSelectedProperty;
isSelected = element.GetAutomationPropertyValue<bool>(selectionItemProperty);
}
}
catch (CruciatusException)
{
var toggleStateProperty = TogglePattern.ToggleStateProperty;
var toggleState = element.GetAutomationPropertyValue<ToggleState>(toggleStateProperty);
isSelected = toggleState == ToggleState.On;
}
return this.JsonResponse(ResponseStatus.Success, isSelected);
}
#endregion
}
}
|
namespace Winium.Desktop.Driver.CommandExecutors
{
#region using
using System.Windows.Automation;
using Winium.Cruciatus.Exceptions;
using Winium.Cruciatus.Extensions;
using Winium.StoreApps.Common;
#endregion
internal class IsElementSelectedExecutor : CommandExecutorBase
{
#region Methods
protected override string DoImpl()
{
var registeredKey = this.ExecutedCommand.Parameters["ID"].ToString();
var element = this.Automator.Elements.GetRegisteredElement(registeredKey);
var isSelected = false;
try
{
var isTogglePattrenAvailable =
element.GetAutomationPropertyValue<bool>(AutomationElement.IsTogglePatternAvailableProperty);
if (isTogglePattrenAvailable)
{
var toggleStateProperty = TogglePattern.ToggleStateProperty;
var toggleState = element.GetAutomationPropertyValue<ToggleState>(toggleStateProperty);
isSelected = toggleState == ToggleState.On;
}
}
catch (CruciatusException)
{
var selectionItemProperty = SelectionItemPattern.IsSelectedProperty;
isSelected = element.GetAutomationPropertyValue<bool>(selectionItemProperty);
}
return this.JsonResponse(ResponseStatus.Success, isSelected);
}
#endregion
}
}
|
mpl-2.0
|
C#
|
06d894f18d918fe8847ebfb49fe10b7ec19d6eea
|
Update IDeserializer.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Serialization/IDeserializer.cs
|
TIKSN.Core/Serialization/IDeserializer.cs
|
namespace TIKSN.Serialization
{
/// <summary>
/// Deserializer interface
/// </summary>
/// <typeparam name="TSerial">Type to deserialize from, usually string or byte array</typeparam>
public interface IDeserializer<TSerial> where TSerial : class
{
/// <summary>
/// Deserialize from <typeparamref name="TSerial" /> type
/// </summary>
/// <param name="serial"></param>
/// <returns></returns>
T Deserialize<T>(TSerial serial);
}
}
|
namespace TIKSN.Serialization
{
/// <summary>
/// Deserializer interface
/// </summary>
/// <typeparam name="TSerial">Type to deserialize from, usually string or byte array</typeparam>
public interface IDeserializer<TSerial> where TSerial : class
{
/// <summary>
/// Deserialize from <typeparamref name="TSerial" /> type
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
T Deserialize<T>(TSerial serial);
}
}
|
mit
|
C#
|
8c31c4344c2f24925b3b2552bf7ee38478b99576
|
Update CarroController.cs
|
cayodonatti/TopGearApi
|
TopGearApi/Controllers/CarroController.cs
|
TopGearApi/Controllers/CarroController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TopGearApi.DataAccess;
using TopGearApi.Domain.Models;
using TopGearApi.Models;
namespace TopGearApi.Controllers
{
public class CarroController : TController<Carro>
{
[HttpGet]
public IEnumerable<Carro> GetByItem(int id)
{
return CarroDA.GetByItem(id);
}
[HttpGet]
public IEnumerable<Carro> GetDisponiveis()
{
return CarroDA.GetDisponiveis();
}
[HttpGet]
public IEnumerable<Carro> GetDisponiveisByAgencia(int id)
{
return CarroDA.GetDisponiveisByAgencia(id);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TopGearApi.DataAccess;
using TopGearApi.Domain.Models;
using TopGearApi.Models;
namespace TopGearApi.Controllers
{
public class CarroController : TController<Carro>
{
private static CarroDA DA = new CarroDA();
[HttpGet]
public IEnumerable<Carro> GetByItem(int id)
{
return DA.GetByItem(id);
}
[HttpGet]
public IEnumerable<Carro> GetDisponiveis()
{
return DA.GetDisponiveis();
}
[HttpGet]
public IEnumerable<Carro> GetDisponiveisByAgencia(int id)
{
return DA.GetDisponiveisByAgencia(id);
}
}
}
|
mit
|
C#
|
b4f6dbc89d649c396104de59b64d82a8728d964a
|
Fix typo in content
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/CheckFunding.cshtml
|
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/CheckFunding.cshtml
|
@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel
<h3 class="das-panel__heading">Funding your apprentice's training</h3>
<p>Reserve apprenticeship funding to guarantee you receive funds to pay for your apprentice's training and assessment.</p>
<p><a href="@Url.ReservationsAction("reservations")" class="das-panel__link">Check funding availability and make a reservation</a> </p>
|
@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel
<h3 class="das-panel__heading">Funding your apprentice's training</h3>
<p>Reserve apprentiship funding to guarantee you receive funds to pay for your apprentice's training and assessment.</p>
<p><a href="@Url.ReservationsAction("reservations")" class="das-panel__link">Check funding availability and make a reservation</a> </p>
|
mit
|
C#
|
907369a0aecf0dbfe684fd08400d98aa791419b2
|
Update _Footer.cshtml
|
reactiveui/website,reactiveui/website,reactiveui/website,reactiveui/website
|
input/_Footer.cshtml
|
input/_Footer.cshtml
|
<div class="container bottom-footer">
<div class="col-lg-10 col-sm-10 col-xs-12">
<ul class="list-inline">
<li class="list-inline-item">
<a href="/team" target="_blank">Branding</a>
</li>
<li class="list-inline-item">
<a href="/sponsorship" target="_blank">Sponsorship</a>
</li>
<li class="list-inline-item">
<a href="/support" target="_blank">Support</a>
</li>
<li class="list-inline-item">
<a href="/stackoverflow" target="_blank">StackOverflow</a>
</li>
<li class="list-inline-item">
<a href="/branding" target="_blank">Branding</a>
</li>
<li>
<a href="/source-code" target="_blank">Source Code</a>
</li>
<li class="list-inline-item">
<a href="/docs" target="_blank">Documentation</a>
</li>
<li class="list-inline-item">
<a href="/changelog" target="_blank">Changelog</a>
</li>
</ul>
</div>
<div class="col-lg-2 col-sm-2 col-xs-12">
<a href="/"><img src="./assets/img/logo.png" width="64" height="64" class="footer-logo" ></a>
</div>
</div>
|
<div class="container bottom-footer">
<div class="col-lg-10 col-sm-10 col-xs-12">
<ul class="list-inline">
<li class="list-inline-item">
<a href="/donate" target="_blank">Donate</a>
</li>
<li class="list-inline-item">
<a href="/sponsorship" target="_blank">Sponsorship</a>
</li>
<li class="list-inline-item">
<a href="/support" target="_blank">Support</a>
</li>
<li class="list-inline-item">
<a href="/stackoverflow" target="_blank">StackOverflow</a>
</li>
<li class="list-inline-item">
<a href="/branding" target="_blank">Branding</a>
</li>
<li>
<a href="/source-code" target="_blank">Source Code</a>
</li>
<li class="list-inline-item">
<a href="/docs" target="_blank">Documentation</a>
</li>
<li class="list-inline-item">
<a href="/changelog" target="_blank">Changelog</a>
</li>
</ul>
</div>
<div class="col-lg-2 col-sm-2 col-xs-12">
<a href="/"><img src="./assets/img/logo.png" width="64" height="64" class="footer-logo" ></a>
</div>
</div>
|
mit
|
C#
|
344a91376d95fbb1aba878d06f14df2d6039d4bb
|
test user svc make more sense
|
IdentityServer/IdentityServer3,AscendXYZ/Thinktecture.IdentityServer.v3,tbitowner/IdentityServer3,wondertrap/IdentityServer3,openbizgit/IdentityServer3,ryanvgates/IdentityServer3,bodell/IdentityServer3,delloncba/IdentityServer3,jonathankarsh/IdentityServer3,angelapper/IdentityServer3,kouweizhong/IdentityServer3,yanjustino/IdentityServer3,uoko-J-Go/IdentityServer,18098924759/IdentityServer3,bodell/IdentityServer3,feanz/Thinktecture.IdentityServer.v3,IdentityServer/IdentityServer3,huoxudong125/Thinktecture.IdentityServer.v3,bestwpw/IdentityServer3,mvalipour/IdentityServer3,paulofoliveira/IdentityServer3,buddhike/IdentityServer3,AscendXYZ/Thinktecture.IdentityServer.v3,ascoro/Thinktecture.IdentityServer.v3.Fork,feanz/Thinktecture.IdentityServer.v3,olohmann/IdentityServer3,SonOfSam/IdentityServer3,roflkins/IdentityServer3,SonOfSam/IdentityServer3,olohmann/IdentityServer3,Agrando/IdentityServer3,faithword/IdentityServer3,kouweizhong/IdentityServer3,faithword/IdentityServer3,EternalXw/IdentityServer3,jackswei/IdentityServer3,maz100/Thinktecture.IdentityServer.v3,feanz/Thinktecture.IdentityServer.v3,remunda/IdentityServer3,tuyndv/IdentityServer3,mvalipour/IdentityServer3,angelapper/IdentityServer3,buddhike/IdentityServer3,ryanvgates/IdentityServer3,chicoribas/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,kouweizhong/IdentityServer3,huoxudong125/Thinktecture.IdentityServer.v3,charoco/IdentityServer3,tuyndv/IdentityServer3,openbizgit/IdentityServer3,bestwpw/IdentityServer3,jonathankarsh/IdentityServer3,18098924759/IdentityServer3,iamkoch/IdentityServer3,tbitowner/IdentityServer3,buddhike/IdentityServer3,faithword/IdentityServer3,tonyeung/IdentityServer3,tbitowner/IdentityServer3,tonyeung/IdentityServer3,jackswei/IdentityServer3,roflkins/IdentityServer3,ryanvgates/IdentityServer3,EternalXw/IdentityServer3,18098924759/IdentityServer3,chicoribas/IdentityServer3,delRyan/IdentityServer3,codeice/IdentityServer3,huoxudong125/Thinktecture.IdentityServer.v3,uoko-J-Go/IdentityServer,delloncba/IdentityServer3,openbizgit/IdentityServer3,yanjustino/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,Agrando/IdentityServer3,jackswei/IdentityServer3,paulofoliveira/IdentityServer3,iamkoch/IdentityServer3,chicoribas/IdentityServer3,EternalXw/IdentityServer3,ascoro/Thinktecture.IdentityServer.v3.Fork,charoco/IdentityServer3,codeice/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,maz100/Thinktecture.IdentityServer.v3,SonOfSam/IdentityServer3,tonyeung/IdentityServer3,delRyan/IdentityServer3,uoko-J-Go/IdentityServer,delRyan/IdentityServer3,charoco/IdentityServer3,mvalipour/IdentityServer3,iamkoch/IdentityServer3,roflkins/IdentityServer3,jonathankarsh/IdentityServer3,angelapper/IdentityServer3,delloncba/IdentityServer3,Agrando/IdentityServer3,bestwpw/IdentityServer3,olohmann/IdentityServer3,paulofoliveira/IdentityServer3,wondertrap/IdentityServer3,yanjustino/IdentityServer3,remunda/IdentityServer3,codeice/IdentityServer3,tuyndv/IdentityServer3,bodell/IdentityServer3,wondertrap/IdentityServer3,maz100/Thinktecture.IdentityServer.v3,IdentityServer/IdentityServer3,remunda/IdentityServer3
|
source/Core.TestServices/TestUserService.cs
|
source/Core.TestServices/TestUserService.cs
|
using System;
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license
*/
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Services;
namespace Thinktecture.IdentityServer.TestServices
{
public class TestUserService : IUserService
{
public async Task<IEnumerable<Claim>> GetProfileDataAsync(string sub, IEnumerable<string> requestedClaimTypes = null)
{
var claims = new List<Claim>();
if (requestedClaimTypes == null)
{
claims.Add(new Claim(Constants.ClaimTypes.Subject, sub));
return claims;
}
foreach (var requestedClaim in requestedClaimTypes)
{
if (requestedClaim == Constants.ClaimTypes.Subject)
{
claims.Add(new Claim(Constants.ClaimTypes.Subject, sub));
}
else
{
claims.Add(new Claim(requestedClaim, requestedClaim));
}
}
return claims;
}
public async Task<AuthenticateResult> AuthenticateLocalAsync(string username, string password)
{
if (username != password) return null;
return new AuthenticateResult(username, username);
}
public async Task<ExternalAuthenticateResult> AuthenticateExternalAsync(string subject, IEnumerable<Claim> claims)
{
if (claims == null)
{
return null;
}
var name = claims.FirstOrDefault(x=>x.Type==ClaimTypes.NameIdentifier);
if (name == null)
{
return null;
}
return new ExternalAuthenticateResult(name.Issuer, Guid.NewGuid().ToString("D"), name.Value);
}
}
}
|
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license
*/
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Services;
namespace Thinktecture.IdentityServer.TestServices
{
public class TestUserService : IUserService
{
public async Task<IEnumerable<Claim>> GetProfileDataAsync(string sub, IEnumerable<string> requestedClaimTypes = null)
{
var claims = new List<Claim>();
if (requestedClaimTypes == null)
{
claims.Add(new Claim(Constants.ClaimTypes.Subject, sub));
return claims;
}
foreach (var requestedClaim in requestedClaimTypes)
{
if (requestedClaim == Constants.ClaimTypes.Subject)
{
claims.Add(new Claim(Constants.ClaimTypes.Subject, sub));
}
else
{
claims.Add(new Claim(requestedClaim, requestedClaim));
}
}
return claims;
}
public async Task<AuthenticateResult> AuthenticateLocalAsync(string username, string password)
{
if (username != password) return null;
return new AuthenticateResult(username, username);
}
public async Task<ExternalAuthenticateResult> AuthenticateExternalAsync(string subject, IEnumerable<Claim> claims)
{
if (claims == null)
{
return null;
}
var name = claims.FirstOrDefault(x=>x.Type==ClaimTypes.NameIdentifier);
if (name == null)
{
return null;
}
return new ExternalAuthenticateResult("external", name.Value, name.Value);
}
}
}
|
apache-2.0
|
C#
|
5b82fa981e65f4986412e0ac67f757c1b659fe28
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.37.*")]
|
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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.36.*")]
|
mit
|
C#
|
6b5387940be512290ae404e9297e0500b230f1fa
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.64.*")]
|
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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.63.*")]
|
mit
|
C#
|
72d77482e35775380c62423d4488276f0796e0de
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.21.*")]
|
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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.20.*")]
|
mit
|
C#
|
13456088b859fb0c2ac60aaba6915db5614539b3
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.20.*")]
|
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("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// 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.19.*")]
|
mit
|
C#
|
a261684395ec709876a5f53400452dafcdd97e90
|
Add Exception handling when source .mkdb file not found
|
advasoft/scafftools
|
src/win/scafftools/makedb/Program.cs
|
src/win/scafftools/makedb/Program.cs
|
/* Copyright (C) Advasoft Development 2015
*
* 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.
*
* Written by Denis Kozlov <deniskozlov@outlook.com>, April, 26 2015
*/
namespace scafftools.makedb
{
using Scheme;
using System;
using Model;
using Utilities;
class Program
{
static void Main(string[] args)
{
OptionSet options = default(OptionSet);
try
{
options = ArgumentsParser.ParseArguments<OptionSet>(args);
}
catch (ConsoleArgumentsParseException cexception)
{
Console.WriteLine(cexception.Message);
return;
}
catch (Exception)
{
Console.WriteLine("Something wrong");
return;
}
string mkdbContent = "";
try
{
mkdbContent = new MkdbFileReader(options.SourcePath).ReadFileContent();
}
catch (ApplicationException ae)
{
Console.WriteLine(ae.Message);
return;
}
catch (Exception ex)
{
Console.WriteLine("Something wrong");
return;
}
Db model;
try
{
model = MkdbParser.Parse(mkdbContent);
}
catch (InvalidMkdbFileStructureException e)
{
Console.WriteLine("Invalid file structure at line {0}", e.Line);
return;
}
ISchemeCreator creator = SchemeCreatorFactory.CreateSchemeCreator(options.ServerType);
var scheme = creator.GenerateScript(model);
}
}
}
|
/* Copyright (C) Advasoft Development 2015
*
* 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.
*
* Written by Denis Kozlov <deniskozlov@outlook.com>, April, 26 2015
*/
namespace scafftools.makedb
{
using Scheme;
using System;
using Model;
using Utilities;
class Program
{
static void Main(string[] args)
{
OptionSet options = default(OptionSet);
try
{
options = ArgumentsParser.ParseArguments<OptionSet>(args);
}
catch (ConsoleArgumentsParseException cexception)
{
Console.WriteLine(cexception.Message);
return;
}
catch (Exception)
{
Console.WriteLine("Something wrong");
return;
}
var mkdbContent = new MkdbFileReader(options.SourcePath).ReadFileContent();
Db model;
try
{
model = MkdbParser.Parse(mkdbContent);
}
catch (InvalidMkdbFileStructureException e)
{
Console.WriteLine("Invalid file structure at line {0}", e.Line);
return;
}
ISchemeCreator creator = SchemeCreatorFactory.CreateSchemeCreator(options.ServerType);
var scheme = creator.GenerateScript(model);
}
}
}
|
mit
|
C#
|
9a59f0ea311d19d1b41690d407c94f3ba5511788
|
Remove meaningless check
|
2gis/Winium.Desktop,zebraxxl/Winium.Desktop,jorik041/Winium.Desktop
|
src/Winium.Desktop.Driver/CommandExecutors/IsElementSelectedExecutor.cs
|
src/Winium.Desktop.Driver/CommandExecutors/IsElementSelectedExecutor.cs
|
namespace Winium.Desktop.Driver.CommandExecutors
{
#region using
using System.Windows.Automation;
using Winium.Cruciatus.Exceptions;
using Winium.Cruciatus.Extensions;
using Winium.StoreApps.Common;
#endregion
internal class IsElementSelectedExecutor : CommandExecutorBase
{
#region Methods
protected override string DoImpl()
{
var registeredKey = this.ExecutedCommand.Parameters["ID"].ToString();
var element = this.Automator.Elements.GetRegisteredElement(registeredKey);
bool isSelected;
try
{
var selectionItemProperty = SelectionItemPattern.IsSelectedProperty;
isSelected = element.GetAutomationPropertyValue<bool>(selectionItemProperty);
}
catch (CruciatusException)
{
var toggleStateProperty = TogglePattern.ToggleStateProperty;
var toggleState = element.GetAutomationPropertyValue<ToggleState>(toggleStateProperty);
isSelected = toggleState == ToggleState.On;
}
return this.JsonResponse(ResponseStatus.Success, isSelected);
}
#endregion
}
}
|
namespace Winium.Desktop.Driver.CommandExecutors
{
#region using
using System.Windows.Automation;
using Winium.Cruciatus.Exceptions;
using Winium.Cruciatus.Extensions;
using Winium.StoreApps.Common;
#endregion
internal class IsElementSelectedExecutor : CommandExecutorBase
{
#region Methods
protected override string DoImpl()
{
var registeredKey = this.ExecutedCommand.Parameters["ID"].ToString();
var element = this.Automator.Elements.GetRegisteredElement(registeredKey);
var isSelected = false;
try
{
var isSelectedItemPattrenAvailable =
element.GetAutomationPropertyValue<bool>(AutomationElement.IsSelectionItemPatternAvailableProperty);
if (isSelectedItemPattrenAvailable)
{
var selectionItemProperty = SelectionItemPattern.IsSelectedProperty;
isSelected = element.GetAutomationPropertyValue<bool>(selectionItemProperty);
}
}
catch (CruciatusException)
{
var toggleStateProperty = TogglePattern.ToggleStateProperty;
var toggleState = element.GetAutomationPropertyValue<ToggleState>(toggleStateProperty);
isSelected = toggleState == ToggleState.On;
}
return this.JsonResponse(ResponseStatus.Success, isSelected);
}
#endregion
}
}
|
mpl-2.0
|
C#
|
50da773bf5fe3aaba44edb78f4d85446399966ba
|
Fix draw ellipse
|
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
|
src/PathDemo/Controls/Renderer/LineHelper.cs
|
src/PathDemo/Controls/Renderer/LineHelper.cs
|
using System.Windows.Media;
using Draw2D.Models.Renderers;
using Draw2D.Models.Shapes;
using Draw2D.Models.Style;
namespace PathDemo.Controls
{
public class CommonHelper
{
public static EllipseShape Ellipse = new EllipseShape(new PointShape(-4, -4, null), new PointShape(4, 4, null))
{
Style = new DrawStyle(new DrawColor(255, 255, 255, 0), new DrawColor(0, 0, 0, 0), 2.0, false, true)
};
public static void DrawEllipseAt(object dc, ShapeRenderer r, PointShape s, double radius)
{
Ellipse.TopLeft.X = s.X - radius;
Ellipse.TopLeft.Y = s.Y - radius;
Ellipse.BottomRight.X = s.X + radius;
Ellipse.BottomRight.Y = s.Y + radius;
Ellipse.Draw(dc, r, 0.0, 0.0);
}
}
public class LineHelper : CommonHelper
{
public static void Draw(object dc, ShapeRenderer r, LineShape line)
{
DrawEllipseAt(dc, r, line.StartPoint, 2.0);
DrawEllipseAt(dc, r, line.Point, 2.0);
}
}
}
|
using System.Windows.Media;
using Draw2D.Models.Renderers;
using Draw2D.Models.Shapes;
using Draw2D.Models.Style;
namespace PathDemo.Controls
{
public class CommonHelper
{
public static EllipseShape Ellipse = new EllipseShape(new PointShape(-4, -4, null), new PointShape(4, 4, null))
{
Style = new DrawStyle(new DrawColor(255, 255, 255, 0), new DrawColor(0, 0, 0, 0), 2.0, false, true)
};
public static void DrawEllipseAt(object dc, ShapeRenderer r, PointShape s, double radius)
{
Ellipse.TopLeft.X = s.X - radius;
Ellipse.TopLeft.X = s.Y - radius;
Ellipse.BottomRight.X = s.X + radius;
Ellipse.BottomRight.X = s.Y + radius;
Ellipse.Draw(dc, r, 0.0, 0.0);
}
}
public class LineHelper : CommonHelper
{
public static void Draw(object dc, ShapeRenderer r, LineShape line)
{
DrawEllipseAt(dc, r, line.StartPoint, 2.0);
DrawEllipseAt(dc, r, line.Point, 2.0);
}
}
}
|
mit
|
C#
|
0231d3c28b82f17778a9358a5e7fb15e3680a634
|
rework of ValueSyntax, final refactoring
|
hahoyer/reni.cs,hahoyer/reni.cs,hahoyer/reni.cs
|
src/ReniUI/Classification/WhiteSpaceToken.cs
|
src/ReniUI/Classification/WhiteSpaceToken.cs
|
using System.Collections.Generic;
using hw.Scanner;
using Reni.Parser;
namespace ReniUI.Classification
{
sealed class WhiteSpaceToken : Token
{
internal override Helper.Syntax Syntax { get; }
readonly IItem Item;
internal WhiteSpaceToken(IItem item, Helper.Syntax parent)
{
Item = item;
Syntax = parent;
}
public override SourcePart SourcePart => Item.SourcePart;
public override bool IsComment => Lexer.IsMultiLineComment(Item);
public override bool IsLineComment => Lexer.IsLineComment(Item);
public override bool IsWhiteSpace => Lexer.IsSpace(Item);
public override bool IsLineEnd => Lexer.IsLineEnd(Item);
public override string State => Lexer.Instance.WhiteSpaceId(Item) ?? "";
public override IEnumerable<SourcePart> FindAllBelongings(CompilerBrowser compiler) { yield break; }
}
}
|
using System.Collections.Generic;
using hw.Scanner;
using Reni.Parser;
using ReniUI.Helper;
namespace ReniUI.Classification
{
sealed class WhiteSpaceToken : Token
{
readonly IItem _item;
internal WhiteSpaceToken(IItem item, Helper.Syntax parent)
{
_item = item;
Syntax = parent;
}
public override SourcePart SourcePart => _item.SourcePart;
public override bool IsComment => Lexer.IsMultiLineComment(_item);
public override bool IsLineComment => Lexer.IsLineComment(_item);
public override bool IsWhiteSpace => Lexer.IsSpace(_item);
public override bool IsLineEnd => Lexer.IsLineEnd(_item);
public override string State => Lexer.Instance.WhiteSpaceId(_item) ?? "";
internal override Helper.Syntax Syntax {get;}
public override IEnumerable<SourcePart> FindAllBelongings(CompilerBrowser compiler) {yield break;}
}
}
|
mit
|
C#
|
c1cc76521485931a0cd6bffdb276c28b37140159
|
Change contact drop-down options
|
MarioZisov/Baskerville,MarioZisov/Baskerville,MarioZisov/Baskerville
|
BaskervilleWebsite/Baskerville.Models/ViewModels/ContactViewModel.cs
|
BaskervilleWebsite/Baskerville.Models/ViewModels/ContactViewModel.cs
|
namespace Baskerville.Models.ViewModels
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
public class ContactViewModel
{
#region English Properties
public readonly IEnumerable<SelectListItem> SubjectsEn = new List<SelectListItem>
{
new SelectListItem {Text = "Option 1", Value = "Option 1" },
new SelectListItem {Text = "Option 2", Value = "Option 2" },
new SelectListItem {Text = "Option 3", Value = "Option 3" }
};
[Required]
public string NameEn { get; set; }
[Required]
public string EmailEn { get; set; }
[Required]
public string PhoneNumberEn { get; set; }
[Required]
public string SubjectEn { get; set; }
[Required]
public string MessageEn { get; set; }
#endregion
#region Builgarian Properties
public readonly IEnumerable<SelectListItem> SubjectsBg = new List<SelectListItem>
{
new SelectListItem {Text = "Вариант 1", Value = "Вариант 1" },
new SelectListItem {Text = "Вариант 2", Value = "Вариант 2" },
new SelectListItem {Text = "Вариант 3", Value = "Вариант 3" }
};
public string NameBg { get; set; }
public string EmailBg { get; set; }
public string PhoneNumberBg { get; set; }
public string SubjectBg { get; set; }
public string MessageBg { get; set; }
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace Baskerville.Models.ViewModels
{
public class ContactViewModel
{
#region English Properties
public readonly IEnumerable<SelectListItem> SubjectsEn = new List<SelectListItem>
{
new SelectListItem {Text = "Question asdasdadsad", Value = "Question asdasdadsad" },
new SelectListItem {Text = "Another asdasdadsad", Value = "Another asdasdadsad" },
new SelectListItem {Text = "AAAA fakQuestion asdasdadsad", Value = "AAAA fakQuestion asdasdadsad" }
};
[Required]
public string NameEn { get; set; }
[Required]
public string EmailEn { get; set; }
[Required]
public string PhoneNumberEn { get; set; }
[Required]
public string SubjectEn { get; set; }
[Required]
public string MessageEn { get; set; }
#endregion
#region Builgarian Properties
public readonly IEnumerable<SelectListItem> SubjectsBg = new List<SelectListItem>
{
new SelectListItem {Text = "Question asdasdadsad", Value = "Question asdasdadsad" },
new SelectListItem {Text = "Another asdasdadsad", Value = "Another asdasdadsad" },
new SelectListItem {Text = "AAAA fakQuestion asdasdadsad", Value = "AAAA fakQuestion asdasdadsad" }
};
public string NameBg { get; set; }
public string EmailBg { get; set; }
public string PhoneNumberBg { get; set; }
public string SubjectBg { get; set; }
public string MessageBg { get; set; }
#endregion
}
}
|
apache-2.0
|
C#
|
38cd5c2e6071f15a1ca7ecced6a84d6e32df976b
|
Update Metatogger default install path
|
luminescence-software/scripts
|
.intellisense.csx
|
.intellisense.csx
|
#r "C:\Program Files (x86)\Luminescence Software\Metatogger 5.9\Metatogger.exe"
using System.Collections.Generic;
using Metatogger.Data;
IEnumerable<AudioFile> files = new List<AudioFile>(); // list of checked audio files in the workspace
|
#r "C:\Program Files (x86)\Luminescence Software\Metatogger 5.8\Metatogger.exe"
using System.Collections.Generic;
using Metatogger.Data;
IEnumerable<AudioFile> files = new List<AudioFile>(); // list of checked audio files in the workspace
|
mpl-2.0
|
C#
|
54c0bdf7d3174ec1b6ee5ba61abf096492d7fa2c
|
Fix PlaylistLoungeTestScene appearing very narrow
|
NeoAdonis/osu,smoogipoo/osu,peppy/osu-new,smoogipoo/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu,peppy/osu,peppy/osu,UselessToucan/osu,smoogipooo/osu,smoogipoo/osu
|
osu.Game.Tests/Visual/Playlists/TestScenePlaylistsLoungeSubScreen.cs
|
osu.Game.Tests/Visual/Playlists/TestScenePlaylistsLoungeSubScreen.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.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.OnlinePlay.Lounge;
using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Tests.Visual.Multiplayer;
namespace osu.Game.Tests.Visual.Playlists
{
public class TestScenePlaylistsLoungeSubScreen : RoomManagerTestScene
{
private LoungeSubScreen loungeScreen;
[BackgroundDependencyLoader]
private void load()
{
}
public override void SetUpSteps()
{
base.SetUpSteps();
AddStep("push screen", () => LoadScreen(loungeScreen = new PlaylistsLoungeSubScreen()));
AddUntilStep("wait for present", () => loungeScreen.IsCurrentScreen());
}
private RoomsContainer roomsContainer => loungeScreen.ChildrenOfType<RoomsContainer>().First();
[Test]
public void TestScrollSelectedIntoView()
{
AddRooms(30);
AddUntilStep("first room is not masked", () => checkRoomVisible(roomsContainer.Rooms.First()));
AddStep("select last room", () => roomsContainer.Rooms.Last().Action?.Invoke());
AddUntilStep("first room is masked", () => !checkRoomVisible(roomsContainer.Rooms.First()));
AddUntilStep("last room is not masked", () => checkRoomVisible(roomsContainer.Rooms.Last()));
}
private bool checkRoomVisible(DrawableRoom room) =>
loungeScreen.ChildrenOfType<OsuScrollContainer>().First().ScreenSpaceDrawQuad
.Contains(room.ScreenSpaceDrawQuad.Centre);
}
}
|
// 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.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.OnlinePlay.Lounge;
using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Tests.Visual.Multiplayer;
namespace osu.Game.Tests.Visual.Playlists
{
public class TestScenePlaylistsLoungeSubScreen : RoomManagerTestScene
{
private LoungeSubScreen loungeScreen;
[BackgroundDependencyLoader]
private void load()
{
}
public override void SetUpSteps()
{
base.SetUpSteps();
AddStep("push screen", () => LoadScreen(loungeScreen = new PlaylistsLoungeSubScreen
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 0.5f,
}));
AddUntilStep("wait for present", () => loungeScreen.IsCurrentScreen());
}
private RoomsContainer roomsContainer => loungeScreen.ChildrenOfType<RoomsContainer>().First();
[Test]
public void TestScrollSelectedIntoView()
{
AddRooms(30);
AddUntilStep("first room is not masked", () => checkRoomVisible(roomsContainer.Rooms.First()));
AddStep("select last room", () => roomsContainer.Rooms.Last().Action?.Invoke());
AddUntilStep("first room is masked", () => !checkRoomVisible(roomsContainer.Rooms.First()));
AddUntilStep("last room is not masked", () => checkRoomVisible(roomsContainer.Rooms.Last()));
}
private bool checkRoomVisible(DrawableRoom room) =>
loungeScreen.ChildrenOfType<OsuScrollContainer>().First().ScreenSpaceDrawQuad
.Contains(room.ScreenSpaceDrawQuad.Centre);
}
}
|
mit
|
C#
|
550f8a4d07ca2d7f620a6e5416d178a9429ce489
|
Set version to 0.0.0.0
|
jammycakes/dolstagis.web,jammycakes/dolstagis.web,jammycakes/dolstagis.web
|
src/.version/DefaultVersionInfo.cs
|
src/.version/DefaultVersionInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// 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.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// 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#
|
f2d80de343e74702ffb75ef82b430bd0def6ef5e
|
Fix error with RequirePermission precondition
|
LassieME/Discord.Net,RogueException/Discord.Net,Confruggy/Discord.Net,AntiTcb/Discord.Net
|
src/Discord.Net.Commands/Attributes/Preconditions/RequirePermission.cs
|
src/Discord.Net.Commands/Attributes/Preconditions/RequirePermission.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Discord.Commands.Attributes.Preconditions
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequirePermission : PreconditionAttribute
{
public GuildPermission? GuildPermission { get; set; }
public ChannelPermission? ChannelPermission { get; set; }
public RequirePermission(GuildPermission permission)
{
GuildPermission = permission;
ChannelPermission = null;
}
public RequirePermission(ChannelPermission permission)
{
ChannelPermission = permission;
GuildPermission = null;
}
public override Task<PreconditionResult> CheckPermissions(IMessage context, Command executingCommand, object moduleInstance)
{
if (!(context.Channel is IGuildChannel))
return Task.FromResult(PreconditionResult.FromError("Command must be used in a guild channel"));
var author = context.Author as IGuildUser;
if (GuildPermission.HasValue)
{
var guildPerms = author.GuildPermissions.ToList();
if (!guildPerms.Contains(GuildPermission.Value))
return Task.FromResult(PreconditionResult.FromError($"User is missing guild permission {GuildPermission.Value}"));
}
if (ChannelPermission.HasValue)
{
var channel = context.Channel as IGuildChannel;
var channelPerms = author.GetPermissions(channel).ToList();
if (!channelPerms.Contains(ChannelPermission.Value))
return Task.FromResult(PreconditionResult.FromError($"User is missing channel permission {ChannelPermission.Value}"));
}
return Task.FromResult(PreconditionResult.FromSuccess());
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Discord.Commands.Attributes.Preconditions
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequirePermission : RequireGuildAttribute
{
public GuildPermission? GuildPermission { get; set; }
public ChannelPermission? ChannelPermission { get; set; }
public RequirePermission(GuildPermission permission)
{
GuildPermission = permission;
ChannelPermission = null;
}
public RequirePermission(ChannelPermission permission)
{
ChannelPermission = permission;
GuildPermission = null;
}
public override async Task<PreconditionResult> CheckPermissions(IMessage context, Command executingCommand, object moduleInstance)
{
var result = await base.CheckPermissions(context, executingCommand, moduleInstance).ConfigureAwait(false);
if (!result.IsSuccess)
return result;
var author = context.Author as IGuildUser;
if (GuildPermission.HasValue)
{
var guildPerms = author.GuildPermissions.ToList();
if (!guildPerms.Contains(GuildPermission.Value))
return PreconditionResult.FromError($"User is missing guild permission {GuildPermission.Value}");
}
if (ChannelPermission.HasValue)
{
var channel = context.Channel as IGuildChannel;
var channelPerms = author.GetPermissions(channel).ToList();
if (!channelPerms.Contains(ChannelPermission.Value))
return PreconditionResult.FromError($"User is missing channel permission {ChannelPermission.Value}");
}
return PreconditionResult.FromSuccess();
}
}
}
|
mit
|
C#
|
0b48051ce9fb5e3128de19ec3c73cc8e2b059699
|
Fix what I like to call the Kiesza bug
|
Brijen/lastfm,realworld666/lastfm
|
src/IF.Lastfm.Core/Api/Commands/ArtistApi/GetArtistTopAlbumsCommand.cs
|
src/IF.Lastfm.Core/Api/Commands/ArtistApi/GetArtistTopAlbumsCommand.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using IF.Lastfm.Core.Api.Enums;
using IF.Lastfm.Core.Api.Helpers;
using IF.Lastfm.Core.Objects;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace IF.Lastfm.Core.Api.Commands.ArtistApi
{
internal class GetArtistTopAlbumsCommand : GetAsyncCommandBase<PageResponse<LastAlbum>>
{
public string ArtistName { get; set; }
public GetArtistTopAlbumsCommand(IAuth auth, string artistname)
: base(auth)
{
Method = "artist.topAlbums";
ArtistName = artistname;
}
public override void SetParameters()
{
Parameters.Add("artist", ArtistName);
AddPagingParameters();
DisableCaching();
}
public async override Task<PageResponse<LastAlbum>> HandleResponse(HttpResponseMessage response)
{
string json = await response.Content.ReadAsStringAsync();
LastFmApiError error;
if (LastFm.IsResponseValid(json, out error) && response.IsSuccessStatusCode)
{
var jtoken = JsonConvert.DeserializeObject<JToken>(json);
//first, let's see how many albums
//stupid api returns an object intead of an array when there is only one item
var attrToken = jtoken.SelectToken("topalbums").SelectToken("@attr");
var albums = new List<LastAlbum>();
if (attrToken.Value<int>("count") > 1)
albums = jtoken.SelectToken("topalbums")
.SelectToken("album")
.Children().Select(LastAlbum.ParseJToken)
.ToList();
else
albums.Add(LastAlbum.ParseJToken(jtoken.SelectToken("topalbums")
.SelectToken("album")));
var pageresponse = PageResponse<LastAlbum>.CreateSuccessResponse(albums);
pageresponse.AddPageInfoFromJToken(attrToken);
return pageresponse;
}
else
{
return LastResponse.CreateErrorResponse<PageResponse<LastAlbum>>(error);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using IF.Lastfm.Core.Api.Enums;
using IF.Lastfm.Core.Api.Helpers;
using IF.Lastfm.Core.Objects;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace IF.Lastfm.Core.Api.Commands.ArtistApi
{
internal class GetArtistTopAlbumsCommand : GetAsyncCommandBase<PageResponse<LastAlbum>>
{
public string ArtistName { get; set; }
public GetArtistTopAlbumsCommand(IAuth auth, string artistname)
: base(auth)
{
Method = "artist.topAlbums";
ArtistName = artistname;
}
public override void SetParameters()
{
Parameters.Add("artist", ArtistName);
AddPagingParameters();
DisableCaching();
}
public async override Task<PageResponse<LastAlbum>> HandleResponse(HttpResponseMessage response)
{
string json = await response.Content.ReadAsStringAsync();
LastFmApiError error;
if (LastFm.IsResponseValid(json, out error) && response.IsSuccessStatusCode)
{
var jtoken = JsonConvert.DeserializeObject<JToken>(json);
var albums = jtoken.SelectToken("topalbums")
.SelectToken("album")
.Children().Select(LastAlbum.ParseJToken)
.ToList();
var pageresponse = PageResponse<LastAlbum>.CreateSuccessResponse(albums);
var attrToken = jtoken.SelectToken("topalbums").SelectToken("@attr");
pageresponse.AddPageInfoFromJToken(attrToken);
return pageresponse;
}
else
{
return LastResponse.CreateErrorResponse<PageResponse<LastAlbum>>(error);
}
}
}
}
|
mit
|
C#
|
82229564ffbbf9901203a00560f2c1a0bcc96c0d
|
remove unused using
|
tynor88/Topshelf.SimpleInjector
|
Source/Topshelf.SimpleInjector.Quartz/SimpleInjectorScheduleJobServiceConfiguratorExtensions.cs
|
Source/Topshelf.SimpleInjector.Quartz/SimpleInjectorScheduleJobServiceConfiguratorExtensions.cs
|
using System;
using System.Linq;
using System.Reflection;
using Quartz;
using Quartz.Impl;
using Quartz.Spi;
using SimpleInjector;
using Topshelf.Logging;
using Topshelf.SimpleInjector.Quartz.Factory;
namespace Topshelf.SimpleInjector.Quartz
{
internal static class SimpleInjectorScheduleJobServiceConfiguratorExtensions
{
internal static void SetupQuartzSimpleInjector()
{
RegisterQuartzInSimpleInjector();
}
internal static void SetupQuartzSimpleInjector(params Assembly[] jobAssemblies)
{
RegisterQuartzInSimpleInjector(jobAssemblies);
}
private static void RegisterQuartzInSimpleInjector(Assembly[] jobAssemblies = null)
{
var log = HostLogger.Get(typeof(SimpleInjectorScheduleJobServiceConfiguratorExtensions));
Container container = SimpleInjectorHostBuilderConfigurator.Container;
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
if (jobAssemblies == null)
{
container.RegisterSingleton<IJobFactory>(new SimpleInjectorJobFactory(container));
}
else
{
container.RegisterSingleton<IJobFactory>(new SimpleInjectorDecoratorJobFactory(container, jobAssemblies));
}
container.RegisterSingleton<ISchedulerFactory>(schedulerFactory);
if (!Environment.GetCommandLineArgs().Any(x => x.ToLower() == "install" || x.ToLower() == "uninstall"))
{
container.RegisterSingleton<IScheduler>(() =>
{
IScheduler scheduler = schedulerFactory.GetScheduler();
scheduler.JobFactory = container.GetInstance<IJobFactory>();
return scheduler;
});
}
Func<IScheduler> schedulerFunc = () => container.GetInstance<IScheduler>();
ScheduleJobServiceConfiguratorExtensions.SchedulerFactory = schedulerFunc;
log.Info("[Topshelf.SimpleInjector.Quartz] Quartz configured to construct jobs with SimpleInjector.");
}
}
}
|
using System;
using System.Linq;
using System.Reflection;
using Quartz;
using Quartz.Impl;
using Quartz.Spi;
using SimpleInjector;
using Topshelf.Logging;
using Topshelf.ServiceConfigurators;
using Topshelf.SimpleInjector.Quartz.Factory;
namespace Topshelf.SimpleInjector.Quartz
{
public static class SimpleInjectorScheduleJobServiceConfiguratorExtensions
{
public static ServiceConfigurator<T> UseQuartzSimpleInjector<T>(this ServiceConfigurator<T> configurator)
where T : class
{
SetupQuartzSimpleInjector();
return configurator;
}
internal static void SetupQuartzSimpleInjector()
{
RegisterQuartzInSimpleInjector();
}
internal static void SetupQuartzSimpleInjector(params Assembly[] jobAssemblies)
{
RegisterQuartzInSimpleInjector(jobAssemblies);
}
private static void RegisterQuartzInSimpleInjector(Assembly[] jobAssemblies = null)
{
var log = HostLogger.Get(typeof(SimpleInjectorScheduleJobServiceConfiguratorExtensions));
Container container = SimpleInjectorHostBuilderConfigurator.Container;
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
if (jobAssemblies == null)
{
container.RegisterSingleton<IJobFactory>(new SimpleInjectorJobFactory(container));
}
else
{
container.RegisterSingleton<IJobFactory>(new SimpleInjectorDecoratorJobFactory(container, jobAssemblies));
}
container.RegisterSingleton<ISchedulerFactory>(schedulerFactory);
if (!Environment.GetCommandLineArgs().Any(x => x.ToLower() == "install" || x.ToLower() == "uninstall"))
{
container.RegisterSingleton<IScheduler>(() =>
{
IScheduler scheduler = schedulerFactory.GetScheduler();
scheduler.JobFactory = container.GetInstance<IJobFactory>();
return scheduler;
});
}
Func<IScheduler> schedulerFunc = () => container.GetInstance<IScheduler>();
ScheduleJobServiceConfiguratorExtensions.SchedulerFactory = schedulerFunc;
log.Info("[Topshelf.SimpleInjector.Quartz] Quartz configured to construct jobs with SimpleInjector.");
}
}
}
|
mit
|
C#
|
d7cc1b5f07cee1b8e38c046b7f916eb17c33208b
|
Add Tag property to Node, for user data.
|
drewnoakes/boing
|
Boing/Node.cs
|
Boing/Node.cs
|
namespace Boing
{
public sealed class Node
{
private Vector2f _acceleration;
public string Id { get; private set; }
public float Mass { get; set; }
public float Damping { get; set; }
public bool IsPinned { get; set; }
public object Tag { get; set; }
public Vector2f Position { get; private set; }
public Vector2f Velocity { get; private set; }
public Node(string id, float mass = 1.0f, float damping = 0.5f)
{
Id = id;
Mass = mass;
Damping = damping;
Position = Vector2f.Random();
}
public void ApplyForce(Vector2f force)
{
// Accumulate acceleration
_acceleration += force/Mass;
}
public void Update(float dt)
{
// Update velocity
Velocity += _acceleration*dt;
Velocity *= Damping;
// Update position
Position += Velocity*dt;
// Clear acceleration
_acceleration = Vector2f.Zero;
}
}
}
|
namespace Boing
{
public sealed class Node
{
private Vector2f _acceleration;
public string Id { get; private set; }
public float Mass { get; set; }
public float Damping { get; set; }
public bool IsPinned { get; set; }
public Vector2f Position { get; private set; }
public Vector2f Velocity { get; private set; }
public Node(string id, float mass = 1.0f, float damping = 0.5f)
{
Id = id;
Mass = mass;
Damping = damping;
Position = Vector2f.Random();
}
public void ApplyForce(Vector2f force)
{
// Accumulate acceleration
_acceleration += force/Mass;
}
public void Update(float dt)
{
// Update velocity
Velocity += _acceleration*dt;
Velocity *= Damping;
// Update position
Position += Velocity*dt;
// Clear acceleration
_acceleration = Vector2f.Zero;
}
}
}
|
apache-2.0
|
C#
|
72b45be365c802d6b71507ea1d6e9cf0bc0ebc71
|
Fix unit test
|
jeroenverh/teamleader-dotnet
|
src/TeamleaderDotNet.Tests/ThrottlerTests.cs
|
src/TeamleaderDotNet.Tests/ThrottlerTests.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TeamleaderDotNet.Common;
namespace TeamleaderDotNet.Tests
{
[TestClass]
public class ThrottlerTests
{
[TestMethod]
public void ExecuteShould()
{
var executedTasks = 0;
var startTime = DateTime.Now;
for (int i = 0; i < 26; i++)
{
executedTasks = Throttler.ExecuteTask(() => executedTasks+1);
}
Assert.IsTrue(executedTasks == 26);
Assert.IsTrue(DateTime.Now> startTime.Add(TimeSpan.FromSeconds(5)));
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TeamleaderDotNet.Common;
namespace TeamleaderDotNet.Tests
{
[TestClass]
public class ThrottlerTests
{
[TestMethod]
public void ExecuteShould()
{
var executedTasks = 0;
var startTime = DateTime.Now;
for (int i = 0; i < 7; i++)
{
executedTasks = Throttler.ExecuteTask(() => executedTasks+1);
}
Assert.IsTrue(executedTasks == 7);
Assert.IsTrue(DateTime.Now> startTime.Add(TimeSpan.FromSeconds(25)));
}
}
}
|
mit
|
C#
|
9252aaa9f989b389446fad9495a2af758c7606bc
|
Remove unnecessary property initialization.
|
Cimpress-MCP/dotnet-core-httputils
|
src/Cimpress.Extensions.Http.Caching.Abstractions/CacheData.cs
|
src/Cimpress.Extensions.Http.Caching.Abstractions/CacheData.cs
|
using System.Collections.Generic;
using System.Net.Http;
namespace Cimpress.Extensions.Http.Caching.Abstractions
{
/// <summary>
/// The data object that is used to put into the cache.
/// </summary>
public class CacheData
{
public CacheData(byte[] data, HttpResponseMessage cachableResponse, Dictionary<string, IEnumerable<string>> headers, Dictionary<string, IEnumerable<string>> contentHeaders)
{
Data = data;
CachableResponse = cachableResponse;
Headers = headers;
ContentHeaders = contentHeaders;
}
/// <summary>
/// The cachable part of a previously retrieved response (excludes the content and request).
/// </summary>
public HttpResponseMessage CachableResponse { get; }
/// <summary>
/// The content of the response.
/// </summary>
public byte[] Data { get; }
/// <summary>
/// the headers of the response.
/// </summary>
public Dictionary<string, IEnumerable<string>> Headers { get; }
/// <summary>
/// The content headers of the response.
/// </summary>
public Dictionary<string, IEnumerable<string>> ContentHeaders { get; }
}
}
|
using System.Collections.Generic;
using System.Net.Http;
namespace Cimpress.Extensions.Http.Caching.Abstractions
{
/// <summary>
/// The data object that is used to put into the cache.
/// </summary>
public class CacheData
{
public CacheData(byte[] data, HttpResponseMessage cachableResponse, Dictionary<string, IEnumerable<string>> headers, Dictionary<string, IEnumerable<string>> contentHeaders)
{
Data = data;
CachableResponse = cachableResponse;
Headers = headers;
ContentHeaders = contentHeaders;
}
/// <summary>
/// The cachable part of a previously retrieved response (excludes the content and request).
/// </summary>
public HttpResponseMessage CachableResponse { get; }
/// <summary>
/// The content of the response.
/// </summary>
public byte[] Data { get; }
/// <summary>
/// the headers of the response.
/// </summary>
public Dictionary<string, IEnumerable<string>> Headers { get; } = new Dictionary<string, IEnumerable<string>>();
/// <summary>
/// The content headers of the response.
/// </summary>
public Dictionary<string, IEnumerable<string>> ContentHeaders { get; } = new Dictionary<string, IEnumerable<string>>();
}
}
|
apache-2.0
|
C#
|
e3e29a9c3d4a8346a60fc6cff9ae7009fe990ad8
|
Fix bug: Searching too fast in dialog returns no results when enter is pressed Work items: 598
|
mdavid/nuget,mdavid/nuget
|
src/Dialog/PackageManagerUI/BaseProvider/PackagesSearchNode.cs
|
src/Dialog/PackageManagerUI/BaseProvider/PackagesSearchNode.cs
|
using System;
using System.Linq;
using Microsoft.VisualStudio.ExtensionsExplorer;
namespace NuGet.Dialog.Providers {
internal class PackagesSearchNode : PackagesTreeNodeBase {
private string _searchText;
private readonly PackagesTreeNodeBase _baseNode;
public PackagesTreeNodeBase BaseNode {
get {
return _baseNode;
}
}
public PackagesSearchNode(PackagesProviderBase provider, IVsExtensionsTreeNode parent, PackagesTreeNodeBase baseNode, string searchText) :
base(parent, provider) {
if (baseNode == null) {
throw new ArgumentNullException("baseNode");
}
_searchText = searchText;
_baseNode = baseNode;
// Mark this node as a SearchResults node to assist navigation in ExtensionsExplorer
IsSearchResultsNode = true;
}
public override string Name {
get {
return Resources.Dialog_RootNodeSearch;
}
}
public void SetSearchText(string newSearchText) {
if (newSearchText == null) {
throw new ArgumentNullException("newSearchText");
}
_searchText = newSearchText;
if (IsSelected) {
ResetQuery();
LoadPage(1);
}
}
public override IQueryable<IPackage> GetPackages() {
return _baseNode.GetPackages().Find(_searchText);
}
}
}
|
using System;
using System.Linq;
using Microsoft.VisualStudio.ExtensionsExplorer;
namespace NuGet.Dialog.Providers {
internal class PackagesSearchNode : PackagesTreeNodeBase {
private string _searchText;
private readonly PackagesTreeNodeBase _baseNode;
public PackagesTreeNodeBase BaseNode {
get {
return _baseNode;
}
}
public PackagesSearchNode(PackagesProviderBase provider, IVsExtensionsTreeNode parent, PackagesTreeNodeBase baseNode, string searchText) :
base(parent, provider) {
if (baseNode == null) {
throw new ArgumentNullException("baseNode");
}
_searchText = searchText;
_baseNode = baseNode;
// Mark this node as a SearchResults node to assist navigation in ExtensionsExplorer
IsSearchResultsNode = true;
}
public override string Name {
get {
return Resources.Dialog_RootNodeSearch;
}
}
public void SetSearchText(string newSearchText) {
if (newSearchText == null) {
throw new ArgumentNullException("newSearchText");
}
if (_searchText != newSearchText) {
_searchText = newSearchText;
if (IsSelected) {
ResetQuery();
LoadPage(1);
}
}
}
public override IQueryable<IPackage> GetPackages() {
return _baseNode.GetPackages().Find(_searchText);
}
}
}
|
apache-2.0
|
C#
|
bce7d84906325e9c5a26039ebe3f94c9dcea22c8
|
Fix cart count when the same album is added to the cart multiple times (#765)
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
samples/MusicStore/Components/CartSummaryComponent.cs
|
samples/MusicStore/Components/CartSummaryComponent.cs
|
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MusicStore.Models;
namespace MusicStore.Components
{
[ViewComponent(Name = "CartSummary")]
public class CartSummaryComponent : ViewComponent
{
public CartSummaryComponent(MusicStoreContext dbContext)
{
DbContext = dbContext;
}
private MusicStoreContext DbContext { get; }
public async Task<IViewComponentResult> InvokeAsync()
{
var cart = ShoppingCart.GetCart(DbContext, HttpContext);
var cartItems = await cart.GetCartItems();
ViewBag.CartCount = cartItems.Sum(c => c.Count);
ViewBag.CartSummary = string.Join("\n", cartItems.Select(c => c.Album.Title).Distinct());
return View();
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MusicStore.Models;
namespace MusicStore.Components
{
[ViewComponent(Name = "CartSummary")]
public class CartSummaryComponent : ViewComponent
{
public CartSummaryComponent(MusicStoreContext dbContext)
{
DbContext = dbContext;
}
private MusicStoreContext DbContext { get; }
public async Task<IViewComponentResult> InvokeAsync()
{
var cart = ShoppingCart.GetCart(DbContext, HttpContext);
var cartItems = await cart.GetCartAlbumTitles();
ViewBag.CartCount = cartItems.Count;
ViewBag.CartSummary = string.Join("\n", cartItems.Distinct());
return View();
}
}
}
|
apache-2.0
|
C#
|
9692ca37e696c3fa2c97222d27e28a6e6ffd2e6b
|
fix build
|
furore-fhir/spark,furore-fhir/spark,furore-fhir/spark
|
src/Spark/App_Start/UnityConfig.cs
|
src/Spark/App_Start/UnityConfig.cs
|
using Hl7.Fhir.Model;
using Microsoft.Practices.Unity;
using Spark.Controllers;
using Spark.Core;
using Spark.Engine.Core;
using Spark.Models;
using Spark.Mongo.Search.Common;
using Spark.Service;
using Spark.Store.Mongo;
using System.Web.Http;
using System.Web.Mvc;
using Microsoft.AspNet.SignalR;
using Unity.WebApi;
namespace Spark
{
public static class UnityConfig
{
public static void RegisterComponents()
{
var container = new UnityContainer();
container.RegisterType<HomeController, HomeController>(new PerResolveLifetimeManager(),
new InjectionConstructor(Settings.MongoUrl));
container.RegisterType<IServiceListener, ServiceListener>(new ContainerControlledLifetimeManager());
container.RegisterType<ILocalhost, Localhost>(new ContainerControlledLifetimeManager(),
new InjectionConstructor(Settings.Endpoint));
container.RegisterType<MongoFhirStore, MongoFhirStore>(new ContainerControlledLifetimeManager(),
new InjectionConstructor(Settings.MongoUrl));
container.RegisterType<IFhirStore, MongoFhirStore>(new ContainerControlledLifetimeManager());
container.RegisterType<IGenerator, MongoFhirStore>(new ContainerControlledLifetimeManager());
container.RegisterType<ISnapshotStore, MongoFhirStore>(new ContainerControlledLifetimeManager());
container.RegisterType<MongoIndexStore, MongoIndexStore>(new ContainerControlledLifetimeManager(),
new InjectionConstructor(Settings.MongoUrl));
container.RegisterInstance<Definitions>(DefinitionsFactory.Generate(ModelInfo.SearchParameters));
//TODO: Use FhirModel instead of ModelInfo
container.RegisterType<IFhirIndex, MongoFhirIndex>(new ContainerControlledLifetimeManager());
// register all your components with the container here
// it is NOT necessary to register your controllers
// e.g. container.RegisterType<ITestService, TestService>();
IControllerFactory unityControllerFactory = new UnityControllerFactory(container);
ControllerBuilder.Current.SetControllerFactory(unityControllerFactory);
GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
GlobalHost.DependencyResolver = new SignalRUnityDependencyResolver(container);
}
}
}
|
using Hl7.Fhir.Model;
using Microsoft.Practices.Unity;
using Spark.Controllers;
using Spark.Core;
using Spark.Engine.Core;
using Spark.Models;
using Spark.Mongo.Search.Common;
using Spark.Service;
using Spark.Store.Mongo;
using System.Web.Http;
using System.Web.Mvc;
using Microsoft.AspNet.SignalR;
using Unity.WebApi;
namespace Spark
{
public static class UnityConfig
{
public static void RegisterComponents(HttpConfiguration config)
{
var container = new UnityContainer();
container.RegisterType<HomeController, HomeController>(new PerResolveLifetimeManager(),
new InjectionConstructor(Settings.MongoUrl));
container.RegisterType<IServiceListener, ServiceListener>(new ContainerControlledLifetimeManager());
container.RegisterType<ILocalhost, Localhost>(new ContainerControlledLifetimeManager(),
new InjectionConstructor(Settings.Endpoint));
container.RegisterType<MongoFhirStore, MongoFhirStore>(new ContainerControlledLifetimeManager(),
new InjectionConstructor(Settings.MongoUrl));
container.RegisterType<IFhirStore, MongoFhirStore>(new ContainerControlledLifetimeManager());
container.RegisterType<IGenerator, MongoFhirStore>(new ContainerControlledLifetimeManager());
container.RegisterType<ISnapshotStore, MongoFhirStore>(new ContainerControlledLifetimeManager());
container.RegisterType<MongoIndexStore, MongoIndexStore>(new ContainerControlledLifetimeManager(),
new InjectionConstructor(Settings.MongoUrl));
container.RegisterInstance<Definitions>(DefinitionsFactory.Generate(ModelInfo.SearchParameters));
//TODO: Use FhirModel instead of ModelInfo
container.RegisterType<IFhirIndex, MongoFhirIndex>(new ContainerControlledLifetimeManager());
// register all your components with the container here
// it is NOT necessary to register your controllers
// e.g. container.RegisterType<ITestService, TestService>();
IControllerFactory unityControllerFactory = new UnityControllerFactory(container);
ControllerBuilder.Current.SetControllerFactory(unityControllerFactory);
GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
GlobalHost.DependencyResolver = new SignalRUnityDependencyResolver(container);
}
}
}
|
bsd-3-clause
|
C#
|
82556adb7148d5bb83061953b0d15fae84cf1d8e
|
Make generic for local and production
|
Azure/azure-webjobs-sdk,Azure/azure-webjobs-sdk
|
src/Microsoft.Azure.WebJobs.Extensions.Storage/StorageAccountProvider.cs
|
src/Microsoft.Azure.WebJobs.Extensions.Storage/StorageAccountProvider.cs
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Configuration;
namespace Microsoft.Azure.WebJobs
{
/// <summary>
/// Abstraction to provide storage accounts from the connection names.
/// This gets the storage account name via the binding attribute's <see cref="IConnectionProvider.Connection"/>
/// property.
/// If the connection is not specified on the attribute, it uses a default account.
/// </summary>
public class StorageAccountProvider
{
private readonly IConfiguration _configuration;
public StorageAccountProvider(IConfiguration configuration)
{
_configuration = configuration;
}
public StorageAccount Get(string name, INameResolver resolver)
{
var resolvedName = resolver.ResolveWholeString(name);
return this.Get(resolvedName);
}
public virtual StorageAccount Get(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
name = ConnectionStringNames.Storage; // default
}
// $$$ Where does validation happen?
string connectionString = _configuration.GetWebJobsConnectionString(name);
if (connectionString == null)
{
// Not found
throw new InvalidOperationException($"Storage account connection string '{name}' does not exist. Make sure that it a defined App Setting.");
}
return StorageAccount.NewFromConnectionString(connectionString);
}
/// <summary>
/// The host account is for internal storage mechanisms like load balancer queuing.
/// </summary>
/// <returns></returns>
public virtual StorageAccount GetHost()
{
return this.Get(null);
}
}
}
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Configuration;
namespace Microsoft.Azure.WebJobs
{
/// <summary>
/// Abstraction to provide storage accounts from the connection names.
/// This gets the storage account name via the binding attribute's <see cref="IConnectionProvider.Connection"/>
/// property.
/// If the connection is not specified on the attribute, it uses a default account.
/// </summary>
public class StorageAccountProvider
{
private readonly IConfiguration _configuration;
public StorageAccountProvider(IConfiguration configuration)
{
_configuration = configuration;
}
public StorageAccount Get(string name, INameResolver resolver)
{
var resolvedName = resolver.ResolveWholeString(name);
return this.Get(resolvedName);
}
public virtual StorageAccount Get(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
name = ConnectionStringNames.Storage; // default
}
// $$$ Where does validation happen?
string connectionString = _configuration.GetWebJobsConnectionString(name);
if (connectionString == null)
{
// Not found
throw new InvalidOperationException($"Storage account connection string '{name}' does not exist. Make sure that it is defined in application settings.");
}
return StorageAccount.NewFromConnectionString(connectionString);
}
/// <summary>
/// The host account is for internal storage mechanisms like load balancer queuing.
/// </summary>
/// <returns></returns>
public virtual StorageAccount GetHost()
{
return this.Get(null);
}
}
}
|
mit
|
C#
|
64b51a0a2e23b31cf49d1b93ca58a0c95cae3069
|
Update AssemblyInfoCommon.cs
|
ABTSoftware/SciChart.Xamarin.Examples
|
AssemblyInfoCommon.cs
|
AssemblyInfoCommon.cs
|
// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2017. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// AssemblyInfoCommon.cs is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
// *************************************************************************************
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("SciChart Ltd")]
[assembly: AssemblyCopyright("Copyright © SciChart Ltd 2011-2022, www.scichart.com")]
[assembly: AssemblyTrademark("SCICHART™")]
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("PublicPrivateKeyFile.snk")]
// 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("4.4.0.4571")]
|
// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2017. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// AssemblyInfoCommon.cs is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
// *************************************************************************************
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("SciChart Ltd")]
[assembly: AssemblyCopyright("Copyright © SciChart Ltd 2011-2017, www.scichart.com")]
[assembly: AssemblyTrademark("SCICHART™")]
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("PublicPrivateKeyFile.snk")]
// 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("2.0.0.461")]
|
mit
|
C#
|
775749c535e6bb8352ec6db1864131336b39c023
|
Fix grammar in documentation
|
ashfordl/cards
|
CardGames/GameInfo.cs
|
CardGames/GameInfo.cs
|
// GameInfo.cs
// <copyright file="GameInfo.cs"> This code is protected under the MIT License. </copyright>
using System.Collections.Generic;
using CardsLibrary;
namespace CardGames
{
/// <summary>
/// An object to represent game data to pass to player classes.
/// </summary>
public class GameInfo
{
/// <summary>
/// The internal value of AceHigh.
/// </summary>
private bool aceHigh;
/// <summary>
/// Gets or sets the current round number.
/// </summary>
public int RoundNumber { get; set; }
/// <summary>
/// Gets or sets the current cards in play.
/// </summary>
public List<Card> CardsInPlay { get; set; }
/// <summary>
/// Gets or sets a value indicating whether aces are high.
/// </summary>
public bool AceHigh
{
get
{
return this.aceHigh;
}
set
{
this.aceHigh = value;
Settings.AceHigh = value;
}
}
}
}
|
// GameInfo.cs
// <copyright file="GameInfo.cs"> This code is protected under the MIT License. </copyright>
using System.Collections.Generic;
using CardsLibrary;
namespace CardGames
{
/// <summary>
/// An object to represent game data to pass to player classes.
/// </summary>
public class GameInfo
{
/// <summary>
/// The internal value of AceHigh.
/// </summary>
private bool aceHigh;
/// <summary>
/// Gets or sets the current round number.
/// </summary>
public int RoundNumber { get; set; }
/// <summary>
/// Gets or sets the current cards in play.
/// </summary>
public List<Card> CardsInPlay { get; set; }
/// <summary>
/// Gets or sets a value indicating whether ace is high.
/// </summary>
public bool AceHigh
{
get
{
return this.aceHigh;
}
set
{
this.aceHigh = value;
Settings.AceHigh = value;
}
}
}
}
|
mit
|
C#
|
fc7152bf25ad3862e22f604f98acaedbf7caf55f
|
Add new file Droid/MainActivity.cs
|
ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl
|
Droid/MainActivity.cs
|
Droid/MainActivity.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace userAuth.cpl.Droid
{
[Activity (Label = "userAuth.cpl.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = Android.Content.PM.ConfigChanges.Density | Android.Content.PM.ConfigChanges.Touchscreen)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.ActivityIndicatorRenderer
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
global::Xamarin.Forms.Forms.Init (this, bundle);
LoadApplication (new App ());
// Create your application here
const SystemProperty_init_ == class {
dynamic void SystemProperty (Reference reference[ref])
{
method.constructor[Args:0];
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace userAuth.cpl.Droid
{
[Activity (Label = "userAuth.cpl.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = Android.Content.PM.ConfigChanges.Density | Android.Content.PM.ConfigChanges.Touchscreen)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.ActivityIndicatorRenderer
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
global::Xamarin.Forms.Forms.Init (this, bundle);
LoadApplication (new App ());
// Create your apponlication here
}
}
}
|
mit
|
C#
|
b34752e67dda31acb2c8a04a133127d2ed68d998
|
make all route params required
|
0xFireball/KQAnalytics3,0xFireball/KQAnalytics3,0xFireball/KQAnalytics3
|
KQAnalytics3/src/KQAnalytics3/Modules/Api/Query/TagRequestQueryModule.cs
|
KQAnalytics3/src/KQAnalytics3/Modules/Api/Query/TagRequestQueryModule.cs
|
using KQAnalytics3.Configuration.Access;
using KQAnalytics3.Services.Authentication;
using KQAnalytics3.Services.Authentication.Security;
using KQAnalytics3.Services.DataCollection;
using KQAnalytics3.Utilities;
using Nancy;
namespace KQAnalytics3.Modules.Api.Query
{
public class TagRequestQueryModule : NancyModule
{
public TagRequestQueryModule() : base("/api")
{
this.RequiresAllClaims(ClientApiAccessValidator.GetAccessClaimListFromScopes(new[] {
ApiAccessScope.Read,
ApiAccessScope.QueryTagRequests
}), ClientApiAccessValidator.GetAccessClaim(ApiAccessScope.Admin));
// Query Tagged Requests
// Tag is the tag to filter by
// Limit is the max number of log requests to return
Get("/query/tagged/{tags}/{limit:int}", async args =>
{
var itemLimit = args.limit as int? ?? 100;
var filterTags = (args.tags != null) ? ((string)args.tags).Split(',') : null;
var data = await DataLoggerService.QueryTaggedRequestsAsync(itemLimit, filterTags);
return Response.AsJsonNet(data);
});
}
}
}
|
using KQAnalytics3.Configuration.Access;
using KQAnalytics3.Services.Authentication;
using KQAnalytics3.Services.Authentication.Security;
using KQAnalytics3.Services.DataCollection;
using KQAnalytics3.Utilities;
using Nancy;
namespace KQAnalytics3.Modules.Api.Query
{
public class TagRequestQueryModule : NancyModule
{
public TagRequestQueryModule() : base("/api")
{
this.RequiresAllClaims(ClientApiAccessValidator.GetAccessClaimListFromScopes(new[] {
ApiAccessScope.Read,
ApiAccessScope.QueryTagRequests
}), ClientApiAccessValidator.GetAccessClaim(ApiAccessScope.Admin));
// Query Tagged Requests
// Tag is the tag to filter by
// Limit is the max number of log requests to return. Default 100
Get("/query/tagged/{tags?}/{limit:int?}", async args =>
{
var itemLimit = args.limit as int? ?? 100;
var filterTags = (args != null) ? ((string)args.tags).Split(',') : null;
var data = await DataLoggerService.QueryTaggedRequestsAsync(itemLimit, filterTags);
return Response.AsJsonNet(data);
});
}
}
}
|
agpl-3.0
|
C#
|
29c723ebc94814d68d050c06f5a6233d732c0800
|
Allow PlatformSpecific on a class
|
weshaggard/buildtools,karajas/buildtools,ianhays/buildtools,FiveTimesTheFun/buildtools,MattGal/buildtools,joperezr/buildtools,maririos/buildtools,karajas/buildtools,joperezr/buildtools,maririos/buildtools,tarekgh/buildtools,alexperovich/buildtools,schaabs/buildtools,roncain/buildtools,roncain/buildtools,roncain/buildtools,ChadNedzlek/buildtools,dotnet/buildtools,jhendrixMSFT/buildtools,ianhays/buildtools,tarekgh/buildtools,ericstj/buildtools,maririos/buildtools,MattGal/buildtools,naamunds/buildtools,crummel/dotnet_buildtools,chcosta/buildtools,stephentoub/buildtools,tarekgh/buildtools,ianhays/buildtools,weshaggard/buildtools,venkat-raman251/buildtools,alexperovich/buildtools,ericstj/buildtools,karajas/buildtools,chcosta/buildtools,alexperovich/buildtools,naamunds/buildtools,AlexGhiondea/buildtools,dotnet/buildtools,crummel/dotnet_buildtools,nguerrera/buildtools,pgavlin/buildtools,JeremyKuhne/buildtools,crummel/dotnet_buildtools,nguerrera/buildtools,ChadNedzlek/buildtools,schaabs/buildtools,crummel/dotnet_buildtools,MattGal/buildtools,weshaggard/buildtools,jthelin/dotnet-buildtools,AlexGhiondea/buildtools,mmitche/buildtools,joperezr/buildtools,jthelin/dotnet-buildtools,schaabs/buildtools,naamunds/buildtools,AlexGhiondea/buildtools,MattGal/buildtools,stephentoub/buildtools,jhendrixMSFT/buildtools,MattGal/buildtools,jthelin/dotnet-buildtools,mmitche/buildtools,ChadNedzlek/buildtools,ericstj/buildtools,karajas/buildtools,nguerrera/buildtools,dotnet/buildtools,venkat-raman251/buildtools,tarekgh/buildtools,joperezr/buildtools,weshaggard/buildtools,JeremyKuhne/buildtools,JeremyKuhne/buildtools,ericstj/buildtools,alexperovich/buildtools,stephentoub/buildtools,jthelin/dotnet-buildtools,JeremyKuhne/buildtools,naamunds/buildtools,nguerrera/buildtools,schaabs/buildtools,jhendrixMSFT/buildtools,dotnet/buildtools,stephentoub/buildtools,mmitche/buildtools,alexperovich/buildtools,mmitche/buildtools,ianhays/buildtools,maririos/buildtools,tarekgh/buildtools,mmitche/buildtools,chcosta/buildtools,roncain/buildtools,jhendrixMSFT/buildtools,chcosta/buildtools,AlexGhiondea/buildtools,ChadNedzlek/buildtools,joperezr/buildtools
|
src/xunit.netcore.extensions/Attributes/PlatformSpecificAttribute.cs
|
src/xunit.netcore.extensions/Attributes/PlatformSpecificAttribute.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Xunit.Sdk;
namespace Xunit
{
/// <summary>
/// Apply this attribute to your test method to specify this is a platform specific test.
/// </summary>
[TraitDiscoverer("Xunit.NetCore.Extensions.PlatformSpecificDiscoverer", "Xunit.NetCore.Extensions")]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
public class PlatformSpecificAttribute : Attribute, ITraitAttribute
{
public PlatformSpecificAttribute(PlatformID platform) { }
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Xunit.Sdk;
namespace Xunit
{
/// <summary>
/// Apply this attribute to your test method to specify this is a platform specific test.
/// </summary>
[TraitDiscoverer("Xunit.NetCore.Extensions.PlatformSpecificDiscoverer", "Xunit.NetCore.Extensions")]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class PlatformSpecificAttribute : Attribute, ITraitAttribute
{
public PlatformSpecificAttribute(PlatformID platform) { }
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.