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 |
---|---|---|---|---|---|---|---|---|
3b13ad480af5afa7f0fe15c300a5e02bcf0fb4d7
|
Increase fade-out time of hitobjects in the editor
|
EVAST9919/osu,peppy/osu,2yangk23/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,johnneijzen/osu,ppy/osu,UselessToucan/osu,ppy/osu,peppy/osu,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu,johnneijzen/osu,ppy/osu,UselessToucan/osu,EVAST9919/osu,2yangk23/osu,peppy/osu-new
|
osu.Game.Rulesets.Osu/Edit/DrawableOsuEditRuleset.cs
|
osu.Game.Rulesets.Osu/Edit/DrawableOsuEditRuleset.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Osu.Edit
{
public class DrawableOsuEditRuleset : DrawableOsuRuleset
{
public DrawableOsuEditRuleset(Ruleset ruleset, IWorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
: base(ruleset, beatmap, mods)
{
}
public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h)
=> base.CreateDrawableRepresentation(h)?.With(d => d.ApplyCustomUpdateState += updateState);
private void updateState(DrawableHitObject hitObject, ArmedState state)
{
switch (state)
{
case ArmedState.Miss:
// Get the existing fade out transform
var existing = hitObject.Transforms.LastOrDefault(t => t.TargetMember == nameof(Alpha));
if (existing == null)
return;
using (hitObject.BeginAbsoluteSequence(existing.StartTime))
hitObject.FadeOut(500).Expire();
break;
}
}
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor();
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { Size = Vector2.One };
private class OsuPlayfieldNoCursor : OsuPlayfield
{
protected override GameplayCursorContainer CreateCursor() => 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 System.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Osu.Edit
{
public class DrawableOsuEditRuleset : DrawableOsuRuleset
{
public DrawableOsuEditRuleset(Ruleset ruleset, IWorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
: base(ruleset, beatmap, mods)
{
}
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor();
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { Size = Vector2.One };
private class OsuPlayfieldNoCursor : OsuPlayfield
{
protected override GameplayCursorContainer CreateCursor() => null;
}
}
}
|
mit
|
C#
|
7edf87619cd9342dcce2ee3d6ee34bb858c58018
|
Return type T for metadata scalars.
|
ecologylab/BigSemanticsCSharp
|
ecologylabSemantics/ecologylab/semantics/metadata/scalar/MetadataScalars.cs
|
ecologylabSemantics/ecologylab/semantics/metadata/scalar/MetadataScalars.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ecologylab.semantics.metadata.scalar
{
abstract public class MetadataScalarBase<T>
{
public T value;
public static String VALUE_FIELD_NAME = "value";
public MetadataScalarBase()
{
}
public MetadataScalarBase(object value)
{
this.value = (T) value;
}
public T Value
{
get { return value; }
set { this.value = (T)value; }
}
public override String ToString()
{
return value == null ? "null" : value.ToString();
}
}
public class MetadataString : MetadataScalarBase<String>
{
public MetadataString(){}
//The termvector stuff goes here !
/// <summary>
///
/// </summary>
/// <param name="value"></param>
public MetadataString(object value):base(value)
{}
}
public class MetadataInteger : MetadataScalarBase<int>
{
public MetadataInteger(){}
public MetadataInteger(object value):base(value)
{}
}
public class MetadataParsedURL : MetadataScalarBase<Uri>
{
public MetadataParsedURL(){}
public MetadataParsedURL(object value):base(value)
{}
}
public class MetadataDate : MetadataScalarBase<DateTime>
{
public MetadataDate(){}
public MetadataDate(object value):base(value)
{}
}
public class MetadataStringBuilder : MetadataScalarBase<StringBuilder>
{
public MetadataStringBuilder(){}
public MetadataStringBuilder(object value):base(value)
{}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ecologylab.semantics.metadata.scalar
{
abstract public class MetadataScalarBase<T>
{
public T value;
public static String VALUE_FIELD_NAME = "value";
public MetadataScalarBase()
{
}
public MetadataScalarBase(object value)
{
this.value = (T) value;
}
public object Value
{
get { return value; }
set { this.value = (T)value; }
}
public override String ToString()
{
return value == null ? "null" : value.ToString();
}
}
public class MetadataString : MetadataScalarBase<String>
{
public MetadataString(){}
//The termvector stuff goes here !
/// <summary>
///
/// </summary>
/// <param name="value"></param>
public MetadataString(object value):base(value)
{}
}
public class MetadataInteger : MetadataScalarBase<int>
{
public MetadataInteger(){}
public MetadataInteger(object value):base(value)
{}
}
public class MetadataParsedURL : MetadataScalarBase<Uri>
{
public MetadataParsedURL(){}
public MetadataParsedURL(object value):base(value)
{}
}
public class MetadataDate : MetadataScalarBase<DateTime>
{
public MetadataDate(){}
public MetadataDate(object value):base(value)
{}
}
public class MetadataStringBuilder : MetadataScalarBase<StringBuilder>
{
public MetadataStringBuilder(){}
public MetadataStringBuilder(object value):base(value)
{}
}
}
|
apache-2.0
|
C#
|
844e87aafeb7cfc7ef43066222dd21f0e39fc242
|
Use the true head position rather than capturing current position
|
peppy/osu,peppy/osu-new,UselessToucan/osu,naoey/osu,smoogipoo/osu,naoey/osu,Frontear/osuKyzer,johnneijzen/osu,DrabWeb/osu,Nabile-Rahmani/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,smoogipooo/osu,peppy/osu,2yangk23/osu,ppy/osu,EVAST9919/osu,ppy/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,UselessToucan/osu,2yangk23/osu,naoey/osu,ZLima12/osu,DrabWeb/osu,DrabWeb/osu,EVAST9919/osu,ZLima12/osu,ppy/osu,NeoAdonis/osu,johnneijzen/osu
|
osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleOverlay.cs
|
osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleOverlay.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 osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit.Layers.Selection;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
{
public class SliderCircleOverlay : HitObjectOverlay
{
public SliderCircleOverlay(DrawableHitCircle sliderHead, DrawableSlider slider)
: this(sliderHead, ((Slider)slider.HitObject).StackedPositionAt(0), slider)
{
}
public SliderCircleOverlay(DrawableSliderTail sliderTail, DrawableSlider slider)
: this(sliderTail, ((Slider)slider.HitObject).Curve.PositionAt(1) + slider.HitObject.StackOffset, slider)
{
}
private SliderCircleOverlay(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider)
: base(hitObject)
{
Origin = Anchor.Centre;
Position = position;
Size = slider.HeadCircle.Size;
Scale = slider.HeadCircle.Scale;
AddInternal(new RingPiece());
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit.Layers.Selection;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
{
public class SliderCircleOverlay : HitObjectOverlay
{
public SliderCircleOverlay(DrawableHitCircle sliderHead, DrawableSlider slider)
: this(sliderHead, sliderHead.Position, slider)
{
}
public SliderCircleOverlay(DrawableSliderTail sliderTail, DrawableSlider slider)
: this(sliderTail, ((Slider)slider.HitObject).Curve.PositionAt(1) + slider.HitObject.StackOffset, slider)
{
}
private SliderCircleOverlay(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider)
: base(hitObject)
{
Origin = Anchor.Centre;
Position = position;
Size = slider.HeadCircle.Size;
Scale = slider.HeadCircle.Scale;
AddInternal(new RingPiece());
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
}
}
|
mit
|
C#
|
69d4dd90260d5ee3647aad1ebc85a6b67e395147
|
Fix bug
|
syuilo/Misq
|
Misq/App.cs
|
Misq/App.cs
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Misq
{
/// <summary>
/// Misskeyアプリクラス
/// </summary>
public class App
{
/// <summary>
/// アプリケーションのシークレット・キーを取得または設定します。
/// </summary>
public string Secret
{
get;
set;
}
/// <summary>
/// Appインスタンスを初期化します。
/// </summary>
/// <param name="secret">アプリケーションのシークレットキー</param>
public App(string secret)
{
this.Secret = secret;
}
/// <summary>
/// 認証セッションを開始し、フォームを既定のブラウザーで表示します。
/// </summary>
/// <returns>ユーザーが認証を終えたことを通知するハンドラ</returns>
public async Task<Func<Task<Me>>> Authorize()
{
var obj = await this.Request("auth/session/generate");
var token = obj.token.Value;
var url = obj.url.Value;
// 規定のブラウザで表示
System.Diagnostics.Process.Start(url);
return async () =>
{
var obj2 = await this.Request("auth/session/userkey", new Dictionary<string, string> {
{ "token", token }
});
var accessToken = obj2.access_token.Value;
var userData = obj2.user;
return new Me(accessToken, this.Secret, userData);
};
}
/// <summary>
/// このアプリからAPIにリクエストします。
/// </summary>
/// <param name="endpoint">エンドポイント名</param>
/// <returns>レスポンス</returns>
public async Task<dynamic> Request(string endpoint)
{
return await Core.Request(endpoint, new Dictionary<string, string> {
{ "app_secret", this.Secret }
});
}
/// <summary>
/// このアプリからAPIにリクエストします。
/// </summary>
/// <param name="endpoint">エンドポイント名</param>
/// <param name="ps">パラメーター</param>
/// <returns>レスポンス</returns>
public async Task<dynamic> Request(string endpoint, Dictionary<string, string> ps)
{
ps.Add("app_secret", this.Secret);
return await Core.Request(endpoint, ps);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Misq
{
/// <summary>
/// Misskeyアプリクラス
/// </summary>
public class App
{
/// <summary>
/// アプリケーションのシークレット・キーを取得または設定します。
/// </summary>
public string Secret
{
get;
set;
}
/// <summary>
/// Appインスタンスを初期化します。
/// </summary>
/// <param name="secret">アプリケーションのシークレットキー</param>
public App(string secret)
{
this.Secret = secret;
}
/// <summary>
/// 認証セッションを開始し、フォームを既定のブラウザーで表示します。
/// </summary>
/// <returns>ユーザーが認証を終えたことを通知するハンドラ</returns>
public async Task<Func<Task<Me>>> Authorize()
{
var obj = await this.Request("auth/session/generate");
var token = obj.token.Value;
var url = obj.url.Value;
// 規定のブラウザで表示
System.Diagnostics.Process.Start(url);
return async () =>
{
var obj2 = await this.Request("auth/session/userkey", new Dictionary<string, string> {
{ "token", token }
});
var accessToken = obj2.access_token.Value;
var userData = obj2.user.Value;
return new Me(accessToken, this.Secret, userData);
};
}
/// <summary>
/// このアプリからAPIにリクエストします。
/// </summary>
/// <param name="endpoint">エンドポイント名</param>
/// <returns>レスポンス</returns>
public async Task<dynamic> Request(string endpoint)
{
return await Core.Request(endpoint, new Dictionary<string, string> {
{ "app_secret", this.Secret }
});
}
/// <summary>
/// このアプリからAPIにリクエストします。
/// </summary>
/// <param name="endpoint">エンドポイント名</param>
/// <param name="ps">パラメーター</param>
/// <returns>レスポンス</returns>
public async Task<dynamic> Request(string endpoint, Dictionary<string, string> ps)
{
ps.Add("app_secret", this.Secret);
return await Core.Request(endpoint, ps);
}
}
}
|
mit
|
C#
|
1772a2626814684b8db5e1adf585a8625a615067
|
Change service's start mode to auto
|
mdavid/SuperSocket,mdavid/SuperSocket,mdavid/SuperSocket
|
SocketService/SocketServiceInstaller.cs
|
SocketService/SocketServiceInstaller.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
using System.Configuration;
namespace SuperSocket.SocketService
{
[RunInstaller(true)]
public partial class SocketServiceInstaller : Installer
{
private ServiceInstaller serviceInstaller;
private ServiceProcessInstaller processInstaller;
public SocketServiceInstaller()
{
InitializeComponent();
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"];
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
using System.Configuration;
namespace SuperSocket.SocketService
{
[RunInstaller(true)]
public partial class SocketServiceInstaller : Installer
{
private ServiceInstaller serviceInstaller;
private ServiceProcessInstaller processInstaller;
public SocketServiceInstaller()
{
InitializeComponent();
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.StartType = ServiceStartMode.Manual;
serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"];
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
}
}
|
apache-2.0
|
C#
|
f035b08ff959681cc5edd30fbb6a19de2dbd4a25
|
increment patch version,
|
jwChung/Experimentalism,jwChung/Experimentalism
|
build/CommonAssemblyInfo.cs
|
build/CommonAssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.8.21")]
[assembly: AssemblyInformationalVersion("0.8.21")]
/*
* Version 0.8.21
*
* Refactor to simplify
* - Makes BaseTheoremAttribute and BaseFirstClassTheoremAttribute
* abstract class.
* - Removes all the parameterized constructors of BaseTheoremAttribute
* and BaseFirstClassTheoremAttribute, but instead, introduces
* the abstract method 'CreateTestFixture(MethodInfo)'.
*
* BREAKING CHANGE
* - Delete: ITestFixtureFactory
* - Delete: TypeFixtureFactory
* - Delete: NotSupportedFixture
* - Delete: AutoFixtureFactory
* - Rename: DefaultTheoremAttribute -> BaseTheoremAttribute
* - Rename: DefaultFirstClassTheoremAttribute ->
* BaseFirstClassTheoremAttribute
* - Delete: All the constructors of BaseTheoremAttribute
* and BaseFirstClassTheoremAttribute
* - Delete: FixtureFactory and FixtureType properties of
* BaseTheoremAttribute and BaseFirstClassTheoremAttribute
* - Change: ConvertToTestCommand(IMethodInfo, ITestFixtureFactory) ->
* ConvertToTestCommand(IMethodInfo, Func<MethodInfo, ITestFixture>)
*/
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.8.20")]
[assembly: AssemblyInformationalVersion("0.8.20")]
/*
* Version 0.8.20
*
* This version removes AutoFixture.Xunit dependency from
* Experiment.AutoFixture. Instead, to support the way of customizing fixture
* with attribute using AutoFixture.Xunit, this version uses reflection
* through the `ICustomization GetCustomization(ParameterInfo)` method
* signature.
*/
|
mit
|
C#
|
0f43c9acd793e46bdce28ad64de9d2e62a613e87
|
increment patch version,
|
jwChung/Experimentalism,jwChung/Experimentalism
|
build/CommonAssemblyInfo.cs
|
build/CommonAssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.8.17")]
[assembly: AssemblyInformationalVersion("0.8.17")]
/*
* Version 0.8.17
*
* Experiment.AutoFixture nuget package includes Excperiment.dll
* but does not depend on the Experiment nuget package.
*
* This version does not publish the Experiment nuget package.
*/
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.8.17")]
[assembly: AssemblyInformationalVersion("0.8.17-pre01")]
/*
* Version 0.8.17-pre01
*
* To test publishing
*/
|
mit
|
C#
|
bddda9854a0c8f29f3b55562efd3a4be97f8ff84
|
increment minor version,
|
jwChung/Experimentalism,jwChung/Experimentalism
|
build/CommonAssemblyInfo.cs
|
build/CommonAssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.15.0")]
[assembly: AssemblyInformationalVersion("0.15.0")]
/*
* Version 0.15.0
*
* - [FIX] Slightly improves the message of `HidingReferenceException` in
* `HidingReferenceAssertion`.
*
* - [NEW] Introduces the new `GuardClauseAssertion` class to verify that a
* method or constructor has appropriate Guard Clauses in place.
*
* - [FIX] Lets `ConstructingMemberAssertion` accept only relevant elements.
*
* - [FIX] Deletes the `Verify(Assemlby)` method in `HidingReferenceAssertion`
* and `RestrictingReferenceAssertion` to keep consistency with other
* assertions. Instead use the `AssemblyElement.Accept(IReflectionVisitor<object>)`
* method as the demo below. (BREAKING-CHANGE)
*
* [Fact]
* public void Demo()
* {
* var assertion = new RestrictingReferenceAssertion();
* typeof(IEnumerable<object>).Assembly.ToElement().Accept(assertion);
* }
*/
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.14.0")]
[assembly: AssemblyInformationalVersion("0.14.0")]
/*
* Version 0.15.0
*
* - [FIX] Slightly improves the message of `HidingReferenceException` in
* `HidingReferenceAssertion`.
*
* - [NEW] Introduces the new `GuardClauseAssertion` class to verify that a
* method or constructor has appropriate Guard Clauses in place.
*
* - [FIX] Lets `ConstructingMemberAssertion` accept only relevant elements.
*
* - [FIX] Deletes the `Verify(Assemlby)` method in `HidingReferenceAssertion`
* and `RestrictingReferenceAssertion` to keep consistency with other
* assertions. Instead use the `AssemblyElement.Accept(IReflectionVisitor<object>)`
* method as the demo below. (BREAKING-CHANGE)
*
* [Fact]
* public void Demo()
* {
* var assertion = new RestrictingReferenceAssertion();
* typeof(IEnumerable<object>).Assembly.ToElement().Accept(assertion);
* }
*/
|
mit
|
C#
|
097bd37e37c38095113bd706717a9601afc1f3c0
|
Fix SelectorTab crashing tests after a reload
|
UselessToucan/osu,ppy/osu,NeoAdonis/osu,EVAST9919/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,EVAST9919/osu,UselessToucan/osu,peppy/osu-new,smoogipooo/osu,NeoAdonis/osu,peppy/osu,peppy/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,ppy/osu
|
osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs
|
osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat.Tabs
{
public class ChannelSelectorTabItem : ChannelTabItem
{
public override bool IsRemovable => false;
public override bool IsSwitchable => false;
protected override bool IsBoldWhenActive => false;
public ChannelSelectorTabItem()
: base(new ChannelSelectorTabChannel())
{
Depth = float.MaxValue;
Width = 45;
Icon.Alpha = 0;
Text.Font = Text.Font.With(size: 45);
Text.Truncate = false;
}
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
BackgroundInactive = colour.Gray2;
BackgroundActive = colour.Gray3;
}
public class ChannelSelectorTabChannel : Channel
{
public ChannelSelectorTabChannel()
{
Name = "+";
Type = ChannelType.Temporary;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat.Tabs
{
public class ChannelSelectorTabItem : ChannelTabItem
{
public override bool IsRemovable => false;
public override bool IsSwitchable => false;
protected override bool IsBoldWhenActive => false;
public ChannelSelectorTabItem()
: base(new ChannelSelectorTabChannel())
{
Depth = float.MaxValue;
Width = 45;
Icon.Alpha = 0;
Text.Font = Text.Font.With(size: 45);
Text.Truncate = false;
}
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
BackgroundInactive = colour.Gray2;
BackgroundActive = colour.Gray3;
}
public class ChannelSelectorTabChannel : Channel
{
public ChannelSelectorTabChannel()
{
Name = "+";
}
}
}
}
|
mit
|
C#
|
7ec6ac7b0eb15e88ed18e13889a57ca917e63738
|
Remove unnecessary override
|
NeoAdonis/osu,2yangk23/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,johnneijzen/osu,ZLima12/osu,2yangk23/osu,ppy/osu,ZLima12/osu,smoogipooo/osu,EVAST9919/osu,smoogipoo/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,johnneijzen/osu,UselessToucan/osu,peppy/osu,EVAST9919/osu
|
osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs
|
osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat.Tabs
{
public class ChannelSelectorTabItem : ChannelTabItem
{
public override bool IsRemovable => false;
public override bool IsSwitchable => false;
public ChannelSelectorTabItem()
: base(new ChannelSelectorTabChannel())
{
Depth = float.MaxValue;
Width = 45;
Icon.Alpha = 0;
Text.Font = Text.Font.With(size: 45);
TextBold.Font = Text.Font.With(size: 45);
}
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
BackgroundInactive = colour.Gray2;
BackgroundActive = colour.Gray3;
}
public class ChannelSelectorTabChannel : Channel
{
public ChannelSelectorTabChannel()
{
Name = "+";
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat.Tabs
{
public class ChannelSelectorTabItem : ChannelTabItem
{
public override bool IsRemovable => false;
public override bool IsSwitchable => false;
public ChannelSelectorTabItem()
: base(new ChannelSelectorTabChannel())
{
Depth = float.MaxValue;
Width = 45;
Icon.Alpha = 0;
Text.Font = Text.Font.With(size: 45);
TextBold.Font = Text.Font.With(size: 45);
}
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
BackgroundInactive = colour.Gray2;
BackgroundActive = colour.Gray3;
}
public class ChannelSelectorTabChannel : Channel
{
public ChannelSelectorTabChannel()
{
Name = "+";
}
}
protected override bool OnMouseUp(MouseUpEvent e) => false;
}
}
|
mit
|
C#
|
16b3f22caf2754d97aacbf40f0d429e8b3cecdce
|
Fix incorrect trash icon being used on deleted comments counter
|
peppy/osu,UselessToucan/osu,peppy/osu,smoogipooo/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu-new,NeoAdonis/osu,smoogipoo/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu
|
osu.Game/Overlays/Comments/DeletedCommentsCounter.cs
|
osu.Game/Overlays/Comments/DeletedCommentsCounter.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.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Framework.Graphics.Sprites;
using osuTK;
using osu.Framework.Bindables;
using Humanizer;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Comments
{
public class DeletedCommentsCounter : CompositeDrawable
{
public readonly BindableBool ShowDeleted = new BindableBool();
public readonly BindableInt Count = new BindableInt();
private readonly SpriteText countText;
public DeletedCommentsCounter()
{
AutoSizeAxes = Axes.Both;
InternalChild = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(3, 0),
Children = new Drawable[]
{
new SpriteIcon
{
Icon = FontAwesome.Regular.TrashAlt,
Size = new Vector2(14),
},
countText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold, italics: true),
}
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Count.BindValueChanged(_ => updateDisplay(), true);
ShowDeleted.BindValueChanged(_ => updateDisplay(), true);
}
private void updateDisplay()
{
if (!ShowDeleted.Value && Count.Value != 0)
{
countText.Text = @"deleted comment".ToQuantity(Count.Value);
Show();
}
else
Hide();
}
}
}
|
// 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.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Framework.Graphics.Sprites;
using osuTK;
using osu.Framework.Bindables;
using Humanizer;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Comments
{
public class DeletedCommentsCounter : CompositeDrawable
{
public readonly BindableBool ShowDeleted = new BindableBool();
public readonly BindableInt Count = new BindableInt();
private readonly SpriteText countText;
public DeletedCommentsCounter()
{
AutoSizeAxes = Axes.Both;
InternalChild = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(3, 0),
Children = new Drawable[]
{
new SpriteIcon
{
Icon = FontAwesome.Solid.Trash,
Size = new Vector2(14),
},
countText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold, italics: true),
}
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Count.BindValueChanged(_ => updateDisplay(), true);
ShowDeleted.BindValueChanged(_ => updateDisplay(), true);
}
private void updateDisplay()
{
if (!ShowDeleted.Value && Count.Value != 0)
{
countText.Text = @"deleted comment".ToQuantity(Count.Value);
Show();
}
else
Hide();
}
}
}
|
mit
|
C#
|
12ba19f85876aff8e5ced3dc1f489cc293d61fe4
|
Fix Mediator bug when register is called in base class
|
Esri/coordinate-tool-addin-dotnet
|
source/CoordinateConversion/CoordinateConversionLibrary/Helpers/Mediator.cs
|
source/CoordinateConversion/CoordinateConversionLibrary/Helpers/Mediator.cs
|
// Copyright 2015 Esri
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
namespace CoordinateConversionLibrary.Helpers
{
static public class Mediator
{
static readonly IDictionary<string, List<Action<object>>> pl_dict = new Dictionary<string, List<Action<object>>>();
static public void Register(string token, Action<object> callback)
{
if (!pl_dict.ContainsKey(token))
{
var list = new List<Action<object>>();
list.Add(callback);
pl_dict.Add(token, list);
}
else
{
bool found = false;
foreach (var item in pl_dict[token])
if (item.Method.ToString() == callback.Method.ToString() && item.Target.ToString() == callback.Target.ToString())
found = true;
if (!found)
pl_dict[token].Add(callback);
}
}
static public void Unregister(string token, Action<object> callback)
{
if (pl_dict.ContainsKey(token))
pl_dict[token].Remove(callback);
}
static public void NotifyColleagues(string token, object args)
{
if (pl_dict.ContainsKey(token))
foreach (var callback in pl_dict[token])
callback(args);
}
}
}
|
// Copyright 2015 Esri
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
namespace CoordinateConversionLibrary.Helpers
{
static public class Mediator
{
static readonly IDictionary<string, List<Action<object>>> pl_dict = new Dictionary<string, List<Action<object>>>();
static public void Register(string token, Action<object> callback)
{
if (!pl_dict.ContainsKey(token))
{
var list = new List<Action<object>>();
list.Add(callback);
pl_dict.Add(token, list);
}
else
{
bool found = false;
foreach (var item in pl_dict[token])
if (item.Method.ToString() == callback.Method.ToString())
found = true;
if (!found)
pl_dict[token].Add(callback);
}
}
static public void Unregister(string token, Action<object> callback)
{
if (pl_dict.ContainsKey(token))
pl_dict[token].Remove(callback);
}
static public void NotifyColleagues(string token, object args)
{
if (pl_dict.ContainsKey(token))
foreach (var callback in pl_dict[token])
callback(args);
}
}
}
|
apache-2.0
|
C#
|
62647c55de38ff61681038f3c1a9925d128ed33c
|
improve test to check that correct LangLevel is used
|
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
|
rider/testData/solutions/SimpleUnityProject/Assets/NewBehaviourScript.cs
|
rider/testData/solutions/SimpleUnityProject/Assets/NewBehaviourScript.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
// check that C# LangLevel is 7.3, fails if it is 7.1
int binaryNotation = 0b_0001_1110_1000_0100_1000_0000; // 2 million
Debug.Log(binaryNotation);
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
|
apache-2.0
|
C#
|
8131dc59e504780eb6e2b037a7f4b69abbfd584a
|
Clean up OperationConsumesProcessor
|
RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,quails4Eva/NSwag,quails4Eva/NSwag,quails4Eva/NSwag,quails4Eva/NSwag
|
src/NSwag.SwaggerGeneration.WebApi/Processors/OperationConsumesProcessor.cs
|
src/NSwag.SwaggerGeneration.WebApi/Processors/OperationConsumesProcessor.cs
|
//-----------------------------------------------------------------------
// <copyright file="OperationConsumesProcessor.cs" company="NSwag">
// Copyright (c) Rico Suter. All rights reserved.
// </copyright>
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
// <author>Rico Suter, mail@rsuter.com</author>
//-----------------------------------------------------------------------
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Linq;
using NSwag.SwaggerGeneration.Processors;
using NSwag.SwaggerGeneration.Processors.Contexts;
namespace NSwag.SwaggerGeneration.WebApi.Processors
{
/// <summary>Generates the consumes clause from the operation's ConsumesAttribute.</summary>
public class OperationConsumesProcessor : IOperationProcessor
{
/// <summary>Processes the specified method information.</summary>
/// <param name="context"></param>
/// <returns>true if the operation should be added to the Swagger specification.</returns>
public Task<bool> ProcessAsync(OperationProcessorContext context)
{
// Check if the action method itself has the Consumes Attribute
dynamic consumesAttribute = context.MethodInfo
.GetCustomAttributes()
.SingleOrDefault(a => a.GetType().Name == "ConsumesAttribute");
if (consumesAttribute == null)
{
// If the action method does not have a Consumes Attribute we'll try with its containing class
consumesAttribute = context.MethodInfo.DeclaringType
.GetTypeInfo()
.GetCustomAttributes()
.SingleOrDefault(a => a.GetType().Name == "ConsumesAttribute");
}
if (consumesAttribute != null && consumesAttribute.ContentTypes != null)
{
if (context.OperationDescription.Operation.Consumes == null)
context.OperationDescription.Operation.Consumes = new List<string>(consumesAttribute.ContentTypes);
else
context.OperationDescription.Operation.Consumes.AddRange(consumesAttribute.ContentTypes);
}
return Task.FromResult(true);
}
}
}
|
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Linq;
using NSwag.SwaggerGeneration.Processors;
using NSwag.SwaggerGeneration.Processors.Contexts;
namespace NSwag.SwaggerGeneration.WebApi.Processors
{
/// <summary>Generates the consumes clause from the operation's ConsumesAttribute.</summary>
public class OperationConsumesProcessor : IOperationProcessor
{
/// <summary>Processes the specified method information.</summary>
/// <param name="context"></param>
/// <returns>true if the operation should be added to the Swagger specification.</returns>
public Task<bool> ProcessAsync(OperationProcessorContext context)
{
// Check if the action method itself has the Consumes Attribute
dynamic consumesAttribute = context.MethodInfo
.GetCustomAttributes()
.SingleOrDefault(a => a.GetType().Name == "ConsumesAttribute");
if(consumesAttribute == null)
{
// If the action method does not have a Consumes Attribute we'll try with its containing class
consumesAttribute = context.MethodInfo.DeclaringType
.GetTypeInfo()
.GetCustomAttributes()
.SingleOrDefault(a => a.GetType().Name == "ConsumesAttribute");
}
if(
consumesAttribute != null &&
consumesAttribute.ContentTypes != null)
{
if(context.OperationDescription.Operation.Consumes == null)
context.OperationDescription.Operation.Consumes = new List<string>(consumesAttribute.ContentTypes);
else
context.OperationDescription.Operation.Consumes.AddRange(consumesAttribute.ContentTypes);
}
return Task.FromResult(true);
}
}
}
|
mit
|
C#
|
337e779a10a766dbbc9b2ad1d6e23c9fa9144291
|
verify the property name when doing a PropertyChanged event ***NO_CI***
|
dylan-smith/pokerleaguemanager,dylan-smith/pokerleaguemanager,dylan-smith/pokerleaguemanager,dylan-smith/pokerleaguemanager
|
src/PokerLeagueManager.UI.WPF/Infrastructure/BaseViewModel.cs
|
src/PokerLeagueManager.UI.WPF/Infrastructure/BaseViewModel.cs
|
using System;
using System.ComponentModel;
namespace PokerLeagueManager.UI.WPF.Infrastructure
{
public class BaseViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
VerifyPropertyName(propertyName);
if (this.PropertyChanged != null)
{
var e = new PropertyChangedEventArgs(propertyName);
this.PropertyChanged(this, e);
}
}
public void VerifyPropertyName(string propertyName)
{
if (TypeDescriptor.GetProperties(this)[propertyName] == null)
{
throw new Exception(string.Format("Invalid property name: {0}", propertyName));
}
}
}
}
|
using System.ComponentModel;
namespace PokerLeagueManager.UI.WPF.Infrastructure
{
public class BaseViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
// TODO: Verify that this is a legit propertyName
if (this.PropertyChanged != null)
{
var e = new PropertyChangedEventArgs(propertyName);
this.PropertyChanged(this, e);
}
}
}
}
|
mit
|
C#
|
f77a0ad6bad1c5c73f7b980b8b409287a7f30dad
|
Update src/Tools/ExternalAccess/OmniSharp/Completion/OmniSharpCompletionOptions.cs
|
weltkante/roslyn,bartdesmet/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,weltkante/roslyn,KevinRansom/roslyn,jasonmalinowski/roslyn,KevinRansom/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,dotnet/roslyn,mavasani/roslyn,dotnet/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,mavasani/roslyn
|
src/Tools/ExternalAccess/OmniSharp/Completion/OmniSharpCompletionOptions.cs
|
src/Tools/ExternalAccess/OmniSharp/Completion/OmniSharpCompletionOptions.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.Completion;
namespace Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Completion
{
internal readonly record struct OmniSharpCompletionOptions(
bool ShowItemsFromUnimportedNamespaces,
bool ForceExpandedCompletionIndexCreation)
{
internal CompletionOptions ToCompletionOptions()
=> CompletionOptions.Default with
{
ShowItemsFromUnimportedNamespaces = ShowItemsFromUnimportedNamespaces,
ForceExpandedCompletionIndexCreation = ForceExpandedCompletionIndexCreation,
UpdateImportCompletionCacheInBackground = true,
};
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.Completion;
namespace Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Completion
{
internal readonly record struct OmniSharpCompletionOptions(
bool ShowItemsFromUnimportedNamespaces,
bool ForceExpandedCompletionIndexCreation)
{
internal CompletionOptions ToCompletionOptions()
=> CompletionOptions.Default with
{
ShowItemsFromUnimportedNamespaces = ShowItemsFromUnimportedNamespaces,
ForceExpandedCompletionIndexCreation = ForceExpandedCompletionIndexCreation,
UpdateImportCompletionCacheInBackground = true
};
}
}
|
mit
|
C#
|
1a021863502719b752ed10bab0ef8aa735405632
|
check for empty destination path before trying to see if it's writeable.
|
wislon/xamarin-android-use-removable-sd-card
|
src/TestExternalSd/StorageClasses/ExternalSdCardInfo.cs
|
src/TestExternalSd/StorageClasses/ExternalSdCardInfo.cs
|
using Android.OS;
namespace TestExternalSd.StorageClasses
{
public static class ExternalSdCardInfo
{
private static string _path = null;
private static bool _isWriteable;
private static FileSystemBlockInfo _fileSystemBlockInfo = null;
/// <summary>
/// Quick property you can check after initialising
/// </summary>
public static bool ExternalSdCardExists
{
get { return !string.IsNullOrWhiteSpace(Path); }
}
/// <summary>
/// Returns the path to External SD card (if there is one),
/// otherwise empty string if there isn't
/// </summary>
public static string Path
{
get
{
return _path ?? GetExternalSdCardPath();
}
}
/// <summary>
/// Returns whether the external SD card is writeable. You need to have
/// tried to access the <see cref="Path"/> or <see cref="ExternalSdCardExists"/>
/// property before the result of this makes any sense (it will always be false).
/// </summary>
public static bool IsWriteable
{
get { return _isWriteable; }
}
/// <summary>
/// The values in the <see cref="FileSystemBlockInfo"/> object may have
/// changed depending on what's going on in the file system, so it repopulates relatively
/// expensively every time you read this property
/// </summary>
public static FileSystemBlockInfo FileSystemBlockInfo
{
get { return GetFileSystemBlockInfo(); }
}
private static FileSystemBlockInfo GetFileSystemBlockInfo()
{
if (!string.IsNullOrWhiteSpace(_path))
{
_fileSystemBlockInfo = ExternalSdStorageHelper.GetFileSystemBlockInfo(_path);
return _fileSystemBlockInfo;
}
return null;
}
private static string GetExternalSdCardPath()
{
_path = string.Empty;
if (Android.OS.Build.VERSION.SdkInt <= BuildVersionCodes.JellyBeanMr2)
{
_path = ExternalSdStorageHelper.GetExternalSdCardPath();
}
else
{
_path = ExternalSdStorageHelper.GetExternalSdCardPathEx();
}
if (!string.IsNullOrWhiteSpace(_path))
{
_isWriteable = ExternalSdStorageHelper.IsWriteable(_path);
}
return _path;
}
}
}
|
using Android.OS;
namespace TestExternalSd.StorageClasses
{
public static class ExternalSdCardInfo
{
private static string _path = null;
private static bool _isWriteable;
private static FileSystemBlockInfo _fileSystemBlockInfo = null;
/// <summary>
/// Quick property you can check after initialising
/// </summary>
public static bool ExternalSdCardExists
{
get { return !string.IsNullOrWhiteSpace(Path); }
}
/// <summary>
/// Returns the path to External SD card (if there is one),
/// otherwise empty string if there isn't
/// </summary>
public static string Path
{
get
{
return _path ?? GetExternalSdCardPath();
}
}
/// <summary>
/// Returns whether the external SD card is writeable. You need to have
/// tried to access the <see cref="Path"/> or <see cref="ExternalSdCardExists"/>
/// property before the result of this makes any sense (it will always be false).
/// </summary>
public static bool IsWriteable
{
get { return _isWriteable; }
}
/// <summary>
/// The values in the <see cref="FileSystemBlockInfo"/> object may have
/// changed depending on what's going on in the file system, so it repopulates relatively
/// expensively every time you read this property
/// </summary>
public static FileSystemBlockInfo FileSystemBlockInfo
{
get { return GetFileSystemBlockInfo(); }
}
private static FileSystemBlockInfo GetFileSystemBlockInfo()
{
if (!string.IsNullOrWhiteSpace(_path))
{
_fileSystemBlockInfo = ExternalSdStorageHelper.GetFileSystemBlockInfo(_path);
return _fileSystemBlockInfo;
}
return null;
}
private static string GetExternalSdCardPath()
{
_path = string.Empty;
if (Android.OS.Build.VERSION.SdkInt <= BuildVersionCodes.JellyBeanMr2)
{
_path = ExternalSdStorageHelper.GetExternalSdCardPath();
}
else
{
_path = ExternalSdStorageHelper.GetExternalSdCardPathEx();
}
_isWriteable = ExternalSdStorageHelper.IsWriteable(_path);
return _path;
}
}
}
|
mit
|
C#
|
1fc4bf6dcde744d1b4ec67e1c590ef08118ac170
|
Update src/Umbraco.Core/Events/IScopedNotificationPublisher.cs
|
JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,abjerner/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,dawoe/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS
|
src/Umbraco.Core/Events/IScopedNotificationPublisher.cs
|
src/Umbraco.Core/Events/IScopedNotificationPublisher.cs
|
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Notifications;
namespace Umbraco.Cms.Core.Events
{
public interface IScopedNotificationPublisher
{
/// <summary>
/// Suppresses all notifications from being added/created until the result object is disposed.
/// </summary>
/// <returns></returns>
IDisposable Suppress();
/// <summary>
/// Publishes a cancelable notification to the notification subscribers
/// </summary>
/// <param name="notification"></param>
/// <returns>True if the notification was cancelled by a subscriber, false otherwise</returns>
bool PublishCancelable(ICancelableNotification notification);
/// <summary>
/// Publishes a cancelable notification to the notification subscribers
/// </summary>
/// <param name="notification"></param>
/// <returns>True if the notification was cancelled by a subscriber, false otherwise</returns>
Task<bool> PublishCancelableAsync(ICancelableNotification notification);
/// <summary>
/// Publishes a notification to the notification subscribers
/// </summary>
/// <param name="notification"></param>
/// <remarks>The notification is published upon successful completion of the current scope, i.e. when things have been saved/published/deleted etc.</remarks>
void Publish(INotification notification);
/// <summary>
/// Invokes publishing of all pending notifications within the current scope
/// </summary>
/// <param name="completed"></param>
void ScopeExit(bool completed);
}
}
|
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Notifications;
namespace Umbraco.Cms.Core.Events
{
public interface IScopedNotificationPublisher
{
/// <summary>
/// Supresses all notifications from being added/created until the result object is disposed.
/// </summary>
/// <returns></returns>
IDisposable Suppress();
/// <summary>
/// Publishes a cancelable notification to the notification subscribers
/// </summary>
/// <param name="notification"></param>
/// <returns>True if the notification was cancelled by a subscriber, false otherwise</returns>
bool PublishCancelable(ICancelableNotification notification);
/// <summary>
/// Publishes a cancelable notification to the notification subscribers
/// </summary>
/// <param name="notification"></param>
/// <returns>True if the notification was cancelled by a subscriber, false otherwise</returns>
Task<bool> PublishCancelableAsync(ICancelableNotification notification);
/// <summary>
/// Publishes a notification to the notification subscribers
/// </summary>
/// <param name="notification"></param>
/// <remarks>The notification is published upon successful completion of the current scope, i.e. when things have been saved/published/deleted etc.</remarks>
void Publish(INotification notification);
/// <summary>
/// Invokes publishing of all pending notifications within the current scope
/// </summary>
/// <param name="completed"></param>
void ScopeExit(bool completed);
}
}
|
mit
|
C#
|
d21639ef80a9bb71b27f8742c6f8b99d9d94f809
|
fix Upgrade_20211112_FixBootstrap
|
signumsoftware/framework,signumsoftware/framework
|
Signum.Upgrade/Upgrades/Upgrade_20211112_FixBootstrap.cs
|
Signum.Upgrade/Upgrades/Upgrade_20211112_FixBootstrap.cs
|
namespace Signum.Upgrade.Upgrades;
class Upgrade_20211112_FixBootstrap : CodeUpgradeBase
{
public override string Description => "Set Production mode";
public override void Execute(UpgradeContext uctx)
{
uctx.ChangeCodeFile($@"Southwind.React\Dockerfile", file =>
{
file.Replace("build-development", "build-production");
});
uctx.ChangeCodeFile($@"Southwind.React\Views\Home\Index.cshtml", file =>
{
file.Replace("supportIE = true", "supportIE = false");
});
uctx.ChangeCodeFile($@"Southwind.React\App\SCSS\custom.scss", file =>
{
file.InsertAfterFirstLine(a => a.Contains(@"@import ""./_bootswatch"";"), @".btn.input-group-text{
background: $input-group-addon-bg;
border: $input-border-width solid $input-group-addon-border-color
}");
});
uctx.ChangeCodeFile(@$"Southwind.React\package.json", file =>
{
file.Replace("--mode='production'", "--mode=production");
file.Replace(
@"webpack --config webpack.config.polyfills.js && webpack --config webpack.config.dll.js --mode=production",
@"webpack --config webpack.config.polyfills.js --mode=production && webpack --config webpack.config.dll.js --mode=production");
});
}
}
|
namespace Signum.Upgrade.Upgrades;
class Upgrade_20211112_FixBootstrap : CodeUpgradeBase
{
public override string Description => "Set Production mode";
public override void Execute(UpgradeContext uctx)
{
uctx.ChangeCodeFile($@"Southwind.React\Dockerfile", file =>
{
file.Replace("build-development", "build-production");
});
uctx.ChangeCodeFile($@"Southwind.React\App\Layout.tsx", file =>
{
file.Replace("supportIE = true", "supportIE = false");
});
uctx.ChangeCodeFile($@"Southwind.React\App\SCSS\custom.scss", file =>
{
file.InsertAfterFirstLine(a => a.Contains(@"@import ""./_bootswatch"";"), @".btn.input-group-text{
background: $input-group-addon-bg;
border: $input-border-width solid $input-group-addon-border-color
}");
});
uctx.ChangeCodeFile(@$"Southwind.React\package.json", file =>
{
file.Replace("--mode='production'", "--mode=production");
file.Replace(
@"webpack --config webpack.config.polyfills.js webpack --config webpack.config.dll.js --mode=production",
@"webpack --config webpack.config.polyfills.js --mode=production && webpack --config webpack.config.dll.js --mode=production");
});
}
}
|
mit
|
C#
|
33ca12c48c411c2c929274170a0a18ea7df74e19
|
Remove faulty cast.
|
SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia
|
tests/Avalonia.IntegrationTests.Appium/ComboBoxTests.cs
|
tests/Avalonia.IntegrationTests.Appium/ComboBoxTests.cs
|
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Mac;
using Xunit;
namespace Avalonia.IntegrationTests.Appium
{
[Collection("Default")]
public class ComboBoxTests
{
private readonly AppiumDriver<AppiumWebElement> _session;
public ComboBoxTests(TestAppFixture fixture)
{
_session = fixture.Session;
var tabs = _session.FindElementByAccessibilityId("MainTabs");
var tab = tabs.FindElementByName("ComboBox");
tab.Click();
}
[Fact]
public void UnselectedComboBox()
{
var comboBox = _session.FindElementByAccessibilityId("UnselectedComboBox");
Assert.Equal(string.Empty, comboBox.Text);
comboBox.Click();
_session.FindElementByName("Bar").SendClick();
Assert.Equal("Bar", comboBox.Text);
}
[Fact]
public void SelectedIndex0ComboBox()
{
var comboBox = _session.FindElementByAccessibilityId("SelectedIndex0ComboBox");
Assert.Equal("Foo", comboBox.Text);
}
[Fact]
public void SelectedIndex1ComboBox()
{
var comboBox = _session.FindElementByAccessibilityId("SelectedIndex1ComboBox");
Assert.Equal("Bar", comboBox.Text);
}
}
}
|
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Mac;
using Xunit;
namespace Avalonia.IntegrationTests.Appium
{
[Collection("Default")]
public class ComboBoxTests
{
private readonly AppiumDriver<AppiumWebElement> _session;
public ComboBoxTests(TestAppFixture fixture)
{
_session = fixture.Session;
var tabs = _session.FindElementByAccessibilityId("MainTabs");
var tab = tabs.FindElementByName("ComboBox");
tab.Click();
}
[Fact]
public void UnselectedComboBox()
{
var comboBox = _session.FindElementByAccessibilityId("UnselectedComboBox");
Assert.Equal(string.Empty, comboBox.Text);
((MacElement)comboBox).Click();
_session.FindElementByName("Bar").SendClick();
Assert.Equal("Bar", comboBox.Text);
}
[Fact]
public void SelectedIndex0ComboBox()
{
var comboBox = _session.FindElementByAccessibilityId("SelectedIndex0ComboBox");
Assert.Equal("Foo", comboBox.Text);
}
[Fact]
public void SelectedIndex1ComboBox()
{
var comboBox = _session.FindElementByAccessibilityId("SelectedIndex1ComboBox");
Assert.Equal("Bar", comboBox.Text);
}
}
}
|
mit
|
C#
|
7b0b0f94957df059694c237998eb5d063d9bd29b
|
Update umbracoUser2NodeNotify in SuperZero migration
|
abryukhov/Umbraco-CMS,abjerner/Umbraco-CMS,abjerner/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,tcmorris/Umbraco-CMS,NikRimington/Umbraco-CMS,arknu/Umbraco-CMS,NikRimington/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,dawoe/Umbraco-CMS,bjarnef/Umbraco-CMS,madsoulswe/Umbraco-CMS,leekelleher/Umbraco-CMS,leekelleher/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,abjerner/Umbraco-CMS,bjarnef/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,madsoulswe/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,bjarnef/Umbraco-CMS,abryukhov/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,hfloyd/Umbraco-CMS,umbraco/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,hfloyd/Umbraco-CMS,abjerner/Umbraco-CMS,hfloyd/Umbraco-CMS,mattbrailsford/Umbraco-CMS,NikRimington/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,mattbrailsford/Umbraco-CMS,hfloyd/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,madsoulswe/Umbraco-CMS
|
src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/SuperZero.cs
|
src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/SuperZero.cs
|
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
public class SuperZero : MigrationBase
{
public SuperZero(IMigrationContext context)
: base(context)
{ }
public override void Migrate()
{
var exists = Database.Fetch<int>("select id from umbracoUser where id=-1;").Count > 0;
if (exists) return;
Database.Execute("update umbracoUser set userLogin = userLogin + '__' where id=0");
Database.Execute("set identity_insert umbracoUser on;");
Database.Execute(@"
insert into umbracoUser (id,
userDisabled, userNoConsole, userName, userLogin, userPassword, passwordConfig,
userEmail, userLanguage, securityStampToken, failedLoginAttempts, lastLockoutDate,
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
createDate, updateDate, avatar, tourData)
select
-1 id,
userDisabled, userNoConsole, userName, substring(userLogin, 1, len(userLogin) - 2) userLogin, userPassword, passwordConfig,
userEmail, userLanguage, securityStampToken, failedLoginAttempts, lastLockoutDate,
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
createDate, updateDate, avatar, tourData
from umbracoUser where id=0;");
Database.Execute("set identity_insert umbracoUser off;");
Database.Execute("update umbracoUser2UserGroup set userId=-1 where userId=0;");
Database.Execute("update umbracoUser2NodeNotify set userId=-1 where userId=0;");
Database.Execute("update umbracoNode set nodeUser=-1 where nodeUser=0;");
Database.Execute("update umbracoUserLogin set userId=-1 where userId=0;");
Database.Execute($"update {Constants.DatabaseSchema.Tables.ContentVersion} set userId=-1 where userId=0;");
Database.Execute("delete from umbracoUser where id=0;");
}
}
}
|
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
public class SuperZero : MigrationBase
{
public SuperZero(IMigrationContext context)
: base(context)
{ }
public override void Migrate()
{
var exists = Database.Fetch<int>("select id from umbracoUser where id=-1;").Count > 0;
if (exists) return;
Database.Execute("update umbracoUser set userLogin = userLogin + '__' where id=0");
Database.Execute("set identity_insert umbracoUser on;");
Database.Execute(@"
insert into umbracoUser (id,
userDisabled, userNoConsole, userName, userLogin, userPassword, passwordConfig,
userEmail, userLanguage, securityStampToken, failedLoginAttempts, lastLockoutDate,
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
createDate, updateDate, avatar, tourData)
select
-1 id,
userDisabled, userNoConsole, userName, substring(userLogin, 1, len(userLogin) - 2) userLogin, userPassword, passwordConfig,
userEmail, userLanguage, securityStampToken, failedLoginAttempts, lastLockoutDate,
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
createDate, updateDate, avatar, tourData
from umbracoUser where id=0;");
Database.Execute("set identity_insert umbracoUser off;");
Database.Execute("update umbracoUser2UserGroup set userId=-1 where userId=0;");
Database.Execute("update umbracoNode set nodeUser=-1 where nodeUser=0;");
Database.Execute("update umbracoUserLogin set userId=-1 where userId=0;");
Database.Execute($"update {Constants.DatabaseSchema.Tables.ContentVersion} set userId=-1 where userId=0;");
Database.Execute("delete from umbracoUser where id=0;");
}
}
}
|
mit
|
C#
|
f9e43f4025a6da11803ccd579cbd5f6de133f64f
|
Change the assumptions that rootvisual is UserControl
|
epascales/SilverlightInspector,epascales/SilverlightInspector
|
SilverlightInspector/Inspector.cs
|
SilverlightInspector/Inspector.cs
|
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.Windows.Threading;
using NoName.Controls;
using SilverlightInspector.ViewModels;
using SilverlightInspector.Views;
namespace SilverlightInspector
{
public class Inspector
{
private Inspector()
{
Initialize();
}
private void Initialize()
{
var root = Application.Current.RootVisual as FrameworkElement;
if (root == null)
throw new InvalidOperationException("RootVisual is not set.");
var panel = ControlHelper.FindFirstDescendantElementInVisualTree<Panel>(root);
var popup = new Popup { IsOpen = true };
Action updatePopupSize = () =>
{
popup.Height = Application.Current.Host.Content.ActualHeight;
popup.Width = Application.Current.Host.Content.ActualWidth;
};
Application.Current.Host.Content.Resized += (s, e) =>
{
updatePopupSize();
};
var inspectorView = new InspectorView(new InspectorViewModel());
popup.Child = inspectorView;
panel.Children.Add(popup);
popup.SizeChanged += (s, e) =>
{
inspectorView.Width = popup.ActualWidth;
inspectorView.Height = popup.ActualHeight;
};
checkPopupsTimer.Tick += (s, e) =>
{
var openPopups = VisualTreeHelper.GetOpenPopups();
if (openPopups.First() != popup)
{
popup.IsOpen = false;
popup.IsOpen = true;
inspectorView.IsEnabled = true;
}
};
checkPopupsTimer.Start();
}
public static void Run()
{
Current = new Inspector();
}
public static Inspector Current { get; private set; }
DispatcherTimer checkPopupsTimer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(500) };
}
}
|
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.Windows.Threading;
using NoName.Controls;
using SilverlightInspector.ViewModels;
using SilverlightInspector.Views;
namespace SilverlightInspector
{
public class Inspector
{
private Inspector()
{
Initialize();
}
private void Initialize()
{
var root = Application.Current.RootVisual as UserControl;
if (root == null)
throw new InvalidOperationException("RootVisual is not set.");
var panel = ControlHelper.FindFirstDescendantElementInVisualTree<Panel>(root);
var popup = new Popup { IsOpen = true };
Action updatePopupSize = () =>
{
popup.Height = Application.Current.Host.Content.ActualHeight;
popup.Width = Application.Current.Host.Content.ActualWidth;
};
Application.Current.Host.Content.Resized += (s, e) =>
{
updatePopupSize();
};
var inspectorView = new InspectorView(new InspectorViewModel());
popup.Child = inspectorView;
panel.Children.Add(popup);
popup.SizeChanged += (s, e) =>
{
inspectorView.Width = popup.ActualWidth;
inspectorView.Height = popup.ActualHeight;
};
checkPopupsTimer.Tick += (s, e) =>
{
var openPopups = VisualTreeHelper.GetOpenPopups();
if (openPopups.First() != popup)
{
popup.IsOpen = false;
popup.IsOpen = true;
inspectorView.IsEnabled = true;
}
};
checkPopupsTimer.Start();
}
public static void Run()
{
Current = new Inspector();
}
public static Inspector Current { get; private set; }
DispatcherTimer checkPopupsTimer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(500) };
}
}
|
mit
|
C#
|
ed8c3a63aee9d4e4a70757db1a9e3ea907e47f09
|
modifica e salvataggio dettagli chiamata
|
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
|
src/backend/SO115App.Models/Classi/Condivise/Localita.cs
|
src/backend/SO115App.Models/Classi/Condivise/Localita.cs
|
//-----------------------------------------------------------------------
// <copyright file="Localita.cs" company="CNVVF">
// Copyright (C) 2017 - CNVVF
//
// This file is part of SOVVF.
// SOVVF 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.
//
// SOVVF 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/.
// </copyright>
//-----------------------------------------------------------------------
using System.ComponentModel.DataAnnotations;
namespace SO115App.API.Models.Classi.Condivise
{
public class Localita
{
public Localita(Coordinate _coordinate, string Indirizzo, string Note)
{
this.Coordinate = _coordinate;
this.Indirizzo = Indirizzo;
this.Note = Note;
}
[Required]
public Coordinate Coordinate { get; set; }
public string Indirizzo { get; set; }
public string Citta { get; set; }
public string Provincia { get; set; }
public string Interno { get; set; }
public string Palazzo { get; set; }
public string Scala { get; set; }
public string Note { get; set; }
public string Piano { get; set; }
}
}
|
//-----------------------------------------------------------------------
// <copyright file="Localita.cs" company="CNVVF">
// Copyright (C) 2017 - CNVVF
//
// This file is part of SOVVF.
// SOVVF 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.
//
// SOVVF 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/.
// </copyright>
//-----------------------------------------------------------------------
using System.ComponentModel.DataAnnotations;
namespace SO115App.API.Models.Classi.Condivise
{
public class Localita
{
public Localita(Coordinate _coordinate, string Indirizzo, string Note)
{
this.Coordinate = _coordinate;
this.Indirizzo = Indirizzo;
this.Note = Note;
}
[Required]
public Coordinate Coordinate { get; set; }
public string Indirizzo { get; set; }
public string Citta { get; set; }
public string Provincia { get; set; }
public string Note { get; set; }
public string Piano { get; set; }
}
}
|
agpl-3.0
|
C#
|
1d93567fc666626c1744993555ef14abfdf1801f
|
Increase feature version.
|
Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex
|
backend/src/Squidex/Areas/Api/Controllers/News/Service/FeaturesService.cs
|
backend/src/Squidex/Areas/Api/Controllers/News/Service/FeaturesService.cs
|
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Squidex.Areas.Api.Controllers.News.Models;
using Squidex.ClientLibrary;
namespace Squidex.Areas.Api.Controllers.News.Service
{
public sealed class FeaturesService
{
private const int FeatureVersion = 11;
private readonly QueryContext flatten = QueryContext.Default.Flatten();
private readonly IContentsClient<NewsEntity, FeatureDto> client;
public sealed class NewsEntity : Content<FeatureDto>
{
}
public FeaturesService(IOptions<MyNewsOptions> options)
{
if (options.Value.IsConfigured())
{
var squidexOptions = new SquidexOptions
{
AppName = options.Value.AppName,
ClientId = options.Value.ClientId,
ClientSecret = options.Value.ClientSecret,
Url = "https://cloud.squidex.io"
};
var clientManager = new SquidexClientManager(squidexOptions);
client = clientManager.CreateContentsClient<NewsEntity, FeatureDto>("feature-news");
}
}
public async Task<FeaturesDto> GetFeaturesAsync(int version = 0)
{
var result = new FeaturesDto { Features = new List<FeatureDto>(), Version = FeatureVersion };
if (client != null && version < FeatureVersion)
{
var query = new ContentQuery
{
Filter = $"data/version/iv ge {FeatureVersion}"
};
var features = await client.GetAsync(query, flatten);
result.Features.AddRange(features.Items.Select(x => x.Data));
}
return result;
}
}
}
|
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Squidex.Areas.Api.Controllers.News.Models;
using Squidex.ClientLibrary;
namespace Squidex.Areas.Api.Controllers.News.Service
{
public sealed class FeaturesService
{
private const int FeatureVersion = 9;
private readonly QueryContext flatten = QueryContext.Default.Flatten();
private readonly IContentsClient<NewsEntity, FeatureDto> client;
public sealed class NewsEntity : Content<FeatureDto>
{
}
public FeaturesService(IOptions<MyNewsOptions> options)
{
if (options.Value.IsConfigured())
{
var squidexOptions = new SquidexOptions
{
AppName = options.Value.AppName,
ClientId = options.Value.ClientId,
ClientSecret = options.Value.ClientSecret,
Url = "https://cloud.squidex.io"
};
var clientManager = new SquidexClientManager(squidexOptions);
client = clientManager.CreateContentsClient<NewsEntity, FeatureDto>("feature-news");
}
}
public async Task<FeaturesDto> GetFeaturesAsync(int version = 0)
{
var result = new FeaturesDto { Features = new List<FeatureDto>(), Version = FeatureVersion };
if (client != null && version < FeatureVersion)
{
var query = new ContentQuery
{
Filter = $"data/version/iv ge {FeatureVersion}"
};
var features = await client.GetAsync(query, flatten);
result.Features.AddRange(features.Items.Select(x => x.Data));
}
return result;
}
}
}
|
mit
|
C#
|
398624659e4c3d64cd683f6ec1dd10c2896edcf0
|
Fix a bug that causes the GetProviderNode to return null references.
|
nohros/must,nohros/must,nohros/must
|
src/base/common/providers/data/SqlConnectionProviderFactory.cs
|
src/base/common/providers/data/SqlConnectionProviderFactory.cs
|
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Nohros.Configuration;
namespace Nohros.Data.Providers
{
public partial class SqlConnectionProvider : IConnectionProviderFactory
{
#region .ctor
/// <summary>
/// Constructor implied by the interface
/// <see cref="IConnectionProviderFactory"/>.
/// </summary>
SqlConnectionProvider() { }
#endregion
#region IConnectionProviderFactory Members
/// <inheritdoc/>
IConnectionProvider IConnectionProviderFactory.CreateProvider(
IDictionary<string, string> options) {
string connection_string;
SqlConnectionStringBuilder builder;
if (options.TryGetValue(kConnectionStringOption, out connection_string)) {
builder = new SqlConnectionStringBuilder(connection_string);
} else {
string[] data = ProviderOptions.ThrowIfNotExists(options, kServerOption,
kLoginOption, kPasswordOption);
const int kServer = 0;
const int kLogin = 1;
const int kPassword = 2;
builder = new SqlConnectionStringBuilder
{
DataSource = data[kServer],
UserID = data[kLogin],
Password = data[kPassword]
};
}
return new SqlConnectionProvider(builder.ConnectionString);
}
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Nohros.Configuration;
namespace Nohros.Data.Providers
{
public partial class SqlConnectionProvider : IConnectionProviderFactory
{
#region .ctor
/// <summary>
/// Constructor implied by the interface
/// <see cref="IConnectionProviderFactory"/>.
/// </summary>
SqlConnectionProvider() {
}
#endregion
#region IConnectionProviderFactory Members
/// <inheritdoc/>
IConnectionProvider IConnectionProviderFactory.CreateProvider(
IDictionary<string, string> options) {
string connection_string;
SqlConnectionStringBuilder builder;
if (options.TryGetValue(kConnectionStringOption, out connection_string)) {
builder = new SqlConnectionStringBuilder(connection_string);
} else {
string[] data = ProviderOptions.ThrowIfNotExists(options, kServerOption,
kLoginOption, kPasswordOption);
const int kServer = 0;
const int kLogin = 1;
const int kPassword = 2;
builder = new SqlConnectionStringBuilder {
DataSource = data[kServer],
UserID = data[kLogin],
Password = data[kPassword]
};
}
return new SqlConnectionProvider(builder.ConnectionString);
}
#endregion
}
}
|
mit
|
C#
|
3b929ffd21035432d09ea8dc029150bc4194e54e
|
Make test more useful
|
smoogipoo/osu,2yangk23/osu,smoogipoo/osu,EVAST9919/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,2yangk23/osu,peppy/osu,naoey/osu,johnneijzen/osu,Nabile-Rahmani/osu,ppy/osu,NeoAdonis/osu,DrabWeb/osu,UselessToucan/osu,ppy/osu,DrabWeb/osu,DrabWeb/osu,peppy/osu,smoogipooo/osu,UselessToucan/osu,naoey/osu,ZLima12/osu,EVAST9919/osu,NeoAdonis/osu,johnneijzen/osu,peppy/osu,naoey/osu,NeoAdonis/osu,Frontear/osuKyzer,ZLima12/osu,peppy/osu-new
|
osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs
|
osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.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 NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawable;
using osu.Game.Rulesets.Catch.UI;
namespace osu.Game.Rulesets.Catch.Tests
{
[TestFixture]
[Ignore("getting CI working")]
public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(BananaShower),
typeof(DrawableBananaShower),
typeof(CatchRuleset),
typeof(CatchRulesetContainer),
};
public TestCaseBananaShower()
: base(new CatchRuleset())
{
}
protected override Beatmap CreateBeatmap()
{
var beatmap = new Beatmap
{
BeatmapInfo = new BeatmapInfo
{
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 6,
}
}
};
beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 10000, NewCombo = true });
return beatmap;
}
}
}
|
// 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 NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawable;
using osu.Game.Rulesets.Catch.UI;
namespace osu.Game.Rulesets.Catch.Tests
{
[TestFixture]
[Ignore("getting CI working")]
public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(BananaShower),
typeof(DrawableBananaShower),
typeof(CatchRuleset),
typeof(CatchRulesetContainer),
};
public TestCaseBananaShower()
: base(new CatchRuleset())
{
}
protected override Beatmap CreateBeatmap()
{
var beatmap = new Beatmap
{
BeatmapInfo = new BeatmapInfo
{
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 6,
}
}
};
for (int i = 0; i < 10; i++)
beatmap.HitObjects.Add(new BananaShower { StartTime = i * 1200, Duration = 1000, NewCombo = i % 2 == 0 });
return beatmap;
}
}
}
|
mit
|
C#
|
069d48ac14a29ac0bf20647a5cafe815500697f7
|
Remove unused variable
|
naoey/osu,peppy/osu,2yangk23/osu,EVAST9919/osu,2yangk23/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,johnneijzen/osu,ZLima12/osu,DrabWeb/osu,smoogipooo/osu,DrabWeb/osu,ZLima12/osu,Nabile-Rahmani/osu,naoey/osu,johnneijzen/osu,peppy/osu-new,ppy/osu,peppy/osu,UselessToucan/osu,naoey/osu,DrabWeb/osu
|
osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs
|
osu.Game/Overlays/Profile/Sections/BeatmapsSection.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.Linq;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Profile.Sections.Beatmaps;
namespace osu.Game.Overlays.Profile.Sections
{
public class BeatmapsSection : ProfileSection
{
public override string Title => "Beatmaps";
public override string Identifier => "beatmaps";
public BeatmapsSection()
{
Children = new[]
{
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.Unranked, User, "Pending Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"),
};
foreach (var paginatedBeatmapContainer in Children.OfType<PaginatedBeatmapContainer>())
{
paginatedBeatmapContainer.BeganPlayingPreview += beatmapContainer =>
{
foreach (var bc in Children.OfType<PaginatedBeatmapContainer>())
{
if (bc != beatmapContainer)
bc.StopPlayingPreview();
}
};
}
}
}
}
|
// 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.Linq;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Direct;
using osu.Game.Overlays.Profile.Sections.Beatmaps;
namespace osu.Game.Overlays.Profile.Sections
{
public class BeatmapsSection : ProfileSection
{
public override string Title => "Beatmaps";
public override string Identifier => "beatmaps";
private DirectPanel currentlyPlaying;
public BeatmapsSection()
{
Children = new[]
{
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.Unranked, User, "Pending Beatmaps"),
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"),
};
foreach (var paginatedBeatmapContainer in Children.OfType<PaginatedBeatmapContainer>())
{
paginatedBeatmapContainer.BeganPlayingPreview += beatmapContainer =>
{
foreach (var bc in Children.OfType<PaginatedBeatmapContainer>())
{
if (bc != beatmapContainer)
bc.StopPlayingPreview();
}
};
}
}
}
}
|
mit
|
C#
|
398654328289e395ff83f42aac7339e275414fce
|
Update EpochToDateTimeConverter.cs
|
mirajavora/sendgrid-webhooks
|
Sendgrid.Webhooks/Converters/EpochToDateTimeConverter.cs
|
Sendgrid.Webhooks/Converters/EpochToDateTimeConverter.cs
|
using System;
using Newtonsoft.Json;
namespace Sendgrid.Webhooks.Converters
{
public class EpochToDateTimeConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return objectType == typeof(DateTime);
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (value != null)
serializer.Serialize(writer, ((DateTime)value).ToString());
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
long timestamp = (long) reader.Value;
return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timestamp);
}
}
}
|
using System;
using Newtonsoft.Json;
namespace Sendgrid.Webhooks.Converters
{
public class EpochToDateTimeConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return objectType == typeof(DateTime);
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
long timestamp = (long) reader.Value;
return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timestamp);
}
}
}
|
apache-2.0
|
C#
|
996febbf4d23ab3363cad403d50597045e7083d6
|
return Notification<T> from Json/JsonWebServiceClient.cs
|
mvbalaw/MvbaCore.ThirdParty,mvbalaw/MvbaCore.ThirdParty,mvbalaw/MvbaCore.ThirdParty
|
src/MvbaCore.ThirdParty/Json/JsonWebServiceClient.cs
|
src/MvbaCore.ThirdParty/Json/JsonWebServiceClient.cs
|
// * **************************************************************************
// * Copyright (c) McCreary, Veselka, Bragg & Allen, P.C.
// * This source code is subject to terms and conditions of the MIT License.
// * A copy of the license can be found in the License.txt file
// * at the root of this distribution.
// * By using this source code in any fashion, you are agreeing to be bound by
// * the terms of the MIT License.
// * You must not remove this notice from this software.
// * **************************************************************************
using System;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
namespace MvbaCore.ThirdParty.Json
{
public interface IJsonWebServiceClient
{
Notification<TOutput> Post<TInput, TOutput>(string url, TInput data);
TOutput Post<TOutput>(string url);
TOutput PostDataContract<TInput, TOutput>(string url, TInput data);
}
public class JsonWebServiceClient : IJsonWebServiceClient
{
private const string ApplicationJsonContentType = "application/json";
public Notification<TOutput> Post<TInput, TOutput>(string url, TInput data)
{
var content = JsonUtility.SerializeForWebRequest(data);
var result = new WebServiceClient().Post(url, content, ApplicationJsonContentType);
return GetResponse<TOutput>(result);
}
public TOutput PostDataContract<TInput, TOutput>(string url, TInput data)
{
var memoryStream = new MemoryStream();
new DataContractJsonSerializer(typeof(TInput)).WriteObject(memoryStream, data);
var json = memoryStream.ToArray();
memoryStream.Close();
var content = Encoding.UTF8.GetString(json, 0, json.Length);
var result = new WebServiceClient().Post(url, content, ApplicationJsonContentType);
return GetResponse<TOutput>(result);
}
public TOutput Post<TOutput>(string url)
{
var result = new WebServiceClient().Post(url, ApplicationJsonContentType);
return GetResponse<TOutput>(result);
}
private static Notification<TOutput> GetResponse<TOutput>(Notification<string> result)
{
if (result.Item == null)
{
return new Notification<TOutput>(result);
}
TOutput output;
try
{
output = JsonUtility.Deserialize<TOutput>(result);
}
catch (Exception exception)
{
var notification = new Notification<TOutput>(Notification.ErrorFor("caught exception deserializing:\n" + result.Item + "\n" + exception.Message))
{
Item = default(TOutput)
};
return notification;
}
return output;
}
}
}
|
// * **************************************************************************
// * Copyright (c) McCreary, Veselka, Bragg & Allen, P.C.
// * This source code is subject to terms and conditions of the MIT License.
// * A copy of the license can be found in the License.txt file
// * at the root of this distribution.
// * By using this source code in any fashion, you are agreeing to be bound by
// * the terms of the MIT License.
// * You must not remove this notice from this software.
// * **************************************************************************
using System;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
namespace MvbaCore.ThirdParty.Json
{
public interface IJsonWebServiceClient
{
TOutput Post<TInput, TOutput>(string url, TInput data);
TOutput Post<TOutput>(string url);
TOutput PostDataContract<TInput, TOutput>(string url, TInput data);
}
public class JsonWebServiceClient : IJsonWebServiceClient
{
private const string ApplicationJsonContentType = "application/json";
public TOutput Post<TInput, TOutput>(string url, TInput data)
{
var content = JsonUtility.SerializeForWebRequest(data);
var result = new WebServiceClient().Post(url, content, ApplicationJsonContentType);
return GetResponse<TOutput>(result);
}
public TOutput PostDataContract<TInput, TOutput>(string url, TInput data)
{
var memoryStream = new MemoryStream();
new DataContractJsonSerializer(typeof(TInput)).WriteObject(memoryStream, data);
var json = memoryStream.ToArray();
memoryStream.Close();
var content = Encoding.UTF8.GetString(json, 0, json.Length);
var result = new WebServiceClient().Post(url, content, ApplicationJsonContentType);
return GetResponse<TOutput>(result);
}
public TOutput Post<TOutput>(string url)
{
var result = new WebServiceClient().Post(url, ApplicationJsonContentType);
return GetResponse<TOutput>(result);
}
private static Notification<TOutput> GetResponse<TOutput>(Notification<string> result)
{
if (result.Item == null)
{
return new Notification<TOutput>(result);
}
TOutput output;
try
{
output = JsonUtility.Deserialize<TOutput>(result);
}
catch (Exception exception)
{
var notification = new Notification<TOutput>(Notification.ErrorFor("caught exception deserializing:\n" + result.Item + "\n" + exception.Message))
{
Item = default(TOutput)
};
return notification;
}
return output;
}
}
}
|
mit
|
C#
|
3f1aa0763c02dad012b400330333d8df824aa351
|
Add more tests for NH-3408
|
nhibernate/nhibernate-core,ManufacturingIntelligence/nhibernate-core,nkreipke/nhibernate-core,fredericDelaporte/nhibernate-core,lnu/nhibernate-core,hazzik/nhibernate-core,nhibernate/nhibernate-core,RogerKratz/nhibernate-core,alobakov/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,fredericDelaporte/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,RogerKratz/nhibernate-core,gliljas/nhibernate-core,ngbrown/nhibernate-core,alobakov/nhibernate-core,hazzik/nhibernate-core,fredericDelaporte/nhibernate-core,nkreipke/nhibernate-core,lnu/nhibernate-core,gliljas/nhibernate-core,RogerKratz/nhibernate-core,nkreipke/nhibernate-core,livioc/nhibernate-core,fredericDelaporte/nhibernate-core,gliljas/nhibernate-core,alobakov/nhibernate-core,gliljas/nhibernate-core,nhibernate/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core,nhibernate/nhibernate-core,RogerKratz/nhibernate-core,lnu/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core
|
src/NHibernate.Test/NHSpecificTest/NH3408/Fixture.cs
|
src/NHibernate.Test/NHSpecificTest/NH3408/Fixture.cs
|
using System.Collections.Generic;
using System.Linq;
using NHibernate.Linq;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH3408
{
public class Fixture : BugTestCase
{
[Test]
public void ProjectAnonymousTypeWithArrayProperty()
{
using (var session = OpenSession())
using (session.BeginTransaction())
{
var query = from c in session.Query<Country>()
select new { c.Picture, c.NationalHolidays };
Assert.DoesNotThrow(() => { query.ToList(); });
}
}
[Test]
public void ProjectAnonymousTypeWithArrayPropertyWhenByteArrayContains()
{
using (var session = OpenSession())
using (session.BeginTransaction())
{
var pictures = new List<byte[]>();
var query = from c in session.Query<Country>()
where pictures.Contains(c.Picture)
select new { c.Picture, c.NationalHolidays };
Assert.DoesNotThrow(() => { query.ToList(); });
}
}
[Test]
public void SelectBytePropertyWithArrayPropertyWhenByteArrayContains()
{
using (var session = OpenSession())
using (session.BeginTransaction())
{
var pictures = new List<byte[]>();
var query = from c in session.Query<Country>()
where pictures.Contains(c.Picture)
select c.Picture;
Assert.DoesNotThrow(() => { query.ToList(); });
}
}
}
}
|
using System.Linq;
using NHibernate.Linq;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH3408
{
public class Fixture : BugTestCase
{
[Test]
public void ProjectAnonymousTypeWithArrayProperty()
{
using (var session = OpenSession())
using (session.BeginTransaction())
{
var query = from c in session.Query<Country>()
select new { c.Picture, c.NationalHolidays };
Assert.DoesNotThrow(() => { query.ToList(); });
}
}
}
}
|
lgpl-2.1
|
C#
|
d713d4b97fdd94dbc158c0097ab4027b5ba1a71f
|
Call the reflection method only if types don't match
|
jmptrader/WampSharp,jmptrader/WampSharp,jmptrader/WampSharp
|
src/net45/WampSharp/WAMP2/V2/Core/WampObjectFormatter.cs
|
src/net45/WampSharp/WAMP2/V2/Core/WampObjectFormatter.cs
|
using System;
using System.Linq;
using System.Reflection;
using WampSharp.Core.Serialization;
using WampSharp.Core.Utilities;
namespace WampSharp.V2.Core
{
public class WampObjectFormatter : IWampFormatter<object>
{
public static readonly IWampFormatter<object> Value = new WampObjectFormatter();
private readonly MethodInfo mSerializeMethod =
Method.Get((WampObjectFormatter x) => x.Deserialize<object>(default(object)))
.GetGenericMethodDefinition();
private WampObjectFormatter()
{
}
public bool CanConvert(object argument, Type type)
{
return type.IsInstanceOfType(argument);
}
public TTarget Deserialize<TTarget>(object message)
{
return (TTarget) message;
}
public object Deserialize(Type type, object message)
{
if (type.IsInstanceOfType(message))
{
return message;
}
else
{
// This throws an exception if types don't match.
object converted =
mSerializeMethod.MakeGenericMethod(type)
.Invoke(this, new object[] {message});
return converted;
}
}
public object Serialize(object value)
{
return value;
}
}
}
|
using System;
using System.Linq;
using System.Reflection;
using WampSharp.Core.Serialization;
using WampSharp.Core.Utilities;
namespace WampSharp.V2.Core
{
public class WampObjectFormatter : IWampFormatter<object>
{
public static readonly IWampFormatter<object> Value = new WampObjectFormatter();
private WampObjectFormatter()
{
}
public bool CanConvert(object argument, Type type)
{
return type.IsInstanceOfType(argument);
}
public TTarget Deserialize<TTarget>(object message)
{
return (TTarget) message;
}
public object Deserialize(Type type, object message)
{
MethodInfo genericMethod =
Method.Get((WampObjectFormatter x) => x.Deserialize<object>(default(object)))
.GetGenericMethodDefinition();
// This actually only throws an exception if types don't match.
object converted =
genericMethod.MakeGenericMethod(type)
.Invoke(this, new object[] {message});
return converted;
}
public object Serialize(object value)
{
return value;
}
}
}
|
bsd-2-clause
|
C#
|
0d357fa4eb5529fcd5931d70740128f70da8e55f
|
Update CommentsDisqus.cshtml
|
Shazwazza/Articulate,readingdancer/Articulate,Shazwazza/Articulate,readingdancer/Articulate,readingdancer/Articulate,Shazwazza/Articulate
|
src/Articulate.Web/App_Plugins/Articulate/Themes/Shazwazza/Views/Partials/CommentsDisqus.cshtml
|
src/Articulate.Web/App_Plugins/Articulate/Themes/Shazwazza/Views/Partials/CommentsDisqus.cshtml
|
@model Articulate.Models.PostModel
@if (Model.DisqusShortName.IsNullOrWhiteSpace())
{
<p>
<em>
To enable comments sign up for a <a href="http://disqus.com" target="_blank">Disqus</a> account and
enter your Disqus shortname in the Articulate node settings.
</em>
</p>
}
else
{
<div id="disqus_thread">
<script type="text/javascript">
/** ENTER DISQUS SHORTNAME HERE **/
var disqus_shortname = '@Model.DisqusShortName';
/** DO NOT MODIFY BELOW THIS LINE **/
var disqus_identifier = '@Model.GetKey()';
var disqus_url = '@Model.UrlWithDomain()';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
<a href="http://disqus.com" class="dsq-brlink">
comments powered by <span class="logo-disqus">Disqus</span>
</a>
</div>
}
|
@model Articulate.Models.PostModel
@if (Model.DisqusShortName.IsNullOrWhiteSpace())
{
<p>
<em>
To enable comments sign up for a <a href="http://disqus.com" target="_blank">Disqus</a> account and
enter your Disqus shortname in the Articulate node settings.
</em>
</p>
}
else
{
<div id="disqus_thread">
<script type="text/javascript">
/** ENTER DISQUS SHORTNAME HERE **/
var disqus_shortname = '@Model.DisqusShortName';
/** DO NOT MODIFY BELOW THIS LINE **/
var disqus_identifier = '@Model.Id';
var disqus_url = '@Model.UrlWithDomain()';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
<a href="http://disqus.com" class="dsq-brlink">
comments powered by <span class="logo-disqus">Disqus</span>
</a>
</div>
}
|
mit
|
C#
|
68e370ce7cd72c51a7eda6f9863ed37b0f86b3d5
|
Set spinner tick start time to allow result reverting
|
smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,peppy/osu,peppy/osu-new,ppy/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,peppy/osu,ppy/osu,NeoAdonis/osu
|
osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs
|
osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.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.Audio;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public class DrawableSpinnerTick : DrawableOsuHitObject
{
private readonly BindableDouble bonusSampleVolume = new BindableDouble();
private bool hasBonusPoints;
/// <summary>
/// Whether this judgement has a bonus of 1,000 points additional to the numeric result.
/// Should be set when a spin occured after the spinner has completed.
/// </summary>
public bool HasBonusPoints
{
get => hasBonusPoints;
internal set
{
hasBonusPoints = value;
bonusSampleVolume.Value = value ? 1 : 0;
((OsuSpinnerTickJudgement)Result.Judgement).HasBonusPoints = value;
}
}
public override bool DisplayResult => false;
public DrawableSpinnerTick(SpinnerTick spinnerTick)
: base(spinnerTick)
{
}
protected override void LoadComplete()
{
base.LoadComplete();
Samples.AddAdjustment(AdjustableProperty.Volume, bonusSampleVolume);
}
public void TriggerResult(HitResult result)
{
HitObject.StartTime = Time.Current;
ApplyResult(r => r.Type = result);
}
}
}
|
// 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.Audio;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public class DrawableSpinnerTick : DrawableOsuHitObject
{
private readonly BindableDouble bonusSampleVolume = new BindableDouble();
private bool hasBonusPoints;
/// <summary>
/// Whether this judgement has a bonus of 1,000 points additional to the numeric result.
/// Should be set when a spin occured after the spinner has completed.
/// </summary>
public bool HasBonusPoints
{
get => hasBonusPoints;
internal set
{
hasBonusPoints = value;
bonusSampleVolume.Value = value ? 1 : 0;
((OsuSpinnerTickJudgement)Result.Judgement).HasBonusPoints = value;
}
}
public override bool DisplayResult => false;
public DrawableSpinnerTick(SpinnerTick spinnerTick)
: base(spinnerTick)
{
}
protected override void LoadComplete()
{
base.LoadComplete();
Samples.AddAdjustment(AdjustableProperty.Volume, bonusSampleVolume);
}
public void TriggerResult(HitResult result) => ApplyResult(r => r.Type = result);
}
}
|
mit
|
C#
|
d1d4b06da6f80038e8e6c2647eb6d4c0fca8ccb0
|
fix typos
|
jbogard/MediatR
|
samples/MediatR.Examples.PublishStrategies/PublishStrategy.cs
|
samples/MediatR.Examples.PublishStrategies/PublishStrategy.cs
|
namespace MediatR.Examples.PublishStrategies;
/// <summary>
/// Strategy to use when publishing notifications
/// </summary>
public enum PublishStrategy
{
/// <summary>
/// Run each notification handler after one another. Returns when all handlers are finished. In case of any exception(s), they will be captured in an AggregateException.
/// </summary>
SyncContinueOnException = 0,
/// <summary>
/// Run each notification handler after one another. Returns when all handlers are finished or an exception has been thrown. In case of an exception, any handlers after that will not be run.
/// </summary>
SyncStopOnException = 1,
/// <summary>
/// Run all notification handlers asynchronously. Returns when all handlers are finished. In case of any exception(s), they will be captured in an AggregateException.
/// </summary>
Async = 2,
/// <summary>
/// Run each notification handler on its own thread using Task.Run(). Returns immediately and does not wait for any handlers to finish. Note that you cannot capture any exceptions, even if you await the call to Publish.
/// </summary>
ParallelNoWait = 3,
/// <summary>
/// Run each notification handler on its own thread using Task.Run(). Returns when all threads (handlers) are finished. In case of any exception(s), they are captured in an AggregateException by Task.WhenAll.
/// </summary>
ParallelWhenAll = 4,
/// <summary>
/// Run each notification handler on its own thread using Task.Run(). Returns when any thread (handler) is finished. Note that you cannot capture any exceptions (See msdn documentation of Task.WhenAny)
/// </summary>
ParallelWhenAny = 5,
}
|
namespace MediatR.Examples.PublishStrategies;
/// <summary>
/// Strategy to use when publishing notifications
/// </summary>
public enum PublishStrategy
{
/// <summary>
/// Run each notification handler after one another. Returns when all handlers are finished. In case of any exception(s), they will be captured in an AggregateException.
/// </summary>
SyncContinueOnException = 0,
/// <summary>
/// Run each notification handler after one another. Returns when all handlers are finished or an exception has been thrown. In case of an exception, any handlers after that will not be run.
/// </summary>
SyncStopOnException = 1,
/// <summary>
/// Run all notification handlers asynchronously. Returns when all handlers are finished. In case of any exception(s), they will be captured in an AggregateException.
/// </summary>
Async = 2,
/// <summary>
/// Run each notification handler on it's own thread using Task.Run(). Returns immediately and does not wait for any handlers to finish. Note that you cannot capture any exceptions, even if you await the call to Publish.
/// </summary>
ParallelNoWait = 3,
/// <summary>
/// Run each notification handler on it's own thread using Task.Run(). Returns when all threads (handlers) are finished. In case of any exception(s), they are captured in an AggregateException by Task.WhenAll.
/// </summary>
ParallelWhenAll = 4,
/// <summary>
/// Run each notification handler on it's own thread using Task.Run(). Returns when any thread (handler) is finished. Note that you cannot capture any exceptions (See msdn documentation of Task.WhenAny)
/// </summary>
ParallelWhenAny = 5,
}
|
apache-2.0
|
C#
|
2ff6c12347e4826010cea4d30dea6bc97a6601e1
|
Move helper function accessor code outside pragma.
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpHelperVisitor.cs
|
src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpHelperVisitor.cs
|
using System;
namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
{
public class CSharpHelperVisitor : CodeVisitor<CSharpCodeWriter>
{
private const string HelperWriterName = "__razor_helper_writer";
private CSharpCodeVisitor _codeVisitor;
public CSharpHelperVisitor(CSharpCodeWriter writer, CodeGeneratorContext context)
: base(writer, context)
{
_codeVisitor = new CSharpCodeVisitor(writer, context);
}
protected override void Visit(HelperChunk chunk)
{
IDisposable lambdaScope = null;
string accessibility = "public " + (Context.Host.StaticHelpers ? "static" : String.Empty);
Writer.Write(accessibility).Write(" ").Write(Context.Host.GeneratedClassContext.TemplateTypeName).Write(" ");
using (CSharpLineMappingWriter mappingWriter = Writer.BuildLineMapping(chunk.Signature.Location, chunk.Signature.Value.Length, Context.SourceFile))
{
Writer.Write(chunk.Signature);
}
if (chunk.HeaderComplete)
{
Writer.WriteStartReturn()
.WriteStartNewObject(Context.Host.GeneratedClassContext.TemplateTypeName);
lambdaScope = Writer.BuildLambda(endLine: false, parameterNames: HelperWriterName);
}
string currentTargetWriterName = Context.TargetWriterName;
Context.TargetWriterName = HelperWriterName;
// Generate children code
_codeVisitor.Accept(chunk.Children);
Context.TargetWriterName = currentTargetWriterName;
if (chunk.HeaderComplete)
{
lambdaScope.Dispose();
Writer.WriteEndMethodInvocation();
}
if (chunk.Footer != null && !String.IsNullOrEmpty(chunk.Footer.Value))
{
using (Writer.BuildLineMapping(chunk.Footer.Location, chunk.Footer.Value.Length, Context.SourceFile))
{
Writer.Write(chunk.Footer);
}
}
Writer.WriteLine();
}
}
}
|
using System;
namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
{
public class CSharpHelperVisitor : CodeVisitor<CSharpCodeWriter>
{
private const string HelperWriterName = "__razor_helper_writer";
private CSharpCodeVisitor _codeVisitor;
public CSharpHelperVisitor(CSharpCodeWriter writer, CodeGeneratorContext context)
: base(writer, context)
{
_codeVisitor = new CSharpCodeVisitor(writer, context);
}
protected override void Visit(HelperChunk chunk)
{
IDisposable lambdaScope = null;
using (CSharpLineMappingWriter mappingWriter = Writer.BuildLineMapping(chunk.Signature.Location, chunk.Signature.Value.Length, Context.SourceFile))
{
string accessibility = "public " + (Context.Host.StaticHelpers ? "static" : String.Empty);
Writer.Write(accessibility).Write(" ").Write(Context.Host.GeneratedClassContext.TemplateTypeName).Write(" ");
mappingWriter.MarkLineMappingStart();
Writer.Write(chunk.Signature);
mappingWriter.MarkLineMappingEnd();
}
if (chunk.HeaderComplete)
{
Writer.WriteStartReturn()
.WriteStartNewObject(Context.Host.GeneratedClassContext.TemplateTypeName);
lambdaScope = Writer.BuildLambda(endLine: false, parameterNames: HelperWriterName);
}
string currentTargetWriterName = Context.TargetWriterName;
Context.TargetWriterName = HelperWriterName;
// Generate children code
_codeVisitor.Accept(chunk.Children);
Context.TargetWriterName = currentTargetWriterName;
if (chunk.HeaderComplete)
{
lambdaScope.Dispose();
Writer.WriteEndMethodInvocation();
}
if (chunk.Footer != null && !String.IsNullOrEmpty(chunk.Footer.Value))
{
using (Writer.BuildLineMapping(chunk.Footer.Location, chunk.Footer.Value.Length, Context.SourceFile))
{
Writer.Write(chunk.Footer);
}
}
Writer.WriteLine();
}
}
}
|
apache-2.0
|
C#
|
e0d8210f6a00ffbf4f0a8a49790743767dc4891a
|
Fix XML comment (#34701)
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
src/Components/Server/src/BlazorPack/BlazorPackHubProtocol.cs
|
src/Components/Server/src/BlazorPack/BlazorPackHubProtocol.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Buffers;
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.SignalR.Internal;
using Microsoft.AspNetCore.SignalR.Protocol;
namespace Microsoft.AspNetCore.Components.Server.BlazorPack
{
/// <summary>
/// Implements the SignalR Hub Protocol using MessagePack with limited type support.
/// </summary>
[NonDefaultHubProtocol]
internal sealed class BlazorPackHubProtocol : IHubProtocol
{
internal const string ProtocolName = "blazorpack";
private const int ProtocolVersion = 1;
private readonly BlazorPackHubProtocolWorker _worker = new BlazorPackHubProtocolWorker();
/// <inheritdoc />
public string Name => ProtocolName;
/// <inheritdoc />
public int Version => ProtocolVersion;
/// <inheritdoc />
public TransferFormat TransferFormat => TransferFormat.Binary;
/// <inheritdoc />
public bool IsVersionSupported(int version)
{
return version == Version;
}
/// <inheritdoc />
public bool TryParseMessage(ref ReadOnlySequence<byte> input, IInvocationBinder binder, out HubMessage message)
=> _worker.TryParseMessage(ref input, binder, out message);
/// <inheritdoc />
public void WriteMessage(HubMessage message, IBufferWriter<byte> output)
=> _worker.WriteMessage(message, output);
/// <inheritdoc />
public ReadOnlyMemory<byte> GetMessageBytes(HubMessage message)
=> _worker.GetMessageBytes(message);
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Buffers;
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.SignalR.Internal;
using Microsoft.AspNetCore.SignalR.Protocol;
namespace Microsoft.AspNetCore.Components.Server.BlazorPack
{
/// <summary>
/// Implements the SignalR Hub Protocol using MessagePack with limited type support.
/// </summary>
[NonDefaultHubProtocol]
internal sealed class BlazorPackHubProtocol : IHubProtocol
{
internal const string ProtocolName = "blazorpack";
private const int ProtocolVersion = 1;
private readonly BlazorPackHubProtocolWorker _worker = new BlazorPackHubProtocolWorker();
/// <inheritdoc />
public string Name => ProtocolName;
/// <inheritdoc />
public int Version => ProtocolVersion;
/// <inheritdoc />
public TransferFormat TransferFormat => TransferFormat.Binary;
/// <inheritdoc />
public bool IsVersionSupported(int version)
{
return version == Version;
}
/// <inheritdoc />
public bool TryParseMessage(ref ReadOnlySequence<byte> input, IInvocationBinder binder, out HubMessage message)
=> _worker.TryParseMessage(ref input, binder, out message);
/// <inheritdoc />
public void WriteMessage(HubMessage message, IBufferWriter<byte> output)
=> _worker.WriteMessage(message, output);
///// <inheritdoc />
public ReadOnlyMemory<byte> GetMessageBytes(HubMessage message)
=> _worker.GetMessageBytes(message);
}
}
|
apache-2.0
|
C#
|
b84ef301e0462aaa3ce955444bbd60cbd3a17e93
|
Remove extra comment line
|
twsouthwick/corefx,benjamin-bader/corefx,lggomez/corefx,tstringer/corefx,mokchhya/corefx,dotnet-bot/corefx,wtgodbe/corefx,benpye/corefx,ericstj/corefx,gkhanna79/corefx,Petermarcu/corefx,dsplaisted/corefx,rjxby/corefx,BrennanConroy/corefx,ViktorHofer/corefx,stephenmichaelf/corefx,benpye/corefx,tijoytom/corefx,jcme/corefx,iamjasonp/corefx,twsouthwick/corefx,parjong/corefx,tijoytom/corefx,zhenlan/corefx,ravimeda/corefx,shimingsg/corefx,marksmeltzer/corefx,shahid-pk/corefx,marksmeltzer/corefx,rubo/corefx,tstringer/corefx,rahku/corefx,ellismg/corefx,benjamin-bader/corefx,Ermiar/corefx,fgreinacher/corefx,stone-li/corefx,rahku/corefx,krk/corefx,alphonsekurian/corefx,ravimeda/corefx,krytarowski/corefx,alphonsekurian/corefx,shimingsg/corefx,Ermiar/corefx,the-dwyer/corefx,shahid-pk/corefx,parjong/corefx,dotnet-bot/corefx,zhenlan/corefx,rjxby/corefx,marksmeltzer/corefx,Jiayili1/corefx,Jiayili1/corefx,Ermiar/corefx,alexperovich/corefx,ViktorHofer/corefx,marksmeltzer/corefx,mmitche/corefx,dhoehna/corefx,kkurni/corefx,shmao/corefx,twsouthwick/corefx,JosephTremoulet/corefx,dotnet-bot/corefx,dhoehna/corefx,axelheer/corefx,dsplaisted/corefx,Priya91/corefx-1,Chrisboh/corefx,lggomez/corefx,rahku/corefx,pallavit/corefx,alphonsekurian/corefx,weltkante/corefx,Petermarcu/corefx,kkurni/corefx,stephenmichaelf/corefx,stephenmichaelf/corefx,richlander/corefx,nbarbettini/corefx,DnlHarvey/corefx,tstringer/corefx,shimingsg/corefx,tijoytom/corefx,MaggieTsang/corefx,yizhang82/corefx,alexperovich/corefx,SGuyGe/corefx,Chrisboh/corefx,krytarowski/corefx,JosephTremoulet/corefx,MaggieTsang/corefx,yizhang82/corefx,stone-li/corefx,JosephTremoulet/corefx,pallavit/corefx,richlander/corefx,Priya91/corefx-1,krk/corefx,benjamin-bader/corefx,seanshpark/corefx,nbarbettini/corefx,BrennanConroy/corefx,billwert/corefx,khdang/corefx,YoupHulsebos/corefx,mazong1123/corefx,krk/corefx,yizhang82/corefx,nchikanov/corefx,the-dwyer/corefx,yizhang82/corefx,elijah6/corefx,lggomez/corefx,wtgodbe/corefx,marksmeltzer/corefx,JosephTremoulet/corefx,dotnet-bot/corefx,ellismg/corefx,mokchhya/corefx,ptoonen/corefx,weltkante/corefx,jlin177/corefx,ericstj/corefx,yizhang82/corefx,zhenlan/corefx,krytarowski/corefx,jlin177/corefx,zhenlan/corefx,rubo/corefx,SGuyGe/corefx,mokchhya/corefx,parjong/corefx,kkurni/corefx,Priya91/corefx-1,gkhanna79/corefx,ViktorHofer/corefx,benjamin-bader/corefx,marksmeltzer/corefx,axelheer/corefx,Ermiar/corefx,ViktorHofer/corefx,nchikanov/corefx,stone-li/corefx,cartermp/corefx,seanshpark/corefx,ravimeda/corefx,dotnet-bot/corefx,nbarbettini/corefx,pallavit/corefx,MaggieTsang/corefx,jcme/corefx,jhendrixMSFT/corefx,YoupHulsebos/corefx,weltkante/corefx,jhendrixMSFT/corefx,twsouthwick/corefx,mokchhya/corefx,alexperovich/corefx,YoupHulsebos/corefx,ericstj/corefx,richlander/corefx,Petermarcu/corefx,jlin177/corefx,mmitche/corefx,ericstj/corefx,elijah6/corefx,cydhaselton/corefx,manu-silicon/corefx,iamjasonp/corefx,manu-silicon/corefx,adamralph/corefx,nchikanov/corefx,shahid-pk/corefx,seanshpark/corefx,shmao/corefx,rubo/corefx,iamjasonp/corefx,iamjasonp/corefx,ericstj/corefx,jhendrixMSFT/corefx,mmitche/corefx,JosephTremoulet/corefx,gkhanna79/corefx,lggomez/corefx,lggomez/corefx,ptoonen/corefx,mmitche/corefx,yizhang82/corefx,shimingsg/corefx,BrennanConroy/corefx,Chrisboh/corefx,nbarbettini/corefx,manu-silicon/corefx,khdang/corefx,gkhanna79/corefx,alphonsekurian/corefx,zhenlan/corefx,elijah6/corefx,cartermp/corefx,lggomez/corefx,iamjasonp/corefx,stone-li/corefx,jlin177/corefx,khdang/corefx,Jiayili1/corefx,alphonsekurian/corefx,dhoehna/corefx,cartermp/corefx,weltkante/corefx,stone-li/corefx,zhenlan/corefx,ViktorHofer/corefx,ericstj/corefx,ravimeda/corefx,Ermiar/corefx,manu-silicon/corefx,ViktorHofer/corefx,rahku/corefx,wtgodbe/corefx,Petermarcu/corefx,rubo/corefx,wtgodbe/corefx,richlander/corefx,rahku/corefx,mazong1123/corefx,ellismg/corefx,MaggieTsang/corefx,gkhanna79/corefx,shimingsg/corefx,shmao/corefx,YoupHulsebos/corefx,rjxby/corefx,tijoytom/corefx,krytarowski/corefx,pallavit/corefx,mokchhya/corefx,cartermp/corefx,tstringer/corefx,krk/corefx,zhenlan/corefx,cydhaselton/corefx,JosephTremoulet/corefx,tijoytom/corefx,richlander/corefx,SGuyGe/corefx,pallavit/corefx,cydhaselton/corefx,billwert/corefx,mazong1123/corefx,nbarbettini/corefx,DnlHarvey/corefx,shimingsg/corefx,cydhaselton/corefx,wtgodbe/corefx,gkhanna79/corefx,gkhanna79/corefx,pallavit/corefx,seanshpark/corefx,khdang/corefx,billwert/corefx,mmitche/corefx,wtgodbe/corefx,rahku/corefx,stephenmichaelf/corefx,ellismg/corefx,mazong1123/corefx,tijoytom/corefx,krytarowski/corefx,rjxby/corefx,Jiayili1/corefx,adamralph/corefx,SGuyGe/corefx,alexperovich/corefx,parjong/corefx,billwert/corefx,kkurni/corefx,ellismg/corefx,shahid-pk/corefx,fgreinacher/corefx,manu-silicon/corefx,jlin177/corefx,billwert/corefx,manu-silicon/corefx,mazong1123/corefx,axelheer/corefx,marksmeltzer/corefx,krytarowski/corefx,axelheer/corefx,alexperovich/corefx,ptoonen/corefx,mmitche/corefx,the-dwyer/corefx,jhendrixMSFT/corefx,SGuyGe/corefx,jlin177/corefx,ravimeda/corefx,rubo/corefx,benjamin-bader/corefx,tstringer/corefx,tstringer/corefx,Priya91/corefx-1,axelheer/corefx,twsouthwick/corefx,jcme/corefx,Jiayili1/corefx,Chrisboh/corefx,benpye/corefx,shmao/corefx,ptoonen/corefx,ptoonen/corefx,benjamin-bader/corefx,seanshpark/corefx,MaggieTsang/corefx,stephenmichaelf/corefx,krk/corefx,ptoonen/corefx,shimingsg/corefx,fgreinacher/corefx,yizhang82/corefx,Priya91/corefx-1,MaggieTsang/corefx,mokchhya/corefx,nchikanov/corefx,alexperovich/corefx,ravimeda/corefx,dotnet-bot/corefx,alphonsekurian/corefx,jhendrixMSFT/corefx,ViktorHofer/corefx,rjxby/corefx,weltkante/corefx,rjxby/corefx,tijoytom/corefx,shahid-pk/corefx,alphonsekurian/corefx,YoupHulsebos/corefx,the-dwyer/corefx,DnlHarvey/corefx,adamralph/corefx,jlin177/corefx,stone-li/corefx,stone-li/corefx,parjong/corefx,mmitche/corefx,Jiayili1/corefx,cartermp/corefx,fgreinacher/corefx,krk/corefx,benpye/corefx,khdang/corefx,YoupHulsebos/corefx,twsouthwick/corefx,Jiayili1/corefx,nbarbettini/corefx,SGuyGe/corefx,wtgodbe/corefx,parjong/corefx,krk/corefx,nbarbettini/corefx,Ermiar/corefx,seanshpark/corefx,Priya91/corefx-1,dsplaisted/corefx,benpye/corefx,DnlHarvey/corefx,jcme/corefx,jhendrixMSFT/corefx,Petermarcu/corefx,elijah6/corefx,richlander/corefx,rahku/corefx,jcme/corefx,cydhaselton/corefx,Chrisboh/corefx,parjong/corefx,dotnet-bot/corefx,twsouthwick/corefx,elijah6/corefx,iamjasonp/corefx,DnlHarvey/corefx,YoupHulsebos/corefx,mazong1123/corefx,the-dwyer/corefx,jhendrixMSFT/corefx,nchikanov/corefx,lggomez/corefx,billwert/corefx,JosephTremoulet/corefx,shmao/corefx,kkurni/corefx,billwert/corefx,mazong1123/corefx,weltkante/corefx,ravimeda/corefx,dhoehna/corefx,richlander/corefx,stephenmichaelf/corefx,manu-silicon/corefx,dhoehna/corefx,shmao/corefx,krytarowski/corefx,cydhaselton/corefx,MaggieTsang/corefx,DnlHarvey/corefx,iamjasonp/corefx,elijah6/corefx,ericstj/corefx,shahid-pk/corefx,ellismg/corefx,dhoehna/corefx,khdang/corefx,cartermp/corefx,cydhaselton/corefx,Petermarcu/corefx,dhoehna/corefx,weltkante/corefx,the-dwyer/corefx,ptoonen/corefx,seanshpark/corefx,jcme/corefx,Ermiar/corefx,Chrisboh/corefx,elijah6/corefx,rjxby/corefx,nchikanov/corefx,shmao/corefx,nchikanov/corefx,DnlHarvey/corefx,stephenmichaelf/corefx,alexperovich/corefx,kkurni/corefx,axelheer/corefx,Petermarcu/corefx,the-dwyer/corefx,benpye/corefx
|
src/System.Data.Common/src/System/Data/Common/DbDataRecord.cs
|
src/System.Data.Common/src/System/Data/Common/DbDataRecord.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.
namespace System.Data.Common
{
public abstract class DbDataRecord : IDataRecord
{
protected DbDataRecord()
{
}
public abstract int FieldCount
{
get;
}
public abstract object this[int i]
{
get;
}
public abstract object this[string name]
{
get;
}
public abstract bool GetBoolean(int i);
public abstract byte GetByte(int i);
public abstract long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
public abstract char GetChar(int i);
public abstract long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length);
virtual protected DbDataReader GetDbDataReader(int i)
{
// NOTE: This method is virtual because we're required to implement
// it however most providers won't support it. Only the OLE DB
// provider supports it right now, and they can override it.
throw ADP.NotSupported();
}
public abstract string GetDataTypeName(int i);
public abstract DateTime GetDateTime(int i);
public abstract Decimal GetDecimal(int i);
public abstract double GetDouble(int i);
public abstract Type GetFieldType(int i);
public abstract float GetFloat(int i);
public abstract Guid GetGuid(int i);
public abstract Int16 GetInt16(int i);
public abstract Int32 GetInt32(int i);
public abstract Int64 GetInt64(int i);
public abstract string GetName(int i);
public abstract int GetOrdinal(string name);
public abstract string GetString(int i);
public abstract object GetValue(int i);
public abstract int GetValues(object[] values);
public abstract bool IsDBNull(int i);
public IDataReader GetData(int i)
{
return GetDbDataReader(i);
}
}
}
|
// 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.
//------------------------------------------------------------------------------
namespace System.Data.Common
{
public abstract class DbDataRecord : IDataRecord
{
protected DbDataRecord()
{
}
public abstract int FieldCount
{
get;
}
public abstract object this[int i]
{
get;
}
public abstract object this[string name]
{
get;
}
public abstract bool GetBoolean(int i);
public abstract byte GetByte(int i);
public abstract long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
public abstract char GetChar(int i);
public abstract long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length);
virtual protected DbDataReader GetDbDataReader(int i)
{
// NOTE: This method is virtual because we're required to implement
// it however most providers won't support it. Only the OLE DB
// provider supports it right now, and they can override it.
throw ADP.NotSupported();
}
public abstract string GetDataTypeName(int i);
public abstract DateTime GetDateTime(int i);
public abstract Decimal GetDecimal(int i);
public abstract double GetDouble(int i);
public abstract Type GetFieldType(int i);
public abstract float GetFloat(int i);
public abstract Guid GetGuid(int i);
public abstract Int16 GetInt16(int i);
public abstract Int32 GetInt32(int i);
public abstract Int64 GetInt64(int i);
public abstract string GetName(int i);
public abstract int GetOrdinal(string name);
public abstract string GetString(int i);
public abstract object GetValue(int i);
public abstract int GetValues(object[] values);
public abstract bool IsDBNull(int i);
public IDataReader GetData(int i)
{
return GetDbDataReader(i);
}
}
}
|
mit
|
C#
|
321b67efd485e8ce061f768ad656b1f39c786454
|
remove password type input on passphrase
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer/Models/WalletViewModels/SignWithSeedViewModel.cs
|
BTCPayServer/Models/WalletViewModels/SignWithSeedViewModel.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using NBitcoin;
namespace BTCPayServer.Models.WalletViewModels
{
public class SignWithSeedViewModel
{
public SigningContextModel SigningContext { get; set; } = new SigningContextModel();
[Required]
[Display(Name = "BIP39 Seed (12/24 word mnemonic phrase) or HD private key (xprv...)")]
public string SeedOrKey { get; set; }
[Display(Name = "Optional seed passphrase")]
public string Passphrase { get; set; }
public ExtKey GetExtKey(Network network)
{
ExtKey extKey = null;
try
{
var mnemonic = new Mnemonic(SeedOrKey);
extKey = mnemonic.DeriveExtKey(Passphrase);
}
catch (Exception)
{
}
if (extKey == null)
{
try
{
extKey = ExtKey.Parse(SeedOrKey, network);
}
catch (Exception)
{
}
}
return extKey;
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using NBitcoin;
namespace BTCPayServer.Models.WalletViewModels
{
public class SignWithSeedViewModel
{
public SigningContextModel SigningContext { get; set; } = new SigningContextModel();
[Required]
[Display(Name = "BIP39 Seed (12/24 word mnemonic phrase) or HD private key (xprv...)")]
public string SeedOrKey { get; set; }
[Display(Name = "Optional seed passphrase")]
[DataType(DataType.Password)]
public string Passphrase { get; set; }
public ExtKey GetExtKey(Network network)
{
ExtKey extKey = null;
try
{
var mnemonic = new Mnemonic(SeedOrKey);
extKey = mnemonic.DeriveExtKey(Passphrase);
}
catch (Exception)
{
}
if (extKey == null)
{
try
{
extKey = ExtKey.Parse(SeedOrKey, network);
}
catch (Exception)
{
}
}
return extKey;
}
}
}
|
mit
|
C#
|
fee5126aa694ee58a613c7d87d949fa3f69176d8
|
Fix integrationtest.
|
ExRam/ExRam.Gremlinq
|
test/ExRam.Gremlinq.Providers.JanusGraph.Tests/JanusGraphIntegrationTests.cs
|
test/ExRam.Gremlinq.Providers.JanusGraph.Tests/JanusGraphIntegrationTests.cs
|
#if RELEASE && NET5_0 && RUNJANUSGRAPHINTEGRATIONTESTS
using System;
using System.Collections.Immutable;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using ExRam.Gremlinq.Core;
using ExRam.Gremlinq.Core.Tests;
using Xunit;
using Xunit.Abstractions;
using static ExRam.Gremlinq.Core.GremlinQuerySource;
namespace ExRam.Gremlinq.Providers.JanusGraph.Tests
{
public class JanusGraphIntegrationTests : QueryIntegrationTest
{
private static readonly Regex RelationIdRegex = new("\"relationId\":[\\s]?\"[0-9a-z]{3}([-][0-9a-z]{3})*\"", RegexOptions.IgnoreCase);
public JanusGraphIntegrationTests(ITestOutputHelper testOutputHelper) : base(
g
.ConfigureEnvironment(env => env
.UseJanusGraph(builder => builder
.At(new Uri("ws://localhost:8183")))
.ConfigureExecutor(_ => _
.TransformResult(_ => AsyncEnumerable.Empty<object>()))),
testOutputHelper)
{
}
[Fact(Skip = "ServerError: Expected valid relation id: id")]
public override Task Properties_Where_Id()
{
return base.Properties_Where_Id();
}
[Fact(Skip = "ServerError: Expected valid relation id: id")]
public override Task Properties_Where_Id_equals_static_field()
{
return base.Properties_Where_Id_equals_static_field();
}
public override IImmutableList<Func<string, string>> Scrubbers()
{
return base.Scrubbers()
.Add(x => RelationIdRegex.Replace(x, "\"relationId\": \"scrubbed\""));
}
}
}
#endif
|
#if RELEASE && NET5_0 && RUNJANUSGRAPHINTEGRATIONTESTS
using System;
using System.Collections.Immutable;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using ExRam.Gremlinq.Core;
using ExRam.Gremlinq.Core.Tests;
using ExRam.Gremlinq.Providers.WebSocket;
using Newtonsoft.Json.Linq;
using Xunit;
using Xunit.Abstractions;
using static ExRam.Gremlinq.Core.GremlinQuerySource;
namespace ExRam.Gremlinq.Providers.JanusGraph.Tests
{
public class JanusGraphIntegrationTests : QueryIntegrationTest
{
private static readonly Regex RelationIdRegex = new("\"relationId\":[\\s]?\"[0-9a-z]{3}([-][0-9a-z]{3})*\"", RegexOptions.IgnoreCase);
public JanusGraphIntegrationTests(ITestOutputHelper testOutputHelper) : base(
g
.ConfigureEnvironment(env => env
.UseJanusGraph(builder => builder
.At("ws://localhost:8183"))
.ConfigureExecutor(_ => _
.TransformResult(_ => AsyncEnumerable.Empty<object>()))),
testOutputHelper)
{
}
[Fact(Skip = "ServerError: Expected valid relation id: id")]
public override Task Properties_Where_Id()
{
return base.Properties_Where_Id();
}
[Fact(Skip = "ServerError: Expected valid relation id: id")]
public override Task Properties_Where_Id_equals_static_field()
{
return base.Properties_Where_Id_equals_static_field();
}
public override IImmutableList<Func<string, string>> Scrubbers()
{
return base.Scrubbers()
.Add(x => RelationIdRegex.Replace(x, "\"relationId\": \"scrubbed\""));
}
}
}
#endif
|
mit
|
C#
|
7bc2b4b6b7ad569bd2b4716344e3872548fd7283
|
Make changes per review
|
oliver-feng/nuget,akrisiun/NuGet,mrward/nuget,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,rikoe/nuget,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,mono/nuget,OneGet/nuget,themotleyfool/NuGet,ctaggart/nuget,antiufo/NuGet2,alluran/node.net,chester89/nugetApi,mrward/nuget,zskullz/nuget,pratikkagda/nuget,mrward/nuget,pratikkagda/nuget,chocolatey/nuget-chocolatey,antiufo/NuGet2,jmezach/NuGet2,dolkensp/node.net,RichiCoder1/nuget-chocolatey,dolkensp/node.net,mrward/NuGet.V2,rikoe/nuget,chocolatey/nuget-chocolatey,jholovacs/NuGet,chocolatey/nuget-chocolatey,RichiCoder1/nuget-chocolatey,rikoe/nuget,pratikkagda/nuget,themotleyfool/NuGet,themotleyfool/NuGet,jmezach/NuGet2,ctaggart/nuget,GearedToWar/NuGet2,xoofx/NuGet,zskullz/nuget,xoofx/NuGet,OneGet/nuget,RichiCoder1/nuget-chocolatey,mono/nuget,oliver-feng/nuget,chester89/nugetApi,indsoft/NuGet2,mrward/nuget,mrward/nuget,mrward/NuGet.V2,kumavis/NuGet,indsoft/NuGet2,jmezach/NuGet2,anurse/NuGet,mrward/NuGet.V2,alluran/node.net,chocolatey/nuget-chocolatey,oliver-feng/nuget,mono/nuget,OneGet/nuget,indsoft/NuGet2,ctaggart/nuget,zskullz/nuget,jholovacs/NuGet,xoofx/NuGet,mono/nuget,xero-github/Nuget,jmezach/NuGet2,dolkensp/node.net,GearedToWar/NuGet2,OneGet/nuget,GearedToWar/NuGet2,atheken/nuget,antiufo/NuGet2,alluran/node.net,alluran/node.net,xoofx/NuGet,jholovacs/NuGet,anurse/NuGet,pratikkagda/nuget,jmezach/NuGet2,atheken/nuget,antiufo/NuGet2,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,GearedToWar/NuGet2,antiufo/NuGet2,RichiCoder1/nuget-chocolatey,mrward/nuget,kumavis/NuGet,akrisiun/NuGet,ctaggart/nuget,xoofx/NuGet,GearedToWar/NuGet2,pratikkagda/nuget,mrward/NuGet.V2,jmezach/NuGet2,antiufo/NuGet2,oliver-feng/nuget,jholovacs/NuGet,indsoft/NuGet2,oliver-feng/nuget,xoofx/NuGet,mrward/NuGet.V2,jholovacs/NuGet,mrward/NuGet.V2,dolkensp/node.net,jholovacs/NuGet,rikoe/nuget,zskullz/nuget,oliver-feng/nuget,GearedToWar/NuGet2,pratikkagda/nuget
|
src/VsExtension/FontAndColorsRegistrationAttribute.cs
|
src/VsExtension/FontAndColorsRegistrationAttribute.cs
|
using Microsoft.VisualStudio.Shell;
namespace NuGet.Tools {
/// <summary>
/// This class is used to create a registry key for the FontAndColors category
/// </summary>
public class FontAndColorsRegistrationAttribute : RegistrationAttribute {
// this GUID is used by all VSPackages that use the default font and color configurations.
// http://msdn.microsoft.com/en-us/library/bb165737.aspx
private const string PackageGuid = "{F5E7E71D-1401-11D1-883B-0000F87579D2}";
// this ID is set in VSPackage.resx
private const int CategoryNameResourceID = 200;
public string CategoryGuid { get; private set; }
public string ToolWindowPackageGuid { get; private set; }
public string CategoryKey { get; private set; }
public FontAndColorsRegistrationAttribute(string categoryKeyName, string categoryGuid, string toolWindowPackageGuid) {
CategoryGuid = categoryGuid;
ToolWindowPackageGuid = toolWindowPackageGuid;
CategoryKey = "FontAndColors\\" + categoryKeyName;
}
public override void Register(RegistrationContext context) {
using (var key = context.CreateKey(CategoryKey)) {
key.SetValue("Category", CategoryGuid);
key.SetValue("Package", PackageGuid);
key.SetValue("NameID", CategoryNameResourceID);
key.SetValue("ToolWindowPackage", ToolWindowPackageGuid);
// IMPORTANT: without calling Close() the values won't be persisted to registry.
key.Close();
}
}
public override void Unregister(RegistrationContext context) {
context.RemoveKey(CategoryKey);
}
}
}
|
using Microsoft.VisualStudio.Shell;
namespace NuGet.Tools {
/// <summary>
/// This class is used to create a registry key for the FontAndColors category
/// </summary>
public class FontAndColorsRegistrationAttribute : RegistrationAttribute {
// this GUID is used by all VSPackages that use the default font and color configurations.
// http://msdn.microsoft.com/en-us/library/bb165737.aspx
private const string PackageGuid = "{F5E7E71D-1401-11D1-883B-0000F87579D2}";
// this ID is set in VSPackage.resx
private const int CategoryNameResourceID = 200;
public string CategoryGuid { get; private set; }
public string ToolWindowPackageGuid { get; private set; }
public string CategoryKey { get; private set; }
public FontAndColorsRegistrationAttribute(string categoryKeyName, string categoryGuid, string toolWindowPackageGuid) {
CategoryGuid = categoryGuid;
ToolWindowPackageGuid = toolWindowPackageGuid;
CategoryKey = "FontAndColors\\" + categoryKeyName;
}
public override void Register(RegistrationContext context) {
var key = context.CreateKey(CategoryKey);
key.SetValue("Category", CategoryGuid);
key.SetValue("Package", PackageGuid);
key.SetValue("NameID", CategoryNameResourceID);
key.SetValue("ToolWindowPackage", ToolWindowPackageGuid);
// IMPORTANT: without calling Close() the values won't be persisted to registry.
key.Close();
}
public override void Unregister(RegistrationContext context) {
context.RemoveKey(CategoryKey);
}
}
}
|
apache-2.0
|
C#
|
7bf7082c33452e13aab2874e6b3ce43d82321c19
|
Set ShowEverythingOnOnePage = true;
|
endeavourhealth/FHIR-Tools,endeavourhealth/FHIR-Tools,endeavourhealth/FHIR-Tools
|
FhirProfilePublisher/FhirProfilePublisher.Engine/Model/OutputConfiguration.cs
|
FhirProfilePublisher/FhirProfilePublisher.Engine/Model/OutputConfiguration.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FhirProfilePublisher.Engine
{
public class OutputOptions
{
public string HeaderText { get; set; }
public string PageTitleSuffix { get; set; }
public string FooterText { get; set; }
public string IndexPageHtml { get; set; }
public string PageTemplate { get; set; }
public bool ShowEverythingOnOnePage { get; set; } = true;
public bool ShowResourcesInW5Group { get; set; }
public ResourceMaturity[] ListOnlyResourcesWithMaturity { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FhirProfilePublisher.Engine
{
public class OutputOptions
{
public string HeaderText { get; set; }
public string PageTitleSuffix { get; set; }
public string FooterText { get; set; }
public string IndexPageHtml { get; set; }
public string PageTemplate { get; set; }
public bool ShowEverythingOnOnePage { get; set; }
public bool ShowResourcesInW5Group { get; set; }
public ResourceMaturity[] ListOnlyResourcesWithMaturity { get; set; }
}
}
|
apache-2.0
|
C#
|
385d15fc10861ffe335316f1543c18ba95ecc77b
|
Stop running Repository.CompleteAsync if the saga was never Repository.CreateAsync
|
Lavinski/Enexure.MicroBus
|
src/Enexure.MicroBus.Sagas/SagaRunnerEventHandler.cs
|
src/Enexure.MicroBus.Sagas/SagaRunnerEventHandler.cs
|
using System;
using System.Threading.Tasks;
using System.Reflection;
using System.Linq;
namespace Enexure.MicroBus.Sagas
{
public class SagaRunnerEventHandler<TSaga, TEvent> : IEventHandler<TEvent>
where TEvent : IEvent
where TSaga : class, ISaga
{
private readonly ISagaRepository<TSaga> sagaRepository;
private readonly IDependencyScope scope;
public SagaRunnerEventHandler(ISagaRepository<TSaga> sagaRepository, IDependencyScope scope)
{
this.scope = scope;
this.sagaRepository = sagaRepository;
}
public async Task Handle(TEvent @event)
{
var isNew = false;
var isStartable = typeof(ISagaStartedBy<TEvent>).GetTypeInfo().IsAssignableFrom(typeof(TSaga).GetTypeInfo());
var sagaFinder = ReflectionExtensions.ExpandType(typeof(TEvent))
.Select(x => typeof(ISagaFinder<,>).MakeGenericType(typeof(TSaga), x))
.Select(x => scope.GetServices(x).FirstOrDefault())
.Where(x => x != null)
.Select(x =>
{
var finderType = x.GetType();
var findByAsync = finderType.GetRuntimeMethods().First(m => m.Name == "FindByAsync");
return new Func<TEvent, Task<TSaga>>(e => (Task<TSaga>)findByAsync.Invoke(x, new object[] { e }));
})
.FirstOrDefault();
TSaga saga;
if (isStartable) {
saga = await FindSaga(@event, sagaFinder);
if (saga == null)
{
isNew = true;
saga = sagaRepository.NewSaga();
}
} else {
saga = await FindSaga(@event, sagaFinder);
if (saga == null) {
throw new NoSagaFoundException(typeof(TSaga), typeof(TEvent));
}
}
// ReSharper disable once SuspiciousTypeConversion.Global
await ((IEventHandler<TEvent>)saga).Handle(@event);
if (!saga.IsCompleted && isNew) {
await sagaRepository.CreateAsync(saga);
} else if (saga.IsCompleted) {
if (!isNew) {
await sagaRepository.CompleteAsync(saga);
}
} else {
await sagaRepository.UpdateAsync(saga);
}
}
private Task<TSaga> FindSaga(TEvent @event, Func<TEvent, Task<TSaga>> sagaFinder)
{
return sagaFinder != null ? sagaFinder(@event) : sagaRepository.FindAsync(@event);
}
}
}
|
using System;
using System.Threading.Tasks;
using System.Reflection;
using System.Linq;
namespace Enexure.MicroBus.Sagas
{
public class SagaRunnerEventHandler<TSaga, TEvent> : IEventHandler<TEvent>
where TEvent : IEvent
where TSaga : class, ISaga
{
private readonly ISagaRepository<TSaga> sagaRepository;
private readonly IDependencyScope scope;
public SagaRunnerEventHandler(ISagaRepository<TSaga> sagaRepository, IDependencyScope scope)
{
this.scope = scope;
this.sagaRepository = sagaRepository;
}
public async Task Handle(TEvent @event)
{
var isNew = false;
var isStartable = typeof(ISagaStartedBy<TEvent>).GetTypeInfo().IsAssignableFrom(typeof(TSaga).GetTypeInfo());
var sagaFinder = ReflectionExtensions.ExpandType(typeof(TEvent))
.Select(x => typeof(ISagaFinder<,>).MakeGenericType(typeof(TSaga), x))
.Select(x => scope.GetServices(x).FirstOrDefault())
.Where(x => x != null)
.Select(x =>
{
var finderType = x.GetType();
var findByAsync = finderType.GetRuntimeMethods().First(m => m.Name == "FindByAsync");
return new Func<TEvent, Task<TSaga>>(e => (Task<TSaga>)findByAsync.Invoke(x, new object[] { e }));
})
.FirstOrDefault();
TSaga saga;
if (isStartable) {
saga = await FindSaga(@event, sagaFinder);
if (saga == null)
{
isNew = true;
saga = sagaRepository.NewSaga();
}
} else {
saga = await FindSaga(@event, sagaFinder);
if (saga == null) {
throw new NoSagaFoundException(typeof(TSaga), typeof(TEvent));
}
}
// ReSharper disable once SuspiciousTypeConversion.Global
await ((IEventHandler<TEvent>)saga).Handle(@event);
if (!saga.IsCompleted && isNew) {
await sagaRepository.CreateAsync(saga);
} else if (saga.IsCompleted) {
await sagaRepository.CompleteAsync(saga);
} else {
await sagaRepository.UpdateAsync(saga);
}
}
private Task<TSaga> FindSaga(TEvent @event, Func<TEvent, Task<TSaga>> sagaFinder)
{
return sagaFinder != null ? sagaFinder(@event) : sagaRepository.FindAsync(@event);
}
}
}
|
mit
|
C#
|
11540ab42ebfc39b1d2bf3e1d3945eef85e1cd05
|
Fix missing """
|
AArnott/Nerdbank.GitVersioning,AArnott/Nerdbank.GitVersioning,AArnott/Nerdbank.GitVersioning
|
src/NerdBank.GitVersioning.Tests/AssemblyInfoTest.cs
|
src/NerdBank.GitVersioning.Tests/AssemblyInfoTest.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nerdbank.GitVersioning.Tasks;
using Xunit;
namespace NerdBank.GitVersioning.Tests
{
public class AssemblyInfoTest
{
[Fact]
public void FSharpGenerator()
{
var info = new AssemblyVersionInfo();
info.AssemblyCompany = "company";
info.AssemblyFileVersion = "1.3.1.0";
info.AssemblyVersion = "1.3.0.0";
info.CodeLanguage = "f#";
var built = info.BuildCode();
var expected = @"//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AssemblyInfo
[<assembly: System.Reflection.AssemblyVersionAttribute(""1.3.0.0"")>]
[<assembly: System.Reflection.AssemblyFileVersionAttribute(""1.3.1.0"")>]
[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("""")>]
do()
[<System.CodeDom.Compiler.GeneratedCode(""" + AssemblyVersionInfo.GeneratorName + """,""" + AssemblyVersionInfo.GeneratorVerison + """)>]
type internal ThisAssembly() =
static member internal AssemblyVersion = ""1.3.0.0""
static member internal AssemblyFileVersion = ""1.3.1.0""
static member internal AssemblyCompany = ""company""
static member internal RootNamespace = """"
do()
";
Assert.Equal(expected, built);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nerdbank.GitVersioning.Tasks;
using Xunit;
namespace NerdBank.GitVersioning.Tests
{
public class AssemblyInfoTest
{
[Fact]
public void FSharpGenerator()
{
var info = new AssemblyVersionInfo();
info.AssemblyCompany = "company";
info.AssemblyFileVersion = "1.3.1.0";
info.AssemblyVersion = "1.3.0.0";
info.CodeLanguage = "f#";
var built = info.BuildCode();
var expected = @"//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AssemblyInfo
[<assembly: System.Reflection.AssemblyVersionAttribute(""1.3.0.0"")>]
[<assembly: System.Reflection.AssemblyFileVersionAttribute(""1.3.1.0"")>]
[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("""")>]
do()
[<System.CodeDom.Compiler.GeneratedCode("" + AssemblyVersionInfo.GeneratorName + "","" + AssemblyVersionInfo.GeneratorVerison + "")>]
type internal ThisAssembly() =
static member internal AssemblyVersion = ""1.3.0.0""
static member internal AssemblyFileVersion = ""1.3.1.0""
static member internal AssemblyCompany = ""company""
static member internal RootNamespace = """"
do()
";
Assert.Equal(expected, built);
}
}
}
|
mit
|
C#
|
1d5c75e3925e7103e61865299e9b200f8bcaa666
|
Use System.InvalidOperationException to avoid exception serialization failures
|
nguerrera/roslyn,dotnet/roslyn,weltkante/roslyn,aelij/roslyn,tannergooding/roslyn,mgoertz-msft/roslyn,xasx/roslyn,bkoelman/roslyn,diryboy/roslyn,jamesqo/roslyn,stephentoub/roslyn,heejaechang/roslyn,VSadov/roslyn,abock/roslyn,weltkante/roslyn,genlu/roslyn,physhi/roslyn,jmarolf/roslyn,stephentoub/roslyn,AlekseyTs/roslyn,OmarTawfik/roslyn,swaroop-sridhar/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,diryboy/roslyn,KevinRansom/roslyn,paulvanbrenk/roslyn,mgoertz-msft/roslyn,AmadeusW/roslyn,jcouv/roslyn,physhi/roslyn,KevinRansom/roslyn,diryboy/roslyn,jmarolf/roslyn,bartdesmet/roslyn,AmadeusW/roslyn,VSadov/roslyn,paulvanbrenk/roslyn,wvdd007/roslyn,MichalStrehovsky/roslyn,bartdesmet/roslyn,tmeschter/roslyn,jasonmalinowski/roslyn,physhi/roslyn,eriawan/roslyn,reaction1989/roslyn,bkoelman/roslyn,DustinCampbell/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,weltkante/roslyn,DustinCampbell/roslyn,heejaechang/roslyn,mavasani/roslyn,aelij/roslyn,xasx/roslyn,gafter/roslyn,jamesqo/roslyn,bartdesmet/roslyn,ErikSchierboom/roslyn,AlekseyTs/roslyn,tmeschter/roslyn,tmat/roslyn,AlekseyTs/roslyn,dpoeschl/roslyn,jamesqo/roslyn,jasonmalinowski/roslyn,agocke/roslyn,sharwell/roslyn,wvdd007/roslyn,abock/roslyn,gafter/roslyn,shyamnamboodiripad/roslyn,mgoertz-msft/roslyn,eriawan/roslyn,jcouv/roslyn,CyrusNajmabadi/roslyn,DustinCampbell/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,KirillOsenkov/roslyn,dotnet/roslyn,nguerrera/roslyn,sharwell/roslyn,reaction1989/roslyn,cston/roslyn,tmeschter/roslyn,CyrusNajmabadi/roslyn,heejaechang/roslyn,bkoelman/roslyn,ErikSchierboom/roslyn,paulvanbrenk/roslyn,swaroop-sridhar/roslyn,davkean/roslyn,eriawan/roslyn,swaroop-sridhar/roslyn,tannergooding/roslyn,genlu/roslyn,KirillOsenkov/roslyn,wvdd007/roslyn,cston/roslyn,jcouv/roslyn,xasx/roslyn,cston/roslyn,abock/roslyn,MichalStrehovsky/roslyn,nguerrera/roslyn,VSadov/roslyn,KirillOsenkov/roslyn,davkean/roslyn,dpoeschl/roslyn,KevinRansom/roslyn,davkean/roslyn,dotnet/roslyn,shyamnamboodiripad/roslyn,agocke/roslyn,reaction1989/roslyn,tmat/roslyn,aelij/roslyn,AmadeusW/roslyn,panopticoncentral/roslyn,sharwell/roslyn,brettfo/roslyn,gafter/roslyn,brettfo/roslyn,MichalStrehovsky/roslyn,mavasani/roslyn,stephentoub/roslyn,OmarTawfik/roslyn,OmarTawfik/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,panopticoncentral/roslyn,tannergooding/roslyn,agocke/roslyn,tmat/roslyn,jmarolf/roslyn,mavasani/roslyn,panopticoncentral/roslyn,ErikSchierboom/roslyn,genlu/roslyn,dpoeschl/roslyn
|
src/Test/Utilities/Portable/ThrowingTraceListener.cs
|
src/Test/Utilities/Portable/ThrowingTraceListener.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.Diagnostics;
namespace Microsoft.CodeAnalysis
{
// To enable this for a process, add the following to the app.config for the project:
//
// <configuration>
// <system.diagnostics>
// <trace>
// <listeners>
// <remove name="Default" />
// <add name="ThrowingTraceListener" type="Microsoft.CodeAnalysis.ThrowingTraceListener, Roslyn.Test.Utilities" />
// </listeners>
// </trace>
// </system.diagnostics>
//</configuration>
public sealed class ThrowingTraceListener : TraceListener
{
public override void Fail(string message, string detailMessage)
{
throw new InvalidOperationException(message + Environment.NewLine + detailMessage);
}
public override void Write(object o)
{
}
public override void Write(object o, string category)
{
}
public override void Write(string message)
{
}
public override void Write(string message, string category)
{
}
public override void WriteLine(object o)
{
}
public override void WriteLine(object o, string category)
{
}
public override void WriteLine(string message)
{
}
public override void WriteLine(string message, string category)
{
}
}
}
|
// 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.Diagnostics;
#if !NETSTANDARD1_3
using System.Runtime.Serialization;
#endif
namespace Microsoft.CodeAnalysis
{
// To enable this for a process, add the following to the app.config for the project:
//
// <configuration>
// <system.diagnostics>
// <trace>
// <listeners>
// <remove name="Default" />
// <add name="ThrowingTraceListener" type="Microsoft.CodeAnalysis.ThrowingTraceListener, Roslyn.Test.Utilities" />
// </listeners>
// </trace>
// </system.diagnostics>
//</configuration>
public sealed class ThrowingTraceListener : TraceListener
{
public override void Fail(string message, string detailMessage)
{
throw new DebugAssertFailureException(message + Environment.NewLine + detailMessage);
}
public override void Write(object o)
{
}
public override void Write(object o, string category)
{
}
public override void Write(string message)
{
}
public override void Write(string message, string category)
{
}
public override void WriteLine(object o)
{
}
public override void WriteLine(object o, string category)
{
}
public override void WriteLine(string message)
{
}
public override void WriteLine(string message, string category)
{
}
#if !NETSTANDARD1_3
[Serializable]
#endif
public class DebugAssertFailureException : Exception
{
public DebugAssertFailureException() { }
public DebugAssertFailureException(string message) : base(message) { }
public DebugAssertFailureException(string message, Exception innerException) : base(message, innerException) { }
#if !NETSTANDARD1_3
protected DebugAssertFailureException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endif
}
}
}
|
mit
|
C#
|
4af790c2805993f69564659465b36ac891a427da
|
Bump the copyright year
|
github/VisualStudio,github/VisualStudio,github/VisualStudio
|
src/common/SolutionInfo.cs
|
src/common/SolutionInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub Extension for Visual Studio")]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2014-2019")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub Extension for Visual Studio")]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2014-2016")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
|
mit
|
C#
|
139f22abaa4ab42147f3316dcc73fc696bcff0a4
|
Fix SeekDialog padding
|
directhex/banshee-hacks,arfbtwn/banshee,mono-soc-2011/banshee,petejohanson/banshee,allquixotic/banshee-gst-sharp-work,Dynalon/banshee-osx,ixfalia/banshee,babycaseny/banshee,lamalex/Banshee,dufoli/banshee,allquixotic/banshee-gst-sharp-work,mono-soc-2011/banshee,dufoli/banshee,babycaseny/banshee,petejohanson/banshee,stsundermann/banshee,mono-soc-2011/banshee,stsundermann/banshee,dufoli/banshee,Dynalon/banshee-osx,babycaseny/banshee,Carbenium/banshee,GNOME/banshee,stsundermann/banshee,GNOME/banshee,arfbtwn/banshee,mono-soc-2011/banshee,allquixotic/banshee-gst-sharp-work,lamalex/Banshee,GNOME/banshee,lamalex/Banshee,dufoli/banshee,GNOME/banshee,Carbenium/banshee,stsundermann/banshee,directhex/banshee-hacks,directhex/banshee-hacks,GNOME/banshee,petejohanson/banshee,stsundermann/banshee,ixfalia/banshee,babycaseny/banshee,Dynalon/banshee-osx,lamalex/Banshee,petejohanson/banshee,ixfalia/banshee,Carbenium/banshee,babycaseny/banshee,arfbtwn/banshee,allquixotic/banshee-gst-sharp-work,arfbtwn/banshee,Carbenium/banshee,arfbtwn/banshee,babycaseny/banshee,stsundermann/banshee,ixfalia/banshee,dufoli/banshee,Carbenium/banshee,babycaseny/banshee,stsundermann/banshee,petejohanson/banshee,arfbtwn/banshee,Dynalon/banshee-osx,Dynalon/banshee-osx,ixfalia/banshee,GNOME/banshee,directhex/banshee-hacks,dufoli/banshee,Dynalon/banshee-osx,arfbtwn/banshee,ixfalia/banshee,ixfalia/banshee,lamalex/Banshee,mono-soc-2011/banshee,dufoli/banshee,petejohanson/banshee,GNOME/banshee,GNOME/banshee,Dynalon/banshee-osx,mono-soc-2011/banshee,directhex/banshee-hacks,babycaseny/banshee,Dynalon/banshee-osx,lamalex/Banshee,arfbtwn/banshee,ixfalia/banshee,directhex/banshee-hacks,stsundermann/banshee,Carbenium/banshee,allquixotic/banshee-gst-sharp-work,mono-soc-2011/banshee,dufoli/banshee,allquixotic/banshee-gst-sharp-work
|
src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/SeekDialog.cs
|
src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/SeekDialog.cs
|
//
// SeekDialog.cs
//
// Author:
// Aaron Bockover <abockover@novell.com>
// Gabriel Burt <gburt@novell.com>
//
// Copyright 2006-2010 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using Mono.Unix;
using Gtk;
using Banshee.Base;
using Banshee.Gui.Widgets;
namespace Banshee.Gui.Dialogs
{
public class SeekDialog : BansheeDialog
{
public SeekDialog () : base (Catalog.GetString ("Seek to Position"))
{
var seek_slider = new ConnectedSeekSlider () {
RightPadding = 0,
LeftPadding = 0
};
seek_slider.StreamPositionLabel.FormatString = "<big>{0}</big>";
seek_slider.ShowAll ();
VBox.PackStart (seek_slider, false, false, 0);
AddDefaultCloseButton ();
SetSizeRequest (300, -1);
}
}
}
|
//
// SeekDialog.cs
//
// Author:
// Aaron Bockover <abockover@novell.com>
// Gabriel Burt <gburt@novell.com>
//
// Copyright 2006-2010 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using Mono.Unix;
using Gtk;
using Banshee.Base;
using Banshee.Gui.Widgets;
namespace Banshee.Gui.Dialogs
{
public class SeekDialog : BansheeDialog
{
public SeekDialog () : base (Catalog.GetString ("Seek to Position"))
{
var seek_slider = new ConnectedSeekSlider ();
seek_slider.StreamPositionLabel.FormatString = "<big>{0}</big>";
seek_slider.ShowAll ();
VBox.PackStart (seek_slider, false, false, 0);
AddDefaultCloseButton ();
SetSizeRequest (300, -1);
}
}
}
|
mit
|
C#
|
237beab136d1e162e5e8ad0a782cc250e2e0972f
|
refresh profile when avatars changed
|
leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net
|
src/JoinRpg.Portal/Controllers/UserProfile/AvatarController.cs
|
src/JoinRpg.Portal/Controllers/UserProfile/AvatarController.cs
|
using JoinRpg.Interfaces;
using JoinRpg.Portal.Identity;
using JoinRpg.PrimitiveTypes;
using JoinRpg.Services.Interfaces;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace JoinRpg.Portal.Controllers.UserProfile;
[Authorize]
public class AvatarController : Controller
{
private readonly ICurrentUserAccessor currentUserAccessor;
private readonly IAvatarService avatarService;
private readonly ApplicationSignInManager signInManager;
private readonly ApplicationUserManager userManager;
public AvatarController(
ICurrentUserAccessor currentUserAccessor,
IAvatarService avatarService,
ApplicationSignInManager signInManager,
ApplicationUserManager userManager)
{
this.currentUserAccessor = currentUserAccessor;
this.avatarService = avatarService;
this.signInManager = signInManager;
this.userManager = userManager;
}
[HttpPost("manage/avatars/choose")]
public async Task<IActionResult> ChooseAvatar(int userAvatarId)
{
await avatarService.SelectAvatar(
currentUserAccessor.UserId,
new AvatarIdentification(userAvatarId)
);
await RefreshUserProfile();
return RedirectToAction("SetupProfile", "Manage");
}
[HttpPost("manage/avatars/delete")]
public async Task<IActionResult> DeleteAvatar(int userAvatarId)
{
await avatarService.DeleteAvatar(
currentUserAccessor.UserId,
new AvatarIdentification(userAvatarId)
);
await RefreshUserProfile();
return RedirectToAction("SetupProfile", "Manage");
}
private async Task RefreshUserProfile()
{
var user = await userManager.FindByIdAsync(currentUserAccessor.UserId.ToString());
await signInManager.RefreshSignInAsync(user);
}
}
|
using JoinRpg.Interfaces;
using JoinRpg.PrimitiveTypes;
using JoinRpg.Services.Interfaces;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace JoinRpg.Portal.Controllers.UserProfile;
[Authorize]
public class AvatarController : Controller
{
private readonly ICurrentUserAccessor currentUserAccessor;
private readonly IAvatarService avatarService;
public AvatarController(
ICurrentUserAccessor currentUserAccessor,
IAvatarService avatarService)
{
this.currentUserAccessor = currentUserAccessor;
this.avatarService = avatarService;
}
[HttpPost("manage/avatars/choose")]
public async Task<IActionResult> ChooseAvatar(int userAvatarId)
{
await avatarService.SelectAvatar(
currentUserAccessor.UserId,
new AvatarIdentification(userAvatarId)
);
return RedirectToAction("SetupProfile", "Manage");
}
[HttpPost("manage/avatars/delete")]
public async Task<IActionResult> DeleteAvatar(int userAvatarId)
{
await avatarService.DeleteAvatar(
currentUserAccessor.UserId,
new AvatarIdentification(userAvatarId)
);
return RedirectToAction("SetupProfile", "Manage");
}
}
|
mit
|
C#
|
8c0ccf3a2dc1a2dc9897458ee619e45c328997ac
|
add Picked event
|
NextLight/PokeBattle_Client
|
PokeBattle_Client/PokeBattle_Client/PokemonPicker.xaml.cs
|
PokeBattle_Client/PokeBattle_Client/PokemonPicker.xaml.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace PokeBattle_Client
{
public partial class PokemonPicker : ListBox
{
public PokemonPicker()
{
InitializeComponent();
}
Pokemon[] pokeTeam;
public Pokemon[] PokeTeam
{
get { return pokeTeam; }
set
{
pokeTeam = value;
foreach (Pokemon p in pokeTeam)
Items.Add(p);
SelectedPokemonIndex = selectedPokemonIndex;
}
}
// ??
int selectedPokemonIndex = 0;
public int SelectedPokemonIndex
{
get { return selectedPokemonIndex; }
set
{
selectedPokemonIndex = value;
Items.Insert(0, PokeTeam[selectedPokemonIndex]);
Items.Remove(PokeTeam[selectedPokemonIndex]);
}
}
public event EventHandler<PickedPokemonArgs> Picked;
private void ListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (SelectedIndex != -1 && Picked != null)
Picked(this, new PickedPokemonArgs(pokeTeam[SelectedIndex], SelectedIndex));
}
}
public class PickedPokemonArgs : EventArgs
{
public Pokemon PickedPokemon { get; private set; }
public int PickedIndex { get; private set; }
public PickedPokemonArgs(Pokemon poke, int idx)
{
PickedPokemon = poke;
PickedIndex = idx;
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace PokeBattle_Client
{
public partial class PokemonPicker : ListBox
{
public PokemonPicker()
{
InitializeComponent();
}
Pokemon[] pokeTeam;
public Pokemon[] PokeTeam
{
get { return pokeTeam; }
set
{
pokeTeam = value;
foreach (Pokemon p in pokeTeam)
Items.Add(p);
SelectedPokemonIndex = selectedPokemonIndex;
}
}
int selectedPokemonIndex = 0;
public int SelectedPokemonIndex
{
get { return selectedPokemonIndex; }
set
{
selectedPokemonIndex = value;
Items.Insert(0, PokeTeam[selectedPokemonIndex]);
Items.Remove(PokeTeam[selectedPokemonIndex]);
}
}
}
}
|
mit
|
C#
|
59fe886ab534827ded4a070b6608a6182d7afe50
|
fix for switching play and scene mode
|
nicloay/unity-navigation-history
|
NavigationHistory.cs
|
NavigationHistory.cs
|
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Collections.Generic;
public class NavigationHistory : EditorWindow {
Object[] history;
int historySize = 50;
Object lastGameObject;
int firstId;
int lastId;
int selectedId;
bool arrayFull;
GUIStyle boldButton;
GUIStyle normalButton;
[MenuItem("Window/History Window")]
static void menuCall(){
NavigationHistory nh= EditorWindow.GetWindow <NavigationHistory>(false, "History");
}
public void OnEnable(){
if (history!=null)
return;
EditorApplication.hierarchyWindowItemOnGUI+=onHierarchyChangeListener;
history = new Object[historySize];
firstId = historySize - 1;
lastId = 0;
selectedId = firstId;
arrayFull = false;
initStyles();
checkSelection();
}
void initStyles(){
normalButton = new GUIStyle(EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).button);
normalButton.stretchWidth = true;
normalButton.alignment = TextAnchor.MiddleLeft;
boldButton = new GUIStyle(normalButton);
boldButton.fontStyle = FontStyle.Bold;
}
Vector2 scrollPosition;
void OnGUI(){
EditorGUILayout.BeginHorizontal() ;
GUI.enabled = (selectedId != lastId);
if (GUILayout.Button("←"))
selectObject(getPreviousId(selectedId));
GUI.enabled = true;
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
int i = firstId;
bool exit = false;
while(!exit){
if (history[i]==null)
break;
if (GUILayout.Button(history[i].name, i==selectedId ? boldButton : normalButton)){
selectObject(i);
}
i = getPreviousId(i);
exit = (i==firstId);
}
EditorGUILayout.EndScrollView();
GUI.enabled = (selectedId != firstId);
if (GUILayout.Button("→"))
selectObject(getNextId(selectedId));
GUI.enabled = true;
EditorGUILayout.EndHorizontal();
}
void selectObject(int i){
Selection.activeObject = history[i];
selectedId = i;
}
void onHierarchyChangeListener (int instanceID, Rect selectionRect)
{
checkSelection ();
}
void checkSelection ()
{
if (Selection.activeObject != null && Selection.activeObject != lastGameObject && Selection.activeObject != history[selectedId]) {
lastGameObject = Selection.activeObject;
firstId = getNextId (firstId);
if (arrayFull == false && history[firstId]!=null)
arrayFull = true;
history [firstId] = lastGameObject;
selectedId = firstId;
if (arrayFull)
lastId = getNextId(firstId);
}
Repaint ();
}
int getNextId(int id){
return ++id == historySize ? 0 : id;
}
int getPreviousId(int id){
return --id == -1 ? historySize - 1 : id ;
}
}
|
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Collections.Generic;
public class NavigationHistory : EditorWindow {
Object[] history;
int historySize = 50;
[System.NonSerialized]
Object lastGameObject;
[System.NonSerialized]
int firstId;
[System.NonSerialized]
int lastId;
[System.NonSerialized]
int selectedId;
bool arrayFull;
GUIStyle boldButton;
GUIStyle normalButton;
[MenuItem("Window/History Window")]
static void menuCall(){
NavigationHistory nh= EditorWindow.GetWindow <NavigationHistory>(false, "History");
}
public void OnEnable(){
EditorApplication.hierarchyWindowItemOnGUI+=onHierarchyChangeListener;
history = new Object[historySize];
firstId = historySize - 1;
lastId = 0;
selectedId = firstId;
arrayFull = false;
initStyles();
checkSelection();
}
void initStyles(){
normalButton = new GUIStyle(EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).button);
normalButton.stretchWidth = true;
normalButton.alignment = TextAnchor.MiddleLeft;
boldButton = new GUIStyle(normalButton);
boldButton.fontStyle = FontStyle.Bold;
}
Vector2 scrollPosition;
void OnGUI(){
EditorGUILayout.BeginHorizontal() ;
GUI.enabled = (selectedId != lastId);
if (GUILayout.Button("←"))
selectObject(getPreviousId(selectedId));
GUI.enabled = true;
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
int i = firstId;
bool exit = false;
while(!exit){
if (history[i]==null)
break;
if (GUILayout.Button(history[i].name, i==selectedId ? boldButton : normalButton)){
selectObject(i);
}
i = getPreviousId(i);
exit = (i==firstId);
}
EditorGUILayout.EndScrollView();
GUI.enabled = (selectedId != firstId);
if (GUILayout.Button("→"))
selectObject(getNextId(selectedId));
GUI.enabled = true;
EditorGUILayout.EndHorizontal();
}
void selectObject(int i){
Selection.activeObject = history[i];
selectedId = i;
}
void onHierarchyChangeListener (int instanceID, Rect selectionRect)
{
checkSelection ();
}
void checkSelection ()
{
if (Selection.activeObject != null && Selection.activeObject != lastGameObject && Selection.activeObject != history[selectedId]) {
lastGameObject = Selection.activeObject;
firstId = getNextId (firstId);
if (arrayFull == false && history[firstId]!=null)
arrayFull = true;
history [firstId] = lastGameObject;
selectedId = firstId;
if (arrayFull)
lastId = getNextId(firstId);
}
Repaint ();
}
int getNextId(int id){
return ++id == historySize ? 0 : id;
}
int getPreviousId(int id){
return --id == -1 ? historySize - 1 : id ;
}
}
|
bsd-3-clause
|
C#
|
e068ae49d0c6b46e9f40e5ef32a427f04cac9e9d
|
Make ProjectionCollection unit test more strict
|
KodamaSakuno/Sakuno.Base
|
tests/Sakuno.Base.Tests/ProjectionCollectionTests.cs
|
tests/Sakuno.Base.Tests/ProjectionCollectionTests.cs
|
using Sakuno.Collections;
using System.Collections.ObjectModel;
using Xunit;
namespace Sakuno.Base.Tests
{
public static class ProjectionCollectionTests
{
[Fact]
public static void SimpleProjection()
{
var source = new ObservableCollection<int>();
var projection = new ProjectionCollection<int, int>(source, r => r * 2);
source.Add(1);
source.Add(2);
source.Add(3);
source.Add(4);
source.Add(5);
source.Remove(3);
source.Insert(1, 6);
source.Insert(2, 10);
source.Remove(5);
source.Remove(2);
Assert.Equal(projection.Count, source.Count);
using (var projectionEnumerator = projection.GetEnumerator())
using (var sourceEnumerator = source.GetEnumerator())
{
while (projectionEnumerator.MoveNext() && sourceEnumerator.MoveNext())
Assert.Equal(sourceEnumerator.Current * 2, projectionEnumerator.Current);
Assert.False(projectionEnumerator.MoveNext());
Assert.False(sourceEnumerator.MoveNext());
}
source.Clear();
Assert.Empty(projection);
projection.Dispose();
}
}
}
|
using Sakuno.Collections;
using System.Collections.ObjectModel;
using Xunit;
namespace Sakuno.Base.Tests
{
public static class ProjectionCollectionTests
{
[Fact]
public static void SimpleProjection()
{
var source = new ObservableCollection<int>();
var projection = new ProjectionCollection<int, int>(source, r => r * 2);
source.Add(1);
source.Add(2);
source.Add(3);
source.Add(4);
source.Add(5);
source.Remove(3);
source.Insert(1, 6);
source.Insert(2, 10);
source.Remove(5);
source.Remove(2);
Assert.Equal(projection.Count, source.Count);
using (var projectionEnumerator = projection.GetEnumerator())
using (var sourceEnumerator = source.GetEnumerator())
{
while (projectionEnumerator.MoveNext() && sourceEnumerator.MoveNext())
Assert.Equal(sourceEnumerator.Current * 2, projectionEnumerator.Current);
}
source.Clear();
Assert.Empty(projection);
projection.Dispose();
}
}
}
|
mit
|
C#
|
09990ee6a98534c4340782c202834b284b677810
|
Use expression lambda.
|
ryanjfitz/SimpSim.NET
|
SimpSim.NET.Presentation/ViewModels/SystemRegistersViewModel.cs
|
SimpSim.NET.Presentation/ViewModels/SystemRegistersViewModel.cs
|
using System.Windows.Input;
namespace SimpSim.NET.Presentation.ViewModels
{
public class SystemRegistersViewModel : ViewModelBase
{
private readonly SimpleSimulator _simulator;
public SystemRegistersViewModel(SimpleSimulator simulator)
{
_simulator = simulator;
ResetProgramCounterCommand = new Command(() => _simulator.Machine.ProgramCounter = 0x00, () => true, _simulator);
_simulator.Machine.ProgramCounterChanged += () => OnPropertyChanged(nameof(ProgramCounter));
_simulator.Machine.InstructionRegisterChanged += () => OnPropertyChanged(nameof(InstructionRegister));
}
public ICommand ResetProgramCounterCommand { get; }
public byte ProgramCounter
{
get => _simulator.Machine.ProgramCounter;
set => _simulator.Machine.ProgramCounter = value;
}
public Instruction InstructionRegister => _simulator.Machine.InstructionRegister;
}
}
|
using System.Windows.Input;
namespace SimpSim.NET.Presentation.ViewModels
{
public class SystemRegistersViewModel : ViewModelBase
{
private readonly SimpleSimulator _simulator;
public SystemRegistersViewModel(SimpleSimulator simulator)
{
_simulator = simulator;
ResetProgramCounterCommand = new Command(() => _simulator.Machine.ProgramCounter = 0x00, () => true, _simulator);
_simulator.Machine.ProgramCounterChanged += () => { OnPropertyChanged(nameof(ProgramCounter)); };
_simulator.Machine.InstructionRegisterChanged += () => { OnPropertyChanged(nameof(InstructionRegister)); };
}
public ICommand ResetProgramCounterCommand { get; }
public byte ProgramCounter
{
get => _simulator.Machine.ProgramCounter;
set => _simulator.Machine.ProgramCounter = value;
}
public Instruction InstructionRegister => _simulator.Machine.InstructionRegister;
}
}
|
mit
|
C#
|
12ea8369ee504caddcaf38488cae09bfedb091b6
|
Update retriever to be relatively sized
|
ppy/osu,peppy/osu,ppy/osu,peppy/osu,ppy/osu,peppy/osu
|
osu.Game/Beatmaps/Drawables/CalculatingDifficultyIcon.cs
|
osu.Game/Beatmaps/Drawables/CalculatingDifficultyIcon.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.Graphics;
using osu.Framework.Graphics.Containers;
using osuTK;
namespace osu.Game.Beatmaps.Drawables
{
/// <summary>
/// A difficulty icon which automatically calculates difficulty in the background.
/// </summary>
public class CalculatingDifficultyIcon : CompositeDrawable
{
/// <summary>
/// Size of this difficulty icon.
/// </summary>
public new Vector2 Size
{
get => difficultyIcon.Size;
set => difficultyIcon.Size = value;
}
public bool ShowTooltip
{
get => difficultyIcon.ShowTooltip;
set => difficultyIcon.ShowTooltip = value;
}
private readonly DifficultyIcon difficultyIcon;
/// <summary>
/// Creates a new <see cref="CalculatingDifficultyIcon"/> that follows the currently-selected ruleset and mods.
/// </summary>
/// <param name="beatmapInfo">The beatmap to show the difficulty of.</param>
public CalculatingDifficultyIcon(IBeatmapInfo beatmapInfo)
{
AutoSizeAxes = Axes.Both;
InternalChildren = new Drawable[]
{
difficultyIcon = new DifficultyIcon(beatmapInfo),
new DelayedLoadUnloadWrapper(() => new DifficultyRetriever(beatmapInfo) { StarDifficulty = { BindTarget = difficultyIcon.Current } }, 0)
{
RelativeSizeAxes = Axes.Both,
}
};
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osuTK;
namespace osu.Game.Beatmaps.Drawables
{
/// <summary>
/// A difficulty icon which automatically calculates difficulty in the background.
/// </summary>
public class CalculatingDifficultyIcon : CompositeDrawable
{
/// <summary>
/// Size of this difficulty icon.
/// </summary>
public new Vector2 Size
{
get => difficultyIcon.Size;
set => difficultyIcon.Size = value;
}
public bool ShowTooltip
{
get => difficultyIcon.ShowTooltip;
set => difficultyIcon.ShowTooltip = value;
}
private readonly IBeatmapInfo beatmapInfo;
private readonly DifficultyIcon difficultyIcon;
/// <summary>
/// Creates a new <see cref="CalculatingDifficultyIcon"/> that follows the currently-selected ruleset and mods.
/// </summary>
/// <param name="beatmapInfo">The beatmap to show the difficulty of.</param>
public CalculatingDifficultyIcon(IBeatmapInfo beatmapInfo)
{
this.beatmapInfo = beatmapInfo ?? throw new ArgumentNullException(nameof(beatmapInfo));
AutoSizeAxes = Axes.Both;
InternalChildren = new Drawable[]
{
difficultyIcon = new DifficultyIcon(beatmapInfo),
new DelayedLoadUnloadWrapper(createDifficultyRetriever, 0)
};
}
private Drawable createDifficultyRetriever() => new DifficultyRetriever(beatmapInfo) { StarDifficulty = { BindTarget = difficultyIcon.Current } };
}
}
|
mit
|
C#
|
fd08b3bf230dbf9a466791f91e70f61fe80acfbe
|
Rename for consistency.
|
christophediericx/ArduinoDriver
|
Source/ArduinoLibCSharp.ArduinoUploader/UploaderLogger.cs
|
Source/ArduinoLibCSharp.ArduinoUploader/UploaderLogger.cs
|
using System;
using NLog;
namespace ArduinoLibCSharp.ArduinoUploader
{
internal class UploaderLogger
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
internal static void LogAndThrowError<TException>(string errorMessage) where TException : Exception, new()
{
logger.Error(errorMessage);
var exception = (TException)Activator.CreateInstance(typeof(TException), errorMessage);
throw exception;
}
}
}
|
using System;
using NLog;
namespace ArduinoLibCSharp.ArduinoUploader
{
internal class UploaderLogger
{
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
internal static void LogAndThrowError<TException>(string errorMessage) where TException : Exception, new()
{
Logger.Error(errorMessage);
var exception = (TException)Activator.CreateInstance(typeof(TException), errorMessage);
throw exception;
}
}
}
|
mit
|
C#
|
435d3ddf12f72b92a4e35598dcbff777dc7f98ae
|
Update SimpleJsonBondSerializer.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Serialization/Bond/SimpleJsonBondSerializer.cs
|
TIKSN.Core/Serialization/Bond/SimpleJsonBondSerializer.cs
|
using System.IO;
using Bond.Protocols;
namespace TIKSN.Serialization.Bond
{
public class SimpleJsonBondSerializer : SerializerBase<string>
{
protected override string SerializeInternal<T>(T obj)
{
using (var output = new StringWriter())
{
var writer = new SimpleJsonWriter(output);
global::Bond.Serialize.To(writer, obj);
writer.Flush();
return output.GetStringBuilder().ToString();
}
}
}
}
|
using Bond.Protocols;
using System.IO;
namespace TIKSN.Serialization.Bond
{
public class SimpleJsonBondSerializer : SerializerBase<string>
{
protected override string SerializeInternal<T>(T obj)
{
using (var output = new StringWriter())
{
var writer = new SimpleJsonWriter(output);
global::Bond.Serialize.To(writer, obj);
writer.Flush();
return output.GetStringBuilder().ToString();
}
}
}
}
|
mit
|
C#
|
3829fa43722333a9166f272d5dd26268748f9ed3
|
Bring Title/NavTitle in line with Umbraco implementation
|
Gibe/Gibe.Navigation
|
Gibe.Navigation.GibeCommerce/GibeCommerceNavigationProvider.cs
|
Gibe.Navigation.GibeCommerce/GibeCommerceNavigationProvider.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using Gibe.Navigation.GibeCommerce.Models;
using Gibe.Navigation.Models;
using GibeCommerce.CatalogSystem;
using GibeCommerce.SiteServices.UrlProviders;
namespace Gibe.Navigation.GibeCommerce
{
public class GibeCommerceNavigationProvider<T> : INavigationProvider<T> where T : INavigationElement
{
private readonly ICatalogService _catalogService;
private readonly IUrlProvider _urlProvider;
public GibeCommerceNavigationProvider(ICatalogService catalogService, int priority, IUrlProvider urlProvider)
{
_catalogService = catalogService;
Priority = priority;
_urlProvider = urlProvider;
}
public IEnumerable<T> GetNavigationElements()
{
var categories = _catalogService.GetSubCategories("root")
.Where(x => x.Name != "root" && IncludeInNavigation(x));
return categories.OrderBy(x => x.Rank).Select(x => (T) ToNavigationElement(x)).ToList();
}
public SubNavigationModel<T> GetSubNavigation(string url)
{
var categories = _catalogService.GetAllCategories();
var parent = categories.First(x => IncludeInNavigation(x) && _urlProvider.GetUrl(x, UrlProviderMode.Relative) == url);
var children = _catalogService.GetSubCategories(parent.Name).Where(IncludeInNavigation);
return new SubNavigationModel<T>
{
SectionParent = ToNavigationElement(parent),
NavigationElements = children.OrderBy(x => x.Rank).Select(x => (T) ToNavigationElement(x)).ToList()
};
}
public int Priority { get; }
private INavigationElement ToNavigationElement(ICategory category)
{
return new GibeCommerceNavigationElement
{
Title = string.IsNullOrEmpty(NavTitle(category)) ? category.DisplayName : NavTitle(category),
IsVisible = ShowInNavigation(category),
NavTitle = NavTitle(category),
Items = _catalogService.GetSubCategories(category.Name).OrderBy(x => x.Rank).Select(ToNavigationElement).ToList(),
Url = _urlProvider.GetUrl(category, UrlProviderMode.Relative)
};
}
private static string NavTitle(ICategory category) => category.GetAttribute("NavigationTitle", String.Empty);
protected virtual bool IncludeInNavigation(ICategory category)
{
return true;
}
protected virtual bool ShowInNavigation(ICategory category)
{
return true;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using Gibe.Navigation.GibeCommerce.Models;
using Gibe.Navigation.Models;
using GibeCommerce.CatalogSystem;
using GibeCommerce.SiteServices.UrlProviders;
namespace Gibe.Navigation.GibeCommerce
{
public class GibeCommerceNavigationProvider<T> : INavigationProvider<T> where T : INavigationElement
{
private readonly ICatalogService _catalogService;
private readonly IUrlProvider _urlProvider;
public GibeCommerceNavigationProvider(ICatalogService catalogService, int priority, IUrlProvider urlProvider)
{
_catalogService = catalogService;
Priority = priority;
_urlProvider = urlProvider;
}
public IEnumerable<T> GetNavigationElements()
{
var categories = _catalogService.GetSubCategories("root")
.Where(x => x.Name != "root" && IncludeInNavigation(x));
return categories.OrderBy(x => x.Rank).Select(x => (T) ToNavigationElement(x)).ToList();
}
public SubNavigationModel<T> GetSubNavigation(string url)
{
var categories = _catalogService.GetAllCategories();
var parent = categories.First(x => IncludeInNavigation(x) && _urlProvider.GetUrl(x, UrlProviderMode.Relative) == url);
var children = _catalogService.GetSubCategories(parent.Name).Where(IncludeInNavigation);
return new SubNavigationModel<T>
{
SectionParent = ToNavigationElement(parent),
NavigationElements = children.OrderBy(x => x.Rank).Select(x => (T) ToNavigationElement(x)).ToList()
};
}
public int Priority { get; }
private INavigationElement ToNavigationElement(ICategory category)
{
return new GibeCommerceNavigationElement
{
Title = category.GetAttribute("PageTitle", string.Empty),
IsVisible = ShowInNavigation(category),
NavTitle = category.DisplayName,
Items = _catalogService.GetSubCategories(category.Name).OrderBy(x => x.Rank).Select(ToNavigationElement).ToList(),
Url = _urlProvider.GetUrl(category, UrlProviderMode.Relative)
};
}
protected virtual bool IncludeInNavigation(ICategory category)
{
return true;
}
protected virtual bool ShowInNavigation(ICategory category)
{
return true;
}
}
}
|
mit
|
C#
|
6e1ab275ca398fe2e62235a9ded56417d4e573ec
|
Fix bug when root page would be shown a second time.
|
mallibone/XamarinFormsExtendedSplashPage
|
XamarinFormsExtendedSplashPage/XamarinFormsExtendedSplashPage/RootPage.xaml.cs
|
XamarinFormsExtendedSplashPage/XamarinFormsExtendedSplashPage/RootPage.xaml.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace XamarinFormsExtendedSplashPage
{
public partial class RootPage : ContentPage
{
public RootPage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
base.OnAppearing();
var rootPage = Navigation.NavigationStack[0];
if (typeof (RootPage) == rootPage.GetType()) return;
Navigation.RemovePage(rootPage);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace XamarinFormsExtendedSplashPage
{
public partial class RootPage : ContentPage
{
public RootPage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
base.OnAppearing();
Navigation.RemovePage(Navigation.NavigationStack[0]);
}
}
}
|
apache-2.0
|
C#
|
b6e35eb8a9f3b6d782c87632182ab1a5aa4a5553
|
add more function
|
autumn009/TanoCSharpSamples
|
Chap38/RawStringLiterals/RawStringLiterals/Program.cs
|
Chap38/RawStringLiterals/RawStringLiterals/Program.cs
|
string s1 = @"
<div>
<p>
This is a XML text.
<p>
</div>
";
string s2 = """
<div>
<p>
This is a XML text.
<p>
</div>
""";
string s3 = """"
"""t1"""
"""t2"""
"""";
Console.WriteLine(s1);
Console.WriteLine(s2);
Console.WriteLine(s3);
foreach (var item in s3) Console.Write($"{(int)item} ");
Console.WriteLine();
|
string s1 = @"
<div>
<p>
This is a XML text.
<p>
</div>
";
string s2 = """
<div>
<p>
This is a XML text.
<p>
</div>
""";
string s3 = """"
"""text"""
"""";
Console.WriteLine(s1);
Console.WriteLine(s2);
Console.WriteLine(s3);
|
mit
|
C#
|
1a72956bc7932c4a08e26b8aeb6eda0721f5e885
|
Update Index.cshtml
|
ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab
|
Anlab.Mvc/Views/Home/Index.cshtml
|
Anlab.Mvc/Views/Home/Index.cshtml
|
@{
ViewData["Title"] = "Home Page";
}
<div class="col-8">
<h2 style="color: blue">PLEASE NOTE: New rates will take effect December 16th. Work orders for samples not received by December 16th will need to be re-created so as to capture the new rates.</h2>
<p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p>
<p>Analytical Laboratory clients are University of California academics, other educational institutions, government agencies, and research-based businesses.
</p>
<p>In addition to analytical services, the Laboratory provides project assistance in the areas of analytical, agricultural and environmental chemistry. The Laboratory has an educational role, providing training to students and researchers in the
operation of a number of analytical methods and instruments.</p>
<p>Please Note: Dirk Holstege has recently retired as Laboratory Director of the UC Davis Analytical Laboratory.
We thank him for his nearly twenty years of service as Director of the Analytical Lab and his thirty-two years of service
as a UC Davis employee. We wish him all the best in his retirement.<br/> <br/>
Traci Francis, Laboratory Supervisor, is serving as Interim Director. </p>
</div>
<div class="col-4">
<address>
<p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br> Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br> Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br> Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p>
</address>
</div>
|
@{
ViewData["Title"] = "Home Page";
}
<div class="col-8">
@*<h2 style="color: blue">PLEASE NOTE: There will be a modest increase in our rates effective in early October.</h2>*@
<p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p>
<p>Analytical Laboratory clients are University of California academics, other educational institutions, government agencies, and research-based businesses.
</p>
<p>In addition to analytical services, the Laboratory provides project assistance in the areas of analytical, agricultural and environmental chemistry. The Laboratory has an educational role, providing training to students and researchers in the
operation of a number of analytical methods and instruments.</p>
<p>Please Note: Dirk Holstege has recently retired as Laboratory Director of the UC Davis Analytical Laboratory.
We thank him for his nearly twenty years of service as Director of the Analytical Lab and his thirty-two years of service
as a UC Davis employee. We wish him all the best in his retirement.<br/> <br/>
Traci Francis, Laboratory Supervisor, is serving as Interim Director. </p>
</div>
<div class="col-4">
<address>
<p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br> Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br> Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br> Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p>
</address>
</div>
|
mit
|
C#
|
a7b49284946d9d6242a56559f8c5349e6efb6332
|
Exit in dispose
|
ZLima12/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,DrabWeb/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,smoogipooo/osu-framework
|
osu.Framework.Tests/IO/BackgroundGameHeadlessGameHost.cs
|
osu.Framework.Tests/IO/BackgroundGameHeadlessGameHost.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.Threading;
using System.Threading.Tasks;
using osu.Framework.Platform;
namespace osu.Framework.Tests.IO
{
/// <summary>
/// Ad headless host for testing purposes. Contains an arbitrary game that is running after construction.
/// </summary>
public class BackgroundGameHeadlessGameHost : HeadlessGameHost
{
private TestGame testGame;
public BackgroundGameHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true, bool portableInstallation = false)
: base(gameName, bindIPC, realtime, portableInstallation)
{
// ReSharper disable once AccessToDisposedClosure
Task.Run(() => Run(testGame = new TestGame()));
while (ExecutionState != ExecutionState.Stopped && testGame?.HasProcessed != true)
Thread.Sleep(10);
}
private class TestGame : Game
{
public bool HasProcessed;
protected override void Update()
{
base.Update();
HasProcessed = true;
}
}
protected override void Dispose(bool isDisposing)
{
Exit();
base.Dispose(isDisposing);
}
}
}
|
// 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.Threading;
using System.Threading.Tasks;
using osu.Framework.Platform;
namespace osu.Framework.Tests.IO
{
/// <summary>
/// Ad headless host for testing purposes. Contains an arbitrary game that is running after construction.
/// </summary>
public class BackgroundGameHeadlessGameHost : HeadlessGameHost
{
private TestGame testGame;
public BackgroundGameHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true, bool portableInstallation = false)
: base(gameName, bindIPC, realtime, portableInstallation)
{
// ReSharper disable once AccessToDisposedClosure
Task.Run(() => Run(testGame = new TestGame()));
while (ExecutionState != ExecutionState.Stopped && testGame?.HasProcessed != true)
Thread.Sleep(10);
}
private class TestGame : Game
{
public bool HasProcessed;
protected override void Update()
{
base.Update();
HasProcessed = true;
}
}
}
}
|
mit
|
C#
|
33bf8b81548b4bb65f6a4e199e2e580e7982ec15
|
Remove unused using statements from CropProviderTest
|
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
|
Oogstplanner.Tests/Tests.Services/CropProviderTest.cs
|
Oogstplanner.Tests/Tests.Services/CropProviderTest.cs
|
using Moq;
using NUnit.Framework;
using System;
using Oogstplanner.Repositories;
using Oogstplanner.Services;
namespace Oogstplanner.Tests.Services
{
[TestFixture]
public class CropProviderTest
{
[Test]
public void Services_Crop_GetAllCrops()
{
// ARRANGE
var cropRepositoryMock = new Mock<ICropRepository>();
var service = new CropProvider(cropRepositoryMock.Object);
// ACT
service.GetAllCrops();
// ASSERT
cropRepositoryMock.Verify(mock =>
mock.GetAllCrops(), Times.Once,
"All crops should be retrieved from the repository.");
}
[Test]
public void Services_Crop_GetById()
{
// ARRANGE
var cropRepositoryMock = new Mock<ICropRepository>();
var service = new CropProvider(cropRepositoryMock.Object);
var expectedCropId = new Random().Next();
// ACT
service.GetCrop(expectedCropId);
// ASSERT
cropRepositoryMock.Verify(mock =>
mock.GetCrop(expectedCropId), Times.Once,
"The crop with the expected id should be obtained from " +
"the repository.");
}
}
}
|
using Moq;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using Oogstplanner.Models;
using Oogstplanner.ViewModels;
using Oogstplanner.Repositories;
using Oogstplanner.Services;
using Oogstplanner.Tests.Lib.Fakes;
namespace Oogstplanner.Tests.Services
{
[TestFixture]
public class CropProviderTest
{
[Test]
public void Services_Crop_GetAllCrops()
{
// ARRANGE
var cropRepositoryMock = new Mock<ICropRepository>();
var service = new CropProvider(cropRepositoryMock.Object);
// ACT
service.GetAllCrops();
// ASSERT
cropRepositoryMock.Verify(mock =>
mock.GetAllCrops(), Times.Once,
"All crops should be retrieved from the repository.");
}
[Test]
public void Services_Crop_GetById()
{
// ARRANGE
var cropRepositoryMock = new Mock<ICropRepository>();
var service = new CropProvider(cropRepositoryMock.Object);
var expectedCropId = new Random().Next();
// ACT
service.GetCrop(expectedCropId);
// ASSERT
cropRepositoryMock.Verify(mock =>
mock.GetCrop(expectedCropId), Times.Once,
"The crop with the expected id should be obtained from " +
"the repository.");
}
}
}
|
mit
|
C#
|
2f7c6371a546998b1aabbdad08062178027c6c8c
|
use XDocument to deserialize assets
|
Perspex/Perspex,wieslawsoltes/Perspex,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,grokys/Perspex,grokys/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,Perspex/Perspex,SuperJMN/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,akrisiun/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia
|
src/Avalonia.Base/Utilities/AvaloniaResourcesIndex.cs
|
src/Avalonia.Base/Utilities/AvaloniaResourcesIndex.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Xml.Linq;
using System.Linq;
// ReSharper disable AssignNullToNotNullAttribute
namespace Avalonia.Utilities
{
#if !BUILDTASK
public
#endif
static class AvaloniaResourcesIndexReaderWriter
{
private const int LastKnownVersion = 1;
public static List<AvaloniaResourcesIndexEntry> Read(Stream stream)
{
var ver = new BinaryReader(stream).ReadInt32();
if (ver > LastKnownVersion)
throw new Exception("Resources index format version is not known");
var assetDoc = XDocument.Load(stream);
XNamespace assetNs = assetDoc.Root.Attribute("xmlns").Value;
List<AvaloniaResourcesIndexEntry> entries=
(from entry in assetDoc.Root.Element(assetNs + "Entries").Elements(assetNs + "AvaloniaResourcesIndexEntry")
select new AvaloniaResourcesIndexEntry
{
Path = entry.Element(assetNs + "Path").Value,
Offset = int.Parse(entry.Element(assetNs + "Offset").Value),
Size = int.Parse(entry.Element(assetNs + "Size").Value)
}).ToList();
return entries;
}
public static void Write(Stream stream, List<AvaloniaResourcesIndexEntry> entries)
{
new BinaryWriter(stream).Write(LastKnownVersion);
new DataContractSerializer(typeof(AvaloniaResourcesIndex)).WriteObject(stream,
new AvaloniaResourcesIndex()
{
Entries = entries
});
}
}
[DataContract]
#if !BUILDTASK
public
#endif
class AvaloniaResourcesIndex
{
[DataMember]
public List<AvaloniaResourcesIndexEntry> Entries { get; set; } = new List<AvaloniaResourcesIndexEntry>();
}
[DataContract]
#if !BUILDTASK
public
#endif
class AvaloniaResourcesIndexEntry
{
[DataMember]
public string Path { get; set; }
[DataMember]
public int Offset { get; set; }
[DataMember]
public int Size { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
// ReSharper disable AssignNullToNotNullAttribute
namespace Avalonia.Utilities
{
#if !BUILDTASK
public
#endif
static class AvaloniaResourcesIndexReaderWriter
{
private const int LastKnownVersion = 1;
public static List<AvaloniaResourcesIndexEntry> Read(Stream stream)
{
var ver = new BinaryReader(stream).ReadInt32();
if (ver > LastKnownVersion)
throw new Exception("Resources index format version is not known");
var index = (AvaloniaResourcesIndex)
new DataContractSerializer(typeof(AvaloniaResourcesIndex)).ReadObject(stream);
return index.Entries;
}
public static void Write(Stream stream, List<AvaloniaResourcesIndexEntry> entries)
{
new BinaryWriter(stream).Write(LastKnownVersion);
new DataContractSerializer(typeof(AvaloniaResourcesIndex)).WriteObject(stream,
new AvaloniaResourcesIndex()
{
Entries = entries
});
}
}
[DataContract]
#if !BUILDTASK
public
#endif
class AvaloniaResourcesIndex
{
[DataMember]
public List<AvaloniaResourcesIndexEntry> Entries { get; set; } = new List<AvaloniaResourcesIndexEntry>();
}
[DataContract]
#if !BUILDTASK
public
#endif
class AvaloniaResourcesIndexEntry
{
[DataMember]
public string Path { get; set; }
[DataMember]
public int Offset { get; set; }
[DataMember]
public int Size { get; set; }
}
}
|
mit
|
C#
|
ec2c127a3d162f0df4c2999c015cd8601fb153fc
|
Bump version for release 1.0.16349-alpha3
|
rlvandaveer/heliar-composition,rlvandaveer/heliar-composition,rlvandaveer/heliar-composition
|
src/Heliar.Composition.Web/Properties/AssemblyInfo.cs
|
src/Heliar.Composition.Web/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("Heliar.Composition.Web")]
[assembly: AssemblyDescription("Provides shared types and core behavior, e.g. dependency resolver bootstrappers, composition scopes, to perform composition for web based projects")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("39a5ad59-0a65-4032-9b9c-1f0933410b4a")]
// 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.16349.2159")]
[assembly: AssemblyFileVersion("1.0.16349.2159")]
[assembly: AssemblyInformationalVersion("1.0.16349-alpha3")]
|
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("Heliar.Composition.Web")]
[assembly: AssemblyDescription("Provides shared types and core behavior, e.g. dependency resolver bootstrappers, composition scopes, to perform composition for web based projects")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("39a5ad59-0a65-4032-9b9c-1f0933410b4a")]
// 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.16349.2124")]
[assembly: AssemblyFileVersion("1.0.16349.2124")]
[assembly: AssemblyInformationalVersion("1.0.16349-alpha2")]
|
mit
|
C#
|
8f316654788bd5fab8ccd944e417c5d71dead5aa
|
Make IServerFactory AssemblyNeutral.
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
src/Microsoft.AspNet.Hosting/Server/IServerFactory.cs
|
src/Microsoft.AspNet.Hosting/Server/IServerFactory.cs
|
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF
// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.Runtime;
namespace Microsoft.AspNet.Hosting.Server
{
[AssemblyNeutral]
public interface IServerFactory
{
IServerInformation Initialize(IConfiguration configuration);
IDisposable Start(IServerInformation serverInformation, Func<object, Task> application);
}
}
|
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF
// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.Framework.ConfigurationModel;
namespace Microsoft.AspNet.Hosting.Server
{
// TODO: [AssemblyNeutral]
public interface IServerFactory
{
IServerInformation Initialize(IConfiguration configuration);
IDisposable Start(IServerInformation serverInformation, Func<object, Task> application);
}
}
|
apache-2.0
|
C#
|
8d623edc751e0ce9bdab6ab0368b99facb5313c0
|
Update AssemblyInfo.cs
|
heinrichelsigan/AwsEC2-DotNet-CSharp-Sample
|
AwsEC2Sample1/Properties/AssemblyInfo.cs
|
AwsEC2Sample1/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("Amazon EC2 Sample")]
[assembly: AssemblyDescription("Amazon EC2 Sample")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("AWS .NET SDK")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright 2009-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// 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.3.*")]
[assembly: AssemblyFileVersion("1.0.3.*")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Amazon EC2 Sample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("AWS .NET SDK")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright 2009-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// 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")]
|
apache-2.0
|
C#
|
0ae7dd0e21e164b716100d7a3dfea09a30950a42
|
Remove using.
|
chromium/vs-chromium,chromium/vs-chromium,chromium/vs-chromium,chromium/vs-chromium
|
src/Server/FileSystemContents/IFileContentsFactory.cs
|
src/Server/FileSystemContents/IFileContentsFactory.cs
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
using System;
using VsChromium.Core.Files;
namespace VsChromium.Server.FileSystemContents {
public interface IFileContentsFactory {
FileContents ReadFileContents(FullPath path);
}
}
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
using VsChromium.Core.Files;
namespace VsChromium.Server.FileSystemContents {
public interface IFileContentsFactory {
FileContents ReadFileContents(FullPath path);
}
}
|
bsd-3-clause
|
C#
|
973a8c2a68c54938061e02a3ca61062ce43a88a5
|
Update test
|
object/Simple.OData.Client,object/Simple.OData.Client
|
src/Simple.OData.Client.UnitTests/Core/StreamTests.cs
|
src/Simple.OData.Client.UnitTests/Core/StreamTests.cs
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
namespace Simple.OData.Client.Tests.Core
{
public class StreamTests : CoreTestBase
{
public override string MetadataFile { get { return "TripPin.xml"; } }
public override IFormatSettings FormatSettings { get { return new ODataV4Format(); } }
class Photo
{
public long Id { get; set; }
public string Name { get; set; }
public byte[] Media { get; set; }
}
[Fact]
public async Task GetMediaStream()
{
var command = _client
.For<Photo>()
.Key(1)
.QueryOptions(new Dictionary<string, object>() { { "IntOption", 42 }, { "StringOption", "xyz" } })
.Media();
var commandText = await command.GetCommandTextAsync();
Assert.Equal("Photos(1)/$value?IntOption=42&StringOption='xyz'", commandText);
}
}
}
|
using System.Threading.Tasks;
using Xunit;
namespace Simple.OData.Client.Tests.Core
{
public class StreamTests : CoreTestBase
{
public override string MetadataFile { get { return "TripPin.xml"; } }
public override IFormatSettings FormatSettings { get { return new ODataV4Format(); } }
class Photo
{
public long Id { get; set; }
public string Name { get; set; }
public byte[] Media { get; set; }
}
[Fact]
public async Task GetMediaStream()
{
var command = _client
.For<Photo>()
.Key(1)
.Media();
var commandText = await command.GetCommandTextAsync();
Assert.Equal("Photos(1)/$value", commandText);
}
}
}
|
mit
|
C#
|
2154c9e010c1826d306829f12cfb3d3120a7767b
|
更新 .net 4.5 项目版本号
|
JeffreySu/WxOpen,JeffreySu/WxOpen
|
src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Properties/AssemblyInfo.cs
|
src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Senparc.Weixin.WxOpen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Senparc.Weixin.WxOpen")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("379d8c97-4f96-45af-9f91-6bd160514495")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.7.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Senparc.Weixin.WxOpen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Senparc.Weixin.WxOpen")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("379d8c97-4f96-45af-9f91-6bd160514495")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.6.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
apache-2.0
|
C#
|
07f0c896d98404ab26a709b3b81a9dbfb0f37325
|
Add settings parameter
|
MihaMarkic/Cake.Docker
|
src/Cake.Docker/Registry/Logout/Docker.Aliases.Logout.cs
|
src/Cake.Docker/Registry/Logout/Docker.Aliases.Logout.cs
|
using Cake.Core;
using Cake.Core.Annotations;
using System;
namespace Cake.Docker
{
// Contains functionality for working with logout command.
partial class DockerAliases
{
/// <summary>
/// Logout from a Docker registry.
/// If no server is specified, the docker engine default is used.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="server">The server.</param>
[CakeMethodAlias]
public static void DockerLogout(this ICakeContext context, string server = null)
{
DockerLogout(context, new DockerRegistryLogoutSettings(), server);
}
/// <summary>
/// Logout from a Docker registry.
/// If no server is specified, the docker engine default is used.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="settings">The settings.</param>
/// <param name="server">The server.</param>
[CakeMethodAlias]
public static void DockerLogout(this ICakeContext context, DockerRegistryLogoutSettings settings, string server = null)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (settings == null)
{
throw new ArgumentNullException("settings");
}
var runner = new GenericDockerRunner<DockerRegistryLogoutSettings>(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
runner.Run("logout", settings, server != null ? new[] { server } : new string[]{ });
}
}
}
|
using Cake.Core;
using Cake.Core.Annotations;
using System;
namespace Cake.Docker
{
// Contains functionality for working with logout command.
partial class DockerAliases
{
/// <summary>
/// Logout from a Docker registry.
/// If no server is specified, the docker engine default is used.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="server">The server.</param>
[CakeMethodAlias]
public static void DockerLogout(this ICakeContext context, string server = null)
{
var runner = new GenericDockerRunner<DockerRegistryLogoutSettings>(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
runner.Run("logout", new DockerRegistryLogoutSettings(), server != null ? new[] { server } : new string[]{ });
}
}
}
|
mit
|
C#
|
88461bd5a31022334db67b6a0cdc66865ccf51b8
|
set WebApiDemo internals visible to test project
|
solomobro/Instagram,solomobro/Instagram,solomobro/Instagram
|
src/Solomobro.Instagram.WebApiDemo/Properties/AssemblyInfo.cs
|
src/Solomobro.Instagram.WebApiDemo/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("Solomobro.Instagram.WebApiDemo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Solomobro.Instagram.WebApiDemo")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Set internals visibility to test proj
[assembly: InternalsVisibleTo("Solomobro.Instagram.Tests")]
// 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("2c19f0e2-87cc-4516-82f4-4662a7a80260")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Solomobro.Instagram.WebApiDemo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Solomobro.Instagram.WebApiDemo")]
[assembly: AssemblyCopyright("Copyright © 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("2c19f0e2-87cc-4516-82f4-4662a7a80260")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
apache-2.0
|
C#
|
2f7828f085b440314a5c821a78e158b01bc2a13d
|
Fix typo
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/Shell/MainMenu/ToolsMainMenuItems.cs
|
WalletWasabi.Gui/Shell/MainMenu/ToolsMainMenuItems.cs
|
using AvalonStudio.MainMenu;
using AvalonStudio.Menus;
using System;
using System.Collections.Generic;
using System.Composition;
using System.Text;
namespace WalletWasabi.Gui.Shell.MainMenu
{
internal class ToolsMainMenuItems
{
private IMenuItemFactory MenuItemFactory { get; }
[ImportingConstructor]
public ToolsMainMenuItems(IMenuItemFactory menuItemFactory)
{
MenuItemFactory = menuItemFactory;
}
#region MainMenu
[ExportMainMenuItem("Tools")]
[DefaultOrder(1)]
public IMenuItem Tools => MenuItemFactory.CreateHeaderMenuItem("Tools", null);
#endregion MainMenu
#region Group
[ExportMainMenuDefaultGroup("Tools", "Managers")]
[DefaultOrder(0)]
public object ManagersGroup => null;
[ExportMainMenuDefaultGroup("Tools", "Utilities")]
[DefaultOrder(10)]
public object UtilitiesGroup => null;
[ExportMainMenuDefaultGroup("Tools", "Settings")]
[DefaultOrder(20)]
public object SettingsGroup => null;
#endregion Group
#region MenuItem
[ExportMainMenuItem("Tools", "Wallet Manager")]
[DefaultOrder(1)]
[DefaultGroup("Managers")]
public IMenuItem WalletManager => MenuItemFactory.CreateCommandMenuItem("Tools.WalletManager");
#if DEBUG
[ExportMainMenuItem("Tools", "Dev Tools")]
[DefaultOrder(10)]
[DefaultGroup("Managers")]
public IMenuItem DevTools => MenuItemFactory.CreateCommandMenuItem("Tools.DevTools");
#endif
[ExportMainMenuItem("Tools", "Broadcast Transaction")]
[DefaultOrder(1)]
[DefaultGroup("Utilities")]
public IMenuItem BroadcastTransaction => MenuItemFactory.CreateCommandMenuItem("Tools.BroadcastTransaction");
[ExportMainMenuItem("Tools", "Settings")]
[DefaultOrder(20)]
[DefaultGroup("Settings")]
public IMenuItem Settings => MenuItemFactory.CreateCommandMenuItem("Tools.Settings");
#endregion MenuItem
}
}
|
using AvalonStudio.MainMenu;
using AvalonStudio.Menus;
using System;
using System.Collections.Generic;
using System.Composition;
using System.Text;
namespace WalletWasabi.Gui.Shell.MainMenu
{
internal class ToolsMainMenuItems
{
private IMenuItemFactory MenuItemFactory { get; }
[ImportingConstructor]
public ToolsMainMenuItems(IMenuItemFactory menuItemFactory)
{
MenuItemFactory = menuItemFactory;
}
#region MainMenu
[ExportMainMenuItem("Tools")]
[DefaultOrder(1)]
public IMenuItem Tools => MenuItemFactory.CreateHeaderMenuItem("Tools", null);
#endregion MainMenu
#region Group
[ExportMainMenuDefaultGroup("Tools", "Managers")]
[DefaultOrder(0)]
public object ManagersGroup => null;
[ExportMainMenuDefaultGroup("Tools", "Utilities")]
[DefaultOrder(10)]
public object UtilitiesGroup => null;
[ExportMainMenuDefaultGroup("Tools", "Settings")]
[DefaultOrder(20)]
public object SettingsGroup => null;
#endregion Group
#region MenuItem
[ExportMainMenuItem("Tools", "Wallet Manager")]
[DefaultOrder(1)]
[DefaultGroup("Managers")]
public IMenuItem WalletManager => MenuItemFactory.CreateCommandMenuItem("Tools.WalletManager");
#if DEBUG
[ExportMainMenuItem("Tools", "Dev Tools")]
[DefaultOrder(10)]
[DefaultGroup("Managers")]
public IMenuItem DevTools => MenuItemFactory.CreateCommandMenuItem("Tools.DevTools");
#endif
[ExportMainMenuItem("Tools", "Broadcast Transaction")]
[DefaultOrder(1)]
[DefaultGroup("Utilities")]
public IMenuItem BroadcastTransation => MenuItemFactory.CreateCommandMenuItem("Tools.BroadcastTransaction");
[ExportMainMenuItem("Tools", "Settings")]
[DefaultOrder(20)]
[DefaultGroup("Settings")]
public IMenuItem Settings => MenuItemFactory.CreateCommandMenuItem("Tools.Settings");
#endregion MenuItem
}
}
|
mit
|
C#
|
6b619e74273860ab162ef884d1e081f5cbef6c0a
|
Fix logic for ABCP date checks
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
Battery-Commander.Web/Views/Shared/DisplayTemplates/ABCP.cshtml
|
Battery-Commander.Web/Views/Shared/DisplayTemplates/ABCP.cshtml
|
@model ABCP
@if (Model != null)
{
<div>
<a href="@Url.Action("Details", "ABCP", new { Model.Id })">
@if (Model.IsPassing)
{
// Per request, if the weigh-in is within the last 6 months, it's GREEN
// If it's 6-9 months, AMBER
// 9 months+, RED
if (Model.Date > DateTime.Today.AddMonths(-6))
{
<span class="label label-success">GO</span>
}
else if (Model.Date > DateTime.Today.AddMonths(-9))
{
<span class="label label-warning">GO</span>
}
else
{
<span class="label label-danger">GO</span>
}
}
else
{
<span class="label label-danger">NOGO</span>
}
</a>
</div>
}
|
@model ABCP
@if (Model != null)
{
<div>
<a href="@Url.Action("Details", "ABCP", new { Model.Id })">
@if (Model.IsPassing)
{
// Per request, if the weigh-in is within the last 6 months, it's GREEN
// If it's 6-9 months, AMBER
// 9 months+, RED
if (Model.Date < DateTime.Today.AddMonths(-6))
{
<span class="label label-success">GO</span>
}
else if (Model.Date < DateTime.Today.AddMonths(-9))
{
<span class="label label-warning">GO</span>
}
else
{
<span class="label label-danger">GO</span>
}
}
else
{
<span class="label label-danger">NOGO</span>
}
</a>
</div>
}
|
mit
|
C#
|
8ac1d56861a5802ba9755d7fde303e8a7aece1bf
|
Make sure unit isn't null
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
Battery-Commander.Web/Views/Shared/DisplayTemplates/Unit.cshtml
|
Battery-Commander.Web/Views/Shared/DisplayTemplates/Unit.cshtml
|
@model Unit
@if (Model != null)
{
<div>@Html.ActionLink(Model.Name, "Index", "Soldiers", new { unit = Model.Id })</div>
}
|
@model Unit
<div>@Html.ActionLink(Model.Name, "Index", "Soldiers", new { unit = Model.Id })</div>
|
mit
|
C#
|
bd60b1e750065aec021d91f5e3597b589959865f
|
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
|
autofac/Autofac.Extras.NHibernate
|
Properties/VersionAssemblyInfo.cs
|
Properties/VersionAssemblyInfo.cs
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
|
mit
|
C#
|
515e4ca1651e520a5b5cdf75481e2bfadf25c7b8
|
Add back a method that was removed bug is required by functional tests.
|
chocolatey/nuget-chocolatey,mono/nuget,GearedToWar/NuGet2,antiufo/NuGet2,GearedToWar/NuGet2,jmezach/NuGet2,rikoe/nuget,pratikkagda/nuget,dolkensp/node.net,antiufo/NuGet2,mrward/nuget,jholovacs/NuGet,jmezach/NuGet2,jmezach/NuGet2,ctaggart/nuget,mono/nuget,alluran/node.net,antiufo/NuGet2,xoofx/NuGet,mrward/nuget,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,jmezach/NuGet2,mrward/NuGet.V2,ctaggart/nuget,antiufo/NuGet2,RichiCoder1/nuget-chocolatey,oliver-feng/nuget,mrward/NuGet.V2,indsoft/NuGet2,xoofx/NuGet,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,OneGet/nuget,mrward/NuGet.V2,indsoft/NuGet2,alluran/node.net,RichiCoder1/nuget-chocolatey,dolkensp/node.net,xoofx/NuGet,RichiCoder1/nuget-chocolatey,pratikkagda/nuget,akrisiun/NuGet,xoofx/NuGet,alluran/node.net,jholovacs/NuGet,akrisiun/NuGet,OneGet/nuget,GearedToWar/NuGet2,mrward/nuget,OneGet/nuget,ctaggart/nuget,mrward/NuGet.V2,ctaggart/nuget,jholovacs/NuGet,rikoe/nuget,mrward/nuget,antiufo/NuGet2,OneGet/nuget,chocolatey/nuget-chocolatey,GearedToWar/NuGet2,jholovacs/NuGet,mono/nuget,alluran/node.net,pratikkagda/nuget,jholovacs/NuGet,mrward/NuGet.V2,zskullz/nuget,dolkensp/node.net,chocolatey/nuget-chocolatey,oliver-feng/nuget,antiufo/NuGet2,zskullz/nuget,pratikkagda/nuget,dolkensp/node.net,mrward/nuget,oliver-feng/nuget,pratikkagda/nuget,indsoft/NuGet2,chocolatey/nuget-chocolatey,zskullz/nuget,mono/nuget,indsoft/NuGet2,mrward/NuGet.V2,chocolatey/nuget-chocolatey,indsoft/NuGet2,xoofx/NuGet,xoofx/NuGet,chocolatey/nuget-chocolatey,oliver-feng/nuget,mrward/nuget,zskullz/nuget,jmezach/NuGet2,rikoe/nuget,oliver-feng/nuget,jmezach/NuGet2,pratikkagda/nuget,rikoe/nuget,oliver-feng/nuget,GearedToWar/NuGet2,RichiCoder1/nuget-chocolatey,jholovacs/NuGet
|
src/VisualStudio/PackageSource/AggregatePackageSource.cs
|
src/VisualStudio/PackageSource/AggregatePackageSource.cs
|
using System.Collections.Generic;
using System.Linq;
namespace NuGet.VisualStudio
{
public static class AggregatePackageSource
{
public static readonly PackageSource Instance = new PackageSource("(Aggregate source)", Resources.VsResources.AggregateSourceName);
public static bool IsAggregate(this PackageSource source)
{
return source == Instance;
}
// IMPORTANT: do NOT remove this method. It is used by functional tests.
public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregate()
{
return GetEnabledPackageSourcesWithAggregate(ServiceLocator.GetInstance<IVsPackageSourceProvider>());
}
public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregate(this IPackageSourceProvider provider)
{
return new[] { Instance }.Concat(provider.GetEnabledPackageSources());
}
public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregateSmart(this IPackageSourceProvider provider)
{
var packageSources = provider.GetEnabledPackageSources().ToArray();
// If there's less than 2 package sources, don't add the Aggregate source because it will be exactly the same as the main source.
if (packageSources.Length <= 1)
{
return packageSources;
}
return new[] { Instance }.Concat(packageSources);
}
}
}
|
using System.Collections.Generic;
using System.Linq;
namespace NuGet.VisualStudio
{
public static class AggregatePackageSource
{
public static readonly PackageSource Instance = new PackageSource("(Aggregate source)", Resources.VsResources.AggregateSourceName);
public static bool IsAggregate(this PackageSource source)
{
return source == Instance;
}
public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregate(this IPackageSourceProvider provider)
{
return new[] { Instance }.Concat(provider.GetEnabledPackageSources());
}
public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregateSmart(this IPackageSourceProvider provider)
{
var packageSources = provider.GetEnabledPackageSources().ToArray();
// If there's less than 2 package sources, don't add the Aggregate source because it will be exactly the same as the main source.
if (packageSources.Length <= 1)
{
return packageSources;
}
return new[] { Instance }.Concat(packageSources);
}
}
}
|
apache-2.0
|
C#
|
745e178c79b0d128eed19f7c6f52810fdd3cf698
|
Set version to 3.0.0
|
mdsol/Medidata.ZipkinTracerModule
|
src/Medidata.ZipkinTracer.Core/Properties/AssemblyInfo.cs
|
src/Medidata.ZipkinTracer.Core/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("Medidata.ZipkinTracer.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("Medidata Solutions, Inc.")]
[assembly: AssemblyProduct("Medidata.ZipkinTracer.Core")]
[assembly: AssemblyCopyright("Copyright © Medidata Solutions, Inc. 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
// 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("dfbe97d6-8b81-4bee-b2ce-23ef0f4d9953")]
// 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("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: AssemblyInformationalVersion("3.0.0")]
[assembly: InternalsVisibleTo("Medidata.ZipkinTracer.Core.Test")]
|
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("Medidata.ZipkinTracer.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("Medidata Solutions, Inc.")]
[assembly: AssemblyProduct("Medidata.ZipkinTracer.Core")]
[assembly: AssemblyCopyright("Copyright © Medidata Solutions, Inc. 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
// 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("dfbe97d6-8b81-4bee-b2ce-23ef0f4d9953")]
// 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")]
[assembly: AssemblyFileVersion("2.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: InternalsVisibleTo("Medidata.ZipkinTracer.Core.Test")]
|
mit
|
C#
|
23a234a5c16b2ea4e87dd3616a0a95c049beb00c
|
Fix missing type in method param
|
tzachshabtay/MonoAGS
|
Source/Editor/AGS.Editor/Components/MethodWizard/MethodParam.cs
|
Source/Editor/AGS.Editor/Components/MethodWizard/MethodParam.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using Humanizer;
namespace AGS.Editor
{
public class MethodParam : IProperty, INotifyPropertyChanged
{
private readonly ParameterInfo _param;
#pragma warning disable CS0067
public event PropertyChangedEventHandler PropertyChanged;
#pragma warning restore CS0067
public MethodParam(ParameterInfo parameter, API.IComponent obj, object overrideDefault = null)
: this(parameter, obj, obj, null, overrideDefault)
{}
public MethodParam(ParameterInfo parameter, API.IComponent component, object obj, IProperty parent, object overrideDefault = null)
{
_param = parameter;
DisplayName = Name.Humanize();
Object = obj;
Component = component;
Parent = parent;
Children = new List<IProperty>();
Value = new ValueModel(overrideDefault ?? (parameter.HasDefaultValue ? parameter.DefaultValue : GetDefaultValue(PropertyType)), type: PropertyType);
}
public string Name => _param.Name;
public string DisplayName { get; }
public object Object { get; }
public API.IComponent Component { get; }
public IProperty Parent { get; }
public string ValueString => Value?.ToString() ?? InspectorProperty.NullValue;
public Type PropertyType => _param.ParameterType;
public List<IProperty> Children { get; private set; }
public bool IsReadonly => false;
public TAttribute GetAttribute<TAttribute>() where TAttribute : Attribute
{
return _param.GetCustomAttribute<TAttribute>();
}
public ValueModel Value { get; set; }
public void Refresh() {}
public static object GetDefaultValue(Type type)
{
if (type.IsValueType) return Activator.CreateInstance(type);
return null;
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using Humanizer;
namespace AGS.Editor
{
public class MethodParam : IProperty, INotifyPropertyChanged
{
private readonly ParameterInfo _param;
#pragma warning disable CS0067
public event PropertyChangedEventHandler PropertyChanged;
#pragma warning restore CS0067
public MethodParam(ParameterInfo parameter, API.IComponent obj, object overrideDefault = null)
: this(parameter, obj, obj, null, overrideDefault)
{}
public MethodParam(ParameterInfo parameter, API.IComponent component, object obj, IProperty parent, object overrideDefault = null)
{
_param = parameter;
DisplayName = Name.Humanize();
Object = obj;
Component = component;
Parent = parent;
Children = new List<IProperty>();
Value = new ValueModel(overrideDefault ?? (parameter.HasDefaultValue ? parameter.DefaultValue : GetDefaultValue(PropertyType)));
}
public string Name => _param.Name;
public string DisplayName { get; }
public object Object { get; }
public API.IComponent Component { get; }
public IProperty Parent { get; }
public string ValueString => Value?.ToString() ?? InspectorProperty.NullValue;
public Type PropertyType => _param.ParameterType;
public List<IProperty> Children { get; private set; }
public bool IsReadonly => false;
public TAttribute GetAttribute<TAttribute>() where TAttribute : Attribute
{
return _param.GetCustomAttribute<TAttribute>();
}
public ValueModel Value { get; set; }
public void Refresh() {}
public static object GetDefaultValue(Type type)
{
if (type.IsValueType) return Activator.CreateInstance(type);
return null;
}
}
}
|
artistic-2.0
|
C#
|
6def3304dc277fc15adb8fedb108a003f86ab2b2
|
Fix null reference in String.Join for IntegratedTests
|
BluewireTechnologies/cassette,damiensawyer/cassette,honestegg/cassette,andrewdavey/cassette,BluewireTechnologies/cassette,damiensawyer/cassette,andrewdavey/cassette,honestegg/cassette,damiensawyer/cassette,honestegg/cassette,andrewdavey/cassette
|
src/Cassette/HtmlTemplates/InlineHtmlTemplateBundleRenderer.cs
|
src/Cassette/HtmlTemplates/InlineHtmlTemplateBundleRenderer.cs
|
using System;
using System.Linq;
using Cassette.Utilities;
namespace Cassette.HtmlTemplates
{
class InlineHtmlTemplateBundleRenderer : IBundleHtmlRenderer<HtmlTemplateBundle>
{
public string Render(HtmlTemplateBundle bundle)
{
return string.Join(
Environment.NewLine,
bundle.Assets.Select(asset => asset.OpenStream().ReadToEnd()).ToArray()
);
}
}
}
|
using System;
using System.Linq;
using Cassette.Utilities;
namespace Cassette.HtmlTemplates
{
class InlineHtmlTemplateBundleRenderer : IBundleHtmlRenderer<HtmlTemplateBundle>
{
public string Render(HtmlTemplateBundle bundle)
{
return string.Join(
Environment.NewLine,
bundle.Assets.Select(asset => asset.OpenStream().ReadToEnd()) as string[]
);
}
}
}
|
mit
|
C#
|
afbd7e229b13ce14eac5c8cf5b48593603662710
|
Fix bug in DrawArea control
|
Thraka/SadConsole
|
SadConsole/UI/Themes/DrawingAreaTheme.cs
|
SadConsole/UI/Themes/DrawingAreaTheme.cs
|
using System;
using System.Runtime.Serialization;
using SadConsole.UI.Controls;
using SadRogue.Primitives;
namespace SadConsole.UI.Themes
{
/// <summary>
/// A basic theme for a drawing surface that simply fills the surface based on the state.
/// </summary>
[DataContract]
public class DrawingAreaTheme : ThemeBase
{
/// <summary>
/// When true, only uses <see cref="ThemeStates.Normal"/> for drawing.
/// </summary>
[DataMember]
public bool UseNormalStateOnly { get; set; } = true;
/// <summary>
/// The current appearance based on the control state.
/// </summary>
public ColoredGlyph Appearance { get; protected set; }
/// <inheritdoc />
public override void UpdateAndDraw(ControlBase control, TimeSpan time)
{
if (!(control is DrawingArea drawingSurface)) return;
RefreshTheme(control.FindThemeColors(), control);
if (!UseNormalStateOnly)
Appearance = ControlThemeState.GetStateAppearance(control.State);
else
Appearance = ControlThemeState.Normal;
drawingSurface.OnDraw?.Invoke(drawingSurface, time);
control.IsDirty = false;
}
/// <inheritdoc />
public override ThemeBase Clone() => new DrawingAreaTheme()
{
ControlThemeState = ControlThemeState.Clone(),
UseNormalStateOnly = UseNormalStateOnly
};
}
}
|
using System;
using System.Runtime.Serialization;
using SadConsole.UI.Controls;
using SadRogue.Primitives;
namespace SadConsole.UI.Themes
{
/// <summary>
/// A basic theme for a drawing surface that simply fills the surface based on the state.
/// </summary>
[DataContract]
public class DrawingAreaTheme : ThemeBase
{
/// <summary>
/// When true, only uses <see cref="ThemeStates.Normal"/> for drawing.
/// </summary>
[DataMember]
public bool UseNormalStateOnly { get; set; } = true;
/// <summary>
/// The current appearance based on the control state.
/// </summary>
public ColoredGlyph Appearance { get; protected set; }
/// <inheritdoc />
public override void UpdateAndDraw(ControlBase control, TimeSpan time)
{
if (!(control is DrawingArea drawingSurface)) return;
RefreshTheme(control.FindThemeColors(), control);
if (!UseNormalStateOnly)
Appearance = ControlThemeState.GetStateAppearance(control.State);
else
Appearance = ControlThemeState.Normal;
drawingSurface?.OnDraw(drawingSurface, time);
control.IsDirty = false;
}
/// <inheritdoc />
public override ThemeBase Clone() => new DrawingAreaTheme()
{
ControlThemeState = ControlThemeState.Clone(),
UseNormalStateOnly = UseNormalStateOnly
};
}
}
|
mit
|
C#
|
bca626a5ed042685a9abb884b8cb04d7400f829b
|
Add missing parameter to date range aggregation method (Port of #4024)
|
elastic/elasticsearch-net,elastic/elasticsearch-net
|
src/Nest/Aggregations/Bucket/DateRange/DateRangeAggregation.cs
|
src/Nest/Aggregations/Bucket/DateRange/DateRangeAggregation.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using Elasticsearch.Net.Utf8Json;
namespace Nest
{
[InterfaceDataContract]
[ReadAs(typeof(DateRangeAggregation))]
public interface IDateRangeAggregation : IBucketAggregation
{
[DataMember(Name ="field")]
Field Field { get; set; }
[DataMember(Name ="format")]
string Format { get; set; }
[DataMember(Name="missing")]
object Missing { get; set; }
[DataMember(Name ="ranges")]
IEnumerable<IDateRangeExpression> Ranges { get; set; }
[DataMember(Name ="time_zone")]
string TimeZone { get; set; }
}
public class DateRangeAggregation : BucketAggregationBase, IDateRangeAggregation
{
internal DateRangeAggregation() { }
public DateRangeAggregation(string name) : base(name) { }
public Field Field { get; set; }
public string Format { get; set; }
public object Missing { get; set; }
public IEnumerable<IDateRangeExpression> Ranges { get; set; }
public string TimeZone { get; set; }
internal override void WrapInContainer(AggregationContainer c) => c.DateRange = this;
}
public class DateRangeAggregationDescriptor<T>
: BucketAggregationDescriptorBase<DateRangeAggregationDescriptor<T>, IDateRangeAggregation, T>
, IDateRangeAggregation
where T : class
{
Field IDateRangeAggregation.Field { get; set; }
string IDateRangeAggregation.Format { get; set; }
object IDateRangeAggregation.Missing { get; set; }
IEnumerable<IDateRangeExpression> IDateRangeAggregation.Ranges { get; set; }
string IDateRangeAggregation.TimeZone { get; set; }
public DateRangeAggregationDescriptor<T> Field(Field field) => Assign(field, (a, v) => a.Field = v);
public DateRangeAggregationDescriptor<T> Field<TValue>(Expression<Func<T, TValue>> field) => Assign(field, (a, v) => a.Field = v);
public DateRangeAggregationDescriptor<T> Format(string format) => Assign(format, (a, v) => a.Format = v);
public DateRangeAggregationDescriptor<T> Missing(object missing) => Assign(missing, (a, v) => a.Missing = v);
public DateRangeAggregationDescriptor<T> Ranges(params IDateRangeExpression[] ranges) =>
Assign(ranges.ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);
public DateRangeAggregationDescriptor<T> TimeZone(string timeZone) => Assign(timeZone, (a, v) => a.TimeZone = v);
public DateRangeAggregationDescriptor<T> Ranges(params Func<DateRangeExpressionDescriptor, IDateRangeExpression>[] ranges) =>
Assign(ranges?.Select(r => r(new DateRangeExpressionDescriptor())).ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);
public DateRangeAggregationDescriptor<T> Ranges(IEnumerable<Func<DateRangeExpressionDescriptor, IDateRangeExpression>> ranges) =>
Assign(ranges?.Select(r => r(new DateRangeExpressionDescriptor())).ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using Elasticsearch.Net.Utf8Json;
namespace Nest
{
[InterfaceDataContract]
[ReadAs(typeof(DateRangeAggregation))]
public interface IDateRangeAggregation : IBucketAggregation
{
[DataMember(Name ="field")]
Field Field { get; set; }
[DataMember(Name ="format")]
string Format { get; set; }
[DataMember(Name ="ranges")]
IEnumerable<IDateRangeExpression> Ranges { get; set; }
[DataMember(Name ="time_zone")]
string TimeZone { get; set; }
}
public class DateRangeAggregation : BucketAggregationBase, IDateRangeAggregation
{
internal DateRangeAggregation() { }
public DateRangeAggregation(string name) : base(name) { }
public Field Field { get; set; }
public string Format { get; set; }
public IEnumerable<IDateRangeExpression> Ranges { get; set; }
public string TimeZone { get; set; }
internal override void WrapInContainer(AggregationContainer c) => c.DateRange = this;
}
public class DateRangeAggregationDescriptor<T>
: BucketAggregationDescriptorBase<DateRangeAggregationDescriptor<T>, IDateRangeAggregation, T>
, IDateRangeAggregation
where T : class
{
Field IDateRangeAggregation.Field { get; set; }
string IDateRangeAggregation.Format { get; set; }
IEnumerable<IDateRangeExpression> IDateRangeAggregation.Ranges { get; set; }
string IDateRangeAggregation.TimeZone { get; set; }
public DateRangeAggregationDescriptor<T> Field(Field field) => Assign(field, (a, v) => a.Field = v);
public DateRangeAggregationDescriptor<T> Field<TValue>(Expression<Func<T, TValue>> field) => Assign(field, (a, v) => a.Field = v);
public DateRangeAggregationDescriptor<T> Format(string format) => Assign(format, (a, v) => a.Format = v);
public DateRangeAggregationDescriptor<T> Ranges(params IDateRangeExpression[] ranges) =>
Assign(ranges.ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);
public DateRangeAggregationDescriptor<T> TimeZone(string timeZone) => Assign(timeZone, (a, v) => a.TimeZone = v);
public DateRangeAggregationDescriptor<T> Ranges(params Func<DateRangeExpressionDescriptor, IDateRangeExpression>[] ranges) =>
Assign(ranges?.Select(r => r(new DateRangeExpressionDescriptor())).ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);
public DateRangeAggregationDescriptor<T> Ranges(IEnumerable<Func<DateRangeExpressionDescriptor, IDateRangeExpression>> ranges) =>
Assign(ranges?.Select(r => r(new DateRangeExpressionDescriptor())).ToListOrNullIfEmpty(), (a, v) => a.Ranges = v);
}
}
|
apache-2.0
|
C#
|
0609fc40de1ba8ba08e5126bc22c1351b027d268
|
Fix up DrawableJuiceStream/BananaShower
|
peppy/osu,2yangk23/osu,peppy/osu-new,NeoAdonis/osu,2yangk23/osu,ppy/osu,UselessToucan/osu,ZLima12/osu,ZLima12/osu,smoogipoo/osu,peppy/osu,DrabWeb/osu,ppy/osu,Frontear/osuKyzer,EVAST9919/osu,Nabile-Rahmani/osu,UselessToucan/osu,ppy/osu,NeoAdonis/osu,EVAST9919/osu,peppy/osu,naoey/osu,DrabWeb/osu,smoogipoo/osu,UselessToucan/osu,DrabWeb/osu,johnneijzen/osu,smoogipoo/osu,naoey/osu,NeoAdonis/osu,johnneijzen/osu,naoey/osu,smoogipooo/osu
|
osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs
|
osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.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.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using OpenTK;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
public class DrawableJuiceStream : DrawableCatchHitObject<JuiceStream>
{
private readonly Container dropletContainer;
public DrawableJuiceStream(JuiceStream s) : base(s)
{
RelativeSizeAxes = Axes.Both;
Origin = Anchor.BottomLeft;
X = 0;
Child = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
foreach (CatchHitObject tick in s.NestedHitObjects.OfType<CatchHitObject>())
{
TinyDroplet tiny = tick as TinyDroplet;
if (tiny != null)
{
AddNested(new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) });
continue;
}
Droplet droplet = tick as Droplet;
if (droplet != null)
AddNested(new DrawableDroplet(droplet));
Fruit fruit = tick as Fruit;
if (fruit != null)
AddNested(new DrawableFruit(fruit));
}
}
protected override void AddNested(DrawableHitObject h)
{
((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
dropletContainer.Add(h);
base.AddNested(h);
}
}
}
|
// 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.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using OpenTK;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
public class DrawableJuiceStream : DrawableCatchHitObject<JuiceStream>
{
private readonly Container dropletContainer;
public DrawableJuiceStream(JuiceStream s) : base(s)
{
RelativeSizeAxes = Axes.Both;
Height = (float)HitObject.Duration;
X = 0;
Child = dropletContainer = new Container
{
RelativeSizeAxes = Axes.Both,
RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime),
RelativeChildSize = new Vector2(1, (float)HitObject.Duration)
};
foreach (CatchHitObject tick in s.NestedHitObjects.OfType<CatchHitObject>())
{
TinyDroplet tiny = tick as TinyDroplet;
if (tiny != null)
{
AddNested(new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) });
continue;
}
Droplet droplet = tick as Droplet;
if (droplet != null)
AddNested(new DrawableDroplet(droplet));
Fruit fruit = tick as Fruit;
if (fruit != null)
AddNested(new DrawableFruit(fruit));
}
}
protected override void AddNested(DrawableHitObject h)
{
((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
dropletContainer.Add(h);
base.AddNested(h);
}
}
}
|
mit
|
C#
|
3732f21b2edc881a3294d67ff7a538e9e7d09756
|
Reset version number
|
inMobile/inMobile-.NET-API-Client
|
Sms.ApiClient/Properties/AssemblyInfo.cs
|
Sms.ApiClient/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("Sms.ApiClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sms.ApiClient")]
[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("b0983e1f-fecd-473b-8154-892b671c37cc")]
// 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.2.1.0")]
[assembly: AssemblyFileVersion("2.2.1.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sms.ApiClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sms.ApiClient")]
[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("b0983e1f-fecd-473b-8154-892b671c37cc")]
// 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.2.71.0")]
[assembly: AssemblyFileVersion("2.2.71.0")]
|
bsd-3-clause
|
C#
|
6d01c0c30be21e8bbdde76dedf8f25f42398d459
|
add error handling to android location service
|
dkataskin/bstrkr
|
bstrkr.mobile/bstrkr.core.android/Services/Location/SuperLocationService.cs
|
bstrkr.mobile/bstrkr.core.android/Services/Location/SuperLocationService.cs
|
using System;
using Cirrious.MvvmCross.Plugins.Location;
using bstrkr.core.services.location;
using bstrkr.core.spatial;
namespace bstrkr.core.android.services.location
{
public class SuperLocationService : ILocationService
{
private IMvxLocationWatcher _locationWatcher;
public SuperLocationService(IMvxLocationWatcher locationWatcher)
{
_locationWatcher = locationWatcher;
}
public event EventHandler<LocationUpdatedEventArgs> LocationUpdated;
public void StartUpdating()
{
_locationWatcher.Start(
new MvxLocationOptions
{
Accuracy = MvxLocationAccuracy.Fine,
TimeBetweenUpdates = TimeSpan.FromMilliseconds(1000),
MovementThresholdInM = 30
},
this.OnSuccess,
this.OnError);
}
public void StopUpdating()
{
_locationWatcher.Stop();
}
private void OnSuccess(MvxGeoLocation geoLocation)
{
if (this.LocationUpdated != null)
{
this.LocationUpdated(
this,
new LocationUpdatedEventArgs(geoLocation.Coordinates.Latitude,
geoLocation.Coordinates.Longitude,
geoLocation.Coordinates.Accuracy));
}
}
private void OnError(MvxLocationError locationError)
{
switch (locationError.Code)
{
case MvxLocationErrorCode.PermissionDenied:
break;
case MvxLocationErrorCode.ServiceUnavailable:
break;
case MvxLocationErrorCode.PositionUnavailable:
break;
default:
break;
}
}
}
}
|
using System;
using Cirrious.MvvmCross.Plugins.Location;
using bstrkr.core.services.location;
using bstrkr.core.spatial;
namespace bstrkr.core.android.services.location
{
public class SuperLocationService : ILocationService
{
private IMvxLocationWatcher _locationWatcher;
public SuperLocationService(IMvxLocationWatcher locationWatcher)
{
_locationWatcher = locationWatcher;
}
public event EventHandler<LocationUpdatedEventArgs> LocationUpdated;
public void StartUpdating()
{
_locationWatcher.Start(
new MvxLocationOptions
{
Accuracy = MvxLocationAccuracy.Fine,
TimeBetweenUpdates = TimeSpan.FromMilliseconds(1000),
},
this.OnSuccess,
this.OnError);
}
public void StopUpdating()
{
_locationWatcher.Stop();
}
private void OnSuccess(MvxGeoLocation geoLocation)
{
if (this.LocationUpdated != null)
{
this.LocationUpdated(
this,
new LocationUpdatedEventArgs(geoLocation.Coordinates.Latitude,
geoLocation.Coordinates.Longitude,
geoLocation.Coordinates.Accuracy));
}
}
private void OnError(MvxLocationError locationError)
{
}
}
}
|
bsd-2-clause
|
C#
|
0d5a0a53e706280003b9d2981ff547d989b4e746
|
remove overload for name resolver
|
cvent/Metrics.NET,ntent-ad/Metrics.NET,Liwoj/Metrics.NET,mnadel/Metrics.NET,cvent/Metrics.NET,etishor/Metrics.NET,alhardy/Metrics.NET,DeonHeyns/Metrics.NET,DeonHeyns/Metrics.NET,huoxudong125/Metrics.NET,Recognos/Metrics.NET,MetaG8/Metrics.NET,alhardy/Metrics.NET,huoxudong125/Metrics.NET,MetaG8/Metrics.NET,MetaG8/Metrics.NET,Recognos/Metrics.NET,Liwoj/Metrics.NET,etishor/Metrics.NET,ntent-ad/Metrics.NET,mnadel/Metrics.NET
|
Src/Adapters/Owin.Metrics/OwinMetrics.cs
|
Src/Adapters/Owin.Metrics/OwinMetrics.cs
|
using System;
using Metrics;
namespace Owin.Metrics
{
/// <summary>
/// Helper class to register OWIN Metrics
/// </summary>
public static class OwinMetrics
{
/// <summary>
/// Add Metrics Middleware to the Owin pipeline.
/// Sample: Metric.Config.WithOwin( m => app.Use(m))
/// Where app is the IAppBuilder
/// </summary>
/// <param name="config">Chainable configuration object.</param>
/// <param name="middlewareRegistration">Action used to register middleware. This should generally be app.Use(middleware)</param>
/// <returns>Chainable configuration object.</returns>
public static MetricsConfig WithOwin(this MetricsConfig config, Action<object> middlewareRegistration)
{
return config.WithOwin(middlewareRegistration, owin =>
owin.WithRequestMetricsConfig()
.WithMetricsEndpoint());
}
/// <summary>
/// Add Metrics Middleware to the Owin pipeline.
/// Sample: Metric.Config.WithOwin( m => app.Use(m))
/// Where app is the IAppBuilder
/// </summary>
/// <param name="config">Chainable configuration object.</param>
/// <param name="middlewareRegistration">Action used to register middleware. This should generally be app.Use(middleware)</param>
/// <param name="owinConfig">Action used to configure Owin metrics.</param>
/// <returns>Chainable configuration object.</returns>
public static MetricsConfig WithOwin(this MetricsConfig config, Action<object> middlewareRegistration, Action<OwinMetricsConfig> owinConfig)
{
var owin = config.WithConfigExtension((ctx, hs) => new OwinMetricsConfig(middlewareRegistration, ctx, hs));
owinConfig(owin);
return config;
}
}
}
|
using Metrics;
using System;
using System.Collections.Generic;
namespace Owin.Metrics
{
/// <summary>
/// Helper class to register OWIN Metrics
/// </summary>
public static class OwinMetrics
{
/// <summary>
/// Add Metrics Middleware to the Owin pipeline.
/// Sample: Metric.Config.WithOwin( m => app.Use(m))
/// Where app is the IAppBuilder
/// </summary>
/// <param name="config">Chainable configuration object.</param>
/// <param name="middlewareRegistration">Action used to register middleware. This should generally be app.Use(middleware)</param>
/// <returns>Chainable configuration object.</returns>
public static MetricsConfig WithOwin(this MetricsConfig config, Action<object> middlewareRegistration)
{
return config.WithOwin(middlewareRegistration, owin =>
owin.WithRequestMetricsConfig()
.WithMetricsEndpoint());
}
/// <summary>
/// Add Metrics Middleware to the Owin pipeline.
/// Sample: Metric.Config.WithOwin( m => app.Use(m))
/// Where app is the IAppBuilder
/// </summary>
/// <param name="config">Chainable configuration object.</param>
/// <param name="middlewareRegistration">Action used to register middleware. This should generally be app.Use(middleware)</param>
/// <param name="owinConfig">Action used to configure Owin metrics.</param>
/// <returns>Chainable configuration object.</returns>
public static MetricsConfig WithOwin(this MetricsConfig config, Action<object> middlewareRegistration, Action<OwinMetricsConfig> owinConfig)
{
var owin = config.WithConfigExtension((ctx, hs) => new OwinMetricsConfig(middlewareRegistration, ctx, hs));
owinConfig(owin);
return config;
}
/// <summary>
/// Add Metrics Middleware to the Owin pipeline.
/// Sample: Metric.Config.WithOwin( m => app.Use(m))
/// Where app is the IAppBuilder
/// </summary>
/// <param name="config">Chainable configuration object.</param>
/// <param name="middlewareRegistration">Action used to register middleware. This should generally be app.Use(middleware)</param>
/// <param name="owinConfig">Action used to configure Owin metrics.</param>
/// <param name="metricNameResolver">
/// The metric name resolver callback.
/// If not provided a metric for each OWIN request will be created for each route and their route parameters.
/// These route parameters need to be determined using the underlying web framework.
/// e.g.
/// - /sample/1
/// - /sample/2
/// </param>
/// <returns>Chainable configuration object.</returns>
public static MetricsConfig WithOwin(this MetricsConfig config, Action<object> middlewareRegistration,
Action<OwinMetricsConfig> owinConfig, Func<IDictionary<string, object>, string> metricNameResolver)
{
var owin = config.WithConfigExtension((ctx, hs) => new OwinMetricsConfig(middlewareRegistration, ctx, hs));
owinConfig(owin);
return config;
}
}
}
|
apache-2.0
|
C#
|
014eeaaaa25629aae1589f5c346bcda4dccc2375
|
Remove CommentTest for jpeg test without metadata
|
Clancey/taglib-sharp,mono/taglib-sharp,CamargoR/taglib-sharp,CamargoR/taglib-sharp,Clancey/taglib-sharp,Clancey/taglib-sharp,hwahrmann/taglib-sharp,archrival/taglib-sharp,punker76/taglib-sharp,hwahrmann/taglib-sharp,punker76/taglib-sharp,archrival/taglib-sharp
|
tests/fixtures/TagLib.Tests.Images/JpegNoMetadataTest.cs
|
tests/fixtures/TagLib.Tests.Images/JpegNoMetadataTest.cs
|
using System;
using NUnit.Framework;
using TagLib.IFD;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
using TagLib.Xmp;
using TagLib.Tests.Images.Validators;
namespace TagLib.Tests.Images
{
[TestFixture]
public class JpegNoMetadataTest
{
[Test]
public void Test ()
{
ImageTest.Run ("sample_no_metadata.jpg",
new JpegNoMetadataTestInvariantValidator (),
NoModificationValidator.Instance,
new NoModificationValidator (),
new TagCommentModificationValidator (TagTypes.TiffIFD, false),
new TagCommentModificationValidator (TagTypes.XMP, false),
new TagKeywordsModificationValidator (TagTypes.XMP, false)
);
}
}
public class JpegNoMetadataTestInvariantValidator : IMetadataInvariantValidator
{
public void ValidateMetadataInvariants (Image.File file)
{
Assert.IsNotNull (file);
}
}
}
|
using System;
using NUnit.Framework;
using TagLib.IFD;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
using TagLib.Xmp;
using TagLib.Tests.Images.Validators;
namespace TagLib.Tests.Images
{
[TestFixture]
public class JpegNoMetadataTest
{
[Test]
public void Test ()
{
ImageTest.Run ("sample_no_metadata.jpg",
new JpegNoMetadataTestInvariantValidator (),
NoModificationValidator.Instance,
new NoModificationValidator (),
new CommentModificationValidator (),
new TagCommentModificationValidator (TagTypes.TiffIFD, false),
new TagCommentModificationValidator (TagTypes.XMP, false),
new TagKeywordsModificationValidator (TagTypes.XMP, false)
);
}
}
public class JpegNoMetadataTestInvariantValidator : IMetadataInvariantValidator
{
public void ValidateMetadataInvariants (Image.File file)
{
Assert.IsNotNull (file);
}
}
}
|
lgpl-2.1
|
C#
|
01202f09bec882209c314a34cf05543c3acaa0a0
|
Expand SearchBeatmapSetsResponse
|
peppy/osu,johnneijzen/osu,2yangk23/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu-new,smoogipooo/osu,EVAST9919/osu,UselessToucan/osu,ppy/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,ppy/osu,2yangk23/osu,johnneijzen/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu,EVAST9919/osu,smoogipoo/osu
|
osu.Game/Online/API/Requests/SearchBeatmapSetsResponse.cs
|
osu.Game/Online/API/Requests/SearchBeatmapSetsResponse.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Online.API.Requests
{
public class SearchBeatmapSetsResponse : ResponseWithCursor
{
[JsonProperty("beatmapsets")]
public IEnumerable<APIBeatmapSet> BeatmapSets;
[JsonProperty("error")]
public string Error;
[JsonProperty("total")]
public int Total;
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Online.API.Requests
{
public class SearchBeatmapSetsResponse : ResponseWithCursor
{
public IEnumerable<APIBeatmapSet> BeatmapSets;
}
}
|
mit
|
C#
|
adeecc971448410c89191bb85bd72b9c76934b20
|
update toxy assembly version
|
tonyqus/toxy
|
ToxyFramework/Properties/AssemblyInfo.cs
|
ToxyFramework/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// 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("Toxy Framework")]
[assembly: AssemblyDescription(".Net Data/Text Extraction Framework")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Neuzilla")]
[assembly: AssemblyProduct("Toxy")]
[assembly: AssemblyCopyright("Apache 2.0")]
[assembly: AssemblyTrademark("Neuzilla")]
[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("3c5f41de-9f62-45cc-b89e-8e377a2e036e")]
// 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.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// 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("Toxy Framework")]
[assembly: AssemblyDescription(".Net Data/Text Extraction Framework")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Neuzilla")]
[assembly: AssemblyProduct("Toxy")]
[assembly: AssemblyCopyright("Apache 2.0")]
[assembly: AssemblyTrademark("Neuzilla")]
[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("3c5f41de-9f62-45cc-b89e-8e377a2e036e")]
// 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.5.0.0")]
[assembly: AssemblyFileVersion("1.5.0.0")]
[assembly: AssemblyInformationalVersion("Toxy 1.5")]
[assembly: AllowPartiallyTrustedCallers]
|
apache-2.0
|
C#
|
0790dca925676afe5a058bec79bfa122a9474b7d
|
bump version
|
Fody/ModuleInit
|
CommonAssemblyInfo.cs
|
CommonAssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ModuleInit")]
[assembly: AssemblyProduct("ModuleInit")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.7.0.0")]
[assembly: AssemblyFileVersion("0.7.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ModuleInit")]
[assembly: AssemblyProduct("ModuleInit")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")]
|
mit
|
C#
|
0562ba6434eed90bbb41fa68d80f6dd55f0e748b
|
bump version
|
Fody/Freezable
|
CommonAssemblyInfo.cs
|
CommonAssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Freezable")]
[assembly: AssemblyProduct("Freezable")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Freezable")]
[assembly: AssemblyProduct("Freezable")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.4.0.0")]
[assembly: AssemblyFileVersion("0.4.0.0")]
|
mit
|
C#
|
16bbc7887d2a5cb6c62b734dd98eeb910b4c3ad9
|
Convert size parameter from int to long
|
Azure/azure-sdk-for-java,selvasingh/azure-sdk-for-java,selvasingh/azure-sdk-for-java,Azure/azure-sdk-for-java,Azure/azure-sdk-for-java,Azure/azure-sdk-for-java,Azure/azure-sdk-for-java,selvasingh/azure-sdk-for-java
|
net/Azure.Storage.Blobs.PerfStress/Core/SizeOptions.cs
|
net/Azure.Storage.Blobs.PerfStress/Core/SizeOptions.cs
|
using Azure.Test.PerfStress;
using CommandLine;
namespace Azure.Storage.Blobs.PerfStress.Core
{
public class SizeOptions : PerfStressOptions
{
[Option('s', "size", Default = 10 * 1024, HelpText = "Size of message (in bytes)")]
public long Size { get; set; }
}
}
|
using Azure.Test.PerfStress;
using CommandLine;
namespace Azure.Storage.Blobs.PerfStress.Core
{
public class SizeOptions : PerfStressOptions
{
[Option('s', "size", Default = 10 * 1024, HelpText = "Size of message (in bytes)")]
public int Size { get; set; }
}
}
|
mit
|
C#
|
357d023395aa7323c92229956bc14bf59b484306
|
Remove double subscription to SelectionChanged event.
|
cra0zy/xwt,lytico/xwt,hwthomas/xwt,hamekoz/xwt,antmicro/xwt,TheBrainTech/xwt,mono/xwt,residuum/xwt
|
Xwt.Gtk/Xwt.GtkBackend/ListBoxBackend.cs
|
Xwt.Gtk/Xwt.GtkBackend/ListBoxBackend.cs
|
//
// ListBoxBackend.cs
//
// Author:
// Lluis Sanchez <lluis@xamarin.com>
//
// Copyright (c) 2012 Xamarin Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Xwt.Backends;
namespace Xwt.GtkBackend
{
public class ListBoxBackend: ListViewBackend, IListBoxBackend
{
Gtk.TreeViewColumn theColumn;
public ListBoxBackend ()
{
}
public new bool GridLinesVisible {
get {
return (base.GridLinesVisible == Xwt.GridLines.Horizontal || base.GridLinesVisible == Xwt.GridLines.Both);
}
set {
base.GridLinesVisible = value ? Xwt.GridLines.Horizontal : Xwt.GridLines.None;
}
}
protected new IListBoxEventSink EventSink {
get { return (IListBoxEventSink)((WidgetBackend)this).EventSink; }
}
public override void Initialize ()
{
base.Initialize ();
Widget.HeadersVisible = false;
theColumn = new Gtk.TreeViewColumn ();
Widget.AppendColumn (theColumn);
var cr = new Gtk.CellRendererText ();
theColumn.PackStart (cr, false);
theColumn.AddAttribute (cr, "text", 0);
}
public void SetViews (CellViewCollection views)
{
theColumn.Clear ();
foreach (var v in views)
CellUtil.CreateCellRenderer (ApplicationContext, Frontend, this, theColumn, v);
}
}
}
|
//
// ListBoxBackend.cs
//
// Author:
// Lluis Sanchez <lluis@xamarin.com>
//
// Copyright (c) 2012 Xamarin Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Xwt.Backends;
namespace Xwt.GtkBackend
{
public class ListBoxBackend: ListViewBackend, IListBoxBackend
{
Gtk.TreeViewColumn theColumn;
public ListBoxBackend ()
{
}
public new bool GridLinesVisible {
get {
return (base.GridLinesVisible == Xwt.GridLines.Horizontal || base.GridLinesVisible == Xwt.GridLines.Both);
}
set {
base.GridLinesVisible = value ? Xwt.GridLines.Horizontal : Xwt.GridLines.None;
}
}
protected new IListBoxEventSink EventSink {
get { return (IListBoxEventSink)((WidgetBackend)this).EventSink; }
}
public override void Initialize ()
{
base.Initialize ();
Widget.HeadersVisible = false;
theColumn = new Gtk.TreeViewColumn ();
Widget.AppendColumn (theColumn);
var cr = new Gtk.CellRendererText ();
theColumn.PackStart (cr, false);
theColumn.AddAttribute (cr, "text", 0);
}
public void SetViews (CellViewCollection views)
{
theColumn.Clear ();
foreach (var v in views)
CellUtil.CreateCellRenderer (ApplicationContext, Frontend, this, theColumn, v);
}
public override void EnableEvent (object eventId)
{
base.EnableEvent (eventId);
if (eventId is TableViewEvent) {
if (((TableViewEvent)eventId) == TableViewEvent.SelectionChanged)
Widget.Selection.Changed += HandleWidgetSelectionChanged;
}
}
public override void DisableEvent (object eventId)
{
base.DisableEvent (eventId);
if (eventId is TableViewEvent) {
if (((TableViewEvent)eventId) == TableViewEvent.SelectionChanged)
Widget.Selection.Changed -= HandleWidgetSelectionChanged;
}
}
void HandleWidgetSelectionChanged (object sender, EventArgs e)
{
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnSelectionChanged ();
});
}
}
}
|
mit
|
C#
|
bf2989fc1e2a784286a495ee512b33cdb903bec7
|
Fix JobHandler tests
|
tgstation/tgstation-server,tgstation/tgstation-server-tools,tgstation/tgstation-server
|
tests/Tgstation.Server.Host.Tests/Jobs/TestJobHandler.cs
|
tests/Tgstation.Server.Host.Tests/Jobs/TestJobHandler.cs
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Tgstation.Server.Host.Jobs.Tests
{
[TestClass]
public sealed class TestJobHandler
{
Task currentWaitTask;
bool cancelled;
async Task TestJob(CancellationToken cancellationToken)
{
await currentWaitTask.ConfigureAwait(false);
cancelled = cancellationToken.IsCancellationRequested;
}
[TestMethod]
public void TestConstructionAndDisposal()
{
cancelled = false;
Assert.ThrowsException<ArgumentNullException>(() => new JobHandler(null));
currentWaitTask = Task.CompletedTask;
new JobHandler(TestJob).Dispose();
Assert.IsFalse(cancelled);
}
[TestMethod]
public async Task TestWait()
{
cancelled = false;
//test with a cancelled cts
using (var cts = new CancellationTokenSource())
{
var tcs = new TaskCompletionSource<object>();
currentWaitTask = tcs.Task;
cts.Cancel();
using var handler = new JobHandler(TestJob);
await Assert.ThrowsExceptionAsync<InvalidOperationException>(() => handler.Wait(cts.Token)).ConfigureAwait(false);
handler.Start();
await Assert.ThrowsExceptionAsync<OperationCanceledException>(() => handler.Wait(cts.Token)).ConfigureAwait(false);
tcs.SetResult(null);
await handler.Wait(default).ConfigureAwait(false);
}
Assert.IsFalse(cancelled);
}
[TestMethod]
public void TestProgress()
{
currentWaitTask = Task.CompletedTask;
cancelled = false;
using (var handler = new JobHandler(TestJob))
{
Assert.IsFalse(handler.Progress.HasValue);
handler.Progress = 42;
Assert.AreEqual(42, handler.Progress);
}
Assert.IsFalse(cancelled);
}
[TestMethod]
public async Task TestCancellation()
{
var tcs = new TaskCompletionSource<object>();
currentWaitTask = tcs.Task;
cancelled = false;
using(var handler = new JobHandler(TestJob))
{
handler.Start();
handler.Cancel();
tcs.SetResult(null);
await handler.Wait(default).ConfigureAwait(false);
}
Assert.IsTrue(cancelled);
}
}
}
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Tgstation.Server.Host.Jobs.Tests
{
[TestClass]
public sealed class TestJobHandler
{
Task currentWaitTask;
bool cancelled;
async Task TestJob(CancellationToken cancellationToken)
{
await currentWaitTask.ConfigureAwait(false);
cancelled = cancellationToken.IsCancellationRequested;
}
[TestMethod]
public void TestConstructionAndDisposal()
{
cancelled = false;
Assert.ThrowsException<ArgumentNullException>(() => new JobHandler(null));
currentWaitTask = Task.CompletedTask;
new JobHandler(TestJob).Dispose();
Assert.IsFalse(cancelled);
}
[TestMethod]
public async Task TestWait()
{
cancelled = false;
//test with a cancelled cts
using (var cts = new CancellationTokenSource())
{
var tcs = new TaskCompletionSource<object>();
currentWaitTask = tcs.Task;
cts.Cancel();
using(var handler = new JobHandler(TestJob))
{
await Assert.ThrowsExceptionAsync<OperationCanceledException>(() => handler.Wait(cts.Token)).ConfigureAwait(false);
tcs.SetResult(null);
await handler.Wait(default).ConfigureAwait(false);
}
}
Assert.IsFalse(cancelled);
}
[TestMethod]
public void TestProgress()
{
currentWaitTask = Task.CompletedTask;
cancelled = false;
using (var handler = new JobHandler(TestJob))
{
Assert.IsFalse(handler.Progress.HasValue);
handler.Progress = 42;
Assert.AreEqual(42, handler.Progress);
}
Assert.IsFalse(cancelled);
}
[TestMethod]
public async Task TestCancellation()
{
var tcs = new TaskCompletionSource<object>();
currentWaitTask = tcs.Task;
cancelled = false;
using(var handler = new JobHandler(TestJob))
{
handler.Cancel();
tcs.SetResult(null);
await handler.Wait(default).ConfigureAwait(false);
}
Assert.IsTrue(cancelled);
}
}
}
|
agpl-3.0
|
C#
|
01582f78b9d553b4374b5f77eed82e5e137cace1
|
Initialize SerializationManager in IlBasedSerializerTests (#2279)
|
brhinescot/orleans,benjaminpetit/orleans,amccool/orleans,Carlm-MS/orleans,ReubenBond/orleans,gabikliot/orleans,brhinescot/orleans,waynemunro/orleans,bstauff/orleans,waynemunro/orleans,dVakulen/orleans,SoftWar1923/orleans,amccool/orleans,jokin/orleans,hoopsomuah/orleans,shlomiw/orleans,centur/orleans,Liversage/orleans,LoveElectronics/orleans,MikeHardman/orleans,MikeHardman/orleans,jokin/orleans,shlomiw/orleans,galvesribeiro/orleans,pherbel/orleans,veikkoeeva/orleans,amccool/orleans,rrector/orleans,jason-bragg/orleans,galvesribeiro/orleans,bstauff/orleans,shayhatsor/orleans,Liversage/orleans,ibondy/orleans,ashkan-saeedi-mazdeh/orleans,ElanHasson/orleans,jthelin/orleans,sergeybykov/orleans,dVakulen/orleans,ashkan-saeedi-mazdeh/orleans,rrector/orleans,centur/orleans,LoveElectronics/orleans,jokin/orleans,sergeybykov/orleans,yevhen/orleans,Liversage/orleans,pherbel/orleans,dVakulen/orleans,ElanHasson/orleans,ibondy/orleans,SoftWar1923/orleans,ashkan-saeedi-mazdeh/orleans,Carlm-MS/orleans,yevhen/orleans,jdom/orleans,dotnet/orleans,jdom/orleans,shayhatsor/orleans,dotnet/orleans,hoopsomuah/orleans,brhinescot/orleans,gabikliot/orleans
|
test/NonSiloTests/SerializationTests/IlBasedSerializerTests.cs
|
test/NonSiloTests/SerializationTests/IlBasedSerializerTests.cs
|
namespace UnitTests.Serialization
{
using System.Diagnostics.CodeAnalysis;
using Orleans.Serialization;
using Xunit;
[TestCategory("BVT"), TestCategory("Serialization")]
public class IlBasedSerializerTests
{
public IlBasedSerializerTests()
{
SerializationManager.InitializeForTesting();
}
/// <summary>
/// Tests that <see cref="IlBasedSerializerGenerator"/> supports distinct field selection for serialization
/// versus copy operations.
/// </summary>
[Fact]
public void IlBasedSerializer_AllowCopiedFieldsToDifferFromSerializedFields()
{
var input = new FieldTest
{
One = 1,
Two = 2,
Three = 3
};
var generator = new IlBasedSerializerGenerator();
var serializers = generator.GenerateSerializer(input.GetType(), f => f.Name != "One", f => f.Name != "Three");
var copy = (FieldTest)serializers.DeepCopy(input);
Assert.Equal(1, copy.One);
Assert.Equal(2, copy.Two);
Assert.Equal(0, copy.Three);
var writer = new BinaryTokenStreamWriter();
serializers.Serialize(input, writer, input.GetType());
var reader = new BinaryTokenStreamReader(writer.ToByteArray());
var deserialized = (FieldTest)serializers.Deserialize(input.GetType(), reader);
Assert.Equal(0, deserialized.One);
Assert.Equal(2, deserialized.Two);
Assert.Equal(3, deserialized.Three);
}
[SuppressMessage("ReSharper", "StyleCop.SA1401", Justification = "This is for testing purposes.")]
private class FieldTest
{
#pragma warning disable 169
public int One;
public int Two;
public int Three;
#pragma warning restore 169
}
}
}
|
namespace UnitTests.Serialization
{
using System.Diagnostics.CodeAnalysis;
using Orleans.Serialization;
using Xunit;
[TestCategory("BVT"), TestCategory("Serialization")]
public class IlBasedSerializerTests
{
/// <summary>
/// Tests that <see cref="IlBasedSerializerGenerator"/> supports distinct field selection for serialization
/// versus copy operations.
/// </summary>
[Fact]
public void IlBasedSerializer_AllowCopiedFieldsToDifferFromSerializedFields()
{
var input = new FieldTest
{
One = 1,
Two = 2,
Three = 3
};
var generator = new IlBasedSerializerGenerator();
var serializers = generator.GenerateSerializer(input.GetType(), f => f.Name != "One", f => f.Name != "Three");
var copy = (FieldTest)serializers.DeepCopy(input);
Assert.Equal(1, copy.One);
Assert.Equal(2, copy.Two);
Assert.Equal(0, copy.Three);
var writer = new BinaryTokenStreamWriter();
serializers.Serialize(input, writer, input.GetType());
var reader = new BinaryTokenStreamReader(writer.ToByteArray());
var deserialized = (FieldTest)serializers.Deserialize(input.GetType(), reader);
Assert.Equal(0, deserialized.One);
Assert.Equal(2, deserialized.Two);
Assert.Equal(3, deserialized.Three);
}
[SuppressMessage("ReSharper", "StyleCop.SA1401", Justification = "This is for testing purposes.")]
private class FieldTest
{
#pragma warning disable 169
public int One;
public int Two;
public int Three;
#pragma warning restore 169
}
}
}
|
mit
|
C#
|
92d329154eaae66890ff11a2efe6ce61689229c9
|
Update filewacher.
|
sixpetals/CmisActionAgent
|
CmisActionAgentSolution/CmisActionAgentConsole/Program.cs
|
CmisActionAgentSolution/CmisActionAgentConsole/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Aegif.Makuranage.Models;
using Aegif.Makuranage.TriggerEngine;
using Aegif.Makuranage.ActionEngine;
using Aegif.Makuranage.ActionEngine.Cmis;
namespace Aegif.Makuranage.ConsoleApplication {
class Program {
static void Main(string[] args) {
var trigger = new LocalFileSystemTrigger();
trigger.Changed += Trigger_Changed;
Console.Read();
}
private static void Trigger_Changed(object sender, TransferObjectEventArgs e) {
var conn = new CmisConnector();
var action = new CmisUploadAction(conn);
action.Invoke(e.TransferObject);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Aegif.Makuranage.Models;
using Aegif.Makuranage.TriggerEngine;
using Aegif.Makuranage.ActionEngine;
namespace Aegif.Makuranage.ConsoleApplication {
class Program {
static void Main(string[] args) {
var trigger = new LocalFileSystemTrigger();
trigger.Changed += Trigger_Changed;
}
private static void Trigger_Changed(object sender, TransferObjectEventArgs e) {
var action = new CmisUploadAction();
action.Invole(e.TransferObject);
}
}
}
|
agpl-3.0
|
C#
|
4fc2c6c89e601953bf226b7a65db7255f3d41932
|
add self-adjustment to `FrameTime` (#1366)
|
lbochenek/react-native-windows,lbochenek/react-native-windows,lbochenek/react-native-windows,lbochenek/react-native-windows
|
ReactWindows/ReactNative.Shared/Modules/Core/FrameEventArgs.cs
|
ReactWindows/ReactNative.Shared/Modules/Core/FrameEventArgs.cs
|
using System;
namespace ReactNative.Modules.Core
{
/// <summary>
/// Event arguments for frame callbacks.
/// </summary>
public class FrameEventArgs : IMutableFrameEventArgs
{
private static readonly TimeSpan s_frameDuration = TimeSpan.FromTicks(166666);
private readonly TimeSpan _initialRenderingTime;
private DateTimeOffset _initialAbsoluteTime;
internal FrameEventArgs(TimeSpan renderingTime)
{
RenderingTime = _initialRenderingTime = renderingTime;
FrameTime = _initialAbsoluteTime = DateTimeOffset.UtcNow;
}
/// <summary>
/// The relative frame time.
/// </summary>
public TimeSpan RenderingTime
{
get;
private set;
}
/// <summary>
/// The absolute frame time.
/// </summary>
public DateTimeOffset FrameTime
{
get;
private set;
}
void IMutableFrameEventArgs.Update(TimeSpan renderingTime)
{
RenderingTime = renderingTime;
FrameTime = _initialAbsoluteTime + renderingTime - _initialRenderingTime;
// Self-adjust initial absolute time to better approximate CompositionTarget frame boundary
_initialAbsoluteTime -= FrameTime - DateTimeOffset.UtcNow - s_frameDuration;
}
}
}
|
using System;
namespace ReactNative.Modules.Core
{
/// <summary>
/// Event arguments for frame callbacks.
/// </summary>
public class FrameEventArgs : IMutableFrameEventArgs
{
private readonly TimeSpan _initialRenderingTime;
private readonly DateTimeOffset _initialAbsoluteTime;
internal FrameEventArgs(TimeSpan renderingTime)
{
RenderingTime = _initialRenderingTime = renderingTime;
FrameTime = _initialAbsoluteTime = DateTimeOffset.UtcNow;
}
/// <summary>
/// The relative frame time.
/// </summary>
public TimeSpan RenderingTime
{
get;
private set;
}
/// <summary>
/// The absolute frame time.
/// </summary>
public DateTimeOffset FrameTime
{
get;
private set;
}
void IMutableFrameEventArgs.Update(TimeSpan renderingTime)
{
RenderingTime = renderingTime;
FrameTime = _initialAbsoluteTime + renderingTime - _initialRenderingTime;
}
}
}
|
mit
|
C#
|
f84b64daf18e1667f734d7c9160add086f576f1a
|
Move property.
|
JohanLarsson/Gu.ChangeTracking,JohanLarsson/Gu.State,JohanLarsson/Gu.State
|
Gu.State/Track/RootChangeEventArgs/ReplaceEventArgs.cs
|
Gu.State/Track/RootChangeEventArgs/ReplaceEventArgs.cs
|
namespace Gu.State
{
using System;
using System.Collections;
/// <summary>This is raised when an element was replaced in a notifying collection.</summary>
public struct ReplaceEventArgs : IRootChangeEventArgs, IEquatable<ReplaceEventArgs>
{
internal ReplaceEventArgs(IList source, int index)
{
this.Index = index;
this.Source = source;
}
/// <summary>Gets the collection that changed.</summary>
public IList Source { get; }
/// <inheritdoc />
object IRootChangeEventArgs.Source => this.Source;
/// <summary>Gets the index at which an element was replaced. </summary>
public int Index { get; }
public static bool operator ==(ReplaceEventArgs left, ReplaceEventArgs right)
{
return left.Equals(right);
}
public static bool operator !=(ReplaceEventArgs left, ReplaceEventArgs right)
{
return !left.Equals(right);
}
/// <inheritdoc />
public bool Equals(ReplaceEventArgs other) => Equals(this.Source, other.Source) &&
this.Index == other.Index;
/// <inheritdoc />
public override bool Equals(object obj) => obj is ReplaceEventArgs other &&
this.Equals(other);
/// <inheritdoc />
public override int GetHashCode()
{
unchecked
{
return ((this.Source != null ? this.Source.GetHashCode() : 0) * 397) ^ this.Index;
}
}
}
}
|
namespace Gu.State
{
using System;
using System.Collections;
/// <summary>This is raised when an element was replaced in a notifying collection.</summary>
public struct ReplaceEventArgs : IRootChangeEventArgs, IEquatable<ReplaceEventArgs>
{
internal ReplaceEventArgs(IList source, int index)
{
this.Index = index;
this.Source = source;
}
/// <summary>Gets the collection that changed.</summary>
public IList Source { get; }
/// <inheritdoc />
object IRootChangeEventArgs.Source => this.Source;
public static bool operator ==(ReplaceEventArgs left, ReplaceEventArgs right)
{
return left.Equals(right);
}
public static bool operator !=(ReplaceEventArgs left, ReplaceEventArgs right)
{
return !left.Equals(right);
}
/// <summary>Gets the index at which an element was replaced. </summary>
public int Index { get; }
/// <inheritdoc />
public bool Equals(ReplaceEventArgs other) => Equals(this.Source, other.Source) &&
this.Index == other.Index;
/// <inheritdoc />
public override bool Equals(object obj) => obj is ReplaceEventArgs other &&
this.Equals(other);
/// <inheritdoc />
public override int GetHashCode()
{
unchecked
{
return ((this.Source != null ? this.Source.GetHashCode() : 0) * 397) ^ this.Index;
}
}
}
}
|
mit
|
C#
|
30180dcb1ed3a4736d27a5360fd828ccbcfd8fde
|
Set PlatformWindow in ShowSystemWindow
|
mmoening/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,mmoening/MatterControl,unlimitedbacon/MatterControl,mmoening/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl
|
MatterControl.Winforms/WinformsSingleWindowProvider.cs
|
MatterControl.Winforms/WinformsSingleWindowProvider.cs
|
/*
Copyright (c) 2018, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using MatterHackers.Agg.UI;
namespace MatterHackers.MatterControl
{
public class WinformsSingleWindowProvider : SingleWindowProvider
{
private OpenGLSystemWindow winform;
public override void ShowSystemWindow(SystemWindow systemWindow)
{
if (platformWindow == null)
{
winform = new OpenGLSystemWindow();
winform.WindowProvider = this;
WinformsSystemWindow.SingleWindowMode = true;
platformWindow = winform;
}
systemWindow.PlatformWindow = winform;
base.ShowSystemWindow(systemWindow);
}
}
}
|
/*
Copyright (c) 2018, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using MatterHackers.Agg.UI;
namespace MatterHackers.MatterControl
{
public class WinformsSingleWindowProvider : SingleWindowProvider
{
private OpenGLSystemWindow winform;
public override void ShowSystemWindow(SystemWindow systemWindow)
{
if (platformWindow == null)
{
winform = new OpenGLSystemWindow();
winform.WindowProvider = this;
WinformsSystemWindow.SingleWindowMode = true;
platformWindow = winform;
}
base.ShowSystemWindow(systemWindow);
}
}
}
|
bsd-2-clause
|
C#
|
9f0afc741e82816156021a13faea400b461f069c
|
add TiledObjectGroup.objectsWithType
|
ericmbernier/Nez,Blucky87/Nez,prime31/Nez,prime31/Nez,prime31/Nez
|
Nez.Portable/PipelineRuntime/Tiled/TiledObjectGroup.cs
|
Nez.Portable/PipelineRuntime/Tiled/TiledObjectGroup.cs
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace Nez.Tiled
{
public class TiledObjectGroup
{
public string name;
public Color color;
public float opacity;
public bool visible;
public Dictionary<string,string> properties = new Dictionary<string,string>();
public TiledObject[] objects;
public TiledObjectGroup( string name, Color color, bool visible, float opacity )
{
this.name = name;
this.color = color;
this.visible = visible;
this.opacity = opacity;
}
/// <summary>
/// gets the first TiledObject with the given name
/// </summary>
/// <returns>The with name.</returns>
/// <param name="name">Name.</param>
public TiledObject objectWithName( string name )
{
for( int i = 0; i < objects.Length; i++ )
{
if( objects[i].name == name )
return objects[i];
}
return null;
}
/// <summary>
/// gets all the TiledObjects with the given name
/// </summary>
/// <returns>The objects with matching names.</returns>
/// <param name="name">Name.</param>
public List<TiledObject> objectsWithName( string name )
{
var list = new List<TiledObject>();
for( int i = 0; i < objects.Length; i++ )
{
if( objects[i].name == name )
list.Add( objects[i] );
}
return list;
}
/// <summary>
/// gets all the TiledObjects with the given type
/// </summary>
/// <returns>The objects with matching types.</returns>
/// <param name="type">Type.</param>
public List<TiledObject> objectsWithType( string type )
{
var list = new List<TiledObject>();
for( int i = 0; i < objects.Length; i++ )
{
if( objects[i].type == type )
list.Add( objects[i] );
}
return list;
}
}
}
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace Nez.Tiled
{
public class TiledObjectGroup
{
public string name;
public Color color;
public float opacity;
public bool visible;
public Dictionary<string,string> properties = new Dictionary<string,string>();
public TiledObject[] objects;
public TiledObjectGroup( string name, Color color, bool visible, float opacity )
{
this.name = name;
this.color = color;
this.visible = visible;
this.opacity = opacity;
}
/// <summary>
/// gets the first TiledObject with the given name
/// </summary>
/// <returns>The with name.</returns>
/// <param name="name">Name.</param>
public TiledObject objectWithName( string name )
{
for( int i = 0; i < objects.Length; i++ )
{
if( objects[i].name == name )
return objects[i];
}
return null;
}
/// <summary>
/// gets all the TiledObjects with the given name
/// </summary>
/// <returns>The with name.</returns>
/// <param name="name">Name.</param>
public List<TiledObject> objectsWithName( string name )
{
var list = new List<TiledObject>();
for( int i = 0; i < objects.Length; i++ )
{
if( objects[i].name == name )
list.Add( objects[i] );
}
return list;
}
}
}
|
mit
|
C#
|
e4df1c0d9a261fbe22dc64f23d09ceff15d8c73b
|
Fix registration of Data Packages
|
csf-dev/agiil,csf-dev/agiil,csf-dev/agiil,csf-dev/agiil
|
Tests/Agiil.Web.TestBuild/Bootstrap/DataPackagesModule.cs
|
Tests/Agiil.Web.TestBuild/Bootstrap/DataPackagesModule.cs
|
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using Agiil.Web.Services.DataPackages;
using Autofac;
using Agiil.Web.Services;
namespace Agiil.Web.Bootstrap
{
public class DataPackagesModule : Autofac.Module
{
static readonly Type
NamespaceMarker = typeof(IDataPackagesNamespaceMarker),
DataPackageInterface = typeof(IDataPackage);
string DataPackagesNamespace => NamespaceMarker.Namespace;
protected override void Load(ContainerBuilder builder)
{
var packageTypes = GetDataPackageTypes();
foreach(var packageType in packageTypes)
{
builder
.RegisterType(packageType)
.As<IDataPackage>()
.WithMetadata<DataPackageMetadata>(config => {
config.For(x => x.PackageTypeName, packageType.Name);
});
}
}
IEnumerable<Type> GetDataPackageTypes()
{
return (from type in Assembly.GetExecutingAssembly().GetExportedTypes()
where
type.IsClass
&& !type.IsAbstract
&& DataPackageInterface.IsAssignableFrom(type)
&& type.Namespace == DataPackagesNamespace
select type)
.ToArray();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using Agiil.Web.Services.DataPackages;
using Autofac;
using Agiil.Web.Services;
namespace Agiil.Web.Bootstrap
{
public class DataPackagesModule : Autofac.Module
{
static readonly Type
NamespaceMarker = typeof(IDataPackagesNamespaceMarker),
DataPackageInterface = typeof(IDataPackage);
string DataPackagesNamespace => NamespaceMarker.Namespace;
protected override void Load(ContainerBuilder builder)
{
var packageTypes = GetDataPackageTypes();
foreach(var packageType in packageTypes)
{
builder
.RegisterType(packageType)
.WithMetadata<DataPackageMetadata>(config => {
config.For(x => x.PackageTypeName, packageType.Name);
});
}
}
IEnumerable<Type> GetDataPackageTypes()
{
return (from type in Assembly.GetExecutingAssembly().GetExportedTypes()
where
type.IsClass
&& !type.IsAbstract
&& DataPackageInterface.IsAssignableFrom(type)
&& type.Namespace == DataPackagesNamespace
select type)
.ToArray();
}
}
}
|
mit
|
C#
|
a011026d0e99566f3c60ba6a83cda2e8152448a1
|
Update AssemblyInfo.cs
|
google-pay/tink-jni-examples,google-pay/tink-jni-examples,google-pay/tink-jni-examples,google-pay/tink-jni-examples,google-pay/tink-jni-examples,google-pay/tink-jni-examples
|
TinkJNIDotNet/TinkDotNetSample/Properties/AssemblyInfo.cs
|
TinkJNIDotNet/TinkDotNetSample/Properties/AssemblyInfo.cs
|
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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;
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("Tink Library .Net C# Sample")]
[assembly: AssemblyDescription("An example of fascade program to invoke Java Tink library via Java Native Interface")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Google")]
[assembly: AssemblyProduct("Tink Library .Net C# Sample")]
[assembly: AssemblyCopyright("©2018 Google LLC")]
[assembly: AssemblyTrademark("Google and the Google logo are registered trademarks of Google LLC.")]
[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("54e5e772-344c-44bb-b687-29ce3362856f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tink Library .Net C# Sample")]
[assembly: AssemblyDescription("An example of fascade program to invoke Java Tink library via Java Native Interface")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Google")]
[assembly: AssemblyProduct("Tink Library .Net C# Sample")]
[assembly: AssemblyCopyright("©2018 Google LLC")]
[assembly: AssemblyTrademark("Google and the Google logo are registered trademarks of Google LLC.")]
[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("54e5e772-344c-44bb-b687-29ce3362856f")]
// 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")]
|
apache-2.0
|
C#
|
cfd1646de4672ee1d2005faa4c54ec80936ad87d
|
Remove unused RoleProvider setting from authentication configuration
|
Acute-sales-ltd/Bonobo-Git-Server,larshg/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,crowar/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,PGM-NipponSysits/IIS.Git-Connector,Acute-sales-ltd/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,padremortius/Bonobo-Git-Server,willdean/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,lkho/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,crowar/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,willdean/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,gencer/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,crowar/Bonobo-Git-Server,larshg/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,igoryok-zp/Bonobo-Git-Server,gencer/Bonobo-Git-Server,lkho/Bonobo-Git-Server,willdean/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,willdean/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,Ollienator/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,larshg/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,Ollienator/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,crowar/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,Webmine/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,crowar/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,larshg/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,lkho/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,NipponSysits/IIS.Git-Connector,padremortius/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,gencer/Bonobo-Git-Server,gencer/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,lkho/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,willdean/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,crowar/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server
|
Bonobo.Git.Server/Configuration/AuthenticationSettings.cs
|
Bonobo.Git.Server/Configuration/AuthenticationSettings.cs
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
namespace Bonobo.Git.Server.Configuration
{
public class AuthenticationSettings
{
public static string MembershipService { get; private set; }
static AuthenticationSettings()
{
MembershipService = ConfigurationManager.AppSettings["MembershipService"];
}
}
}
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
namespace Bonobo.Git.Server.Configuration
{
public class AuthenticationSettings
{
public static string MembershipService { get; private set; }
public static string RoleProvider { get; private set; }
static AuthenticationSettings()
{
MembershipService = ConfigurationManager.AppSettings["MembershipService"];
RoleProvider = ConfigurationManager.AppSettings["RoleProvider"];
}
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.