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 |
|---|---|---|---|---|---|---|---|---|
99298f472ba7f5deb7707abc268f2963798c4254
|
Increment version code
|
akorb/SteamShutdown
|
SteamShutdown/Properties/AssemblyInfo.cs
|
SteamShutdown/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("SteamShutdown")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SteamShutdown")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[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("10eaad6a-d668-405a-9e9d-bab3026395ec")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.5")]
[assembly: AssemblyFileVersion("2.3.5")]
|
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("SteamShutdown")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SteamShutdown")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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("10eaad6a-d668-405a-9e9d-bab3026395ec")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.4")]
[assembly: AssemblyFileVersion("2.3.4")]
|
mit
|
C#
|
5fc6196bef3c6f641d7040ba6140d28988b8270e
|
Remove length object from all JSON messages
|
mstrother/BmpListener
|
BmpListener/Bgp/BgpMessage.cs
|
BmpListener/Bgp/BgpMessage.cs
|
using System;
using System.Linq;
using Newtonsoft.Json;
namespace BmpListener.Bgp
{
public abstract class BgpMessage
{
protected BgpMessage(ref ArraySegment<byte> data)
{
var bgpHeader = new BgpHeader(data);
Type = bgpHeader.Type;
var offset = data.Offset + 19;
Length = (int) bgpHeader.Length;
data = new ArraySegment<byte>(data.Array, offset, Length - 19);
}
[JsonIgnore]
public int Length { get; }
[JsonIgnore]
public MessageType Type { get; }
public abstract void DecodeFromBytes(ArraySegment<byte> data);
public static BgpMessage GetBgpMessage(ArraySegment<byte> data)
{
var msgType = (MessageType) data.ElementAt(18);
switch (msgType)
{
case MessageType.Open:
return new BgpOpenMessage(data);
case MessageType.Update:
return new BgpUpdateMessage(data);
case MessageType.Notification:
return new BgpNotification(data);
case MessageType.Keepalive:
throw new NotImplementedException();
case MessageType.RouteRefresh:
throw new NotImplementedException();
default:
throw new NotImplementedException();
}
}
}
}
|
using System;
using System.Linq;
using Newtonsoft.Json;
namespace BmpListener.Bgp
{
public abstract class BgpMessage
{
protected BgpMessage(ref ArraySegment<byte> data)
{
var bgpHeader = new BgpHeader(data);
Type = bgpHeader.Type;
var offset = data.Offset + 19;
Length = (int) bgpHeader.Length;
data = new ArraySegment<byte>(data.Array, offset, Length - 19);
}
public int Length { get; }
[JsonIgnore]
public MessageType Type { get; }
public abstract void DecodeFromBytes(ArraySegment<byte> data);
public static BgpMessage GetBgpMessage(ArraySegment<byte> data)
{
var msgType = (MessageType) data.ElementAt(18);
switch (msgType)
{
case MessageType.Open:
return new BgpOpenMessage(data);
case MessageType.Update:
return new BgpUpdateMessage(data);
case MessageType.Notification:
return new BgpNotification(data);
case MessageType.Keepalive:
throw new NotImplementedException();
case MessageType.RouteRefresh:
throw new NotImplementedException();
default:
throw new NotImplementedException();
}
}
}
}
|
mit
|
C#
|
a8b9c836d6805cd903722df2c270327dc31b83f6
|
Add missing lock
|
AzureAD/microsoft-authentication-library-for-dotnet,AzureAD/microsoft-authentication-library-for-dotnet,AzureAD/microsoft-authentication-library-for-dotnet,AzureAD/azure-activedirectory-library-for-dotnet,AzureAD/microsoft-authentication-library-for-dotnet
|
msal/src/Microsoft.Identity.Client/Internal/ModuleInitializer.cs
|
msal/src/Microsoft.Identity.Client/Internal/ModuleInitializer.cs
|
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// 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 Microsoft.Identity.Core;
using System;
namespace Microsoft.Identity.Client.Internal
{
/// <summary>
/// Initializes the MSAL module. This can be considered an entry point into MSAL
/// for initialization purposes.
/// </summary>
/// <remarks>
/// The CLR defines a module initializer, however this is not implemented in C# and to
/// use this it would require IL weaving, which does not seem to work on all target frameworks.
/// Instead, call <see cref="EnsureModuleInitialized"/> from static ctors of public entry points.
/// </remarks>
internal class ModuleInitializer
{
private static bool isInitialized = false;
private static object lockObj;
static ModuleInitializer()
{
lockObj = new object();
}
public static void EnsureModuleInitialized()
{
lock (lockObj)
{
if (!isInitialized)
{
CoreExceptionFactory.Instance = new MsalExceptionFactory();
#if !FACADE
CoreLoggerBase.Default = new MsalLogger(Guid.Empty, null);
#endif
isInitialized = true;
}
}
}
}
}
|
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// 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 Microsoft.Identity.Core;
using System;
namespace Microsoft.Identity.Client.Internal
{
/// <summary>
/// Initializes the MSAL module. This can be considered an entry point into MSAL
/// for initialization purposes.
/// </summary>
/// <remarks>
/// The CLR defines a module initializer, however this is not implemented in C# and to
/// use this it would require IL weaving, which does not seem to work on all target frameworks.
/// Instead, call <see cref="EnsureModuleInitialized"/> from static ctors of public entry points.
/// </remarks>
internal class ModuleInitializer
{
private static bool isInitialized = false;
private static object lockObj;
static ModuleInitializer()
{
lockObj = new object();
}
public static void EnsureModuleInitialized()
{
if (!isInitialized)
{
CoreExceptionFactory.Instance = new MsalExceptionFactory();
#if !FACADE
CoreLoggerBase.Default = new MsalLogger(Guid.Empty, null);
#endif
isInitialized = true;
}
}
}
}
|
mit
|
C#
|
89880d4dadc429058ca857e08c50b38ce71c0962
|
Set correct command
|
wieslawsoltes/AvaloniaBehaviors,wieslawsoltes/AvaloniaBehaviors,XamlBehaviors/XamlBehaviors,XamlBehaviors/XamlBehaviors
|
samples/XamlTestApplicationPcl/ViewModels/MainWindowViewModel.cs
|
samples/XamlTestApplicationPcl/ViewModels/MainWindowViewModel.cs
|
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Windows.Input;
using XamlTestApplication.ViewModels.Core;
namespace XamlTestApplication.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
private int _count;
private double _position;
public int Count
{
get { return _count; }
set
{
if (value != _count)
{
_count = value;
OnPropertyChanged(nameof(Count));
}
}
}
public double Position
{
get { return _position; }
set
{
if (value != _position)
{
_position = value;
OnPropertyChanged(nameof(Position));
}
}
}
public ICommand MoveLeftCommand { get; set; }
public ICommand MoveRightCommand { get; set; }
public ICommand ResetMoveCommand { get; set; }
public MainWindowViewModel()
{
Count = 0;
Position = 100.0;
MoveLeftCommand = new Command((param) => Position -= 5.0);
MoveRightCommand = new Command((param) => Position += 5.0);
ResetMoveCommand = new Command((param) => Position = 100.0);
}
public void IncrementCount()
{
Count++;
}
public void DecrementCount(object sender, object parameter)
{
Count--;
}
}
}
|
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Windows.Input;
using XamlTestApplication.ViewModels.Core;
namespace XamlTestApplication.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
private int _count;
private double _position;
public int Count
{
get { return _count; }
set
{
if (value != _count)
{
_count = value;
OnPropertyChanged(nameof(Count));
}
}
}
public double Position
{
get { return _position; }
set
{
if (value != _position)
{
_position = value;
OnPropertyChanged(nameof(Position));
}
}
}
public ICommand MoveLeftCommand { get; set; }
public ICommand MoveRightCommand { get; set; }
public ICommand ResetMoveCommand { get; set; }
public MainWindowViewModel()
{
Count = 0;
Position = 100.0;
MoveLeftCommand = new Command((param) => Position -= 5.0);
MoveRightCommand = new Command((param) => Position += 5.0);
MoveLeftCommand = new Command((param) => Position = 0.0);
}
public void IncrementCount()
{
Count++;
}
public void DecrementCount(object sender, object parameter)
{
Count--;
}
}
}
|
mit
|
C#
|
35512dc3a8b9b313a00f9cb9dedfd3c0da8a674c
|
use minified version of JS
|
smbc-digital/iag-webapp,smbc-digital/iag-webapp,smbc-digital/iag-webapp
|
src/StockportWebapp/Views/stockportgov/Shared/MultiSelect.cshtml
|
src/StockportWebapp/Views/stockportgov/Shared/MultiSelect.cshtml
|
@model StockportWebapp.ViewModels.MultiSelect
<input type="hidden" id="@Model.ValueControlId-limit" value="@Model.Limit" />
<input type="hidden" class="multi-select-control" value="@Model.ValueControlId" />
@for (var i = 1; i <= Model.Limit; i++)
{
<div class="grid-100 grid-parent @Model.ValueControlId-div">
<select class="form-control grid-50 tablet-grid-80 mobile-grid-90 @Model.ValueControlId-select" name="@Model.InputName" title="@Model.Label">
<option value="">
Select @Model.Label.ToLower()
</option>
@foreach (var item in Model.AvailableValues)
{
<option value="@item">@item</option>
}
</select>
<div class="grid-50 mobile-grid-10 tablet-grid-20 @Model.ValueControlId-remove" style="display: none">
<a href="javascript:void(0);" class="@Model.ValueControlId-remove-link" aria-label="Remove @Model.Label.ToLower()"><span class="fa fa-times-circle fa-2x" style="display: inline-block; vertical-align: middle; line-height: 1.5" aria-hidden="true"></span></a>
</div>
<div class="grid-100 tablet-grid-100 mobile-grid-100">
<a href="javascript:void(0);" class="@Model.ValueControlId-add" style="display: none"><span class="fa fa-plus-circle" aria-hidden="true"></span> Add another @Model.Label.ToLower()</a>
</div>
</div>
}
<script>
require(['/assets/javascript/stockportgov/config.min.js'], function() {
require(['multiSelect.min'],
function(multiSelect) {
multiSelect.Init("CategoriesList");
}
);
});
</script>
|
@model StockportWebapp.ViewModels.MultiSelect
<input type="hidden" id="@Model.ValueControlId-limit" value="@Model.Limit" />
<input type="hidden" class="multi-select-control" value="@Model.ValueControlId" />
@for (var i = 1; i <= Model.Limit; i++)
{
<div class="grid-100 grid-parent @Model.ValueControlId-div">
<select class="form-control grid-50 tablet-grid-80 mobile-grid-90 @Model.ValueControlId-select" name="@Model.InputName" title="@Model.Label">
<option value="">
Select @Model.Label.ToLower()
</option>
@foreach (var item in Model.AvailableValues)
{
<option value="@item">@item</option>
}
</select>
<div class="grid-50 mobile-grid-10 tablet-grid-20 @Model.ValueControlId-remove" style="display: none">
<a href="javascript:void(0);" class="@Model.ValueControlId-remove-link" aria-label="Remove @Model.Label.ToLower()"><span class="fa fa-times-circle fa-2x" style="display: inline-block; vertical-align: middle; line-height: 1.5" aria-hidden="true"></span></a>
</div>
<div class="grid-100 tablet-grid-100 mobile-grid-100">
<a href="javascript:void(0);" class="@Model.ValueControlId-add" style="display: none"><span class="fa fa-plus-circle" aria-hidden="true"></span> Add another @Model.Label.ToLower()</a>
</div>
</div>
}
<script>
require(['/assets/javascript/stockportgov/config.min.js'], function() {
require(['multiSelect'],
function(multiSelect) {
multiSelect.Init("CategoriesList");
}
);
});
</script>
|
mit
|
C#
|
2046cbe2d987fa12b46f6acfcd40a91a5cb283f1
|
Add missing exceptions to server xmldoc
|
UselessToucan/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipoo/osu,smoogipooo/osu,ppy/osu,ppy/osu,peppy/osu,UselessToucan/osu,peppy/osu
|
osu.Game/Online/RealtimeMultiplayer/IMultiplayerServer.cs
|
osu.Game/Online/RealtimeMultiplayer/IMultiplayerServer.cs
|
using System.Threading.Tasks;
namespace osu.Game.Online.RealtimeMultiplayer
{
/// <summary>
/// An interface defining the spectator server instance.
/// </summary>
public interface IMultiplayerServer
{
/// <summary>
/// Request to join a multiplayer room.
/// </summary>
/// <param name="roomId">The databased room ID.</param>
/// <exception cref="UserAlreadyInMultiplayerRoom">If the user is already in the requested (or another) room.</exception>
Task<MultiplayerRoom> JoinRoom(long roomId);
/// <summary>
/// Request to leave the currently joined room.
/// </summary>
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
Task LeaveRoom();
/// <summary>
/// Transfer the host of the currently joined room to another user in the room.
/// </summary>
/// <param name="userId">The new user which is to become host.</param>
/// <exception cref="NotHostException">A user other than the current host is attempting to transfer host.</exception>
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
Task TransferHost(long userId);
/// <summary>
/// As the host, update the settings of the currently joined room.
/// </summary>
/// <param name="settings">The new settings to apply.</param>
/// <exception cref="NotHostException">A user other than the current host is attempting to transfer host.</exception>
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
Task ChangeSettings(MultiplayerRoomSettings settings);
/// <summary>
/// Change the local user state in the currently joined room.
/// </summary>
/// <param name="newState">The proposed new state.</param>
/// <exception cref="InvalidStateChange">If the state change requested is not valid, given the previous state or room state.</exception>
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
Task ChangeState(MultiplayerUserState newState);
/// <summary>
/// As the host of a room, start the match.
/// </summary>
/// <exception cref="NotHostException">A user other than the current host is attempting to start the game.</exception>
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
Task StartMatch();
}
}
|
using System.Threading.Tasks;
namespace osu.Game.Online.RealtimeMultiplayer
{
/// <summary>
/// An interface defining the spectator server instance.
/// </summary>
public interface IMultiplayerServer
{
/// <summary>
/// Request to join a multiplayer room.
/// </summary>
/// <param name="roomId">The databased room ID.</param>
/// <exception cref="UserAlreadyInMultiplayerRoom">If the user is already in the requested (or another) room.</exception>
Task<MultiplayerRoom> JoinRoom(long roomId);
/// <summary>
/// Request to leave the currently joined room.
/// </summary>
Task LeaveRoom();
/// <summary>
/// Transfer the host of the currently joined room to another user in the room.
/// </summary>
/// <param name="userId">The new user which is to become host.</param>
/// <exception cref="NotHostException">A user other than the current host is attempting to transfer host.</exception>
Task TransferHost(long userId);
/// <summary>
/// As the host, update the settings of the currently joined room.
/// </summary>
/// <param name="settings">The new settings to apply.</param>
Task ChangeSettings(MultiplayerRoomSettings settings);
/// <summary>
/// Change the local user state in the currently joined room.
/// </summary>
/// <param name="newState">The proposed new state.</param>
/// <exception cref="InvalidStateChange">If the state change requested is not valid, given the previous state or room state.</exception>
Task ChangeState(MultiplayerUserState newState);
/// <summary>
/// As the host of a room, start the match.
/// </summary>
/// <exception cref="NotHostException">A user other than the current host is attempting to start the game.</exception>
Task StartMatch();
}
}
|
mit
|
C#
|
0cdad77bbdb660384462f4e9ced596e0c150eae0
|
Make StateChanged action more verbose in its arguments.
|
DrabWeb/osu-framework,peppy/osu-framework,default0/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,RedNesto/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,naoey/osu-framework,Nabile-Rahmani/osu-framework,default0/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,Tom94/osu-framework,paparony03/osu-framework,paparony03/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,naoey/osu-framework,RedNesto/osu-framework,Nabile-Rahmani/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework
|
osu.Framework/Graphics/Containers/OverlayContainer.cs
|
osu.Framework/Graphics/Containers/OverlayContainer.cs
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Graphics.Containers
{
/// <summary>
/// An element which starts hidden and can be toggled to visible.
/// </summary>
public abstract class OverlayContainer : Container, IStateful<Visibility>
{
protected override void LoadComplete()
{
if (state == Visibility.Hidden)
{
PopOut();
Flush(true);
}
base.LoadComplete();
}
private Visibility state;
public Visibility State
{
get { return state; }
set
{
if (value == state) return;
state = value;
switch (value)
{
case Visibility.Hidden:
PopOut();
break;
case Visibility.Visible:
PopIn();
break;
}
StateChanged?.Invoke(this, state);
}
}
public event Action<OverlayContainer, Visibility> StateChanged;
protected abstract void PopIn();
protected abstract void PopOut();
public override void Hide() => State = Visibility.Hidden;
public override void Show() => State = Visibility.Visible;
public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible);
}
public enum Visibility
{
Hidden,
Visible
}
}
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Graphics.Containers
{
/// <summary>
/// An element which starts hidden and can be toggled to visible.
/// </summary>
public abstract class OverlayContainer : Container, IStateful<Visibility>
{
protected override void LoadComplete()
{
if (state == Visibility.Hidden)
{
PopOut();
Flush(true);
}
base.LoadComplete();
}
private Visibility state;
public Visibility State
{
get { return state; }
set
{
if (value == state) return;
state = value;
switch (value)
{
case Visibility.Hidden:
PopOut();
break;
case Visibility.Visible:
PopIn();
break;
}
StateChanged?.Invoke();
}
}
public event Action StateChanged;
protected abstract void PopIn();
protected abstract void PopOut();
public override void Hide() => State = Visibility.Hidden;
public override void Show() => State = Visibility.Visible;
public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible);
}
public enum Visibility
{
Hidden,
Visible
}
}
|
mit
|
C#
|
53f11ceb8e150eb06c257552f29620dce073a0cb
|
tweak CSL syntax
|
stwalkerster/eyeinthesky,stwalkerster/eyeinthesky,stwalkerster/eyeinthesky
|
EyeInTheSky/StalkNodes/OrNode.cs
|
EyeInTheSky/StalkNodes/OrNode.cs
|
using System;
using System.Xml;
namespace EyeInTheSky.StalkNodes
{
class OrNode : DoubleChildLogicalNode
{
#region Overrides of StalkNode
public override bool match(RecentChange rc)
{
return (LeftChildNode.match(rc) || RightChildNode.match(rc));
}
public static new StalkNode newFromXmlFragment(XmlNode xmlNode)
{
OrNode s = new OrNode();
s.LeftChildNode = StalkNode.newFromXmlFragment(xmlNode.ChildNodes[0]);
s.RightChildNode = StalkNode.newFromXmlFragment(xmlNode.ChildNodes[1]);
return s;
}
public override XmlElement toXmlFragment(XmlDocument doc, string xmlns)
{
XmlElement e = doc.CreateElement("or", xmlns);
e.AppendChild(LeftChildNode.toXmlFragment(doc, xmlns));
e.AppendChild(RightChildNode.toXmlFragment(doc, xmlns));
return e;
}
public override string ToString()
{
return "(|:" + LeftChildNode + RightChildNode + ")";
}
#endregion
}
}
|
using System;
using System.Xml;
namespace EyeInTheSky.StalkNodes
{
class OrNode : DoubleChildLogicalNode
{
#region Overrides of StalkNode
public override bool match(RecentChange rc)
{
return (LeftChildNode.match(rc) || RightChildNode.match(rc));
}
public static new StalkNode newFromXmlFragment(XmlNode xmlNode)
{
OrNode s = new OrNode();
s.LeftChildNode = StalkNode.newFromXmlFragment(xmlNode.ChildNodes[0]);
s.RightChildNode = StalkNode.newFromXmlFragment(xmlNode.ChildNodes[1]);
return s;
}
public override XmlElement toXmlFragment(XmlDocument doc, string xmlns)
{
XmlElement e = doc.CreateElement("or", xmlns);
e.AppendChild(LeftChildNode.toXmlFragment(doc, xmlns));
e.AppendChild(RightChildNode.toXmlFragment(doc, xmlns));
return e;
}
public override string ToString()
{
return "(" + LeftChildNode + "|" + RightChildNode + ")";
}
#endregion
}
}
|
mit
|
C#
|
b54bf49cb9617c995beb4c83561c34f1d3627582
|
fix CR
|
NuGet/NuGet.Services.Dashboard,NuGet/NuGet.Services.Dashboard,NuGet/NuGet.Services.Dashboard
|
NuGet.Services.Dashboard.Operations/Tasks/DashBoardTasks/IssLogCleanUptask.cs
|
NuGet.Services.Dashboard.Operations/Tasks/DashBoardTasks/IssLogCleanUptask.cs
|
using System;
using System.IO;
namespace NuGetGallery.Operations.Tasks.DashBoardTasks
{
[Command("IssCleanUpTask", "clean up old iss log in current dir", AltName = "clean")]
class IssLogCleanUptask : OpsTask
{
public override void ExecuteCommand()
{
var dirs = Directory.EnumerateDirectories(Environment.CurrentDirectory, "*.log");
foreach (string dir in dirs)
{
try
{
string date = RemoveLetter(dir.Substring(Environment.CurrentDirectory.Length));
DateTime logdate = new DateTime();
logdate = DateTime.ParseExact(date, "yyMMddHH", null);
if (logdate < DateTime.UtcNow.AddHours(-48)) Directory.Delete(dir, true);
}
catch (Exception e)
{
Console.WriteLine("clean up error: {0}", e.Message);
}
}
}
private string RemoveLetter(string src)
{
if (src.Equals("")) return src;
if (char.IsDigit(src[0])) return src[0] + RemoveLetter(src.Substring(1));
else return RemoveLetter(src.Substring(1));
}
}
}
|
using System;
using System.IO;
namespace NuGetGallery.Operations.Tasks.DashBoardTasks
{
[Command("IssCleanUpTask", "clean up old iss log in current dir", AltName = "clean")]
class IssLogCleanUptask : OpsTask
{
public override void ExecuteCommand()
{
try
{
var dirs = Directory.EnumerateDirectories(Environment.CurrentDirectory, "*.log");
foreach(string dir in dirs)
{
string date = dir.Substring(Environment.CurrentDirectory.Length+5, 8);
DateTime logdate = new DateTime();
logdate = DateTime.ParseExact(date, "yyMMddHH", null);
if (logdate < DateTime.UtcNow.AddHours(-48)) Directory.Delete(dir, true);
}
}
catch (Exception e)
{
Console.WriteLine("clean up error: {0}", e.Message);
}
}
}
}
|
apache-2.0
|
C#
|
83a5ce577e88db5bf7b5d52121b985d0b45f115d
|
修改 Sample 样式
|
lishewen/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,lishewen/WeiXinMPSDK,mc7246/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,mc7246/WeiXinMPSDK,lishewen/WeiXinMPSDK,mc7246/WeiXinMPSDK
|
Samples/Shared/Senparc.Weixin.Sample.Shared/Views/Shared/_IconsPartial.cshtml
|
Samples/Shared/Senparc.Weixin.Sample.Shared/Views/Shared/_IconsPartial.cshtml
|
<p class="no-text-indent">
<a href="https://mysenparc.visualstudio.com/Senparc%20SDK/_build/latest?definitionId=36" target="_blank"><img src="https://mysenparc.visualstudio.com/Senparc%20SDK/_apis/build/status/Weixin%20SDK/Senparc.Weixin%20Dev-%E5%86%85%E9%83%A8-%E8%87%AA%E5%8A%A8-.Net6" alt="Build status"></a>
<a href="https://github.com/JeffreySu/WeiXinMPSDK/commits/master" target="_blank"><img src="https://img.shields.io/github/commit-activity/4w/JeffreySu/WeiXinMPSDK.svg" alt="GitHub commit activity the past week, 4 weeks, year"></a>
<a href="https://www.nuget.org/packages/Senparc.Weixin" target="_blank"><img src="https://img.shields.io/nuget/dt/Senparc.Weixin.svg" alt="Senparc.Weixin"></a>
<a href="https://www.nuget.org/packages/Senparc.Weixin.MP" target="_blank"><img src="https://img.shields.io/nuget/dt/Senparc.Weixin.MP.svg" alt="Senparc.Weixin.MP"></a>
<a href="https://www.nuget.org/packages/Senparc.Weixin.MP" target="_blank"><img src="https://img.shields.io/nuget/v/Senparc.Weixin.MP.svg?style=flat" alt="MP"></a>
<a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"><img src="https://img.shields.io/github/license/JeffreySu/WeiXinMPSDK.svg" alt="Senparc.Weixin.MP"></a>
</p>
|
<p>
<a href="https://mysenparc.visualstudio.com/Senparc%20SDK/_build/latest?definitionId=36" target="_blank"><img src="https://mysenparc.visualstudio.com/Senparc%20SDK/_apis/build/status/Weixin%20SDK/Senparc.Weixin%20Dev-%E5%86%85%E9%83%A8-%E8%87%AA%E5%8A%A8-.Net6" alt="Build status"></a>
<a href="https://github.com/JeffreySu/WeiXinMPSDK/commits/master" target="_blank"><img src="https://img.shields.io/github/commit-activity/4w/JeffreySu/WeiXinMPSDK.svg" alt="GitHub commit activity the past week, 4 weeks, year"></a>
<a href="https://www.nuget.org/packages/Senparc.Weixin" target="_blank"><img src="https://img.shields.io/nuget/dt/Senparc.Weixin.svg" alt="Senparc.Weixin"></a>
<a href="https://www.nuget.org/packages/Senparc.Weixin.MP" target="_blank"><img src="https://img.shields.io/nuget/dt/Senparc.Weixin.MP.svg" alt="Senparc.Weixin.MP"></a>
<a href="https://www.nuget.org/packages/Senparc.Weixin.MP" target="_blank"><img src="https://img.shields.io/nuget/v/Senparc.Weixin.MP.svg?style=flat" alt="MP"></a>
<a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"><img src="https://img.shields.io/github/license/JeffreySu/WeiXinMPSDK.svg" alt="Senparc.Weixin.MP"></a>
</p>
|
apache-2.0
|
C#
|
415451429689466fe2c5401618d06fae761234d8
|
Test for checking Fork update
|
Apathak-tba/ApathakMailTest,Apathak-tba/ApathakMailTest,Apathak-tba/ApathakMailTest
|
MailTest/MailTest/LogOut.aspx.cs
|
MailTest/MailTest/LogOut.aspx.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MailTest
{
public partial class LogOut : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Modifying file to check fork update
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MailTest
{
public partial class LogOut : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
|
mit
|
C#
|
39eafc8eeea16c293e8b33830736e9cb292ca5d0
|
Fix Alarm component to dispose it's delegates
|
lucas-miranda/Raccoon
|
Raccoon/Core/Components/Alarm.cs
|
Raccoon/Core/Components/Alarm.cs
|
namespace Raccoon.Components {
public class Alarm : Component {
public Alarm(uint interval, System.Action action) {
NextActivationTimer = Interval = interval;
Action = action;
}
public System.Action Action { get; set; }
public uint Timer { get; private set; }
public uint NextActivationTimer { get; private set; }
public uint Interval { get; set; }
public uint RepeatTimes { get; set; } = uint.MaxValue;
public uint TriggeredCount { get; private set; }
public override void Update(int delta) {
Timer += (uint) delta;
if (TriggeredCount > RepeatTimes || Timer < NextActivationTimer) {
return;
}
Action();
TriggeredCount++;
NextActivationTimer += Interval;
}
public override void Render() {
}
public override void DebugRender() {
}
public void Reset() {
TriggeredCount = 0;
Timer = 0;
NextActivationTimer = Interval;
}
public override void Dispose() {
base.Dispose();
Action = null;
}
}
}
|
namespace Raccoon.Components {
public class Alarm : Component {
public Alarm(uint interval, System.Action action) {
NextActivationTimer = Interval = interval;
Action = action;
}
public System.Action Action { get; set; }
public uint Timer { get; private set; }
public uint NextActivationTimer { get; private set; }
public uint Interval { get; set; }
public uint RepeatTimes { get; set; } = uint.MaxValue;
public uint TriggeredCount { get; private set; }
public override void Update(int delta) {
Timer += (uint) delta;
if (TriggeredCount > RepeatTimes || Timer < NextActivationTimer) {
return;
}
Action();
TriggeredCount++;
NextActivationTimer += Interval;
}
public override void Render() {
}
public override void DebugRender() {
}
public void Reset() {
TriggeredCount = 0;
Timer = 0;
NextActivationTimer = Interval;
}
}
}
|
mit
|
C#
|
902b8e38d057b651f6b67bc75f34be785faee7c0
|
Add GetPrivateMessages
|
SirCmpwn/RedditSharp,Jinivus/RedditSharp,CrustyJew/RedditSharp,tomnolan95/RedditSharp,nyanpasudo/RedditSharp,epvanhouten/RedditSharp,ekaralar/RedditSharpWindowsStore,IAmAnubhavSaini/RedditSharp,chuggafan/RedditSharp-1,pimanac/RedditSharp,angelotodaro/RedditSharp,justcool393/RedditSharp-1,RobThree/RedditSharp,theonlylawislove/RedditSharp
|
RedditSharp/AuthenticatedUser.cs
|
RedditSharp/AuthenticatedUser.cs
|
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
namespace RedditSharp
{
public class AuthenticatedUser : RedditUser
{
private const string ModeratorUrl = "/reddits/mine/moderator.json";
private const string UnreadMessagesUrl = "/message/unread.json?mark=true&limit=25";
private const string ModQueueUrl = "/r/mod/about/modqueue.json";
private const string UnmoderatedUrl = "/r/mod/about/unmoderated.json";
private const string ModMailUrl = "/message/moderator.json";
private const string InboxUrl = "/message/messages.json";
public AuthenticatedUser(Reddit reddit, JToken json, IWebAgent webAgent) : base(reddit, json, webAgent)
{
JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings);
}
public Listing<Subreddit> GetModeratorReddits()
{
return new Listing<Subreddit>(Reddit, ModeratorUrl, WebAgent);
}
public Listing<Thing> GetUnreadMessages()
{
return new Listing<Thing>(Reddit, UnreadMessagesUrl, WebAgent);
}
public Listing<VotableThing> GetModerationQueue()
{
return new Listing<VotableThing>(Reddit, ModQueueUrl, WebAgent);
}
public Listing<Post> GetUnmoderatedLinks ()
{
return new Listing<Post>(Reddit, UnmoderatedUrl, WebAgent);
}
public Listing<PrivateMessage> GetModMail()
{
return new Listing<PrivateMessage>(Reddit, ModMailUrl, WebAgent);
}
public Listing<PrivateMessage> GetPrivateMessages()
{
return new Listing<PrivateMessage>(Reddit, InboxUrl, WebAgent);
}
[JsonProperty("modhash")]
public string Modhash { get; set; }
[JsonProperty("has_mail")]
public bool HasMail { get; set; }
[JsonProperty("has_mod_mail")]
public bool HasModMail { get; set; }
}
}
|
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
namespace RedditSharp
{
public class AuthenticatedUser : RedditUser
{
private const string ModeratorUrl = "/reddits/mine/moderator.json";
private const string UnreadMessagesUrl = "/message/unread.json?mark=true&limit=25";
private const string ModQueueUrl = "/r/mod/about/modqueue.json";
private const string UnmoderatedUrl = "/r/mod/about/unmoderated.json";
private const string ModMailUrl = "/message/moderator.json";
public AuthenticatedUser(Reddit reddit, JToken json, IWebAgent webAgent) : base(reddit, json, webAgent)
{
JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings);
}
public Listing<Subreddit> GetModeratorReddits()
{
return new Listing<Subreddit>(Reddit, ModeratorUrl, WebAgent);
}
public Listing<Thing> GetUnreadMessages()
{
return new Listing<Thing>(Reddit, UnreadMessagesUrl, WebAgent);
}
public Listing<VotableThing> GetModerationQueue()
{
return new Listing<VotableThing>(Reddit, ModQueueUrl, WebAgent);
}
public Listing<Post> GetUnmoderatedLinks ()
{
return new Listing<Post>(Reddit, UnmoderatedUrl, WebAgent);
}
public Listing<PrivateMessage> GetModMail()
{
return new Listing<PrivateMessage>(Reddit, ModMailUrl, WebAgent);
}
[JsonProperty("modhash")]
public string Modhash { get; set; }
[JsonProperty("has_mail")]
public bool HasMail { get; set; }
[JsonProperty("has_mod_mail")]
public bool HasModMail { get; set; }
}
}
|
mit
|
C#
|
4f087ceae3c961a4141516f5e3f55a236ee6d6c3
|
Fix VideoResponse parse exception
|
Naxiz/TeleBotDotNet,LouisMT/TeleBotDotNet
|
Responses/Types/VideoResponse.cs
|
Responses/Types/VideoResponse.cs
|
using TeleBotDotNet.Json;
namespace TeleBotDotNet.Responses.Types
{
public class VideoResponse
{
public string FileId { get; private set; }
public int Width { get; private set; }
public int Height { get; private set; }
public int Duration { get; private set; }
public PhotoSizeResponse Thumb { get; private set; }
public string MimeType { get; private set; }
public int? FileSize { get; private set; }
internal static VideoResponse Parse(JsonData data)
{
if (data == null || !data.Has("file_id") || !data.Has("width") || !data.Has("height") || !data.Has("duration"))
{
return null;
}
return new VideoResponse
{
FileId = data.Get<string>("file_id"),
Width = data.Get<int>("width"),
Height = data.Get<int>("height"),
Duration = data.Get<int>("duration"),
Thumb = PhotoSizeResponse.Parse(data.GetJson("thumb")),
MimeType = data.Get<string>("mime_type"),
FileSize = data.Get<int?>("file_size")
};
}
}
}
|
using TeleBotDotNet.Json;
namespace TeleBotDotNet.Responses.Types
{
public class VideoResponse
{
public int FileId { get; private set; }
public int Width { get; private set; }
public int Height { get; private set; }
public int Duration { get; private set; }
public PhotoSizeResponse Thumb { get; private set; }
public string MimeType { get; private set; }
public int? FileSize { get; private set; }
internal static VideoResponse Parse(JsonData data)
{
if (data == null || !data.Has("file_id") || !data.Has("width") || !data.Has("height") || !data.Has("duration"))
{
return null;
}
return new VideoResponse
{
FileId = data.Get<int>("file_id"),
Width = data.Get<int>("width"),
Height = data.Get<int>("height"),
Duration = data.Get<int>("duration"),
Thumb = PhotoSizeResponse.Parse(data.GetJson("thumb")),
MimeType = data.Get<string>("mime_type"),
FileSize = data.Get<int?>("file_size")
};
}
}
}
|
mit
|
C#
|
f1dacf72cfcbb5f506a1bb2c31853326be42745a
|
Fix bools not being parsed correctly from config (case sensitivity).
|
EVAST9919/osu-framework,naoey/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,ZLima12/osu-framework,default0/osu-framework,paparony03/osu-framework,default0/osu-framework,peppy/osu-framework,Nabile-Rahmani/osu-framework,naoey/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,DrabWeb/osu-framework,paparony03/osu-framework,RedNesto/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,RedNesto/osu-framework,Tom94/osu-framework,DrabWeb/osu-framework
|
osu.Framework/Configuration/BindableBool.cs
|
osu.Framework/Configuration/BindableBool.cs
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
namespace osu.Framework.Configuration
{
public class BindableBool : Bindable<bool>
{
public BindableBool(bool value = false)
: base(value)
{
}
public static implicit operator bool(BindableBool value) => value != null && value.Value;
public override string ToString() => Value.ToString();
public override bool Parse(object s)
{
string str = s as string;
if (str == null) return false;
Value = str == @"1" || str.Equals(@"true", System.StringComparison.OrdinalIgnoreCase);
return true;
}
public void Toggle() => Value = !Value;
}
}
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
namespace osu.Framework.Configuration
{
public class BindableBool : Bindable<bool>
{
public BindableBool(bool value = false)
: base(value)
{
}
public static implicit operator bool(BindableBool value) => value != null && value.Value;
public override string ToString() => Value.ToString();
public override bool Parse(object s)
{
string str = s as string;
if (str == null) return false;
Value = str == @"1" || str == @"true";
return true;
}
public void Toggle() => Value = !Value;
}
}
|
mit
|
C#
|
aaa7c7eb0593c9b04c728aee778ff1de5a08f6bc
|
Handle null case explicitly in `SpectatorState.Equals()`
|
peppy/osu,peppy/osu-new,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,peppy/osu,UselessToucan/osu,UselessToucan/osu,UselessToucan/osu,ppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu
|
osu.Game/Online/Spectator/SpectatorState.cs
|
osu.Game/Online/Spectator/SpectatorState.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 System.Diagnostics.CodeAnalysis;
using System.Linq;
using MessagePack;
using osu.Game.Online.API;
namespace osu.Game.Online.Spectator
{
[Serializable]
[MessagePackObject]
public class SpectatorState : IEquatable<SpectatorState>
{
[Key(0)]
public int? BeatmapID { get; set; }
[Key(1)]
public int? RulesetID { get; set; }
[NotNull]
[Key(2)]
public IEnumerable<APIMod> Mods { get; set; } = Enumerable.Empty<APIMod>();
public bool Equals(SpectatorState other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return BeatmapID == other.BeatmapID && Mods.SequenceEqual(other.Mods) && RulesetID == other.RulesetID;
}
public override string ToString() => $"Beatmap:{BeatmapID} Mods:{string.Join(',', Mods)} Ruleset:{RulesetID}";
}
}
|
// 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 System.Diagnostics.CodeAnalysis;
using System.Linq;
using MessagePack;
using osu.Game.Online.API;
namespace osu.Game.Online.Spectator
{
[Serializable]
[MessagePackObject]
public class SpectatorState : IEquatable<SpectatorState>
{
[Key(0)]
public int? BeatmapID { get; set; }
[Key(1)]
public int? RulesetID { get; set; }
[NotNull]
[Key(2)]
public IEnumerable<APIMod> Mods { get; set; } = Enumerable.Empty<APIMod>();
public bool Equals(SpectatorState other) => BeatmapID == other?.BeatmapID && Mods.SequenceEqual(other?.Mods) && RulesetID == other?.RulesetID;
public override string ToString() => $"Beatmap:{BeatmapID} Mods:{string.Join(',', Mods)} Ruleset:{RulesetID}";
}
}
|
mit
|
C#
|
558a9ef4c2b45cd7812e71ad03cd7775db18147e
|
Update TestCaseActiveState to cover Window.CursorInWindow state
|
smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework
|
osu.Framework.Tests/Visual/Platform/TestSceneActiveState.cs
|
osu.Framework.Tests/Visual/Platform/TestSceneActiveState.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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Platform;
using osuTK.Graphics;
namespace osu.Framework.Tests.Visual.Platform
{
public class TestSceneActiveState : FrameworkTestScene
{
private IBindable<bool> isActive;
private IBindable<bool> cursorInWindow;
private Box isActiveBox;
private Box cursorInWindowBox;
[BackgroundDependencyLoader]
private void load(GameHost host)
{
isActive = host.IsActive.GetBoundCopy();
cursorInWindow = host.Window.CursorInWindow.GetBoundCopy();
}
protected override void LoadComplete()
{
base.LoadComplete();
Children = new Drawable[]
{
isActiveBox = new Box
{
Colour = Color4.Black,
Width = 0.5f,
RelativeSizeAxes = Axes.Both,
},
cursorInWindowBox = new Box
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.Both,
Width = 0.5f,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
},
};
isActive.BindValueChanged(active => isActiveBox.Colour = active.NewValue ? Color4.Green : Color4.Red, true);
cursorInWindow.BindValueChanged(active => cursorInWindowBox.Colour = active.NewValue ? Color4.Green : Color4.Red, true);
}
}
}
|
// 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Platform;
using osuTK.Graphics;
namespace osu.Framework.Tests.Visual.Platform
{
public class TestSceneActiveState : FrameworkTestScene
{
private IBindable<bool> isActive;
private Box isActiveBox;
[BackgroundDependencyLoader]
private void load(GameHost host)
{
isActive = host.IsActive.GetBoundCopy();
}
protected override void LoadComplete()
{
base.LoadComplete();
Children = new Drawable[]
{
isActiveBox = new Box
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.Both,
},
};
isActive.BindValueChanged(active => isActiveBox.Colour = active.NewValue ? Color4.Green : Color4.Red);
}
}
}
|
mit
|
C#
|
fe6c369e0765ce8fd8d16229d40e3944c76b6ea4
|
Fix incorrect channel
|
DrabWeb/osu,EVAST9919/osu,DrabWeb/osu,UselessToucan/osu,peppy/osu,ppy/osu,ppy/osu,ZLima12/osu,johnneijzen/osu,EVAST9919/osu,naoey/osu,UselessToucan/osu,naoey/osu,NeoAdonis/osu,peppy/osu-new,NeoAdonis/osu,smoogipoo/osu,johnneijzen/osu,ZLima12/osu,DrabWeb/osu,2yangk23/osu,peppy/osu,smoogipoo/osu,naoey/osu,NeoAdonis/osu,smoogipooo/osu,UselessToucan/osu,ppy/osu,2yangk23/osu,peppy/osu,smoogipoo/osu
|
osu.Game/Screens/Multi/Match/Components/MatchChatDisplay.cs
|
osu.Game/Screens/Multi/Match/Components/MatchChatDisplay.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Online.Chat;
using osu.Game.Online.Multiplayer;
namespace osu.Game.Screens.Multi.Match.Components
{
public class MatchChatDisplay : StandAloneChatDisplay
{
private readonly Room room;
[Resolved]
private ChannelManager channelManager { get; set; }
public MatchChatDisplay(Room room)
: base(true)
{
this.room = room;
}
protected override void LoadComplete()
{
base.LoadComplete();
room.RoomID.BindValueChanged(v => updateChannel(), true);
}
private void updateChannel()
{
if (room.RoomID.Value != null)
Channel.Value = channelManager.JoinChannel(new Channel { Id = room.ChannelId, Type = ChannelType.Multiplayer, Name = $"#mp_{room.RoomID}" });
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Online.Chat;
using osu.Game.Online.Multiplayer;
namespace osu.Game.Screens.Multi.Match.Components
{
public class MatchChatDisplay : StandAloneChatDisplay
{
private readonly Room room;
[Resolved]
private ChannelManager channelManager { get; set; }
public MatchChatDisplay(Room room)
: base(true)
{
this.room = room;
}
protected override void LoadComplete()
{
base.LoadComplete();
Channel.Value = channelManager.JoinChannel(new Channel { Id = room.ChannelId, Type = ChannelType.Multiplayer, Name = $"#mp_{room.RoomID}" });
}
}
}
|
mit
|
C#
|
5606b201976d20e7f1747dd1425e2c9e936346d8
|
change Toxy info to Toxy 1.1
|
tonyqus/toxy,yixiangling/toxy,yixiangling/toxy
|
ToxyFramework/Properties/AssemblyInfo.cs
|
ToxyFramework/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Toxy Framework")]
[assembly: AssemblyDescription(".Net Data/Text Extraction Framework")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Neuzilla")]
[assembly: AssemblyProduct("Toxy")]
[assembly: AssemblyCopyright("Apache 2.0")]
[assembly: AssemblyTrademark("Neuzilla")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3c5f41de-9f62-45cc-b89e-8e377a2e036e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("Toxy 1.1")]
[assembly: AllowPartiallyTrustedCallers]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Toxy Framework")]
[assembly: AssemblyDescription(".Net Data/Text Extraction Framework")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Neuzilla")]
[assembly: AssemblyProduct("Toxy")]
[assembly: AssemblyCopyright("Apache 2.0")]
[assembly: AssemblyTrademark("Neuzilla")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3c5f41de-9f62-45cc-b89e-8e377a2e036e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("Toxy 1.0")]
[assembly: AllowPartiallyTrustedCallers]
|
apache-2.0
|
C#
|
aa42023754233b8758d31fe70bfbe424ecfd93c7
|
Add comment about Exclusive tracks.
|
smoogipooo/osu-framework,Tom94/osu-framework,default0/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,paparony03/osu-framework,DrabWeb/osu-framework,ZLima12/osu-framework,Tom94/osu-framework,Nabile-Rahmani/osu-framework,paparony03/osu-framework,ZLima12/osu-framework,Nabile-Rahmani/osu-framework,ppy/osu-framework,naoey/osu-framework,RedNesto/osu-framework,default0/osu-framework,smoogipooo/osu-framework,NeoAdonis/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,naoey/osu-framework,peppy/osu-framework,NeoAdonis/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,RedNesto/osu-framework
|
osu.Framework/Audio/Track/TrackManager.cs
|
osu.Framework/Audio/Track/TrackManager.cs
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Linq;
using osu.Framework.IO.Stores;
namespace osu.Framework.Audio.Track
{
public class TrackManager : AudioCollectionManager<AudioTrack>
{
IResourceStore<byte[]> store;
AudioTrack exclusiveTrack;
public TrackManager(IResourceStore<byte[]> store)
{
this.store = store;
}
public AudioTrack Get(string name)
{
AudioTrackBass track = new AudioTrackBass(store.GetStream(name));
AddItem(track);
return track;
}
/// <summary>
/// Specify an AudioTrack which should get exclusive playback over everything else.
/// Will pause all other tracks and throw away any existing exclusive track.
/// </summary>
public void SetExclusive(AudioTrack track)
{
if (exclusiveTrack == track) return;
Items.ForEach(i => i.Stop());
exclusiveTrack?.Dispose();
exclusiveTrack = track;
AddItem(track);
}
public override void Update()
{
base.Update();
if (exclusiveTrack?.HasCompleted != false)
findExclusiveTrack();
}
private void findExclusiveTrack()
{
exclusiveTrack = Items.FirstOrDefault();
}
}
}
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Linq;
using osu.Framework.IO.Stores;
namespace osu.Framework.Audio.Track
{
public class TrackManager : AudioCollectionManager<AudioTrack>
{
IResourceStore<byte[]> store;
AudioTrack exclusiveTrack;
public TrackManager(IResourceStore<byte[]> store)
{
this.store = store;
}
public AudioTrack Get(string name)
{
AudioTrackBass track = new AudioTrackBass(store.GetStream(name));
AddItem(track);
return track;
}
public void SetExclusive(AudioTrack track)
{
if (exclusiveTrack == track) return;
Items.ForEach(i => i.Stop());
exclusiveTrack?.Dispose();
exclusiveTrack = track;
AddItem(track);
}
public override void Update()
{
base.Update();
if (exclusiveTrack?.HasCompleted != false)
findExclusiveTrack();
}
private void findExclusiveTrack()
{
exclusiveTrack = Items.FirstOrDefault();
}
}
}
|
mit
|
C#
|
bf0b83512c0b89b1488fe40aedd8250fc892b685
|
Add missing await
|
timeanddate/libtad-net
|
TimeAndDate.Services/AccountService.cs
|
TimeAndDate.Services/AccountService.cs
|
using System;
using System.Threading.Tasks;
using System.Collections.Specialized;
using System.Net;
using TimeAndDate.Services.Common;
using System.Collections.Generic;
using System.Xml;
using TimeAndDate.Services.DataTypes.Account;
namespace TimeAndDate.Services
{
public class AccountService : BaseService
{
/// <summary>
/// The accounts service can be used to retrieve information about the
/// API account in use, remaining request credits and current packages.
/// </summary>
/// <param name='accessKey'>
/// Access key.
/// </param>
/// <param name='secretKey'>
/// Secret key.
/// </param>
public AccountService (string accessKey, string secretKey) : base(accessKey, secretKey, "account")
{
XmlElemName = "account";
}
/// <summary>
/// Gets information about account in use.
/// </summary>
/// <returns>
/// The account.
/// </returns>
public Account GetAccount ()
{
return CallService<Account> (new NameValueCollection ());
}
/// <summary>
/// Gets information about account in use.
/// </summary>
/// <returns>
/// The account.
/// </returns>
public async Task<Account> GetAccountAsync ()
{
return await CallServiceAsync<Account> (new NameValueCollection ());
}
protected override Account FromString<Account> (string result)
{
var xml = new XmlDocument();
xml.LoadXml (result);
var node = xml.SelectSingleNode ("data");
node = node.SelectSingleNode ("account");
var instance = Activator.CreateInstance(typeof(Account), new object[] { node });
return (Account) instance;
}
}
}
|
using System;
using System.Threading.Tasks;
using System.Collections.Specialized;
using System.Net;
using TimeAndDate.Services.Common;
using System.Collections.Generic;
using System.Xml;
using TimeAndDate.Services.DataTypes.Account;
namespace TimeAndDate.Services
{
public class AccountService : BaseService
{
/// <summary>
/// The accounts service can be used to retrieve information about the
/// API account in use, remaining request credits and current packages.
/// </summary>
/// <param name='accessKey'>
/// Access key.
/// </param>
/// <param name='secretKey'>
/// Secret key.
/// </param>
public AccountService (string accessKey, string secretKey) : base(accessKey, secretKey, "account")
{
XmlElemName = "account";
}
/// <summary>
/// Gets information about account in use.
/// </summary>
/// <returns>
/// The account.
/// </returns>
public Account GetAccount ()
{
return CallService<Account> (new NameValueCollection ());
}
/// <summary>
/// Gets information about account in use.
/// </summary>
/// <returns>
/// The account.
/// </returns>
public async Task<Account> GetAccountAsync ()
{
return CallServiceAsync<Account> (new NameValueCollection ());
}
protected override Account FromString<Account> (string result)
{
var xml = new XmlDocument();
xml.LoadXml (result);
var node = xml.SelectSingleNode ("data");
node = node.SelectSingleNode ("account");
var instance = Activator.CreateInstance(typeof(Account), new object[] { node });
return (Account) instance;
}
}
}
|
mit
|
C#
|
a0fde5805433d9567b0ceae601d154395fce2bf5
|
Make WeightRange class, convert fields to props
|
roman-yagodin/R7.News,roman-yagodin/R7.News,roman-yagodin/R7.News
|
R7.News/Models/WeightRange.cs
|
R7.News/Models/WeightRange.cs
|
//
// WeightRange.cs
//
// Author:
// Roman M. Yagodin <roman.yagodin@gmail.com>
//
// Copyright (c) 2017 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace R7.News.Models
{
public class WeightRange
{
public int Min { get; set; }
public int Max { get; set; }
public WeightRange (int min, int max)
{
Min = min;
Max = max;
}
}
}
|
//
// WeightRange.cs
//
// Author:
// Roman M. Yagodin <roman.yagodin@gmail.com>
//
// Copyright (c) 2017 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace R7.News.Models
{
public struct WeightRange
{
public int Min;
public int Max;
public WeightRange (int min, int max)
{
Min = min;
Max = max;
}
}
}
|
agpl-3.0
|
C#
|
7af273814456bcf561ac01e71b0ce9794feb3076
|
Update AssemblyInfo.cs
|
wieslawsoltes/MatrixPanAndZoomDemo,wieslawsoltes/PanAndZoom,wieslawsoltes/PanAndZoom,PanAndZoom/PanAndZoom,PanAndZoom/PanAndZoom
|
src/Avalonia.Controls.PanAndZoom/Properties/AssemblyInfo.cs
|
src/Avalonia.Controls.PanAndZoom/Properties/AssemblyInfo.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.Resources;
using System.Reflection;
[assembly: AssemblyTitle("Avalonia.Controls.PanAndZoom")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Avalonia.Controls.PanAndZoom")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
|
// 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.Resources;
using System.Reflection;
using Avalonia.Metadata;
[assembly: AssemblyTitle("Avalonia.Controls.PanAndZoom")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Avalonia.Controls.PanAndZoom")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: XmlnsDefinition("https://github.com/panandzoom", "Avalonia.Controls.PanAndZoom")]
|
mit
|
C#
|
d5fc31f2449465f831516416a5d161891a495897
|
Clarify ServerTimestampAttribute documentation
|
jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/gcloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet
|
apis/Google.Cloud.Firestore/Google.Cloud.Firestore/ServerTimestampAttribute.cs
|
apis/Google.Cloud.Firestore/Google.Cloud.Firestore/ServerTimestampAttribute.cs
|
// Copyright 2018, Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
namespace Google.Cloud.Firestore
{
/// <summary>
/// Attribute indicating that the value of the property within the .NET object should be ignored
/// when creating or modifying a document. Instead, the server time of the commit that creates
/// or modifies the document is automatically used to populate the value in the Firestore document.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class ServerTimestampAttribute : Attribute
{
}
}
|
// Copyright 2018, Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
namespace Google.Cloud.Firestore
{
/// <summary>
/// Attribute indicating that a property value should be ignored on
/// creation and modification operations, using the server time for
/// the commit that modifies the document.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class ServerTimestampAttribute : Attribute
{
}
}
|
apache-2.0
|
C#
|
3f07471cff190164436626bf719aab3173936d3b
|
Make tests for delete collection methods.
|
kangkot/ArangoDB-NET,yojimbo87/ArangoDB-NET
|
src/Arango/Arango.Test/CollectionTests.cs
|
src/Arango/Arango.Test/CollectionTests.cs
|
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Arango.Client;
namespace Arango.Test
{
[TestClass]
public class CollectionTests
{
private ArangoDatabase _database;
public CollectionTests()
{
string alias = "test";
string[] connectionString = File.ReadAllText(@"..\..\..\..\..\ConnectionString.txt").Split(';');
ArangoNode node = new ArangoNode(
connectionString[0],
int.Parse(connectionString[1]),
connectionString[2],
connectionString[3],
alias
);
ArangoClient.Nodes.Add(node);
_database = new ArangoDatabase(alias);
}
[TestMethod]
public void CreateCollectionAndDeleteItByID()
{
ArangoCollection testCollection = new ArangoCollection();
testCollection.Name = "tempUnitTestCollection001xyz";
testCollection.Type = ArangoCollectionType.Document;
testCollection.WaitForSync = false;
testCollection.JournalSize = 1024 * 1024; // 1 MB
ArangoCollection newCollection = _database.CreateCollection(testCollection.Name, testCollection.Type, testCollection.WaitForSync, testCollection.JournalSize);
Assert.AreEqual(testCollection.Name, newCollection.Name);
Assert.AreEqual(testCollection.Type, newCollection.Type);
Assert.AreEqual(testCollection.WaitForSync, newCollection.WaitForSync);
Assert.AreEqual(testCollection.JournalSize, newCollection.JournalSize);
bool isDeleted = _database.DeleteCollection(newCollection.ID);
Assert.IsTrue(isDeleted);
}
[TestMethod]
public void CreateCollectionAndDeleteItByName()
{
ArangoCollection testCollection = new ArangoCollection();
testCollection.Name = "tempUnitTestCollection002xyz";
testCollection.Type = ArangoCollectionType.Document;
testCollection.WaitForSync = false;
testCollection.JournalSize = 1024 * 1024; // 1 MB
ArangoCollection newCollection = _database.CreateCollection(testCollection.Name, testCollection.Type, testCollection.WaitForSync, testCollection.JournalSize);
Assert.AreEqual(testCollection.Name, newCollection.Name);
Assert.AreEqual(testCollection.Type, newCollection.Type);
Assert.AreEqual(testCollection.WaitForSync, newCollection.WaitForSync);
Assert.AreEqual(testCollection.JournalSize, newCollection.JournalSize);
bool isDeleted = _database.DeleteCollection(newCollection.Name);
Assert.IsTrue(isDeleted);
}
}
}
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Arango.Test
{
[TestClass]
public class CollectionTests
{
[TestMethod]
public void TestMethod1()
{
}
}
}
|
mit
|
C#
|
301be3c24cbec6767e46d660dc17bcafed5d1333
|
Fix argument checks in MemoryCacheStore
|
shaynevanasperen/Data.Operations,shaynevanasperen/Magneto
|
src/Magneto.Microsoft/MemoryCacheStore.cs
|
src/Magneto.Microsoft/MemoryCacheStore.cs
|
using System;
using System.Threading.Tasks;
using Magneto.Configuration;
using Magneto.Core;
using Microsoft.Extensions.Caching.Memory;
namespace Magneto.Microsoft
{
public class MemoryCacheStore : ICacheStore<MemoryCacheEntryOptions>
{
readonly IMemoryCache _memoryCache;
public MemoryCacheStore(IMemoryCache memoryCache) => _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));
/// <inheritdoc cref="ISyncCacheStore{DistributedCacheEntryOptions}.Get{T}"/>
public CacheEntry<T> Get<T>(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
return _memoryCache.Get<CacheEntry<T>>(key);
}
/// <inheritdoc cref="ISyncCacheStore{DistributedCacheEntryOptions}.Set{T}"/>
public void Set<T>(string key, CacheEntry<T> item, MemoryCacheEntryOptions cacheEntryOptions)
{
if (key == null) throw new ArgumentNullException(nameof(key));
if (item == null) throw new ArgumentNullException(nameof(item));
if (cacheEntryOptions == null) throw new ArgumentNullException(nameof(cacheEntryOptions));
_memoryCache.Set(key, item, cacheEntryOptions);
}
/// <inheritdoc cref="ISyncCacheStore{DistributedCacheEntryOptions}.Remove"/>
public void Remove(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
_memoryCache.Remove(key);
}
/// <inheritdoc cref="IAsyncCacheStore{DistributedCacheEntryOptions}.GetAsync{T}"/>
public Task<CacheEntry<T>> GetAsync<T>(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
return Task.FromResult(Get<T>(key));
}
/// <inheritdoc cref="IAsyncCacheStore{DistributedCacheEntryOptions}.SetAsync{T}"/>
public Task SetAsync<T>(string key, CacheEntry<T> item, MemoryCacheEntryOptions cacheEntryOptions)
{
if (key == null) throw new ArgumentNullException(nameof(key));
if (item == null) throw new ArgumentNullException(nameof(item));
if (cacheEntryOptions == null) throw new ArgumentNullException(nameof(cacheEntryOptions));
Set(key, item, cacheEntryOptions);
return Task.CompletedTask;
}
/// <inheritdoc cref="IAsyncCacheStore{DistributedCacheEntryOptions}.RemoveAsync"/>
public Task RemoveAsync(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
Remove(key);
return Task.CompletedTask;
}
}
}
|
using System;
using System.Threading.Tasks;
using Magneto.Configuration;
using Magneto.Core;
using Microsoft.Extensions.Caching.Memory;
namespace Magneto.Microsoft
{
public class MemoryCacheStore : ICacheStore<MemoryCacheEntryOptions>
{
readonly IMemoryCache _memoryCache;
public MemoryCacheStore(IMemoryCache memoryCache) => _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));
/// <inheritdoc cref="ISyncCacheStore{DistributedCacheEntryOptions}.Get{T}"/>
public CacheEntry<T> Get<T>(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
return _memoryCache.Get<CacheEntry<T>>(key);
}
/// <inheritdoc cref="ISyncCacheStore{DistributedCacheEntryOptions}.Set{T}"/>
public void Set<T>(string key, CacheEntry<T> item, MemoryCacheEntryOptions cacheEntryOptions)
{
if (item == null) throw new ArgumentNullException(nameof(item));
if (item == null) throw new ArgumentNullException(nameof(item));
if (cacheEntryOptions == null) throw new ArgumentNullException(nameof(cacheEntryOptions));
_memoryCache.Set(key, item, cacheEntryOptions);
}
/// <inheritdoc cref="ISyncCacheStore{DistributedCacheEntryOptions}.Remove"/>
public void Remove(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
_memoryCache.Remove(key);
}
/// <inheritdoc cref="IAsyncCacheStore{DistributedCacheEntryOptions}.GetAsync{T}"/>
public Task<CacheEntry<T>> GetAsync<T>(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
return Task.FromResult(Get<T>(key));
}
/// <inheritdoc cref="IAsyncCacheStore{DistributedCacheEntryOptions}.SetAsync{T}"/>
public Task SetAsync<T>(string key, CacheEntry<T> item, MemoryCacheEntryOptions cacheEntryOptions)
{
if (item == null) throw new ArgumentNullException(nameof(item));
if (item == null) throw new ArgumentNullException(nameof(item));
if (cacheEntryOptions == null) throw new ArgumentNullException(nameof(cacheEntryOptions));
Set(key, item, cacheEntryOptions);
return Task.CompletedTask;
}
/// <inheritdoc cref="IAsyncCacheStore{DistributedCacheEntryOptions}.RemoveAsync"/>
public Task RemoveAsync(string key)
{
if (key == null) throw new ArgumentNullException(nameof(key));
Remove(key);
return Task.CompletedTask;
}
}
}
|
mit
|
C#
|
5c714e247efe90c23d12359d6531a75196e3c6c9
|
Update Assembly versions
|
ErikEJ/EntityFramework.SqlServerCompact,ErikEJ/EntityFramework7.SqlServerCompact
|
src/Provider40/Properties/AssemblyInfo.cs
|
src/Provider40/Properties/AssemblyInfo.cs
|
using System.Reflection;
using Microsoft.EntityFrameworkCore.Design;
[assembly: DesignTimeProviderServices("EFCore.SqlCe.Design.Internal.SqlCeDesignTimeServices")]
#if SQLCE35
[assembly: AssemblyTitle("EntityFrameworkCore.SqlServerCompact35")]
[assembly: AssemblyProduct("EntityFrameworkCore.SqlServerCompact35")]
#else
[assembly: AssemblyTitle("EntityFrameworkCore.SqlServerCompact40")]
[assembly: AssemblyProduct("EntityFrameworkCore.SqlServerCompact40")]
#endif
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyInformationalVersion("2.1.0-rtm")]
|
using System.Reflection;
using Microsoft.EntityFrameworkCore.Design;
[assembly: DesignTimeProviderServices("EFCore.SqlCe.Design.Internal.SqlCeDesignTimeServices")]
#if SQLCE35
[assembly: AssemblyTitle("EntityFrameworkCore.SqlServerCompact35")]
[assembly: AssemblyProduct("EntityFrameworkCore.SqlServerCompact35")]
#else
[assembly: AssemblyTitle("EntityFrameworkCore.SqlServerCompact40")]
[assembly: AssemblyProduct("EntityFrameworkCore.SqlServerCompact40")]
#endif
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-rtm")]
|
apache-2.0
|
C#
|
22e41c7ddd227a875553641b2ac0cbde482d6188
|
Fix error when items had invariant language versions (versions compared could be incorrectly the default language instead of the invariant language)
|
bllue78/Unicorn,kamsar/Unicorn,MacDennis76/Unicorn,bllue78/Unicorn,rmwatson5/Unicorn,PetersonDave/Unicorn,GuitarRich/Unicorn,kamsar/Unicorn,GuitarRich/Unicorn,PetersonDave/Unicorn,MacDennis76/Unicorn,rmwatson5/Unicorn
|
src/Unicorn/Data/ISourceItemExtensions.cs
|
src/Unicorn/Data/ISourceItemExtensions.cs
|
using System;
using System.Linq;
namespace Unicorn.Data
{
public static class SourceItemExtensions
{
/// <summary>
/// Helper method to get a specific version from a source item, if it exists
/// </summary>
/// <returns>Null if the version does not exist or the version if it exists</returns>
public static ItemVersion GetVersion(this ISourceItem sourceItem, string language, int versionNumber)
{
return sourceItem.Versions.FirstOrDefault(x => x.Language.Equals(language, StringComparison.OrdinalIgnoreCase) && x.VersionNumber == versionNumber);
}
}
}
|
using System;
using System.Linq;
using Sitecore.Data.Managers;
using Sitecore.Globalization;
namespace Unicorn.Data
{
public static class SourceItemExtensions
{
/// <summary>
/// Helper method to get a specific version from a source item, if it exists
/// </summary>
/// <returns>Null if the version does not exist or the version if it exists</returns>
public static ItemVersion GetVersion(this ISourceItem sourceItem, string language, int versionNumber)
{
if (language.Equals(Language.Invariant.Name)) language = LanguageManager.DefaultLanguage.Name;
return sourceItem.Versions.FirstOrDefault(x => x.Language.Equals(language, StringComparison.OrdinalIgnoreCase) && x.VersionNumber == versionNumber);
}
}
}
|
mit
|
C#
|
69e1382b760315ba28e93e70aface8047a41812a
|
Add Padding == and != operators, and implement IEquatable<T>
|
l8s/Eto,PowerOfCode/Eto,l8s/Eto,l8s/Eto,PowerOfCode/Eto,bbqchickenrobot/Eto-1,bbqchickenrobot/Eto-1,bbqchickenrobot/Eto-1,PowerOfCode/Eto
|
Source/Eto/Drawing/Padding.cs
|
Source/Eto/Drawing/Padding.cs
|
using System;
using System.ComponentModel;
namespace Eto.Drawing
{
[TypeConverter(typeof(PaddingConverter))]
public struct Padding : IEquatable<Padding>
{
public int Top { get; set; }
public int Left { get; set; }
public int Right { get; set; }
public int Bottom { get; set; }
public static readonly Padding Empty = new Padding(0);
public Padding (int all)
: this()
{
this.Left = all;
this.Top = all;
this.Right = all;
this.Bottom = all;
}
public Padding (int horizontal, int vertical)
: this()
{
this.Left = horizontal;
this.Top = vertical;
this.Right = horizontal;
this.Bottom = vertical;
}
public Padding (int left, int top, int right, int bottom)
: this()
{
this.Left = left;
this.Top = top;
this.Right = right;
this.Bottom = bottom;
}
public int Horizontal
{
get { return Left + Right; }
}
public int Vertical
{
get { return Top + Bottom; }
}
public Size Size
{
get { return new Size(Horizontal, Vertical); }
}
public static bool operator == (Padding value1, Padding value2)
{
return value1.Top == value2.Top && value1.Bottom == value2.Bottom && value1.Left == value2.Left && value1.Right == value2.Right;
}
public static bool operator != (Padding value1, Padding value2)
{
return !(value1 == value2);
}
public override bool Equals (object obj)
{
return obj is Padding && (Padding)obj == this;
}
public override int GetHashCode ()
{
return Top ^ Left ^ Right ^ Bottom;
}
public override string ToString ()
{
return string.Format ("[Padding: Top={0}, Left={1}, Right={2}, Bottom={3}]", Top, Left, Right, Bottom);
}
public bool Equals (Padding other)
{
return other == this;
}
}
}
|
using System;
using System.ComponentModel;
namespace Eto.Drawing
{
[TypeConverter(typeof(PaddingConverter))]
public struct Padding
{
public int Top { get; set; }
public int Left { get; set; }
public int Right { get; set; }
public int Bottom { get; set; }
public static readonly Padding Empty = new Padding(0);
public Padding (int all)
: this()
{
this.Left = all;
this.Top = all;
this.Right = all;
this.Bottom = all;
}
public Padding (int horizontal, int vertical)
: this()
{
this.Left = horizontal;
this.Top = vertical;
this.Right = horizontal;
this.Bottom = vertical;
}
public Padding (int left, int top, int right, int bottom)
: this()
{
this.Left = left;
this.Top = top;
this.Right = right;
this.Bottom = bottom;
}
public int Horizontal
{
get { return Left + Right; }
}
public int Vertical
{
get { return Top + Bottom; }
}
public Size Size
{
get { return new Size(Horizontal, Vertical); }
}
public override bool Equals (object obj)
{
if (!(obj is Padding)) return false;
var val = (Padding)obj;
return val.Top == Top && val.Bottom == Bottom && val.Left == Left && val.Right == Right;
}
public override int GetHashCode ()
{
return Top ^ Left ^ Right ^ Bottom;
}
public override string ToString ()
{
return string.Format ("[Padding: Top={0}, Left={1}, Right={2}, Bottom={3}]", Top, Left, Right, Bottom);
}
}
}
|
bsd-3-clause
|
C#
|
9f9ac5a4e273f589a412fff933aacdef50416af9
|
Add DetailedErrorPolicy in global configuration
|
uheerme/core,uheerme/core,uheerme/core
|
Samesound/Global.asax.cs
|
Samesound/Global.asax.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Samesound
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Samesound
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
|
mit
|
C#
|
78fc808db6055d1790369a5b21f60c6223d749be
|
Add comment
|
sharwell/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,jasonmalinowski/roslyn,jasonmalinowski/roslyn,sharwell/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,sharwell/roslyn,mavasani/roslyn,KevinRansom/roslyn,KevinRansom/roslyn,mavasani/roslyn,diryboy/roslyn,diryboy/roslyn,dotnet/roslyn,diryboy/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,dotnet/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn
|
src/EditorFeatures/Core/GoToImplementation/GoToImplementationCommandHandler.cs
|
src/EditorFeatures/Core/GoToImplementation/GoToImplementationCommandHandler.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.CommandHandlers;
using Microsoft.CodeAnalysis.Editor.Commanding.Commands;
using Microsoft.CodeAnalysis.Editor.FindUsages;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.FindUsages;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.SymbolMapping;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.GoToImplementation
{
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.GoToImplementation)]
internal class GoToImplementationCommandHandler : AbstractGoToCommandHandler<IFindUsagesService, GoToImplementationCommandArgs>
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public GoToImplementationCommandHandler(
IThreadingContext threadingContext,
IStreamingFindUsagesPresenter streamingPresenter) : base(threadingContext, streamingPresenter)
{
}
public override string DisplayName => EditorFeaturesResources.Go_To_Implementation;
protected override string ScopeDescription => EditorFeaturesResources.Locating_implementations;
protected override FunctionId FunctionId => FunctionId.CommandHandler_GoToImplementation;
protected override Task FindActionAsync(IFindUsagesService service, Document document, int caretPosition, IFindUsagesContext context, CancellationToken cancellationToken)
=> service.FindImplementationsAsync(document, caretPosition, context, cancellationToken);
protected override IFindUsagesService? GetService(Document? document)
=> document?.GetLanguageService<IFindUsagesService>();
protected override async Task<Solution> GetSolutionAsync(Document document, CancellationToken cancellationToken)
{
// The original document we may be starting with might be in a metadata-as-source workspace.
// Ensure that we map back to the real primary workspace to present symbols in so we can
// navigate back to source implementations there.
var mappingService = document.Project.Solution.Workspace.Services.GetRequiredService<ISymbolMappingService>();
var mappedProject = await mappingService.MapDocumentAsync(document, cancellationToken).ConfigureAwait(false);
return mappedProject?.Solution ?? document.Project.Solution;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.CommandHandlers;
using Microsoft.CodeAnalysis.Editor.Commanding.Commands;
using Microsoft.CodeAnalysis.Editor.FindUsages;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.FindUsages;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.SymbolMapping;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.GoToImplementation
{
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.GoToImplementation)]
internal class GoToImplementationCommandHandler : AbstractGoToCommandHandler<IFindUsagesService, GoToImplementationCommandArgs>
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public GoToImplementationCommandHandler(
IThreadingContext threadingContext,
IStreamingFindUsagesPresenter streamingPresenter) : base(threadingContext, streamingPresenter)
{
}
public override string DisplayName => EditorFeaturesResources.Go_To_Implementation;
protected override string ScopeDescription => EditorFeaturesResources.Locating_implementations;
protected override FunctionId FunctionId => FunctionId.CommandHandler_GoToImplementation;
protected override Task FindActionAsync(IFindUsagesService service, Document document, int caretPosition, IFindUsagesContext context, CancellationToken cancellationToken)
=> service.FindImplementationsAsync(document, caretPosition, context, cancellationToken);
protected override IFindUsagesService? GetService(Document? document)
=> document?.GetLanguageService<IFindUsagesService>();
protected override async Task<Solution> GetSolutionAsync(Document document, CancellationToken cancellationToken)
{
var mappingService = document.Project.Solution.Workspace.Services.GetRequiredService<ISymbolMappingService>();
var mappedProject = await mappingService.MapDocumentAsync(document, cancellationToken).ConfigureAwait(false);
return mappedProject?.Solution ?? document.Project.Solution;
}
}
}
|
mit
|
C#
|
7cd12b251d9faff32328e378e12f8e9b59fd963d
|
Build SMA with version 0.0.0.0
|
bingbing8/PowerShell,daxian-dbw/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,jsoref/PowerShell,JamesWTruher/PowerShell-1,jsoref/PowerShell,TravisEz13/PowerShell,kmosher/PowerShell,JamesWTruher/PowerShell-1,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,jsoref/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,PaulHigin/PowerShell,daxian-dbw/PowerShell,bingbing8/PowerShell,TravisEz13/PowerShell,kmosher/PowerShell,kmosher/PowerShell,TravisEz13/PowerShell,daxian-dbw/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,KarolKaczmarek/PowerShell,jsoref/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,PaulHigin/PowerShell,JamesWTruher/PowerShell-1,PaulHigin/PowerShell,JamesWTruher/PowerShell-1,kmosher/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell,bmanikm/PowerShell,kmosher/PowerShell,daxian-dbw/PowerShell
|
src/System.Management.Automation/System.Management.Automation.assembly-info.cs
|
src/System.Management.Automation/System.Management.Automation.assembly-info.cs
|
using System.Runtime.CompilerServices;
using System.Reflection;
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Management")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Utility")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Security")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.Host")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.UnitTests")]
[assembly:AssemblyFileVersionAttribute("0.0.0.0")]
[assembly:AssemblyVersion("0.0.0.0")]
namespace System.Management.Automation
{
internal class NTVerpVars
{
internal const int PRODUCTMAJORVERSION = 10;
internal const int PRODUCTMINORVERSION = 0;
internal const int PRODUCTBUILD = 10032;
internal const int PRODUCTBUILD_QFE = 0;
internal const int PACKAGEBUILD_QFE = 814;
}
}
|
using System.Runtime.CompilerServices;
using System.Reflection;
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Management")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Utility")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Security")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.Host")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Linux.UnitTests")]
[assembly:AssemblyFileVersionAttribute("3.0.0.0")]
[assembly:AssemblyVersion("3.0.0.0")]
namespace System.Management.Automation
{
internal class NTVerpVars
{
internal const int PRODUCTMAJORVERSION = 10;
internal const int PRODUCTMINORVERSION = 0;
internal const int PRODUCTBUILD = 10032;
internal const int PRODUCTBUILD_QFE = 0;
internal const int PACKAGEBUILD_QFE = 814;
}
}
|
mit
|
C#
|
2c6dba704918d7bc1c25f411c428e2d2134bfed0
|
Update SiblingElement.cs
|
thelgevold/xpathitup
|
XPathFinder/SiblingElement.cs
|
XPathFinder/SiblingElement.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace XPathItUp
{
internal class SiblingElement:Base, ISibling
{
public static SiblingElement Create(string tag, List<string> expressionParts, string siblingType,int tagIndex)
{
return new SiblingElement(tag,expressionParts,siblingType,tagIndex);
}
private SiblingElement(string tag, List<string> expressionParts, string siblingType, int tagIndex)
{
this.ExpressionParts = expressionParts;
this.ExpressionParts.Insert(tagIndex,string.Format("/{0}::{1}", siblingType, tag));
this.tagIndex = this.ExpressionParts.Count - 1;
}
public ILimitedWith With
{
get { return WithExpression.Create(this.ExpressionParts, this.tagIndex,false); }
}
}
}
|
/*
Copyright (C) 2010 Torgeir Helgevold
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace XPathItUp
{
internal class SiblingElement:Base, ISibling
{
public static SiblingElement Create(string tag, List<string> expressionParts, string siblingType,int tagIndex)
{
return new SiblingElement(tag,expressionParts,siblingType,tagIndex);
}
private SiblingElement(string tag, List<string> expressionParts, string siblingType, int tagIndex)
{
this.ExpressionParts = expressionParts;
this.ExpressionParts.Insert(tagIndex,string.Format("/{0}::{1}", siblingType, tag));
this.tagIndex = this.ExpressionParts.Count - 1;
}
public ILimitedWith With
{
get { return WithExpression.Create(this.ExpressionParts, this.tagIndex,false); }
}
}
}
|
mit
|
C#
|
2776e831092cf0562762dd00f98b052d2166e20e
|
Fix Benchmark requiring a clock within Load.
|
Nabile-Rahmani/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,RedNesto/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,RedNesto/osu-framework,paparony03/osu-framework,naoey/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ZLima12/osu-framework,Tom94/osu-framework,DrabWeb/osu-framework,default0/osu-framework,default0/osu-framework,Tom94/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,NeoAdonis/osu-framework,Nabile-Rahmani/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,naoey/osu-framework,ZLima12/osu-framework,paparony03/osu-framework,DrabWeb/osu-framework,NeoAdonis/osu-framework
|
osu.Framework.VisualTests/Benchmark.cs
|
osu.Framework.VisualTests/Benchmark.cs
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Diagnostics;
using osu.Framework.GameModes.Testing;
namespace osu.Framework.VisualTests
{
public class Benchmark : BaseGame
{
private double timePerTest = 200;
protected override void Load(BaseGame game)
{
base.Load(game);
Host.MaximumDrawHz = int.MaxValue;
Host.MaximumUpdateHz = int.MaxValue;
Host.MaximumInactiveHz = int.MaxValue;
}
protected override void LoadComplete()
{
base.LoadComplete();
TestBrowser f = new TestBrowser();
Add(f);
Console.WriteLine($@"{Time}: Running {f.TestCount} tests for {timePerTest}ms each...");
for (int i = 1; i < f.TestCount; i++)
{
int loadableCase = i;
Scheduler.AddDelayed(delegate
{
f.LoadTest(loadableCase);
Console.WriteLine($@"{Time}: Switching to test #{loadableCase}");
}, loadableCase * timePerTest);
}
Scheduler.AddDelayed(Host.Exit, f.TestCount * timePerTest);
}
}
}
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Diagnostics;
using osu.Framework.GameModes.Testing;
namespace osu.Framework.VisualTests
{
public class Benchmark : BaseGame
{
private double timePerTest = 200;
protected override void Load(BaseGame game)
{
base.Load(game);
Host.MaximumDrawHz = int.MaxValue;
Host.MaximumUpdateHz = int.MaxValue;
Host.MaximumInactiveHz = int.MaxValue;
TestBrowser f = new TestBrowser();
Add(f);
Console.WriteLine($@"{Time}: Running {f.TestCount} tests for {timePerTest}ms each...");
for (int i = 1; i < f.TestCount; i++)
{
int loadableCase = i;
Scheduler.AddDelayed(delegate
{
f.LoadTest(loadableCase);
Console.WriteLine($@"{Time}: Switching to test #{loadableCase}");
}, loadableCase * timePerTest);
}
Scheduler.AddDelayed(Host.Exit, f.TestCount * timePerTest);
}
}
}
|
mit
|
C#
|
cf6d95cba11f4247f45fc711e7e7a1035da0faf8
|
Rename some methods to be more .NET (#1255)
|
mono/SkiaSharp,mono/SkiaSharp,mono/SkiaSharp,mono/SkiaSharp,mono/SkiaSharp,mono/SkiaSharp,mono/SkiaSharp
|
binding/Binding/SKRotationScaleMatrix.cs
|
binding/Binding/SKRotationScaleMatrix.cs
|
using System;
namespace SkiaSharp
{
public unsafe partial struct SKRotationScaleMatrix
{
public static readonly SKRotationScaleMatrix Empty;
public static readonly SKRotationScaleMatrix Identity = new SKRotationScaleMatrix (1, 0, 0, 0);
public SKRotationScaleMatrix (float scos, float ssin, float tx, float ty)
{
fSCos = scos;
fSSin = ssin;
fTX = tx;
fTY = ty;
}
public readonly SKMatrix ToMatrix () =>
new SKMatrix (fSCos, -fSSin, fTX, fSSin, fSCos, fTY, 0, 0, 1);
public static SKRotationScaleMatrix CreateDegrees (float scale, float degrees, float tx, float ty, float anchorX, float anchorY) =>
Create (scale, degrees * SKMatrix.DegreesToRadians, tx, ty, anchorX, anchorY);
public static SKRotationScaleMatrix Create (float scale, float radians, float tx, float ty, float anchorX, float anchorY)
{
var s = (float)Math.Sin (radians) * scale;
var c = (float)Math.Cos (radians) * scale;
var x = tx + -c * anchorX + s * anchorY;
var y = ty + -s * anchorX - c * anchorY;
return new SKRotationScaleMatrix (c, s, x, y);
}
public static SKRotationScaleMatrix CreateIdentity () =>
new SKRotationScaleMatrix (1, 0, 0, 0);
public static SKRotationScaleMatrix CreateTranslation (float x, float y) =>
new SKRotationScaleMatrix (1, 0, x, y);
public static SKRotationScaleMatrix CreateScale (float s) =>
new SKRotationScaleMatrix (s, 0, 0, 0);
public static SKRotationScaleMatrix CreateRotation (float radians, float anchorX, float anchorY) =>
Create (1, radians, 0, 0, anchorX, anchorY);
public static SKRotationScaleMatrix CreateRotationDegrees (float degrees, float anchorX, float anchorY) =>
CreateDegrees (1, degrees, 0, 0, anchorX, anchorY);
}
}
|
using System;
namespace SkiaSharp
{
public unsafe partial struct SKRotationScaleMatrix
{
public static readonly SKRotationScaleMatrix Empty;
public static readonly SKRotationScaleMatrix Identity = new SKRotationScaleMatrix (1, 0, 0, 0);
public SKRotationScaleMatrix (float scos, float ssin, float tx, float ty)
{
fSCos = scos;
fSSin = ssin;
fTX = tx;
fTY = ty;
}
public readonly SKMatrix ToMatrix () =>
new SKMatrix (fSCos, -fSSin, fTX, fSSin, fSCos, fTY, 0, 0, 1);
public static SKRotationScaleMatrix FromDegrees (float scale, float degrees, float tx, float ty, float anchorX, float anchorY) =>
FromRadians (scale, degrees * SKMatrix.DegreesToRadians, tx, ty, anchorX, anchorY);
public static SKRotationScaleMatrix FromRadians (float scale, float radians, float tx, float ty, float anchorX, float anchorY)
{
var s = (float)Math.Sin (radians) * scale;
var c = (float)Math.Cos (radians) * scale;
var x = tx + -c * anchorX + s * anchorY;
var y = ty + -s * anchorX - c * anchorY;
return new SKRotationScaleMatrix (c, s, x, y);
}
public static SKRotationScaleMatrix CreateIdentity () =>
new SKRotationScaleMatrix (1, 0, 0, 0);
public static SKRotationScaleMatrix CreateTranslation (float x, float y) =>
new SKRotationScaleMatrix (1, 0, x, y);
public static SKRotationScaleMatrix CreateScale (float s) =>
new SKRotationScaleMatrix (s, 0, 0, 0);
public static SKRotationScaleMatrix CreateRotation (float radians, float anchorX, float anchorY) =>
FromRadians (1, radians, 0, 0, anchorX, anchorY);
public static SKRotationScaleMatrix CreateRotationDegrees (float degrees, float anchorX, float anchorY) =>
FromDegrees (1, degrees, 0, 0, anchorX, anchorY);
}
}
|
mit
|
C#
|
fd667bb3e819033e76c816cc3e2d0ce7bcd8a9fb
|
Change to www
|
pjf/StuffManager
|
StuffManager/Settings.cs
|
StuffManager/Settings.cs
|
using System;
namespace StuffManager
{
static class Settings
{
// The root address of KerbalStuff
public static String KS_ROOT = "https://www.kerbalstuff.com";
//API String for KerbalStuff
public static String KS_API = KS_ROOT + "/api";
//String for getting a user via KS's API
public static String KS_USER = KS_API + "/user";
//String for getting a mod via KS's API
public static String KS_MOD = KS_API + "/mod";
//String to search for mods via KS's API
public static String KS_MOD_SEARCH = KS_API + "/search/mod?query=";
//String to search for users via KS's API
public static String KS_USER_SEARCH = KS_API + "/search/user?query=";
}
}
|
using System;
namespace StuffManager
{
static class Settings
{
// The root address of KerbalStuff
public static String KS_ROOT = "https://beta.kerbalstuff.com";
//API String for KerbalStuff
public static String KS_API = KS_ROOT + "/api";
//String for getting a user via KS's API
public static String KS_USER = KS_API + "/user";
//String for getting a mod via KS's API
public static String KS_MOD = KS_API + "/mod";
//String to search for mods via KS's API
public static String KS_MOD_SEARCH = KS_API + "/search/mod?query=";
//String to search for users via KS's API
public static String KS_USER_SEARCH = KS_API + "/search/user?query=";
}
}
|
mit
|
C#
|
7177a0b4b62db0808e8ff356702e640717fe5565
|
remove unnecessary using
|
Kingloo/Pingy
|
src/Model/IP.cs
|
src/Model/IP.cs
|
using System.Net;
namespace Pingy.Model
{
public class IP : PingBase
{
public IP(IPAddress ip)
{
Address = ip;
DisplayName = Address.ToString();
}
}
}
|
using System;
using System.Net;
namespace Pingy.Model
{
public class IP : PingBase
{
public IP(IPAddress ip)
{
Address = ip;
DisplayName = Address.ToString();
}
}
}
|
unlicense
|
C#
|
a2cc139ad340c6eb0a8a8a0ea2d9db1a901a89d3
|
Update AHCI.cs
|
CosmosOS/Cosmos,tgiphil/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,jp2masa/Cosmos,zarlo/Cosmos,fanoI/Cosmos,zarlo/Cosmos,tgiphil/Cosmos,tgiphil/Cosmos,zarlo/Cosmos,jp2masa/Cosmos,jp2masa/Cosmos,fanoI/Cosmos,CosmosOS/Cosmos,fanoI/Cosmos,zarlo/Cosmos
|
source/Cosmos.Core/MemoryGroup/AHCI.cs
|
source/Cosmos.Core/MemoryGroup/AHCI.cs
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Cosmos.Core.MemoryGroup
{
public class AHCI
{
public MemoryBlock DataBlock;
public AHCI(uint aSectorSize)
{
DataBlock = new Core.MemoryBlock(0x0046C000, aSectorSize * 1024);
DataBlock.Fill(0);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Cosmos.Core.MemoryGroup
{
public class AHCI
{
public MemoryBlock DataBlock;
public AHCI(uint aSectorSize)
{
DataBlock = new Core.MemoryBlock(0x0046C000, aSectorSize * 256);
DataBlock.Fill(0);
}
}
}
|
bsd-3-clause
|
C#
|
ccad45fccef3aa303bb00f92b784e61093cf6116
|
Annotate PlatformID as a moved type
|
shimingsg/corefx,ViktorHofer/corefx,wtgodbe/corefx,ViktorHofer/corefx,ericstj/corefx,wtgodbe/corefx,BrennanConroy/corefx,wtgodbe/corefx,ptoonen/corefx,ViktorHofer/corefx,wtgodbe/corefx,ptoonen/corefx,wtgodbe/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,wtgodbe/corefx,ericstj/corefx,ptoonen/corefx,wtgodbe/corefx,ViktorHofer/corefx,ViktorHofer/corefx,shimingsg/corefx,BrennanConroy/corefx,ptoonen/corefx,shimingsg/corefx,shimingsg/corefx,ptoonen/corefx,shimingsg/corefx,ericstj/corefx,ptoonen/corefx,ViktorHofer/corefx,ptoonen/corefx,BrennanConroy/corefx,shimingsg/corefx,ViktorHofer/corefx,ericstj/corefx,ericstj/corefx
|
src/Common/src/CoreLib/System/PlatformID.cs
|
src/Common/src/CoreLib/System/PlatformID.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.ComponentModel;
namespace System
{
#if PROJECTN
[Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
#endif
public enum PlatformID
{
[EditorBrowsable(EditorBrowsableState.Never)] Win32S = 0,
[EditorBrowsable(EditorBrowsableState.Never)] Win32Windows = 1,
Win32NT = 2,
[EditorBrowsable(EditorBrowsableState.Never)] WinCE = 3,
Unix = 4,
[EditorBrowsable(EditorBrowsableState.Never)] Xbox = 5,
[EditorBrowsable(EditorBrowsableState.Never)] MacOSX = 6
}
}
|
// 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.ComponentModel;
namespace System
{
public enum PlatformID
{
[EditorBrowsable(EditorBrowsableState.Never)] Win32S = 0,
[EditorBrowsable(EditorBrowsableState.Never)] Win32Windows = 1,
Win32NT = 2,
[EditorBrowsable(EditorBrowsableState.Never)] WinCE = 3,
Unix = 4,
[EditorBrowsable(EditorBrowsableState.Never)] Xbox = 5,
[EditorBrowsable(EditorBrowsableState.Never)] MacOSX = 6
}
}
|
mit
|
C#
|
f0b268ccdc002cd7de6b1521b8959e5de43df5b7
|
Clear scroll does indeed return an empty response
|
cstlaurent/elasticsearch-net,KodrAus/elasticsearch-net,cstlaurent/elasticsearch-net,azubanov/elasticsearch-net,RossLieberman/NEST,CSGOpenSource/elasticsearch-net,KodrAus/elasticsearch-net,adam-mccoy/elasticsearch-net,TheFireCookie/elasticsearch-net,elastic/elasticsearch-net,azubanov/elasticsearch-net,RossLieberman/NEST,elastic/elasticsearch-net,adam-mccoy/elasticsearch-net,RossLieberman/NEST,azubanov/elasticsearch-net,CSGOpenSource/elasticsearch-net,UdiBen/elasticsearch-net,UdiBen/elasticsearch-net,TheFireCookie/elasticsearch-net,adam-mccoy/elasticsearch-net,TheFireCookie/elasticsearch-net,CSGOpenSource/elasticsearch-net,cstlaurent/elasticsearch-net,KodrAus/elasticsearch-net,UdiBen/elasticsearch-net
|
src/Nest/CommonAbstractions/Response/EmptyResponse.cs
|
src/Nest/CommonAbstractions/Response/EmptyResponse.cs
|
using Newtonsoft.Json;
namespace Nest
{
public interface IEmptyResponse : IResponse
{
}
[JsonObject]
public class EmptyResponse : BaseResponse, IEmptyResponse
{
}
}
|
using Newtonsoft.Json;
namespace Nest
{
public interface IEmptyResponse : IResponse
{
}
[JsonObject]
//TODO Only used by clearscroll, does it really not return anything useful?
public class EmptyResponse : BaseResponse, IEmptyResponse
{
}
}
|
apache-2.0
|
C#
|
6122babf893c9369fc4b3ff56e41643bfbd15bbd
|
Update version for publishing to Nuget.
|
grantcolley/wpfcontrols
|
DevelopmentInProgress.WPFControls/Properties/AssemblyInfo.cs
|
DevelopmentInProgress.WPFControls/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DipWpfControls")]
[assembly: AssemblyDescription("Custom WPF controls (beta)")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Development In Progress Ltd")]
[assembly: AssemblyProduct("DipWpfControls")]
[assembly: AssemblyCopyright("Copyright © Development In Progress Ltd 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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DipWpfControls")]
[assembly: AssemblyDescription("Custom WPF controls (beta)")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Development In Progress Ltd")]
[assembly: AssemblyProduct("DipWpfControls")]
[assembly: AssemblyCopyright("Copyright © Development In Progress Ltd 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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.0.0")]
[assembly: AssemblyFileVersion("1.5.0.0")]
|
apache-2.0
|
C#
|
33799d248c7aa5d7cc495cea96872ed1bfbe75c4
|
Add back private setter in NameRecord
|
SixLabors/Fonts
|
src/SixLabors.Fonts/Tables/General/Name/NameRecord.cs
|
src/SixLabors.Fonts/Tables/General/Name/NameRecord.cs
|
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Text;
using SixLabors.Fonts.Utilities;
using SixLabors.Fonts.WellKnownIds;
namespace SixLabors.Fonts.Tables.General.Name
{
internal class NameRecord
{
private readonly string value;
public NameRecord(PlatformIDs platform, ushort languageId, NameIds nameId, string value)
{
this.Platform = platform;
this.LanguageID = languageId;
this.NameID = nameId;
this.value = value;
}
public PlatformIDs Platform { get; }
public ushort LanguageID { get; }
public NameIds NameID { get; }
internal StringLoader StringReader { get; private set; }
public string Value => this.StringReader?.Value ?? this.value;
public static NameRecord Read(BinaryReader reader)
{
PlatformIDs platform = reader.ReadUInt16<PlatformIDs>();
EncodingIDs encodingId = reader.ReadUInt16<EncodingIDs>();
Encoding encoding = encodingId.AsEncoding();
ushort languageID = reader.ReadUInt16();
NameIds nameID = reader.ReadUInt16<NameIds>();
StringLoader stringReader = StringLoader.Create(reader, encoding);
return new NameRecord(platform, languageID, nameID, null)
{
StringReader = stringReader
};
}
}
}
|
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Text;
using SixLabors.Fonts.Utilities;
using SixLabors.Fonts.WellKnownIds;
namespace SixLabors.Fonts.Tables.General.Name
{
internal class NameRecord
{
private readonly string value;
public NameRecord(PlatformIDs platform, ushort languageId, NameIds nameId, string value)
{
this.Platform = platform;
this.LanguageID = languageId;
this.NameID = nameId;
this.value = value;
}
public PlatformIDs Platform { get; }
public ushort LanguageID { get; }
public NameIds NameID { get; }
internal StringLoader StringReader { get; }
public string Value => this.StringReader?.Value ?? this.value;
public static NameRecord Read(BinaryReader reader)
{
PlatformIDs platform = reader.ReadUInt16<PlatformIDs>();
EncodingIDs encodingId = reader.ReadUInt16<EncodingIDs>();
Encoding encoding = encodingId.AsEncoding();
ushort languageID = reader.ReadUInt16();
NameIds nameID = reader.ReadUInt16<NameIds>();
StringLoader stringReader = StringLoader.Create(reader, encoding);
return new NameRecord(platform, languageID, nameID, null)
{
StringReader = stringReader
};
}
}
}
|
apache-2.0
|
C#
|
919d5deb73efb710c125998ec97449039c467bd3
|
Refactor to use linq expression
|
appharbor/appharbor-cli
|
src/AppHarbor/CompressionExtensions.cs
|
src/AppHarbor/CompressionExtensions.cs
|
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;
namespace AppHarbor
{
public static class CompressionExtensions
{
public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
{
var archive = TarArchive.CreateOutputTarArchive(output);
archive.RootPath = sourceDirectory.FullName.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');
var entries = GetFiles(sourceDirectory, excludedDirectoryNames)
.Select(x => TarEntry.CreateEntryFromFile(x.FullName));
foreach (var entry in entries)
{
archive.WriteEntry(entry, true);
}
archive.Close();
}
private static IEnumerable<FileInfo> GetFiles(DirectoryInfo directory, string[] excludedDirectories)
{
return directory.GetFiles("*", SearchOption.TopDirectoryOnly)
.Concat(directory.GetDirectories()
.Where(x => excludedDirectories.Contains(x.Name))
.SelectMany(x => GetFiles(x, excludedDirectories)));
}
}
}
|
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;
namespace AppHarbor
{
public static class CompressionExtensions
{
public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
{
var archive = TarArchive.CreateOutputTarArchive(output);
archive.RootPath = sourceDirectory.FullName.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');
var entries = GetFiles(sourceDirectory, excludedDirectoryNames)
.Select(x => TarEntry.CreateEntryFromFile(x.FullName));
foreach (var entry in entries)
{
archive.WriteEntry(entry, true);
}
archive.Close();
}
private static IEnumerable<FileInfo> GetFiles(DirectoryInfo directory, string[] excludedDirectories)
{
IEnumerable<FileInfo> files = directory.GetFiles("*", SearchOption.TopDirectoryOnly);
foreach (var nestedDirectory in directory.GetDirectories())
{
if (excludedDirectories.Contains(nestedDirectory.Name))
{
continue;
}
files = files.Concat(GetFiles(nestedDirectory, excludedDirectories));
}
return files;
}
}
}
|
mit
|
C#
|
57fbed8de8028e19e951168b9579f0b4153bca7e
|
Update Fun token image URL.
|
funfair-tech/CoinBot
|
src/CoinBot.Discord/Commands/CommandBase.cs
|
src/CoinBot.Discord/Commands/CommandBase.cs
|
using Discord;
using Discord.Commands;
using System;
namespace CoinBot.Discord.Commands
{
public abstract class CommandBase : ModuleBase
{
protected static void AddAuthor(EmbedBuilder builder)
{
builder.WithAuthor(new EmbedAuthorBuilder
{
Name = "FunFair CoinBot - right click above to block",
Url = "https://funfair.io",
IconUrl = "https://s2.coinmarketcap.com/static/img/coins/32x32/1757.png"
});
}
protected static void AddFooter(EmbedBuilder builder, DateTime? dateTime = null)
{
if (dateTime.HasValue)
{
builder.Timestamp = dateTime;
builder.Footer = new EmbedFooterBuilder
{
Text = "Prices updated"
};
}
}
}
}
|
using Discord;
using Discord.Commands;
using System;
namespace CoinBot.Discord.Commands
{
public abstract class CommandBase : ModuleBase
{
protected static void AddAuthor(EmbedBuilder builder)
{
builder.WithAuthor(new EmbedAuthorBuilder
{
Name = "FunFair CoinBot - right click above to block",
Url = "https://funfair.io",
IconUrl = "https://files.coinmarketcap.com/static/img/coins/32x32/funfair.png"
});
}
protected static void AddFooter(EmbedBuilder builder, DateTime? dateTime = null)
{
if (dateTime.HasValue)
{
builder.Timestamp = dateTime;
builder.Footer = new EmbedFooterBuilder
{
Text = "Prices updated"
};
}
}
}
}
|
mit
|
C#
|
83dc4ed352978d6ac08e2b700db601dcdcd41574
|
Add data contract attribute to Discrepancy.cs
|
Ackara/Daterpillar
|
src/Daterpillar.Core/Compare/Discrepancy.cs
|
src/Daterpillar.Core/Compare/Discrepancy.cs
|
using System.Runtime.Serialization;
namespace Gigobyte.Daterpillar.Compare
{
[DataContract]
public class Discrepancy
{
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gigobyte.Daterpillar.Compare
{
public class Discrepancy
{
}
}
|
mit
|
C#
|
96ed73a9b0baf607c56d29b497c1d53ce9a53a3a
|
Fix HasMore
|
exceptionless/Foundatio.Repositories
|
src/Elasticsearch/Queries/Builders/PagableQueryBuilder.cs
|
src/Elasticsearch/Queries/Builders/PagableQueryBuilder.cs
|
using System;
using Foundatio.Repositories.Queries;
namespace Foundatio.Repositories.Elasticsearch.Queries.Builders {
public class PagableQueryBuilder : IElasticQueryBuilder {
public void Build<T>(QueryBuilderContext<T> ctx) where T : class, new() {
var pagableQuery = ctx.GetQueryAs<IPagableQuery>();
if (pagableQuery == null)
return;
// add 1 to limit if not auto paging so we can know if we have more results
if (pagableQuery.ShouldUseLimit())
ctx.Search.Size(pagableQuery.GetLimit() + (!pagableQuery.ShouldUseSnapshotPaging() ? 1 : 0));
if (pagableQuery.ShouldUseSkip())
ctx.Search.Skip(pagableQuery.GetSkip());
}
}
}
|
using System;
using Foundatio.Repositories.Queries;
namespace Foundatio.Repositories.Elasticsearch.Queries.Builders {
public class PagableQueryBuilder : IElasticQueryBuilder {
public void Build<T>(QueryBuilderContext<T> ctx) where T : class, new() {
var pagableQuery = ctx.GetQueryAs<IPagableQuery>();
if (pagableQuery == null)
return;
// add 1 to limit if not auto paging so we can know if we have more results
if (pagableQuery.ShouldUseLimit())
ctx.Search.Size(pagableQuery.GetLimit() + (pagableQuery.ShouldUseSnapshotPaging() ? 1 : 0));
if (pagableQuery.ShouldUseSkip())
ctx.Search.Skip(pagableQuery.GetSkip());
}
}
}
|
apache-2.0
|
C#
|
32dddd566ff86d875984a71d2323d2be0a270b82
|
update the main function to create an output pin configuraiton, open a gpio connection, create a loop that toggles the LED for 25 seconds.
|
cdemaskey/coffee-roaster,cdemaskey/coffee-roaster
|
coffee-roaster/coffee-roaster/Program.cs
|
coffee-roaster/coffee-roaster/Program.cs
|
using Raspberry.IO.GeneralPurpose;
using System;
using System.Threading;
namespace coffee_roaster
{
internal class Program
{
private static void Main(string[] args)
{
var led1 = ConnectorPin.P1Pin07.Output();
var connection = new GpioConnection(led1);
for(int i = 0; i < 100; i++)
{
connection.Toggle(led1);
Thread.Sleep(250);
}
connection.Close();
}
}
}
|
using System;
namespace coffee_roaster
{
internal class Program
{
private static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("\n\nPress any key to exit");
Console.ReadKey();
}
}
}
|
mit
|
C#
|
dae21ad0e685d011bc831c7dc58e6ff46bcd43c2
|
Update _Layout.cshtml
|
pacoferre/polymercrud,pacoferre/polymercrud,pacoferre/polymercrud
|
src/PolymerCRUD/Views/Shared/_Layout.cshtml
|
src/PolymerCRUD/Views/Shared/_Layout.cshtml
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="Polymer CRUD">
<title>@ViewData["Title"] - Polymer CRUD</title>
<!-- Place favicon.ico in the `app/` directory -->
<!-- Chrome for Android theme color -->
<meta name="theme-color" content="#2E3AA1">
<!-- Web Application Manifest -->
<link rel="manifest" href="manifest.json">
<!-- Tile color for Win8 -->
<meta name="msapplication-TileColor" content="#3372DF">
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="PSK">
<link rel="icon" sizes="192x192" href="images/touch/chrome-touch-icon-192x192.png">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Polymer CRUD">
<link rel="apple-touch-icon" href="images/touch/apple-touch-icon.png">
<!-- Tile icon for Win8 (144x144) -->
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<!-- Because this project uses vulcanize this should be your only html import
in this file. All other imports should go in elements.html -->
<link rel="import" href="~/elements/elements.html">
@RenderSection("subelements", required: false)
<!-- For shared styles, shared-styles.html import in elements.html -->
<style is="custom-style" include="shared-styles"></style>
<link rel="stylesheet" href="~/css/main.css" />
<environment names="Development">
<script src="~/lib/webcomponentsjs/webcomponents-lite.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<script src="~/lib/webcomponentsjs/webcomponents-lite.js" asp-append-version="true"></script>
</environment>
</head>
<body unresolved>
@RenderBody()
@*<environment names="Development">
<script src="~/js/app.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<script src="~/js/app.min.js" asp-append-version="true"></script>
</environment>*@
@RenderSection("scripts", required: false)
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="Polymer CRUD">
<title>@ViewData["Title"] - Polymer CRUD</title>
<!-- Place favicon.ico in the `app/` directory -->
<!-- Chrome for Android theme color -->
<meta name="theme-color" content="#2E3AA1">
<!-- Web Application Manifest -->
<link rel="manifest" href="manifest.json">
<!-- Tile color for Win8 -->
<meta name="msapplication-TileColor" content="#3372DF">
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="PSK">
<link rel="icon" sizes="192x192" href="images/touch/chrome-touch-icon-192x192.png">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Polymer CRUD">
<link rel="apple-touch-icon" href="images/touch/apple-touch-icon.png">
<!-- Tile icon for Win8 (144x144) -->
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<!-- Because this project uses vulcanize this should be your only html import
in this file. All other imports should go in elements.html -->
<link rel="import" href="~/elements/elements.html">
@RenderSection("subelements", required: false)
<!-- For shared styles, shared-styles.html import in elements.html -->
<style is="custom-style" include="shared-styles"></style>
<environment names="Development">
<link rel="stylesheet" href="~/css/main.css" />
<script src="~/lib/webcomponentsjs/webcomponents-lite.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="~/css/main.min.css" asp-append-version="true" />
<script src="~/lib/webcomponentsjs/webcomponents-lite.js" asp-append-version="true"></script>
</environment>
</head>
<body unresolved>
@RenderBody()
@*<environment names="Development">
<script src="~/js/app.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<script src="~/js/app.min.js" asp-append-version="true"></script>
</environment>*@
@RenderSection("scripts", required: false)
</body>
</html>
|
mit
|
C#
|
7b65e257bcc6ce34deab3d189a7b92319cd43a08
|
Add API.
|
mika-f/Orion,OrionDevelop/Orion
|
Source/Orion.Service.Mastodon/Clients/NotificationsClient.cs
|
Source/Orion.Service.Mastodon/Clients/NotificationsClient.cs
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Orion.Service.Mastodon.Helpers;
using Orion.Service.Mastodon.Models;
using Orion.Service.Shared;
using Orion.Service.Shared.Extensions;
namespace Orion.Service.Mastodon.Clients
{
public class NotificationsClient : ApiClient<MastodonClient>
{
internal NotificationsClient(MastodonClient mastodonClent) : base(mastodonClent) { }
public Task<List<Notification>> ShowAsync(int? maxId = null, int? sinceId = null)
{
var parameters = new List<KeyValuePair<string, object>>();
PaginateHelper.ApplyParams(parameters, maxId, sinceId);
return AppClient.GetAsync<List<Notification>>("api/v1/notifications", parameters);
}
public Task<Notification> SingleAsync(int id)
{
return AppClient.GetAsync<Notification>($"api/v1/notifications/{id}");
}
public async Task ClearAsync()
{
await AppClient.PostRawAsync("api/v1/notifications/clear").Stay();
}
public async Task DismissAsync(int id)
{
await AppClient.PostRawAsync($"api/v1/notifications/dismiss/{id}").Stay();
}
}
}
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Orion.Service.Mastodon.Helpers;
using Orion.Service.Mastodon.Models;
using Orion.Service.Shared;
namespace Orion.Service.Mastodon.Clients
{
public class NotificationsClient : ApiClient<MastodonClient>
{
internal NotificationsClient(MastodonClient mastodonClent) : base(mastodonClent) { }
public Task<List<Notification>> ShowAsync(int? maxId = null, int? sinceId = null)
{
var parameters = new List<KeyValuePair<string, object>>();
PaginateHelper.ApplyParams(parameters, maxId, sinceId);
return AppClient.GetAsync<List<Notification>>("api/v1/notifications", parameters);
}
public Task<Notification> SingleAsync(int id)
{
return AppClient.GetAsync<Notification>($"api/v1/notifications/{id}");
}
public async Task ClearAsync()
{
await AppClient.PostAsync<string>("api/v1/notifications/clear").ConfigureAwait(false);
}
}
}
|
mit
|
C#
|
28e342f2ecbf02b2a90f4f5286c58c56a28147f0
|
clean up code
|
IvanZheng/IFramework,IvanZheng/IFramework,IvanZheng/IFramework
|
Src/iFramework.Plugins/IFramework.Log4Net/Log4NetProvider.cs
|
Src/iFramework.Plugins/IFramework.Log4Net/Log4NetProvider.cs
|
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Reflection;
using IFramework.Config;
using log4net;
using log4net.Config;
using log4net.Repository;
using Microsoft.Extensions.Logging;
namespace IFramework.Log4Net
{
public class Log4NetProvider : ILoggerProvider
{
private readonly ILoggerRepository _loggerRepository;
private readonly ConcurrentDictionary<string, Log4NetLogger> _loggers = new ConcurrentDictionary<string, Log4NetLogger>();
public Log4NetProvider(string log4NetConfigFile)
{
var configFile = GetLog4NetConfigFile(log4NetConfigFile);
var repositoryName = Configuration.GetAppSetting("app") ?? Assembly.GetCallingAssembly()
.FullName;
_loggerRepository = LogManager.GetAllRepositories()
.FirstOrDefault(r => r.Name == repositoryName) ?? LogManager.CreateRepository(repositoryName);
XmlConfigurator.ConfigureAndWatch(_loggerRepository, configFile);
}
public ILogger CreateLogger(string categoryName)
{
return _loggers.GetOrAdd(categoryName, CreateLoggerImplementation);
}
public void Dispose()
{
_loggers.Clear();
}
private static FileInfo GetLog4NetConfigFile(string filename)
{
filename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
filename);
return new FileInfo(filename);
}
private Log4NetLogger CreateLoggerImplementation(string name)
{
return new Log4NetLogger(_loggerRepository.Name, name);
}
}
}
|
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Reflection;
using System.Text;
using System.Xml;
using IFramework.Config;
using log4net;
using log4net.Config;
using log4net.Repository;
using Microsoft.Extensions.Logging;
namespace IFramework.Log4Net
{
public class Log4NetProvider : ILoggerProvider
{
private readonly ConcurrentDictionary<string, Log4NetLogger> _loggers = new ConcurrentDictionary<string, Log4NetLogger>();
private readonly ILoggerRepository _loggerRepository;
public Log4NetProvider(string log4NetConfigFile)
{
var configFile = GetLog4NetConfigFile(log4NetConfigFile);
_loggerRepository = LogManager.CreateRepository(Configuration.GetAppSetting("app") ?? Assembly.GetCallingAssembly().FullName,
typeof(log4net.Repository.Hierarchy.Hierarchy));
XmlConfigurator.ConfigureAndWatch(_loggerRepository, configFile);
}
public ILogger CreateLogger(string categoryName)
{
return _loggers.GetOrAdd(categoryName, CreateLoggerImplementation);
}
public void Dispose()
{
_loggers.Clear();
}
private static FileInfo GetLog4NetConfigFile(string filename)
{
filename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
filename);
return new FileInfo(filename);
}
private Log4NetLogger CreateLoggerImplementation(string name)
{
return new Log4NetLogger(_loggerRepository.Name, name);
}
}
}
|
mit
|
C#
|
ae75a4a9c4560a58e010eef012d4594a7ae1bed1
|
Fix warning
|
tom-englert/TomsToolbox
|
src/TomsToolbox.Composition.MicrosoftExtensions/IsExternalInit.cs
|
src/TomsToolbox.Composition.MicrosoftExtensions/IsExternalInit.cs
|
// ReSharper disable All
namespace System.Runtime.CompilerServices
{
internal class IsExternalInit { }
}
|
namespace System.Runtime.CompilerServices
{
public class IsExternalInit { }
}
|
mit
|
C#
|
c61002c796406c3d8e86193bc6c41a3f3da98eaa
|
Select first item by default in "Select Item" window
|
danielchalmers/DesktopWidgets
|
DesktopWidgets/WindowViewModels/SelectItemViewModel.cs
|
DesktopWidgets/WindowViewModels/SelectItemViewModel.cs
|
using System.Collections.Generic;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight;
namespace DesktopWidgets.WindowViewModels
{
public class SelectItemViewModel : ViewModelBase
{
private object _selectedItem;
public SelectItemViewModel(IEnumerable<object> items)
{
ItemsList = new ObservableCollection<object>(items);
if (ItemsList.Count > 0)
{
SelectedItem = ItemsList[0];
}
}
public ObservableCollection<object> ItemsList { get; set; }
public object SelectedItem
{
get { return _selectedItem; }
set
{
if (_selectedItem != value)
{
_selectedItem = value;
RaisePropertyChanged();
}
}
}
}
}
|
using System.Collections.Generic;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight;
namespace DesktopWidgets.WindowViewModels
{
public class SelectItemViewModel : ViewModelBase
{
private object _selectedItem;
public SelectItemViewModel(IEnumerable<object> items)
{
ItemsList = new ObservableCollection<object>(items);
}
public ObservableCollection<object> ItemsList { get; set; }
public object SelectedItem
{
get { return _selectedItem; }
set
{
if (_selectedItem != value)
{
_selectedItem = value;
RaisePropertyChanged();
}
}
}
}
}
|
apache-2.0
|
C#
|
4336be6ab6c1cc43227ca4fb1efe189e25a265c2
|
Update sys version to v2.0-a3 #269
|
FanrayMedia/Fanray,FanrayMedia/Fanray,FanrayMedia/Fanray
|
src/Fan/Helpers/SysVersion.cs
|
src/Fan/Helpers/SysVersion.cs
|
namespace Fan.Helpers
{
public class SysVersion
{
public static string CurrentVersion = "v2.0-a3";
}
}
|
namespace Fan.Helpers
{
public class SysVersion
{
public static string CurrentVersion = "v2.0-a2";
}
}
|
apache-2.0
|
C#
|
137ab5b27edd3f21af016c979d6baa3659b29cc3
|
Undo time acceleration
|
ppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework
|
osu.Framework/Platform/HeadlessGameHost.cs
|
osu.Framework/Platform/HeadlessGameHost.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Input.Handlers;
using osu.Framework.Logging;
using osu.Framework.Timing;
namespace osu.Framework.Platform
{
/// <summary>
/// A GameHost which doesn't require a graphical or sound device.
/// </summary>
public class HeadlessGameHost : DesktopGameHost
{
public const double CLOCK_RATE = 1000.0 / 30;
private readonly IFrameBasedClock customClock;
protected override IFrameBasedClock SceneGraphClock => customClock ?? base.SceneGraphClock;
public override void OpenFileExternally(string filename) => Logger.Log($"Application has requested file \"{filename}\" to be opened.");
public override void OpenUrlExternally(string url) => Logger.Log($"Application has requested URL \"{url}\" to be opened.");
protected override Storage GetStorage(string baseName) => new DesktopStorage($"headless-{baseName}", this);
public HeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true)
: base(gameName, bindIPC)
{
if (!realtime) customClock = new FramedClock(new FastClock(CLOCK_RATE));
UpdateThread.Scheduler.Update();
}
protected override void UpdateInitialize()
{
}
protected override void DrawInitialize()
{
}
protected override void DrawFrame()
{
//we can't draw.
}
protected override void UpdateFrame()
{
customClock?.ProcessFrame();
base.UpdateFrame();
}
protected override IEnumerable<InputHandler> CreateAvailableInputHandlers() => new InputHandler[] { };
private class FastClock : IClock
{
private readonly double increment;
private double time;
/// <summary>
/// A clock which increments each time <see cref="CurrentTime"/> is requested.
/// Run fast. Run consistent.
/// </summary>
/// <param name="increment">Milliseconds we should increment the clock by each time the time is requested.</param>
public FastClock(double increment)
{
this.increment = increment;
}
public double CurrentTime => time += increment;
public double Rate => CLOCK_RATE;
public bool IsRunning => true;
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Input.Handlers;
using osu.Framework.Logging;
using osu.Framework.Timing;
namespace osu.Framework.Platform
{
/// <summary>
/// A GameHost which doesn't require a graphical or sound device.
/// </summary>
public class HeadlessGameHost : DesktopGameHost
{
public const double CLOCK_RATE = 1000.0;
private readonly IFrameBasedClock customClock;
protected override IFrameBasedClock SceneGraphClock => customClock ?? base.SceneGraphClock;
public override void OpenFileExternally(string filename) => Logger.Log($"Application has requested file \"{filename}\" to be opened.");
public override void OpenUrlExternally(string url) => Logger.Log($"Application has requested URL \"{url}\" to be opened.");
protected override Storage GetStorage(string baseName) => new DesktopStorage($"headless-{baseName}", this);
public HeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true)
: base(gameName, bindIPC)
{
if (!realtime) customClock = new FramedClock(new FastClock(CLOCK_RATE));
UpdateThread.Scheduler.Update();
}
protected override void UpdateInitialize()
{
}
protected override void DrawInitialize()
{
}
protected override void DrawFrame()
{
//we can't draw.
}
protected override void UpdateFrame()
{
customClock?.ProcessFrame();
base.UpdateFrame();
}
protected override IEnumerable<InputHandler> CreateAvailableInputHandlers() => new InputHandler[] { };
private class FastClock : IClock
{
private readonly double increment;
private double time;
/// <summary>
/// A clock which increments each time <see cref="CurrentTime"/> is requested.
/// Run fast. Run consistent.
/// </summary>
/// <param name="increment">Milliseconds we should increment the clock by each time the time is requested.</param>
public FastClock(double increment)
{
this.increment = increment;
}
public double CurrentTime => time += increment;
public double Rate => CLOCK_RATE;
public bool IsRunning => true;
}
}
}
|
mit
|
C#
|
cd255bd67bab75616aa3e86108e43455775c46f8
|
Rename Reflection extensions class.
|
WimObiwan/Pash,ForNeVeR/Pash,sillvan/Pash,ForNeVeR/Pash,WimObiwan/Pash,Jaykul/Pash,mrward/Pash,sburnicki/Pash,sburnicki/Pash,sillvan/Pash,mrward/Pash,Jaykul/Pash,JayBazuzi/Pash,ForNeVeR/Pash,Jaykul/Pash,sburnicki/Pash,JayBazuzi/Pash,mrward/Pash,WimObiwan/Pash,sillvan/Pash,mrward/Pash,Jaykul/Pash,sillvan/Pash,JayBazuzi/Pash,sburnicki/Pash,ForNeVeR/Pash,JayBazuzi/Pash,WimObiwan/Pash
|
Source/Pash.System.Management/Extensions/Reflection.cs
|
Source/Pash.System.Management/Extensions/Reflection.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Extensions.Reflection
{
static class _
{
public static T GetValue<T>(this FieldInfo fieldInfo, object obj = null)
{
return (T)fieldInfo.GetValue(obj);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Extensions.Reflection
{
static class Extensions
{
public static T GetValue<T>(this FieldInfo fieldInfo, object obj = null) { return (T)fieldInfo.GetValue(obj); }
}
}
|
bsd-3-clause
|
C#
|
e36b15eb8a004f30788603de7fa537305f7dff53
|
refresh after cookie set
|
YAFNET/YAFNET,YAFNET/YAFNET,YAFNET/YAFNET,YAFNET/YAFNET
|
yafsrc/YetAnotherForum.NET/Controls/CookieConsent.ascx.cs
|
yafsrc/YetAnotherForum.NET/Controls/CookieConsent.ascx.cs
|
/* Yet Another Forum.NET
* Copyright (C) 2003-2005 Bjørnar Henden
* Copyright (C) 2006-2013 Jaben Cargman
* Copyright (C) 2014-2020 Ingo Herbote
* https://www.yetanotherforum.net/
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* https://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace YAF.Controls
{
#region Using
using System;
using System.Web;
using YAF.Configuration;
using YAF.Core.BaseControls;
using YAF.Types;
using YAF.Types.Constants;
using YAF.Types.Interfaces;
using YAF.Utils;
#endregion
/// <summary>
/// The forum control for showing the cookie warning!
/// </summary>
public partial class CookieConsent : BaseUserControl
{
/// <summary>
/// Handles the Load event of the Page control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
{
this.Label1.Param0 = this.Get<BoardSettings>().Name;
this.MoreDetails.NavigateUrl = BuildLink.GetLink(ForumPages.Cookies);
}
/// <summary>
/// Accept Cookie Consent
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The e.
/// </param>
protected void AcceptClick(object sender, EventArgs e)
{
this.PageContext.Get<HttpResponseBase>().SetCookie(
new HttpCookie("YAF-AcceptCookies", "true") { Expires = DateTime.UtcNow.AddYears(1) });
this.Response.Redirect(this.Request.RawUrl);
this.DataBind();
}
}
}
|
/* Yet Another Forum.NET
* Copyright (C) 2003-2005 Bjørnar Henden
* Copyright (C) 2006-2013 Jaben Cargman
* Copyright (C) 2014-2020 Ingo Herbote
* https://www.yetanotherforum.net/
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* https://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace YAF.Controls
{
#region Using
using System;
using System.Web;
using YAF.Configuration;
using YAF.Core.BaseControls;
using YAF.Types;
using YAF.Types.Constants;
using YAF.Types.Interfaces;
using YAF.Utils;
#endregion
/// <summary>
/// The forum control for showing the cookie warning!
/// </summary>
public partial class CookieConsent : BaseUserControl
{
/// <summary>
/// Handles the Load event of the Page control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
{
this.Label1.Param0 = this.Get<BoardSettings>().Name;
this.MoreDetails.NavigateUrl = BuildLink.GetLink(ForumPages.Cookies);
}
/// <summary>
/// Accept Cookie Consent
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The e.
/// </param>
protected void AcceptClick(object sender, EventArgs e)
{
this.PageContext.Get<HttpResponseBase>().SetCookie(
new HttpCookie("YAF-AcceptCookies", "true") { Expires = DateTime.UtcNow.AddYears(1) });
//TODO:Reload Page
this.DataBind();
}
}
}
|
apache-2.0
|
C#
|
3e80c5f415e2ea61265bd34b2d0aa77b84fb77fc
|
comment about not needing to dispose of anything
|
iiwaasnet/aspnet-identity-mongo,Dedice/aspnet-identity-mongo,s4lvo/aspnet-identity-mongo,abbasmhd/aspnet-identity-mongo,winterdouglas/aspnet-identity-mongo,Malkiat-Singh/aspnet-identity-mongo,g0t4/aspnet-identity-mongo,iiwaasnet/aspnet-identity-mongo,FelschR/aspnetcore-identity-documentdb,s4lvo/aspnet-identity-mongo,FelschR/AspNetCore.Identity.DocumentDB,Malkiat-Singh/aspnet-identity-mongo,Dedice/aspnet-identity-mongo,abbasmhd/aspnet-identity-mongo
|
src/AspNet.Identity.MongoDB/UserStore.cs
|
src/AspNet.Identity.MongoDB/UserStore.cs
|
namespace AspNet.Identity.MongoDB
{
using System.Threading.Tasks;
using global::MongoDB.Bson;
using global::MongoDB.Driver.Builders;
using Microsoft.AspNet.Identity;
public class UserStore<TUser> : IUserStore<TUser>
where TUser : IdentityUser
{
private readonly IdentityContext _Context;
public UserStore(IdentityContext context)
{
_Context = context;
}
public void Dispose()
{
// no need to dispose of anything, mongodb handles connection pooling automatically
}
public Task CreateAsync(TUser user)
{
return Task.Run(() => _Context.Users.Insert(user));
}
public Task UpdateAsync(TUser user)
{
return Task.Run(() => _Context.Users.Save(user));
}
public Task DeleteAsync(TUser user)
{
var remove = Query<TUser>.EQ(u => u.Id, user.Id);
return Task.Run(() => _Context.Users.Remove(remove));
}
public Task<TUser> FindByIdAsync(string userId)
{
return Task.Run(() => _Context.Users.FindOneByIdAs<TUser>(ObjectId.Parse(userId)));
}
public Task<TUser> FindByNameAsync(string userName)
{
// todo exception on duplicates? or better to enforce unique index to ensure this
var byName = Query<TUser>.EQ(u => u.UserName, userName);
return Task.Run(() => _Context.Users.FindOneAs<TUser>(byName));
}
}
}
|
namespace AspNet.Identity.MongoDB
{
using System.Threading.Tasks;
using global::MongoDB.Bson;
using global::MongoDB.Driver.Builders;
using Microsoft.AspNet.Identity;
public class UserStore<TUser> : IUserStore<TUser>
where TUser : IdentityUser
{
private readonly IdentityContext _Context;
public UserStore(IdentityContext context)
{
_Context = context;
}
public void Dispose()
{
}
public Task CreateAsync(TUser user)
{
return Task.Run(() => _Context.Users.Insert(user));
}
public Task UpdateAsync(TUser user)
{
return Task.Run(() => _Context.Users.Save(user));
}
public Task DeleteAsync(TUser user)
{
var remove = Query<TUser>.EQ(u => u.Id, user.Id);
return Task.Run(() => _Context.Users.Remove(remove));
}
public Task<TUser> FindByIdAsync(string userId)
{
return Task.Run(() => _Context.Users.FindOneByIdAs<TUser>(ObjectId.Parse(userId)));
}
public Task<TUser> FindByNameAsync(string userName)
{
// todo exception on duplicates? or better to enforce unique index to ensure this
var byName = Query<TUser>.EQ(u => u.UserName, userName);
return Task.Run(() => _Context.Users.FindOneAs<TUser>(byName));
}
}
}
|
mit
|
C#
|
91fe6a24a875c78a8949e351b4ab1eb9f7a09242
|
Fix incorrect namespace
|
nikhilk/scriptsharp,x335/scriptsharp,x335/scriptsharp,x335/scriptsharp,nikhilk/scriptsharp,nikhilk/scriptsharp
|
src/Core/CoreLib/Threading/TaskStatus.cs
|
src/Core/CoreLib/Threading/TaskStatus.cs
|
// TaskStatus.cs
// Script#/Libraries/CoreLib
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
namespace System.Threading {
[Imported]
[IgnoreNamespace]
[NamedValues]
public enum TaskStatus {
Pending,
Done,
Failed
}
}
|
// TaskStatus.cs
// Script#/Libraries/CoreLib
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
namespace System {
[Imported]
[IgnoreNamespace]
[NamedValues]
public enum TaskStatus {
Pending,
Done,
Failed
}
}
|
apache-2.0
|
C#
|
9fc48c3d0d741bd2dde8bf26f04da0ec632acf3d
|
Add Lerp() to DoubleUtil
|
KodamaSakuno/Sakuno.Base
|
src/Sakuno.Base/DoubleUtil.cs
|
src/Sakuno.Base/DoubleUtil.cs
|
using System;
using System.Runtime.CompilerServices;
namespace Sakuno
{
public static class DoubleUtil
{
const double _epsilon = 2.2204460492503131E-15;
public static readonly object Zero = 0.0;
public static readonly object One = 1.0;
public static readonly object NaN = double.NaN;
public static object GetBoxed(double value)
{
if (IsCloseToZero(value))
return Zero;
if (IsCloseToOne(value))
return One;
if (value.IsNaN())
return NaN;
return value;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCloseToZero(double value) => Math.Abs(value) < _epsilon;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCloseToOne(double value) => Math.Abs(value - 1.0) < _epsilon;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double Lerp(double from, double to, double frac) => from + (to - from) * frac;
}
}
|
using System;
using System.Runtime.CompilerServices;
namespace Sakuno
{
public static class DoubleUtil
{
const double _epsilon = 2.2204460492503131E-15;
public static readonly object Zero = 0.0;
public static readonly object One = 1.0;
public static readonly object NaN = double.NaN;
public static object GetBoxed(double value)
{
if (IsCloseToZero(value))
return Zero;
if (IsCloseToOne(value))
return One;
if (value.IsNaN())
return NaN;
return value;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCloseToZero(double value) => Math.Abs(value) < _epsilon;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCloseToOne(double value) => Math.Abs(value - 1.0) < _epsilon;
}
}
|
mit
|
C#
|
b6c46028b654177f090a3495bac82af3c96353fa
|
Clean up using statements
|
cjbhaines/Log4Net.Async,squirmy/Log4Net.Async
|
src/Log4Net.Async/LoggingEventContext.cs
|
src/Log4Net.Async/LoggingEventContext.cs
|
namespace Log4Net.Async
{
using log4net.Core;
internal class LoggingEventContext
{
public LoggingEventContext(LoggingEvent loggingEvent, object httpContext)
{
LoggingEvent = loggingEvent;
HttpContext = httpContext;
}
public LoggingEvent LoggingEvent { get; set; }
public object HttpContext { get; set; }
}
}
|
namespace Log4Net.Async
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Log4Net;
using log4net.Core;
internal class LoggingEventContext
{
public LoggingEventContext(LoggingEvent loggingEvent, object httpContext)
{
LoggingEvent = loggingEvent;
HttpContext = httpContext;
}
public LoggingEvent LoggingEvent { get; set; }
public object HttpContext { get; set; }
}
}
|
mit
|
C#
|
6b6e7296bd39261cbc02b590d14bec9602e65d5a
|
Update to Rx 2.2.2.
|
PombeirP/RxSchedulers.Switch
|
solution/src/app/GlobalAssemblyInfo.cs
|
solution/src/app/GlobalAssemblyInfo.cs
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GlobalAssemblyInfo.cs" company="Pedro Pombeiro">
// © 2012 Pedro Pombeiro. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
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: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Developer in the Flow")]
[assembly: AssemblyProduct("RxSchedulers.Switch")]
[assembly: AssemblyCopyright("Copyright © Pedro Pombeiro 2012-2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2.2.0")]
[assembly: AssemblyFileVersion("2.2.2.0")]
[assembly: AssemblyInformationalVersion("2.2.2")]
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GlobalAssemblyInfo.cs" company="Pedro Pombeiro">
// © 2012 Pedro Pombeiro. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
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: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Pedro Pombeiro")]
[assembly: AssemblyProduct("RxSchedulers.Switch")]
[assembly: AssemblyCopyright("Copyright © Pedro Pombeiro 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
|
mit
|
C#
|
255cbdd23770e10ababe2c804707309da5f56807
|
fix missing namespace
|
isse-augsburg/ssharp,isse-augsburg/ssharp,isse-augsburg/ssharp,isse-augsburg/ssharp,maul-esel/ssharp,maul-esel/ssharp,isse-augsburg/ssharp,maul-esel/ssharp,maul-esel/ssharp
|
Models/SelfOrganizingPillProduction/Analysis/ModelCheckingTests.cs
|
Models/SelfOrganizingPillProduction/Analysis/ModelCheckingTests.cs
|
using NUnit.Framework;
using SafetySharp.Analysis;
using SafetySharp.Modeling;
using SafetySharp.CaseStudies.SelfOrganizingPillProduction.Modeling;
using static SafetySharp.Analysis.Operators;
namespace SafetySharp.CaseStudies.SelfOrganizingPillProduction.Analysis
{
public class ModelCheckingTests
{
[Test]
public void Dcca()
{
//var model = Model.NoRedundancyCircularModel();
var model = new ModelSetupParser().Parse("Analysis/medium_setup.model");
var modelChecker = new SafetyAnalysis();
modelChecker.Configuration.CpuCount = 1;
modelChecker.Configuration.StateCapacity = 20000;
var result = modelChecker.ComputeMinimalCriticalSets(model, model.ObserverController.Unsatisfiable);
System.Console.WriteLine(result);
}
[Test]
public void EnumerateAllStates()
{
var model = new ModelSetupParser().Parse("Analysis/medium_setup.model");
model.Faults.SuppressActivations();
var checker = new SSharpChecker { Configuration = { StateCapacity = 1 << 18 } };
var result = checker.CheckInvariant(model, true);
System.Console.WriteLine(result.StateVectorLayout);
}
[Test]
public void ProductionCompletesIfNoFaultsOccur()
{
var model = Model.NoRedundancyCircularModel();
var recipe = new Recipe(new[]
{
new Ingredient(IngredientType.BlueParticulate, 1),
new Ingredient(IngredientType.RedParticulate, 3),
new Ingredient(IngredientType.BlueParticulate, 1)
}, 6);
model.ScheduleProduction(recipe);
model.Faults.SuppressActivations();
var invariant = ((Formula) !recipe.ProcessingComplete).Implies(F(recipe.ProcessingComplete));
var result = ModelChecker.Check(model, invariant);
Assert.That(result.FormulaHolds, "Recipe production never finishes");
}
}
}
|
using NUnit.Framework;
using SafetySharp.Analysis;
using SafetySharp.Modeling;
using SafetySharp.CaseStudies.SelfOrganizingPillProduction.Modeling;
using static SafetySharp.Analysis.Operators;
namespace SafetySharp.CaseStudies.SelfOrganizingPillProduction.Analysis
{
public class ModelCheckingTests
{
[Test]
public void Dcca()
{
//var model = Model.NoRedundancyCircularModel();
var model = new ModelSetupParser().Parse("Analysis/medium_setup.model");
var modelChecker = new SafetyAnalysis();
modelChecker.Configuration.CpuCount = 1;
modelChecker.Configuration.StateCapacity = 20000;
var result = modelChecker.ComputeMinimalCriticalSets(model, model.ObserverController.Unsatisfiable);
System.Console.WriteLine(result);
}
[Test]
public void EnumerateAllStates()
{
var model = new ModelSetupParser().Parse("Analysis/medium_setup.model");
model.Faults.SuppressActivations();
var checker = new SSharpChecker { Configuration = { StateCapacity = 1 << 18 } };
var result = checker.CheckInvariant(model, true);
Console.WriteLine(result.StateVectorLayout);
}
[Test]
public void ProductionCompletesIfNoFaultsOccur()
{
var model = Model.NoRedundancyCircularModel();
var recipe = new Recipe(new[]
{
new Ingredient(IngredientType.BlueParticulate, 1),
new Ingredient(IngredientType.RedParticulate, 3),
new Ingredient(IngredientType.BlueParticulate, 1)
}, 6);
model.ScheduleProduction(recipe);
model.Faults.SuppressActivations();
var invariant = ((Formula) !recipe.ProcessingComplete).Implies(F(recipe.ProcessingComplete));
var result = ModelChecker.Check(model, invariant);
Assert.That(result.FormulaHolds, "Recipe production never finishes");
}
}
}
|
mit
|
C#
|
f7e5632d773e22695ca5d366503630342d967827
|
Update input data
|
pugachAG/univ,pugachAG/univ,pugachAG/univ
|
NumericalMethodsMathematicalPhysics/NMMP/Common/Lab3/InputData3.cs
|
NumericalMethodsMathematicalPhysics/NMMP/Common/Lab3/InputData3.cs
|
using Common.RealAnalysis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common.Lab3
{
public static class InputData3
{
public static double sigma = 0.5;
public static int K = 50;
public static double tau = 0.01;
public static double l = 0.02;
public static double FinishTime = 10;
public static double TemperatureEnd = 0;
public static FuncRealFunction u0 = new FuncRealFunction(
x => 0
//x => - 10 * x * Math.Sin(Math.PI * x)
);
public static FuncRealFunction f = new FuncRealFunction(
x => 3500
);
public static double lambda = 220;
public static double c = 0.89 * 1000;
public static double rho = 2700;
public static double gamma = 300;
public static double AlphaSquare
{
get
{
return lambda / (c * rho);
}
}
}
}
|
using Common.RealAnalysis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common.Lab3
{
public static class InputData3
{
public static double sigma = 0.5;
public static int K = 100;
public static double tau = 0.01;
public static double l = 0.02;
public static double FinishTime = 10;
public static double TemperatureEnd = 0;
public static FuncRealFunction u0 = new FuncRealFunction(
x => 0
//x => - 10 * x * Math.Sin(Math.PI * x)
);
public static FuncRealFunction f = new FuncRealFunction(
x => 3500
);
public static double lambda = 45.5;
public static double c = 0.46 * 1000;
public static double rho = 7900;
public static double gamma = 140;
public static double AlphaSquare
{
get
{
return lambda / (c * rho);
}
}
}
}
|
mit
|
C#
|
c6e857521f1d255f46a057601ffa2c4d08e65887
|
Rename a variable
|
willb611/SlimeSimulation
|
SlimeSimulation/View/WindowComponent/FlowResultNodeHighlightKey.cs
|
SlimeSimulation/View/WindowComponent/FlowResultNodeHighlightKey.cs
|
using Gtk;
using SlimeSimulation.Controller.WindowComponentController;
namespace SlimeSimulation.View.WindowComponent
{
public class FlowResultNodeHighlightKey : VBox
{
public FlowResultNodeHighlightKey() : base(true, 10)
{
Add(new Label("Node colour key"));
var sourcePart = new HBox(true, 10);
sourcePart.Add(new Label("Source"));
sourcePart.Add(new ColorArea(FlowResultNodeViewController.SourceColour));
var sinkPart = new HBox(true, 10);
sinkPart.Add(new Label("Sink"));
sinkPart.Add(new ColorArea(FlowResultNodeViewController.SinkColour));
var notSinkOrSourceNodePart = new HBox(true, 10);
notSinkOrSourceNodePart.Add(new Label("Normal node"));
notSinkOrSourceNodePart.Add(new ColorArea(FlowResultNodeViewController.NormalNodeColour));
Add(sourcePart);
Add(sinkPart);
Add(notSinkOrSourceNodePart);
}
}
}
|
using Gtk;
using SlimeSimulation.Controller.WindowComponentController;
namespace SlimeSimulation.View.WindowComponent
{
public class FlowResultNodeHighlightKey : VBox
{
public FlowResultNodeHighlightKey() : base(true, 10)
{
Add(new Label("Node colour key"));
var sourcePart = new HBox(true, 10);
sourcePart.Add(new Label("Source"));
sourcePart.Add(new ColorArea(FlowResultNodeViewController.SourceColour));
var sinkPart = new HBox(true, 10);
sinkPart.Add(new Label("Sink"));
sinkPart.Add(new ColorArea(FlowResultNodeViewController.SinkColour));
var normalPart = new HBox(true, 10);
normalPart.Add(new Label("Normal node"));
normalPart.Add(new ColorArea(FlowResultNodeViewController.NormalNodeColour));
Add(sourcePart);
Add(sinkPart);
Add(normalPart);
}
}
}
|
apache-2.0
|
C#
|
8e39f023d9bf3fcb33c70351e6e274493e033a37
|
Fix for code coverage.
|
dlemstra/Magick.NET,dlemstra/Magick.NET
|
Tests/Magick.NET.Tests/Web/Configuration/MagickWebSettingsTests.cs
|
Tests/Magick.NET.Tests/Web/Configuration/MagickWebSettingsTests.cs
|
//=================================================================================================
// Copyright 2013-2017 Dirk Lemstra <https://magick.codeplex.com/>
//
// Licensed under the ImageMagick License (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.imagemagick.org/script/license.php
//
// 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 ImageMagick.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Configuration;
using System.Linq;
namespace Magick.NET.Tests
{
[TestClass]
public class MagickWebSettingsTests
{
[TestMethod]
public void Test_Properties()
{
#if !Q8 || WIN64 || ANYCPU
Assert.Inconclusive("Only testing this with the Q8-x86 build.");
#endif
MagickWebSettings settings = null;
try
{
settings = MagickWebSettings.Instance;
}
catch (ConfigurationErrorsException)
{
// Here for code coverage.
ExeConfigurationFileMap map = new ExeConfigurationFileMap();
map.ExeConfigFilename = @"Magick.NET.Tests.dll.config";
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
settings = config.GetSection("magick.net.web") as MagickWebSettings;
}
Assert.IsNotNull(settings);
Assert.IsTrue(settings.CacheDirectory.EndsWith(@"\cache\"));
Assert.IsFalse(settings.CanCreateDirectories);
Assert.AreEqual(new TimeSpan(1, 0, 0, 0), settings.ClientCache.CacheControlMaxAge);
Assert.AreEqual(CacheControlMode.UseMaxAge, settings.ClientCache.CacheControlMode);
Assert.IsTrue(settings.EnableGzip);
Assert.IsTrue(settings.OptimizeImages);
Assert.IsNull(settings.ResourceLimits.Height);
Assert.IsNull(settings.ResourceLimits.Width);
Assert.IsFalse(settings.ShowVersion);
Assert.AreEqual(@"c:\temp\", settings.TempDirectory);
Assert.IsFalse(settings.UseOpenCL);
var urlResolverSettings = settings.UrlResolvers.Cast<UrlResolverSettings>();
Assert.AreEqual(1, urlResolverSettings.Count());
}
}
}
|
//=================================================================================================
// Copyright 2013-2017 Dirk Lemstra <https://magick.codeplex.com/>
//
// Licensed under the ImageMagick License (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.imagemagick.org/script/license.php
//
// 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 ImageMagick.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;
namespace Magick.NET.Tests
{
[TestClass]
public class MagickWebSettingsTests
{
[TestMethod]
public void Test_Properties()
{
#if !Q8 || WIN64 || ANYCPU
Assert.Inconclusive("Only testing this with the Q8-x86 build.");
#endif
MagickWebSettings settings = MagickWebSettings.Instance;
Assert.IsTrue(settings.CacheDirectory.EndsWith(@"\cache\"));
Assert.IsFalse(settings.CanCreateDirectories);
Assert.AreEqual(new TimeSpan(1, 0, 0, 0), settings.ClientCache.CacheControlMaxAge);
Assert.AreEqual(CacheControlMode.UseMaxAge, settings.ClientCache.CacheControlMode);
Assert.IsTrue(settings.EnableGzip);
Assert.IsTrue(settings.OptimizeImages);
Assert.IsNull(settings.ResourceLimits.Height);
Assert.IsNull(settings.ResourceLimits.Width);
Assert.IsFalse(settings.ShowVersion);
Assert.AreEqual(@"c:\temp\", settings.TempDirectory);
Assert.IsFalse(settings.UseOpenCL);
var urlResolverSettings = settings.UrlResolvers.Cast<UrlResolverSettings>();
Assert.AreEqual(1, urlResolverSettings.Count());
}
}
}
|
apache-2.0
|
C#
|
668dfad76040c9b63f9f61b4f99d76d29b4e8788
|
test 45345
|
emksaz/testgit2,emksaz/testgit2,emksaz/testgit2
|
testgit23/testgit23/Views/Home/Index.cshtml
|
testgit23/testgit23/Views/Home/Index.cshtml
|
@{
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="jumbotron">
<h1>ASP.NET -david.z 1655 34234 test2-brah1 q</h1>
<h1>ASP.NET -david.z 1655 34234 test2-brah1</h1>
<h1>ASP.NET -david.z 1655 34234 test3-brah2 3re 45345</h1>
</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="jumbotron">
<h1>ASP.NET -david.z 1655 34234 test2-brah1 q</h1>
<h1>ASP.NET -david.z 1655 34234 test2-brah1</h1>
<h1>ASP.NET -david.z 1655 34234 test3-brah2 3re</h1>
</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>
|
apache-2.0
|
C#
|
ff92c97b894e7dc4e522a18d6a349f745c25c3f0
|
Add % symbol on WinRate Table Page
|
Joey-Softwire/ELO,Variares/ELOSYSTEM,Variares/ELOSYSTEM,richardadalton/EloRate,richardadalton/EloRate,Joey-Softwire/ELO
|
src/EloWeb/Views/Tables/WinRate.cshtml
|
src/EloWeb/Views/Tables/WinRate.cshtml
|
@model System.Collections.Generic.IEnumerable<EloWeb.Models.Player>
@{
ViewBag.Title = "Win Rate Leaderboard";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Win Rate Leaderboard</h2>
<h4>
@Html.ActionLink("Add Game", "Create", "Games") | @Html.ActionLink("Add Player", "Create", "Players")
</h4>
<table class="table">
<tr>
<th>
Rank
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.WinRate)
</th>
</tr>
@{ var rank = 1; }
@foreach (var item in Model) {
<tr>
<td>
@rank
</td>
<td>
@Html.ActionLink(item.Name, "Details", "Players", new { name = item.Name }, null)
</td>
<td>
@Html.DisplayFor(modelItem => item.WinRate)%
</td>
</tr>
rank++;
}
</table>
|
@model System.Collections.Generic.IEnumerable<EloWeb.Models.Player>
@{
ViewBag.Title = "Win Rate Leaderboard";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Win Rate Leaderboard</h2>
<h4>
@Html.ActionLink("Add Game", "Create", "Games") | @Html.ActionLink("Add Player", "Create", "Players")
</h4>
<table class="table">
<tr>
<th>
Rank
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.WinRate)
</th>
</tr>
@{ var rank = 1; }
@foreach (var item in Model) {
<tr>
<td>
@rank
</td>
<td>
@Html.ActionLink(item.Name, "Details", "Players", new { name = item.Name }, null)
</td>
<td>
@Html.DisplayFor(modelItem => item.WinRate)
</td>
</tr>
rank++;
}
</table>
|
unlicense
|
C#
|
129416835f2e7d78d7cbf5b120c7d9708de953f9
|
Remove stray `string.Empty` specification
|
peppy/osu,peppy/osu,peppy/osu-new,smoogipoo/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,ppy/osu,smoogipooo/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu
|
osu.Game/Models/RealmBeatmapMetadata.cs
|
osu.Game/Models/RealmBeatmapMetadata.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 Newtonsoft.Json;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using Realms;
#nullable enable
namespace osu.Game.Models
{
[ExcludeFromDynamicCompile]
[Serializable]
[MapTo("BeatmapMetadata")]
public class RealmBeatmapMetadata : RealmObject, IBeatmapMetadataInfo
{
public string Title { get; set; } = string.Empty;
[JsonProperty("title_unicode")]
public string TitleUnicode { get; set; } = string.Empty;
public string Artist { get; set; } = string.Empty;
[JsonProperty("artist_unicode")]
public string ArtistUnicode { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty; // eventually should be linked to a persisted User.
public string Source { get; set; } = string.Empty;
[JsonProperty(@"tags")]
public string Tags { get; set; } = string.Empty;
/// <summary>
/// The time in milliseconds to begin playing the track for preview purposes.
/// If -1, the track should begin playing at 40% of its length.
/// </summary>
public int PreviewTime { get; set; }
public string AudioFile { get; set; } = string.Empty;
public string BackgroundFile { get; set; } = string.Empty;
}
}
|
// 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 Newtonsoft.Json;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using Realms;
#nullable enable
namespace osu.Game.Models
{
[ExcludeFromDynamicCompile]
[Serializable]
[MapTo("BeatmapMetadata")]
public class RealmBeatmapMetadata : RealmObject, IBeatmapMetadataInfo
{
public string Title { get; set; } = string.Empty;
[JsonProperty("title_unicode")]
public string TitleUnicode { get; set; } = string.Empty;
public string Artist { get; set; } = string.Empty;
[JsonProperty("artist_unicode")]
public string ArtistUnicode { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty; // eventually should be linked to a persisted User. = string.Empty;
public string Source { get; set; } = string.Empty;
[JsonProperty(@"tags")]
public string Tags { get; set; } = string.Empty;
/// <summary>
/// The time in milliseconds to begin playing the track for preview purposes.
/// If -1, the track should begin playing at 40% of its length.
/// </summary>
public int PreviewTime { get; set; }
public string AudioFile { get; set; } = string.Empty;
public string BackgroundFile { get; set; } = string.Empty;
}
}
|
mit
|
C#
|
ec1298b8ae8e3e77aaf754eb59dc7103de4821be
|
Allow XR Plug-in Management settings to be configured post-build
|
Chaser324/unity-build-actions
|
UnityBuild-XRPluginManagement/Editor/XRPluginManagement.cs
|
UnityBuild-XRPluginManagement/Editor/XRPluginManagement.cs
|
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEngine;
using UnityEngine.XR.Management;
namespace SuperSystems.UnityBuild
{
public class XRPluginManagement : BuildAction, IPreBuildPerPlatformAction, IPostBuildPerPlatformAction
{
[Header("XR Settings")]
[Tooltip("XR plugin loaders to use for this build")] public List<XRLoader> XRPlugins = new List<XRLoader>();
[Tooltip("Whether or not to use automatic initialization of XR plugin loaders on startup")] public bool InitializeXROnStartup = true;
public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
{
XRGeneralSettings generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(platform.targetGroup);
XRManagerSettings settingsManager = generalSettings.Manager;
generalSettings.InitManagerOnStart = InitializeXROnStartup;
settingsManager.loaders = XRPlugins;
}
}
}
|
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEngine;
using UnityEngine.XR.Management;
namespace SuperSystems.UnityBuild
{
public class XRPluginManagement : BuildAction, IPreBuildAction, IPreBuildPerPlatformAction
{
[Header("XR Settings")]
[Tooltip("XR plugin loaders to use for this build")] public List<XRLoader> XRPlugins = new List<XRLoader>();
[Tooltip("Whether or not to use automatic initialization of XR plugin loaders on startup")] public bool InitializeXROnStartup = true;
public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
{
XRGeneralSettings generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(platform.targetGroup);
XRManagerSettings settingsManager = generalSettings.Manager;
List<XRLoader> previousLoaders = settingsManager.loaders;
generalSettings.InitManagerOnStart = InitializeXROnStartup;
settingsManager.loaders = XRPlugins;
}
}
}
|
mit
|
C#
|
853e904a79ab49b21e7d56a17728d58dc3183102
|
increment minor version
|
gigya/microdot
|
SolutionVersion.cs
|
SolutionVersion.cs
|
#region Copyright
// Copyright 2017 Gigya Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Gigya Inc.")]
[assembly: AssemblyCopyright("© 2018 Gigya Inc.")]
[assembly: AssemblyDescription("Microdot Framework")]
[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
[assembly: AssemblyInformationalVersion("2.2.0.0")]
// 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)]
[assembly: CLSCompliant(false)]
|
#region Copyright
// Copyright 2017 Gigya Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Gigya Inc.")]
[assembly: AssemblyCopyright("© 2018 Gigya Inc.")]
[assembly: AssemblyDescription("Microdot Framework")]
[assembly: AssemblyVersion("2.2.2.0")]
[assembly: AssemblyFileVersion("2.2.2.0")]
[assembly: AssemblyInformationalVersion("2.2.2.0")]
// 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)]
[assembly: CLSCompliant(false)]
|
apache-2.0
|
C#
|
720d2049021e19d2c11f81278318efff237d562b
|
Remove duplicated test
|
inputfalken/Sharpy
|
Tests/FileTests.cs
|
Tests/FileTests.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using NUnit.Framework;
using Sharpy.Implementation.DataObjects;
using Sharpy.Properties;
namespace Tests {
[TestFixture]
internal class FileTests {
[Test]
public void Name_Contains_No_Numbers() {
var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
Encoding.UTF8.GetString(Resources.NamesByOrigin));
var noNumber = deserializeObject.Select(name => name.Data).All(s => s.All(c => !char.IsNumber(c)));
Assert.IsTrue(noNumber);
}
[Test]
public void Name_Contains_No_Symbols() {
var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
Encoding.UTF8.GetString(Resources.NamesByOrigin));
var noSymbol = deserializeObject.Select(name => name.Data).All(s => s.All(c => !char.IsSymbol(c)));
Assert.IsTrue(noSymbol);
}
[Test]
public void User_Name_Contains_No_Numbers() {
var noNumber = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
.All(s => s.All(c => !char.IsNumber(c)));
Assert.IsTrue(noNumber);
}
[Test]
public void User_Name_Contains_No_Symbols() {
var noSymbols = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
.All(s => s.All(c => !char.IsSymbol(c)));
Assert.IsTrue(noSymbols);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using NUnit.Framework;
using Sharpy.Implementation.DataObjects;
using Sharpy.Properties;
namespace Tests {
[TestFixture]
internal class FileTests {
[Test]
public void Name_Contains_No_Numbers() {
var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
Encoding.UTF8.GetString(Resources.NamesByOrigin));
var noNumber = deserializeObject.Select(name => name.Data).All(s => s.All(c => !char.IsNumber(c)));
Assert.IsTrue(noNumber);
}
[Test]
public void Name_Contains_No_Symbol() {
var deserializeObject = JsonConvert.DeserializeObject<IEnumerable<Name>>(
Encoding.UTF8.GetString(Resources.NamesByOrigin));
var noSymbol = deserializeObject.Select(name => name.Data).All(s => s.All(c => !char.IsSymbol(c)));
Assert.IsTrue(noSymbol);
}
[Test]
public void Name_Contains_No_Symbols() {
var noSymbols = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
.All(s => s.All(c => !char.IsSymbol(c)));
Assert.IsTrue(noSymbols);
}
[Test]
public void User_Name_Contains_No_Numbers() {
var noNumber = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
.All(s => s.All(c => !char.IsNumber(c)));
Assert.IsTrue(noNumber);
}
[Test]
public void User_Name_Contains_No_Symbols() {
var noSymbols = Resources.usernames.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None)
.All(s => s.All(c => !char.IsSymbol(c)));
Assert.IsTrue(noSymbols);
}
}
}
|
mit
|
C#
|
4ab8872f03ce5aabf0fd301ded5a65f1a53053e0
|
Fix instantiation of DbInitializer
|
corstijank/blog-dotnet-jenkins,corstijank/blog-dotnet-jenkins
|
TodoApi/Startup.cs
|
TodoApi/Startup.cs
|
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using TodoApi.Data;
using TodoApi.Models;
namespace TodoApi
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddSingleton<DbInitializer,DbInitializer>();
services.AddSingleton<ITodoRepository, TodoRepository>();
services.AddDbContext<TodoContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, TodoContext dbContext, DbInitializer dbInitializer)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseMvc();
dbInitializer.Initialize(dbContext);
}
}
}
|
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using TodoApi.Data;
using TodoApi.Models;
namespace TodoApi
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
#region snippet_AddSingleton
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddSingleton<ITodoRepository, TodoRepository>();
services.AddDbContext<TodoContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
}
#endregion
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, TodoContext dbContext)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseMvc();
new DbInitializer().Initialize(dbContext);
}
}
}
|
apache-2.0
|
C#
|
c345e81902470ba373560430e47b6ab4ce3158b5
|
Simplify template
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer/Views/Stores/TestWebhook.cshtml
|
BTCPayServer/Views/Stores/TestWebhook.cshtml
|
@model EditWebhookViewModel
@using BTCPayServer.Client.Models;
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(StoreNavPages.Webhooks, "Send a test event to a webhook endpoint", Context.GetStoreData().StoreName);
}
<div class="row">
<div class="col-lg-8">
<form method="post">
<h4 class="mb-3">@ViewData["PageTitle"]</h4>
<div class="form-group">
<label for="Type" class="form-label">Event type</label>
<select
asp-items="Html.GetEnumSelectList<WebhookEventType>()"
name="Type"
id="Type"
class="form-select w-auto"
></select>
</div>
<button type="submit" class="btn btn-primary">Send test webhook</button>
</form>
</div>
</div>
|
@model EditWebhookViewModel
@using BTCPayServer.Client.Models;
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(StoreNavPages.Webhooks, "Send a test event to a webhook endpoint", Context.GetStoreData().StoreName);
}
<div class="row">
<div class="col-lg-8">
<form method="post">
<h4 class="mb-3">@ViewData["PageTitle"]</h4>
<div class="form-group">
<label for="Type">Event type</label>
<select name="Type" id="Type" class="form-control w-auto">
@foreach (var evt in new[]
{
WebhookEventType.InvoiceCreated,
WebhookEventType.InvoiceReceivedPayment,
WebhookEventType.InvoiceProcessing,
WebhookEventType.InvoiceExpired,
WebhookEventType.InvoiceSettled,
WebhookEventType.InvoiceInvalid
})
{
<option value="@evt">
@evt
</option>
}
</select>
</div>
<button type="submit" class="btn btn-primary">Send test webhook</button>
</form>
</div>
</div>
|
mit
|
C#
|
92e05fca710c16ac591d11c1a2a7c3479a5d5f55
|
Fix reversed boolean
|
pingzing/digi-transit-10
|
DigiTransit10/Controls/NavCommandBar.xaml.cs
|
DigiTransit10/Controls/NavCommandBar.xaml.cs
|
using Windows.UI.Xaml.Controls;
namespace DigiTransit10.Controls
{
public sealed partial class NavCommandBar : CommandBar
{
public NavCommandBar()
{
this.InitializeComponent();
Views.Busy.BusyChanged += BusyView_BusyChanged;
}
private void BusyView_BusyChanged(object sender, bool newIsBusy)
{
this.IsEnabled = !newIsBusy;
}
}
}
|
using Windows.UI.Xaml.Controls;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
namespace DigiTransit10.Controls
{
public sealed partial class NavCommandBar : CommandBar
{
public NavCommandBar()
{
this.InitializeComponent();
Views.Busy.BusyChanged += BusyView_BusyChanged;
}
private void BusyView_BusyChanged(object sender, bool newIsBusy)
{
this.IsEnabled = !newIsBusy;
}
}
}
|
mit
|
C#
|
a3e0f8303069a16488967d7e0913c05aecbcb14d
|
Remove memoization of compilation assemblies from ReferenceInfo
|
dotnet/roslyn,KevinRansom/roslyn,weltkante/roslyn,AmadeusW/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,bartdesmet/roslyn,AlekseyTs/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,KevinRansom/roslyn,wvdd007/roslyn,dotnet/roslyn,sharwell/roslyn,diryboy/roslyn,eriawan/roslyn,CyrusNajmabadi/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,AlekseyTs/roslyn,ErikSchierboom/roslyn,jasonmalinowski/roslyn,wvdd007/roslyn,tmat/roslyn,AmadeusW/roslyn,diryboy/roslyn,mavasani/roslyn,AlekseyTs/roslyn,wvdd007/roslyn,CyrusNajmabadi/roslyn,mavasani/roslyn,sharwell/roslyn,physhi/roslyn,physhi/roslyn,weltkante/roslyn,sharwell/roslyn,tmat/roslyn,mgoertz-msft/roslyn,tmat/roslyn,physhi/roslyn,mavasani/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,ErikSchierboom/roslyn,eriawan/roslyn,dotnet/roslyn,mgoertz-msft/roslyn,ErikSchierboom/roslyn,eriawan/roslyn
|
src/Features/Core/Portable/UnusedReferences/ReferenceInfo.cs
|
src/Features/Core/Portable/UnusedReferences/ReferenceInfo.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.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace Microsoft.CodeAnalysis.UnusedReferences
{
internal class ReferenceInfo
{
/// <summary>
/// Indicates the type of reference.
/// </summary>
public ReferenceType ReferenceType { get; }
/// <summary>
/// Uniquely identifies the reference.
/// </summary>
/// <remarks>
/// Should match the Include or Name attribute used in the project file.
/// </remarks>
public string ItemSpecification { get; }
/// <summary>
/// Indicates that this reference should be treated as if it were used.
/// </summary>
public bool TreatAsUsed { get; }
/// <summary>
/// The assembly paths that this reference directly adds to the compilation.
/// </summary>
public ImmutableArray<string> CompilationAssemblies { get; }
/// <summary>
/// The dependencies that this reference transitively brings in to the compilation.
/// </summary>
public ImmutableArray<ReferenceInfo> Dependencies { get; }
public ReferenceInfo(ReferenceType referenceType, string itemSpecification, bool treatAsUsed, ImmutableArray<string> compilationAssemblies, ImmutableArray<ReferenceInfo> dependencies)
{
ReferenceType = referenceType;
ItemSpecification = itemSpecification;
TreatAsUsed = treatAsUsed;
CompilationAssemblies = compilationAssemblies;
Dependencies = dependencies;
}
/// <summary>
/// Gets the compilation assemblies this reference directly brings into the compilation as well as those
/// brought in transitively.
/// </summary>
public ImmutableArray<string> GetAllCompilationAssemblies()
{
return CompilationAssemblies
.Concat(GetTransitiveCompilationAssemblies())
.ToImmutableArray();
}
private IEnumerable<string> GetTransitiveCompilationAssemblies()
{
return Dependencies.SelectMany(dependency => dependency.GetAllCompilationAssemblies());
}
}
}
|
// 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.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace Microsoft.CodeAnalysis.UnusedReferences
{
internal class ReferenceInfo
{
private ImmutableArray<string>? _allCompilationAssemblies;
/// <summary>
/// Indicates the type of reference.
/// </summary>
public ReferenceType ReferenceType { get; }
/// <summary>
/// Uniquely identifies the reference.
/// </summary>
/// <remarks>
/// Should match the Include or Name attribute used in the project file.
/// </remarks>
public string ItemSpecification { get; }
/// <summary>
/// Indicates that this reference should be treated as if it were used.
/// </summary>
public bool TreatAsUsed { get; }
/// <summary>
/// The assembly paths that this reference directly adds to the compilation.
/// </summary>
public ImmutableArray<string> CompilationAssemblies { get; }
/// <summary>
/// The dependencies that this reference transitively brings in to the compilation.
/// </summary>
public ImmutableArray<ReferenceInfo> Dependencies { get; }
public ReferenceInfo(ReferenceType referenceType, string itemSpecification, bool treatAsUsed, ImmutableArray<string> compilationAssemblies, ImmutableArray<ReferenceInfo> dependencies)
{
ReferenceType = referenceType;
ItemSpecification = itemSpecification;
TreatAsUsed = treatAsUsed;
CompilationAssemblies = compilationAssemblies;
Dependencies = dependencies;
}
/// <summary>
/// Gets the compilation assemblies this reference directly brings into the compilation as well as those
/// brought in transitively.
/// </summary>
public ImmutableArray<string> GetAllCompilationAssemblies()
{
_allCompilationAssemblies ??= CompilationAssemblies
.Concat(GetTransitiveCompilationAssemblies())
.ToImmutableArray();
return _allCompilationAssemblies.Value;
}
private IEnumerable<string> GetTransitiveCompilationAssemblies()
{
return Dependencies.SelectMany(dependency => dependency.GetAllCompilationAssemblies());
}
}
}
|
mit
|
C#
|
77aab59478f1c069c4992c69617502697be2ca6c
|
add 15.11 siebel workflow related files
|
oracle/Accelerators,oracle/Accelerators,oracle/Accelerators,oracle/Accelerators
|
casemgmt/ebs/cx/projects/Accelerator.EBS.ServiceStatusBarAddIn/Logs/DefaultLog.cs
|
casemgmt/ebs/cx/projects/Accelerator.EBS.ServiceStatusBarAddIn/Logs/DefaultLog.cs
|
/* *********************************************************************************************
* This file is part of the Oracle Service Cloud Accelerator Reference Integration set published
* by Oracle Service Cloud under the MIT license (MIT) included in the original distribution.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
***********************************************************************************************
* Accelerator Package: OSVC + EBS Enhancement
* link: http://www.oracle.com/technetwork/indexes/samplecode/accelerator-osvc-2525361.html
* OSvC release: 15.8 (August 2015)
* EBS release: 12.1.3
* reference: 150505-000099, 150420-000127
* date: Thu Nov 12 00:52:47 PST 2015
* revision: rnw-15-11-fixes-release-1
* SHA1: $Id: 66c15e7cee7b37925ed8a5bbc284555271894999 $
* *********************************************************************************************
* File: DefaultLog.cs
* *********************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Accelerator.EBS.SharedServices.RightNowServiceReference;
namespace Accelerator.EBS.SharedServices.Logs
{
internal class DefaultLog : Log
{
public DefaultLog(string param1 = null, string param2 = null, string param3 = null)
{
}
public void ErrorLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
public void DebugLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
public void NoticeLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
public void ClickLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
}
}
|
/* *********************************************************************************************
* This file is part of the Oracle Service Cloud Accelerator Reference Integration set published
* by Oracle Service Cloud under the MIT license (MIT) included in the original distribution.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
***********************************************************************************************
* Accelerator Package: OSVC + EBS Enhancement
* link: http://www.oracle.com/technetwork/indexes/samplecode/accelerator-osvc-2525361.html
* OSvC release: 15.8 (August 2015)
* EBS release: 12.1.3
* reference: 150505-000099, 150420-000127
* date: Thu Nov 12 00:52:47 PST 2015
* revision: rnw-15-11-fixes-release-1
* SHA1: $Id: 66c15e7cee7b37925ed8a5bbc284555271894999 $
* *********************************************************************************************
* File: DefaultLog.cs
* *********************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Accelerator.EBS.SharedServices.RightNowServiceReference;
namespace Accelerator.EBS.SharedServices.Logs
{
internal class DefaultLog : Log
{
public void ErrorLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
public void DebugLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
public void NoticeLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
public void ClickLog(Incident incident = null, RightNowServiceReference.Contact contact = null, string LogMessage = null, string LogNote = null, string source = null, int timeElapsed = 0)
{
}
}
}
|
mit
|
C#
|
a10ecb17f3a03fdce64fc9615fc42628447b7911
|
Clean up Program.cs
|
bfriesen/CSharpinator
|
src/CSharpifier.Console/Program.cs
|
src/CSharpifier.Console/Program.cs
|
using System;
using System.IO;
using System.Xml.Linq;
namespace CSharpifier
{
class Program
{
static void Main(string[] args)
{
XDocument xDocument;
if (args.Length == 0)
{
Console.WriteLine("Must include path to document as first argument.");
return;
}
if (!File.Exists(args[0]))
{
Console.WriteLine("No file exists at: " + args[0]);
return;
}
try
{
xDocument = XDocument.Load(args[0]);
}
catch
{
Console.WriteLine("Error reading into XDocument for file: " + args[0]);
return;
}
// xDocument = XDocument.Parse(@"
// <foo>
// <bars>
// <bar>123</bar>
// <bar>2147483648</bar>
// </bars>
// </foo>");
var domElement = new XmlDomElement(xDocument.Root);
var classRepository = new ClassRepository();
var domVisitor = new DomVisitor(classRepository);
domVisitor.Visit(domElement);
var classGenerator = new ClassGenerator(classRepository);
classGenerator.Write(
Case.PascalCase,
Case.PascalCase,
PropertyAttributes.XmlSerializion | PropertyAttributes.DataContract,
Console.Out);
}
}
}
|
using System;
using System.IO;
using System.Xml.Linq;
namespace CSharpifier
{
class Program
{
static void Main(string[] args)
{
XDocument xDocument;
if (args == null)
{
xDocument = XDocument.Parse(@"
<foo>
<bars>
<bar id=""1"">abc</bar>
<bar id=""1"">xyz</bar>
<baz>true</baz>
</bars>
</foo>");
}
else
{
if (args.Length == 0)
{
Console.WriteLine("Must include path to document as first argument.");
return;
}
if (!File.Exists(args[0]))
{
Console.WriteLine("No file exists at: " + args[0]);
return;
}
try
{
xDocument = XDocument.Load(args[0]);
}
catch
{
Console.WriteLine("Error reading into XDocument for file: " + args[0]);
return;
}
}
//xDocument.Root.ToString().Dump(); "".Dump();
var domElement = new XmlDomElement(xDocument.Root);
var classRepository = new ClassRepository();
var domVisitor = new DomVisitor(classRepository);
domVisitor.Visit(domElement);
// var classes = classRepository.GetAll();
// classes.Dump();
//
// var classDefinitions = ClassDefinitions.FromClasses(classes);
// classDefinitions.Dump();
//
// var loadedClasses = classDefinitions.ToClasses(classRepository);
// loadedClasses.Dump();
var classGenerator = new ClassGenerator(classRepository);
classGenerator.Write(
Case.PascalCase,
Case.PascalCase,
PropertyAttributes.XmlSerializion | PropertyAttributes.DataContract,
Console.Out);
}
}
}
|
mit
|
C#
|
06b8199d0d149094c6e8142d8a1503b592a722b4
|
Fix release build
|
Cyberboss/tgstation-server,tgstation/tgstation-server-tools,Cyberboss/tgstation-server,tgstation/tgstation-server,tgstation/tgstation-server
|
src/Tgstation.Server.Host.Watchdog/IActiveAssemblyDeleter.cs
|
src/Tgstation.Server.Host.Watchdog/IActiveAssemblyDeleter.cs
|
namespace Tgstation.Server.Host.Watchdog
{
/// <summary>
/// For deleting <see cref="System.Reflection.Assembly"/>s used by the program
/// </summary>
interface IActiveAssemblyDeleter
{
/// <summary>
/// Deletes an <see cref="System.Reflection.Assembly"/> that is in use by the runtime
/// </summary>
/// <param name="assemblyPath">The <see cref="System.Reflection.Assembly.Location"/> of the <see cref="System.Reflection.Assembly"/> to delete</param>
void DeleteActiveAssembly(string assemblyPath);
}
}
|
using System.Reflection;
namespace Tgstation.Server.Host.Watchdog
{
/// <summary>
/// For deleting <see cref="Assembly"/>s used by the program
/// </summary>
interface IActiveAssemblyDeleter
{
/// <summary>
/// Deletes an <paramref name="assembly"/> that is in use by the runtime
/// </summary>
/// <param name="assemblyPath">The <see cref="Assembly.Location"/> of the <see cref="Assembly"/> to delete</param>
void DeleteActiveAssembly(string assemblyPath);
}
}
|
agpl-3.0
|
C#
|
9ef98a674c4f50a7e36faca4eba9f8b8996ac07f
|
Kill commented out code so Scott isn't sad
|
ucdavis/Commencement,ucdavis/Commencement,ucdavis/Commencement
|
Commencement.Mvc/App_Start/FilterConfig.cs
|
Commencement.Mvc/App_Start/FilterConfig.cs
|
using System;
using System.Web;
using System.Web.Mvc;
using Serilog;
namespace Commencement.Mvc
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleAndLogErrorAttribute());
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method,
Inherited = true, AllowMultiple = true)]
public class HandleAndLogErrorAttribute : HandleErrorAttribute
{
public override void OnException(ExceptionContext filterContext)
{
// log exception here via stackify
Log.Error(filterContext.Exception, filterContext.Exception.Message);
base.OnException(filterContext);
}
}
}
|
using System;
using System.Web;
using System.Web.Mvc;
using Serilog;
namespace Commencement.Mvc
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleAndLogErrorAttribute());
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method,
Inherited = true, AllowMultiple = true)]
public class HandleAndLogErrorAttribute : HandleErrorAttribute
{
public override void OnException(ExceptionContext filterContext)
{
// log exception here via stackify
//Log.Error(filterContext.Exception.Message, filterContext.Exception);
Log.Error(filterContext.Exception, filterContext.Exception.Message);
base.OnException(filterContext);
}
}
}
|
mit
|
C#
|
74bbbce95401354873ccbbfd558bc066bad80955
|
Add some labels to AddGameObjectViewModelBase
|
leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,kirillkos/joinrpg-net,kirillkos/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net
|
Joinrpg/Models/AddGameObjectViewModelBase.cs
|
Joinrpg/Models/AddGameObjectViewModelBase.cs
|
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace JoinRpg.Web.Models
{
public class AddGameObjectViewModelBase
{
public int ProjectId { get; set; }
[Required, DisplayName("Является частью локаций")]
public List<int> ParentCharacterGroupIds { get; set; } = new List<int>();
[Required]
public string Name
{ get; set; }
[DisplayName("Публично?")]
public bool IsPublic { get; set; } = true;
[DataType(DataType.MultilineText),DisplayName("Описание")]
public string Description { get; set; }
public CharacterGroupListViewModel Data { get; set; }
}
}
|
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using JoinRpg.DataModel;
namespace JoinRpg.Web.Models
{
public class AddGameObjectViewModelBase
{
[Required]
public int ProjectId { get; set; }
[Required]
public List<int> ParentCharacterGroupIds { get; set; } = new List<int>();
[Required]
public string Name
{ get; set; }
public bool IsPublic { get; set; } = true;
[DataType(DataType.MultilineText)]
public string Description { get; set; }
public CharacterGroupListViewModel Data { get; set; }
}
}
|
mit
|
C#
|
e74afba37a131ef6b8c288caec14f1aed852c900
|
comment setTimeouts
|
apimatic/unirest-net,Knight1988/unirest-net
|
unirest-net/unirest-net/src/http/Unirest.cs
|
unirest-net/unirest-net/src/http/Unirest.cs
|
using System.Net.Http;
using unirest_net.request;
namespace unirest_net.http
{
public class Unirest
{
// Should add overload that takes URL object
public static HttpRequest get(string url)
{
return new HttpRequest(HttpMethod.Get, url);
}
public static HttpRequest post(string url)
{
return new HttpRequest(HttpMethod.Post, url);
}
public static HttpRequest delete(string url)
{
return new HttpRequest(HttpMethod.Delete, url);
}
public static HttpRequest patch(string url)
{
return new HttpRequest(new HttpMethod("PATCH"), url);
}
public static HttpRequest put(string url)
{
return new HttpRequest(HttpMethod.Put, url);
}
public static HttpRequest options(string url)
{
return new HttpRequest(HttpMethod.Options, url);
}
public static HttpRequest head(string url)
{
return new HttpRequest(HttpMethod.Head, url);
}
public static HttpRequest trace(string url)
{
return new HttpRequest(HttpMethod.Trace, url);
}
/// <summary>
/// Throw System.Threading.Tasks.TaskCanceledException when timeout
/// </summary>
/// <param name="connectionTimeout"></param>
public static void setTimeouts(long connectionTimeout)
{
HttpClientHelper.ConnectionTimeout = connectionTimeout;
}
}
}
|
using System.Net.Http;
using unirest_net.request;
namespace unirest_net.http
{
public class Unirest
{
// Should add overload that takes URL object
public static HttpRequest get(string url)
{
return new HttpRequest(HttpMethod.Get, url);
}
public static HttpRequest post(string url)
{
return new HttpRequest(HttpMethod.Post, url);
}
public static HttpRequest delete(string url)
{
return new HttpRequest(HttpMethod.Delete, url);
}
public static HttpRequest patch(string url)
{
return new HttpRequest(new HttpMethod("PATCH"), url);
}
public static HttpRequest put(string url)
{
return new HttpRequest(HttpMethod.Put, url);
}
public static HttpRequest options(string url)
{
return new HttpRequest(HttpMethod.Options, url);
}
public static HttpRequest head(string url)
{
return new HttpRequest(HttpMethod.Head, url);
}
public static HttpRequest trace(string url)
{
return new HttpRequest(HttpMethod.Trace, url);
}
public static void setTimeouts(long connectionTimeout)
{
HttpClientHelper.ConnectionTimeout = connectionTimeout;
}
}
}
|
mit
|
C#
|
230fa69c964dee69698ff781062c8d38cae5683e
|
Apply suggestions from code review
|
CyrusNajmabadi/roslyn,gafter/roslyn,KirillOsenkov/roslyn,reaction1989/roslyn,tannergooding/roslyn,wvdd007/roslyn,ErikSchierboom/roslyn,mgoertz-msft/roslyn,jasonmalinowski/roslyn,AmadeusW/roslyn,aelij/roslyn,stephentoub/roslyn,mgoertz-msft/roslyn,wvdd007/roslyn,jmarolf/roslyn,physhi/roslyn,eriawan/roslyn,davkean/roslyn,AmadeusW/roslyn,tmat/roslyn,diryboy/roslyn,ErikSchierboom/roslyn,shyamnamboodiripad/roslyn,sharwell/roslyn,brettfo/roslyn,panopticoncentral/roslyn,AlekseyTs/roslyn,brettfo/roslyn,heejaechang/roslyn,mavasani/roslyn,genlu/roslyn,KirillOsenkov/roslyn,aelij/roslyn,sharwell/roslyn,mavasani/roslyn,gafter/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,stephentoub/roslyn,reaction1989/roslyn,eriawan/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,dotnet/roslyn,jasonmalinowski/roslyn,panopticoncentral/roslyn,tannergooding/roslyn,KevinRansom/roslyn,AlekseyTs/roslyn,stephentoub/roslyn,mavasani/roslyn,tannergooding/roslyn,davkean/roslyn,heejaechang/roslyn,jmarolf/roslyn,weltkante/roslyn,KevinRansom/roslyn,tmat/roslyn,jmarolf/roslyn,tmat/roslyn,heejaechang/roslyn,aelij/roslyn,CyrusNajmabadi/roslyn,davkean/roslyn,ErikSchierboom/roslyn,bartdesmet/roslyn,diryboy/roslyn,diryboy/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,KirillOsenkov/roslyn,dotnet/roslyn,KevinRansom/roslyn,AmadeusW/roslyn,dotnet/roslyn,genlu/roslyn,eriawan/roslyn,reaction1989/roslyn,brettfo/roslyn,bartdesmet/roslyn,gafter/roslyn,wvdd007/roslyn,bartdesmet/roslyn,physhi/roslyn,sharwell/roslyn,genlu/roslyn,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn
|
src/EditorFeatures/TestUtilities/ChangeSignature/AddedParameterOrExistingIndex.cs
|
src/EditorFeatures/TestUtilities/ChangeSignature/AddedParameterOrExistingIndex.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.ChangeSignature;
namespace Microsoft.CodeAnalysis.Test.Utilities.ChangeSignature
{
internal sealed class AddedParameterOrExistingIndex
{
public bool IsExisting { get; }
public int OldIndex { get; }
public AddedParameter AddedParameter { get; }
public AddedParameterOrExistingIndex(int index)
{
OldIndex = index;
IsExisting = true;
AddedParameter = default;
}
public AddedParameterOrExistingIndex(AddedParameter addedParameter)
{
OldIndex = -1;
IsExisting = false;
AddedParameter = addedParameter;
}
public override string ToString()
=> IsExisting ? OldIndex.ToString() : AddedParameter.ToString();
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.ChangeSignature;
namespace Microsoft.CodeAnalysis.Test.Utilities.ChangeSignature
{
internal class AddedParameterOrExistingIndex
{
public bool IsExisting { get; }
public int OldIndex { get; }
public AddedParameter AddedParameter { get; }
public AddedParameterOrExistingIndex(int index)
{
OldIndex = index;
IsExisting = true;
AddedParameter = default;
}
public AddedParameterOrExistingIndex(AddedParameter addedParameter)
{
OldIndex = -1;
IsExisting = false;
AddedParameter = addedParameter;
}
public override string ToString()
=> IsExisting ? OldIndex.ToString() : AddedParameter.ToString();
}
}
|
mit
|
C#
|
4e8ab66bdf6dae23c08f449bc6d70eced9d374ba
|
Remove redunded Remove-AzureRmSqlDatabaseAuditing Cmdlet alias
|
naveedaz/azure-powershell,AzureRT/azure-powershell,ClogenyTechnologies/azure-powershell,seanbamsft/azure-powershell,pankajsn/azure-powershell,devigned/azure-powershell,AzureAutomationTeam/azure-powershell,AzureAutomationTeam/azure-powershell,seanbamsft/azure-powershell,AzureAutomationTeam/azure-powershell,ClogenyTechnologies/azure-powershell,rohmano/azure-powershell,AzureRT/azure-powershell,ClogenyTechnologies/azure-powershell,AzureAutomationTeam/azure-powershell,zhencui/azure-powershell,krkhan/azure-powershell,rohmano/azure-powershell,hungmai-msft/azure-powershell,ClogenyTechnologies/azure-powershell,hungmai-msft/azure-powershell,zhencui/azure-powershell,atpham256/azure-powershell,devigned/azure-powershell,naveedaz/azure-powershell,AzureAutomationTeam/azure-powershell,AzureRT/azure-powershell,krkhan/azure-powershell,AzureAutomationTeam/azure-powershell,seanbamsft/azure-powershell,zhencui/azure-powershell,atpham256/azure-powershell,pankajsn/azure-powershell,zhencui/azure-powershell,seanbamsft/azure-powershell,devigned/azure-powershell,naveedaz/azure-powershell,atpham256/azure-powershell,pankajsn/azure-powershell,krkhan/azure-powershell,devigned/azure-powershell,AzureRT/azure-powershell,rohmano/azure-powershell,atpham256/azure-powershell,hungmai-msft/azure-powershell,atpham256/azure-powershell,hungmai-msft/azure-powershell,atpham256/azure-powershell,rohmano/azure-powershell,pankajsn/azure-powershell,AzureRT/azure-powershell,krkhan/azure-powershell,devigned/azure-powershell,ClogenyTechnologies/azure-powershell,zhencui/azure-powershell,AzureRT/azure-powershell,devigned/azure-powershell,hungmai-msft/azure-powershell,zhencui/azure-powershell,naveedaz/azure-powershell,rohmano/azure-powershell,naveedaz/azure-powershell,krkhan/azure-powershell,pankajsn/azure-powershell,seanbamsft/azure-powershell,rohmano/azure-powershell,pankajsn/azure-powershell,naveedaz/azure-powershell,seanbamsft/azure-powershell,hungmai-msft/azure-powershell,krkhan/azure-powershell
|
src/ResourceManager/Sql/Commands.Sql/Auditing/Cmdlet/RemoveSqlDatabaseAuditing.cs
|
src/ResourceManager/Sql/Commands.Sql/Auditing/Cmdlet/RemoveSqlDatabaseAuditing.cs
|
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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 Microsoft.Azure.Commands.Sql.Auditing.Model;
using System.Management.Automation;
namespace Microsoft.Azure.Commands.Sql.Auditing.Cmdlet
{
/// <summary>
/// Disables auditing on a specific database.
/// </summary>
[Cmdlet(VerbsCommon.Remove, "AzureRmSqlDatabaseAuditing", SupportsShouldProcess = true), OutputType(typeof(AuditingPolicyModel))]
public class RemoveSqlDatabaseAuditing : SqlDatabaseAuditingCmdletBase
{
/// <summary>
/// Defines whether the cmdlets will output the model object at the end of its execution
/// </summary>
[Parameter(Mandatory = false)]
public SwitchParameter PassThru { get; set; }
/// <summary>
/// Returns true if the model object that was constructed by this cmdlet should be written out
/// </summary>
/// <returns>True if the model object should be written out, False otherwise</returns>
protected override bool WriteResult() { return PassThru; }
/// <summary>
/// Updates the given model element with the cmdlet specific operation
/// </summary>
/// <param name="model">A model object</param>
protected override AuditingPolicyModel ApplyUserInputToModel(AuditingPolicyModel model)
{
base.ApplyUserInputToModel(model);
model.AuditState = AuditStateType.Disabled;
return model;
}
/// <summary>
/// This method is responsible to call the right API in the communication layer that will eventually send the information in the
/// object to the REST endpoint
/// </summary>
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
protected override AuditingPolicyModel PersistChanges(AuditingPolicyModel model)
{
ModelAdapter.IgnoreStorage = true;
base.PersistChanges(model);
AuditType = AuditType.Blob;
var blobModel = GetEntity();
blobModel.AuditState = AuditStateType.Disabled;
base.PersistChanges(blobModel);
return null;
}
}
}
|
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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 Microsoft.Azure.Commands.Sql.Auditing.Model;
using System.Management.Automation;
namespace Microsoft.Azure.Commands.Sql.Auditing.Cmdlet
{
/// <summary>
/// Disables auditing on a specific database.
/// </summary>
[Cmdlet(VerbsCommon.Remove, "AzureRmSqlDatabaseAuditing", SupportsShouldProcess = true), OutputType(typeof(AuditingPolicyModel))]
[Alias("Remove-AzureRmSqlDatabaseAuditing")]
public class RemoveSqlDatabaseAuditing : SqlDatabaseAuditingCmdletBase
{
/// <summary>
/// Defines whether the cmdlets will output the model object at the end of its execution
/// </summary>
[Parameter(Mandatory = false)]
public SwitchParameter PassThru { get; set; }
/// <summary>
/// Returns true if the model object that was constructed by this cmdlet should be written out
/// </summary>
/// <returns>True if the model object should be written out, False otherwise</returns>
protected override bool WriteResult() { return PassThru; }
/// <summary>
/// Updates the given model element with the cmdlet specific operation
/// </summary>
/// <param name="model">A model object</param>
protected override AuditingPolicyModel ApplyUserInputToModel(AuditingPolicyModel model)
{
base.ApplyUserInputToModel(model);
model.AuditState = AuditStateType.Disabled;
return model;
}
/// <summary>
/// This method is responsible to call the right API in the communication layer that will eventually send the information in the
/// object to the REST endpoint
/// </summary>
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
protected override AuditingPolicyModel PersistChanges(AuditingPolicyModel model)
{
ModelAdapter.IgnoreStorage = true;
base.PersistChanges(model);
AuditType = AuditType.Blob;
var blobModel = GetEntity();
blobModel.AuditState = AuditStateType.Disabled;
base.PersistChanges(blobModel);
return null;
}
}
}
|
apache-2.0
|
C#
|
bb18960e078ed725945b7ef2e8deb7b9ad6b068c
|
Edit it
|
sta/websocket-sharp,jogibear9988/websocket-sharp,sta/websocket-sharp,sta/websocket-sharp,jogibear9988/websocket-sharp,sta/websocket-sharp,jogibear9988/websocket-sharp,jogibear9988/websocket-sharp
|
websocket-sharp/Server/IWebSocketSession.cs
|
websocket-sharp/Server/IWebSocketSession.cs
|
#region License
/*
* IWebSocketSession.cs
*
* The MIT License
*
* Copyright (c) 2013-2014 sta.blockhead
*
* 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.
*/
#endregion
using System;
using WebSocketSharp.Net.WebSockets;
namespace WebSocketSharp.Server
{
/// <summary>
/// Exposes the access to the information in a WebSocket session.
/// </summary>
public interface IWebSocketSession
{
#region Properties
/// <summary>
/// Gets the information in the WebSocket handshake request.
/// </summary>
/// <value>
/// A <see cref="WebSocketContext"/> instance that provides the access to
/// the information in the handshake request.
/// </value>
WebSocketContext Context { get; }
/// <summary>
/// Gets the unique ID of the session.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the unique ID of the session.
/// </value>
string ID { get; }
/// <summary>
/// Gets the name of the WebSocket subprotocol used in the session.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the name of the subprotocol
/// if present.
/// </value>
string Protocol { get; }
/// <summary>
/// Gets the time that the session has started.
/// </summary>
/// <value>
/// A <see cref="DateTime"/> that represents the time that the session
/// has started.
/// </value>
DateTime StartTime { get; }
/// <summary>
/// Gets the state of the <see cref="WebSocket"/> used in the session.
/// </summary>
/// <value>
/// One of the <see cref="WebSocketState"/> enum values, indicates the state of
/// the <see cref="WebSocket"/> used in the session.
/// </value>
WebSocketState State { get; }
#endregion
}
}
|
#region License
/*
* IWebSocketSession.cs
*
* The MIT License
*
* Copyright (c) 2013-2014 sta.blockhead
*
* 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.
*/
#endregion
using System;
using WebSocketSharp.Net.WebSockets;
namespace WebSocketSharp.Server
{
/// <summary>
/// Exposes the access to the information in a WebSocket session.
/// </summary>
public interface IWebSocketSession
{
#region Properties
/// <summary>
/// Gets the information in the WebSocket handshake request.
/// </summary>
/// <value>
/// A <see cref="WebSocketContext"/> instance that provides the access to
/// the information in the handshake request.
/// </value>
WebSocketContext Context { get; }
/// <summary>
/// Gets the unique ID of the session.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the unique ID of the session.
/// </value>
string ID { get; }
/// <summary>
/// Gets the name of the WebSocket subprotocol used in the session.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the name of the subprotocol
/// if present.
/// </value>
string Protocol { get; }
/// <summary>
/// Gets the time that the session has started.
/// </summary>
/// <value>
/// A <see cref="DateTime"/> that represents the time that the session has started.
/// </value>
DateTime StartTime { get; }
/// <summary>
/// Gets the state of the <see cref="WebSocket"/> used in the session.
/// </summary>
/// <value>
/// One of the <see cref="WebSocketState"/> enum values, indicates the state of
/// the <see cref="WebSocket"/> used in the session.
/// </value>
WebSocketState State { get; }
#endregion
}
}
|
mit
|
C#
|
81b8950ee211fcc4023cdc89dbdf2d235be473e9
|
Fix tests.
|
JohanLarsson/Gu.Analyzers
|
Gu.Analyzers.Test/GU0082IdenticalTestCaseTests/Diagnostics.cs
|
Gu.Analyzers.Test/GU0082IdenticalTestCaseTests/Diagnostics.cs
|
namespace Gu.Analyzers.Test.GU0082IdenticalTestCaseTests
{
using Gu.Roslyn.Asserts;
using NUnit.Framework;
internal class Diagnostics
{
private static readonly TestMethodAnalyzer Analyzer = new TestMethodAnalyzer();
private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create("GU0082");
[Test]
public void TestCaseAttributeAndParameter()
{
var testCode = @"
namespace RoslynSandbox
{
using NUnit.Framework;
public class FooTests
{
[↓TestCase(1, 2)]
[↓TestCase(1, 2)]
public void Test(int i, int j)
{
}
}
}";
AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic, testCode);
}
[Test]
public void WithAndWithoutAuthor()
{
var testCode = @"
namespace RoslynSandbox
{
using NUnit.Framework;
public class FooTests
{
[↓TestCase(1, 2)]
[↓TestCase(1, 2, Author = ""Author"")]
public void Test(int i)
{
}
}
}";
AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic, testCode);
}
[Test]
public void WithAuthor()
{
var testCode = @"
namespace RoslynSandbox
{
using NUnit.Framework;
public class FooTests
{
[↓TestCase(1, 2, Author = ""Author"")]
[↓TestCase(1, 2, Author = ""Author"")]
public void Test(int i)
{
}
}
}";
AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic, testCode);
}
}
}
|
namespace Gu.Analyzers.Test.GU0082IdenticalTestCaseTests
{
using Gu.Roslyn.Asserts;
using NUnit.Framework;
internal class Diagnostics
{
private static readonly TestMethodAnalyzer Analyzer = new TestMethodAnalyzer();
private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create("GU0081");
[Test]
public void TestCaseAttributeAndParameter()
{
var testCode = @"
namespace RoslynSandbox
{
using NUnit.Framework;
public class FooTests
{
[↓TestCase(1, 2)]
[↓TestCase(1, 2)]
public void Test(int i)
{
}
}
}";
AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic, testCode);
}
[Test]
public void TestCaseAttributeWithAuthor()
{
var testCode = @"
namespace RoslynSandbox
{
using NUnit.Framework;
public class FooTests
{
[↓TestCase(1, 2, Author = ""Author"")]
[↓TestCase(1, 2, Author = ""Author"")]
public void Test(int i)
{
}
}
}";
AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic, testCode);
}
}
}
|
mit
|
C#
|
a7bc6fcb10c894ca32282d16e6d7db1337f74313
|
Change directory
|
sakapon/Samples-2015
|
AzureMLSample/ColorDataConsole/Program.cs
|
AzureMLSample/ColorDataConsole/Program.cs
|
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace ColorDataConsole
{
static class Program
{
static void Main(string[] args)
{
CreateColorData();
CreateColorDataJP();
}
static void CreateColorData()
{
var columnNames = "RGB,Name,R,G,B,Hue,Saturation,Brightness";
var colorData = typeof(Color).GetProperties(BindingFlags.Public | BindingFlags.Static)
.Where(p => p.PropertyType == typeof(Color))
.Select(p => (Color)p.GetValue(null))
.Where(c => c.A == 255) // Exclude Transparent.
.Select(c => string.Join(",", string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B), c.Name, c.R, c.G, c.B, c.GetHue().ToString("N6"), c.GetSaturation().ToString("N6"), c.GetBrightness().ToString("N6")));
File.WriteAllLines("ColorData.csv", new[] { columnNames }.Concat(colorData));
}
static void CreateColorDataJP()
{
var columnNames = "RGB,Name,RomanName,R,G,B,Hue,Saturation,Brightness";
var colorData = File.ReadLines(@"..\..\..\ColorData\Input\ColorData-JP-org.csv")
.Skip(1)
.Select(l => l.Split(','))
.Select(org => new { org, c = ColorTranslator.FromHtml(org[0]) })
.Select(_ => string.Join(",", _.org[0], _.org[1], _.org[2], _.c.R, _.c.G, _.c.B, _.c.GetHue().ToString("N6"), _.c.GetSaturation().ToString("N6"), _.c.GetBrightness().ToString("N6")));
File.WriteAllLines("ColorData-JP.csv", new[] { columnNames }.Concat(colorData), Encoding.UTF8);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace ColorDataConsole
{
static class Program
{
static void Main(string[] args)
{
CreateColorDataJP();
}
static void CreateColorData()
{
var columnNames = "RGB,Name,R,G,B,Hue,Saturation,Brightness";
var colorData = typeof(Color).GetProperties(BindingFlags.Public | BindingFlags.Static)
.Where(p => p.PropertyType == typeof(Color))
.Select(p => (Color)p.GetValue(null))
.Where(c => c.A == 255) // Exclude Transparent.
.Select(c => string.Join(",", string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B), c.Name, c.R, c.G, c.B, c.GetHue().ToString("N6"), c.GetSaturation().ToString("N6"), c.GetBrightness().ToString("N6")));
File.WriteAllLines("ColorData.csv", new[] { columnNames }.Concat(colorData));
}
static void CreateColorDataJP()
{
var columnNames = "RGB,Name,RomanName,R,G,B,Hue,Saturation,Brightness";
var colorData = File.ReadLines(@"..\..\..\ColorData\ColorData-JP-org.csv")
.Skip(1)
.Select(l => l.Split(','))
.Select(org => new { org, c = ColorTranslator.FromHtml(org[0]) })
.Select(_ => string.Join(",", _.org[0], _.org[1], _.org[2], _.c.R, _.c.G, _.c.B, _.c.GetHue().ToString("N6"), _.c.GetSaturation().ToString("N6"), _.c.GetBrightness().ToString("N6")));
File.WriteAllLines("ColorData-JP.csv", new[] { columnNames }.Concat(colorData), Encoding.UTF8);
}
}
}
|
mit
|
C#
|
dea0fcd483fda1f6e86421928368d94b8ced5be4
|
Update Assert.cs
|
stephanstapel/ZUGFeRD-csharp,stephanstapel/ZUGFeRD-csharp
|
ZUGFeRD-Test/Assert.cs
|
ZUGFeRD-Test/Assert.cs
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ZUGFeRD_Test
{
public class Assert
{
public static bool AreEqual(object o1, object o2)
{
if (!o1.Equals(o2))
{
throw new Exception();
}
return true;
}
public static bool AreEqual(decimal d1, decimal d2)
{
if (d1 != d2)
{
throw new Exception();
}
return true;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ZUGFeRD_Test
{
public class Assert
{
public static bool AreEqual(object o1, object o2)
{
if (!o1.Equals(o2))
{
throw new Exception();
}
return true;
}
public static bool AreEqual(decimal d1, decimal d2)
{
if (d1 != d2)
{
throw new Exception();
}
return true;
}
}
}
|
apache-2.0
|
C#
|
20645312e5d7c93e8ecc576626b328b0dfd4b2f8
|
Bump version to 0.9.4
|
quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot
|
CactbotOverlay/Properties/AssemblyInfo.cs
|
CactbotOverlay/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.9.4.0")]
[assembly: AssemblyFileVersion("0.9.4.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.9.3.0")]
[assembly: AssemblyFileVersion("0.9.3.0")]
|
apache-2.0
|
C#
|
493297f1df600866331af28c1330f4e605476438
|
Bump version to 0.10.6
|
quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot
|
CactbotOverlay/Properties/AssemblyInfo.cs
|
CactbotOverlay/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.10.6.0")]
[assembly: AssemblyFileVersion("0.10.6.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.10.5.0")]
[assembly: AssemblyFileVersion("0.10.5.0")]
|
apache-2.0
|
C#
|
679df86cd9dceb7bae7099f2d503450c74ea0c7b
|
update version 1.1.3
|
clabnet/DataTestLoader,clabnet/DataTestLoader
|
DataTestLoader/Properties/AssemblyInfo.cs
|
DataTestLoader/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("Data Test Loader")]
[assembly: AssemblyDescription("A test data loader for integration test")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataTestLoader")]
[assembly: AssemblyCopyright("Copyright © 2015 Claudio Barca")]
[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("234fff06-675f-40c9-be13-85f02d9d4674")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.3")]
[assembly: AssemblyFileVersion("1.1.3")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Data Test Loader")]
[assembly: AssemblyDescription("A test data loader for integration test")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataTestLoader")]
[assembly: AssemblyCopyright("Copyright © 2015 Claudio Barca")]
[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("234fff06-675f-40c9-be13-85f02d9d4674")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
|
apache-2.0
|
C#
|
f53601451b54af864aa974a9e615833a38202d40
|
Make site name sitei
|
shibayan/kudu,EricSten-MSFT/kudu,projectkudu/kudu,barnyp/kudu,sitereactor/kudu,projectkudu/kudu,EricSten-MSFT/kudu,kenegozi/kudu,oliver-feng/kudu,shrimpy/kudu,dev-enthusiast/kudu,kenegozi/kudu,YOTOV-LIMITED/kudu,bbauya/kudu,duncansmart/kudu,puneet-gupta/kudu,juoni/kudu,shanselman/kudu,puneet-gupta/kudu,chrisrpatterson/kudu,uQr/kudu,shibayan/kudu,badescuga/kudu,MavenRain/kudu,uQr/kudu,WeAreMammoth/kudu-obsolete,mauricionr/kudu,juoni/kudu,sitereactor/kudu,barnyp/kudu,EricSten-MSFT/kudu,puneet-gupta/kudu,YOTOV-LIMITED/kudu,dev-enthusiast/kudu,badescuga/kudu,YOTOV-LIMITED/kudu,dev-enthusiast/kudu,bbauya/kudu,YOTOV-LIMITED/kudu,mauricionr/kudu,bbauya/kudu,sitereactor/kudu,badescuga/kudu,MavenRain/kudu,uQr/kudu,kali786516/kudu,juvchan/kudu,juvchan/kudu,shrimpy/kudu,WeAreMammoth/kudu-obsolete,sitereactor/kudu,mauricionr/kudu,juoni/kudu,sitereactor/kudu,juvchan/kudu,bbauya/kudu,EricSten-MSFT/kudu,shanselman/kudu,chrisrpatterson/kudu,shrimpy/kudu,badescuga/kudu,shibayan/kudu,kenegozi/kudu,chrisrpatterson/kudu,duncansmart/kudu,EricSten-MSFT/kudu,barnyp/kudu,projectkudu/kudu,mauricionr/kudu,shibayan/kudu,kali786516/kudu,duncansmart/kudu,kali786516/kudu,MavenRain/kudu,duncansmart/kudu,puneet-gupta/kudu,kenegozi/kudu,projectkudu/kudu,badescuga/kudu,MavenRain/kudu,juvchan/kudu,oliver-feng/kudu,shibayan/kudu,uQr/kudu,shanselman/kudu,shrimpy/kudu,oliver-feng/kudu,barnyp/kudu,projectkudu/kudu,dev-enthusiast/kudu,chrisrpatterson/kudu,oliver-feng/kudu,juvchan/kudu,WeAreMammoth/kudu-obsolete,juoni/kudu,puneet-gupta/kudu,kali786516/kudu
|
Kudu.FunctionalTests/GitStabilityTests.cs
|
Kudu.FunctionalTests/GitStabilityTests.cs
|
using System.Linq;
using System.Threading.Tasks;
using Kudu.Core.Deployment;
using Kudu.FunctionalTests.Infrastructure;
using Xunit;
namespace Kudu.FunctionalTests
{
public class GitStabilityTests
{
[Fact]
public void NSimpleDeployments()
{
string repositoryName = "HelloKudu";
string cloneUrl = "https://github.com/KuduApps/HelloKudu.git";
using (Git.Clone(repositoryName, cloneUrl))
{
for (int i = 0; i < 5; i++)
{
string applicationName = repositoryName + i;
ApplicationManager.Run(applicationName, appManager =>
{
// Act
appManager.GitDeploy(repositoryName);
var results = appManager.DeploymentManager.GetResults().ToList();
// Assert
Assert.Equal(1, results.Count);
Assert.Equal(DeployStatus.Success, results[0].Status);
KuduAssert.VerifyUrl(appManager.SiteUrl, "Hello Kudu");
});
}
}
}
}
}
|
using System.Linq;
using System.Threading.Tasks;
using Kudu.Core.Deployment;
using Kudu.FunctionalTests.Infrastructure;
using Xunit;
namespace Kudu.FunctionalTests
{
public class GitStabilityTests
{
[Fact]
public void NSimpleDeployments()
{
string repositoryName = "HelloKudu";
string cloneUrl = "https://github.com/KuduApps/HelloKudu.git";
using (Git.Clone(repositoryName, cloneUrl))
{
for (int i = 0; i < 5; i++)
{
string applicationName = repositoryName + "_" + i;
ApplicationManager.Run(applicationName, appManager =>
{
// Act
appManager.GitDeploy(repositoryName);
var results = appManager.DeploymentManager.GetResults().ToList();
// Assert
Assert.Equal(1, results.Count);
Assert.Equal(DeployStatus.Success, results[0].Status);
KuduAssert.VerifyUrl(appManager.SiteUrl, "Hello Kudu");
});
}
}
}
}
}
|
apache-2.0
|
C#
|
f2b9d73561b388f9ceef109b3e0b758f42c30dd3
|
Remove broken test
|
MichalDepta/FAKE,brianary/FAKE,Kazark/FAKE,rflechner/FAKE,xavierzwirtz/FAKE,MiloszKrajewski/FAKE,wooga/FAKE,RMCKirby/FAKE,MichalDepta/FAKE,leflings/FAKE,NaseUkolyCZ/FAKE,modulexcite/FAKE,RMCKirby/FAKE,ovu/FAKE,gareth-evans/FAKE,yonglehou/FAKE,mfalda/FAKE,dlsteuer/FAKE,modulexcite/FAKE,daniel-chambers/FAKE,satsuper/FAKE,ctaggart/FAKE,featuresnap/FAKE,warnergodfrey/FAKE,ovu/FAKE,haithemaraissia/FAKE,darrelmiller/FAKE,ilkerde/FAKE,mglodack/FAKE,Kazark/FAKE,MichalDepta/FAKE,modulexcite/FAKE,NaseUkolyCZ/FAKE,rflechner/FAKE,dmorgan3405/FAKE,haithemaraissia/FAKE,pacificIT/FAKE,mfalda/FAKE,ArturDorochowicz/FAKE,tpetricek/FAKE,ovu/FAKE,leflings/FAKE,naveensrinivasan/FAKE,NaseUkolyCZ/FAKE,daniel-chambers/FAKE,molinch/FAKE,naveensrinivasan/FAKE,warnergodfrey/FAKE,neoeinstein/FAKE,hitesh97/FAKE,pmcvtm/FAKE,ilkerde/FAKE,xavierzwirtz/FAKE,haithemaraissia/FAKE,featuresnap/FAKE,RMCKirby/FAKE,gareth-evans/FAKE,ilkerde/FAKE,JonCanning/FAKE,jayp33/FAKE,yonglehou/FAKE,dmorgan3405/FAKE,dlsteuer/FAKE,neoeinstein/FAKE,beeker/FAKE,darrelmiller/FAKE,mglodack/FAKE,darrelmiller/FAKE,molinch/FAKE,mat-mcloughlin/FAKE,featuresnap/FAKE,pmcvtm/FAKE,mfalda/FAKE,wooga/FAKE,NaseUkolyCZ/FAKE,philipcpresley/FAKE,philipcpresley/FAKE,beeker/FAKE,JonCanning/FAKE,wooga/FAKE,yonglehou/FAKE,leflings/FAKE,modulexcite/FAKE,brianary/FAKE,jayp33/FAKE,hitesh97/FAKE,daniel-chambers/FAKE,mat-mcloughlin/FAKE,darrelmiller/FAKE,gareth-evans/FAKE,MichalDepta/FAKE,leflings/FAKE,beeker/FAKE,pacificIT/FAKE,pmcvtm/FAKE,JonCanning/FAKE,MiloszKrajewski/FAKE,xavierzwirtz/FAKE,ArturDorochowicz/FAKE,daniel-chambers/FAKE,naveensrinivasan/FAKE,mglodack/FAKE,ilkerde/FAKE,brianary/FAKE,neoeinstein/FAKE,gareth-evans/FAKE,naveensrinivasan/FAKE,mat-mcloughlin/FAKE,warnergodfrey/FAKE,mfalda/FAKE,molinch/FAKE,philipcpresley/FAKE,satsuper/FAKE,dlsteuer/FAKE,satsuper/FAKE,pacificIT/FAKE,mglodack/FAKE,dmorgan3405/FAKE,ctaggart/FAKE,hitesh97/FAKE,tpetricek/FAKE,brianary/FAKE,jayp33/FAKE,MiloszKrajewski/FAKE,rflechner/FAKE,JonCanning/FAKE,ArturDorochowicz/FAKE,dmorgan3405/FAKE,satsuper/FAKE,pmcvtm/FAKE,ovu/FAKE,tpetricek/FAKE,Kazark/FAKE,wooga/FAKE,xavierzwirtz/FAKE,MiloszKrajewski/FAKE,yonglehou/FAKE,molinch/FAKE,RMCKirby/FAKE,mat-mcloughlin/FAKE,hitesh97/FAKE,philipcpresley/FAKE,tpetricek/FAKE,featuresnap/FAKE,Kazark/FAKE,beeker/FAKE,ctaggart/FAKE,rflechner/FAKE,ctaggart/FAKE,jayp33/FAKE,pacificIT/FAKE,neoeinstein/FAKE,dlsteuer/FAKE,haithemaraissia/FAKE,warnergodfrey/FAKE,ArturDorochowicz/FAKE
|
src/test/Test.FAKECore/FileHandling/CleanDirectorySpecs.cs
|
src/test/Test.FAKECore/FileHandling/CleanDirectorySpecs.cs
|
using System.IO;
using Machine.Specifications;
namespace Test.FAKECore.FileHandling
{
public class when_cleaning_directory_after_creating_test_structure : BaseFunctions
{
Establish context = CreateTestFileStructure;
Because of = () => CleanDir(TestData.TestDir);
It should_be_writeable =
() => new DirectoryInfo(TestData.TestDir).Attributes.ShouldEqual(FileAttributes.Directory);
It should_cleaned_all_dirs = () => AllDirectories().ShouldBeEmpty();
It should_cleaned_all_files = () => AllFiles().ShouldBeEmpty();
It should_still_exist = () => new DirectoryInfo(TestData.TestDir).Exists.ShouldBeTrue();
}
}
|
using System.IO;
using Machine.Specifications;
namespace Test.FAKECore.FileHandling
{
public class when_cleaning_empty_directory_after_creating_test_structure : BaseFunctions
{
Establish context = CreateTestDirStructure;
Because of = () => CleanDir(TestData.TestDir);
It should_cleaned_all_dirs = () => AllDirectories().ShouldBeEmpty();
It should_cleaned_all_files = () => AllFiles().ShouldBeEmpty();
It should_still_exist = () => new DirectoryInfo(TestData.TestDir).Exists.ShouldBeTrue();
}
public class when_cleaning_directory_after_creating_test_structure : BaseFunctions
{
Establish context = CreateTestFileStructure;
Because of = () => CleanDir(TestData.TestDir);
It should_be_writeable =
() => new DirectoryInfo(TestData.TestDir).Attributes.ShouldEqual(FileAttributes.Directory);
It should_cleaned_all_dirs = () => AllDirectories().ShouldBeEmpty();
It should_cleaned_all_files = () => AllFiles().ShouldBeEmpty();
It should_still_exist = () => new DirectoryInfo(TestData.TestDir).Exists.ShouldBeTrue();
}
}
|
apache-2.0
|
C#
|
342c1a7048b4bb425f09f521b1f325a4eccc3562
|
edit TrackDrawer
|
ChristianHemann/HTW_Motorsport_Simulator
|
Assets/Scripts/UnityInterface/TrackDrawer.cs
|
Assets/Scripts/UnityInterface/TrackDrawer.cs
|
using CalculationComponents;
using CalculationComponents.TrackComponents;
using Output;
using UnityEngine;
namespace UnityInterface
{
public class TrackDrawer : MonoBehaviour
{
private ImportantClasses.Vector2[] _positions;
public GameObject Cone;
void Start()
{
//sets the car on the starting line
foreach (TrackSegment trackSegment in Track.Instance.TrackSegments)
{
if (trackSegment is StartLine)
{
OverallCarOutput.LastCalculation.Direction = trackSegment.EndDirection;
OverallCarOutput.LastCalculation.Position = trackSegment.EndPoint;
break;
}
}
//place cones
_positions = Track.Instance.GetConePositions();
foreach (ImportantClasses.Vector2 position in _positions)
{
Instantiate(Cone, new Vector3(position.X, 0f, position.Y), new Quaternion(0, 0, 0, 0));
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CalculationComponents;
using MathNet.Numerics.LinearAlgebra;
using UnityEngine;
namespace UnityInterface
{
public class TrackDrawer : MonoBehaviour
{
private ImportantClasses.Vector2[] _positions;
public GameObject cone;
void Start()
{
_positions = Track.Instance.GetConePositions();
foreach (ImportantClasses.Vector2 position in _positions)
{
GameObject.Instantiate(cone, new Vector3(position.X, 0f, position.Y), new Quaternion(0, 0, 0, 0));
}
}
}
}
|
bsd-2-clause
|
C#
|
9d5f4ff365dd157acc9a80071b31a812500a2330
|
Change Camera Speed
|
ReiiYuki/KU-Structure
|
Assets/Scripts/UtilityScript/CameraZoomer.cs
|
Assets/Scripts/UtilityScript/CameraZoomer.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraZoomer : MonoBehaviour {
public float orthoZoomSpeed = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f; // The rate of change of the orthographic size in orthographic mode.
float cameraDistanceMax = 20f;
float cameraDistanceMin = 5f;
float cameraDistance = 10f;
float scrollSpeed = 3;
Camera camera;
void Start()
{
camera = Camera.main;
}
void Update()
{
// If there are two touches on the device...
if (Input.touchCount == 2)
{
// Store both touches.
Touch touchZero = Input.GetTouch(0);
Touch touchOne = Input.GetTouch(1);
// Find the position in the previous frame of each touch.
Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;
// Find the magnitude of the vector (the distance) between the touches in each frame.
float prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;
// Find the difference in the distances between each frame.
float deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;
// ... change the orthographic size based on the change in distance between the touches.
camera.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;
// Make sure the orthographic size never drops below zero.
camera.orthographicSize = Mathf.Max(camera.orthographicSize, cameraDistanceMin);
}
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
cameraDistance += Input.GetAxis("Mouse ScrollWheel") * scrollSpeed;
cameraDistance = Mathf.Clamp(cameraDistance, cameraDistanceMin, cameraDistanceMax);
camera.orthographicSize = cameraDistance;
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraZoomer : MonoBehaviour {
public float perspectiveZoomSpeed = 0.00000001f; // The rate of change of the field of view in perspective mode.
public float orthoZoomSpeed = 0.00000001f; // The rate of change of the orthographic size in orthographic mode.
float cameraDistanceMax = 20f;
float cameraDistanceMin = 5f;
float cameraDistance = 10f;
float scrollSpeed = 3;
Camera camera;
void Start()
{
camera = Camera.main;
}
void Update()
{
// If there are two touches on the device...
if (Input.touchCount == 2)
{
// Store both touches.
Touch touchZero = Input.GetTouch(0);
Touch touchOne = Input.GetTouch(1);
// Find the position in the previous frame of each touch.
Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;
// Find the magnitude of the vector (the distance) between the touches in each frame.
float prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;
// Find the difference in the distances between each frame.
float deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;
// ... change the orthographic size based on the change in distance between the touches.
camera.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;
// Make sure the orthographic size never drops below zero.
camera.orthographicSize = Mathf.Max(camera.orthographicSize, cameraDistanceMin);
}
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
cameraDistance += Input.GetAxis("Mouse ScrollWheel") * scrollSpeed;
cameraDistance = Mathf.Clamp(cameraDistance, cameraDistanceMin, cameraDistanceMax);
camera.orthographicSize = cameraDistance;
}
}
}
|
mit
|
C#
|
47781ff33638c619fae47f7a80633d64bcc87771
|
Update Blueprint41/TypeConversion/DateTimeToLong.cs
|
xirqlz/blueprint41
|
Blueprint41/TypeConversion/DateTimeToLong.cs
|
Blueprint41/TypeConversion/DateTimeToLong.cs
|
using Blueprint41.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Blueprint41.TypeConversion
{
internal class DateTimeToLong : Conversion<DateTime, long>
{
protected override long Converter(DateTime value)
{
//if date is not utc convert to utc.
DateTime utcTime = value.Kind != DateTimeKind.Utc ? value.ToUniversalTime() : value;
//return value.Ticks;
DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return (long)utcTime.Subtract(dt).TotalMilliseconds;
}
}
}
|
using Blueprint41.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Blueprint41.TypeConversion
{
internal class DateTimeToLong : Conversion<DateTime, long>
{
protected override long Converter(DateTime value)
{
//return value.Ticks;
DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return (long)value.Subtract(dt).TotalMilliseconds;
}
}
}
|
mit
|
C#
|
a2ca2be4d74694a69f9e7024568670a8cbd19296
|
Expand report model
|
Chess-Variants-Training/Chess-Variants-Training,Chess-Variants-Training/Chess-Variants-Training,Chess-Variants-Training/Chess-Variants-Training
|
src/AtomicChessPuzzles/Models/Report.cs
|
src/AtomicChessPuzzles/Models/Report.cs
|
using MongoDB.Bson.Serialization.Attributes;
namespace AtomicChessPuzzles.Models
{
public class Report
{
[BsonElement("_id")]
public string ID { get; set; }
[BsonElement("type")]
public string Type { get; set; }
[BsonElement("reporter")]
public string Reporter { get; set; }
[BsonElement("reported")]
public string Reported { get; set; }
[BsonElement("reason")]
public string Reason { get; set; }
[BsonElement("reasonExplanation")]
public string ReasonExplanation { get; set; }
[BsonElement("handled")]
public bool Handled { get; set; }
[BsonElement("judgementAfterHandling")]
public string JudgementAfterHandling { get; set; }
public Report(string id, string type, string reporter, string reported, string reason, string reasonExplanation, bool handled, string judgementAfterHandling)
{
ID = id;
Type = type;
Reporter = reporter;
Reported = reported;
Reason = reason;
ReasonExplanation = reasonExplanation;
Handled = handled;
JudgementAfterHandling = judgementAfterHandling;
}
}
}
|
using MongoDB.Bson.Serialization.Attributes;
namespace AtomicChessPuzzles.Models
{
public class Report
{
[BsonElement("_id")]
public string ID { get; set; }
[BsonElement("type")]
public string Type { get; set; }
[BsonElement("reporter")]
public string Reporter { get; set; }
[BsonElement("reported")]
public string Reported { get; set; }
[BsonElement("reason")]
public string Reason { get; set; }
[BsonElement("reasonExplanation")]
public string ReasonExplanation { get; set; }
public Report(string id, string type, string reporter, string reported, string reason, string reasonExplanation)
{
ID = id;
Type = type;
Reporter = reporter;
Reported = reported;
Reason = reason;
ReasonExplanation = reasonExplanation;
}
}
}
|
agpl-3.0
|
C#
|
10694169a4490823b5f0f0e8200a8ff5d0d61e40
|
Add AddStarToWikiTestAsync
|
ats124/backlog4net
|
src/Backlog4net.Test/StarMethodsTest.cs
|
src/Backlog4net.Test/StarMethodsTest.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.Remoting;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Backlog4net.Test
{
using Api;
using Api.Option;
using Backlog4net.Internal.Json;
using Backlog4net.Internal.Json.Activities;
using Conf;
using Newtonsoft.Json;
using TestConfig;
[TestClass]
public class StarMethodsTest
{
private static BacklogClient client;
private static GeneralConfig generalConfig;
private static string projectKey;
private static long projectId;
private static User ownUser;
[ClassInitialize]
public static async Task SetupClient(TestContext context)
{
generalConfig = GeneralConfig.Instance.Value;
var conf = new BacklogJpConfigure(generalConfig.SpaceKey);
conf.ApiKey = generalConfig.ApiKey;
client = new BacklogClientFactory(conf).NewClient();
var users = await client.GetUsersAsync();
projectKey = generalConfig.ProjectKey;
var project = await client.GetProjectAsync(projectKey);
projectId = project.Id;
ownUser = await client.GetMyselfAsync();
}
[TestMethod]
public async Task AddStarToIssueAndCommentAsync()
{
var issueTypes = await client.GetIssueTypesAsync(projectId);
var issue = await client.CreateIssueAsync(new CreateIssueParams(projectId, "StarTestIssue", issueTypes.First().Id, IssuePriorityType.High));
await client.AddStarToIssueAsync(issue.Id);
var issueComment = await client.AddIssueCommentAsync(new AddIssueCommentParams(issue.Id, "Comment"));
await client.AddStarToCommentAsync(issueComment.Id);
await client.DeleteIssueAsync(issue.Id);
}
[TestMethod]
public async Task AddStarToWikiTestAsync()
{
var wiki = await client.CreateWikiAsync(new CreateWikiParams(projectId, "StarTest", "StarTestContent")
{
MailNotify = false,
});
await client.AddStarToWikiAsync(wiki.Id);
await client.DeleteWikiAsync(wiki.Id, false);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.Remoting;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Backlog4net.Test
{
using Api;
using Api.Option;
using Backlog4net.Internal.Json;
using Backlog4net.Internal.Json.Activities;
using Conf;
using Newtonsoft.Json;
using TestConfig;
[TestClass]
public class StarMethodsTest
{
private static BacklogClient client;
private static GeneralConfig generalConfig;
private static string projectKey;
private static long projectId;
private static User ownUser;
[ClassInitialize]
public static async Task SetupClient(TestContext context)
{
generalConfig = GeneralConfig.Instance.Value;
var conf = new BacklogJpConfigure(generalConfig.SpaceKey);
conf.ApiKey = generalConfig.ApiKey;
client = new BacklogClientFactory(conf).NewClient();
var users = await client.GetUsersAsync();
projectKey = generalConfig.ProjectKey;
var project = await client.GetProjectAsync(projectKey);
projectId = project.Id;
ownUser = await client.GetMyselfAsync();
}
[TestMethod]
public async Task AddStarToIssueAndCommentAsync()
{
var issueTypes = await client.GetIssueTypesAsync(projectId);
var issue = await client.CreateIssueAsync(new CreateIssueParams(projectId, "StarTestIssue", issueTypes.First().Id, IssuePriorityType.High));
await client.AddStarToIssueAsync(issue.Id);
var issueComment = await client.AddIssueCommentAsync(new AddIssueCommentParams(issue.Id, "Comment"));
await client.AddStarToCommentAsync(issueComment.Id);
await client.DeleteIssueAsync(issue.Id);
}
}
}
|
mit
|
C#
|
0c655b8fc941565f6304aa7845e91f5d7eb87618
|
Add shared CssBoolean instances
|
Carbon/Css
|
src/Carbon.Css/Ast/Values/CssBoolean.cs
|
src/Carbon.Css/Ast/Values/CssBoolean.cs
|
namespace Carbon.Css
{
public sealed class CssBoolean : CssValue
{
public static readonly CssBoolean True = new CssBoolean(true);
public static readonly CssBoolean False = new CssBoolean(false);
public CssBoolean(bool value)
: base(NodeKind.Boolean)
{
Value = value;
}
public bool Value { get; }
public override CssNode CloneNode() => new CssBoolean(Value);
public override string ToString() => Value.ToString().ToLower();
internal static CssBoolean Get(bool value)
{
return value ? True : False;
}
}
}
|
namespace Carbon.Css
{
public sealed class CssBoolean : CssValue
{
public CssBoolean(bool value)
: base(NodeKind.Boolean)
{
Value = value;
}
public bool Value { get; }
public override CssNode CloneNode() => new CssBoolean(Value);
public override string ToString() => Value.ToString().ToLower();
}
}
|
mit
|
C#
|
d74f124f83b425242bcb07a3e456b190f9d95ebe
|
remove dependency on static Metric class
|
cvent/Metrics.NET,etishor/Metrics.NET,ntent-ad/Metrics.NET,Liwoj/Metrics.NET,MetaG8/Metrics.NET,mnadel/Metrics.NET,DeonHeyns/Metrics.NET,Liwoj/Metrics.NET,MetaG8/Metrics.NET,mnadel/Metrics.NET,etishor/Metrics.NET,ntent-ad/Metrics.NET,DeonHeyns/Metrics.NET,Recognos/Metrics.NET,Recognos/Metrics.NET,huoxudong125/Metrics.NET,MetaG8/Metrics.NET,cvent/Metrics.NET,alhardy/Metrics.NET,alhardy/Metrics.NET,huoxudong125/Metrics.NET
|
Src/Metrics/Reporters/ScheduledReporter.cs
|
Src/Metrics/Reporters/ScheduledReporter.cs
|
using System;
namespace Metrics.Reporters
{
public class ScheduledReporter
{
private readonly Timer reportTime = null;
private readonly Func<Reporter> reporter;
private readonly TimeSpan interval;
private readonly MetricsRegistry registry;
private System.Threading.Timer timer;
public ScheduledReporter(string name, Func<Reporter> reporter, MetricsRegistry registry, TimeSpan interval)
{
if (Metric.Reports.EnableReportDiagnosticMetrics)
{
this.reportTime = registry.Timer("Metrics.Reporter." + name, Unit.Calls, SamplingType.FavourRecent, TimeUnit.Seconds, TimeUnit.Milliseconds);
}
this.reporter = reporter;
this.interval = interval;
this.registry = registry;
}
public void Start()
{
if (this.timer != null)
{
Stop();
}
this.timer = new System.Threading.Timer((s) => RunReport(), null, interval, interval);
}
private void RunReport()
{
try
{
using (this.reportTime != null ? this.reportTime.NewContext() : null)
using (var report = reporter())
{
report.RunReport(this.registry);
}
}
catch (Exception x)
{
if (Metric.ErrorHandler != null)
{
Metric.ErrorHandler(x);
}
else
{
throw;
}
}
}
public void Stop()
{
this.timer.Dispose();
this.timer = null;
}
}
}
|
using System;
namespace Metrics.Reporters
{
public class ScheduledReporter
{
private readonly Timer reportTime = null;
private readonly Func<Reporter> reporter;
private readonly TimeSpan interval;
private readonly MetricsRegistry registry;
private System.Threading.Timer timer;
public ScheduledReporter(string name, Func<Reporter> reporter, MetricsRegistry registry, TimeSpan interval)
{
if (Metric.Reports.EnableReportDiagnosticMetrics)
{
this.reportTime = Metric.Timer("Metrics.Reporter." + name, Unit.Calls);
}
this.reporter = reporter;
this.interval = interval;
this.registry = registry;
}
public void Start()
{
if (this.timer != null)
{
Stop();
}
this.timer = new System.Threading.Timer((s) => RunReport(), null, interval, interval);
}
private void RunReport()
{
try
{
using (this.reportTime != null ? this.reportTime.NewContext() : null)
using (var report = reporter())
{
report.RunReport(this.registry);
}
}
catch (Exception x)
{
if (Metric.ErrorHandler != null)
{
Metric.ErrorHandler(x);
}
else
{
throw;
}
}
}
public void Stop()
{
this.timer.Dispose();
this.timer = null;
}
}
}
|
apache-2.0
|
C#
|
90591a184a4c374a43931a4a56044ea98e72b70a
|
Add 'Internal' and 'Gateway' to known source values.
|
clement911/ShopifySharp,addsb/ShopifySharp,nozzlegear/ShopifySharp
|
ShopifySharp/Entities/ShopifyOrderRisk.cs
|
ShopifySharp/Entities/ShopifyOrderRisk.cs
|
using Newtonsoft.Json;
using System;
namespace ShopifySharp
{
/// <summary>
/// An object representing a Shopify order risk.
/// </summary>
public class ShopifyOrderRisk : ShopifyObject
{
/// <summary>
/// Use this flag when a fraud check is accompanied with a call to the Orders API to cancel the order. This will indicate to the merchant that this risk was severe enough to force cancellation of the order.
/// Note: Setting this parameter does not cancel the order. This must be done by the Orders API.
/// </summary>
[JsonProperty("cause_cancel")]
public bool CauseCancel { get; set; }
/// <summary>
/// WARNING: This is an undocumented value returned by the Shopify API. Use at your own risk.
/// </summary>
[JsonProperty("checkout_id"), Obsolete("This is an undocumented value returned by the Shopify API. Use at your own risk.")]
public long? CheckoutId { get; set; }
/// <summary>
/// States whether or not the risk is displayed. Valid values are "true" or "false".
/// </summary>
[JsonProperty("display")]
public bool Display { get; set; }
/// <summary>
/// The id of the order the order risk belongs to
/// </summary>
[JsonProperty("order_id")]
public long? OrderId { get; set; }
/// <summary>
/// A message that should be displayed to the merchant to indicate the results of the fraud check.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// WARNING: This is an undocumented field returned by the Shopify API. Use at your own risk. This value cannot be set via API. This message is shown in the merchant's admin dashboard if different from <see cref="Message" />.
/// </summary>
[JsonProperty("merchant_message"), Obsolete("This is an undocumented field returned by the Shopify API. Use at your own risk.")]
public string MerchantMessage { get; set; }
/// <summary>
/// The recommended action given to the merchant. Known values are 'cancel', 'investigate' and 'accept'.
/// </summary>
[JsonProperty("recommendation")]
public string Recommendation { get; set; }
/// <summary>
/// A number between 0 and 1 indicating percentage likelihood of being fraud.
/// </summary>
[JsonProperty("score")]
public decimal Score { get; set; }
/// <summary>
/// This indicates the source of the risk assessment. Known values are 'External', 'Internal' and 'Gateway'.
/// </summary>
[JsonProperty("source")]
public string Source { get; set; }
}
}
|
using Newtonsoft.Json;
using System;
namespace ShopifySharp
{
/// <summary>
/// An object representing a Shopify order risk.
/// </summary>
public class ShopifyOrderRisk : ShopifyObject
{
/// <summary>
/// Use this flag when a fraud check is accompanied with a call to the Orders API to cancel the order. This will indicate to the merchant that this risk was severe enough to force cancellation of the order.
/// Note: Setting this parameter does not cancel the order. This must be done by the Orders API.
/// </summary>
[JsonProperty("cause_cancel")]
public bool CauseCancel { get; set; }
/// <summary>
/// WARNING: This is an undocumented value returned by the Shopify API. Use at your own risk.
/// </summary>
[JsonProperty("checkout_id"), Obsolete("This is an undocumented value returned by the Shopify API. Use at your own risk.")]
public long? CheckoutId { get; set; }
/// <summary>
/// States whether or not the risk is displayed. Valid values are "true" or "false".
/// </summary>
[JsonProperty("display")]
public bool Display { get; set; }
/// <summary>
/// The id of the order the order risk belongs to
/// </summary>
[JsonProperty("order_id")]
public long? OrderId { get; set; }
/// <summary>
/// A message that should be displayed to the merchant to indicate the results of the fraud check.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// WARNING: This is an undocumented field returned by the Shopify API. Use at your own risk.
/// </summary>
[JsonProperty("merchant_message"), Obsolete("This is an undocumented field returned by the Shopify API. Use at your own risk.")]
public string MerchantMessage { get; set; }
/// <summary>
/// The recommended action given to the merchant. Known values are 'cancel', 'investigate' and 'accept'.
/// </summary>
[JsonProperty("recommendation")]
public string Recommendation { get; set; }
/// <summary>
/// A number between 0 and 1 indicating percentage likelihood of being fraud.
/// </summary>
[JsonProperty("score")]
public decimal Score { get; set; }
/// <summary>
/// This indicates the source of the risk assessment. Only known value is 'External'.
/// </summary>
[JsonProperty("source")]
public string Source { get; set; }
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.