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 |
|---|---|---|---|---|---|---|---|---|
f4ae5d14aebc079825e76b4a5aa3c640389bff29
|
Fix iOS release step to build solution instead of project
|
Julien-Mialon/Cake.Storm,Julien-Mialon/Cake.Storm
|
fluent/src/Cake.Storm.Fluent.iOS/Steps/iOSReleaseStep.cs
|
fluent/src/Cake.Storm.Fluent.iOS/Steps/iOSReleaseStep.cs
|
using System.IO;
using System.Linq;
using Cake.Common.IO;
using Cake.Common.Tools.MSBuild;
using Cake.Core;
using Cake.Core.IO;
using Cake.Storm.Fluent.Helpers;
using Cake.Storm.Fluent.iOS.Common;
using Cake.Storm.Fluent.Interfaces;
using Cake.Storm.Fluent.InternalExtensions;
using Cake.Storm.Fluent.Steps;
namespace Cake.Storm.Fluent.iOS.Steps
{
[ReleaseStep]
// ReSharper disable once InconsistentNaming
internal class iOSReleaseStep : IStep
{
public void Execute(IConfiguration configuration)
{
DirectoryPath outputDirectory = configuration.GetArtifactsPath();
string solutionFile = configuration.GetSolutionPath();
string projectFile = configuration.GetProjectPath();
configuration.FileExistsOrThrow(solutionFile);
//Create iPA package
configuration.Context.CakeContext.MSBuild(solutionFile, settings =>
{
settings.SetConfiguration("Release");
settings.WithProperty("BuildIpa", "true")
.WithProperty("IpaIncludeArtwork", "false")
.WithProperty("IpaPackageDir", MSBuildHelper.PropertyValue(outputDirectory.MakeAbsolute(configuration.Context.CakeContext.Environment).FullPath))
.WithProperty("Platform", "iPhone");
string codeSignKey = configuration.Has(iOSConstants.IOS_CODESIGN_KEY) ? configuration.GetSimple<string>(iOSConstants.IOS_CODESIGN_KEY) : null;
if (string.IsNullOrEmpty(codeSignKey))
{
configuration.Context.CakeContext.LogAndThrow("No codesignkey for iOS Release");
}
string codeSignProvision = configuration.Has(iOSConstants.IOS_CODESIGN_PROVISION) ? configuration.GetSimple<string>(iOSConstants.IOS_CODESIGN_PROVISION) : null;
if (string.IsNullOrEmpty(codeSignProvision))
{
configuration.Context.CakeContext.LogAndThrow("No codesignprovision for iOS Release");
}
settings.WithProperty("CodesignKey", MSBuildHelper.PropertyValue(codeSignKey))
.WithProperty("CodesignProvision", MSBuildHelper.PropertyValue(codeSignProvision));
configuration.ApplyBuildParameters(settings);
});
//Copy dSYM to output
string searchPattern = new FilePath(projectFile).GetDirectory() + "/**/*.dSYM";
string symDirectory = configuration.Context.CakeContext.Globber
.GetDirectories(searchPattern)
.OrderBy(d => new DirectoryInfo(d.FullPath).LastWriteTimeUtc)
.FirstOrDefault()?.FullPath;
if (string.IsNullOrEmpty(symDirectory))
{
configuration.Context.CakeContext.LogAndThrow("Can not find dSYM file");
}
configuration.Context.CakeContext.Zip(symDirectory, $"{outputDirectory}/{System.IO.Path.GetFileName(symDirectory)}.zip");
}
}
}
|
using System.IO;
using System.Linq;
using Cake.Common.IO;
using Cake.Common.Tools.MSBuild;
using Cake.Core;
using Cake.Core.IO;
using Cake.Storm.Fluent.Helpers;
using Cake.Storm.Fluent.iOS.Common;
using Cake.Storm.Fluent.Interfaces;
using Cake.Storm.Fluent.InternalExtensions;
using Cake.Storm.Fluent.Steps;
namespace Cake.Storm.Fluent.iOS.Steps
{
[ReleaseStep]
// ReSharper disable once InconsistentNaming
internal class iOSReleaseStep : IStep
{
public void Execute(IConfiguration configuration)
{
DirectoryPath outputDirectory = configuration.GetArtifactsPath();
string projectFile = configuration.GetProjectPath();
configuration.FileExistsOrThrow(projectFile);
//Create iPA package
configuration.Context.CakeContext.MSBuild(projectFile, settings =>
{
settings.SetConfiguration("Release");
settings.WithProperty("BuildIpa", "true")
.WithProperty("IpaIncludeArtwork", "false")
.WithProperty("IpaPackageDir", MSBuildHelper.PropertyValue(outputDirectory.MakeAbsolute(configuration.Context.CakeContext.Environment).FullPath))
.WithProperty("Platform", "iPhone");
string codeSignKey = configuration.Has(iOSConstants.IOS_CODESIGN_KEY) ? configuration.GetSimple<string>(iOSConstants.IOS_CODESIGN_KEY) : null;
if (string.IsNullOrEmpty(codeSignKey))
{
configuration.Context.CakeContext.LogAndThrow("No codesignkey for iOS Release");
}
string codeSignProvision = configuration.Has(iOSConstants.IOS_CODESIGN_PROVISION) ? configuration.GetSimple<string>(iOSConstants.IOS_CODESIGN_PROVISION) : null;
if (string.IsNullOrEmpty(codeSignProvision))
{
configuration.Context.CakeContext.LogAndThrow("No codesignprovision for iOS Release");
}
settings.WithProperty("CodesignKey", MSBuildHelper.PropertyValue(codeSignKey))
.WithProperty("CodesignProvision", MSBuildHelper.PropertyValue(codeSignProvision));
configuration.ApplyBuildParameters(settings);
});
//Copy dSYM to output
string searchPattern = new FilePath(projectFile).GetDirectory() + "/**/*.dSYM";
string symDirectory = configuration.Context.CakeContext.Globber
.GetDirectories(searchPattern)
.OrderBy(d => new DirectoryInfo(d.FullPath).LastWriteTimeUtc)
.FirstOrDefault()?.FullPath;
if (string.IsNullOrEmpty(symDirectory))
{
configuration.Context.CakeContext.LogAndThrow("Can not find dSYM file");
}
configuration.Context.CakeContext.Zip(symDirectory, $"{outputDirectory}/{System.IO.Path.GetFileName(symDirectory)}.zip");
}
}
}
|
mit
|
C#
|
82f8a369317504aab8df5ec703b9f897d0340c59
|
Clean up
|
markaschell/SoftwareThresher
|
code/SoftwareThresher/SoftwareThresher/Tasks/NotFoundInCSharpProject.cs
|
code/SoftwareThresher/SoftwareThresher/Tasks/NotFoundInCSharpProject.cs
|
using System;
using System.Collections.Generic;
using SoftwareThresher.Observations;
namespace SoftwareThresher.Tasks {
public class NotFoundInCSharpProject : Task {
public string ReportTitle { get { return "Items not included in a C# project"; } }
public List<Observation> Execute(List<Observation> observations) {
throw new NotImplementedException();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SoftwareThresher.Observations;
namespace SoftwareThresher.Tasks
{
public class NotFoundInCSharpProject : Task
{
public string ReportTitle
{
get
{
throw new NotImplementedException();
}
}
public List<Observation> Execute(List<Observation> observations)
{
throw new NotImplementedException();
}
}
}
|
mit
|
C#
|
457a1e0d3f3d4a4f9ad73129a97464ddc0d586ab
|
Update assembly for 1.0.7
|
AshleyPoole/ssllabs-api-wrapper
|
SSLLabsApiWrapper/Properties/AssemblyInfo.cs
|
SSLLabsApiWrapper/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("SSL Labs Api Wrapper")]
[assembly: AssemblyDescription(".NET Wrapper For SSL Labs Assessment API's")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ashley Poole")]
[assembly: AssemblyProduct("SSL Labs Api Wrapper")]
[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("8f10dc77-ef27-4695-b49c-25557b36b045")]
// 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.7")]
[assembly: AssemblyFileVersion("1.0.7")]
[assembly: InternalsVisibleTo("SSLLabsApiWrapper.Tests"), InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
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("SSL Labs Api Wrapper")]
[assembly: AssemblyDescription(".NET Wrapper For SSL Labs Assessment API's")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ashley Poole")]
[assembly: AssemblyProduct("SSL Labs Api Wrapper")]
[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("8f10dc77-ef27-4695-b49c-25557b36b045")]
// 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.6")]
[assembly: AssemblyFileVersion("1.0.6")]
[assembly: InternalsVisibleTo("SSLLabsApiWrapper.Tests"), InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
mit
|
C#
|
fbeb02601dca05bf492485378bb9032035349d36
|
Make Indent Length Public
|
SnowmanTackler/SamSeifert.Utilities,SnowmanTackler/SamSeifert.Utilities
|
SamSeifert.Utilities/Logging/IndentLogger.cs
|
SamSeifert.Utilities/Logging/IndentLogger.cs
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamSeifert.Utilities.Logging
{
public class IndentLogger : BaseLogger
{
private readonly BaseLogger WrappedLogger;
public int IndentLength = 0;
public IndentLogger()
{
this.WrappedLogger = new TimeLogger();
}
public IndentLogger(BaseLogger baseLogger)
{
this.WrappedLogger = baseLogger;
}
private class Indenter : IDisposable
{
private Action _DisposeFunction;
public Indenter(Action dispose_function)
{
this._DisposeFunction = dispose_function;
}
public void Dispose()
{
this._DisposeFunction();
this._DisposeFunction = null;
}
}
public IDisposable Time(String message)
{
this.Info(message);
this.IndentLength++;
var stp = new Stopwatch();
stp.Start();
return new Indenter(() =>
{
var elapsed = stp.Elapsed;
this.IndentLength--;
this.Info(message + " ... " + elapsed.TotalSeconds.ToString("0.00") + " seconds");
});
}
public override string Write(DateTime time, LogLevel level, string message, Exception exc)
{
var tabbedMessage = new string(' ', this.IndentLength * 4) + message;
return this.WrappedLogger.Write(time, level, tabbedMessage, exc);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamSeifert.Utilities.Logging
{
public class IndentLogger : BaseLogger
{
private readonly BaseLogger WrappedLogger;
public IndentLogger()
{
this.WrappedLogger = new TimeLogger();
}
public IndentLogger(BaseLogger baseLogger)
{
this.WrappedLogger = baseLogger;
}
private int _AddedIndentLength;
private class Indenter : IDisposable
{
private Action _DisposeFunction;
public Indenter(Action dispose_function)
{
this._DisposeFunction = dispose_function;
}
public void Dispose()
{
this._DisposeFunction();
this._DisposeFunction = null;
}
}
public IDisposable Time(String message)
{
this.Info(message);
this._AddedIndentLength++;
var stp = new Stopwatch();
stp.Start();
return new Indenter(() =>
{
var elapsed = stp.Elapsed;
this._AddedIndentLength--;
this.Info(message + " ... " + elapsed.TotalSeconds.ToString("0.00") + " seconds");
});
}
public override string Write(DateTime time, LogLevel level, string message, Exception exc)
{
var tabbedMessage = new string(' ', this._AddedIndentLength * 4) + message;
return this.WrappedLogger.Write(time, level, tabbedMessage, exc);
}
}
}
|
mit
|
C#
|
33eabdd60474ffb9b8fafdb5dcc46c26ca916492
|
Add missing fields to Hurricane.
|
jcheng31/WundergroundAutocomplete.NET
|
WundergroundClient/Autocomplete/Hurricane.cs
|
WundergroundClient/Autocomplete/Hurricane.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WundergroundClient.Autocomplete
{
/// <summary>
/// Tropical Cyclone Basins used by Wunderground.
///
/// Though NorthIndian and SouthIndian are referred to in
/// the "currenthurricane" feature documentation,
/// Autocomplete doesn't appear to return any hurricanes
/// that fall into these basins.
/// </summary>
enum TropicalCycloneBasin
{
NorthAtlantic, // "at"
EasternPacific, // "ep"
WesternPacific, // "wp"
NorthIndian, // "ni"
SouthIndian // "si"
}
class Hurricane : AutocompleteResponseObject
{
/// <summary>
/// The date on which this hurricane occurred.
/// The time properties of this field should be ignored;
/// Wunderground does not provide timing information.
/// </summary>
public DateTime Date;
/// <summary>
/// The Tropical Cyclone Basin that this hurricane occurred in.
/// </summary>
public TropicalCycloneBasin Basin;
/// <summary>
/// The Tropical Depression number of this hurricane.
/// </summary>
public int StormNumber;
/// <summary>
/// Damages caused by this hurricane, in millions of USD.
/// Note: Wunderground sometimes returns a negative number here - possibly
/// if the amount was not recorded.
/// </summary>
public int Damage;
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WundergroundClient.Autocomplete
{
/// <summary>
/// Tropical Cyclone Basins used by Wunderground.
///
/// Though NorthIndian and SouthIndian are referred to in
/// the "currenthurricane" feature documentation,
/// Autocomplete doesn't appear to return any hurricanes
/// that fall into these basins.
/// </summary>
enum TropicalCycloneBasin
{
NorthAtlantic, // "at"
EasternPacific, // "ep"
WesternPacific, // "wp"
NorthIndian, // "ni"
SouthIndian // "si"
}
class Hurricane : AutocompleteResponseObject
{
/// <summary>
/// The date on which this hurricane occurred.
/// The time properties of this field should be ignored;
/// Wunderground does not provide timing information.
/// </summary>
public DateTime Date;
/// <summary>
/// The Tropical Cyclone Basin that this hurricane occurred in.
/// </summary>
public TropicalCycloneBasin Basin;
}
}
|
mit
|
C#
|
ebbca865b370b88813b286db05566aa41f8538ed
|
Exclude DefaultStopwatch from code coverage
|
rvernagus/NBenchmarker
|
src/NBenchmarker/NBenchmarker/DefaultStopwatch.cs
|
src/NBenchmarker/NBenchmarker/DefaultStopwatch.cs
|
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace NBenchmarker
{
[ExcludeFromCodeCoverage] // Just a facade for BCL Stopwatch
public class DefaultStopwatch : IStopwatch
{
private Stopwatch _watch;
public DefaultStopwatch()
{
_watch = new Stopwatch();
}
public TimeSpan GetElapsedTime()
{
return _watch.Elapsed;
}
public void Start()
{
_watch.Start();
}
public void Stop()
{
_watch.Stop();
}
}
}
|
using System;
using System.Diagnostics;
namespace NBenchmarker
{
public class DefaultStopwatch : IStopwatch
{
private Stopwatch _watch;
public DefaultStopwatch()
{
_watch = new Stopwatch();
}
public TimeSpan GetElapsedTime()
{
return _watch.Elapsed;
}
public void Start()
{
_watch.Start();
}
public void Stop()
{
_watch.Stop();
}
}
}
|
mit
|
C#
|
da1087d215bc7618de70675d4cd0baa339e736a7
|
Update index header message.
|
jpfultonzm/trainingsandbox,jpfultonzm/trainingsandbox,jpfultonzm/trainingsandbox
|
ZirMed.TrainingSandbox/Views/Home/Index.cshtml
|
ZirMed.TrainingSandbox/Views/Home/Index.cshtml
|
@{
ViewBag.Title = "Home Page";
}
<div class="jumbotron">
<h1>ASP.NET - ZirMed Training Sandbox</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>
</div>
<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301865">Learn more »</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more »</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301867">Learn more »</a></p>
</div>
</div>
|
@{
ViewBag.Title = "Home Page";
}
<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>
</div>
<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301865">Learn more »</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more »</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301867">Learn more »</a></p>
</div>
</div>
|
mit
|
C#
|
dc9d804882072193c564f7abb5a6eaf8d98fb303
|
Fix YukariCake animator in new version
|
Barleytree/NitoriWare,uulltt/NitoriWare,plrusek/NitoriWare,Barleytree/NitoriWare,NitorInc/NitoriWare,NitorInc/NitoriWare
|
Assets/Resources/Microgames/YukariCake/Scripts/YukariCakeController.cs
|
Assets/Resources/Microgames/YukariCake/Scripts/YukariCakeController.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class YukariCakeController : MonoBehaviour {
// Properties
public YukariCakeReimu Enemy;
public List<AudioSource> AudioSources;
public Animator YukariAnimator;
public AudioSource YukariSource;
public AudioClip YukariSoundSnatch, YukariCakeDimension, YukariSoundVictory, YukariSoundFail;
public GameObject YukariFailSprites;
// Game Variables
public bool IsVulnerable = false;
// Use this for initialization
void Start () {
foreach (var a in AudioSources)
a.pitch = Time.timeScale;
}
// Update is called once per frame
void Update () {
if(YukariAnimator.GetCurrentAnimatorStateInfo(0).IsName("YukariCakeYukariSnatch"))
{
if (Enemy.IsAlert && IsVulnerable)
SetGameFailure();
}
if(!MicrogameController.instance.getVictoryDetermined())
{
if(Input.GetKeyDown(KeyCode.Space))
{
// Here comes the snatch sequence. Better not get caught.
YukariAnimator.Play("YukariCakeYukariSnatch");
}
}
}
public void SetGameVictory()
{
PlayVictoryAnimation();
MicrogameController.instance.setVictory(true, true);
Enemy.Stop();
}
public void SetGameFailure()
{
PlayFailureAnimation();
MicrogameController.instance.setVictory(false, true);
Enemy.Stop();
}
public void PlayVictoryAnimation()
{
YukariAnimator.Play("YukariCakeYukariVictory");
}
public void PlayFailureAnimation()
{
PlayFailureSound();
YukariAnimator.enabled = false;
YukariFailSprites.SetActive(true);
Enemy.PlayFailureAnimation();
}
public void PlayDimensionSound()
{
YukariSource.PlayOneShot(YukariCakeDimension);
}
public void PlaySnatchSound()
{
YukariSource.PlayOneShot(YukariSoundSnatch);
}
public void PlayVictorySound()
{
YukariSource.PlayOneShot(YukariSoundVictory);
Debug.Log("Woo!");
}
public void PlayFailureSound()
{
YukariSource.PlayOneShot(YukariSoundFail);
Debug.Log(":(");
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class YukariCakeController : MonoBehaviour {
// Properties
public YukariCakeReimu Enemy;
public List<AudioSource> AudioSources;
public Animator YukariAnimator;
public AudioSource YukariSource;
public AudioClip YukariSoundSnatch, YukariCakeDimension, YukariSoundVictory, YukariSoundFail;
public GameObject YukariFailSprites;
// Game Variables
public bool IsVulnerable = false;
// Use this for initialization
void Start () {
foreach (var a in AudioSources)
a.pitch = Time.timeScale;
}
// Update is called once per frame
void Update () {
if(YukariAnimator.GetCurrentAnimatorStateInfo(0).IsName("YukariCakeYukariSnatch"))
{
if (Enemy.IsAlert && IsVulnerable)
SetGameFailure();
}
if(!MicrogameController.instance.getVictoryDetermined())
{
if(Input.GetKeyDown(KeyCode.Space))
{
// Here comes the snatch sequence. Better not get caught.
YukariAnimator.Play("YukariCakeYukariSnatch");
}
}
}
public void SetGameVictory()
{
PlayVictoryAnimation();
MicrogameController.instance.setVictory(true, true);
Enemy.Stop();
}
public void SetGameFailure()
{
PlayFailureAnimation();
MicrogameController.instance.setVictory(false, true);
Enemy.Stop();
}
public void PlayVictoryAnimation()
{
YukariAnimator.Play("YukariCakeYukariVictory");
}
public void PlayFailureAnimation()
{
PlayFailureSound();
YukariAnimator.Stop();
YukariFailSprites.SetActive(true);
Enemy.PlayFailureAnimation();
}
public void PlayDimensionSound()
{
YukariSource.PlayOneShot(YukariCakeDimension);
}
public void PlaySnatchSound()
{
YukariSource.PlayOneShot(YukariSoundSnatch);
}
public void PlayVictorySound()
{
YukariSource.PlayOneShot(YukariSoundVictory);
Debug.Log("Woo!");
}
public void PlayFailureSound()
{
YukariSource.PlayOneShot(YukariSoundFail);
Debug.Log(":(");
}
}
|
mit
|
C#
|
6b11f1d0e5ededd715d0fa8303e6eb83b92cb559
|
Check for null value
|
wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D
|
Core2D/Path/XPathSegment.cs
|
Core2D/Path/XPathSegment.cs
|
// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.Text;
namespace Core2D
{
/// <summary>
/// <see cref="XPathFigure"/> segment base class.
/// </summary>
public abstract class XPathSegment
{
/// <summary>
/// Gets or sets flag indicating whether segment is stroked.
/// </summary>
public bool IsStroked { get; set; }
/// <summary>
/// Gets or sets flag indicating whether segment is smooth join.
/// </summary>
public bool IsSmoothJoin { get; set; }
/// <summary>
/// Get all points in the segment.
/// </summary>
/// <returns>All points in the segment.</returns>
public abstract IEnumerable<XPoint> GetPoints();
/// <summary>
/// Creates a string representation of points collection.
/// </summary>
/// <param name="points">The points collection.</param>
/// <returns>A string representation of points collection.</returns>
public string ToString(IList<XPoint> points)
{
if (points?.Count == 0)
{
return string.Empty;
}
var sb = new StringBuilder();
for (int i = 0; i < points.Count; i++)
{
sb.Append(points[i]);
if (i != points.Count - 1)
{
sb.Append(" ");
}
}
return sb.ToString();
}
}
}
|
// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.Text;
namespace Core2D
{
/// <summary>
/// <see cref="XPathFigure"/> segment base class.
/// </summary>
public abstract class XPathSegment
{
/// <summary>
/// Gets or sets flag indicating whether segment is stroked.
/// </summary>
public bool IsStroked { get; set; }
/// <summary>
/// Gets or sets flag indicating whether segment is smooth join.
/// </summary>
public bool IsSmoothJoin { get; set; }
/// <summary>
/// Get all points in the segment.
/// </summary>
/// <returns>All points in the segment.</returns>
public abstract IEnumerable<XPoint> GetPoints();
/// <summary>
/// Creates a string representation of points collection.
/// </summary>
/// <param name="points">The points collection.</param>
/// <returns>A string representation of points collection.</returns>
public string ToString(IList<XPoint> points)
{
if (points.Count == 0)
{
return string.Empty;
}
var sb = new StringBuilder();
for (int i = 0; i < points.Count; i++)
{
sb.Append(points[i]);
if (i != points.Count - 1)
{
sb.Append(" ");
}
}
return sb.ToString();
}
}
}
|
mit
|
C#
|
2002a2c06f9595a06cb9fec14cc20fb346bdb19d
|
Increase number of tests total
|
Benrnz/BudgetAnalyser
|
BudgetAnalyser.UnitTest/MetaTest.cs
|
BudgetAnalyser.UnitTest/MetaTest.cs
|
using System;
using System.Linq;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BudgetAnalyser.UnitTest
{
[TestClass]
public class MetaTest
{
private const int ExpectedMinimumTests = 868;
[TestMethod]
public void ListAllTests()
{
Assembly assembly = GetType().Assembly;
var count = 0;
foreach (Type type in assembly.ExportedTypes)
{
var testClassAttrib = type.GetCustomAttribute<TestClassAttribute>();
if (testClassAttrib != null)
{
foreach (MethodInfo method in type.GetMethods())
{
if (method.GetCustomAttribute<TestMethodAttribute>() != null)
{
Console.WriteLine("{0} {1} - {2}", ++count, type.FullName, method.Name);
}
}
}
}
}
[TestMethod]
public void NoDecreaseInTests()
{
int count = CountTests();
Console.WriteLine(count);
Assert.IsTrue(count >= ExpectedMinimumTests);
}
[TestMethod]
public void UpdateNoDecreaseInTests()
{
int count = CountTests();
Assert.IsFalse(count > ExpectedMinimumTests + 10, "Update the minimum expected number of tests to " + count);
}
private int CountTests()
{
Assembly assembly = GetType().Assembly;
int count = (from type in assembly.ExportedTypes
let testClassAttrib = type.GetCustomAttribute<TestClassAttribute>()
where testClassAttrib != null
select type.GetMethods().Count(method => method.GetCustomAttribute<TestMethodAttribute>() != null)).Sum();
return count;
}
}
}
|
using System;
using System.Linq;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BudgetAnalyser.UnitTest
{
[TestClass]
public class MetaTest
{
private const int ExpectedMinimumTests = 836;
[TestMethod]
public void ListAllTests()
{
Assembly assembly = GetType().Assembly;
var count = 0;
foreach (Type type in assembly.ExportedTypes)
{
var testClassAttrib = type.GetCustomAttribute<TestClassAttribute>();
if (testClassAttrib != null)
{
foreach (MethodInfo method in type.GetMethods())
{
if (method.GetCustomAttribute<TestMethodAttribute>() != null)
{
Console.WriteLine("{0} {1} - {2}", ++count, type.FullName, method.Name);
}
}
}
}
}
[TestMethod]
public void NoDecreaseInTests()
{
int count = CountTests();
Console.WriteLine(count);
Assert.IsTrue(count >= ExpectedMinimumTests);
}
[TestMethod]
public void UpdateNoDecreaseInTests()
{
int count = CountTests();
Assert.IsFalse(count > ExpectedMinimumTests + 10, "Update the minimum expected number of tests to " + count);
}
private int CountTests()
{
Assembly assembly = GetType().Assembly;
int count = (from type in assembly.ExportedTypes
let testClassAttrib = type.GetCustomAttribute<TestClassAttribute>()
where testClassAttrib != null
select type.GetMethods().Count(method => method.GetCustomAttribute<TestMethodAttribute>() != null)).Sum();
return count;
}
}
}
|
mit
|
C#
|
a857fc8918a2364d2617fe955685e71259e5c809
|
Add repository to bootstrap registrations
|
csf-dev/agiil,csf-dev/agiil,csf-dev/agiil,csf-dev/agiil
|
Agiil.Bootstrap/Data/DataModule.cs
|
Agiil.Bootstrap/Data/DataModule.cs
|
using System;
using Agiil.Data;
using Agiil.Domain.Data;
using Autofac;
using CSF.Data;
using CSF.Data.Entities;
using CSF.Data.NHibernate;
namespace Agiil.Bootstrap.Data
{
public class DataModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterType<NHibernateQuery>()
.As<IQuery>();
builder
.RegisterType<NHibernatePersister>()
.As<IPersister>();
builder
.RegisterType<DatabaseCreator>()
.As<IDatabaseCreator>();
builder
.RegisterType<DevelopmentInitialDataCreator>()
.As<IInitialDataCreator>();
builder
.RegisterGeneric(typeof(GenericRepository<>))
.As(typeof(IRepository<>));
builder
.RegisterType<Repository>()
.As<IRepository>();
builder
.RegisterType<TransactionCreator>()
.As<ITransactionCreator>();
builder
.RegisterType<HardcodedDatabaseConfiguration>()
.As<IDatabaseConfiguration>();
}
}
}
|
using System;
using Agiil.Data;
using Agiil.Domain.Data;
using Autofac;
using CSF.Data;
using CSF.Data.Entities;
using CSF.Data.NHibernate;
namespace Agiil.Bootstrap.Data
{
public class DataModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterType<NHibernateQuery>()
.As<IQuery>();
builder
.RegisterType<NHibernatePersister>()
.As<IPersister>();
builder
.RegisterType<DatabaseCreator>()
.As<IDatabaseCreator>();
builder
.RegisterType<DevelopmentInitialDataCreator>()
.As<IInitialDataCreator>();
builder
.RegisterGeneric(typeof(GenericRepository<>))
.As(typeof(IRepository<>));
builder
.RegisterType<TransactionCreator>()
.As<ITransactionCreator>();
builder
.RegisterType<HardcodedDatabaseConfiguration>()
.As<IDatabaseConfiguration>();
}
}
}
|
mit
|
C#
|
e25aa38c36e66bf0da12cfbec72f30519a969676
|
rename functionappdev -> functionapp
|
agruning/azure-functions-ux,chunye/azure-functions-ux,projectkudu/AzureFunctions,agruning/azure-functions-ux,chunye/azure-functions-ux,projectkudu/AzureFunctions,projectkudu/WebJobsPortal,projectkudu/AzureFunctions,chunye/azure-functions-ux,chunye/azure-functions-ux,agruning/azure-functions-ux,agruning/azure-functions-ux,projectkudu/WebJobsPortal,projectkudu/WebJobsPortal,agruning/azure-functions-ux,projectkudu/WebJobsPortal,projectkudu/AzureFunctions,chunye/azure-functions-ux
|
AzureFunctions/Common/Constants.cs
|
AzureFunctions/Common/Constants.cs
|
namespace AzureFunctions.Common
{
public static class Constants
{
public const string SubscriptionTemplate = "{0}/subscriptions/{1}?api-version={2}";
public const string CSMApiVersion = "2014-04-01";
public const string CSMUrl = "https://management.azure.com";
public const string X_MS_OAUTH_TOKEN = "X-MS-OAUTH-TOKEN";
public const string ClientTokenHeader = "client-token";
public const string PortalTokenHeader = "portal-token";
public const string ApplicationJson = "application/json";
public const string AzureStorageAppSettingsName = "AzureWebJobsStorage";
public const string AzureStorageDashboardAppSettingsName = "AzureWebJobsDashboard";
public const string StorageConnectionStringTemplate = "DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}";
public const string PublishingUserName = "publishingUserName";
public const string PublishingPassword = "publishingPassword";
public const string FunctionsResourceGroupName = "AzureFunctions";
public const string FunctionsSitePrefix = "Functions";
public const string FunctionsStorageAccountNamePrefix = "AzureFunctions";
public const string UserAgent = "Functions/1.0";
public const string GeoRegion = "GeoRegion";
public const string WebAppArmType = "Microsoft.Web/sites";
public const string StorageAccountArmType = "Microsoft.Storage/storageAccounts";
public const string TryAppServiceResourceGroupPrefix = "TRY_RG_";
public const string TryAppServiceTenantId = "6224bcc1-1690-4d04-b905-92265f948dad";
public const string TryAppServiceCreateUrl = "https://tryappservice.azure.com/api/resource?x-ms-routing-name=next";
public const string SavedFunctionsContainer = "sfc";
public const string FunctionAppArmKind = "functionapp";
public const string MetadataJson = "metadata.json";
public const string FunctionsExtensionVersion = "FUNCTIONS_EXTENSION_VERSION";
public const string Latest = "latest";
public const string FrontEndDisplayNameHeader = "X-MS-CLIENT-DISPLAY-NAME";
public const string FrontEndPrincipalNameHeader = "X-MS-CLIENT-PRINCIPAL-NAME";
public const string AnonymousUserName = "Anonymous";
public const string PortalReferrer = "https://portal.azure.com/";
}
}
|
namespace AzureFunctions.Common
{
public static class Constants
{
public const string SubscriptionTemplate = "{0}/subscriptions/{1}?api-version={2}";
public const string CSMApiVersion = "2014-04-01";
public const string CSMUrl = "https://management.azure.com";
public const string X_MS_OAUTH_TOKEN = "X-MS-OAUTH-TOKEN";
public const string ClientTokenHeader = "client-token";
public const string PortalTokenHeader = "portal-token";
public const string ApplicationJson = "application/json";
public const string AzureStorageAppSettingsName = "AzureWebJobsStorage";
public const string AzureStorageDashboardAppSettingsName = "AzureWebJobsDashboard";
public const string StorageConnectionStringTemplate = "DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}";
public const string PublishingUserName = "publishingUserName";
public const string PublishingPassword = "publishingPassword";
public const string FunctionsResourceGroupName = "AzureFunctions";
public const string FunctionsSitePrefix = "Functions";
public const string FunctionsStorageAccountNamePrefix = "AzureFunctions";
public const string UserAgent = "Functions/1.0";
public const string GeoRegion = "GeoRegion";
public const string WebAppArmType = "Microsoft.Web/sites";
public const string StorageAccountArmType = "Microsoft.Storage/storageAccounts";
public const string TryAppServiceResourceGroupPrefix = "TRY_RG_";
public const string TryAppServiceTenantId = "6224bcc1-1690-4d04-b905-92265f948dad";
public const string TryAppServiceCreateUrl = "https://tryappservice.azure.com/api/resource?x-ms-routing-name=next";
public const string SavedFunctionsContainer = "sfc";
public const string FunctionAppArmKind = "functionappdev";
public const string MetadataJson = "metadata.json";
public const string FunctionsExtensionVersion = "FUNCTIONS_EXTENSION_VERSION";
public const string Latest = "latest";
public const string FrontEndDisplayNameHeader = "X-MS-CLIENT-DISPLAY-NAME";
public const string FrontEndPrincipalNameHeader = "X-MS-CLIENT-PRINCIPAL-NAME";
public const string AnonymousUserName = "Anonymous";
public const string PortalReferrer = "https://portal.azure.com/";
}
}
|
apache-2.0
|
C#
|
1f20236db91b780c299d8c6fd0293e15afc1f0ab
|
Add warning for UWP that it works only in x86 yet
|
florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho
|
Bindings/UWP/UwpUrhoInitializer.cs
|
Bindings/UWP/UwpUrhoInitializer.cs
|
using System;
using System.IO;
using System.Runtime.InteropServices;
using Windows.Storage;
namespace Urho.UWP
{
public static class UwpUrhoInitializer
{
internal static void OnInited()
{
var folder = ApplicationData.Current.LocalFolder.Path;
if (IntPtr.Size == 8)
{
throw new NotSupportedException("x86_64 is not supported yet. Please use x86.");
}
}
}
}
|
using System;
using System.IO;
using System.Runtime.InteropServices;
using Windows.Storage;
namespace Urho.UWP
{
public static class UwpUrhoInitializer
{
internal static void OnInited()
{
var folder = ApplicationData.Current.LocalFolder.Path;
}
}
}
|
mit
|
C#
|
3a06b786616e9e85b180a18455759960f3f59e51
|
Normalize TextWebConsole with Html5WebConsole's UX
|
kamsar/Kamsar.WebConsole,kamsar/Kamsar.WebConsole
|
Kamsar.WebConsole/TextWebConsole.cs
|
Kamsar.WebConsole/TextWebConsole.cs
|
using System;
using System.Text;
using System.Web;
namespace Kamsar.WebConsole
{
/// <summary>
/// Variant of the WebConsole that emits the Write/WriteLines done as plain text lines (instead of HTML).
/// Useful when capturing text logs of a console (eg for non-web-emission contexts)
///
/// Progress reports are not captured.
///
/// Requires disposal UNLESS using Render(Action) method
/// </summary>
public class TextWebConsole : WebConsole
{
private readonly HttpResponseBase _response;
public TextWebConsole(HttpResponseBase response, bool forceBuffer = true, bool setContentType = true) : base(response, forceBuffer)
{
if (setContentType)
{
response.ContentType = "text/plain";
}
_response = response;
}
public override void Render()
{
throw new NotImplementedException("Use the overload with the process action to avoid needing to dispose this.");
}
public virtual void Render(Action<IProgressStatus> processAction)
{
processAction(this);
Dispose(true);
}
public override void Write(string statusMessage, MessageType type, params object[] formatParameters)
{
if (type == MessageType.Error) HasErrors = true;
if (type == MessageType.Warning) HasWarnings = true;
var line = new StringBuilder();
line.AppendFormat("{0}: ", type);
if (formatParameters.Length > 0)
line.AppendFormat(statusMessage, formatParameters);
else
line.Append(statusMessage);
_response.Write(HttpUtility.HtmlEncode(line.ToString()));
}
public override void WriteLine(string statusMessage, MessageType type, params object[] formatParameters)
{
Write(statusMessage + "\n", type, formatParameters);
}
public override void SetProgress(int percent)
{
// do nothing
}
public override void WriteScript(string script)
{
// do nothing
}
public override void SetTransientStatus(string statusMessage, params object[] formatParameters)
{
// do nothing
}
public virtual bool HasErrors { get; private set; }
public virtual bool HasWarnings { get; private set; }
}
}
|
using System.Text;
using System.Web;
namespace Kamsar.WebConsole
{
/// <summary>
/// Variant of the WebConsole that emits the Write/WriteLines done as plain text lines (instead of HTML).
/// Useful when capturing text logs of a console (eg for non-web-emission contexts)
///
/// Progress reports are not captured.
/// </summary>
public class TextWebConsole : WebConsole
{
private readonly HttpResponseBase _response;
public TextWebConsole(HttpResponseBase response, bool forceBuffer = true) : base(response, forceBuffer)
{
_response = response;
}
public override void Write(string statusMessage, MessageType type, params object[] formatParameters)
{
if (type == MessageType.Error) HasErrors = true;
if (type == MessageType.Warning) HasWarnings = true;
var line = new StringBuilder();
line.AppendFormat("{0}: ", type);
if (formatParameters.Length > 0)
line.AppendFormat(statusMessage, formatParameters);
else
line.Append(statusMessage);
_response.Write(HttpUtility.HtmlEncode(line.ToString()));
}
public override void WriteLine(string statusMessage, MessageType type, params object[] formatParameters)
{
Write(statusMessage + "\n", type, formatParameters);
}
public override void SetProgress(int percent)
{
// do nothing
}
public override void WriteScript(string script)
{
// do nothing
}
public override void SetTransientStatus(string statusMessage, params object[] formatParameters)
{
// do nothing
}
public bool HasErrors { get; private set; }
public bool HasWarnings { get; private set; }
}
}
|
mit
|
C#
|
9d5d021c30d9f2bcc0f2dd9bd9a24879e1fdf2ae
|
switch push for 8 byte values
|
zdimension/Cosmos,jp2masa/Cosmos,MetSystem/Cosmos,sgetaz/Cosmos,trivalik/Cosmos,CosmosOS/Cosmos,MyvarHD/Cosmos,kant2002/Cosmos-1,zhangwenquan/Cosmos,MyvarHD/Cosmos,zhangwenquan/Cosmos,CosmosOS/Cosmos,tgiphil/Cosmos,fanoI/Cosmos,tgiphil/Cosmos,zdimension/Cosmos,zarlo/Cosmos,zarlo/Cosmos,MyvarHD/Cosmos,sgetaz/Cosmos,sgetaz/Cosmos,Cyber4/Cosmos,sgetaz/Cosmos,jp2masa/Cosmos,zhangwenquan/Cosmos,kant2002/Cosmos-1,zhangwenquan/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,kant2002/Cosmos-1,MyvarHD/Cosmos,fanoI/Cosmos,jp2masa/Cosmos,CosmosOS/Cosmos,MetSystem/Cosmos,MyvarHD/Cosmos,fanoI/Cosmos,Cyber4/Cosmos,Cyber4/Cosmos,Cyber4/Cosmos,zdimension/Cosmos,sgetaz/Cosmos,tgiphil/Cosmos,trivalik/Cosmos,zarlo/Cosmos,MetSystem/Cosmos,trivalik/Cosmos,MetSystem/Cosmos,zdimension/Cosmos,kant2002/Cosmos-1,MetSystem/Cosmos,zhangwenquan/Cosmos,zdimension/Cosmos,Cyber4/Cosmos
|
source2/IL2CPU/Cosmos.IL2CPU.X86/IL/Ldc_R8.cs
|
source2/IL2CPU/Cosmos.IL2CPU.X86/IL/Ldc_R8.cs
|
using System;
using CPU = Cosmos.Compiler.Assembler.X86;
using Cosmos.IL2CPU.ILOpCodes;
using Cosmos.Compiler.Assembler;
namespace Cosmos.IL2CPU.X86.IL
{
[Cosmos.IL2CPU.OpCode( ILOpCode.Code.Ldc_R8 )]
public class Ldc_R8 : ILOp
{
public Ldc_R8( Cosmos.Compiler.Assembler.Assembler aAsmblr )
: base( aAsmblr )
{
}
public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
{
OpDouble xOp = ( OpDouble )aOpCode;
byte[] xBytes = BitConverter.GetBytes( xOp.Value );
new CPU.Push { DestinationValue = BitConverter.ToUInt32(xBytes, 4) };
new CPU.Push { DestinationValue = BitConverter.ToUInt32( xBytes, 0 ) };
Assembler.Stack.Push( new StackContents.Item( 4, typeof( Double ) ) );
}
// using System;
// using System.Linq;
//
// using CPU = Cosmos.Compiler.Assembler.X86;
// using Cosmos.IL2CPU.X86;
//
// namespace Cosmos.IL2CPU.IL.X86 {
// [OpCode(OpCodeEnum.Ldc_R8)]
// public class Ldc_R8: Op {
// private readonly Double mValue;
// public Ldc_R8(ILReader aReader, MethodInformation aMethodInfo)
// : base(aReader, aMethodInfo) {
// mValue = aReader.OperandValueDouble;
// }
// public override void DoAssemble() {
// byte[] xBytes = BitConverter.GetBytes(mValue);
// new CPU.Push { DestinationValue = BitConverter.ToUInt32(xBytes, 0) };
// new CPU.Push { DestinationValue = BitConverter.ToUInt32(xBytes, 4) };
// Assembler.Stack.Push(new StackContent(8, typeof(Double)));
// }
// }
// }
}
}
|
using System;
using CPU = Cosmos.Compiler.Assembler.X86;
using Cosmos.IL2CPU.ILOpCodes;
using Cosmos.Compiler.Assembler;
namespace Cosmos.IL2CPU.X86.IL
{
[Cosmos.IL2CPU.OpCode( ILOpCode.Code.Ldc_R8 )]
public class Ldc_R8 : ILOp
{
public Ldc_R8( Cosmos.Compiler.Assembler.Assembler aAsmblr )
: base( aAsmblr )
{
}
public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
{
OpDouble xOp = ( OpDouble )aOpCode;
byte[] xBytes = BitConverter.GetBytes( xOp.Value );
new CPU.Push { DestinationValue = BitConverter.ToUInt32( xBytes, 0 ) };
new CPU.Push { DestinationValue = BitConverter.ToUInt32( xBytes, 4 ) };
Assembler.Stack.Push( new StackContents.Item( 4, typeof( Double ) ) );
}
// using System;
// using System.Linq;
//
// using CPU = Cosmos.Compiler.Assembler.X86;
// using Cosmos.IL2CPU.X86;
//
// namespace Cosmos.IL2CPU.IL.X86 {
// [OpCode(OpCodeEnum.Ldc_R8)]
// public class Ldc_R8: Op {
// private readonly Double mValue;
// public Ldc_R8(ILReader aReader, MethodInformation aMethodInfo)
// : base(aReader, aMethodInfo) {
// mValue = aReader.OperandValueDouble;
// }
// public override void DoAssemble() {
// byte[] xBytes = BitConverter.GetBytes(mValue);
// new CPU.Push { DestinationValue = BitConverter.ToUInt32(xBytes, 0) };
// new CPU.Push { DestinationValue = BitConverter.ToUInt32(xBytes, 4) };
// Assembler.Stack.Push(new StackContent(8, typeof(Double)));
// }
// }
// }
}
}
|
bsd-3-clause
|
C#
|
13d18880cccfe75d294869c5940df5f5f3684bb4
|
use a switch expression
|
destructurama/attributed
|
src/Destructurama.Attributed/Attributed/LogWithNameAttribute.cs
|
src/Destructurama.Attributed/Attributed/LogWithNameAttribute.cs
|
// Copyright 2015-2018 Destructurama Contributors, Serilog Contributors
//
// 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 Serilog.Core;
using Serilog.Events;
using System;
namespace Destructurama.Attributed
{
[AttributeUsage(AttributeTargets.Property)]
public class LogWithNameAttribute : Attribute, IPropertyDestructuringAttribute
{
public LogWithNameAttribute(string newName)
{
PropertyName = newName;
}
public string PropertyName { get; set; }
public bool TryCreateLogEventProperty(string name, object value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventProperty property)
{
var propValue = propertyValueFactory.CreatePropertyValue(value);
LogEventPropertyValue logEventPropVal = propValue switch
{
ScalarValue => new ScalarValue(propValue),
DictionaryValue dictionaryValue => new DictionaryValue(dictionaryValue.Elements),
SequenceValue sequenceValue => new SequenceValue(sequenceValue.Elements),
StructureValue structureValue => new StructureValue(structureValue.Properties),
_ => null
};
property = new LogEventProperty(PropertyName, logEventPropVal);
return true;
}
}
}
|
// Copyright 2015-2018 Destructurama Contributors, Serilog Contributors
//
// 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 Serilog.Core;
using Serilog.Events;
using System;
namespace Destructurama.Attributed
{
[AttributeUsage(AttributeTargets.Property)]
public class LogWithNameAttribute : Attribute, IPropertyDestructuringAttribute
{
public LogWithNameAttribute(string newName)
{
PropertyName = newName;
}
public string PropertyName { get; set; }
public bool TryCreateLogEventProperty(string name, object value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventProperty property)
{
var propValue = propertyValueFactory.CreatePropertyValue(value);
LogEventPropertyValue logEventPropVal = null;
if (propValue is ScalarValue)
logEventPropVal = new ScalarValue(propValue);
else if (propValue is DictionaryValue)
logEventPropVal = new DictionaryValue(((DictionaryValue)propValue).Elements);
else if (propValue is SequenceValue)
logEventPropVal = new SequenceValue(((SequenceValue)propValue).Elements);
else if (propValue is StructureValue)
logEventPropVal = new StructureValue(((StructureValue)propValue).Properties);
property = new LogEventProperty(PropertyName, logEventPropVal);
return true;
}
}
}
|
apache-2.0
|
C#
|
c1899fd95372c85c6119f149748b5a1b00c51ddf
|
fix typo in comment (#870)
|
dotnetcore/CAP,dotnetcore/CAP,ouraspnet/cap,dotnetcore/CAP
|
src/DotNetCore.CAP/Internal/TopicAttribute.cs
|
src/DotNetCore.CAP/Internal/TopicAttribute.cs
|
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Internal
{
/// <inheritdoc />
/// <summary>
/// An abstract attribute that for kafka attribute or rabbit mq attribute
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public abstract class TopicAttribute : Attribute
{
protected TopicAttribute(string name, bool isPartial = false)
{
Name = name;
IsPartial = isPartial;
}
/// <summary>
/// Topic or exchange route key name.
/// </summary>
public string Name { get; }
/// <summary>
/// Defines whether this attribute defines a topic subscription partial.
/// The defined topic will be combined with a topic subscription defined on class level,
/// which results for example in subscription on "class.method".
/// </summary>
public bool IsPartial { get; }
/// <summary>
/// Default group name is CapOptions setting.(Assembly name)
/// kafka --> groups.id
/// rabbit MQ --> queue.name
/// </summary>
public string Group { get; set; }
}
}
|
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Internal
{
/// <inheritdoc />
/// <summary>
/// An abstract attribute that for kafka attribute or rabbit mq attribute
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public abstract class TopicAttribute : Attribute
{
protected TopicAttribute(string name, bool isPartial = false)
{
Name = name;
IsPartial = isPartial;
}
/// <summary>
/// Topic or exchange route key name.
/// </summary>
public string Name { get; }
/// <summary>
/// Defines wether this attribute defines a topic subscription partial.
/// The defined topic will be combined with a topic subscription defined on class level,
/// which results for example in subscription on "class.method".
/// </summary>
public bool IsPartial { get; }
/// <summary>
/// Default group name is CapOptions setting.(Assembly name)
/// kafka --> groups.id
/// rabbit MQ --> queue.name
/// </summary>
public string Group { get; set; }
}
}
|
mit
|
C#
|
99acd3c216fed578c9551166d852b2705cfca095
|
add docs to signature
|
libgit2/libgit2sharp,oliver-feng/libgit2sharp,AMSadek/libgit2sharp,ethomson/libgit2sharp,psawey/libgit2sharp,AArnott/libgit2sharp,OidaTiftla/libgit2sharp,rcorre/libgit2sharp,shana/libgit2sharp,vorou/libgit2sharp,rcorre/libgit2sharp,ethomson/libgit2sharp,AMSadek/libgit2sharp,AArnott/libgit2sharp,sushihangover/libgit2sharp,dlsteuer/libgit2sharp,jorgeamado/libgit2sharp,oliver-feng/libgit2sharp,whoisj/libgit2sharp,jorgeamado/libgit2sharp,nulltoken/libgit2sharp,carlosmn/libgit2sharp,mono/libgit2sharp,jeffhostetler/public_libgit2sharp,vorou/libgit2sharp,jamill/libgit2sharp,Zoxive/libgit2sharp,psawey/libgit2sharp,github/libgit2sharp,paulcbetts/libgit2sharp,red-gate/libgit2sharp,shana/libgit2sharp,nulltoken/libgit2sharp,paulcbetts/libgit2sharp,github/libgit2sharp,mono/libgit2sharp,Zoxive/libgit2sharp,OidaTiftla/libgit2sharp,Skybladev2/libgit2sharp,carlosmn/libgit2sharp,xoofx/libgit2sharp,dlsteuer/libgit2sharp,red-gate/libgit2sharp,whoisj/libgit2sharp,jamill/libgit2sharp,PKRoma/libgit2sharp,Skybladev2/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,GeertvanHorrik/libgit2sharp,vivekpradhanC/libgit2sharp,sushihangover/libgit2sharp,GeertvanHorrik/libgit2sharp,vivekpradhanC/libgit2sharp,jeffhostetler/public_libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,xoofx/libgit2sharp
|
LibGit2Sharp/Signature.cs
|
LibGit2Sharp/Signature.cs
|
using System;
using System.Runtime.InteropServices;
namespace LibGit2Sharp
{
/// <summary>
/// A signature
/// </summary>
public class Signature
{
private readonly GitSignature sig = new GitSignature();
private DateTimeOffset? when;
internal Signature(IntPtr signaturePtr, bool ownedByRepo = true)
{
Marshal.PtrToStructure(signaturePtr, sig);
if (!ownedByRepo)
{
NativeMethods.git_signature_free(signaturePtr);
}
}
/// <summary>
/// Initializes a new instance of the <see cref = "Signature" /> class.
/// </summary>
/// <param name = "name">The name.</param>
/// <param name = "email">The email.</param>
/// <param name = "when">The when.</param>
public Signature(string name, string email, DateTimeOffset when)
: this(NativeMethods.git_signature_new(name, email, when.ToSecondsSinceEpoch(), (int) when.Offset.TotalMinutes), false)
{
}
/// <summary>
/// Gets the name.
/// </summary>
public string Name
{
get { return sig.Name; }
}
/// <summary>
/// Gets the email.
/// </summary>
public string Email
{
get { return sig.Email; }
}
/// <summary>
/// Gets the date when this signature happened.
/// </summary>
public DateTimeOffset When
{
get
{
if (when == null)
{
when = Epoch.ToDateTimeOffset(sig.When.Time, sig.When.Offset);
}
return when.Value;
}
}
}
}
|
using System;
using System.Runtime.InteropServices;
namespace LibGit2Sharp
{
public class Signature
{
private readonly GitSignature sig = new GitSignature();
private DateTimeOffset? when;
internal Signature(IntPtr signaturePtr, bool ownedByRepo = true)
{
Marshal.PtrToStructure(signaturePtr, sig);
if (!ownedByRepo)
{
NativeMethods.git_signature_free(signaturePtr);
}
}
public Signature(string name, string email, DateTimeOffset when)
: this(NativeMethods.git_signature_new(name, email, when.ToSecondsSinceEpoch(), (int) when.Offset.TotalMinutes), false)
{
}
public string Name
{
get { return sig.Name; }
}
public string Email
{
get { return sig.Email; }
}
public DateTimeOffset When
{
get
{
if (when == null)
{
when = Epoch.ToDateTimeOffset(sig.When.Time, sig.When.Offset);
}
return when.Value;
}
}
}
}
|
mit
|
C#
|
0d15dec532202b2febdc1f1e2c5900323b2649e3
|
fix nullable bug
|
loresoft/FluentCommand
|
src/FluentCommand.SqlServer/SqlTypeMapping.cs
|
src/FluentCommand.SqlServer/SqlTypeMapping.cs
|
using System;
using System.Collections.Generic;
namespace FluentCommand
{
public static class SqlTypeMapping
{
private static readonly Dictionary<Type, string> _nativeType = new Dictionary<Type, string>
{
{typeof(bool), "bit"},
{typeof(byte), "tinyint"},
{typeof(short), "smallint"},
{typeof(int), "int"},
{typeof(long), "bigint"},
{typeof(float), "real"},
{typeof(double), "float"},
{typeof(decimal), "decimal"},
{typeof(byte[]), "varbinary(MAX)"},
{typeof(string), "nvarchar(MAX)"},
{typeof(TimeSpan), "time"},
{typeof(DateTime), "datetime2"},
{typeof(DateTimeOffset), "datetimeoffset"},
{typeof(Guid), "uniqueidentifier"}
};
public static string NativeType<T>()
{
return NativeType(typeof(T));
}
public static string NativeType(Type type)
{
var dataType = Nullable.GetUnderlyingType(type) ?? type;
_nativeType.TryGetValue(dataType, out var value);
return value ?? "sql_variant";
}
}
}
|
using System;
using System.Collections.Generic;
namespace FluentCommand
{
public static class SqlTypeMapping
{
private static readonly Dictionary<Type, string> _nativeType = new Dictionary<Type, string>
{
{typeof(bool), "bit"},
{typeof(byte), "tinyint"},
{typeof(short), "smallint"},
{typeof(int), "int"},
{typeof(long), "bigint"},
{typeof(float), "real"},
{typeof(double), "float"},
{typeof(decimal), "decimal"},
{typeof(byte[]), "varbinary(MAX)"},
{typeof(string), "nvarchar(MAX)"},
{typeof(TimeSpan), "time"},
{typeof(DateTime), "datetime2"},
{typeof(DateTimeOffset), "datetimeoffset"},
{typeof(Guid), "uniqueidentifier"}
};
public static string NativeType<T>()
{
return NativeType(typeof(T));
}
public static string NativeType(Type type)
{
_nativeType.TryGetValue(type, out var value);
return value ?? "sql_variant";
}
}
}
|
mit
|
C#
|
2e1011335b130bbaf6dc5beae9edc723ef81f8f2
|
Update SpaceFolder.cs
|
KerbaeAdAstra/KerbalFuture
|
KerbalFuture/SpaceFolder.cs
|
KerbalFuture/SpaceFolder.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using KSP;
namespace KerbalFuture
{
class SpaceFolderData : MonoBehavior
{
public static string path()
{
return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
public bool partContainsModule(string miPart, string moduleName)
{
ConfigNode.Load
}
}
class SpaceFolderVslChecks : MonoBehavior
{
public bool SpaceFolderWarpCheck()
{
List<Part> vslParts = this.Vessel.Parts;
for(vslParts[i])
{
if(vslParts[i].Contains("SFD"+*)
{
}
}
}
}
class FlightDrive : VesselModule
{
Vector3 vslObtVel;
public void FixedUpdate()
{
if((HighLogic.LoadedSceneIsFlight) && (SpaceFolderWarpCheck()))
{
vslObtVel = Vessel.GetObtVelocity();
if (SpacefolderWarpCheck(true))
}
}
}
class SpaceFolderEngine : PartModule
{
double holeDiameter;
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using KSP;
namespace KerbalFuture
{
class SpaceFolderData : MonoBehavior
{
public static string path()
{
return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
public bool partContainsModule(string miPart, string moduleName)
{
ConfigNode.Load
}
}
class SpaceFolderVslChecks : MonoBehavior
{
public bool SpaceFolderWarpCheck()
{
List<Part> vslParts = this.Vessel.Parts;
for(vslParts[i])
{
if(vslParts[i].Contains
}
}
}
class FlightDrive : VesselModule
{
Vector3 vslObtVel;
public void FixedUpdate()
{
if((HighLogic.LoadedSceneIsFlight) && (SpaceFolderWarpCheck()))
{
vslObtVel = Vessel.GetObtVelocity();
if (SpacefolderWarpCheck(true))
}
}
}
class SpaceFolderEngine : PartModule
{
double xMaxLength;
double yMaxLength;
double
}
}
|
mit
|
C#
|
dc262199ee5f9f6e0acd62b3fe34dd3594a6cee4
|
Allow ReleaseDate to be surfaced as it's still returned for Locker and ~/Track/Details calls
|
7digital/SevenDigital.Api.Schema,scooper91/SevenDigital.Api.Schema
|
src/Schema/Releases/Release.cs
|
src/Schema/Releases/Release.cs
|
using System;
using System.Xml.Serialization;
using SevenDigital.Api.Schema.Artists;
using SevenDigital.Api.Schema.Attributes;
using SevenDigital.Api.Schema.Legacy;
using SevenDigital.Api.Schema.Media;
using SevenDigital.Api.Schema.Packages;
using SevenDigital.Api.Schema.ParameterDefinitions.Get;
using SevenDigital.Api.Schema.Pricing;
namespace SevenDigital.Api.Schema.Releases
{
[Serializable]
[XmlRoot("release")]
[ApiEndpoint("release/details")]
public class Release : HasReleaseIdParameter
{
[XmlAttribute("id")]
public int Id { get; set; }
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("version")]
public string Version { get; set; }
[XmlElement("type")]
public ReleaseType Type { get; set; }
[XmlElement("barcode")]
public string Barcode { get; set; }
[XmlElement("year")]
public string Year { get; set; }
[XmlElement("explicitContent")]
public bool ExplicitContent { get; set; }
[XmlElement("artist")]
public Artist Artist { get; set; }
[XmlElement("url")]
public string Url { get; set; }
[XmlElement("image")]
public string Image { get; set; }
[XmlElement("releaseDate")]
[Obsolete("Please use Download.ReleaseDate (if available) instead.")]
public DateTime? ReleaseDate { get; set; }
[XmlElement("addedDate")]
public DateTime AddedDate { get; set; }
[XmlIgnore]
public bool AddedDateSpecified { get { return AddedDate > DateTime.MinValue; } }
[Obsolete]
public Price Price { get { return PriceLegacyMapper.PrimaryPackagePrice(Download); } }
[Obsolete]
public FormatList Formats { get { return FormatLegacyMapper.PrimaryPackageFormats(Download); } }
[XmlElement("label")]
public Label Label { get; set; }
[XmlElement("licensor")]
public Licensor Licensor { get; set; }
[XmlElement("streamingReleaseDate")]
public DateTime? StreamingReleaseDate { get; set; }
[XmlElement("duration")]
public int Duration { get; set; }
[XmlElement("trackCount")]
public int? TrackCount { get; set; }
[XmlElement("download")]
public Download Download { get; set; }
[XmlElement("subscriptionStreaming")]
public Streaming SubscriptionStreaming { get; set; }
[XmlElement("slug")]
public string Slug { get; set; }
public override string ToString()
{
return string.Format("{0}: {1} {2} {3}, Barcode {4}", Id, Title, Version, Type, Barcode);
}
}
}
|
using System;
using System.Xml.Serialization;
using SevenDigital.Api.Schema.Artists;
using SevenDigital.Api.Schema.Attributes;
using SevenDigital.Api.Schema.Legacy;
using SevenDigital.Api.Schema.Media;
using SevenDigital.Api.Schema.Packages;
using SevenDigital.Api.Schema.ParameterDefinitions.Get;
using SevenDigital.Api.Schema.Pricing;
namespace SevenDigital.Api.Schema.Releases
{
[Serializable]
[XmlRoot("release")]
[ApiEndpoint("release/details")]
public class Release : HasReleaseIdParameter
{
[XmlAttribute("id")]
public int Id { get; set; }
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("version")]
public string Version { get; set; }
[XmlElement("type")]
public ReleaseType Type { get; set; }
[XmlElement("barcode")]
public string Barcode { get; set; }
[XmlElement("year")]
public string Year { get; set; }
[XmlElement("explicitContent")]
public bool ExplicitContent { get; set; }
[XmlElement("artist")]
public Artist Artist { get; set; }
[XmlElement("url")]
public string Url { get; set; }
[XmlElement("image")]
public string Image { get; set; }
[Obsolete]
public DateTime? ReleaseDate
{
get
{
if (Download == null)
{
return null;
}
return Download.ReleaseDate;
}
}
[XmlElement("addedDate")]
public DateTime AddedDate { get; set; }
[XmlIgnore]
public bool AddedDateSpecified { get { return AddedDate > DateTime.MinValue; } }
[Obsolete]
public Price Price { get { return PriceLegacyMapper.PrimaryPackagePrice(Download); } }
[Obsolete]
public FormatList Formats { get { return FormatLegacyMapper.PrimaryPackageFormats(Download); } }
[XmlElement("label")]
public Label Label { get; set; }
[XmlElement("licensor")]
public Licensor Licensor { get; set; }
[XmlElement("streamingReleaseDate")]
public DateTime? StreamingReleaseDate { get; set; }
[XmlElement("duration")]
public int Duration { get; set; }
[XmlElement("trackCount")]
public int? TrackCount { get; set; }
[XmlElement("download")]
public Download Download { get; set; }
[XmlElement("subscriptionStreaming")]
public Streaming SubscriptionStreaming { get; set; }
[XmlElement("slug")]
public string Slug { get; set; }
public override string ToString()
{
return string.Format("{0}: {1} {2} {3}, Barcode {4}", Id, Title, Version, Type, Barcode);
}
}
}
|
mit
|
C#
|
0ffc133bc41a703e1e9496331b502c170ac2b3bd
|
update to layer 70
|
OpenTl/OpenTl.Schema
|
src/OpenTl.Schema/SchemaInfo.cs
|
src/OpenTl.Schema/SchemaInfo.cs
|
namespace OpenTl.Schema
{
public static class SchemaInfo
{
public static int SchemaVersion { get; } = 70;
}
}
|
namespace OpenTl.Schema
{
public static class SchemaInfo
{
public static int SchemaVersion { get; } = 68;
}
}
|
mit
|
C#
|
65467a4446e882613f62f05c17df0096d4e81f0f
|
Change menu partial view type
|
stvnhrlnd/SH,stvnhrlnd/SH,stvnhrlnd/SH
|
SH.Site/Views/Partials/_Menu.cshtml
|
SH.Site/Views/Partials/_Menu.cshtml
|
@model MenuViewModel
<a href="#menu" id="menu-link">
<i class="fa fa-bars" aria-hidden="true"></i>
<i class="fa fa-times" aria-hidden="true"></i>
</a>
<div id="menu">
<div class="pure-menu">
<span class="pure-menu-heading">@Model.SiteName</span>
<ul class="pure-menu-list">
@foreach (var item in Model.MenuItems)
{
var selected = Model.Content.Path.Split(',').Select(int.Parse).Contains(item.Id);
<li class="pure-menu-item @(selected ? "pure-menu-selected": "")">
<a href="@item.Url" class="pure-menu-link">
@item.Name
</a>
</li>
}
</ul>
</div>
</div>
|
@inherits UmbracoViewPage<MenuViewModel>
<a href="#menu" id="menu-link">
<i class="fa fa-bars" aria-hidden="true"></i>
<i class="fa fa-times" aria-hidden="true"></i>
</a>
<div id="menu">
<div class="pure-menu">
<span class="pure-menu-heading">@Model.SiteName</span>
<ul class="pure-menu-list">
@foreach (var item in Model.MenuItems)
{
var selected = Model.Content.Path.Split(',').Select(int.Parse).Contains(item.Id);
<li class="pure-menu-item @(selected ? "pure-menu-selected": "")">
<a href="@item.Url" class="pure-menu-link">
@item.Name
</a>
</li>
}
</ul>
</div>
</div>
|
mit
|
C#
|
a8f79f19267e522cd33187e9f17ba1f2a64f6fc9
|
Bump v1.0.1
|
karronoli/tiny-sato
|
TinySato/Properties/AssemblyInfo.cs
|
TinySato/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("TinySato")]
[assembly: AssemblyDescription("Sato Barcode Printer Language(SBPL) wrapper")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TinySato")]
[assembly: AssemblyCopyright("Copyright 2016 karronoli")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("f56213db-fa1f-42da-b930-b642a56ee840")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("TinySato")]
[assembly: AssemblyDescription("Sato Barcode Printer Language(SBPL) wrapper")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TinySato")]
[assembly: AssemblyCopyright("Copyright 2016 karronoli")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("f56213db-fa1f-42da-b930-b642a56ee840")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
apache-2.0
|
C#
|
1461ec818635ecb55a4ba84439432f3f083d5db7
|
Clean up
|
stormpath/stormpath-dotnet-owin-middleware
|
test/Stormpath.Owin.UnitTest/CookieParserTests.cs
|
test/Stormpath.Owin.UnitTest/CookieParserTests.cs
|
using System.Collections.Generic;
using FluentAssertions;
using Stormpath.Owin.Middleware.Internal;
using Xunit;
namespace Stormpath.Owin.UnitTest
{
public class CookieParserTests
{
public static IEnumerable<object[]> EmptyTestCases()
{
yield return new object[] { new string[] { null } };
yield return new object[] { new string[] { string.Empty } };
yield return new object[] { new string[] { " " } };
yield return new object[] { new string[] { " ," } };
yield return new object[] { new string[] { " ;" } };
}
[Theory]
[MemberData(nameof(EmptyTestCases))]
public void ParsesEmptyHeaders(string[] input)
{
var parsed = new CookieParser(input, logger: null);
parsed.Count.Should().Be(0);
}
//public void ParsesCookie(string )
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
using Stormpath.Owin.Middleware.Internal;
using Xunit;
namespace Stormpath.Owin.UnitTest
{
public class CookieParserTests
{
public static IEnumerable<object[]> EmptyTestCases()
{
yield return new object[] { new string[] { null } };
yield return new object[] { new string[] { string.Empty } };
yield return new object[] { new string[] { " " } };
yield return new object[] { new string[] { " ," } };
yield return new object[] { new string[] { " ;" } };
}
[Theory]
[MemberData(nameof(EmptyTestCases))]
public void ParsesEmptyHeaders(string[] input)
{
var parsed = new CookieParser(input, logger: null);
parsed.Count.Should().Be(0);
}
//public void ParsesCookie(string )
}
}
|
apache-2.0
|
C#
|
77875230e1cd04a354cd87afbdf5242dce743cb2
|
add new options
|
ruarai/Trigrad,ruarai/Trigrad
|
Trigrad/DataTypes/TrigradOptions.cs
|
Trigrad/DataTypes/TrigradOptions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Trigrad.DataTypes
{
/// <summary> Options for the usage of the TrigradCompressor. </summary>
public class TrigradOptions
{
/// <summary> Constructs a TrigradOptions with a random seed. </summary>
public TrigradOptions()
{
Random = new Random();
}
/// <summary> Constructs a TrigradOptions with a specified seed. </summary>
public TrigradOptions(int seed)
{
Random = new Random(seed);
}
/// <summary> The goal number of samples to be achieved. </summary>
public int SampleCount = 1000;
/// <summary> The frequency table providing the TrigradCompressor values regarding the chance a pixel will be sampled. </summary>
public FrequencyTable FrequencyTable = null;
/// <summary> The random number generator to be used by the TrigradCompressor. </summary>
public Random Random;
/// <summary> The factor to upscale the bitmap during compression. </summary>
public int ScaleFactor = 1;
/// <summary> The number of resamples. </summary>
public int Resamples = 25;
/// <summary> The number of iterations performed during minimisation. </summary>
public int Iterations = 4;
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Trigrad.DataTypes
{
/// <summary> Options for the usage of the TrigradCompressor. </summary>
public class TrigradOptions
{
/// <summary> Constructs a TrigradOptions with a random seed. </summary>
public TrigradOptions()
{
Random = new Random();
}
/// <summary> Constructs a TrigradOptions with a specified seed. </summary>
public TrigradOptions(int seed)
{
Random = new Random(seed);
}
/// <summary> The goal number of samples to be achieved. </summary>
public int SampleCount = 1000;
/// <summary> The frequency table providing the TrigradCompressor values regarding the chance a pixel will be sampled. </summary>
public FrequencyTable FrequencyTable = null;
/// <summary> The random number generator to be used by the TrigradCompressor. </summary>
public Random Random;
/// <summary> The factor to upscale the bitmap during compression. </summary>
public int ScaleFactor = 1;
}
}
|
mit
|
C#
|
2c37a9f8a9d97d41ed84a7659c2449d77965d7bb
|
Fix test.
|
ajayanandgit/mbunit-v3,Gallio/mbunit-v3,mterwoord/mbunit-v3,Gallio/mbunit-v3,mterwoord/mbunit-v3,Gallio/mbunit-v3,xJom/mbunit-v3,xJom/mbunit-v3,xJom/mbunit-v3,Gallio/mbunit-v3,xJom/mbunit-v3,mterwoord/mbunit-v3,Gallio/mbunit-v3,ajayanandgit/mbunit-v3,Gallio/mbunit-v3,ajayanandgit/mbunit-v3,xJom/mbunit-v3,mterwoord/mbunit-v3,ajayanandgit/mbunit-v3,Gallio/mbunit-v3,mterwoord/mbunit-v3,ajayanandgit/mbunit-v3,xJom/mbunit-v3,ajayanandgit/mbunit-v3,mterwoord/mbunit-v3
|
src/Gallio/Gallio.Tests/Runtime/Preferences/FilePreferenceStoreTest.cs
|
src/Gallio/Gallio.Tests/Runtime/Preferences/FilePreferenceStoreTest.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Gallio.Common.Policies;
using Gallio.Runtime.Preferences;
using MbUnit.Framework;
namespace Gallio.Tests.Runtime.Preferences
{
[TestsOn(typeof(FilePreferenceStore))]
public class FilePreferenceStoreTest
{
[Test]
public void Constructor_WhenDirectoryIsNull_Throws()
{
Assert.Throws<ArgumentNullException>(() => new FilePreferenceStore(null));
}
[Test]
public void Constructor_WhenDirectoryIsValid_InitializesPreferenceStoreDir()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
Assert.AreEqual(directory, preferenceStore.PreferenceStoreDir);
}
[Test]
public void Indexer_WhenNameIsNull_Throws()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
object x;
Assert.Throws<ArgumentNullException>(() => { x = preferenceStore[null]; });
}
[Test]
public void Indexer_WhenNameIsValid_ReturnsFilePreferenceSet()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
var preferenceSet = (FilePreferenceSet)preferenceStore["Prefs"];
Assert.AreEqual(new FileInfo(@"C:\Foo\Prefs.gallioprefs"), preferenceSet.PreferenceSetFile);
}
[Test]
public void Indexer_WhenNameIsValid_ReturnsSameInstanceForSameName()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
Assert.AreSame(preferenceStore["name"], preferenceStore["name"]);
}
[Test]
public void Indexer_WhenNameIsValid_ReturnsDifferentInstanceForDifferentName()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
Assert.AreNotSame(preferenceStore["name"], preferenceStore["different"]);
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Gallio.Common.Policies;
using Gallio.Runtime.Preferences;
using MbUnit.Framework;
namespace Gallio.Tests.Runtime.Preferences
{
[TestsOn(typeof(FilePreferenceStore))]
public class FilePreferenceStoreTest
{
[Test]
public void Constructor_WhenDirectoryIsNull_Throws()
{
Assert.Throws<ArgumentNullException>(() => new FilePreferenceStore(null));
}
[Test]
public void Constructor_WhenDirectoryIsValid_InitializesPreferenceStoreDir()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
Assert.AreEqual(directory, preferenceStore.PreferenceStoreDir);
}
[Test]
public void Indexer_WhenNameIsNull_Throws()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
object x;
Assert.Throws<ArgumentNullException>(() => { x = preferenceStore[null]; });
}
[Test]
public void Indexer_WhenNameIsValid_ReturnsFilePreferenceSet()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
var preferenceSet = (FilePreferenceSet)preferenceStore["Prefs"];
Assert.AreEqual(new FileInfo(@"C:\Foo\Prefs.gallioprefs"), preferenceSet.PreferenceSetFile);
}
[Test]
public void Indexer_WhenNameIsValid_ReturnsSameInstanceForSameName()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
Assert.AreSame(preferenceStore["name"], preferenceStore["name"]);
}
[Test]
public void Indexer_WhenNameIsValid_ReturnsDifferentInstanceForDifferentName()
{
var directory = new DirectoryInfo(@"C:\Foo");
var preferenceStore = new FilePreferenceStore(directory);
Assert.AreSame(preferenceStore["name"], preferenceStore["different"]);
}
}
}
|
apache-2.0
|
C#
|
4cfb92aea8274f0a49631141574bac7dc72afeb8
|
Make known tags readonly
|
dotnet/roslyn-analyzers,dotnet/roslyn-analyzers
|
src/Utilities/Compiler/Extensions/WellKnownDiagnosticTagsExtensions.cs
|
src/Utilities/Compiler/Extensions/WellKnownDiagnosticTagsExtensions.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.
namespace Microsoft.CodeAnalysis
{
internal static class WellKnownDiagnosticTagsExtensions
{
public const string EnabledRuleInAggressiveMode = nameof(EnabledRuleInAggressiveMode);
public const string Dataflow = nameof(Dataflow);
public const string CompilationEnd = nameof(CompilationEnd);
public static readonly string[] DataflowAndTelemetry = new string[] { Dataflow, WellKnownDiagnosticTags.Telemetry };
public static readonly string[] DataflowAndTelemetryEnabledInAggressiveMode = new string[] { Dataflow, WellKnownDiagnosticTags.Telemetry, EnabledRuleInAggressiveMode };
public static readonly string[] Telemetry = new string[] { WellKnownDiagnosticTags.Telemetry };
public static readonly string[] TelemetryEnabledInAggressiveMode = new string[] { WellKnownDiagnosticTags.Telemetry, EnabledRuleInAggressiveMode };
public static readonly string[] CompilationEndAndTelemetry = new string[] { CompilationEnd, WellKnownDiagnosticTags.Telemetry };
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis
{
internal static class WellKnownDiagnosticTagsExtensions
{
public const string EnabledRuleInAggressiveMode = nameof(EnabledRuleInAggressiveMode);
public const string Dataflow = nameof(Dataflow);
public const string CompilationEnd = nameof(CompilationEnd);
public static string[] DataflowAndTelemetry = new string[] { Dataflow, WellKnownDiagnosticTags.Telemetry };
public static string[] DataflowAndTelemetryEnabledInAggressiveMode = new string[] { Dataflow, WellKnownDiagnosticTags.Telemetry, EnabledRuleInAggressiveMode };
public static string[] Telemetry = new string[] { WellKnownDiagnosticTags.Telemetry };
public static string[] TelemetryEnabledInAggressiveMode = new string[] { WellKnownDiagnosticTags.Telemetry, EnabledRuleInAggressiveMode };
public static string[] CompilationEndAndTelemetry = new string[] { CompilationEnd, WellKnownDiagnosticTags.Telemetry };
}
}
|
mit
|
C#
|
777ee122a81f76871160f73cf00848f114a64e75
|
Implement IsValidDestination for Knight
|
ProgramFOX/Chess.NET
|
ChessDotNet/Pieces/Knight.cs
|
ChessDotNet/Pieces/Knight.cs
|
using System;
namespace ChessDotNet.Pieces
{
public class Knight : ChessPiece
{
public override Player Owner
{
get;
set;
}
public Knight(Player owner)
{
Owner = owner;
}
public override string GetFenCharacter()
{
return Owner == Player.White ? "N" : "n";
}
public override bool IsValidDestination(Position origin, Position destination, ChessGame game)
{
Utilities.ThrowIfNull(origin, "origin");
Utilities.ThrowIfNull(destination, "destination");
PositionDistance posDelta = new PositionDistance(origin, destination);
if ((posDelta.DistanceX != 2 || posDelta.DistanceY != 1) && (posDelta.DistanceX != 1 || posDelta.DistanceY != 2))
return false;
return true;
}
}
}
|
namespace ChessDotNet.Pieces
{
public class Knight : ChessPiece
{
public override Player Owner
{
get;
set;
}
public Knight(Player owner)
{
Owner = owner;
}
public override string GetFenCharacter()
{
return Owner == Player.White ? "N" : "n";
}
}
}
|
mit
|
C#
|
17ebd2ae27f2910eaafa7b7b90c0c25f517b43d4
|
Use expression properties
|
MHeasell/Mappy,MHeasell/Mappy
|
Mappy/UI/Drawables/DrawableTile.cs
|
Mappy/UI/Drawables/DrawableTile.cs
|
namespace Mappy.UI.Drawables
{
using System.Drawing;
using Mappy.Data;
using Mappy.UI.Painters;
public class DrawableTile : IDrawable
{
private readonly IMapTile tile;
private readonly BitmapGridPainter painter;
private readonly ContourHeightPainter heightPainter;
public DrawableTile(IMapTile tile)
{
this.tile = tile;
this.painter = new BitmapGridPainter(tile.TileGrid, 32);
this.heightPainter = new ContourHeightPainter(tile.HeightGrid, 16);
this.heightPainter.ShowSeaLevel = true;
}
public Size Size => new Size(this.Width, this.Height);
public int Width => this.tile.TileGrid.Width * 32;
public int Height => this.tile.TileGrid.Height * 32;
public Color BackgroundColor
{
get
{
return this.painter.BackgroundColor;
}
set
{
this.painter.BackgroundColor = value;
}
}
public bool DrawHeightMap { get; set; }
public int SeaLevel
{
get
{
return this.heightPainter.SeaLevel;
}
set
{
this.heightPainter.SeaLevel = value;
}
}
public void Draw(Graphics graphics, Rectangle clipRectangle)
{
this.painter.Paint(graphics, clipRectangle);
if (this.DrawHeightMap)
{
this.heightPainter.Paint(graphics, clipRectangle);
}
}
}
}
|
namespace Mappy.UI.Drawables
{
using System.Drawing;
using Mappy.Data;
using Mappy.UI.Painters;
public class DrawableTile : IDrawable
{
private readonly IMapTile tile;
private readonly BitmapGridPainter painter;
private readonly ContourHeightPainter heightPainter;
public DrawableTile(IMapTile tile)
{
this.tile = tile;
this.painter = new BitmapGridPainter(tile.TileGrid, 32);
this.heightPainter = new ContourHeightPainter(tile.HeightGrid, 16);
this.heightPainter.ShowSeaLevel = true;
}
public Size Size
{
get { return new Size(this.Width, this.Height); }
}
public int Width
{
get { return this.tile.TileGrid.Width * 32; }
}
public int Height
{
get { return this.tile.TileGrid.Height * 32; }
}
public Color BackgroundColor
{
get
{
return this.painter.BackgroundColor;
}
set
{
this.painter.BackgroundColor = value;
}
}
public bool DrawHeightMap { get; set; }
public int SeaLevel
{
get
{
return this.heightPainter.SeaLevel;
}
set
{
this.heightPainter.SeaLevel = value;
}
}
public void Draw(Graphics graphics, Rectangle clipRectangle)
{
this.painter.Paint(graphics, clipRectangle);
if (this.DrawHeightMap)
{
this.heightPainter.Paint(graphics, clipRectangle);
}
}
}
}
|
mit
|
C#
|
735f492afa526e3dcb6cbc993213751253bdffd8
|
remove Stateful from IOnlineShopDbContext
|
StoikoNeykov/OnlineShop,StoikoNeykov/OnlineShop
|
OnlineShop/Libs/OnlineShop.Libs.Data/Contracts/IOnlineShopDbContext.cs
|
OnlineShop/Libs/OnlineShop.Libs.Data/Contracts/IOnlineShopDbContext.cs
|
using OnlineShop.Libs.Models;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Threading.Tasks;
namespace OnlineShop.Libs.Data.Contracts
{
public interface IOnlineShopDbContext
{
IDbSet<TEntity> Set<TEntity>() where TEntity : class;
DbEntityEntry<TEntity> Entry<TEntity>(TEntity entity) where TEntity : class;
Task<int> SaveChangesAsync();
int SaveChanges();
IDbSet<Category> Categories { get; }
IDbSet<Product> Products { get; }
IDbSet<PhotoItem> PhotoItems { get; }
}
}
|
using OnlineShop.Libs.Models;
using System.Data.Entity;
using System.Threading.Tasks;
namespace OnlineShop.Libs.Data.Contracts
{
public interface IOnlineShopDbContext
{
IDbSet<TEntity> Set<TEntity>() where TEntity : class;
IStateful<TEntity> GetStateful<TEntity>(TEntity entity) where TEntity : class;
Task<int> SaveChangesAsync();
int SaveChanges();
IDbSet<Category> Categories { get; }
IDbSet<Product> Products { get; }
IDbSet<PhotoItem> PhotoItems { get; }
}
}
|
mit
|
C#
|
2729c6288641dac4a5948e8bdbf6e8a5d9966eca
|
Add WebMyAccount to IGIDXClient
|
TSEVOLLC/GIDX.SDK-csharp
|
src/GIDX.SDK/IGIDXClient.cs
|
src/GIDX.SDK/IGIDXClient.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GIDX.SDK
{
public interface IGIDXClient : IClient
{
ICustomerIdentityClient CustomerIdentity { get; }
IDocumentLibraryClient DocumentLibrary { get; }
IWebCashierClient WebCashier { get; }
IWebMyAccountClient WebMyAccount { get; }
IWebRegClient WebReg { get; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GIDX.SDK
{
public interface IGIDXClient : IClient
{
ICustomerIdentityClient CustomerIdentity { get; }
IDocumentLibraryClient DocumentLibrary { get; }
IWebCashierClient WebCashier { get; }
IWebRegClient WebReg { get; }
}
}
|
mit
|
C#
|
243ecedd402531d871e9fb44118953b7bb6c239b
|
Update AndroidLinearAccelerationProbe.cs
|
predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus
|
Sensus.Android.Shared/Probes/Movement/AndroidLinearAccelerationProbe.cs
|
Sensus.Android.Shared/Probes/Movement/AndroidLinearAccelerationProbe.cs
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Android.Hardware;
using Sensus.Probes.Movement;
namespace Sensus.Android.Probes.Movement
{
public class AndroidLinearAccelerationProbe : LinearAccelerationProbe
{
private AndroidSensorListener _linearaccelerationListener;
public AndroidLinearAccelerationProbe()
{
_linearaccelerationListener = new AndroidSensorListener(SensorType.LinearAcceleration, async e =>
{
// should get x, y, and z values
if (e.Values.Count != 3)
{
return;
}
await StoreDatumAsync(new LinearAccelerationDatum(DateTimeOffset.UtcNow, e.Values[0], e.Values[1], e.Values[2] ));
});
}
protected override async Task InitializeAsync()
{
await base.InitializeAsync();
_linearaccelerationListener.Initialize(MinDataStoreDelay);
}
protected override async Task StartListeningAsync()
{
await base.StartListeningAsync();
_linearaccelerationListener.Start();
}
protected override async Task StopListeningAsync()
{
await base.StopListeningAsync();
_linearaccelerationListener.Stop();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Android.Hardware;
using Sensus.Probes.Movement;
namespace Sensus.Android.Probes.Movement
{
class AndroidLinearAccelerationProbe : LinearAccelerationProbe
{
private AndroidSensorListener _linearaccelerationListener;
public AndroidLinearAccelerationProbe()
{
_linearaccelerationListener = new AndroidSensorListener(SensorType.LinearAcceleration, async e =>
{
// should get x, y, and z values
if (e.Values.Count != 3)
{
return;
}
await StoreDatumAsync(new LinearAccelerationDatum(DateTimeOffset.UtcNow, e.Values[0], e.Values[1], e.Values[2] ));
});
}
protected override async Task InitializeAsync()
{
await base.InitializeAsync();
_linearaccelerationListener.Initialize(MinDataStoreDelay);
}
protected override async Task StartListeningAsync()
{
await base.StartListeningAsync();
_linearaccelerationListener.Start();
}
protected override async Task StopListeningAsync()
{
await base.StopListeningAsync();
_linearaccelerationListener.Stop();
}
}
}
|
apache-2.0
|
C#
|
eed9a2314e8a32a3fe93375b712e8df5a8ea66ba
|
Update AssemblyInfo.cs
|
Tulpep/Network-AutoSwitch
|
Tulpep.NetworkAutoSwitch.NetworkStateLibrary/Properties/AssemblyInfo.cs
|
Tulpep.NetworkAutoSwitch.NetworkStateLibrary/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("Tulpep.Network.NetworkStateService")]
[assembly: AssemblyDescription("Detailed information at https://github.com/Tulpep/Network-AutoSwitch")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Tulpep")]
[assembly: AssemblyProduct("Tulpep.Network.NetworkStateService")]
[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("9e33f72c-4a08-4081-9a4a-e8ace7a9b7fd")]
// 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("Tulpep.Network.NetworkStateService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tulpep.Network.NetworkStateService")]
[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("9e33f72c-4a08-4081-9a4a-e8ace7a9b7fd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
ca1cad22ce40b37c176ae9cd31bead29a3db3aa5
|
Update ObservableExtensions.cs
|
keith-hall/Extensions,keith-hall/Extensions
|
src/ObservableExtensions.cs
|
src/ObservableExtensions.cs
|
using System;
using System.Reactive.Linq;
namespace HallLibrary.Extensions
{
/// <summary>
/// Contains extension methods for working with observables.
/// </summary>
public static class ObservableExtensions
{
/// <summary>
/// Returns the current value of an observable with the previous value.
/// </summary>
/// <typeparam name="TSource">The source type.</typeparam>
/// <typeparam name="TOutput">The output type after the <paramref name="projection" /> has been applied.</typeparam>
/// <param name="source">The observable.</param>
/// <param name="projection">The projection to apply.</param>
/// <returns>The current observable value with the previous value.</returns>
public static IObservable<TOutput> WithPrevious<TSource, TOutput>(this IObservable<TSource> source, Func<TSource, TSource, TOutput> projection)
{ // http://www.zerobugbuild.com/?p=213
return source.Scan(Tuple.Create(default(TSource), default(TSource)),
(previous, current) => Tuple.Create(previous.Item2, current))
.Select(t => projection(t.Item1, t.Item2));
}
/*
/// <summary>
/// Ensure that the subscription to the <paramref name="observable" /> is re-subscribed to on error.
/// </summary>
/// <typeparam name="T">The type of data the observable contains.</typeparam>
/// <param name="observable">The observable to re-subscribe to on error.</param>
/// <param name="onNext">Action to invoke for each element in the <paramref name="observable" /> sequence.</param>
/// <param name="onError">Action to invoke for each error that occurs in the <paramref name="observable" /> sequence.</param>
/// <param name="delayAfterError">The time to wait after an error before re-subscribing to the <paramref name="observable" /> sequence.</param>
/// <remarks>http://stackoverflow.com/questions/18978523/write-an-rx-retryafter-extension-method</remarks>
public static void ReSubscribeOnError<T> (this IObservable<T> observable, Action<T> onNext, Action<Exception> onError, TimeSpan delayAfterError)
{
Action sub = null;
sub = () => observable.Subscribe(onNext, ex => { onError(ex); observable = observable.DelaySubscription(delayAfterError); sub(); });
sub();
}*/
}
}
|
using System;
using System.Reactive.Linq;
namespace HallLibrary.Extensions
{
/// <summary>
/// Contains extension methods for working with observables.
/// </summary>
public static class ObservableExtensions
{
/// <summary>
/// Returns the current value of an observable with the previous value.
/// </summary>
/// <typeparam name="TSource">The source type.</typeparam>
/// <typeparam name="TOutput">The output type after the <paramref name="projection" /> has been applied.</typeparam>
/// <param name="source">The observable.</param>
/// <param name="projection">The projection to apply.</param>
/// <returns>The current observable value with the previous value.</returns>
public static IObservable<TOutput> WithPrevious<TSource, TOutput>(this IObservable<TSource> source, Func<TSource, TSource, TOutput> projection)
{ // http://www.zerobugbuild.com/?p=213
return source.Scan(Tuple.Create(default(TSource), default(TSource)),
(previous, current) => Tuple.Create(previous.Item2, current))
.Select(t => projection(t.Item1, t.Item2));
}
/// <summary>
/// Ensure that the subscription to the <paramref name="observable" /> is re-subscribed to on error.
/// </summary>
/// <typeparam name="T">The type of data the observable contains.</typeparam>
/// <param name="observable">The observable to re-subscribe to on error.</param>
/// <param name="onNext">Action to invoke for each element in the <paramref name="observable" /> sequence.</param>
/// <param name="onError">Action to invoke for each error that occurs in the <paramref name="observable" /> sequence.</param>
/// <param name="delayAfterError">The time to wait after an error before re-subscribing to the <paramref name="observable" /> sequence.</param>
/// <remarks>http://stackoverflow.com/questions/18978523/write-an-rx-retryafter-extension-method</remarks>
public static void ReSubscribeOnError<T> (this IObservable<T> observable, Action<T> onNext, Action<Exception> onError, TimeSpan delayAfterError)
{
Action sub = null;
sub = () => observable.Subscribe(onNext, ex => { onError(ex); observable = observable.DelaySubscription(delayAfterError); sub(); });
sub();
}
}
}
|
apache-2.0
|
C#
|
83d9645762cc1e200f8b101491ce9328ab788eb4
|
add code to pass test
|
jgraber/ForgetTheMilk,jgraber/ForgetTheMilk,jgraber/ForgetTheMilk
|
ForgetTheMilk/ForgetTheMilk/Controllers/TaskController.cs
|
ForgetTheMilk/ForgetTheMilk/Controllers/TaskController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
namespace ForgetTheMilk.Controllers
{
public class TaskController : Controller
{
public ActionResult Index()
{
return View(Tasks);
}
public static readonly List<Task> Tasks = new List<Task>();
[HttpPost]
public ActionResult Add(string task)
{
var taskItem = new Task(task, DateTime.Today);
Tasks.Add(taskItem);
return RedirectToAction("Index");
}
}
public class Task
{
public Task(string task, DateTime today)
{
Description = task;
var dueDatePattern = new Regex(@"(apr|may)\s(\d)");
var hasDueDate = dueDatePattern.IsMatch(task);
if (hasDueDate)
{
var dueDate = dueDatePattern.Match(task);
var monthInput = dueDate.Groups[1].Value;
var month = monthInput == "may" ? 5 : 4;
var day = Convert.ToInt32(dueDate.Groups[2].Value);
DueDate = new DateTime(today.Year, month, day);
if (DueDate < today)
{
DueDate = DueDate.Value.AddYears(1);
}
}
}
public string Description { get; set; }
public DateTime? DueDate { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
namespace ForgetTheMilk.Controllers
{
public class TaskController : Controller
{
public ActionResult Index()
{
return View(Tasks);
}
public static readonly List<Task> Tasks = new List<Task>();
[HttpPost]
public ActionResult Add(string task)
{
var taskItem = new Task(task, DateTime.Today);
Tasks.Add(taskItem);
return RedirectToAction("Index");
}
}
public class Task
{
public Task(string task, DateTime today)
{
Description = task;
var dueDatePattern = new Regex(@"may\s(\d)");
var hasDueDate = dueDatePattern.IsMatch(task);
if (hasDueDate)
{
var dueDate = dueDatePattern.Match(task);
var day = Convert.ToInt32(dueDate.Groups[1].Value);
DueDate = new DateTime(today.Year, 5, day);
if (DueDate < today)
{
DueDate = DueDate.Value.AddYears(1);
}
}
}
public string Description { get; set; }
public DateTime? DueDate { get; set; }
}
}
|
apache-2.0
|
C#
|
c262052ebfa6f619fe51761440de24b064755bad
|
replace debug tracepoints with trace tracepoints
|
rjw57/streamkinect2.net
|
StreamKinect2Tests/Mocks.cs
|
StreamKinect2Tests/Mocks.cs
|
using System.Diagnostics;
using StreamKinect2;
using System.Collections.Generic;
using System;
namespace StreamKinect2Tests.Mocks
{
/// <summary>
/// A mock zeroconf browser which avoids our test suite advertising to all and sundry.
/// </summary>
public class MockZeroconfServiceBrowser : IZeroconfServiceBrowser
{
public event ServiceRegisteredHandler ServiceRegistered;
public event ServiceResolvedHandler ServiceResolved;
private IDictionary<Tuple<string, string>, ushort> m_nameRegTypeToPort;
public MockZeroconfServiceBrowser()
{
m_nameRegTypeToPort = new Dictionary<Tuple<string, string>, ushort>();
}
public void Register(string name, string regType, ushort port)
{
var args = new ServiceRegisteredArgs
{
Name = name,
RegType = regType,
Domain = "local.",
};
// Record this service
m_nameRegTypeToPort.Add(Tuple.Create(name, regType), port);
Trace.WriteLine("Mock Zeroconf Browser signalling register: " + args);
ServiceRegistered(this, args);
}
public void Resolve(string name, string regType, string domain)
{
ushort port = 0;
try
{
port = m_nameRegTypeToPort[Tuple.Create(name, regType)];
}
catch (KeyNotFoundException)
{
Trace.WriteLine("Mock Zeroconf Browser failed to resolve: " + name + ", " + regType + ", " + domain);
return;
}
var args = new ServiceResolvedArgs
{
FullName = name + "." + regType + ".local.",
Hostname = "localhost",
Port = port,
};
Trace.WriteLine("Mock Zeroconf Browser resolving: " + args);
ServiceResolved(this, args);
}
}
}
|
using System.Diagnostics;
using StreamKinect2;
using System.Collections.Generic;
using System;
namespace StreamKinect2Tests.Mocks
{
/// <summary>
/// A mock zeroconf browser which avoids our test suite advertising to all and sundry.
/// </summary>
public class MockZeroconfServiceBrowser : IZeroconfServiceBrowser
{
public event ServiceRegisteredHandler ServiceRegistered;
public event ServiceResolvedHandler ServiceResolved;
private IDictionary<Tuple<string, string>, ushort> m_nameRegTypeToPort;
public MockZeroconfServiceBrowser()
{
m_nameRegTypeToPort = new Dictionary<Tuple<string, string>, ushort>();
}
public void Register(string name, string regType, ushort port)
{
var args = new ServiceRegisteredArgs
{
Name = name,
RegType = regType,
Domain = "local.",
};
// Record this service
m_nameRegTypeToPort.Add(Tuple.Create(name, regType), port);
Debug.WriteLine("Mock Zeroconf Browser signalling register: " + args);
ServiceRegistered(this, args);
}
public void Resolve(string name, string regType, string domain)
{
ushort port = 0;
try
{
port = m_nameRegTypeToPort[Tuple.Create(name, regType)];
}
catch (KeyNotFoundException)
{
Debug.WriteLine("Mock Zeroconf Browser failed to resolve: " + name + ", " + regType + ", " + domain);
return;
}
var args = new ServiceResolvedArgs
{
FullName = name + "." + regType + ".local.",
Hostname = "localhost",
Port = port,
};
Debug.WriteLine("Mock Zeroconf Browser resolving: " + args);
ServiceResolved(this, args);
}
}
}
|
bsd-2-clause
|
C#
|
ac8b3d80d225fb979ad6c03de21fa1b1ce3c2cca
|
Bump version 0.2.0
|
SaladLab/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladLab/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced
|
plugins/Akka.Interfaced.Persistence/Properties/AssemblyInfoGenerated.cs
|
plugins/Akka.Interfaced.Persistence/Properties/AssemblyInfoGenerated.cs
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyVersionAttribute("0.0.0")]
[assembly: AssemblyFileVersionAttribute("0.2.0")]
[assembly: AssemblyInformationalVersionAttribute("0.2.0-beta")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.0.0";
internal const string InformationalVersion = "0.2.0-beta";
}
}
|
// <auto-generated/>
using System.Reflection;
[assembly: AssemblyVersionAttribute("0.0.0")]
[assembly: AssemblyFileVersionAttribute("0.2.0")]
[assembly: AssemblyInformationalVersionAttribute("0.2.0")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.0.0";
internal const string InformationalVersion = "0.2.0";
}
}
|
mit
|
C#
|
f71f9eb7be950a488227fbdea5ff9201764048b1
|
Add optional InvoiceId
|
haithemaraissia/XamarinStripe,xamarin/XamarinStripe
|
XamarinStripe/StripeInvoiceItem.cs
|
XamarinStripe/StripeInvoiceItem.cs
|
/*
* Copyright 2011 Joe Dluzen, 2012 Xamarin, Inc.
*
* Author(s):
* Joe Dluzen (jdluzen@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using Newtonsoft.Json;
namespace Xamarin.Payments.Stripe {
[JsonObject (MemberSerialization.OptIn)]
public class StripeInvoiceItem : StripeId {
[JsonProperty (PropertyName = "customer")]
public string CustomerID { get; set; }
[JsonProperty (PropertyName = "currency")]
public string Currency { get; set; }
[JsonProperty (PropertyName = "livemode")]
public bool LiveMode { get; set; }
[JsonProperty (PropertyName = "date")]
[JsonConverter (typeof (UnixDateTimeConverter))]
public DateTime Date { get; set; }
[JsonProperty (PropertyName = "description")]
public string Description { get; set; }
[JsonProperty (PropertyName = "deleted")]
public bool? Deleted { get; set; }
[JsonProperty (PropertyName = "invoice")]
public string InvoiceID { get; set; }
}
}
|
/*
* Copyright 2011 Joe Dluzen, 2012 Xamarin, Inc.
*
* Author(s):
* Joe Dluzen (jdluzen@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using Newtonsoft.Json;
namespace Xamarin.Payments.Stripe {
[JsonObject (MemberSerialization.OptIn)]
public class StripeInvoiceItem : StripeId {
[JsonProperty (PropertyName = "customer")]
public string CustomerID { get; set; }
[JsonProperty (PropertyName = "currency")]
public string Currency { get; set; }
[JsonProperty (PropertyName = "livemode")]
public bool LiveMode { get; set; }
[JsonProperty (PropertyName = "date")]
[JsonConverter (typeof (UnixDateTimeConverter))]
public DateTime Date { get; set; }
[JsonProperty (PropertyName = "description")]
public string Description { get; set; }
[JsonProperty (PropertyName = "deleted")]
public bool? Deleted { get; set; }
}
}
|
apache-2.0
|
C#
|
69798055d43f8021f3f52b7265afaff345ffda53
|
Update Program.cs
|
tropo/tropo-webapi-csharp,tropo/tropo-webapi-csharp
|
TropoOutboundSMS/Program.cs
|
TropoOutboundSMS/Program.cs
|
using System;
using System.Collections.Generic;
using System.Web;
using System.Xml;
using TropoCSharp.Structs;
using TropoCSharp.Tropo;
namespace OutboundTest
{
/// <summary>
/// A simple console appplication used to launch a Tropo Session and send an outbound SMS.
/// Note - use in conjnction withe the OutboundSMS.aspx example in the TropoSamples project.
/// For further information, see http://blog.tropo.com/2011/04/14/sending-outbound-sms-with-c/
/// </summary>
class Program
{
static void Main(string[] args)
{
// The voice and messaging tokens provisioned when your Tropo application is set up.
string voiceToken = "your-voice-token-here";
string messagingToken = "your-messaging-token-here";
// A collection to hold the parameters we want to send to the Tropo Session API.
IDictionary<string, string> parameters = new Dictionary<String, String>();
// Enter a phone number to send a call or SMS message to here.
parameters.Add("numberToDial", "15551112222");
// Enter a phone number to use as the caller ID.
parameters.Add("sendFromNumber", "15551113333");
// Select the channel you want to use via the Channel struct.
string channel = Channel.Text;
parameters.Add("channel", channel);
string network = Network.SMS;
parameters.Add("network", network);
// Message is sent as a query string parameter, make sure it is properly encoded.
parameters.Add("textMessageBody", HttpUtility.UrlEncode("This is a test message from C#."));
// Instantiate a new instance of the Tropo object.
Tropo tropo = new Tropo();
// Create an XML doc to hold the response from the Tropo Session API.
XmlDocument doc = new XmlDocument();
// Set the token to use.
string token = channel == Channel.Text ? messagingToken : voiceToken;
// Load the XML document with the return value of the CreateSession() method call.
doc.Load(tropo.CreateSession(token, parameters));
// Display the results in the console.
Console.WriteLine("Result: " + doc.SelectSingleNode("session/success").InnerText.ToUpper());
Console.WriteLine("Token: " + doc.SelectSingleNode("session/token").InnerText);
Console.Read();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Web;
using System.Xml;
using TropoCSharp.Structs;
using TropoCSharp.Tropo;
namespace OutboundTest
{
/// <summary>
/// A simple console appplication used to launch a Tropo Session and send an outbound SMS.
/// Note - use in conjnction withe the OutboundSMS.aspx example in the TropoSamples project.
/// For further information, see http://blog.tropo.com/2011/04/14/sending-outbound-sms-with-c/
/// </summary>
class Program
{
static void Main(string[] args)
{
// The voice and messaging tokens provisioned when your Tropo application is set up.
string voiceToken = "your-voice-token-here";
string messagingToken = "your-messaging-token-here";
// A collection to hold the parameters we want to send to the Tropo Session API.
IDictionary<string, string> parameters = new Dictionary<String, String>();
// Enter a phone number to send a call or SMS message to here.
parameters.Add("sendToNumber", "15551112222");
// Enter a phone number to use as the caller ID.
parameters.Add("sendFromNumber", "15551113333");
// Select the channel you want to use via the Channel struct.
string channel = Channel.Text;
parameters.Add("channel", channel);
string network = Network.SMS;
parameters.Add("network", network);
// Message is sent as a query string parameter, make sure it is properly encoded.
parameters.Add("msg", HttpUtility.UrlEncode("This is a test message from C#."));
// Instantiate a new instance of the Tropo object.
Tropo tropo = new Tropo();
// Create an XML doc to hold the response from the Tropo Session API.
XmlDocument doc = new XmlDocument();
// Set the token to use.
string token = channel == Channel.Text ? messagingToken : voiceToken;
// Load the XML document with the return value of the CreateSession() method call.
doc.Load(tropo.CreateSession(token, parameters));
// Display the results in the console.
Console.WriteLine("Result: " + doc.SelectSingleNode("session/success").InnerText.ToUpper());
Console.WriteLine("Token: " + doc.SelectSingleNode("session/token").InnerText);
Console.Read();
}
}
}
|
mit
|
C#
|
d63001b975071f446c4ac17c885ad2ffdb860201
|
Use POL.OpenPOLUtilsConfigKey() where applicable. Adjusted retrieval of character name mappings to avoid problems/crashes if the registry entry is somehow not a string value.
|
Zastai/POLUtils
|
PlayOnline.FFXI/Character.cs
|
PlayOnline.FFXI/Character.cs
|
using System;
using System.IO;
using Microsoft.Win32;
using PlayOnline.Core;
namespace PlayOnline.FFXI {
public class Character {
internal Character(string ContentID) {
this.ID_ = ContentID;
this.DataDir_ = Path.Combine(POL.GetApplicationPath(AppID.FFXI), Path.Combine("User", ContentID));
}
#region Data Members
public string ID { get { return this.ID_; } }
public string Name {
get {
string DefaultName = String.Format("Unknown Character ({0})", this.ID_);
string value = null;
using (RegistryKey NameMappings = POL.OpenPOLUtilsConfigKey(true)) {
if (NameMappings != null)
value = NameMappings.GetValue(this.ID_, null) as string;
}
return ((value == null) ? DefaultName : value);
}
set {
using (RegistryKey NameMappings = POL.OpenPOLUtilsConfigKey(true)) {
if (NameMappings != null) {
if (value == null)
NameMappings.DeleteValue(this.ID_, false);
else
NameMappings.SetValue(this.ID_, value);
}
}
}
}
public MacroFolderCollection MacroBars {
get {
if (this.MacroBars_ == null)
this.LoadMacroBars();
return this.MacroBars_;
}
}
#region Private Fields
private string ID_;
private string DataDir_;
private MacroFolderCollection MacroBars_;
#endregion
#endregion
public override string ToString() { return this.Name; }
public FileStream OpenUserFile(string FileName, FileMode Mode, FileAccess Access) {
FileStream Result = null;
try {
Result = new FileStream(Path.Combine(this.DataDir_, FileName), Mode, Access, FileShare.Read);
} catch (Exception E) { Console.WriteLine("{0}", E.ToString()); }
return Result;
}
public void SaveMacroBar(int Index) {
this.MacroBars_[Index].WriteToMacroBar(Path.Combine(this.DataDir_, String.Format("mcr{0:#}.dat", Index)));
}
private void LoadMacroBars() {
this.MacroBars_ = new MacroFolderCollection();
for (int i = 0; i < 10; ++i) {
MacroFolder MF = MacroFolder.LoadFromMacroBar(Path.Combine(this.DataDir_, String.Format("mcr{0:#}.dat", i)));
MF.Name = String.Format(I18N.GetText("MacroBarLabel"), i + 1);
this.MacroBars_.Add(MF);
}
}
}
}
|
using System;
using System.IO;
using Microsoft.Win32;
using PlayOnline.Core;
namespace PlayOnline.FFXI {
public class Character {
internal Character(string ContentID) {
this.ID_ = ContentID;
this.DataDir_ = Path.Combine(POL.GetApplicationPath(AppID.FFXI), Path.Combine("User", ContentID));
}
#region Data Members
public string ID { get { return this.ID_; } }
public string Name {
get {
string value = String.Format("Unknown Character ({0})", this.ID_);
RegistryKey NameMappings = Registry.LocalMachine.OpenSubKey(@"Software\Pebbles\POLUtils\Character Names");
if (NameMappings != null) {
value = NameMappings.GetValue(this.ID_, value) as string;
NameMappings.Close();
}
return value;
}
set {
RegistryKey NameMappings = Registry.LocalMachine.CreateSubKey(@"Software\Pebbles\POLUtils\Character Names");
if (NameMappings != null) {
if (value == null)
NameMappings.DeleteValue(this.ID_, false);
else
NameMappings.SetValue(this.ID_, value);
NameMappings.Close();
}
}
}
public MacroFolderCollection MacroBars {
get {
if (this.MacroBars_ == null)
this.LoadMacroBars();
return this.MacroBars_;
}
}
#region Private Fields
private string ID_;
private string DataDir_;
private MacroFolderCollection MacroBars_;
#endregion
#endregion
public override string ToString() { return this.Name; }
public FileStream OpenUserFile(string FileName, FileMode Mode, FileAccess Access) {
FileStream Result = null;
try {
Result = new FileStream(Path.Combine(this.DataDir_, FileName), Mode, Access, FileShare.Read);
} catch (Exception E) { Console.WriteLine("{0}", E.ToString()); }
return Result;
}
public void SaveMacroBar(int Index) {
this.MacroBars_[Index].WriteToMacroBar(Path.Combine(this.DataDir_, String.Format("mcr{0:#}.dat", Index)));
}
private void LoadMacroBars() {
this.MacroBars_ = new MacroFolderCollection();
for (int i = 0; i < 10; ++i) {
MacroFolder MF = MacroFolder.LoadFromMacroBar(Path.Combine(this.DataDir_, String.Format("mcr{0:#}.dat", i)));
MF.Name = String.Format(I18N.GetText("MacroBarLabel"), i + 1);
this.MacroBars_.Add(MF);
}
}
}
}
|
apache-2.0
|
C#
|
bb6600e8b6a1a6cbd5baf6e432775e29073f7626
|
Simplify network accessing
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/Program.cs
|
WalletWasabi.Gui/Program.cs
|
using Avalonia;
using Avalonia.Threading;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Extensibility.Platforms;
using NBitcoin;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Gui.CommandLine;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
namespace WalletWasabi.Gui
{
internal class Program
{
#pragma warning disable IDE1006 // Naming Styles
private static async Task Main(string[] args)
#pragma warning restore IDE1006 // Naming Styles
{
StatusBarViewModel statusBar = null;
try
{
Platform.BaseDirectory = Path.Combine(Global.DataDir, "Gui");
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
if (!await Daemon.RunAsyncReturnTrueIfContinueWithGuiAsync(args))
{
return;
}
BuildAvaloniaApp()
.BeforeStarting(async builder =>
{
MainWindowViewModel.Instance = new MainWindowViewModel();
await Global.InitializeNoUiAsync();
statusBar = new StatusBarViewModel(Global.Nodes.ConnectedNodes, Global.Synchronizer, Global.UpdateChecker);
MainWindowViewModel.Instance.StatusBar = statusBar;
if (Global.Network != Network.Main)
{
MainWindowViewModel.Instance.Title += $" - {Global.Network}";
}
Dispatcher.UIThread.Post(() =>
{
GC.Collect();
});
}).StartShellApp<AppBuilder, MainWindow>("Wasabi Wallet", null, () => MainWindowViewModel.Instance);
}
catch (Exception ex)
{
Logger.LogCritical<Program>(ex);
throw;
}
finally
{
statusBar?.Dispose();
await Global.DisposeAsync();
AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException -= TaskScheduler_UnobservedTaskException;
Logger.LogInfo($"Wasabi stopped gracefully.", Logger.InstanceGuid.ToString());
}
}
private static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
{
Logger.LogWarning(e?.Exception, "UnobservedTaskException");
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Logger.LogWarning(e?.ExceptionObject as Exception, "UnhandledException");
}
private static AppBuilder BuildAvaloniaApp()
{
var result = AppBuilder.Configure<App>();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
result
.UseWin32(true, true)
.UseSkia();
}
else
{
result.UsePlatformDetect();
}
return result;
}
}
}
|
using Avalonia;
using Avalonia.Threading;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Extensibility.Platforms;
using NBitcoin;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Gui.CommandLine;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
namespace WalletWasabi.Gui
{
internal class Program
{
#pragma warning disable IDE1006 // Naming Styles
private static async Task Main(string[] args)
#pragma warning restore IDE1006 // Naming Styles
{
StatusBarViewModel statusBar = null;
try
{
Platform.BaseDirectory = Path.Combine(Global.DataDir, "Gui");
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
if (!await Daemon.RunAsyncReturnTrueIfContinueWithGuiAsync(args))
{
return;
}
BuildAvaloniaApp()
.BeforeStarting(async builder =>
{
MainWindowViewModel.Instance = new MainWindowViewModel();
await Global.InitializeNoUiAsync();
statusBar = new StatusBarViewModel(Global.Nodes.ConnectedNodes, Global.Synchronizer, Global.UpdateChecker);
MainWindowViewModel.Instance.StatusBar = statusBar;
if (Global.Synchronizer.Network != Network.Main)
{
MainWindowViewModel.Instance.Title += $" - {Global.Synchronizer.Network}";
}
Dispatcher.UIThread.Post(() =>
{
GC.Collect();
});
}).StartShellApp<AppBuilder, MainWindow>("Wasabi Wallet", null, () => MainWindowViewModel.Instance);
}
catch (Exception ex)
{
Logger.LogCritical<Program>(ex);
throw;
}
finally
{
statusBar?.Dispose();
await Global.DisposeAsync();
AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException -= TaskScheduler_UnobservedTaskException;
Logger.LogInfo($"Wasabi stopped gracefully.", Logger.InstanceGuid.ToString());
}
}
private static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
{
Logger.LogWarning(e?.Exception, "UnobservedTaskException");
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Logger.LogWarning(e?.ExceptionObject as Exception, "UnhandledException");
}
private static AppBuilder BuildAvaloniaApp()
{
var result = AppBuilder.Configure<App>();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
result
.UseWin32(true, true)
.UseSkia();
}
else
{
result.UsePlatformDetect();
}
return result;
}
}
}
|
mit
|
C#
|
78a4ccdae6ed3afd6680b3bbddd65808c04df158
|
Rename some unit tests.
|
DavidLievrouw/OwinRequestScopeContext
|
src/OwinRequestScopeContext.Tests/AppBuilderExtensionsFixture.cs
|
src/OwinRequestScopeContext.Tests/AppBuilderExtensionsFixture.cs
|
#if NETFRAMEWORK
using System;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using Owin;
using FakeItEasy;
namespace DavidLievrouw.OwinRequestScopeContext {
[TestFixture]
public class AppBuilderExtensionsFixture {
[TestFixture]
public class UseRequestScopeContext : AppBuilderExtensionsFixture {
IAppBuilder _app;
[SetUp]
public void SetUp() {
_app = A.Fake<IAppBuilder>();
}
[Test]
public void UsesExpectedMiddlewareWithSpecifiedOptions() {
var options = new OwinRequestScopeContextOptions {
ItemKeyEqualityComparer = StringComparer.Ordinal
};
_app.UseRequestScopeContext(options);
A.CallTo(() => _app.Use(typeof(OwinRequestScopeContextMiddleware), options)).MustHaveHappened();
}
[Test]
[SuppressMessage("ReSharper", "ExpressionIsAlwaysNull")]
public void GivenNullOptions_UsesDefaultOptions() {
OwinRequestScopeContextOptions nullOptions = null;
_app.UseRequestScopeContext(nullOptions);
A.CallTo(() => _app.Use(typeof(OwinRequestScopeContextMiddleware), OwinRequestScopeContextOptions.Default))
.MustHaveHappened();
}
[Test]
public void GivenNoOptions_UsesDefaultOptions() {
_app.UseRequestScopeContext();
A.CallTo(() => _app.Use(typeof(OwinRequestScopeContextMiddleware), OwinRequestScopeContextOptions.Default))
.MustHaveHappened();
}
}
}
}
#endif
|
#if NETFRAMEWORK
using System;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using Owin;
using FakeItEasy;
namespace DavidLievrouw.OwinRequestScopeContext {
[TestFixture]
public class AppBuilderExtensionsFixture {
[TestFixture]
public class UseRequestScopeContext : AppBuilderExtensionsFixture {
IAppBuilder _app;
[SetUp]
public void SetUp() {
_app = A.Fake<IAppBuilder>();
}
[Test]
public void UseExpectedMiddlewareWithSpecifiedOptions() {
var options = new OwinRequestScopeContextOptions {
ItemKeyEqualityComparer = StringComparer.Ordinal
};
_app.UseRequestScopeContext(options);
A.CallTo(() => _app.Use(typeof(OwinRequestScopeContextMiddleware), options)).MustHaveHappened();
}
[Test]
[SuppressMessage("ReSharper", "ExpressionIsAlwaysNull")]
public void GivenNullOptions_UseDefaultOptions() {
OwinRequestScopeContextOptions nullOptions = null;
_app.UseRequestScopeContext(nullOptions);
A.CallTo(() => _app.Use(typeof(OwinRequestScopeContextMiddleware), OwinRequestScopeContextOptions.Default))
.MustHaveHappened();
}
[Test]
public void GivenNoOptions_UseExpectedMiddlewareWithDefaultOptions() {
_app.UseRequestScopeContext();
A.CallTo(() => _app.Use(typeof(OwinRequestScopeContextMiddleware), OwinRequestScopeContextOptions.Default))
.MustHaveHappened();
}
}
}
}
#endif
|
mit
|
C#
|
ae2afbd735995ed9cbf0d82a9417ebad1839cbaa
|
Allow page on submit to be null
|
TimGeyssens/MCFly,TimGeyssens/MCFly,TimGeyssens/MCFly
|
MCFly/Core/Form.cs
|
MCFly/Core/Form.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace MCFly.Core
{
[TableName("MCFlyForms")]
[PrimaryKey("Id", autoIncrement = true)]
[ExplicitColumns]
[DataContract(Name = "form", Namespace = "")]
public class Form
{
[Column("Id")]
[PrimaryKeyColumn(AutoIncrement = true)]
[DataMember(Name = "id")]
public int Id { get; set; }
[Column("Name")]
[DataMember(Name = "name")]
public string Name { get; set; }
[Column("Alias")]
[DataMember(Name = "alias")]
public string Alias { get; set; }
[Ignore]
[DataMember(Name = "fields")]
public IList<Field> Fields { get; set; }
[Column("RequiredErrorMessage")]
[DataMember(Name = "requiredErrorMessage")]
public string RequiredErrorMessage { get; set; }
[Column("InvalidErrorMessage")]
[DataMember(Name = "invalidErrorMessage")]
public string InvalidErrorMessage { get; set; }
[Column("SubmitButtonCaption")]
[DataMember(Name = "submitButtonCaption")]
public string SubmitButtonCaption { get; set; }
[Column("MessageOnSubmit")]
[DataMember(Name = "messageOnSubmit")]
public string MessageOnSubmit { get; set; }
[Column("GoToPageOnSubmit")]
[DataMember(Name = "goToPageOnSubmit")]
[NullSetting(NullSetting =NullSettings.Null)]
public int GoToPageOnSubmit { get; set; }
[Column("StoresData")]
[DataMember(Name = "storesData")]
public bool StoresData { get; set; }
[Column("WebHookUrl")]
[DataMember(Name="webHookUrl")]
public string WebHookUrl { get; set; }
[Ignore]
[DataMember(Name = "emails")]
public IList<Core.Email> Emails { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace MCFly.Core
{
[TableName("MCFlyForms")]
[PrimaryKey("Id", autoIncrement = true)]
[ExplicitColumns]
[DataContract(Name = "form", Namespace = "")]
public class Form
{
[Column("Id")]
[PrimaryKeyColumn(AutoIncrement = true)]
[DataMember(Name = "id")]
public int Id { get; set; }
[Column("Name")]
[DataMember(Name = "name")]
public string Name { get; set; }
[Column("Alias")]
[DataMember(Name = "alias")]
public string Alias { get; set; }
[Ignore]
[DataMember(Name = "fields")]
public IList<Field> Fields { get; set; }
[Column("RequiredErrorMessage")]
[DataMember(Name = "requiredErrorMessage")]
public string RequiredErrorMessage { get; set; }
[Column("InvalidErrorMessage")]
[DataMember(Name = "invalidErrorMessage")]
public string InvalidErrorMessage { get; set; }
[Column("SubmitButtonCaption")]
[DataMember(Name = "submitButtonCaption")]
public string SubmitButtonCaption { get; set; }
[Column("MessageOnSubmit")]
[DataMember(Name = "messageOnSubmit")]
public string MessageOnSubmit { get; set; }
[Column("GoToPageOnSubmit")]
[DataMember(Name = "goToPageOnSubmit")]
public int GoToPageOnSubmit { get; set; }
[Column("StoresData")]
[DataMember(Name = "storesData")]
public bool StoresData { get; set; }
[Column("WebHookUrl")]
[DataMember(Name="webHookUrl")]
public string WebHookUrl { get; set; }
[Ignore]
[DataMember(Name = "emails")]
public IList<Core.Email> Emails { get; set; }
}
}
|
mit
|
C#
|
ca6857447345d4dc35aadeba1241f91b63dcc645
|
Make `NotificationOverlay` dependency optional in `CollectionSettings`
|
ppy/osu,ppy/osu,ppy/osu,peppy/osu,peppy/osu,peppy/osu
|
osu.Game/Overlays/Settings/Sections/Maintenance/CollectionsSettings.cs
|
osu.Game/Overlays/Settings/Sections/Maintenance/CollectionsSettings.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Localisation;
using osu.Game.Collections;
using osu.Game.Database;
using osu.Game.Localisation;
using osu.Game.Overlays.Notifications;
namespace osu.Game.Overlays.Settings.Sections.Maintenance
{
public class CollectionsSettings : SettingsSubsection
{
protected override LocalisableString Header => "Collections";
private SettingsButton importCollectionsButton = null!;
[Resolved]
private RealmAccess realm { get; set; } = null!;
[Resolved]
private INotificationOverlay? notificationOverlay { get; set; }
[BackgroundDependencyLoader]
private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
{
if (legacyImportManager?.SupportsImportFromStable == true)
{
Add(importCollectionsButton = new SettingsButton
{
Text = MaintenanceSettingsStrings.ImportCollectionsFromStable,
Action = () =>
{
importCollectionsButton.Enabled.Value = false;
legacyImportManager.ImportFromStableAsync(StableContent.Collections).ContinueWith(_ => Schedule(() => importCollectionsButton.Enabled.Value = true));
}
});
}
Add(new DangerousSettingsButton
{
Text = MaintenanceSettingsStrings.DeleteAllCollections,
Action = () =>
{
dialogOverlay?.Push(new MassDeleteConfirmationDialog(deleteAllCollections));
}
});
}
private void deleteAllCollections()
{
realm.Write(r => r.RemoveAll<BeatmapCollection>());
notificationOverlay?.Post(new ProgressCompletionNotification { Text = "Deleted all collections!" });
}
}
}
|
// 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.Localisation;
using osu.Game.Collections;
using osu.Game.Database;
using osu.Game.Localisation;
using osu.Game.Overlays.Notifications;
namespace osu.Game.Overlays.Settings.Sections.Maintenance
{
public class CollectionsSettings : SettingsSubsection
{
protected override LocalisableString Header => "Collections";
private SettingsButton importCollectionsButton = null!;
[Resolved]
private RealmAccess realm { get; set; } = null!;
[Resolved]
private INotificationOverlay notificationOverlay { get; set; } = null!;
[BackgroundDependencyLoader]
private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
{
if (legacyImportManager?.SupportsImportFromStable == true)
{
Add(importCollectionsButton = new SettingsButton
{
Text = MaintenanceSettingsStrings.ImportCollectionsFromStable,
Action = () =>
{
importCollectionsButton.Enabled.Value = false;
legacyImportManager.ImportFromStableAsync(StableContent.Collections).ContinueWith(_ => Schedule(() => importCollectionsButton.Enabled.Value = true));
}
});
}
Add(new DangerousSettingsButton
{
Text = MaintenanceSettingsStrings.DeleteAllCollections,
Action = () =>
{
dialogOverlay?.Push(new MassDeleteConfirmationDialog(deleteAllCollections));
}
});
}
private void deleteAllCollections()
{
realm.Write(r => r.RemoveAll<BeatmapCollection>());
notificationOverlay.Post(new ProgressCompletionNotification { Text = "Deleted all collections!" });
}
}
}
|
mit
|
C#
|
87ef59bcfd4288da62a78ff33b237762a6e368a5
|
Correct display of B5 and B3 in StatusFlags.ToString()
|
eightlittlebits/elbsms
|
elbsms_core/CPU/StatusFlags.cs
|
elbsms_core/CPU/StatusFlags.cs
|
using System.Text;
namespace elbsms_core.CPU
{
struct StatusFlags
{
public const int S = 0b1000_0000;
public const int Z = 0b0100_0000;
public const int B5 = 0b0010_0000;
public const int H = 0b0001_0000;
public const int B3 = 0b0000_1000;
public const int P = 0b0000_0100;
public const int V = 0b0000_0100;
public const int N = 0b0000_0010;
public const int C = 0b0000_0001;
private byte _flags;
public StatusFlags(int i)
{
_flags = (byte)i;
}
public bool this[int bit]
{
get => (_flags & bit) == bit;
set
{
if (value)
{
_flags |= (byte)bit;
}
else
{
_flags &= (byte)~bit;
}
}
}
public static implicit operator byte(StatusFlags b) => b._flags;
public static implicit operator StatusFlags(int i) => new StatusFlags(i);
public override string ToString()
{
StringBuilder sb = new StringBuilder(8);
sb.Append(this[S] ? 'S' : '-');
sb.Append(this[Z] ? 'Z' : '-');
sb.Append(this[B5] ? '5' : '-');
sb.Append(this[H] ? 'H' : '-');
sb.Append(this[B3] ? '3' : '-');
sb.Append(this[P] ? 'P' : '-');
sb.Append(this[N] ? 'N' : '-');
sb.Append(this[C] ? 'C' : '-');
return sb.ToString();
}
}
}
|
using System.Text;
namespace elbsms_core.CPU
{
struct StatusFlags
{
public const int S = 0b1000_0000;
public const int Z = 0b0100_0000;
public const int B5 = 0b0010_0000;
public const int H = 0b0001_0000;
public const int B3 = 0b0000_1000;
public const int P = 0b0000_0100;
public const int V = 0b0000_0100;
public const int N = 0b0000_0010;
public const int C = 0b0000_0001;
private byte _flags;
public StatusFlags(int i)
{
_flags = (byte)i;
}
public bool this[int bit]
{
get => (_flags & bit) == bit;
set
{
if (value)
{
_flags |= (byte)bit;
}
else
{
_flags &= (byte)~bit;
}
}
}
public static implicit operator byte(StatusFlags b) => b._flags;
public static implicit operator StatusFlags(int i) => new StatusFlags(i);
public override string ToString()
{
StringBuilder sb = new StringBuilder(8);
sb.Append(this[S] ? 'S' : '-');
sb.Append(this[Z] ? 'Z' : '-');
sb.Append(this[S] ? '5' : '-');
sb.Append(this[H] ? 'H' : '-');
sb.Append(this[S] ? '3' : '-');
sb.Append(this[P] ? 'P' : '-');
sb.Append(this[N] ? 'N' : '-');
sb.Append(this[C] ? 'C' : '-');
return sb.ToString();
}
}
}
|
mit
|
C#
|
8417ebd77f63feb2ee4c66b348cae5e84292e0a4
|
add rename explanation.
|
amiralles/contest,amiralles/contest
|
src/Contest.Demo/Demo.cs
|
src/Contest.Demo/Demo.cs
|
namespace Demo { //It doesn't match naming conventions but it reads better in the console ;)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _ = System.Action<Contest.Core.Runner>;
// ReSharper disable UnusedMember.Local
class Contest_101 {
_ this_is_a_passing_test = assert =>
assert.Equal(4, 2 + 2);
_ this_is_a_failing_test = assert =>
assert.Equal(5, 2 + 2);
_ this_is_a__should_throw__passing_test = test =>
test.ShouldThrow<NullReferenceException>(() => {
object target = null;
var dummy = target.ToString();
});
_ this_is_a__should_throw__failing_test = test =>
test.ShouldThrow<NullReferenceException>(() => {
//It doesn't throws; So it fails.
});
}
class Contest_201 {
_ before_each = test => {
User.Create("pipe");
User.Create("vilmis");
User.Create("amiralles");
};
_ after_each = test =>
User.Reset();
_ find_existing_user_returns_user = assert =>
assert.IsNotNull(User.Find("pipe"));
_ find_non_existing_user_returns_null = assert =>
assert.IsNull(User.Find("not exists"));
_ create_user_adds_new_user = assert => {
User.Create("foo");
assert.Equal(4, User.Count());
};
}
class Contest_301 {
// setup
_ before_echo = test =>
test.Bag["msg"] = "Hello World!";
//cleanup
_ after_echo = test =>
test.Bag["msg"] = null;
//actual test
_ echo = test =>
test.Equal("Hello World!", Utils.Echo(test.Bag["msg"]));
}
class Utils {
public static Func<object, object> Echo = msg => msg;
}
public class User {
static readonly List<string> _users = new List<string>();
public static Action Reset = () => _users.Clear();
public static Action<string> Create = name => _users.Add(name);
public static Func<int> Count = () => _users.Count;
public static Func<string, object> Find = name =>
_users.FirstOrDefault(u => u == name);
}
}
|
namespace Demo { //It doesn't match naming conventions but looks clear in the console ;)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _ = System.Action<Contest.Core.Runner>;
// ReSharper disable UnusedMember.Local
class Contest_101 {
_ this_is_a_passing_test = assert =>
assert.Equal(4, 2 + 2);
_ this_is_a_failing_test = assert =>
assert.Equal(5, 2 + 2);
_ this_is_a__should_throw__passing_test = test =>
test.ShouldThrow<NullReferenceException>(() => {
object target = null;
var dummy = target.ToString();
});
_ this_is_a__should_throw__failing_test = test =>
test.ShouldThrow<NullReferenceException>(() => {
//It doesn't throws; So it fails.
});
}
class Contest_201 {
_ before_each = test => {
User.Create("pipe");
User.Create("vilmis");
User.Create("amiralles");
};
_ after_each = test =>
User.Reset();
_ find_existing_user_returns_user = assert =>
assert.IsNotNull(User.Find("pipe"));
_ find_non_existing_user_returns_null = assert =>
assert.IsNull(User.Find("not exists"));
_ create_user_adds_new_user = assert => {
User.Create("foo");
assert.Equal(4, User.Count());
};
}
class Contest_301 {
// setup
_ before_echo = test =>
test.Bag["msg"] = "Hello World!";
//cleanup
_ after_echo = test =>
test.Bag["msg"] = null;
//actual test
_ echo = test =>
test.Equal("Hello World!", Utils.Echo(test.Bag["msg"]));
}
class Utils {
public static Func<object, object> Echo = msg => msg;
}
public class User {
static readonly List<string> _users = new List<string>();
public static Action Reset = () => _users.Clear();
public static Action<string> Create = name => _users.Add(name);
public static Func<int> Count = () => _users.Count;
public static Func<string, object> Find = name =>
_users.FirstOrDefault(u => u == name);
}
}
|
mit
|
C#
|
da14c6509237787fb36ec0b8a844d1065d496c16
|
Move SharpDX to next minor verison 2.5.1
|
manu-silicon/SharpDX,TigerKO/SharpDX,wyrover/SharpDX,davidlee80/SharpDX-1,TechPriest/SharpDX,davidlee80/SharpDX-1,PavelBrokhman/SharpDX,waltdestler/SharpDX,fmarrabal/SharpDX,Ixonos-USA/SharpDX,dazerdude/SharpDX,andrewst/SharpDX,wyrover/SharpDX,fmarrabal/SharpDX,RobyDX/SharpDX,jwollen/SharpDX,fmarrabal/SharpDX,Ixonos-USA/SharpDX,davidlee80/SharpDX-1,RobyDX/SharpDX,sharpdx/SharpDX,manu-silicon/SharpDX,fmarrabal/SharpDX,jwollen/SharpDX,VirusFree/SharpDX,VirusFree/SharpDX,weltkante/SharpDX,mrvux/SharpDX,PavelBrokhman/SharpDX,sharpdx/SharpDX,TigerKO/SharpDX,TechPriest/SharpDX,weltkante/SharpDX,Ixonos-USA/SharpDX,mrvux/SharpDX,wyrover/SharpDX,manu-silicon/SharpDX,TechPriest/SharpDX,dazerdude/SharpDX,PavelBrokhman/SharpDX,RobyDX/SharpDX,waltdestler/SharpDX,wyrover/SharpDX,weltkante/SharpDX,VirusFree/SharpDX,Ixonos-USA/SharpDX,sharpdx/SharpDX,VirusFree/SharpDX,jwollen/SharpDX,RobyDX/SharpDX,andrewst/SharpDX,TechPriest/SharpDX,PavelBrokhman/SharpDX,waltdestler/SharpDX,dazerdude/SharpDX,TigerKO/SharpDX,andrewst/SharpDX,manu-silicon/SharpDX,jwollen/SharpDX,weltkante/SharpDX,waltdestler/SharpDX,dazerdude/SharpDX,davidlee80/SharpDX-1,mrvux/SharpDX,TigerKO/SharpDX
|
Source/SharedAssemblyInfo.cs
|
Source/SharedAssemblyInfo.cs
|
// Copyright (c) 2010-2013 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly:AssemblyCompany("Alexandre Mutel")]
[assembly:AssemblyCopyright("Copyright © 2010-2013 Alexandre Mutel")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly:AssemblyVersion("2.5.1")]
[assembly:AssemblyFileVersion("2.5.1")]
[assembly: NeutralResourcesLanguage("en-us")]
#if DEBUG
[assembly:AssemblyConfiguration("Debug")]
#else
[assembly:AssemblyConfiguration("Release")]
#endif
[assembly:ComVisible(false)]
|
// Copyright (c) 2010-2013 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly:AssemblyCompany("Alexandre Mutel")]
[assembly:AssemblyCopyright("Copyright © 2010-2013 Alexandre Mutel")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly:AssemblyVersion("2.5.0")]
[assembly:AssemblyFileVersion("2.5.0")]
[assembly: NeutralResourcesLanguage("en-us")]
#if DEBUG
[assembly:AssemblyConfiguration("Debug")]
#else
[assembly:AssemblyConfiguration("Release")]
#endif
[assembly:ComVisible(false)]
|
mit
|
C#
|
3481a5fd19025c5e3b1f1fecbed1f99868238212
|
Fix wording
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer/Views/Stores/ImportWallet/File.cshtml
|
BTCPayServer/Views/Stores/ImportWallet/File.cshtml
|
@model WalletSetupViewModel
@addTagHelper *, BundlerMinifier.TagHelpers
@{
Layout = "_LayoutWalletSetup";
ViewData["Title"] = "Import your wallet file";
}
@section Navbar {
<a asp-controller="Stores" asp-action="ImportWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="@Model.CryptoCode" asp-route-method="">
<vc:icon symbol="back" />
</a>
}
<header class="text-center">
<h1>@ViewData["Title"]</h1>
<p class="lead text-secondary mt-3">Upload the file exported from your wallet.</p>
</header>
<form method="post" enctype="multipart/form-data" class="my-5">
<div class="form-group">
<label asp-for="WalletFile"></label>
<input asp-for="WalletFile" type="file" class="form-control-file" required>
<span asp-validation-for="WalletFile" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Continue</button>
</form>
<table class="table table-sm">
<thead>
<tr>
<th>Wallet</th>
<th>Instructions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-nowrap">Cobo Vault</td>
<td>Settings ❯ Watch-Only Wallet ❯ BTCPay ❯ Export Wallet</td>
</tr>
<tr>
<td>ColdCard</td>
<td>Advanced ❯ MicroSD Card ❯ Electrum Wallet</td>
</tr>
<tr>
<td>Electrum</td>
<td>File ❯ Save backup (not encrypted with a password)</td>
</tr>
<tr>
<td>Wasabi</td>
<td>Tools ❯ Wallet Manager ❯ Open Wallets Folder</td>
</tr>
<tr>
<td class="text-nowrap">Specter Desktop</td>
<td>Wallet ❯ Settings ❯ Export ❯ Export To Wallet Software ❯ Save wallet file</td>
</tr>
</tbody>
</table>
|
@model WalletSetupViewModel
@addTagHelper *, BundlerMinifier.TagHelpers
@{
Layout = "_LayoutWalletSetup";
ViewData["Title"] = "Import your wallet file";
}
@section Navbar {
<a asp-controller="Stores" asp-action="ImportWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="@Model.CryptoCode" asp-route-method="">
<vc:icon symbol="back" />
</a>
}
<header class="text-center">
<h1>@ViewData["Title"]</h1>
<p class="lead text-secondary mt-3">Upload the file exported from your wallet.</p>
</header>
<form method="post" enctype="multipart/form-data" class="my-5">
<div class="form-group">
<label asp-for="WalletFile"></label>
<input asp-for="WalletFile" type="file" class="form-control-file" required>
<span asp-validation-for="WalletFile" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Continue</button>
</form>
<table class="table table-sm">
<thead>
<tr>
<th>Wallet</th>
<th>Instructions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-nowrap">Cobo Vault</td>
<td>Settings ❯ Watch-Only Wallet ❯ BTCPay ❯ Export Wallet</td>
</tr>
<tr>
<td>ColdCard</td>
<td>Advanced ❯ MicroSD Card ❯ Electrum Wallet</td>
</tr>
<tr>
<td>Electrum</td>
<td>File ❯ Save backup (not encrypted with a password)</td>
</tr>
<tr>
<td>Wasabi</td>
<td>Tools ❯ Wallet Manager ❯ Open Wallets Folder</td>
</tr>
<tr>
<td>Specter</td>
<td><kbd>Wallet ❯ Settings ❯ Export ❯ Export To Wallet Software ❯ Save wallet file</kbd></td>
</tr>
</tbody>
</table>
|
mit
|
C#
|
00390909bd1b85088ff00edb340cf0bebba84539
|
Add ToPlayer for GenericPosition
|
bawNg/Oxide,Nogrod/Oxide-2,Nogrod/Oxide-2,bawNg/Oxide,LaserHydra/Oxide,LaserHydra/Oxide,Visagalis/Oxide,Visagalis/Oxide
|
Oxide.Core/Libraries/Covalence/IPlayerCharacter.cs
|
Oxide.Core/Libraries/Covalence/IPlayerCharacter.cs
|
namespace Oxide.Core.Libraries.Covalence
{
/// <summary>
/// Represents a position of a point in 3D space
/// </summary>
public struct GenericPosition
{
public readonly float X, Y, Z;
public GenericPosition(float x, float y, float z)
{
X = x; Y = y; Z = z;
}
public override string ToString() => $"({X}, {Y}, {Z})";
}
/// <summary>
/// Represents a generic character controlled by a player
/// </summary>
public interface IPlayerCharacter
{
/// <summary>
/// Gets the owner of this character
/// </summary>
ILivePlayer Owner { get; }
/// <summary>
/// Gets the object that backs this character, if available
/// </summary>
object Object { get; }
/// <summary>
/// Gets the position of this character
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="z"></param>
void GetPosition(out float x, out float y, out float z);
/// <summary>
/// Gets the position of this character
/// </summary>
/// <returns></returns>
GenericPosition GetPosition();
#region Manipulation
/// <summary>
/// Causes this character to die
/// </summary>
void Kill();
/// <summary>
/// Teleports this character to the specified position
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="z"></param>
void Teleport(float x, float y, float z);
#endregion
}
}
|
namespace Oxide.Core.Libraries.Covalence
{
/// <summary>
/// Represents a position of a point in 3D space
/// </summary>
public struct GenericPosition
{
public readonly float X, Y, Z;
public GenericPosition(float x, float y, float z)
{
X = x; Y = y; Z = z;
}
}
/// <summary>
/// Represents a generic character controlled by a player
/// </summary>
public interface IPlayerCharacter
{
/// <summary>
/// Gets the owner of this character
/// </summary>
ILivePlayer Owner { get; }
/// <summary>
/// Gets the object that backs this character, if available
/// </summary>
object Object { get; }
/// <summary>
/// Gets the position of this character
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="z"></param>
void GetPosition(out float x, out float y, out float z);
/// <summary>
/// Gets the position of this character
/// </summary>
/// <returns></returns>
GenericPosition GetPosition();
#region Manipulation
/// <summary>
/// Causes this character to die
/// </summary>
void Kill();
/// <summary>
/// Teleports this character to the specified position
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="z"></param>
void Teleport(float x, float y, float z);
#endregion
}
}
|
mit
|
C#
|
7419a2a5a54b0d4d9d54df4fdeaa4cb0682a2aed
|
Remove inheritdoc from BaseHttpServer
|
SnowflakePowered/snowflake,SnowflakePowered/snowflake,RonnChyran/snowflake,faint32/snowflake-1,RonnChyran/snowflake,faint32/snowflake-1,RonnChyran/snowflake,SnowflakePowered/snowflake,faint32/snowflake-1
|
Snowflake.API/Service/HttpServer/BaseHttpServer.cs
|
Snowflake.API/Service/HttpServer/BaseHttpServer.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mono.Net;
using System.Threading;
namespace Snowflake.Service.HttpServer
{
public abstract class BaseHttpServer : IBaseHttpServer
{
HttpListener serverListener;
Thread serverThread;
bool cancel;
public BaseHttpServer(int port)
{
serverListener = new HttpListener();
serverListener.Prefixes.Add("http://localhost:" + port.ToString() + "/");
}
void IBaseHttpServer.StartServer()
{
this.serverThread = new Thread(
() =>
{
serverListener.Start();
while (!this.cancel)
{
HttpListenerContext context = serverListener.GetContext();
Task.Run(() => this.Process(context));
}
}
);
this.serverThread.IsBackground = true;
this.serverThread.Start();
}
void IBaseHttpServer.StopServer()
{
this.cancel = true;
this.serverListener.Abort();
this.serverThread.Abort();
this.serverListener = null;
this.serverThread = null;
}
/// <summary>
/// Implement this to handle the process loop
/// </summary>
/// <param name="context">The HTTP context of the server listener</param>
/// <returns>A Task that is called asynchronously that outputs a stream of text to be written as the HttpResponse</returns>
/// <see cref="Snowflake.Service.Server"/> for example implementations
protected abstract Task Process(HttpListenerContext context);
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mono.Net;
using System.Threading;
namespace Snowflake.Service.HttpServer
{
/// <inheritdoc/>
public abstract class BaseHttpServer : IBaseHttpServer
{
HttpListener serverListener;
Thread serverThread;
bool cancel;
public BaseHttpServer(int port)
{
serverListener = new HttpListener();
serverListener.Prefixes.Add("http://localhost:" + port.ToString() + "/");
}
void IBaseHttpServer.StartServer()
{
this.serverThread = new Thread(
() =>
{
serverListener.Start();
while (!this.cancel)
{
HttpListenerContext context = serverListener.GetContext();
Task.Run(() => this.Process(context));
}
}
);
this.serverThread.IsBackground = true;
this.serverThread.Start();
}
void IBaseHttpServer.StopServer()
{
this.cancel = true;
this.serverListener.Abort();
this.serverThread.Abort();
this.serverListener = null;
this.serverThread = null;
}
/// <summary>
/// Implement this to handle the process loop
/// </summary>
/// <param name="context">The HTTP context of the server listener</param>
/// <returns>A Task that is called asynchronously that outputs a stream of text to be written as the HttpResponse</returns>
/// <see cref="Snowflake.Service.Server"/> for example implementations
protected abstract Task Process(HttpListenerContext context);
}
}
|
mpl-2.0
|
C#
|
060abba55721416aec1eef2ffef41429957d0e80
|
Remove unused
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/CommandLine/CommandInterpreter.cs
|
WalletWasabi.Gui/CommandLine/CommandInterpreter.cs
|
using Mono.Options;
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
namespace WalletWasabi.Gui.CommandLine
{
public static class CommandInterpreter
{
/// <returns>If the GUI should run or not.</returns>
public static async Task<bool> ExecuteCommandsAsync(Global global, string[] args)
{
var showHelp = false;
var showVersion = false;
var daemon = new Daemon(global);
if (args.Length == 0)
{
return true;
}
OptionSet options = null;
var suite = new CommandSet("wassabee")
{
"Usage: wassabee [OPTIONS]+",
"Launches Wasabi Wallet.",
"",
{ "h|help", "Displays help page and exit.", x => showHelp = x != null },
{ "v|version", "Displays Wasabi version and exit.", x => showVersion = x != null },
"",
"Available commands are:",
"",
new MixerCommand(daemon),
new PasswordFinderCommand(global.WalletManager)
};
EnsureBackwardCompatibilityWithOldParameters(ref args);
if (await suite.RunAsync(args) == 0)
{
return false;
}
if (showHelp)
{
ShowHelp(options);
return false;
}
else if (showVersion)
{
ShowVersion();
return false;
}
return false;
}
private static void EnsureBackwardCompatibilityWithOldParameters(ref string[] args)
{
var listArgs = args.ToList();
if (listArgs.Remove("--mix") || listArgs.Remove("-m"))
{
listArgs.Insert(0, "mix");
}
args = listArgs.ToArray();
}
private static void ShowVersion()
{
Console.WriteLine($"Wasabi Client Version: {Constants.ClientVersion}");
Console.WriteLine($"Compatible Coordinator Version: {Constants.ClientSupportBackendVersionText}");
Console.WriteLine($"Compatible Bitcoin Core and Bitcoin Knots Versions: {Constants.BitcoinCoreVersion}");
Console.WriteLine($"Compatible Hardware Wallet Interface Version: {Constants.HwiVersion}");
}
private static void ShowHelp(OptionSet p)
{
ShowVersion();
Console.WriteLine();
Console.WriteLine("Usage: wassabee [OPTIONS]+");
Console.WriteLine("Launches Wasabi Wallet.");
Console.WriteLine();
Console.WriteLine("Options:");
p.WriteOptionDescriptions(Console.Out);
}
}
}
|
using Mono.Options;
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
using WalletWasabi.WebClients.Wasabi;
namespace WalletWasabi.Gui.CommandLine
{
public static class CommandInterpreter
{
/// <returns>If the GUI should run or not.</returns>
public static async Task<bool> ExecuteCommandsAsync(Global global, string[] args)
{
var showHelp = false;
var showVersion = false;
var daemon = new Daemon(global);
if (args.Length == 0)
{
return true;
}
OptionSet options = null;
var suite = new CommandSet("wassabee")
{
"Usage: wassabee [OPTIONS]+",
"Launches Wasabi Wallet.",
"",
{ "h|help", "Displays help page and exit.", x => showHelp = x != null },
{ "v|version", "Displays Wasabi version and exit.", x => showVersion = x != null },
"",
"Available commands are:",
"",
new MixerCommand(daemon),
new PasswordFinderCommand(global.WalletManager)
};
EnsureBackwardCompatibilityWithOldParameters(ref args);
if (await suite.RunAsync(args) == 0)
{
return false;
}
if (showHelp)
{
ShowHelp(options);
return false;
}
else if (showVersion)
{
ShowVersion();
return false;
}
return false;
}
private static void EnsureBackwardCompatibilityWithOldParameters(ref string[] args)
{
var listArgs = args.ToList();
if (listArgs.Remove("--mix") || listArgs.Remove("-m"))
{
listArgs.Insert(0, "mix");
}
args = listArgs.ToArray();
}
private static void ShowVersion()
{
Console.WriteLine($"Wasabi Client Version: {Constants.ClientVersion}");
Console.WriteLine($"Compatible Coordinator Version: {Constants.ClientSupportBackendVersionText}");
Console.WriteLine($"Compatible Bitcoin Core and Bitcoin Knots Versions: {Constants.BitcoinCoreVersion}");
Console.WriteLine($"Compatible Hardware Wallet Interface Version: {Constants.HwiVersion}");
}
private static void ShowHelp(OptionSet p)
{
ShowVersion();
Console.WriteLine();
Console.WriteLine("Usage: wassabee [OPTIONS]+");
Console.WriteLine("Launches Wasabi Wallet.");
Console.WriteLine();
Console.WriteLine("Options:");
p.WriteOptionDescriptions(Console.Out);
}
}
}
|
mit
|
C#
|
5083173b24b661579f359b2d5340263f4ad5587c
|
Use new OAID reading method
|
adjust/unity_sdk,adjust/unity_sdk,adjust/unity_sdk
|
Assets/AdjustOaid/Android/AdjustOaidAndroid.cs
|
Assets/AdjustOaid/Android/AdjustOaidAndroid.cs
|
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace com.adjust.sdk.oaid
{
#if UNITY_ANDROID
public class AdjustOaidAndroid
{
private static AndroidJavaClass ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
public static void ReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("readOaid", ajoCurrentActivity);
}
public static void DoNotReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("doNotReadOaid");
}
}
#endif
}
|
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace com.adjust.sdk.oaid
{
#if UNITY_ANDROID
public class AdjustOaidAndroid
{
private static AndroidJavaClass ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
public static void ReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("readOaid");
}
public static void DoNotReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("doNotReadOaid");
}
}
#endif
}
|
mit
|
C#
|
53ffe4794f863cf26529a9581bfc556dc1865b45
|
Add `LocalisableString` overloads for extension methods.
|
ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework
|
osu.Framework/Extensions/LocalisationExtensions/LocalisableStringExtensions.cs
|
osu.Framework/Extensions/LocalisationExtensions/LocalisableStringExtensions.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.Localisation;
namespace osu.Framework.Extensions.LocalisationExtensions
{
public static class LocalisableStringExtensions
{
/// <summary>
/// Returns a <see cref="TransformableString"/> with the specified underlying localisable string uppercased.
/// </summary>
/// <param name="str">The localisable string.</param>
/// <returns>A transformable string with its localisable string uppercased.</returns>
public static TransformableString ToUpper(this LocalisableString str) => new TransformableString(str, Casing.UpperCase);
/// <summary>
/// Returns a <see cref="TransformableString"/> with the specified underlying string data uppercased.
/// </summary>
/// <param name="data">The string data.</param>
/// <returns>A transformable string with its string data uppercased.</returns>
public static TransformableString ToUpper(this ILocalisableStringData data) => new LocalisableString(data).ToUpper();
/// <summary>
/// Returns a <see cref="LocalisableString"/> with the specified underlying localisable string transformed to title case.
/// </summary>
/// <param name="str">The localisable string.</param>
/// <returns>A transformable string with its localisable string transformed to title case.</returns>
public static TransformableString ToTitle(this LocalisableString str) => new TransformableString(str, Casing.TitleCase);
/// <summary>
/// Returns a <see cref="LocalisableString"/> with the specified underlying string data transformed to title case.
/// </summary>
/// <param name="data">The string data.</param>
/// <returns>A transformable string with its string data transformed to title case.</returns>
public static TransformableString ToTitle(this ILocalisableStringData data) => new LocalisableString(data).ToTitle();
/// <summary>
/// Returns a <see cref="LocalisableString"/> with the specified underlying localisable string lowercased.
/// </summary>
/// <param name="str">The localisable string.</param>
/// <returns>A transformable string with its localisable string lowercased.</returns>
public static TransformableString ToLower(this LocalisableString str) => new TransformableString(str, Casing.LowerCase);
/// <summary>
/// Returns a <see cref="LocalisableString"/> with the specified underlying string data lowercased.
/// </summary>
/// <param name="data">The string data.</param>
/// <returns>A transformable string with its string data lowercased.</returns>
public static TransformableString ToLower(this ILocalisableStringData data) => new LocalisableString(data).ToLower();
}
}
|
// 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.Localisation;
namespace osu.Framework.Extensions.LocalisationExtensions
{
public static class LocalisableStringExtensions
{
/// <summary>
/// Returns a <see cref="TransformableString"/> with the specified underlying string data uppercased.
/// </summary>
/// <param name="data">The string data.</param>
/// <returns>A transformable string with its string data uppercased.</returns>
public static TransformableString ToUpper(this ILocalisableStringData data) => new TransformableString(new LocalisableString(data), Casing.UpperCase);
/// <summary>
/// Returns a <see cref="LocalisableString"/> with the specified underlying string data transformed to title case.
/// </summary>
/// <param name="data">The string data.</param>
/// <returns>A transformable string with its string data transformed to title case.</returns>
public static TransformableString ToTitle(this ILocalisableStringData data) => new TransformableString(new LocalisableString(data), Casing.TitleCase);
/// <summary>
/// Returns a <see cref="LocalisableString"/> with the specified underlying string data lowercased.
/// </summary>
/// <param name="data">The string data.</param>
/// <returns>A transformable string with its string data lowercased.</returns>
public static TransformableString ToLower(this ILocalisableStringData data) => new TransformableString(new LocalisableString(data), Casing.LowerCase);
}
}
|
mit
|
C#
|
308c9dcff357ae71d614083a2f40852195ab1512
|
Remove commented out code
|
NumbersInternational/CefSharp,illfang/CefSharp,jamespearce2006/CefSharp,battewr/CefSharp,illfang/CefSharp,battewr/CefSharp,rover886/CefSharp,wangzheng888520/CefSharp,joshvera/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,twxstar/CefSharp,yoder/CefSharp,dga711/CefSharp,ruisebastiao/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,windygu/CefSharp,rover886/CefSharp,wangzheng888520/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,Octopus-ITSM/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,Livit/CefSharp,AJDev77/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,battewr/CefSharp,ITGlobal/CefSharp,ITGlobal/CefSharp,Octopus-ITSM/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,ruisebastiao/CefSharp,dga711/CefSharp,rover886/CefSharp,windygu/CefSharp,Livit/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,Octopus-ITSM/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,NumbersInternational/CefSharp,battewr/CefSharp,AJDev77/CefSharp,illfang/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,Octopus-ITSM/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,zhangjingpu/CefSharp,Livit/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,joshvera/CefSharp,windygu/CefSharp,wangzheng888520/CefSharp,dga711/CefSharp,haozhouxu/CefSharp,rlmcneary2/CefSharp,twxstar/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,rover886/CefSharp,Haraguroicha/CefSharp,AJDev77/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,ITGlobal/CefSharp,dga711/CefSharp,twxstar/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,rover886/CefSharp
|
CefSharp.BrowserSubprocess/CefRenderProcess.cs
|
CefSharp.BrowserSubprocess/CefRenderProcess.cs
|
using CefSharp.Internals;
using System.Collections.Generic;
using System.ServiceModel;
namespace CefSharp.BrowserSubprocess
{
public class CefRenderProcess : CefSubProcess, IRenderProcess
{
private DuplexChannelFactory<IBrowserProcess> channelFactory;
private CefBrowserBase browser;
public CefBrowserBase Browser
{
get { return browser; }
}
public CefRenderProcess(IEnumerable<string> args)
: base(args)
{
}
protected override void DoDispose(bool isDisposing)
{
DisposeMember(ref browser);
base.DoDispose(isDisposing);
}
public override void OnBrowserCreated(CefBrowserBase cefBrowserWrapper)
{
browser = cefBrowserWrapper;
if (ParentProcessId == null)
{
return;
}
var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, cefBrowserWrapper.BrowserId);
channelFactory = new DuplexChannelFactory<IBrowserProcess>(
this,
new NetNamedPipeBinding(),
new EndpointAddress(serviceName)
);
channelFactory.Open();
Bind(CreateBrowserProxy().GetRegisteredJavascriptObjects());
}
public object EvaluateScript(int frameId, string script, double timeout)
{
var result = Browser.EvaluateScript(frameId, script, timeout);
return result;
}
public override IBrowserProcess CreateBrowserProxy()
{
return channelFactory.CreateChannel();
}
}
}
|
using CefSharp.Internals;
using System.Collections.Generic;
using System.ServiceModel;
namespace CefSharp.BrowserSubprocess
{
public class CefRenderProcess : CefSubProcess, IRenderProcess
{
private DuplexChannelFactory<IBrowserProcess> channelFactory;
private CefBrowserBase browser;
public CefBrowserBase Browser
{
get { return browser; }
}
public CefRenderProcess(IEnumerable<string> args)
: base(args)
{
}
protected override void DoDispose(bool isDisposing)
{
//DisposeMember(ref renderprocess);
DisposeMember(ref browser);
base.DoDispose(isDisposing);
}
public override void OnBrowserCreated(CefBrowserBase cefBrowserWrapper)
{
browser = cefBrowserWrapper;
if (ParentProcessId == null)
{
return;
}
var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, cefBrowserWrapper.BrowserId);
channelFactory = new DuplexChannelFactory<IBrowserProcess>(
this,
new NetNamedPipeBinding(),
new EndpointAddress(serviceName)
);
channelFactory.Open();
Bind(CreateBrowserProxy().GetRegisteredJavascriptObjects());
}
public object EvaluateScript(int frameId, string script, double timeout)
{
var result = Browser.EvaluateScript(frameId, script, timeout);
return result;
}
public override IBrowserProcess CreateBrowserProxy()
{
return channelFactory.CreateChannel();
}
}
}
|
bsd-3-clause
|
C#
|
9e25cc88d7fd116932a6bfe7faa42514285d9f73
|
Remove 0.1 sec waiting periods on Crazy Talk: Helps streams running at low framerates avoid strikes from slow action
|
CaitSith2/ktanemod-twitchplays,ashbash1987/ktanemod-twitchplays
|
Assets/Scripts/ComponentSolvers/Modded/Perky/CrazyTalkComponentSolver.cs
|
Assets/Scripts/ComponentSolvers/Modded/Perky/CrazyTalkComponentSolver.cs
|
using System;
using System.Collections;
using System.Reflection;
using UnityEngine;
public class CrazyTalkComponentSolver : ComponentSolver
{
public CrazyTalkComponentSolver(BombCommander bombCommander, MonoBehaviour bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
base(bombCommander, bombComponent, ircConnection, canceller)
{
_toggle = (MonoBehaviour)_toggleField.GetValue(bombComponent.GetComponent(_componentType));
helpMessage = "Toggle the switch down and up with !{0} toggle 4 5. The order is down, then up.";
}
protected override IEnumerator RespondToCommandInternal(string inputCommand)
{
int downtime;
int uptime;
var commands = inputCommand.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
if (commands.Length != 3 || !commands[0].Equals("toggle", StringComparison.InvariantCultureIgnoreCase) ||
!int.TryParse(commands[1],out downtime) || !int.TryParse(commands[2],out uptime))
yield break;
if (downtime < 0 || downtime > 9 || uptime < 0 || uptime > 9)
yield break;
yield return "Crazy Talk Solve Attempt";
int beforeButtonStrikeCount = StrikeCount;
MonoBehaviour timerComponent = (MonoBehaviour)CommonReflectedTypeInfo.GetTimerMethod.Invoke(BombCommander.Bomb, null);
int timeRemaining = (int)((float)CommonReflectedTypeInfo.TimeRemainingField.GetValue(timerComponent));
while ((timeRemaining%10) != downtime)
{
yield return null;
timeRemaining = (int)((float)CommonReflectedTypeInfo.TimeRemainingField.GetValue(timerComponent));
}
DoInteractionStart(_toggle);
yield return new WaitForSeconds(0.1f);
DoInteractionEnd(_toggle);
if (StrikeCount != beforeButtonStrikeCount)
yield break;
while ((timeRemaining % 10) != uptime)
{
yield return null;
timeRemaining = (int)((float)CommonReflectedTypeInfo.TimeRemainingField.GetValue(timerComponent));
}
DoInteractionStart(_toggle);
yield return new WaitForSeconds(0.1f);
DoInteractionEnd(_toggle);
}
static CrazyTalkComponentSolver()
{
_componentType = ReflectionHelper.FindType("CrazyTalkModule");
_toggleField = _componentType.GetField("toggleSwitch", BindingFlags.Public | BindingFlags.Instance);
}
private static Type _componentType = null;
private static FieldInfo _toggleField = null;
private MonoBehaviour _toggle = null;
}
|
using System;
using System.Collections;
using System.Reflection;
using UnityEngine;
public class CrazyTalkComponentSolver : ComponentSolver
{
public CrazyTalkComponentSolver(BombCommander bombCommander, MonoBehaviour bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
base(bombCommander, bombComponent, ircConnection, canceller)
{
_toggle = (MonoBehaviour)_toggleField.GetValue(bombComponent.GetComponent(_componentType));
helpMessage = "Toggle the switch down and up with !{0} toggle 4 5. The order is down, then up.";
}
protected override IEnumerator RespondToCommandInternal(string inputCommand)
{
int downtime;
int uptime;
var commands = inputCommand.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
if (commands.Length != 3 || !commands[0].Equals("toggle", StringComparison.InvariantCultureIgnoreCase) ||
!int.TryParse(commands[1],out downtime) || !int.TryParse(commands[2],out uptime))
yield break;
if (downtime < 0 || downtime > 9 || uptime < 0 || uptime > 9)
yield break;
yield return "Crazy Talk Solve Attempt";
int beforeButtonStrikeCount = StrikeCount;
MonoBehaviour timerComponent = (MonoBehaviour)CommonReflectedTypeInfo.GetTimerMethod.Invoke(BombCommander.Bomb, null);
int timeRemaining = (int)((float)CommonReflectedTypeInfo.TimeRemainingField.GetValue(timerComponent));
while ((timeRemaining%10) != downtime)
{
yield return new WaitForSeconds(0.1f);
timeRemaining = (int)((float)CommonReflectedTypeInfo.TimeRemainingField.GetValue(timerComponent));
}
DoInteractionStart(_toggle);
yield return new WaitForSeconds(0.1f);
DoInteractionEnd(_toggle);
if (StrikeCount != beforeButtonStrikeCount)
yield break;
while ((timeRemaining % 10) != uptime)
{
yield return new WaitForSeconds(0.1f);
timeRemaining = (int)((float)CommonReflectedTypeInfo.TimeRemainingField.GetValue(timerComponent));
}
DoInteractionStart(_toggle);
yield return new WaitForSeconds(0.1f);
DoInteractionEnd(_toggle);
}
static CrazyTalkComponentSolver()
{
_componentType = ReflectionHelper.FindType("CrazyTalkModule");
_toggleField = _componentType.GetField("toggleSwitch", BindingFlags.Public | BindingFlags.Instance);
}
private static Type _componentType = null;
private static FieldInfo _toggleField = null;
private MonoBehaviour _toggle = null;
}
|
mit
|
C#
|
9b4b324a413cf35ef08c2d491fc35be97161e962
|
Fix broken tests updated for longer max name.
|
frackleton/ApplicationInsights-SDK-Labs,Microsoft/ApplicationInsights-SDK-Labs
|
AggregateMetrics/AggregateMetrics.Tests/CounterCollectionLimitsTests.cs
|
AggregateMetrics/AggregateMetrics.Tests/CounterCollectionLimitsTests.cs
|
namespace CounterCollection.Tests
{
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.ApplicationInsights.Extensibility.AggregateMetrics;
[TestClass]
public class CounterCollectionLimitsTests : AggregationTests
{
[TestMethod]
public void CounterNameIsTruncatedToMaxLength()
{
var client = new TelemetryClient();
client.TrackAggregateMetric("This name is longer than the maximum allowed length and will be truncated", 123.00);
Assert.AreEqual(1, AggregateMetrics.aggregationSets.Count);
AggregationSet aggregationSet;
AggregateMetrics.aggregationSets.TryGetValue(AggregateMetrics.aggregationSets.Keys.First(), out aggregationSet);
Assert.AreEqual("This name is longer ", aggregationSet.Name);
}
[TestMethod]
public void PropertyValueIsTruncatedToMaxLength()
{
var client = new TelemetryClient();
client.TrackAggregateMetric("MyCounter", 123.00, "1. This is a long property value", "2. This is a long property value", "3. This is a long property value");
Assert.AreEqual(1, AggregateMetrics.aggregationSets.Count);
AggregationSet aggregationSet;
AggregateMetrics.aggregationSets.TryGetValue(AggregateMetrics.aggregationSets.Keys.First(), out aggregationSet);
MetricsBag counterData = aggregationSet.RemoveAggregations().First().Value;
Assert.AreEqual("1. This is a long pr", counterData.Property1);
Assert.AreEqual("2. This is a long pr", counterData.Property2);
Assert.AreEqual("3. This is a long pr", counterData.Property3);
}
}
}
|
namespace CounterCollection.Tests
{
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.ApplicationInsights.Extensibility.AggregateMetrics;
[TestClass]
public class CounterCollectionLimitsTests : AggregationTests
{
[TestMethod]
public void CounterNameIsTruncatedToMaxLength()
{
var client = new TelemetryClient();
client.TrackAggregateMetric("This name is longer than the maximum allowed length and will be truncated", 123.00);
Assert.AreEqual(1, AggregateMetrics.aggregationSets.Count);
AggregationSet aggregationSet;
AggregateMetrics.aggregationSets.TryGetValue(AggregateMetrics.aggregationSets.Keys.First(), out aggregationSet);
Assert.AreEqual("This name is lon", aggregationSet.Name);
}
[TestMethod]
public void PropertyValueIsTruncatedToMaxLength()
{
var client = new TelemetryClient();
client.TrackAggregateMetric("MyCounter", 123.00, "1. This is a long property value", "2. This is a long property value", "3. This is a long property value");
Assert.AreEqual(1, AggregateMetrics.aggregationSets.Count);
AggregationSet aggregationSet;
AggregateMetrics.aggregationSets.TryGetValue(AggregateMetrics.aggregationSets.Keys.First(), out aggregationSet);
MetricsBag counterData = aggregationSet.RemoveAggregations().First().Value;
Assert.AreEqual("1. This is a lon", counterData.Property1);
Assert.AreEqual("2. This is a lon", counterData.Property2);
Assert.AreEqual("3. This is a lon", counterData.Property3);
}
}
}
|
mit
|
C#
|
1d0c6d951018becc3f27026cee2606dc8690349d
|
Update MergingCells.cs
|
maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET
|
Examples/CSharp/Formatting/ConfiguringAlignmentSettings/MergingCells.cs
|
Examples/CSharp/Formatting/ConfiguringAlignmentSettings/MergingCells.cs
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Formatting.ConfiguringAlignmentSettings
{
public class MergingCells
{
public static void Main(string[] args)
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create directory if it is not already present.
bool IsExists = System.IO.Directory.Exists(dataDir);
if (!IsExists)
System.IO.Directory.CreateDirectory(dataDir);
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Accessing the "A1" cell from the worksheet
Aspose.Cells.Cell cell = worksheet.Cells["A1"];
//Adding some value to the "A1" cell
cell.PutValue("Visit Aspose!");
//Merging the first three columns in the first row to create a single cell
worksheet.Cells.Merge(0, 0, 1, 3);
//Saving the Excel file
workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003);
//ExEnd:1
}
}
}
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Formatting.ConfiguringAlignmentSettings
{
public class MergingCells
{
public static void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create directory if it is not already present.
bool IsExists = System.IO.Directory.Exists(dataDir);
if (!IsExists)
System.IO.Directory.CreateDirectory(dataDir);
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Accessing the "A1" cell from the worksheet
Aspose.Cells.Cell cell = worksheet.Cells["A1"];
//Adding some value to the "A1" cell
cell.PutValue("Visit Aspose!");
//Merging the first three columns in the first row to create a single cell
worksheet.Cells.Merge(0, 0, 1, 3);
//Saving the Excel file
workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003);
}
}
}
|
mit
|
C#
|
0a849478d371d618d1dd6d77fc98cf93306e5cd6
|
Remove explicit framework version dependency in signing
|
hanu412/roslyn,shyamnamboodiripad/roslyn,MavenRain/roslyn,AnthonyDGreen/roslyn,ErikSchierboom/roslyn,pjmagee/roslyn,tang7526/roslyn,marksantos/roslyn,sharadagrawal/TestProject2,DanielRosenwasser/roslyn,swaroop-sridhar/roslyn,antiufo/roslyn,jeffanders/roslyn,YOTOV-LIMITED/roslyn,robinsedlaczek/roslyn,tmeschter/roslyn,balajikris/roslyn,brettfo/roslyn,heejaechang/roslyn,VitalyTVA/roslyn,paulvanbrenk/roslyn,srivatsn/roslyn,EricArndt/roslyn,basoundr/roslyn,grianggrai/roslyn,jaredpar/roslyn,gafter/roslyn,dpen2000/roslyn,jasonmalinowski/roslyn,DanielRosenwasser/roslyn,dovzhikova/roslyn,MattWindsor91/roslyn,mavasani/roslyn,GuilhermeSa/roslyn,DanielRosenwasser/roslyn,robinsedlaczek/roslyn,mattwar/roslyn,pdelvo/roslyn,droyad/roslyn,sharwell/roslyn,nguerrera/roslyn,Maxwe11/roslyn,garryforreg/roslyn,dpoeschl/roslyn,davkean/roslyn,jaredpar/roslyn,taylorjonl/roslyn,mattwar/roslyn,jamesqo/roslyn,OmarTawfik/roslyn,Hosch250/roslyn,michalhosala/roslyn,moozzyk/roslyn,DinoV/roslyn,lorcanmooney/roslyn,srivatsn/roslyn,jroggeman/roslyn,thomaslevesque/roslyn,evilc0des/roslyn,MichalStrehovsky/roslyn,basoundr/roslyn,mseamari/Stuff,AdamSpeight2008/roslyn-AdamSpeight2008,oocx/roslyn,ilyes14/roslyn,chenxizhang/roslyn,Pvlerick/roslyn,VSadov/roslyn,GuilhermeSa/roslyn,tmat/roslyn,garryforreg/roslyn,KamalRathnayake/roslyn,MichalStrehovsky/roslyn,VPashkov/roslyn,agocke/roslyn,taylorjonl/roslyn,huoxudong125/roslyn,drognanar/roslyn,kienct89/roslyn,jrharmon/roslyn,Hosch250/roslyn,TyOverby/roslyn,vslsnap/roslyn,natidea/roslyn,abock/roslyn,natidea/roslyn,jeffanders/roslyn,danielcweber/roslyn,DinoV/roslyn,Maxwe11/roslyn,MattWindsor91/roslyn,jcouv/roslyn,evilc0des/roslyn,MatthieuMEZIL/roslyn,robinsedlaczek/roslyn,sharwell/roslyn,SeriaWei/roslyn,doconnell565/roslyn,michalhosala/roslyn,tmat/roslyn,kuhlenh/roslyn,genlu/roslyn,weltkante/roslyn,moozzyk/roslyn,jmarolf/roslyn,xoofx/roslyn,aanshibudhiraja/Roslyn,KiloBravoLima/roslyn,dpen2000/roslyn,jramsay/roslyn,dotnet/roslyn,Pvlerick/roslyn,jramsay/roslyn,yjfxfjch/roslyn,KevinRansom/roslyn,khyperia/roslyn,aanshibudhiraja/Roslyn,a-ctor/roslyn,mgoertz-msft/roslyn,cybernet14/roslyn,FICTURE7/roslyn,heejaechang/roslyn,tvand7093/roslyn,gafter/roslyn,jgglg/roslyn,GuilhermeSa/roslyn,akrisiun/roslyn,wschae/roslyn,AmadeusW/roslyn,marksantos/roslyn,ljw1004/roslyn,magicbing/roslyn,huoxudong125/roslyn,zooba/roslyn,1234-/roslyn,ValentinRueda/roslyn,amcasey/roslyn,mseamari/Stuff,shyamnamboodiripad/roslyn,antonssonj/roslyn,droyad/roslyn,AmadeusW/roslyn,rchande/roslyn,sharadagrawal/Roslyn,natidea/roslyn,managed-commons/roslyn,Hosch250/roslyn,yeaicc/roslyn,AlekseyTs/roslyn,KevinRansom/roslyn,vcsjones/roslyn,grianggrai/roslyn,MavenRain/roslyn,REALTOBIZ/roslyn,jasonmalinowski/roslyn,dpen2000/roslyn,jeffanders/roslyn,chenxizhang/roslyn,v-codeel/roslyn,MattWindsor91/roslyn,thomaslevesque/roslyn,jroggeman/roslyn,stjeong/roslyn,jonatassaraiva/roslyn,marksantos/roslyn,natgla/roslyn,russpowers/roslyn,MihaMarkic/roslyn-prank,jasonmalinowski/roslyn,physhi/roslyn,xoofx/roslyn,drognanar/roslyn,v-codeel/roslyn,doconnell565/roslyn,aanshibudhiraja/Roslyn,antonssonj/roslyn,mirhagk/roslyn,orthoxerox/roslyn,dovzhikova/roslyn,swaroop-sridhar/roslyn,akoeplinger/roslyn,MavenRain/roslyn,nguerrera/roslyn,ljw1004/roslyn,lorcanmooney/roslyn,poizan42/roslyn,rgani/roslyn,jcouv/roslyn,jkotas/roslyn,akoeplinger/roslyn,aelij/roslyn,furesoft/roslyn,MatthieuMEZIL/roslyn,eriawan/roslyn,OmniSharp/roslyn,HellBrick/roslyn,cston/roslyn,akoeplinger/roslyn,Giftednewt/roslyn,aelij/roslyn,reaction1989/roslyn,jhendrixMSFT/roslyn,davkean/roslyn,hanu412/roslyn,panopticoncentral/roslyn,shyamnamboodiripad/roslyn,KevinH-MS/roslyn,mgoertz-msft/roslyn,supriyantomaftuh/roslyn,poizan42/roslyn,tang7526/roslyn,BugraC/roslyn,dotnet/roslyn,sharadagrawal/Roslyn,zooba/roslyn,jaredpar/roslyn,krishnarajbb/roslyn,Inverness/roslyn,mseamari/Stuff,orthoxerox/roslyn,antiufo/roslyn,CaptainHayashi/roslyn,REALTOBIZ/roslyn,DinoV/roslyn,mattwar/roslyn,OmniSharp/roslyn,agocke/roslyn,MattWindsor91/roslyn,3F/roslyn,lisong521/roslyn,CyrusNajmabadi/roslyn,AArnott/roslyn,MichalStrehovsky/roslyn,tsdl2013/roslyn,budcribar/roslyn,jeremymeng/roslyn,SeriaWei/roslyn,wschae/roslyn,drognanar/roslyn,sharadagrawal/TestProject2,nguerrera/roslyn,ahmedshuhel/roslyn,stephentoub/roslyn,panopticoncentral/roslyn,pjmagee/roslyn,jkotas/roslyn,mmitche/roslyn,chenxizhang/roslyn,SeriaWei/roslyn,mmitche/roslyn,bkoelman/roslyn,wvdd007/roslyn,stebet/roslyn,jgglg/roslyn,MihaMarkic/roslyn-prank,eriawan/roslyn,cston/roslyn,vcsjones/roslyn,abock/roslyn,HellBrick/roslyn,magicbing/roslyn,nagyistoce/roslyn,OmniSharp/roslyn,Giten2004/roslyn,CaptainHayashi/roslyn,vslsnap/roslyn,jeremymeng/roslyn,KamalRathnayake/roslyn,JakeGinnivan/roslyn,BugraC/roslyn,ValentinRueda/roslyn,tmeschter/roslyn,natgla/roslyn,lisong521/roslyn,jrharmon/roslyn,a-ctor/roslyn,paulvanbrenk/roslyn,rchande/roslyn,zmaruo/roslyn,KashishArora/Roslyn,EricArndt/roslyn,wschae/roslyn,Inverness/roslyn,khellang/roslyn,MatthieuMEZIL/roslyn,hanu412/roslyn,jhendrixMSFT/roslyn,srivatsn/roslyn,bkoelman/roslyn,jbhensley/roslyn,gafter/roslyn,jmarolf/roslyn,tannergooding/roslyn,heejaechang/roslyn,stjeong/roslyn,amcasey/roslyn,kuhlenh/roslyn,akrisiun/roslyn,supriyantomaftuh/roslyn,paulvanbrenk/roslyn,reaction1989/roslyn,khellang/roslyn,mgoertz-msft/roslyn,thomaslevesque/roslyn,khyperia/roslyn,bartdesmet/roslyn,ericfe-ms/roslyn,KevinRansom/roslyn,VSadov/roslyn,yjfxfjch/roslyn,kienct89/roslyn,wvdd007/roslyn,ljw1004/roslyn,xasx/roslyn,TyOverby/roslyn,BugraC/roslyn,tmeschter/roslyn,dsplaisted/roslyn,tvand7093/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,dpoeschl/roslyn,bbarry/roslyn,furesoft/roslyn,genlu/roslyn,poizan42/roslyn,Giftednewt/roslyn,KiloBravoLima/roslyn,rchande/roslyn,leppie/roslyn,evilc0des/roslyn,yeaicc/roslyn,lisong521/roslyn,stephentoub/roslyn,AArnott/roslyn,CyrusNajmabadi/roslyn,ericfe-ms/roslyn,antiufo/roslyn,FICTURE7/roslyn,1234-/roslyn,kienct89/roslyn,paladique/roslyn,mmitche/roslyn,oocx/roslyn,mattscheffer/roslyn,budcribar/roslyn,weltkante/roslyn,tsdl2013/roslyn,tsdl2013/roslyn,Inverness/roslyn,jamesqo/roslyn,Shiney/roslyn,JakeGinnivan/roslyn,jonatassaraiva/roslyn,tang7526/roslyn,ahmedshuhel/roslyn,3F/roslyn,leppie/roslyn,reaction1989/roslyn,enginekit/roslyn,sharadagrawal/Roslyn,RipCurrent/roslyn,EricArndt/roslyn,AlexisArce/roslyn,DustinCampbell/roslyn,KirillOsenkov/roslyn,ilyes14/roslyn,cybernet14/roslyn,jmarolf/roslyn,VShangxiao/roslyn,Giftednewt/roslyn,Giten2004/roslyn,oocx/roslyn,huoxudong125/roslyn,swaroop-sridhar/roslyn,vslsnap/roslyn,furesoft/roslyn,VShangxiao/roslyn,AnthonyDGreen/roslyn,ValentinRueda/roslyn,dovzhikova/roslyn,YOTOV-LIMITED/roslyn,FICTURE7/roslyn,Shiney/roslyn,pjmagee/roslyn,AlexisArce/roslyn,AArnott/roslyn,stjeong/roslyn,abock/roslyn,xasx/roslyn,panopticoncentral/roslyn,3F/roslyn,DustinCampbell/roslyn,Pvlerick/roslyn,AlexisArce/roslyn,weltkante/roslyn,enginekit/roslyn,davkean/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,danielcweber/roslyn,AmadeusW/roslyn,wvdd007/roslyn,1234-/roslyn,antonssonj/roslyn,yeaicc/roslyn,KirillOsenkov/roslyn,jbhensley/roslyn,nemec/roslyn,jhendrixMSFT/roslyn,DustinCampbell/roslyn,budcribar/roslyn,devharis/roslyn,diryboy/roslyn,a-ctor/roslyn,bartdesmet/roslyn,dpoeschl/roslyn,CyrusNajmabadi/roslyn,nemec/roslyn,rgani/roslyn,Giten2004/roslyn,jonatassaraiva/roslyn,kelltrick/roslyn,RipCurrent/roslyn,zmaruo/roslyn,michalhosala/roslyn,YOTOV-LIMITED/roslyn,russpowers/roslyn,nemec/roslyn,KirillOsenkov/roslyn,VPashkov/roslyn,balajikris/roslyn,ahmedshuhel/roslyn,xasx/roslyn,brettfo/roslyn,vcsjones/roslyn,jkotas/roslyn,nagyistoce/roslyn,KamalRathnayake/roslyn,oberxon/roslyn,pdelvo/roslyn,stephentoub/roslyn,ErikSchierboom/roslyn,bbarry/roslyn,AlekseyTs/roslyn,jramsay/roslyn,mirhagk/roslyn,v-codeel/roslyn,brettfo/roslyn,akrisiun/roslyn,aelij/roslyn,zooba/roslyn,KevinH-MS/roslyn,paladique/roslyn,jcouv/roslyn,devharis/roslyn,AlekseyTs/roslyn,bartdesmet/roslyn,managed-commons/roslyn,doconnell565/roslyn,sharadagrawal/TestProject2,VitalyTVA/roslyn,jrharmon/roslyn,paladique/roslyn,tvand7093/roslyn,KevinH-MS/roslyn,physhi/roslyn,tmat/roslyn,dotnet/roslyn,enginekit/roslyn,jroggeman/roslyn,KashishArora/Roslyn,RipCurrent/roslyn,kuhlenh/roslyn,mavasani/roslyn,TyOverby/roslyn,zmaruo/roslyn,dsplaisted/roslyn,Maxwe11/roslyn,bbarry/roslyn,ErikSchierboom/roslyn,nagyistoce/roslyn,jbhensley/roslyn,pdelvo/roslyn,cston/roslyn,VPashkov/roslyn,genlu/roslyn,eriawan/roslyn,krishnarajbb/roslyn,dsplaisted/roslyn,droyad/roslyn,KiloBravoLima/roslyn,MihaMarkic/roslyn-prank,garryforreg/roslyn,supriyantomaftuh/roslyn,physhi/roslyn,devharis/roslyn,xoofx/roslyn,grianggrai/roslyn,lorcanmooney/roslyn,ericfe-ms/roslyn,oberxon/roslyn,managed-commons/roslyn,VShangxiao/roslyn,VitalyTVA/roslyn,stebet/roslyn,rgani/roslyn,jgglg/roslyn,OmarTawfik/roslyn,Shiney/roslyn,jamesqo/roslyn,oberxon/roslyn,HellBrick/roslyn,khellang/roslyn,mattscheffer/roslyn,mavasani/roslyn,diryboy/roslyn,tannergooding/roslyn,orthoxerox/roslyn,taylorjonl/roslyn,ilyes14/roslyn,kelltrick/roslyn,agocke/roslyn,cybernet14/roslyn,khyperia/roslyn,AnthonyDGreen/roslyn,russpowers/roslyn,stebet/roslyn,amcasey/roslyn,JakeGinnivan/roslyn,leppie/roslyn,diryboy/roslyn,danielcweber/roslyn,basoundr/roslyn,CaptainHayashi/roslyn,KashishArora/Roslyn,yjfxfjch/roslyn,magicbing/roslyn,tannergooding/roslyn,sharwell/roslyn,jeremymeng/roslyn,OmarTawfik/roslyn,mirhagk/roslyn,bkoelman/roslyn,balajikris/roslyn,mattscheffer/roslyn,moozzyk/roslyn,krishnarajbb/roslyn,kelltrick/roslyn,REALTOBIZ/roslyn,VSadov/roslyn,natgla/roslyn
|
src/Compilers/Core/Desktop/Interop/ClrStrongName.cs
|
src/Compilers/Core/Desktop/Interop/ClrStrongName.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.Runtime.InteropServices;
using System.Security;
namespace Microsoft.CodeAnalysis.Interop
{
internal static class ClrStrongName
{
[DllImport("mscoree.dll", PreserveSig = false, EntryPoint = "CLRCreateInstance")]
[return: MarshalAs(UnmanagedType.Interface)]
private static extern object nCreateInterface(
[MarshalAs(UnmanagedType.LPStruct)] Guid clsid,
[MarshalAs(UnmanagedType.LPStruct)] Guid riid);
internal static IClrStrongName GetInstance()
{
var metaHostClsid = new Guid(0x9280188D, 0xE8E, 0x4867, 0xB3, 0xC, 0x7F, 0xA8, 0x38, 0x84, 0xE8, 0xDE);
var metaHostGuid = new Guid(0xD332DB9E, 0xB9B3, 0x4125, 0x82, 0x07, 0xA1, 0x48, 0x84, 0xF5, 0x32, 0x16);
var clrStrongNameClsid = new Guid(0xB79B0ACD, 0xF5CD, 0x409b, 0xB5, 0xA5, 0xA1, 0x62, 0x44, 0x61, 0x0B, 0x92);
var clrRuntimeInfoGuid = new Guid(0xBD39D1D2, 0xBA2F, 0x486A, 0x89, 0xB0, 0xB4, 0xB0, 0xCB, 0x46, 0x68, 0x91);
var clrStrongNameGuid = new Guid(0x9FD93CCF, 0x3280, 0x4391, 0xB3, 0xA9, 0x96, 0xE1, 0xCD, 0xE7, 0x7C, 0x8D);
var metaHost = (IClrMetaHost)nCreateInterface(metaHostClsid, metaHostGuid);
var runtime = (IClrRuntimeInfo)metaHost.GetRuntime(RuntimeEnvironment.GetSystemVersion(), clrRuntimeInfoGuid);
return (IClrStrongName)runtime.GetInterface(clrStrongNameClsid, clrStrongNameGuid);
}
}
}
|
// 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.Runtime.InteropServices;
namespace Microsoft.CodeAnalysis.Interop
{
internal static class ClrStrongName
{
[DllImport("mscoree.dll", PreserveSig = false, EntryPoint = "CLRCreateInstance")]
[return: MarshalAs(UnmanagedType.Interface)]
private static extern object nCreateInterface(
[MarshalAs(UnmanagedType.LPStruct)] Guid clsid,
[MarshalAs(UnmanagedType.LPStruct)] Guid riid);
internal static IClrStrongName GetInstance()
{
const string fxVersion = "v4.0.30319";
var metaHostClsid = new Guid(0x9280188D, 0xE8E, 0x4867, 0xB3, 0xC, 0x7F, 0xA8, 0x38, 0x84, 0xE8, 0xDE);
var metaHostGuid = new Guid(0xD332DB9E, 0xB9B3, 0x4125, 0x82, 0x07, 0xA1, 0x48, 0x84, 0xF5, 0x32, 0x16);
var clrStrongNameClsid = new Guid(0xB79B0ACD, 0xF5CD, 0x409b, 0xB5, 0xA5, 0xA1, 0x62, 0x44, 0x61, 0x0B, 0x92);
var clrRuntimeInfoGuid = new Guid(0xBD39D1D2, 0xBA2F, 0x486A, 0x89, 0xB0, 0xB4, 0xB0, 0xCB, 0x46, 0x68, 0x91);
var clrStrongNameGuid = new Guid(0x9FD93CCF, 0x3280, 0x4391, 0xB3, 0xA9, 0x96, 0xE1, 0xCD, 0xE7, 0x7C, 0x8D);
var metaHost = (IClrMetaHost)nCreateInterface(metaHostClsid, metaHostGuid);
var runtime = (IClrRuntimeInfo)metaHost.GetRuntime(fxVersion, clrRuntimeInfoGuid);
return (IClrStrongName)runtime.GetInterface(clrStrongNameClsid, clrStrongNameGuid);
}
}
}
|
mit
|
C#
|
ea685b4f2352b31abcbf769826499aea0e8fb793
|
Add 'article' EmbedType
|
AntiTcb/Discord.Net,RogueException/Discord.Net,Confruggy/Discord.Net
|
src/Discord.Net.Core/Entities/Messages/EmbedType.cs
|
src/Discord.Net.Core/Entities/Messages/EmbedType.cs
|
namespace Discord
{
public enum EmbedType
{
Rich,
Link,
Video,
Image,
Gifv,
Article
}
}
|
namespace Discord
{
public enum EmbedType
{
Rich,
Link,
Video,
Image,
Gifv
}
}
|
mit
|
C#
|
ba7f80fff33d42bba6b3f7089bd19a2d6bea4974
|
Make internals (in particular Runtime.*) visible to the tests.
|
pythonnet/pythonnet,Konstantin-Posudevskiy/pythonnet,yagweb/pythonnet,AlexCatarino/pythonnet,denfromufa/pythonnet,vmuriart/pythonnet,yagweb/pythonnet,denfromufa/pythonnet,denfromufa/pythonnet,dmitriyse/pythonnet,vmuriart/pythonnet,pythonnet/pythonnet,Konstantin-Posudevskiy/pythonnet,AlexCatarino/pythonnet,QuantConnect/pythonnet,dmitriyse/pythonnet,dmitriyse/pythonnet,QuantConnect/pythonnet,AlexCatarino/pythonnet,vmuriart/pythonnet,Konstantin-Posudevskiy/pythonnet,yagweb/pythonnet,yagweb/pythonnet,AlexCatarino/pythonnet,QuantConnect/pythonnet,pythonnet/pythonnet
|
src/runtime/assemblyinfo.cs
|
src/runtime/assemblyinfo.cs
|
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
[assembly: AssemblyProduct("Python for .NET")]
[assembly: AssemblyVersion("4.0.0.1")]
[assembly: AssemblyDefaultAlias("Python.Runtime.dll")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyCopyright("MIT License")]
[assembly: AssemblyFileVersion("2.0.0.2")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: InternalsVisibleTo("Python.EmbeddingTest")]
|
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("Python for .NET")]
[assembly: AssemblyVersion("4.0.0.1")]
[assembly: AssemblyDefaultAlias("Python.Runtime.dll")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyCopyright("MIT License")]
[assembly: AssemblyFileVersion("2.0.0.2")]
[assembly: NeutralResourcesLanguage("en")]
#if PYTHON27
[assembly: AssemblyTitle("Python.Runtime for Python 2.7")]
[assembly: AssemblyDescription("Python Runtime for Python 2.7")]
#elif PYTHON33
[assembly: AssemblyTitle("Python.Runtime for Python 3.3")]
[assembly: AssemblyDescription("Python Runtime for Python 3.3")]
#elif PYTHON34
[assembly: AssemblyTitle("Python.Runtime for Python 3.4")]
[assembly: AssemblyDescription("Python Runtime for Python 3.4")]
#elif PYTHON35
[assembly: AssemblyTitle("Python.Runtime for Python 3.5")]
[assembly: AssemblyDescription("Python Runtime for Python 3.5")]
#elif PYTHON36
[assembly: AssemblyTitle("Python.Runtime for Python 3.6")]
[assembly: AssemblyDescription("Python Runtime for Python 3.6")]
#elif PYTHON37
[assembly: AssemblyTitle("Python.Runtime for Python 3.7")]
[assembly: AssemblyDescription("Python Runtime for Python 3.7")]
#endif
|
mit
|
C#
|
b0c2f6a6554e135ed914ef12111b094bd2650458
|
Fix FxCop warning CA1018 (attributes should have AttributeUsage)
|
shimingsg/corefx,ericstj/corefx,ViktorHofer/corefx,ericstj/corefx,wtgodbe/corefx,wtgodbe/corefx,wtgodbe/corefx,shimingsg/corefx,ViktorHofer/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,wtgodbe/corefx,wtgodbe/corefx,ViktorHofer/corefx,shimingsg/corefx,ViktorHofer/corefx,shimingsg/corefx,ericstj/corefx,ericstj/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,wtgodbe/corefx,wtgodbe/corefx,ViktorHofer/corefx,shimingsg/corefx,ericstj/corefx
|
src/Common/src/CoreLib/System/Runtime/CompilerServices/DiscardableAttribute.cs
|
src/Common/src/CoreLib/System/Runtime/CompilerServices/DiscardableAttribute.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.Runtime.CompilerServices
{
// Custom attribute to indicating a TypeDef is a discardable attribute.
[AttributeUsage(AttributeTargets.All)]
public class DiscardableAttribute : Attribute
{
public DiscardableAttribute() { }
}
}
|
// 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.Runtime.CompilerServices
{
// Custom attribute to indicating a TypeDef is a discardable attribute.
public class DiscardableAttribute : Attribute
{
public DiscardableAttribute() { }
}
}
|
mit
|
C#
|
d34f8feb39e69d2e0a71e055169e4b88dde91e7a
|
Update SignIn.cshtml
|
tariqs-repo/SignalR-Notification-State-Manager,tariqs-repo/SignalR-Notification-State-Manager
|
Sample_Project/SingnalRNotificationStateManager/Views/Home/SignIn.cshtml
|
Sample_Project/SingnalRNotificationStateManager/Views/Home/SignIn.cshtml
|
@{
ViewBag.Title = "SingIn";
}
<h2>SingIn</h2>
<b>Mock login. Type anything to signin.</b>
@using(Html.BeginForm("SignIn", "Home"))
{
@Html.ValidationSummary()
<table>
<tr>
<td>Username</td>
<td>@Html.TextBox("Username", "dhetteri")</td>
</tr>
<tr>
<td>Password</td>
<td>@Html.TextBox("password", "vuila gesi", new { type="password" })</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" /></td>
</tr>
</table>
}
|
@{
ViewBag.Title = "SingIn";
}
<h2>SingIn</h2>
<b>Mock login. Type anything in to signin.</b>
@using(Html.BeginForm("SignIn", "Home"))
{
@Html.ValidationSummary()
<table>
<tr>
<td>Username</td>
<td>@Html.TextBox("Username", "dhetteri")</td>
</tr>
<tr>
<td>Password</td>
<td>@Html.TextBox("password", "vuila gesi", new { type="password" })</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" /></td>
</tr>
</table>
}
|
apache-2.0
|
C#
|
b3a4ef9a6d2fe7f521883c466f6c6feefa0611a5
|
Update NotificationUnsubscribe.cshtml
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
src/SFA.DAS.EmployerAccounts.Web/Views/Settings/NotificationUnsubscribe.cshtml
|
src/SFA.DAS.EmployerAccounts.Web/Views/Settings/NotificationUnsubscribe.cshtml
|
@model OrchestratorResponse<SummaryUnsubscribeViewModel>
@{
ViewBag.Title = "Unsubscribe from notification";
ViewBag.PageId = "unsubscribe-notification";
ViewBag.HideNav = true;
}
<div class="grid-row">
<div class="column-two-thirds">
@if (Model.Data.AlreadyUnsubscribed)
{
<h1 class="heading-xlarge">You've already unsubscribed</h1>
<p>You've already unsubscribed from notifications for @{@Model.Data.AccountName}.</p>
<p>You'll continue to receive important service emails, such as password resets.</p>
}
else
{
<h1 class="heading-xlarge">Unsubscribe successful</h1>
<p>You've unsubscribed from any further email notifications for @{@Model.Data.AccountName}.</p>
<p>You'll continue to receive important service emails, such as password resets.</p>
}
@Html.ActionLink("View notification settings","NotificationSettings", null, new { @class = "button" })
</div>
</div>
|
@model OrchestratorResponse<SummaryUnsubscribeViewModel>
@{
ViewBag.Title = "Unsubscribe from notification";
ViewBag.PageId = "unsubscribe-notification";
ViewBag.HideNav = true;
}
<div class="grid-row">
<div class="column-two-thirds">
@if (Model.Data.AlreadyUnsubscribed)
{
<h1 class="heading-xlarge">You've already unsubscribed</h1>
<p>You've already unsubscribed from notifications for @{@Model.Data.AccountName}.</p>
<p>You'll continue to receive important service emails, such as password resets.</p>
}
else
{
<h1 class="heading-xlarge">Unsubscribe successful</h1>
<p>You've unsubscribed from any further email notifications for @{@Model.Data.AccountName}.</p>
<p>You'll receive one final email to confirm that we've unsubscribed you.</p>
<p>You'll continue to receive important service emails, such as password resets.</p>
}
@Html.ActionLink("View notification settings","NotificationSettings", null, new { @class = "button" })
</div>
</div>
|
mit
|
C#
|
832d736ffbd07bd77600e83c103ac4245d857ddd
|
Change ODataRoutingConventions to expose a Collection instead of an IList
|
yonglehou/WebApi,LianwMS/WebApi,lungisam/WebApi,abkmr/WebApi,LianwMS/WebApi,scz2011/WebApi,lewischeng-ms/WebApi,lungisam/WebApi,scz2011/WebApi,chimpinano/WebApi,yonglehou/WebApi,congysu/WebApi,abkmr/WebApi,congysu/WebApi,lewischeng-ms/WebApi,chimpinano/WebApi
|
src/System.Web.Http.OData/OData/Routing/Conventions/ODataRoutingConventions.cs
|
src/System.Web.Http.OData/OData/Routing/Conventions/ODataRoutingConventions.cs
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System.Collections.ObjectModel;
namespace System.Web.Http.OData.Routing.Conventions
{
/// <summary>
/// Provides helper methods for creating routing conventions.
/// </summary>
public static class ODataRoutingConventions
{
/// <summary>
/// Creates a mutable collection of the default OData routing conventions.
/// </summary>
/// <returns>A mutable collection of the default OData routing conventions.</returns>
public static Collection<IODataRoutingConvention> CreateDefault()
{
return new Collection<IODataRoutingConvention>()
{
new MetadataRoutingConvention(),
new EntitySetRoutingConvention(),
new EntityRoutingConvention(),
new NavigationRoutingConvention(),
new LinksRoutingConvention(),
new ActionRoutingConvention(),
new UnmappedRequestRoutingConvention()
};
}
}
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Generic;
namespace System.Web.Http.OData.Routing.Conventions
{
/// <summary>
/// Provides helper methods for creating routing conventions.
/// </summary>
public static class ODataRoutingConventions
{
/// <summary>
/// Creates a mutable list of the default OData routing conventions.
/// </summary>
/// <returns>A mutable list of the default OData routing conventions.</returns>
public static IList<IODataRoutingConvention> CreateDefault()
{
return new List<IODataRoutingConvention>()
{
new MetadataRoutingConvention(),
new EntitySetRoutingConvention(),
new EntityRoutingConvention(),
new NavigationRoutingConvention(),
new LinksRoutingConvention(),
new ActionRoutingConvention(),
new UnmappedRequestRoutingConvention()
};
}
}
}
|
mit
|
C#
|
7ebe65b5c0715755d95962bd83a690966181333c
|
Use known test vectors
|
ektrah/nsec
|
tests/Algorithms/X25519Tests.cs
|
tests/Algorithms/X25519Tests.cs
|
using System;
using NSec.Cryptography;
using Xunit;
namespace NSec.Tests.Algorithms
{
public static class X25519Tests
{
public static readonly TheoryData<string, string, string> Rfc7748TestVectors = Rfc.X25519Tests.Rfc7748TestVectors;
[Theory]
[MemberData(nameof(Rfc7748TestVectors))]
public static void BitMaskedAgree(string privateKey, string publicKey, string sharedSecret)
{
var a = new X25519();
var kdf = new HkdfSha256();
var pk1 = publicKey.DecodeHex();
var pk2 = publicKey.DecodeHex();
pk1[pk1.Length - 1] &= 0x7F;
pk2[pk2.Length - 1] |= 0x80;
using (var k = Key.Import(a, privateKey.DecodeHex(), KeyBlobFormat.RawPrivateKey))
using (var sharedSecretExpected = SharedSecret.Import(sharedSecret.DecodeHex()))
using (var sharedSecretActual1 = a.Agree(k, PublicKey.Import(a, pk1, KeyBlobFormat.RawPublicKey)))
using (var sharedSecretActual2 = a.Agree(k, PublicKey.Import(a, pk2, KeyBlobFormat.RawPublicKey)))
{
var expected = kdf.Extract(sharedSecretExpected, ReadOnlySpan<byte>.Empty);
var actual1 = kdf.Extract(sharedSecretActual1, ReadOnlySpan<byte>.Empty);
var actual2 = kdf.Extract(sharedSecretActual2, ReadOnlySpan<byte>.Empty);
Assert.Equal(expected, actual1);
Assert.Equal(expected, actual2);
}
}
[Theory]
[MemberData(nameof(Rfc7748TestVectors))]
public static void BitMaskedEquals(string privateKey, string publicKey, string sharedSecret)
{
var a = new X25519();
var pk1 = publicKey.DecodeHex();
var pk2 = publicKey.DecodeHex();
pk1[pk1.Length - 1] &= 0x7F;
pk2[pk2.Length - 1] |= 0x80;
var p1 = PublicKey.Import(a, pk1, KeyBlobFormat.RawPublicKey);
var p2 = PublicKey.Import(a, pk2, KeyBlobFormat.RawPublicKey);
Assert.True(p1.Equals(p2));
}
}
}
|
using System;
using NSec.Cryptography;
using Xunit;
namespace NSec.Tests.Algorithms
{
public static class X25519Tests
{
[Fact]
public static void BitMasked()
{
var a = new X25519();
var kdf = new HkdfSha256();
using (var kA = new Key(a))
using (var kB = new Key(a))
{
var pk1 = kB.Export(KeyBlobFormat.RawPublicKey);
var pk2 = kB.Export(KeyBlobFormat.RawPublicKey);
pk1[pk1.Length - 1] &= 0x7F;
pk2[pk2.Length - 1] |= 0x80;
using (var s1 = a.Agree(kA, PublicKey.Import(a, pk1, KeyBlobFormat.RawPublicKey)))
using (var s2 = a.Agree(kA, PublicKey.Import(a, pk2, KeyBlobFormat.RawPublicKey)))
{
var b1 = kdf.Extract(s1, ReadOnlySpan<byte>.Empty);
var b2 = kdf.Extract(s2, ReadOnlySpan<byte>.Empty);
Assert.Equal(b1, b2);
}
}
}
[Fact]
public static void BitMaskedEqual()
{
var a = new X25519();
var pk1 = Utilities.RandomBytes.Slice(0, a.PublicKeySize).ToArray();
var pk2 = Utilities.RandomBytes.Slice(0, a.PublicKeySize).ToArray();
pk1[pk1.Length - 1] &= 0x7F;
pk2[pk2.Length - 1] |= 0x80;
var p1 = PublicKey.Import(a, pk1, KeyBlobFormat.RawPublicKey);
var p2 = PublicKey.Import(a, pk2, KeyBlobFormat.RawPublicKey);
Assert.True(p1.Equals(p2));
}
}
}
|
mit
|
C#
|
dc1f3cac6152b430a1739bad231bc4aff2542146
|
add TODO for versioning
|
collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists
|
api/FilterLists.Api/Controllers/ListsController.cs
|
api/FilterLists.Api/Controllers/ListsController.cs
|
using FilterLists.Services;
using Microsoft.AspNetCore.Mvc;
namespace FilterLists.Api.Controllers
{
//TODO: migrate controllers to separate projects by version, use dependency injection
//TODO: automate URL versioning
[Route("v1/[controller]")]
public class ListsController : Controller
{
private readonly IListService _listService;
public ListsController(IListService listService)
{
_listService = listService;
}
// GET lists
[HttpGet]
public IActionResult Get()
{
var result = Json(_listService.GetAll());
return result;
}
}
}
|
using FilterLists.Services;
using Microsoft.AspNetCore.Mvc;
namespace FilterLists.Api.Controllers
{
//TODO: automate URL versioning
[Route("v1/[controller]")]
public class ListsController : Controller
{
private readonly IListService _listService;
public ListsController(IListService listService)
{
_listService = listService;
}
// GET lists
[HttpGet]
public IActionResult Get()
{
var result = Json(_listService.GetAll());
return result;
}
}
}
|
mit
|
C#
|
fd291296110ecfc6a0539069271abc40c07fd2b9
|
Rephrase parsing to the end of input in terms of Map.
|
plioi/parsley
|
src/Parsley/ParserExtensions.cs
|
src/Parsley/ParserExtensions.cs
|
using System.Diagnostics.CodeAnalysis;
namespace Parsley;
public static class ParserExtensions
{
public static bool TryParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
var parseToEnd =
Grammar.Map(parse, Grammar.EndOfInput<TItem>(), (result, _) => result);
return TryPartialParse(parseToEnd, input, out int index, out value, out error);
}
public static bool TryPartialParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
out int index,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
index = 0;
value = parse(input, ref index, out var succeeded, out var expectation);
if (succeeded)
{
error = null;
#pragma warning disable CS8762 // Parameter must have a non-null value when exiting in some condition.
return true;
#pragma warning restore CS8762 // Parameter must have a non-null value when exiting in some condition.
}
error = new ParseError(index, expectation!);
return false;
}
}
|
using System.Diagnostics.CodeAnalysis;
namespace Parsley;
public static class ParserExtensions
{
public static bool TryParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
var parseToEnd =
from result in parse
from end in Grammar.EndOfInput<TItem>()
select result;
return TryPartialParse(parseToEnd, input, out int index, out value, out error);
}
public static bool TryPartialParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
out int index,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
index = 0;
value = parse(input, ref index, out var succeeded, out var expectation);
if (succeeded)
{
error = null;
#pragma warning disable CS8762 // Parameter must have a non-null value when exiting in some condition.
return true;
#pragma warning restore CS8762 // Parameter must have a non-null value when exiting in some condition.
}
error = new ParseError(index, expectation!);
return false;
}
}
|
mit
|
C#
|
cd6e0223e428d7feba5bfd4aeb4369eb26b8ae64
|
add words as well as phrases to the index
|
kreeben/resin,kreeben/resin
|
src/Sir.Store/LatinTokenizer.cs
|
src/Sir.Store/LatinTokenizer.cs
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Sir.Store
{
public class LatinTokenizer : ITokenizer
{
private static char[] _delimiters = new char[] {
'.', ',', '?', '!',
':', ';', '\\', '/',
'\n', '\r', '\t',
'(', ')', '[', ']',
'"', '`', '´', '&'
};
public string ContentType => "*";
public IEnumerable<string> Tokenize(string text)
{
var phrases = Normalize(text)
.Split(_delimiters, StringSplitOptions.RemoveEmptyEntries)
.Where(x=>!string.IsNullOrWhiteSpace(x))
.ToList();
var words = phrases.SelectMany(x => x.Split(' ', StringSplitOptions.RemoveEmptyEntries));
foreach (var phrase in phrases)
{
yield return phrase;
}
foreach (var word in words)
{
yield return word;
}
}
public void Dispose()
{
}
public string Normalize(string text)
{
return text.ToLower(CultureInfo.CurrentCulture);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Sir.Store
{
public class LatinTokenizer : ITokenizer
{
private static char[] _delimiters = new char[] {
'.', ',', '?', '!',
':', ';', '\\', '/',
'\n', '\r', '\t',
'(', ')', '[', ']',
'"', '`', '´', '&'
};
public string ContentType => "*";
public IEnumerable<string> Tokenize(string text)
{
var phrases = Normalize(text)
.Split(_delimiters, StringSplitOptions.RemoveEmptyEntries)
.Where(x=>!string.IsNullOrWhiteSpace(x))
.ToList();
var words = phrases.SelectMany(x => x.Split(' ', StringSplitOptions.RemoveEmptyEntries));
foreach (var phrase in phrases)
{
yield return phrase;
}
//foreach (var word in words)
//{
// yield return word;
//}
}
public void Dispose()
{
}
public string Normalize(string text)
{
return text.ToLower(CultureInfo.CurrentCulture);
}
}
}
|
mit
|
C#
|
1a55ba3556300996bf9bb34d7782bd0a4e010610
|
Put WNDCLASS fields in the correct order
|
AArnott/pinvoke
|
src/User32/User32+WNDCLASSEX.cs
|
src/User32/User32+WNDCLASSEX.cs
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System;
using System.Runtime.InteropServices;
/// <content>
/// Contains the <see cref="WNDCLASSEX"/> nested type.
/// </content>
public partial class User32
{
/// <summary>
/// Contains window class information. It is used with the <see cref="RegisterClassEx"/> and <see cref="GetClassInfoEx"/> functions.
/// The <see cref="WNDCLASSEX"/> structure is similar to the <see cref="WNDCLASS"/> structure. There are two differences. <see cref="WNDCLASSEX"/> includes the <see cref="cbSize"/> member, which specifies the size of the structure, and the <see cref="hIconSm"/> member, which contains a handle to a small icon associated with the window class.
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
[OfferIntPtrPropertyAccessors]
public unsafe partial struct WNDCLASSEX
{
public int cbSize;
public ClassStyles style;
[MarshalAs(UnmanagedType.FunctionPtr)]
public WndProc lpfnWndProc;
public int cbClsExtra;
public int cbWndExtra;
public IntPtr hInstance;
public IntPtr hIcon;
public IntPtr hCursor;
public IntPtr hbrBackground;
public char* lpszMenuName;
public char* lpszClassName;
public IntPtr hIconSm;
public static WNDCLASSEX Create()
{
var nw = default(WNDCLASSEX);
nw.cbSize = Marshal.SizeOf(typeof(WNDCLASSEX));
return nw;
}
}
}
}
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System;
using System.Runtime.InteropServices;
/// <content>
/// Contains the <see cref="WNDCLASSEX"/> nested type.
/// </content>
public partial class User32
{
/// <summary>
/// Contains window class information. It is used with the <see cref="RegisterClassEx"/> and <see cref="GetClassInfoEx"/> functions.
/// The <see cref="WNDCLASSEX"/> structure is similar to the <see cref="WNDCLASS"/> structure. There are two differences. <see cref="WNDCLASSEX"/> includes the <see cref="cbSize"/> member, which specifies the size of the structure, and the <see cref="hIconSm"/> member, which contains a handle to a small icon associated with the window class.
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
[OfferIntPtrPropertyAccessors]
public unsafe partial struct WNDCLASSEX
{
public int cbSize;
public ClassStyles style;
[MarshalAs(UnmanagedType.FunctionPtr)]
public WndProc lpfnWndProc;
public int cbClsExtra;
public int cbWndExtra;
public IntPtr hInstance;
public IntPtr hIcon;
public IntPtr hCursor;
public IntPtr hbrBackground;
public char* lpszClassName;
public char* lpszMenuName;
public IntPtr hIconSm;
public static WNDCLASSEX Create()
{
var nw = default(WNDCLASSEX);
nw.cbSize = Marshal.SizeOf(typeof(WNDCLASSEX));
return nw;
}
}
}
}
|
mit
|
C#
|
30ae321ce657a54e67990ca59a473660ff9ad078
|
Use the correct iteration count in IterationDataAttribute
|
diryboy/roslyn,jasonmalinowski/roslyn,nguerrera/roslyn,dotnet/roslyn,abock/roslyn,AmadeusW/roslyn,VSadov/roslyn,KirillOsenkov/roslyn,aelij/roslyn,AlekseyTs/roslyn,jasonmalinowski/roslyn,tmat/roslyn,davkean/roslyn,wvdd007/roslyn,tannergooding/roslyn,swaroop-sridhar/roslyn,KevinRansom/roslyn,eriawan/roslyn,heejaechang/roslyn,wvdd007/roslyn,brettfo/roslyn,sharwell/roslyn,abock/roslyn,AlekseyTs/roslyn,nguerrera/roslyn,physhi/roslyn,physhi/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,abock/roslyn,KevinRansom/roslyn,panopticoncentral/roslyn,sharwell/roslyn,gafter/roslyn,weltkante/roslyn,genlu/roslyn,wvdd007/roslyn,eriawan/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,mgoertz-msft/roslyn,MichalStrehovsky/roslyn,bartdesmet/roslyn,reaction1989/roslyn,jmarolf/roslyn,aelij/roslyn,mgoertz-msft/roslyn,stephentoub/roslyn,diryboy/roslyn,agocke/roslyn,mavasani/roslyn,agocke/roslyn,ErikSchierboom/roslyn,AlekseyTs/roslyn,panopticoncentral/roslyn,weltkante/roslyn,panopticoncentral/roslyn,stephentoub/roslyn,VSadov/roslyn,brettfo/roslyn,diryboy/roslyn,ErikSchierboom/roslyn,MichalStrehovsky/roslyn,CyrusNajmabadi/roslyn,genlu/roslyn,mgoertz-msft/roslyn,gafter/roslyn,bartdesmet/roslyn,reaction1989/roslyn,AmadeusW/roslyn,swaroop-sridhar/roslyn,weltkante/roslyn,ErikSchierboom/roslyn,eriawan/roslyn,brettfo/roslyn,shyamnamboodiripad/roslyn,KirillOsenkov/roslyn,tannergooding/roslyn,swaroop-sridhar/roslyn,jmarolf/roslyn,reaction1989/roslyn,AmadeusW/roslyn,physhi/roslyn,genlu/roslyn,davkean/roslyn,VSadov/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,davkean/roslyn,tannergooding/roslyn,gafter/roslyn,nguerrera/roslyn,MichalStrehovsky/roslyn,mavasani/roslyn,stephentoub/roslyn,KevinRansom/roslyn,heejaechang/roslyn,dotnet/roslyn,tmat/roslyn,shyamnamboodiripad/roslyn,agocke/roslyn,CyrusNajmabadi/roslyn,sharwell/roslyn,jmarolf/roslyn,mavasani/roslyn,heejaechang/roslyn,KirillOsenkov/roslyn,aelij/roslyn
|
src/VisualStudio/IntegrationTest/TestUtilities/IterationDataAttribute.cs
|
src/VisualStudio/IntegrationTest/TestUtilities/IterationDataAttribute.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.Collections.Generic;
using System.Reflection;
using Xunit.Sdk;
namespace Microsoft.VisualStudio.IntegrationTest.Utilities
{
/// <summary>
/// xUnit data attribute that allows looping tests. The following example shows a test which will run 50 times.
/// <code>
/// [WpfTheory, IterationData(50)]
/// public void IteratingTest(int iteration)
/// {
/// }
/// </code>
/// </summary>
public sealed class IterationDataAttribute : DataAttribute
{
public IterationDataAttribute(int iterations = 100)
{
Iterations = iterations;
}
public int Iterations { get; }
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
{
for (var i = 0; i < Iterations; i++)
{
yield return new object[] { i };
}
}
}
}
|
// 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.Collections.Generic;
using System.Reflection;
using Xunit.Sdk;
namespace Microsoft.VisualStudio.IntegrationTest.Utilities
{
/// <summary>
/// xUnit data attribute that allows looping tests. The following example shows a test which will run 50 times.
/// <code>
/// [WpfTheory, IterationData(50)]
/// public void IteratingTest(int iteration)
/// {
/// }
/// </code>
/// </summary>
public sealed class IterationDataAttribute : DataAttribute
{
public IterationDataAttribute(int iterations = 100)
{
Iterations = 100;
}
public int Iterations { get; }
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
{
for (var i = 0; i < Iterations; i++)
{
yield return new object[] { i };
}
}
}
}
|
mit
|
C#
|
5524f52ad4eb918d086db5e4dd6b1699948cf5d5
|
Bump to 0.5
|
github-for-unity/Unity,github-for-unity/Unity,mpOzelot/Unity,mpOzelot/Unity,github-for-unity/Unity
|
common/SolutionInfo.cs
|
common/SolutionInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.5.0.0";
}
}
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.4.0.0";
}
}
|
mit
|
C#
|
733dadcdc6592368394d02bc70820bf7cc900165
|
Bump version to 0.30.6
|
github-for-unity/Unity,github-for-unity/Unity,github-for-unity/Unity
|
common/SolutionInfo.cs
|
common/SolutionInfo.cs
|
#pragma warning disable 436
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017-2018")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.30.6";
}
}
|
#pragma warning disable 436
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017-2018")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.30.5";
}
}
|
mit
|
C#
|
462e67b44215491d30c669a3f45853cd336dcf67
|
update mongolab uri access method
|
WebmarksApp/webmarks.nancy,WebmarksApp/webmarks.nancy,WebmarksApp/webmarks.nancy
|
webmarks.nancy/Bootstrapper.cs
|
webmarks.nancy/Bootstrapper.cs
|
using MongoDB.Driver;
using Nancy;
using Nancy.Conventions;
using Nancy.TinyIoc;
using System;
using System.Configuration;
using webmarks.nancy.Models;
namespace webmarks.nancy
{
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureConventions(NancyConventions nancyConventions)
{
base.ConfigureConventions(nancyConventions);
//Conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("/", @"public"));
}
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
base.ConfigureApplicationContainer(container);
//var connString = "mongodb://localhost:27017";
//var connString = Environment.GetEnvironmentVariable("MONGOLAB_URI");
var connString = ConfigurationManager.AppSettings.Get("MONGOLAB_URI");
var databaseName = "speakersdb";
var mongoClient = new MongoClient(connString);
//MongoServer server = mongoClient.GetServer();
var database = mongoClient.GetDatabase(databaseName);
var collection = database.GetCollection<Speaker>("speakers");
container.Register(database);
container.Register(collection);
}
}
}
|
using MongoDB.Driver;
using Nancy;
using Nancy.Conventions;
using Nancy.TinyIoc;
using System;
using webmarks.nancy.Models;
namespace webmarks.nancy
{
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureConventions(NancyConventions nancyConventions)
{
base.ConfigureConventions(nancyConventions);
//Conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("/", @"public"));
}
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
base.ConfigureApplicationContainer(container);
//var connString = "mongodb://localhost:27017";
var connString = Environment.GetEnvironmentVariable("MONGOLAB_URI");
var databaseName = "speakersdb";
var mongoClient = new MongoClient(connString);
//MongoServer server = mongoClient.GetServer();
var database = mongoClient.GetDatabase(databaseName);
var collection = database.GetCollection<Speaker>("speakers");
container.Register(database);
container.Register(collection);
}
}
}
|
mit
|
C#
|
41a77e3b3a46fcf75f82082990f9619cc9008a32
|
Fix tab names on node views
|
jeddytier4/Opserver,manesiotise/Opserver,mqbk/Opserver,opserver/Opserver,mqbk/Opserver,jeddytier4/Opserver,manesiotise/Opserver,rducom/Opserver,GABeech/Opserver,GABeech/Opserver,manesiotise/Opserver,opserver/Opserver,rducom/Opserver,opserver/Opserver
|
Opserver/Views/Dashboard/CurrentStatusTypes.cs
|
Opserver/Views/Dashboard/CurrentStatusTypes.cs
|
using System.ComponentModel;
namespace StackExchange.Opserver.Views.Dashboard
{
public enum CurrentStatusTypes
{
[Description("None")]
None = 0,
[Description("Stats")]
Stats = 1,
[Description("Interfaces")]
Interfaces = 2,
[Description("VM Info")]
VMHost = 3,
[Description("Elastic")]
Elastic = 4,
[Description("HAProxy")]
HAProxy = 5,
[Description("SQL Instance")]
SQLInstance = 6,
[Description("Active SQL")]
SQLActive = 7,
[Description("Top SQL")]
SQLTop = 8,
[Description("Redis Info")]
Redis = 9
}
}
|
using System.ComponentModel;
namespace StackExchange.Opserver.Views.Dashboard
{
public enum CurrentStatusTypes
{
[Description("None")]
None = 0,
Stats = 1,
Interfaces = 2,
[Description("VM Info")]
VMHost = 3,
[Description("Elastic")]
Elastic = 4,
HAProxy = 5,
[Description("SQL Instance")]
SQLInstance = 6,
[Description("Active SQL")]
SQLActive = 7,
[Description("Top SQL")]
SQLTop = 8,
[Description("Redis Info")]
Redis = 9
}
}
|
mit
|
C#
|
b534c845698fb2c18d7103df485e061f50c7886d
|
Add the time as a title to the order notes date.
|
ucdavis/Purchasing,ucdavis/Purchasing,ucdavis/Purchasing
|
Purchasing.Mvc/Views/Order/_ReviewNotes.cshtml
|
Purchasing.Mvc/Views/Order/_ReviewNotes.cshtml
|
@model ReviewOrderViewModel
<section id="notes" class="ui-corner-all display-form">
<header class="ui-corner-top ui-widget-header">
<div class="col1 showInNav">Order Notes</div>
<div class="col2">
<a href="#" class="button" id="add-note">Add Note</a>
</div>
</header>
<div class="section-contents">
@if (!Model.Comments.Any())
{
<span class="notes-not-found">There Are No Notes Attached To This Order</span>
}
<table class="noicon">
<tbody>
@foreach (var notes in Model.Comments.OrderBy(o => o.DateCreated))
{
<tr>
<td title="@notes.DateCreated.ToString("T")">@notes.DateCreated.ToString("d")</td>
<td>@notes.Text</td>
<td>@notes.User.FullName</td>
</tr>
}
</tbody>
</table>
</div>
@*<footer class="ui-corner-bottom"></footer>*@
</section>
<div id="notes-dialog" title="Add Order Notes" style="display:none;">
<textarea id="notes-box" style="width: 370px; height: 110px;"></textarea>
</div>
<script id="comment-template" type="text/x-jquery-tmpl">
<tr>
<td>${datetime}</td>
<td>${txt}</td>
<td>${user}</td>
</tr>
</script>
|
@model ReviewOrderViewModel
<section id="notes" class="ui-corner-all display-form">
<header class="ui-corner-top ui-widget-header">
<div class="col1 showInNav">Order Notes</div>
<div class="col2">
<a href="#" class="button" id="add-note">Add Note</a>
</div>
</header>
<div class="section-contents">
@if (!Model.Comments.Any())
{
<span class="notes-not-found">There Are No Notes Attached To This Order</span>
}
<table class="noicon">
<tbody>
@foreach (var notes in Model.Comments.OrderBy(o => o.DateCreated))
{
<tr>
<td>@notes.DateCreated.ToString("d")</td>
<td>@notes.Text</td>
<td>@notes.User.FullName</td>
</tr>
}
</tbody>
</table>
</div>
@*<footer class="ui-corner-bottom"></footer>*@
</section>
<div id="notes-dialog" title="Add Order Notes" style="display:none;">
<textarea id="notes-box" style="width: 370px; height: 110px;"></textarea>
</div>
<script id="comment-template" type="text/x-jquery-tmpl">
<tr>
<td>${datetime}</td>
<td>${txt}</td>
<td>${user}</td>
</tr>
</script>
|
mit
|
C#
|
1305ae754ab061b98befb0fadb8460c8604b8fb6
|
Add resources to the automated tests too
|
ZLima12/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,default0/osu-framework,peppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,default0/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,Tom94/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework
|
osu.Framework.Tests/AutomatedVisualTestGame.cs
|
osu.Framework.Tests/AutomatedVisualTestGame.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.IO.Stores;
using osu.Framework.Testing;
namespace osu.Framework.Tests
{
public class AutomatedVisualTestGame : Game
{
[BackgroundDependencyLoader]
private void load()
{
Resources.AddStore(new NamespacedResourceStore<byte[]>(new DllResourceStore(@"osu.Framework.Tests.exe"), "Resources"));
}
public AutomatedVisualTestGame()
{
Add(new TestBrowserTestRunner(new TestBrowser()));
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Testing;
namespace osu.Framework.Tests
{
public class AutomatedVisualTestGame : Game
{
public AutomatedVisualTestGame()
{
Add(new TestBrowserTestRunner(new TestBrowser()));
}
}
}
|
mit
|
C#
|
23eb1c655ce3b2dd5f6bea7e5f68bdc4d111fe8e
|
Add missing description
|
UselessToucan/osu,peppy/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,NeoAdonis/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,smoogipooo/osu,ppy/osu
|
osu.Game.Rulesets.Osu/Mods/OsuModBarrelRoll.cs
|
osu.Game.Rulesets.Osu/Mods/OsuModBarrelRoll.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModBarrelRoll : Mod, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
{
[SettingSource("Roll speed", "Rotations per minute")]
public BindableNumber<double> SpinSpeed { get; } = new BindableDouble(0.5)
{
MinValue = 0.02,
MaxValue = 4,
Precision = 0.01,
};
public override string Name => "Barrel Roll";
public override string Acronym => "BR";
public override string Description => "The whole playfield is on a wheel!";
public override double ScoreMultiplier => 1;
public void Update(Playfield playfield)
{
playfield.Rotation = 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
}
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
// scale the playfield to allow all hitobjects to stay within the visible region.
drawableRuleset.Playfield.Scale = new Vector2(OsuPlayfield.BASE_SIZE.Y / OsuPlayfield.BASE_SIZE.X);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModBarrelRoll : Mod, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
{
[SettingSource("Roll speed", "Rotations per minute")]
public BindableNumber<double> SpinSpeed { get; } = new BindableDouble(0.5)
{
MinValue = 0.02,
MaxValue = 4,
Precision = 0.01,
};
public override string Name => "Barrel Roll";
public override string Acronym => "BR";
public override double ScoreMultiplier => 1;
public void Update(Playfield playfield)
{
playfield.Rotation = 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
}
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
// scale the playfield to allow all hitobjects to stay within the visible region.
drawableRuleset.Playfield.Scale = new Vector2(OsuPlayfield.BASE_SIZE.Y / OsuPlayfield.BASE_SIZE.X);
}
}
}
|
mit
|
C#
|
e801ad514bacd08de9b09f4669278ac51a777223
|
Fix ruleset nullref
|
NeoAdonis/osu,ppy/osu,peppy/osu-new,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,peppy/osu,smoogipooo/osu,smoogipoo/osu,NeoAdonis/osu,EVAST9919/osu,NeoAdonis/osu,EVAST9919/osu,ppy/osu,2yangk23/osu,ppy/osu,2yangk23/osu,peppy/osu,UselessToucan/osu
|
osu.Game/Tests/Visual/ModPerfectTestScene.cs
|
osu.Game/Tests/Visual/ModPerfectTestScene.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions.TypeExtensions;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Scoring;
namespace osu.Game.Tests.Visual
{
public abstract class ModPerfectTestScene : ModSandboxTestScene
{
private readonly Ruleset ruleset;
private readonly ModPerfect perfectMod;
protected ModPerfectTestScene(Ruleset ruleset, ModPerfect perfectMod)
: base(ruleset)
{
this.ruleset = ruleset;
this.perfectMod = perfectMod;
}
protected void CreateHitObjectTest(HitObjectTestCase testCaseData, bool shouldMiss) => CreateModTest(new ModTestCaseData(testCaseData.HitObject.GetType().ReadableName(), perfectMod)
{
Beatmap = new Beatmap
{
BeatmapInfo = { Ruleset = ruleset.RulesetInfo },
HitObjects = { testCaseData.HitObject }
},
Autoplay = !shouldMiss,
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testCaseData.FailOnMiss)
});
protected sealed override TestPlayer CreateReplayPlayer(Score score) => new PerfectModTestPlayer(score);
private class PerfectModTestPlayer : TestPlayer
{
public PerfectModTestPlayer(Score score)
: base(score)
{
}
protected override bool AllowFail => true;
public bool CheckFailed(bool failed)
{
if (!failed)
return ScoreProcessor.HasCompleted && !HealthProcessor.HasFailed;
return ScoreProcessor.JudgedHits > 0 && HealthProcessor.HasFailed;
}
}
protected class HitObjectTestCase
{
public readonly HitObject HitObject;
public readonly bool FailOnMiss;
public HitObjectTestCase(HitObject hitObject, bool failOnMiss = true)
{
HitObject = hitObject;
FailOnMiss = failOnMiss;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions.TypeExtensions;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Scoring;
namespace osu.Game.Tests.Visual
{
public abstract class ModPerfectTestScene : ModSandboxTestScene
{
private readonly ModPerfect perfectMod;
protected ModPerfectTestScene(Ruleset ruleset, ModPerfect perfectMod)
: base(ruleset)
{
this.perfectMod = perfectMod;
}
protected void CreateHitObjectTest(HitObjectTestCase testCaseData, bool shouldMiss) => CreateModTest(new ModTestCaseData(testCaseData.HitObject.GetType().ReadableName(), perfectMod)
{
Beatmap = new Beatmap
{
BeatmapInfo = { Ruleset = Ruleset.Value },
HitObjects = { testCaseData.HitObject }
},
Autoplay = !shouldMiss,
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testCaseData.FailOnMiss)
});
protected sealed override TestPlayer CreateReplayPlayer(Score score) => new PerfectModTestPlayer(score);
private class PerfectModTestPlayer : TestPlayer
{
public PerfectModTestPlayer(Score score)
: base(score)
{
}
protected override bool AllowFail => true;
public bool CheckFailed(bool failed)
{
if (!failed)
return ScoreProcessor.HasCompleted && !HealthProcessor.HasFailed;
return ScoreProcessor.JudgedHits > 0 && HealthProcessor.HasFailed;
}
}
protected class HitObjectTestCase
{
public readonly HitObject HitObject;
public readonly bool FailOnMiss;
public HitObjectTestCase(HitObject hitObject, bool failOnMiss = true)
{
HitObject = hitObject;
FailOnMiss = failOnMiss;
}
}
}
}
|
mit
|
C#
|
1657c3573b2280378da91729c49d2bd5ccbe1ca0
|
update _Layout.cshtml css to style.css
|
MarkPieszak/AspNETCore-Vue-starter,MarkPieszak/AspNETCore-Vue-starter
|
content/Views/Shared/_Layout.cshtml
|
content/Views/Shared/_Layout.cshtml
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - aspnetcore_Vue_starter</title>
<link rel="stylesheet" href="~/dist/vendor.css" asp-append-version="true" />
<environment names="Staging,Production">
<link rel="stylesheet" href="~/dist/style.css" asp-append-version="true" />
</environment>
</head>
<body>
@RenderBody()
<script src="~/dist/vendor.js" asp-append-version="true"></script>
@RenderSection("scripts", required: false)
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - aspnetcore_Vue_starter</title>
<link rel="stylesheet" href="~/dist/vendor.css" asp-append-version="true" />
<environment names="Staging,Production">
<link rel="stylesheet" href="~/dist/site.css" asp-append-version="true" />
</environment>
</head>
<body>
@RenderBody()
<script src="~/dist/vendor.js" asp-append-version="true"></script>
@RenderSection("scripts", required: false)
</body>
</html>
|
mit
|
C#
|
b4c0948f35c360f3791eb1dd96a537226c4a56bc
|
fix up ut
|
paulvanbrenk/nodejstools,zhoffice/nodejstools,mousetraps/nodejstools,bowdenk7/nodejstools,munyirik/nodejstools,hoanhtien/nodejstools,mousetraps/nodejstools,AustinHull/nodejstools,paladique/nodejstools,np83/nodejstools,Microsoft/nodejstools,chanchaldabriya/nodejstools,kant2002/nodejstools,bowdenk7/nodejstools,necroscope/nodejstools,munyirik/nodejstools,paulvanbrenk/nodejstools,avitalb/nodejstools,nareshjo/nodejstools,ahmad-farid/nodejstools,paulvanbrenk/nodejstools,redabakr/nodejstools,AustinHull/nodejstools,munyirik/nodejstools,chanchaldabriya/nodejstools,Microsoft/nodejstools,paulvanbrenk/nodejstools,hoanhtien/nodejstools,lukedgr/nodejstools,munyirik/nodejstools,Microsoft/nodejstools,lukedgr/nodejstools,bossvn/nodejstools,zhoffice/nodejstools,redabakr/nodejstools,hoanhtien/nodejstools,kant2002/nodejstools,hoanhtien/nodejstools,avitalb/nodejstools,nareshjo/nodejstools,mauricionr/nodejstools,hagb4rd/nodejstools,mousetraps/nodejstools,avitalb/nodejstools,redabakr/nodejstools,kant2002/nodejstools,mauricionr/nodejstools,mjbvz/nodejstools,bossvn/nodejstools,necroscope/nodejstools,mauricionr/nodejstools,bowdenk7/nodejstools,lukedgr/nodejstools,np83/nodejstools,zhoffice/nodejstools,bowdenk7/nodejstools,mjbvz/nodejstools,mousetraps/nodejstools,redabakr/nodejstools,bossvn/nodejstools,necroscope/nodejstools,chanchaldabriya/nodejstools,AustinHull/nodejstools,ahmad-farid/nodejstools,chanchaldabriya/nodejstools,mousetraps/nodejstools,hagb4rd/nodejstools,nareshjo/nodejstools,munyirik/nodejstools,nareshjo/nodejstools,paladique/nodejstools,hagb4rd/nodejstools,bossvn/nodejstools,paladique/nodejstools,hagb4rd/nodejstools,avitalb/nodejstools,bossvn/nodejstools,mauricionr/nodejstools,chanchaldabriya/nodejstools,zhoffice/nodejstools,avitalb/nodejstools,hoanhtien/nodejstools,AustinHull/nodejstools,redabakr/nodejstools,zhoffice/nodejstools,necroscope/nodejstools,mjbvz/nodejstools,kant2002/nodejstools,mjbvz/nodejstools,hagb4rd/nodejstools,kant2002/nodejstools,lukedgr/nodejstools,ahmad-farid/nodejstools,lukedgr/nodejstools,nareshjo/nodejstools,np83/nodejstools,paulvanbrenk/nodejstools,AustinHull/nodejstools,Microsoft/nodejstools,np83/nodejstools,ahmad-farid/nodejstools,paladique/nodejstools,np83/nodejstools,mjbvz/nodejstools,necroscope/nodejstools,Microsoft/nodejstools,paladique/nodejstools,bowdenk7/nodejstools,mauricionr/nodejstools,ahmad-farid/nodejstools
|
Nodejs/Tests/TestAdapterTests/NodejsTestInfoTests.cs
|
Nodejs/Tests/TestAdapterTests/NodejsTestInfoTests.cs
|
using Microsoft.NodejsTools.TestAdapter.TestFrameworks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TestAdapterTests {
[TestClass]
public class NodejsTestInfoTests {
[TestMethod, Priority(0)]
public void ConstructFullyQualifiedName_ValidInput() {
//Arrange
string testFile = "c:\\dummyWhatever.js";
string testSuiteName = "testsuite1";
string testName = "myMochaTest";
string testFramework = "mocha";
//Act
NodejsTestInfo testInfo = new NodejsTestInfo(testFile, testName, testSuiteName, testFramework);
//Assert
string expected = testFile + "::" + testName + "::" + testFramework;
Assert.AreEqual(expected, testInfo.FullyQualifiedName);
Assert.AreEqual(testName, testInfo.TestName);
Assert.AreEqual(testFramework, testInfo.TestFramework);
Assert.AreEqual(testFile, testInfo.ModulePath);
Assert.AreEqual(testName, testInfo.TestName);
}
[TestMethod, Priority(0)]
[ExpectedException(typeof(System.ArgumentException))]
public void ConstructFromQualifiedName_ThrowOnInValidInput() {
//Arrange
string badDummy = "c:\\dummy.js::dummy::dumm2::test1";
//Act
NodejsTestInfo testInfo = new NodejsTestInfo(badDummy);
//Assert: N/A
}
}
}
|
using Microsoft.NodejsTools.TestAdapter.TestFrameworks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TestAdapterTests {
[TestClass]
public class NodejsTestInfoTests {
[TestMethod, Priority(0)]
public void ConstructFullyQualifiedName_ValidInput() {
//Arrange
string testFile = "c:\\dummyWhatever.js";
string testSuiteName = "testsuite1";
string testName = "myMochaTest";
string testFramework = "mocha";
//Act
NodejsTestInfo testInfo = new NodejsTestInfo(testFile, testName, testSuiteName, testFramework);
//Assert
string expected = testFile + "::" + testSuiteName + "::" + testName + "::" + testFramework;
Assert.AreEqual(expected, testInfo.FullyQualifiedName);
Assert.AreEqual(testName, testInfo.TestName);
Assert.AreEqual(testFramework, testInfo.TestFramework);
Assert.AreEqual(testFile, testInfo.ModulePath);
Assert.AreEqual(testName, testInfo.TestName);
}
[TestMethod, Priority(0)]
[ExpectedException(typeof(System.ArgumentException))]
public void ConstructFromQualifiedName_ThrowOnInValidInput() {
//Arrange
string badDummy = "c:\\dummy.js::dummy::test1";
//Act
NodejsTestInfo testInfo = new NodejsTestInfo(badDummy);
//Assert: N/A
}
}
}
|
apache-2.0
|
C#
|
e88aee85b5afc5db04a79fb7a19bf240961211fe
|
update prefab path in test
|
DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit.Tests/PlayModeTests/CoreServicesTests.cs
|
Assets/MixedRealityToolkit.Tests/PlayModeTests/CoreServicesTests.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#if !WINDOWS_UWP
// When the .NET scripting backend is enabled and C# projects are built
// The assembly that this file is part of is still built for the player,
// even though the assembly itself is marked as a test assembly (this is not
// expected because test assemblies should not be included in player builds).
// Because the .NET backend is deprecated in 2018 and removed in 2019 and this
// issue will likely persist for 2018, this issue is worked around by wrapping all
// play mode tests in this check.
using Microsoft.MixedReality.Toolkit.CameraSystem;
using NUnit.Framework;
using System;
using System.Collections;
using UnityEditor;
using UnityEngine;
using UnityEngine.TestTools;
namespace Microsoft.MixedReality.Toolkit.Tests
{
public class CoreServicesTests
{
/// <summary>
/// Test if we can register and deregister a core MRTK service
/// </summary>
/// <returns>enumerator for Unity</returns>
[UnityTest]
public IEnumerator TestDynamicServices()
{
UnityEngine.Object cameraSystemPrefab = AssetDatabase.LoadAssetAtPath("Assets/MixedRealityToolkit.SDK/Experimental/ServiceManagers/Camera/Prefabs/CameraSystem.prefab", typeof(UnityEngine.Object));
Assert.IsNull(CoreServices.CameraSystem);
GameObject cameraSystem1 = UnityEngine.Object.Instantiate(cameraSystemPrefab) as GameObject;
Assert.IsNotNull(CoreServices.CameraSystem);
// Destroying the prefab will cause the CameraSystemManager to unregister the Camera System
UnityEngine.Object.DestroyImmediate(cameraSystem1);
Assert.IsTrue(CoreServices.ResetCacheReference(typeof(IMixedRealityCameraSystem)));
// Force garbage collection
GC.Collect();
GC.WaitForPendingFinalizers();
yield return new WaitForSeconds(1.0f);
Assert.IsNull(CoreServices.CameraSystem);
GameObject cameraSystem2 = UnityEngine.Object.Instantiate(cameraSystemPrefab) as GameObject;
Assert.IsNotNull(CoreServices.CameraSystem);
}
}
}
#endif
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#if !WINDOWS_UWP
// When the .NET scripting backend is enabled and C# projects are built
// The assembly that this file is part of is still built for the player,
// even though the assembly itself is marked as a test assembly (this is not
// expected because test assemblies should not be included in player builds).
// Because the .NET backend is deprecated in 2018 and removed in 2019 and this
// issue will likely persist for 2018, this issue is worked around by wrapping all
// play mode tests in this check.
using Microsoft.MixedReality.Toolkit.CameraSystem;
using NUnit.Framework;
using System;
using System.Collections;
using UnityEditor;
using UnityEngine;
using UnityEngine.TestTools;
namespace Microsoft.MixedReality.Toolkit.Tests
{
public class CoreServicesTests
{
/// <summary>
/// Test if we can register and deregister a core MRTK service
/// </summary>
/// <returns>enumerator for Unity</returns>
[UnityTest]
public IEnumerator TestDynamicServices()
{
UnityEngine.Object cameraSystemPrefab = AssetDatabase.LoadAssetAtPath("Assets/MixedRealityToolkit.SDK/Experimental/Features/Camera/Prefabs/CameraSystem.prefab", typeof(UnityEngine.Object));
Assert.IsNull(CoreServices.CameraSystem);
GameObject cameraSystem1 = UnityEngine.Object.Instantiate(cameraSystemPrefab) as GameObject;
Assert.IsNotNull(CoreServices.CameraSystem);
// Destroying the prefab will cause the CameraSystemManager to unregister the Camera System
UnityEngine.Object.DestroyImmediate(cameraSystem1);
Assert.IsTrue(CoreServices.ResetCacheReference(typeof(IMixedRealityCameraSystem)));
// Force garbage collection
GC.Collect();
GC.WaitForPendingFinalizers();
yield return new WaitForSeconds(1.0f);
Assert.IsNull(CoreServices.CameraSystem);
GameObject cameraSystem2 = UnityEngine.Object.Instantiate(cameraSystemPrefab) as GameObject;
Assert.IsNotNull(CoreServices.CameraSystem);
}
}
}
#endif
|
mit
|
C#
|
896088bc0281fc3bb69b883beb9380439df77f2b
|
Remove using
|
DrabWeb/osu,peppy/osu-new,smoogipoo/osu,EVAST9919/osu,NeoAdonis/osu,ppy/osu,ppy/osu,smoogipoo/osu,smoogipooo/osu,ZLima12/osu,ZLima12/osu,2yangk23/osu,NeoAdonis/osu,DrabWeb/osu,johnneijzen/osu,ppy/osu,peppy/osu,UselessToucan/osu,2yangk23/osu,DrabWeb/osu,smoogipoo/osu,peppy/osu,johnneijzen/osu,EVAST9919/osu,UselessToucan/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu
|
osu.Game.Tests/Visual/TestCaseDirectPanel.cs
|
osu.Game.Tests/Visual/TestCaseDirectPanel.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays.Direct;
using osu.Game.Rulesets.Osu;
using osu.Game.Tests.Beatmaps;
using osuTK;
namespace osu.Game.Tests.Visual
{
public class TestCaseDirectPanel : OsuTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(DirectGridPanel),
typeof(DirectListPanel),
typeof(IconPill)
};
[BackgroundDependencyLoader]
private void load()
{
var beatmap = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo, null);
beatmap.BeatmapSetInfo.OnlineInfo.HasVideo = true;
beatmap.BeatmapSetInfo.OnlineInfo.HasStoryboard = true;
Child = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Padding = new MarginPadding(20),
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
new DirectGridPanel(beatmap.BeatmapSetInfo),
new DirectListPanel(beatmap.BeatmapSetInfo)
}
};
}
}
}
|
// 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 System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Overlays.Direct;
using osu.Game.Rulesets.Osu;
using osu.Game.Tests.Beatmaps;
using osuTK;
namespace osu.Game.Tests.Visual
{
public class TestCaseDirectPanel : OsuTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(DirectGridPanel),
typeof(DirectListPanel),
typeof(IconPill)
};
[BackgroundDependencyLoader]
private void load()
{
var beatmap = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo, null);
beatmap.BeatmapSetInfo.OnlineInfo.HasVideo = true;
beatmap.BeatmapSetInfo.OnlineInfo.HasStoryboard = true;
Child = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Padding = new MarginPadding(20),
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
new DirectGridPanel(beatmap.BeatmapSetInfo),
new DirectListPanel(beatmap.BeatmapSetInfo)
}
};
}
}
}
|
mit
|
C#
|
45679fa29e3b683bd77b7f250071f32aed3aad4b
|
fix typo in test/[...]/index.cshtml
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer.Plugins.Test/Views/TestExtension/Index.cshtml
|
BTCPayServer.Plugins.Test/Views/TestExtension/Index.cshtml
|
@model BTCPayServer.Plugins.Test.TestPluginPageViewModel
<section>
<div class="container">
<h1>Challenge Completed!!</h1>
Here is also an image loaded from the plugin<br/>
<a href="https://twitter.com/NicolasDorier/status/1307221679014256640">
<img src="/Resources/img/screengrab.png"/>
</a>
<div class="row">
<h2>Persisted Data</h2>
<p>The following is data persisted to the configured database but in an isolated DbContext. Every time you start BTCPay Server with this plugin enabled, a timestamp is logged.</p>
<ul class="list-group">
@foreach (var item in Model.Data)
{
<li class="list-group-item">@item.Id at @item.Timestamp.ToString("F")</li>
}
</ul>
</div>
</div>
</section>
|
@model BTCPayServer.Plugins.Test.TestPluginPageViewModel
<section>
<div class="container">
<h1>Challenge Completed!!</h1>
Here is also an image loaded from the plugin<br/>
<a href="https://twitter.com/NicolasDorier/status/1307221679014256640">
<img src="/Resources/img/screengrab.png"/>
</a>
<div class="row">
<h2>Persisted Data</h2>
<p>The following is data persisted to the configured database but in an isolated DbContext. Every time you start BTCPayw with this plugin enabled, a timestamp is logged.</p>
<ul class="list-group">
@foreach (var item in Model.Data)
{
<li class="list-group-item">@item.Id at @item.Timestamp.ToString("F")</li>
}
</ul>
</div>
</div>
</section>
|
mit
|
C#
|
b2b4202f0cfb75361844731ab3d9a2073c1010aa
|
add GetCommentTest
|
Taylorgrohs/.NET-SoloProject,Taylorgrohs/.NET-SoloProject,Taylorgrohs/.NET-SoloProject
|
SoloProject/SoloProject.Tests/ModelTests/PostTest.cs
|
SoloProject/SoloProject.Tests/ModelTests/PostTest.cs
|
using SoloProject.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace SoloProject.Tests
{
public class PostTest
{
[Fact]
public void GetContentTest()
{
//Arrange
var post = new Post();
post.Content = "Wash the dog";
//Act
var result = post.Content;
//Assert
Assert.Equal("Wash the dog", result);
}
[Fact]
public void GetCommentTest()
{
var comment = new Comment();
comment.CommentBody = "Test";
var result = comment.CommentBody;
Assert.Equal("Test", result);
}
}
}
|
using SoloProject.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace SoloProject.Tests
{
public class PostTest
{
[Fact]
public void GetContentTest()
{
//Arrange
var post = new Post();
post.Content = "Wash the dog";
//Act
var result = post.Content;
//Assert
Assert.Equal("Wash the dog", result);
}
[Fact]
public void GetComment()
{
var post = new Post();
post.Content = "Today";
post.PostId = 1;
var comment = new Comment();
comment.CommentBody = "Test";
comment.PostId = 1;
}
}
}
|
mit
|
C#
|
dc1fac7874aff38b802f4ad50aa39b0ae3c7a73a
|
comment about improving animation framework
|
MichaelAquilina/Some-2D-RPG,littleboss/Some-2D-RPG
|
DivineRightConcept/DivineRightConcept/Drawing/Animation.cs
|
DivineRightConcept/DivineRightConcept/Drawing/Animation.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace DivineRightConcept.Drawing
{
/// <summary>
/// Animation class that allows the user to specify an animation from a texture
/// </summary>
//TODO: Specify start time. This way, the animation can be reset from its start point
//rather than looping based solely on the GameTime.
public class Animation
{
public Texture2D SpriteSheet { get; set; }
public Rectangle[] Frames { get; set; }
public int FrameChange { get; set; }
public Animation(Texture2D SpriteSheet, Rectangle[] Frames, int FrameChange=100)
{
this.SpriteSheet = SpriteSheet;
this.Frames = Frames;
this.FrameChange = FrameChange;
}
public Rectangle GetCurrentFrame(GameTime GameTime)
{
int index = (int)(GameTime.TotalGameTime.TotalMilliseconds / FrameChange);
return Frames[index % Frames.Length];
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace DivineRightConcept.Drawing
{
/// <summary>
/// Animation class that allows the user to specify an animation from a texture
/// </summary>
public class Animation
{
public Texture2D SpriteSheet { get; set; }
public Rectangle[] Frames { get; set; }
public int FrameChange { get; set; }
public Animation(Texture2D SpriteSheet, Rectangle[] Frames, int FrameChange=100)
{
this.SpriteSheet = SpriteSheet;
this.Frames = Frames;
this.FrameChange = FrameChange;
}
public Rectangle GetCurrentFrame(GameTime GameTime)
{
int index = (int)(GameTime.TotalGameTime.TotalMilliseconds / FrameChange);
return Frames[index % Frames.Length];
}
}
}
|
mit
|
C#
|
2c5c8cae426cf5d393f3be98703445bcdd2b18ce
|
Update ApplicationInsightsEventTelemeter.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Analytics/Telemetry/ApplicationInsightsEventTelemeter.cs
|
TIKSN.Core/Analytics/Telemetry/ApplicationInsightsEventTelemeter.cs
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.DataContracts;
namespace TIKSN.Analytics.Telemetry
{
public class ApplicationInsightsEventTelemeter : IEventTelemeter
{
public Task TrackEvent(string name)
{
try
{
var telemetry = new EventTelemetry(name);
ApplicationInsightsHelper.TrackEvent(telemetry);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
return Task.FromResult<object>(null);
}
public Task TrackEvent(string name, IDictionary<string, string> properties)
{
try
{
var telemetry = new EventTelemetry(name);
foreach (var property in properties)
{
telemetry.Properties.Add(property);
}
ApplicationInsightsHelper.TrackEvent(telemetry);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
return Task.FromResult<object>(null);
}
}
}
|
using Microsoft.ApplicationInsights.DataContracts;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
namespace TIKSN.Analytics.Telemetry
{
public class ApplicationInsightsEventTelemeter : IEventTelemeter
{
public Task TrackEvent(string name)
{
try
{
var telemetry = new EventTelemetry(name);
ApplicationInsightsHelper.TrackEvent(telemetry);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
return Task.FromResult<object>(null);
}
public Task TrackEvent(string name, IDictionary<string, string> properties)
{
try
{
var telemetry = new EventTelemetry(name);
foreach (var property in properties)
telemetry.Properties.Add(property);
ApplicationInsightsHelper.TrackEvent(telemetry);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
return Task.FromResult<object>(null);
}
}
}
|
mit
|
C#
|
3564279836dbe13da43331018a365e8529e62f67
|
Update TokenReplacerBase.cs
|
remember664/Sitecore.RestSharp,remember664/Sitecore.RestSharp
|
Sitecore.RestSharp/Tokens/TokenReplacerBase.cs
|
Sitecore.RestSharp/Tokens/TokenReplacerBase.cs
|
/*
Copyright 2013 Sergey Oleynik
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
namespace Sitecore.RestSharp.Tokens
{
using Sitecore.Diagnostics;
using global::RestSharp;
public abstract class TokenReplacerBase : ITokenReplacer
{
public string Token { get; protected set; }
protected TokenReplacerBase(string token)
{
Assert.ArgumentNotNullOrEmpty(token, "token");
this.Token = token;
}
public virtual void ReplaceToken(IRestRequest request)
{
request.AddUrlSegment(this.Token, this.GetValue(request));
}
protected abstract string GetValue(IRestRequest request);
}
}
|
/*
Copyright 2013 Sergey Oleynik
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
namespace Sitecore.RestSharp.Tokens
{
using Sitecore.Diagnostics;
using global::RestSharp;
public abstract class TokenReplacerBase : ITokenReplacer
{
private readonly string token;
public string Token
{
get { return token; }
}
protected TokenReplacerBase(string token)
{
Assert.ArgumentNotNullOrEmpty(token, "token");
this.token = token;
}
public virtual void ReplaceToken(IRestRequest request)
{
request.AddUrlSegment(this.Token, this.GetValue(request));
}
protected abstract string GetValue(IRestRequest request);
}
}
|
apache-2.0
|
C#
|
e37308df5d75f16e332bc53eb5c3619bd0c51782
|
Fix fault in AssemblyHandlerIterator; attribute read issue
|
HelloKitty/Booma.Proxy
|
src/Booma.Proxy.Client.Unity.Consolidated/IoC/AssemblyHandlerIterator.cs
|
src/Booma.Proxy.Client.Unity.Consolidated/IoC/AssemblyHandlerIterator.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using Reflect.Extent;
namespace Booma.Proxy
{
public class AssemblyHandlerIterator<THandlerTypeProvider> : IEnumerable<Type>
where THandlerTypeProvider : IMessageHandlerTypeContainable, new()
{
public GameSceneType GameSceneTypeSearchingFor { get; }
/// <inheritdoc />
public AssemblyHandlerIterator(GameSceneType gameSceneTypeSearchingFor)
{
if(!Enum.IsDefined(typeof(GameSceneType), gameSceneTypeSearchingFor)) throw new InvalidEnumArgumentException(nameof(gameSceneTypeSearchingFor), (int)gameSceneTypeSearchingFor, typeof(GameSceneType));
GameSceneTypeSearchingFor = gameSceneTypeSearchingFor;
}
/// <inheritdoc />
public IEnumerator<Type> GetEnumerator()
{
THandlerTypeProvider provider = new THandlerTypeProvider();
//Now, we have to iterate the handler Types from the container
foreach(Type handlerType in provider.AssemblyDefinedHandlerTyped)
{
//TODO: Improve efficiency of all this reflection we are doing.
IEnumerable<SceneTypeCreateAttribute> attributes = handlerType.GetCustomAttributes<SceneTypeCreateAttribute>(false);
//We just skip now instead. For ease, maybe revert
if(attributes == null || !attributes.Any()) //don't use base attributes
continue;
//if(!handlerType.HasAttribute<NetworkMessageHandlerAttribute>())
// throw new InvalidOperationException($"Found Handler: {handlerType.Name} with missing/no {nameof(NetworkMessageHandlerAttribute)}. All handlers must have.");
bool isForSceneType = DetermineIfHandlerIsForSceneType(handlerType, GameSceneTypeSearchingFor);
if(isForSceneType)
yield return handlerType;
else
continue;
}
yield break;
}
/// <inheritdoc />
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
private static bool DetermineIfHandlerIsForSceneType(Type handlerType, GameSceneType sceneType)
{
//We don't want to get base attributes
//devs may want to inherit from a handler and change some stuff. But not register it as a handler
//for the same stuff obviously.
foreach(SceneTypeCreateAttribute attris in handlerType.GetCustomAttributes<SceneTypeCreateAttribute>(false))
{
if(attris.SceneType == sceneType)
return true;
}
return false;
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using Reflect.Extent;
namespace Booma.Proxy
{
public class AssemblyHandlerIterator<THandlerTypeProvider> : IEnumerable<Type>
where THandlerTypeProvider : IMessageHandlerTypeContainable, new()
{
public GameSceneType GameSceneTypeSearchingFor { get; }
/// <inheritdoc />
public AssemblyHandlerIterator(GameSceneType gameSceneTypeSearchingFor)
{
if(!Enum.IsDefined(typeof(GameSceneType), gameSceneTypeSearchingFor)) throw new InvalidEnumArgumentException(nameof(gameSceneTypeSearchingFor), (int)gameSceneTypeSearchingFor, typeof(GameSceneType));
GameSceneTypeSearchingFor = gameSceneTypeSearchingFor;
}
/// <inheritdoc />
public IEnumerator<Type> GetEnumerator()
{
THandlerTypeProvider provider = new THandlerTypeProvider();
//Now, we have to iterate the handler Types from the container
foreach(Type handlerType in provider.AssemblyDefinedHandlerTyped)
{
//We just skip now instead. For ease, maybe revert
if(handlerType.GetCustomAttribute<SceneTypeCreateAttribute>(false) == null) //don't use base attributes
continue;
//if(!handlerType.HasAttribute<NetworkMessageHandlerAttribute>())
// throw new InvalidOperationException($"Found Handler: {handlerType.Name} with missing/no {nameof(NetworkMessageHandlerAttribute)}. All handlers must have.");
bool isForSceneType = DetermineIfHandlerIsForSceneType(handlerType, GameSceneTypeSearchingFor);
if(isForSceneType)
yield return handlerType;
else
continue;
}
yield break;
}
/// <inheritdoc />
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
private static bool DetermineIfHandlerIsForSceneType(Type handlerType, GameSceneType sceneType)
{
//We don't want to get base attributes
//devs may want to inherit from a handler and change some stuff. But not register it as a handler
//for the same stuff obviously.
foreach(SceneTypeCreateAttribute attris in handlerType.GetCustomAttributes<SceneTypeCreateAttribute>(false))
{
if(attris.SceneType == sceneType)
return true;
}
return false;
}
}
}
|
agpl-3.0
|
C#
|
934d3acf850e1b9e64fb6e3969632605c19122d8
|
Increment version number to sync up with NuGet
|
jcvandan/XeroAPI.Net,TDaphneB/XeroAPI.Net,MatthewSteeples/XeroAPI.Net,XeroAPI/XeroAPI.Net
|
source/XeroApi/Properties/AssemblyInfo.cs
|
source/XeroApi/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("XeroApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xero")]
[assembly: AssemblyProduct("XeroApi")]
[assembly: AssemblyCopyright("Copyright © Xero 2011")]
[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("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")]
// 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.7")]
[assembly: AssemblyFileVersion("1.0.0.7")]
|
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("XeroApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xero")]
[assembly: AssemblyProduct("XeroApi")]
[assembly: AssemblyCopyright("Copyright © Xero 2011")]
[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("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")]
// 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.5")]
[assembly: AssemblyFileVersion("1.0.0.6")]
|
mit
|
C#
|
73cdc0f7225994cca93fa9d1c439d37361d34881
|
Fix ExponentialBackoff helper
|
carbon/Amazon
|
src/Amazon.Core/Scheduling/RetryPolicy.cs
|
src/Amazon.Core/Scheduling/RetryPolicy.cs
|
using System;
namespace Amazon.Scheduling
{
public abstract class RetryPolicy
{
public abstract bool ShouldRetry(int retryCount);
public abstract TimeSpan GetDelay(int retryCount);
public static ExponentialBackoffRetryPolicy ExponentialBackoff(TimeSpan initialDelay, TimeSpan maxDelay, int maxRetries = 3)
{
return new ExponentialBackoffRetryPolicy(initialDelay, maxDelay, maxRetries);
}
}
}
|
using System;
namespace Amazon.Scheduling
{
public abstract class RetryPolicy
{
public abstract bool ShouldRetry(int retryCount);
public abstract TimeSpan GetDelay(int retryCount);
public static ExponentialBackoffRetryPolicy ExponentialBackoff(TimeSpan initialDelay, TimeSpan maxDelay, int maxRetries = 3)
{
return new ExponentialBackoffRetryPolicy(initialDelay, maxDelay);
}
}
}
|
mit
|
C#
|
86341eccb5b1c64344dba885411c8694dc8f794a
|
Remove obsolete code
|
martijn00/XamarinMediaManager,bubavanhalen/XamarinMediaManager,martijn00/XamarinMediaManager,mike-rowley/XamarinMediaManager,modplug/XamarinMediaManager,mike-rowley/XamarinMediaManager
|
MediaManager/Plugin.MediaManager.iOS/MediaManagerImplementation.cs
|
MediaManager/Plugin.MediaManager.iOS/MediaManagerImplementation.cs
|
using Plugin.MediaManager.Abstractions;
using Plugin.MediaManager.Abstractions.Implementations;
namespace Plugin.MediaManager
{
/// <summary>
/// Implementation for MediaManager
/// </summary>
public class MediaManagerImplementation : MediaManagerBase
{
private IAudioPlayer _audioPlayer;
private IVideoPlayer _videoPlayer;
public override IAudioPlayer AudioPlayer
{
get { return _audioPlayer ?? (_audioPlayer = new AudioPlayerImplementation(VolumeManager)); }
set { _audioPlayer = value; }
}
public override IVideoPlayer VideoPlayer
{
get { return _videoPlayer ?? (_videoPlayer = new VideoPlayerImplementation(VolumeManager)); }
set { _videoPlayer = value; }
}
public override IMediaNotificationManager MediaNotificationManager { get; set; } = new MediaNotificationManagerImplementation();
public override IMediaExtractor MediaExtractor { get; set; } = new MediaExtractorImplementation();
public override IVolumeManager VolumeManager { get; set; } = new VolumeManagerImplementation();
}
}
|
using Plugin.MediaManager.Abstractions;
using Plugin.MediaManager.Abstractions.Implementations;
namespace Plugin.MediaManager
{
/// <summary>
/// Implementation for MediaManager
/// </summary>
public class MediaManagerImplementation : MediaManagerBase
{
private IAudioPlayer _audioPlayer;
private IVolumeManager _volumeManager;
private IVideoPlayer _videoPlayer;
public MediaManagerImplementation()
{
_volumeManager = new VolumeManagerImplementation();
_audioPlayer = new AudioPlayerImplementation(_volumeManager);
_videoPlayer = new VideoPlayerImplementation(_volumeManager);
}
public override IAudioPlayer AudioPlayer
{
get { return _audioPlayer ?? (_audioPlayer = new AudioPlayerImplementation(VolumeManager)); }
set { _audioPlayer = value; }
}
public override IVideoPlayer VideoPlayer
{
get { return _videoPlayer ?? (_videoPlayer = new VideoPlayerImplementation(VolumeManager)); }
set { _videoPlayer = value; }
}
public override IMediaNotificationManager MediaNotificationManager { get; set; } = new MediaNotificationManagerImplementation();
public override IMediaExtractor MediaExtractor { get; set; } = new MediaExtractorImplementation();
public override IVolumeManager VolumeManager
{
get { return _volumeManager ?? (_volumeManager = new VolumeManagerImplementation()); }
set { _volumeManager = value; }
}
}
}
|
mit
|
C#
|
2fe723e189b10f69c43f5748f26f60b34bea6689
|
Update WeeklyXamarin.cs
|
beraybentesen/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,stvansolano/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,stvansolano/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin
|
src/Firehose.Web/Authors/WeeklyXamarin.cs
|
src/Firehose.Web/Authors/WeeklyXamarin.cs
|
using Firehose.Web.Infrastructure;
using System;
using System.Collections.Generic;
namespace Firehose.Web.Authors
{
public class WeeklyXamarin : IAmACommunityMember
{
public string FirstName => "Weekly";
public string LastName => "Xamarin";
public string StateOrRegion => "Internet";
public string EmailAddress => "inbox@weeklyxamarin.com";
public string Title => "newsletter that contains a weekly hand-picked round up of the best mobile development links and resources. Curated by Geoffrey Huntley. Free.";
public Uri WebSite => new Uri("https://www.weeklyxamarin.com");
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://weeklyxamarin.com/issues.rss"); }
}
public string TwitterHandle => "weeklyxamarin";
public string GravatarHash => "";
}
}
|
using Firehose.Web.Infrastructure;
using System;
using System.Collections.Generic;
namespace Firehose.Web.Authors
{
public class WeeklyXamarin : IAmACommunityMember
{
public string FirstName => "Weekly";
public string LastName => "Xamarin";
public string StateOrRegion => "Internet";
public string EmailAddress => "inbox@weeklyxamarin.com";
public string Title => "newsletter that contains a weekly hand-picked round up of the best development links. Curated by Geoffrey Huntley";
public Uri WebSite => new Uri("https://www.weeklyxamarin.com");
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://weeklyxamarin.com/issues.rss"); }
}
public string TwitterHandle => "weeklyxamarin";
public string GravatarHash => "";
}
}
|
mit
|
C#
|
02cf55bc730a13da6176a696a62216e1b4905a49
|
Convert ToWords' tests to theory
|
micdenny/Humanizer,aloisdg/Humanizer,Flatlineato/Humanizer,micdenny/Humanizer,preetksingh80/Humanizer,llehouerou/Humanizer,henriksen/Humanizer,gyurisc/Humanizer,mexx/Humanizer,CodeFromJordan/Humanizer,kikoanis/Humanizer,gyurisc/Humanizer,schalpat/Humanizer,llehouerou/Humanizer,kikoanis/Humanizer,ErikSchierboom/Humanizer,hazzik/Humanizer,preetksingh80/Humanizer,jaxx-rep/Humanizer,mrchief/Humanizer,CodeFromJordan/Humanizer,mrchief/Humanizer,thunsaker/Humanizer,CodeFromJordan/Humanizer,Flatlineato/Humanizer,mrchief/Humanizer,MehdiK/Humanizer,GeorgeHahn/Humanizer,HalidCisse/Humanizer,HalidCisse/Humanizer,GeorgeHahn/Humanizer,thunsaker/Humanizer,nigel-sampson/Humanizer,schalpat/Humanizer,henriksen/Humanizer,HalidCisse/Humanizer,ErikSchierboom/Humanizer,nigel-sampson/Humanizer,llehouerou/Humanizer,mexx/Humanizer,preetksingh80/Humanizer,thunsaker/Humanizer
|
src/Humanizer.Tests/NumberToWordsTests.cs
|
src/Humanizer.Tests/NumberToWordsTests.cs
|
using Xunit;
using Xunit.Extensions;
namespace Humanizer.Tests
{
public class NumberToWordsTests
{
[InlineData(1, "one")]
[InlineData(10, "ten")]
[InlineData(11, "eleven")]
[InlineData(122, "one hundred and twenty-two")]
[InlineData(3501, "three thousand five hundred and one")]
[InlineData(100, "one hundred")]
[InlineData(1000, "one thousand")]
[InlineData(100000, "one hundred thousand")]
[InlineData(1000000, "one million")]
[Theory]
public void Test(int number, string expected)
{
Assert.Equal(expected, number.ToWords());
}
}
}
|
using Xunit;
namespace Humanizer.Tests
{
public class NumberToWordsTests
{
[Fact]
public void ToWords()
{
Assert.Equal("one", 1.ToWords());
Assert.Equal("ten", 10.ToWords());
Assert.Equal("eleven", 11.ToWords());
Assert.Equal("one hundred and twenty-two", 122.ToWords());
Assert.Equal("three thousand five hundred and one", 3501.ToWords());
}
[Fact]
public void RoundNumbersHaveNoSpaceAtTheEnd()
{
Assert.Equal("one hundred", 100.ToWords());
Assert.Equal("one thousand", 1000.ToWords());
Assert.Equal("one hundred thousand", 100000.ToWords());
Assert.Equal("one million", 1000000.ToWords());
}
}
}
|
mit
|
C#
|
0b87b7123410f712ff56a8538680992dfcec6e57
|
Mark the ConstAttribute as not inherited
|
FonsDijkstra/CConst
|
CConst/CConst/ConstAttribute.cs
|
CConst/CConst/ConstAttribute.cs
|
using System;
namespace FonsDijkstra.CConst
{
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class ConstAttribute : Attribute
{
}
}
|
using System;
namespace FonsDijkstra.CConst
{
[AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class ConstAttribute : Attribute
{
}
}
|
mit
|
C#
|
394a09311e2456c2a98aa310455c2f3ce8f07417
|
Use the same type variable for all three database servers
|
jazd/Business,jazd/Business,jazd/Business
|
CSharp/SchemaVersion/Program.cs
|
CSharp/SchemaVersion/Program.cs
|
using System;
using Business.Core;
using Business.Core.Profile;
namespace Version
{
class MainClass
{
public static void Main(string[] args) {
Console.WriteLine("Hello World!");
var profile = new Profile();
IDatabase database;
database = new Business.Core.SQLite.Database(profile);
Console.WriteLine($"SQLite\t\t{database.SchemaVersion()}");
database.Connection.Close();
database = new Business.Core.PostgreSQL.Database(profile);
Console.WriteLine($"PostgreSQL\t{database.SchemaVersion()}");
database.Connection.Close();
database = new Business.Core.NuoDB.Database(profile);
Console.WriteLine($"NuoDB\t\t{database.SchemaVersion()}");
database.Connection.Close();
}
}
}
|
using System;
using Business.Core.Profile;
namespace Version
{
class MainClass
{
public static void Main(string[] args) {
Console.WriteLine("Hello World!");
var profile = new Profile();
var sqlitedatabase = new Business.Core.SQLite.Database(profile);
Console.WriteLine($"SQLite\t\t{sqlitedatabase.SchemaVersion()}");
sqlitedatabase.Connection.Close();
var pgsqldatabase = new Business.Core.PostgreSQL.Database(profile);
Console.WriteLine($"PostgreSQL\t{pgsqldatabase.SchemaVersion()}");
pgsqldatabase.Connection.Close();
var nuodbdatabase = new Business.Core.NuoDB.Database(profile);
Console.WriteLine($"NuoDB\t\t{nuodbdatabase.SchemaVersion()}");
nuodbdatabase.Connection.Close();
}
}
}
|
mit
|
C#
|
86977f1cf0bfffd6c82878fda347f07323b786c7
|
Add Type Forward (dotnet/coreclr#23036)
|
wtgodbe/corefx,ericstj/corefx,ptoonen/corefx,ptoonen/corefx,ViktorHofer/corefx,ViktorHofer/corefx,ViktorHofer/corefx,shimingsg/corefx,wtgodbe/corefx,shimingsg/corefx,ViktorHofer/corefx,wtgodbe/corefx,ericstj/corefx,wtgodbe/corefx,ptoonen/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,ericstj/corefx,ericstj/corefx,ptoonen/corefx,ViktorHofer/corefx,ericstj/corefx,ericstj/corefx,wtgodbe/corefx,BrennanConroy/corefx,BrennanConroy/corefx,ptoonen/corefx,BrennanConroy/corefx,shimingsg/corefx,ViktorHofer/corefx,ptoonen/corefx,shimingsg/corefx,wtgodbe/corefx,ViktorHofer/corefx,ptoonen/corefx,shimingsg/corefx,wtgodbe/corefx
|
src/Common/src/CoreLib/System/Runtime/AmbiguousImplementationException.cs
|
src/Common/src/CoreLib/System/Runtime/AmbiguousImplementationException.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Globalization;
using System.Runtime.Serialization;
namespace System.Runtime
{
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public sealed class AmbiguousImplementationException : Exception
{
public AmbiguousImplementationException()
: base(SR.AmbiguousImplementationException_NullMessage)
{
HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
}
public AmbiguousImplementationException(string message)
: base(message)
{
HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
}
public AmbiguousImplementationException(string message, Exception innerException)
: base(message, innerException)
{
HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
}
private AmbiguousImplementationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Globalization;
using System.Runtime.Serialization;
namespace System.Runtime
{
[Serializable]
public sealed class AmbiguousImplementationException : Exception
{
public AmbiguousImplementationException()
: base(SR.AmbiguousImplementationException_NullMessage)
{
HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
}
public AmbiguousImplementationException(string message)
: base(message)
{
HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
}
public AmbiguousImplementationException(string message, Exception innerException)
: base(message, innerException)
{
HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
}
private AmbiguousImplementationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
|
mit
|
C#
|
8d3c341008665da213fd5abfbb393d3dc9e26a22
|
Improve login error handling
|
Esri/arcgis-runtime-demos-dotnet
|
src/OfflineWorkflowsSample/OfflineWorkflowsSample/Views/LoginPage.xaml.cs
|
src/OfflineWorkflowsSample/OfflineWorkflowsSample/Views/LoginPage.xaml.cs
|
using System;
using System.Threading.Tasks;
using Esri.ArcGISRuntime.Portal;
using OfflineWorkflowSample.ViewModels;
using OfflineWorkflowSample.Views;
using OfflineWorkflowsSample;
using Windows.ApplicationModel.Core;
using Windows.UI;
using Windows.UI.Popups;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace OfflineWorkflowSample
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class LoginPage : Page, IWindowService
{
public LoginPage()
{
InitializeComponent();
ExtendAcrylicIntoTitleBar();
ViewModel.WindowService = null;
ViewModel.CompletedLogin += sender => Login();
// Configure the title bar.
Window.Current.SetTitleBar(DraggablePart);
ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.Black;
}
private LoginViewModel ViewModel => (LoginViewModel) Resources["ViewModel"];
public void LaunchItem(Item item)
{
throw new InvalidOperationException("Can't launch item - not logged in.");
}
public void NavigateToLoginPage()
{
return;
}
public void NavigateToPageForItem(Item item)
{
throw new InvalidOperationException("Can't navigate to item - not logged in.");
}
public void SetBusy(bool isBusy)
{
return;
}
public void SetBusyMessage(string message)
{
return;
}
public async Task ShowAlertAsync(string message)
{
var messageDialog = new MessageDialog(message);
await messageDialog.ShowAsync();
}
public async Task ShowAlertAsync(string message, string title)
{
var messageDialog = new MessageDialog(message, title);
await messageDialog.ShowAsync();
}
private void ExtendAcrylicIntoTitleBar()
{
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
}
private void Login()
{
// Navigate to the main page, passing the view model as an argument.
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.Navigate(typeof(NavigationPage), ViewModel);
}
}
}
|
using OfflineWorkflowSample.ViewModels;
using OfflineWorkflowSample.Views;
using Windows.ApplicationModel.Core;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace OfflineWorkflowSample
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class LoginPage : Page
{
public LoginPage()
{
InitializeComponent();
ExtendAcrylicIntoTitleBar();
ViewModel.WindowService = null;
ViewModel.CompletedLogin += sender => Login();
// Configure the title bar.
Window.Current.SetTitleBar(DraggablePart);
ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.Black;
}
private LoginViewModel ViewModel => (LoginViewModel) Resources["ViewModel"];
private void ExtendAcrylicIntoTitleBar()
{
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
}
private void Login()
{
// Navigate to the main page, passing the view model as an argument.
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.Navigate(typeof(NavigationPage), ViewModel);
}
}
}
|
apache-2.0
|
C#
|
a2e02455b1ffd22be97513cfb1da45665d167407
|
Implement IEncodingFactory #451
|
mpostol/OPC-UA-OOI
|
Networking/DataRepository/AzureGatewayUnitTest/PartDataManagementSetupUnitTest.cs
|
Networking/DataRepository/AzureGatewayUnitTest/PartDataManagementSetupUnitTest.cs
|
//___________________________________________________________________________________
//
// Copyright (C) 2020, Mariusz Postol LODZ POLAND.
//
// To be in touch join the community at GITTER: https://gitter.im/mpostol/OPC-UA-OOI
//___________________________________________________________________________________
using CommonServiceLocator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using UAOOI.Networking.SemanticData;
namespace UAOOI.Networking.DataRepository.AzureGateway.Test
{
[TestClass]
public class PartDataManagementSetupUnitTest
{
[TestMethod]
public void ConstructorTest()
{
Mock<ServiceLocatorImplBase> _ServiceLocatorProviderMocq = new Mock<ServiceLocatorImplBase>();
Mock<IEncodingFactory> _IEncodingFactoryMock = new Mock<IEncodingFactory>();
ServiceLocator.SetLocatorProvider(() => _ServiceLocatorProviderMocq.Object);
_ServiceLocatorProviderMocq.Setup(x => x.GetInstance<IEncodingFactory>()).Returns(_IEncodingFactoryMock.Object);
bool _disposingFlag = false;
int _dosposingCount = 0;
using (PartDataManagementSetup _newInstance = new PartDataManagementSetup())
{
_newInstance.DisposeCheck(x => { _disposingFlag = x; _dosposingCount++; });
Assert.IsNotNull(_newInstance.BindingFactory);
Assert.IsNotNull(_newInstance.ConfigurationFactory);
Assert.IsNotNull(_newInstance.EncodingFactory);
Assert.AreSame(_IEncodingFactoryMock.Object, _newInstance.EncodingFactory);
Assert.IsNull(_newInstance.MessageHandlerFactory);
ServiceLocator.SetLocatorProvider(() => null);
}
Assert.AreEqual<int>(1, _dosposingCount);
Assert.IsTrue(_disposingFlag);
}
}
}
|
//___________________________________________________________________________________
//
// Copyright (C) 2020, Mariusz Postol LODZ POLAND.
//
// To be in touch join the community at GITTER: https://gitter.im/mpostol/OPC-UA-OOI
//___________________________________________________________________________________
using CommonServiceLocator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
namespace UAOOI.Networking.DataRepository.AzureGateway.Test
{
[TestClass]
public class PartDataManagementSetupUnitTest
{
[TestMethod]
public void ConstructorTest()
{
Mock<ServiceLocatorImplBase> _ServiceLocatorProviderMocq = new Mock<ServiceLocatorImplBase>();
ServiceLocator.SetLocatorProvider(() => _ServiceLocatorProviderMocq.Object);
bool _disposingFlag = false;
int _dosposingCount = 0;
using (PartDataManagementSetup _newInstance = new PartDataManagementSetup())
{
_newInstance.DisposeCheck(x => { _disposingFlag = x; _dosposingCount++; });
Assert.IsNotNull(_newInstance.BindingFactory);
Assert.IsNotNull(_newInstance.ConfigurationFactory);
Assert.IsNull(_newInstance.EncodingFactory);
Assert.IsNull(_newInstance.MessageHandlerFactory);
ServiceLocator.SetLocatorProvider(() => null);
}
Assert.AreEqual<int>(1, _dosposingCount);
Assert.IsTrue(_disposingFlag);
}
}
}
|
mit
|
C#
|
533a3b7c876fd58de498411badfd39a2a8c3d54b
|
update file version to 2.3.0.1
|
JKennedy24/Xamarin.Forms.GoogleMaps,amay077/Xamarin.Forms.GoogleMaps,JKennedy24/Xamarin.Forms.GoogleMaps
|
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs
|
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs
|
using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2018";
public const string Trademark = "";
public const string Version = "2.3.0.1";
}
}
|
using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2018";
public const string Trademark = "";
public const string Version = "2.3.0.0";
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.