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 |
|---|---|---|---|---|---|---|---|---|
e8f59ea23323f1d735bb63e68bdf7979ab8cc0ec
|
add type 35 to cRequestContract
|
neowutran/OpcodeSearcher
|
DamageMeter.Core/Heuristic/C_REQUEST_CONTRACT.cs
|
DamageMeter.Core/Heuristic/C_REQUEST_CONTRACT.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tera.Game.Messages;
namespace DamageMeter.Heuristic
{
class C_REQUEST_CONTRACT : AbstractPacketHeuristic
{
public new void Process(ParsedMessage message)
{
base.Process(message);
if (IsKnown || OpcodeFinder.Instance.IsKnown(message.OpCode)) return;
if (message.Payload.Count < 2+2+2+4+4+4+4+4+1) return;
var nameOffset = Reader.ReadUInt16();
var dataOffset = Reader.ReadUInt16();
var dataCount = Reader.ReadUInt16();
var type = Reader.ReadUInt32();
if(type != 4 && type != 35) return; //4 = party invite, 35 = broker nego
var unk2 = Reader.ReadUInt32();
var unk3 = Reader.ReadUInt32();
var unk4 = Reader.ReadUInt32();
try { var name = Reader.ReadTeraString(); }
catch (Exception e) { return; }
if(Reader.BaseStream.Position + dataCount != message.Payload.Count) return;
OpcodeFinder.Instance.SetOpcode(message.OpCode, OPCODE);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tera.Game.Messages;
namespace DamageMeter.Heuristic
{
class C_REQUEST_CONTRACT : AbstractPacketHeuristic
{
public new void Process(ParsedMessage message)
{
base.Process(message);
if (IsKnown || OpcodeFinder.Instance.IsKnown(message.OpCode)) return;
if (message.Payload.Count < 2+2+2+4+4+4+4+4+1) return;
var nameOffset = Reader.ReadUInt16();
var dataOffset = Reader.ReadUInt16();
var dataCount = Reader.ReadUInt16();
var type = Reader.ReadUInt32();
if(type != 4) return;
var unk2 = Reader.ReadUInt32();
var unk3 = Reader.ReadUInt32();
var unk4 = Reader.ReadUInt32();
try { var name = Reader.ReadTeraString(); }
catch (Exception e) { return; }
if(Reader.BaseStream.Position + dataCount != message.Payload.Count) return;
OpcodeFinder.Instance.SetOpcode(message.OpCode, OPCODE);
}
}
}
|
mit
|
C#
|
4bb5d649db2cd70637491f683d1aae4587de45b5
|
Fix extract zip.
|
DatabaseApp-Team-Linnaeus/DatabasesApp,DatabaseApp-Team-Linnaeus/DatabasesApp
|
SupermarketsChain/SupermarketsChain.Importers.Excel/Program.cs
|
SupermarketsChain/SupermarketsChain.Importers.Excel/Program.cs
|
namespace SupermarketsChain.Importers.ZipExcel
{
using System;
using System.IO;
using System.IO.Compression;
using System.Data.OleDb;
using System.Data;
internal class Program
{
private static void Main(string[] args)
{
string zipPath = @".\reports";
string zipName = "Sample-Sales-Reports.zip";
ZipFile.ExtractToDirectory(zipName, zipPath);
var reportsDirectories = Directory.GetDirectories(zipPath);
foreach (var directory in reportsDirectories)
{
var reports = Directory.GetFiles(directory);
foreach (var report in reports)
{
var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + report + ";Extended Properties=\"Excel 12.0;IMEX=1;HDR=NO;TypeGuessRows=0;ImportMixedTypes=Text\"";
using (var conn = new OleDbConnection(connectionString))
{
conn.Open();
var sheets = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT * FROM [" + sheets.Rows[0]["TABLE_NAME"].ToString() + "] ";
var adapter = new OleDbDataAdapter(cmd);
var ds = new DataSet();
adapter.Fill(ds);
Console.WriteLine(ds.Tables);
}
conn.Close();
}
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.IO.Compression;
using System.Data.OleDb;
using SupermarketsChain.Models;
using Microsoft.Office.Core;
using Excel = Microsoft.Office.Interop.Excel;
using System.Data;
namespace SupermarketsChain.Importers.ZipExcel
{
internal class Program
{
private static void Main(string[] args)
{
string zipPath = @".\reports";
string zipName = "Sample-Sales-Reports.zip";
//ZipFile.ExtractToDirectory(zipName, zipPath);
var reportsDirectories = Directory.GetDirectories(zipPath);
foreach (var directory in reportsDirectories)
{
var reports = Directory.GetFiles(directory);
foreach (var report in reports)
{
var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + report + ";Extended Properties=\"Excel 12.0;IMEX=1;HDR=NO;TypeGuessRows=0;ImportMixedTypes=Text\"";
using (var conn = new OleDbConnection(connectionString))
{
conn.Open();
var sheets = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT * FROM [" + sheets.Rows[0]["TABLE_NAME"].ToString() + "] ";
var adapter = new OleDbDataAdapter(cmd);
var ds = new DataSet();
adapter.Fill(ds);
Console.WriteLine(ds.Tables);
}
conn.Close();
}
}
}
}
}
}
|
mit
|
C#
|
e6a6401c3a5766cb1e90764aeeafd275ee13ad0b
|
Move test.
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Tests/UnitTests/Hwi/SerialDefaultResponseTests.cs
|
WalletWasabi.Tests/UnitTests/Hwi/SerialDefaultResponseTests.cs
|
using System;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Hwi.ProcessBridge;
using WalletWasabi.Microservices;
using Xunit;
namespace WalletWasabi.Tests.UnitTests.Hwi
{
/// <summary>
/// The test in this collection is time-sensitive, therefore this test collection is run in a special way:
/// Parallel-capable test collections will be run first (in parallel), followed by this parallel-disabled test collections (run sequentially).
/// </summary>
/// <seealso href="https://xunit.net/docs/running-tests-in-parallel.html#parallelism-in-test-frameworks"/>
[Collection("Serial unit tests collection")]
public class SerialDefaultResponseTests
{
public TimeSpan ReasonableRequestTimeout { get; } = TimeSpan.FromMinutes(1);
[Fact]
public async Task HwiProcessBridgeTestAsync()
{
HwiProcessBridge pb = new HwiProcessBridge(MicroserviceHelpers.GetBinaryPath("hwi"), new ProcessInvoker());
using var cts = new CancellationTokenSource(ReasonableRequestTimeout);
var res = await pb.SendCommandAsync("version", false, cts.Token);
Assert.NotEmpty(res.response);
bool stdInputActionCalled = false;
res = await pb.SendCommandAsync("version", false, cts.Token, (sw) => stdInputActionCalled = true);
Assert.NotEmpty(res.response);
Assert.True(stdInputActionCalled);
}
[Fact]
public async void HwiProcessHelpTestAsync()
{
using var cts = new CancellationTokenSource();
var processBridge = new HwiProcessBridge(MicroserviceHelpers.GetBinaryPath("hwi"), new ProcessInvoker());
(string response, int exitCode) p = await processBridge.SendCommandAsync("--help", openConsole: false, cts.Token);
Assert.Equal(0, p.exitCode);
Assert.Equal("{\"error\": \"Help text requested\", \"code\": -17}" + Environment.NewLine, p.response);
}
}
}
|
using System;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Hwi.ProcessBridge;
using Xunit;
namespace WalletWasabi.Tests.UnitTests.Hwi
{
/// <summary>
/// The test in this collection is time-sensitive, therefore this test collection is run in a special way:
/// Parallel-capable test collections will be run first (in parallel), followed by this parallel-disabled test collections (run sequentially).
/// </summary>
/// <seealso href="https://xunit.net/docs/running-tests-in-parallel.html#parallelism-in-test-frameworks"/>
[Collection("Serial unit tests collection")]
public class SerialDefaultResponseTests
{
public TimeSpan ReasonableRequestTimeout { get; } = TimeSpan.FromMinutes(1);
[Fact]
public async Task HwiProcessBridgeTestAsync()
{
HwiProcessBridge pb = new HwiProcessBridge();
using var cts = new CancellationTokenSource(ReasonableRequestTimeout);
var res = await pb.SendCommandAsync("version", false, cts.Token);
Assert.NotEmpty(res.response);
bool stdInputActionCalled = false;
res = await pb.SendCommandAsync("version", false, cts.Token, (sw) => stdInputActionCalled = true);
Assert.NotEmpty(res.response);
Assert.True(stdInputActionCalled);
}
}
}
|
mit
|
C#
|
df931e11580a7ad02346d1d0911000a17de26f4f
|
Update version for merge
|
cognisant/cr-message-dispatch
|
src/dispatchers.eventstore/Properties/AssemblyInfo.cs
|
src/dispatchers.eventstore/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("CR MessageDispatch Event Store Dispatchers")]
[assembly: AssemblyDescription("Dispatchers for ResolvedEvent and an Event Store subscriber")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cognisant")]
[assembly: AssemblyProduct("CR.MessageDispatch.Dispatchers.EventStore")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("94cea172-0d1f-4f68-887c-e445fc7d8d83")]
// 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.11.*")]
[assembly: AssemblyFileVersion("1.0.11.*")]
|
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("CR MessageDispatch Event Store Dispatchers")]
[assembly: AssemblyDescription("Dispatchers for ResolvedEvent and an Event Store subscriber")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cognisant")]
[assembly: AssemblyProduct("CR.MessageDispatch.Dispatchers.EventStore")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("94cea172-0d1f-4f68-887c-e445fc7d8d83")]
// 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.10.*")]
[assembly: AssemblyFileVersion("1.0.10.*")]
|
bsd-3-clause
|
C#
|
4a656a1aa5a3c3e57c773cdd01179bfaaf09a673
|
Disable useUserOverride in CultureContext
|
shyamnamboodiripad/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jasonmalinowski/roslyn,shyamnamboodiripad/roslyn,cston/roslyn,heejaechang/roslyn,jamesqo/roslyn,CaptainHayashi/roslyn,abock/roslyn,physhi/roslyn,Giftednewt/roslyn,aelij/roslyn,brettfo/roslyn,xasx/roslyn,mattscheffer/roslyn,CyrusNajmabadi/roslyn,CaptainHayashi/roslyn,jamesqo/roslyn,srivatsn/roslyn,agocke/roslyn,jcouv/roslyn,nguerrera/roslyn,swaroop-sridhar/roslyn,paulvanbrenk/roslyn,MattWindsor91/roslyn,tvand7093/roslyn,weltkante/roslyn,mgoertz-msft/roslyn,tvand7093/roslyn,robinsedlaczek/roslyn,ErikSchierboom/roslyn,AlekseyTs/roslyn,orthoxerox/roslyn,dotnet/roslyn,dpoeschl/roslyn,tmat/roslyn,MattWindsor91/roslyn,paulvanbrenk/roslyn,genlu/roslyn,khyperia/roslyn,VSadov/roslyn,DustinCampbell/roslyn,MichalStrehovsky/roslyn,dpoeschl/roslyn,jmarolf/roslyn,jmarolf/roslyn,jkotas/roslyn,DustinCampbell/roslyn,OmarTawfik/roslyn,eriawan/roslyn,srivatsn/roslyn,MattWindsor91/roslyn,AlekseyTs/roslyn,KirillOsenkov/roslyn,CaptainHayashi/roslyn,Giftednewt/roslyn,aelij/roslyn,heejaechang/roslyn,AmadeusW/roslyn,jasonmalinowski/roslyn,tmeschter/roslyn,aelij/roslyn,cston/roslyn,mavasani/roslyn,lorcanmooney/roslyn,khyperia/roslyn,jcouv/roslyn,bkoelman/roslyn,mmitche/roslyn,stephentoub/roslyn,jkotas/roslyn,KevinRansom/roslyn,tmeschter/roslyn,panopticoncentral/roslyn,mavasani/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,dotnet/roslyn,reaction1989/roslyn,paulvanbrenk/roslyn,robinsedlaczek/roslyn,physhi/roslyn,jasonmalinowski/roslyn,robinsedlaczek/roslyn,bartdesmet/roslyn,MattWindsor91/roslyn,swaroop-sridhar/roslyn,abock/roslyn,stephentoub/roslyn,KirillOsenkov/roslyn,weltkante/roslyn,gafter/roslyn,brettfo/roslyn,sharwell/roslyn,physhi/roslyn,mattscheffer/roslyn,mmitche/roslyn,OmarTawfik/roslyn,xasx/roslyn,DustinCampbell/roslyn,ErikSchierboom/roslyn,diryboy/roslyn,tmeschter/roslyn,diryboy/roslyn,brettfo/roslyn,tannergooding/roslyn,wvdd007/roslyn,wvdd007/roslyn,Hosch250/roslyn,CyrusNajmabadi/roslyn,Hosch250/roslyn,lorcanmooney/roslyn,pdelvo/roslyn,MichalStrehovsky/roslyn,cston/roslyn,KirillOsenkov/roslyn,heejaechang/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,genlu/roslyn,tannergooding/roslyn,diryboy/roslyn,jmarolf/roslyn,MichalStrehovsky/roslyn,tmat/roslyn,tannergooding/roslyn,genlu/roslyn,mavasani/roslyn,pdelvo/roslyn,swaroop-sridhar/roslyn,eriawan/roslyn,jkotas/roslyn,VSadov/roslyn,jamesqo/roslyn,nguerrera/roslyn,orthoxerox/roslyn,xasx/roslyn,bkoelman/roslyn,mmitche/roslyn,eriawan/roslyn,VSadov/roslyn,wvdd007/roslyn,tvand7093/roslyn,bkoelman/roslyn,gafter/roslyn,jcouv/roslyn,abock/roslyn,AmadeusW/roslyn,AmadeusW/roslyn,Hosch250/roslyn,sharwell/roslyn,ErikSchierboom/roslyn,lorcanmooney/roslyn,davkean/roslyn,dotnet/roslyn,agocke/roslyn,davkean/roslyn,orthoxerox/roslyn,reaction1989/roslyn,pdelvo/roslyn,OmarTawfik/roslyn,AlekseyTs/roslyn,dpoeschl/roslyn,nguerrera/roslyn,panopticoncentral/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,srivatsn/roslyn,bartdesmet/roslyn,stephentoub/roslyn,Giftednewt/roslyn,mgoertz-msft/roslyn,tmat/roslyn,agocke/roslyn,bartdesmet/roslyn,davkean/roslyn,KevinRansom/roslyn,mattscheffer/roslyn,khyperia/roslyn,gafter/roslyn,panopticoncentral/roslyn,sharwell/roslyn,reaction1989/roslyn
|
src/Test/Utilities/Portable/CultureContext.cs
|
src/Test/Utilities/Portable/CultureContext.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Globalization;
using System.Threading;
namespace Roslyn.Test.Utilities
{
public class CultureContext : IDisposable
{
private readonly CultureInfo _threadCulture;
public CultureContext(CultureInfo cultureInfo)
{
_threadCulture = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = cultureInfo;
}
public CultureContext(string testCulture)
: this(new CultureInfo(testCulture, false))
{ }
public void Dispose()
{
CultureInfo.CurrentCulture = _threadCulture;
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Globalization;
using System.Threading;
namespace Roslyn.Test.Utilities
{
public class CultureContext : IDisposable
{
private readonly CultureInfo _threadCulture;
public CultureContext(CultureInfo cultureInfo)
{
_threadCulture = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = cultureInfo;
}
public CultureContext(string testCulture)
: this(new CultureInfo(testCulture))
{ }
public void Dispose()
{
CultureInfo.CurrentCulture = _threadCulture;
}
}
}
|
mit
|
C#
|
6c4bf1fef555d60426176a104cfaa2859db6d2e5
|
Use Path.Combine instead of Windows-specific directory separators
|
joelverhagen/TorSharp
|
TorSharp/Tools/Tor/TorConfigurationDictionary.cs
|
TorSharp/Tools/Tor/TorConfigurationDictionary.cs
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Knapcode.TorSharp.Tools.Tor
{
public class TorConfigurationDictionary : IConfigurationDictionary
{
private readonly string _torDirectoryPath;
public TorConfigurationDictionary(string torDirectoryPath)
{
_torDirectoryPath = torDirectoryPath;
}
public IDictionary<string, string> GetDictionary(TorSharpSettings settings)
{
var dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
{ "SocksPort", settings.TorSocksPort.ToString(CultureInfo.InvariantCulture) },
{ "ControlPort", settings.TorControlPort.ToString(CultureInfo.InvariantCulture) }
};
if (settings.HashedTorControlPassword != null)
{
dictionary["HashedControlPassword"] = settings.HashedTorControlPassword;
}
if (!string.IsNullOrWhiteSpace(settings.TorDataDirectory))
{
dictionary["DataDirectory"] = settings.TorDataDirectory;
}
if (settings.TorExitNodes != null)
{
dictionary["ExitNodes"] = settings.TorExitNodes;
dictionary["GeoIPFile"] = Path.Combine(_torDirectoryPath, Path.Combine("Data", "Tor", "geoip"));
dictionary["GeoIPv6File"] = Path.Combine(_torDirectoryPath, Path.Combine("Data", "Tor", "geoip6"));
}
if (settings.TorStrictNodes != null)
{
dictionary["StrictNodes"] = settings.TorStrictNodes.Value ? "1" : "0";
}
return dictionary;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Knapcode.TorSharp.Tools.Tor
{
public class TorConfigurationDictionary : IConfigurationDictionary
{
private readonly string _torDirectoryPath;
public TorConfigurationDictionary(string torDirectoryPath)
{
_torDirectoryPath = torDirectoryPath;
}
public IDictionary<string, string> GetDictionary(TorSharpSettings settings)
{
var dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
{ "SocksPort", settings.TorSocksPort.ToString(CultureInfo.InvariantCulture) },
{ "ControlPort", settings.TorControlPort.ToString(CultureInfo.InvariantCulture) }
};
if (settings.HashedTorControlPassword != null)
{
dictionary["HashedControlPassword"] = settings.HashedTorControlPassword;
}
if (!string.IsNullOrWhiteSpace(settings.TorDataDirectory))
{
dictionary["DataDirectory"] = settings.TorDataDirectory;
}
if (settings.TorExitNodes != null)
{
dictionary["ExitNodes"] = settings.TorExitNodes;
dictionary["GeoIPFile"] = Path.Combine(_torDirectoryPath, "Data\\Tor\\geoip");
dictionary["GeoIPv6File"] = Path.Combine(_torDirectoryPath, "Data\\Tor\\geoip6");
}
if (settings.TorStrictNodes != null)
{
dictionary["StrictNodes"] = (bool)settings.TorStrictNodes ? "1" : "0";
}
return dictionary;
}
}
}
|
mit
|
C#
|
3f07f77ee6a0d3f95953095a8d53eefeaf8a6f1b
|
update vi script
|
dncuug/dot-net.in.ua,dncuug/dot-net.in.ua,dncuug/dot-net.in.ua
|
src/WebSite/Views/Shared/_SmartContent.cshtml
|
src/WebSite/Views/Shared/_SmartContent.cshtml
|
<div class="in-feed-ad">
<script type="text/javascript">
(function (v,i){
var source = 'https://test-mobile.viewster.com/ad-unit/source.js',
config = {
ChannelID: '59c4d02d28a06117d405b228',
AdUnitType: '2',
PublisherID: '225216805684543',
PlacementID: '225216805684543',
DivId: '',
IAB_Category: 'IAB19',
Keywords: 'net,c sharp,asp.net,software development,microsoft,mono,visual studio',
Language: 'en-us',
BG_Color: '',
Text_Color: '',
Font: 'Tahoma, Geneva, sans-serif',
FontSize: '',
vioptional1: '',
vioptional2: '',
vioptional3: '',
},
b=v.body||v.documentElement.appendChild(v.createElement('body')),scr=v.createElement('script');scr.src=source,
scr.async=!0,scr.onload=function(){i.vi.run(config,void 0===v.currentScript?v.scripts[v.scripts.length-1]:v.currentScript,source)},b.appendChild(scr);
})(document,window)</script>
</div>
|
<div class="in-feed-ad">
<script type="text/javascript">
(function (v,i){
var source = 'https://s.vi-serve.com/source.js',
config = {
ChannelID: '59c4d02d28a06117d405b228',
AdUnitType: '2',
PublisherID: '225216805684543',
PlacementID: '225216805684543',
DivId: '',
IAB_Category: 'IAB19',
Keywords: 'net,c sharp,asp.net,software development,microsoft,mono,visual studio',
Language: 'en-us',
BG_Color: '',
Text_Color: '',
Font: 'Tahoma, Geneva, sans-serif',
FontSize: '',
vioptional1: '',
vioptional2: '',
vioptional3: '',
},
b=v.body||v.documentElement.appendChild(v.createElement('body')),scr=v.createElement('script');scr.src=source,
scr.async=!0,scr.onload=function(){i.vi.run(config,void 0===v.currentScript?v.scripts[v.scripts.length-1]:v.currentScript,source)},b.appendChild(scr);
})(document,window)</script>
</div>
|
mit
|
C#
|
8c1cc5ec08de143e5404e95c67ee60b0c013cee9
|
Remove unused using statements.
|
KuduApps/NuGetGallery,KuduApps/NuGetGallery,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,skbkontur/NuGetGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,projectkudu/SiteExtensionGallery,mtian/SiteExtensionGallery,JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,projectkudu/SiteExtensionGallery,JetBrains/ReSharperGallery,mtian/SiteExtensionGallery,ScottShingler/NuGetGallery,skbkontur/NuGetGallery,grenade/NuGetGallery_download-count-patch,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery
|
Website/DataServices/ODataRemoveVersionSorter.cs
|
Website/DataServices/ODataRemoveVersionSorter.cs
|
using System;
using System.Linq;
using System.Linq.Expressions;
namespace NuGetGallery
{
public class ODataRemoveVersionSorter : ExpressionVisitor
{
protected override Expression VisitMethodCall(MethodCallExpression node)
{
if (IsSortingOnVersion(node))
{
// The expression is of the format Queryable.ThenBy(OrderBy(<Expression>, <Order-by-params>), <Then-by-params>). To avoid performing the
// method, we ignore it, traversing the passed in expression instead.
return Visit(node.Arguments[0]);
}
return base.VisitMethodCall(node);
}
private bool IsSortingOnVersion(MethodCallExpression expression)
{
var methodsToIgnore = new[] { "ThenBy", "ThenByDescending" };
var method = expression.Method;
if (method.DeclaringType == typeof(Queryable) && methodsToIgnore.Contains(method.Name, StringComparer.Ordinal))
{
return IsVersionArgument(expression);
}
return false;
}
private bool IsVersionArgument(MethodCallExpression expression)
{
if (expression.Arguments.Count == 2)
{
var memberVisitor = new MemberVisitor();
memberVisitor.Visit(expression.Arguments[1]);
return memberVisitor.Flag;
}
return false;
}
private sealed class MemberVisitor : ExpressionVisitor
{
public bool Flag { get; set; }
protected override Expression VisitMember(MemberExpression node)
{
// Note that if Flag has already been set to true, we need to retain that state
// as our visitor can be called multiple times.
// Example: The expression can either be p => p.Version or p => p.ExpandedWrapper.Version where the
// latter is some funky OData type wrapper. We need to ensure we handle both these cases
Flag = Flag || String.Equals(node.Member.Name, "Version", StringComparison.Ordinal);
return base.VisitMember(node);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
namespace NuGetGallery
{
public class ODataRemoveVersionSorter : ExpressionVisitor
{
protected override Expression VisitMethodCall(MethodCallExpression node)
{
if (IsSortingOnVersion(node))
{
// The expression is of the format Queryable.ThenBy(OrderBy(<Expression>, <Order-by-params>), <Then-by-params>). To avoid performing the
// method, we ignore it, traversing the passed in expression instead.
return Visit(node.Arguments[0]);
}
return base.VisitMethodCall(node);
}
private bool IsSortingOnVersion(MethodCallExpression expression)
{
var methodsToIgnore = new[] { "ThenBy", "ThenByDescending" };
var method = expression.Method;
if (method.DeclaringType == typeof(Queryable) && methodsToIgnore.Contains(method.Name, StringComparer.Ordinal))
{
return IsVersionArgument(expression);
}
return false;
}
private bool IsVersionArgument(MethodCallExpression expression)
{
if (expression.Arguments.Count == 2)
{
var memberVisitor = new MemberVisitor();
memberVisitor.Visit(expression.Arguments[1]);
return memberVisitor.Flag;
}
return false;
}
private sealed class MemberVisitor : ExpressionVisitor
{
public bool Flag { get; set; }
protected override Expression VisitMember(MemberExpression node)
{
// Note that if Flag has already been set to true, we need to retain that state
// as our visitor can be called multiple times.
// Example: The expression can either be p => p.Version or p => p.ExpandedWrapper.Version where the
// latter is some funky OData type wrapper. We need to ensure we handle both these cases
Flag = Flag || String.Equals(node.Member.Name, "Version", StringComparison.Ordinal);
return base.VisitMember(node);
}
}
}
}
|
apache-2.0
|
C#
|
da058197c737072bf9ff6c591eda9027e4652f27
|
Remove useless field in ProgramSource
|
derekforeman/Wox,renzhn/Wox,mika76/Wox,dstiert/Wox,Wox-launcher/Wox,EmuxEvans/Wox,AlexCaranha/Wox,qianlifeng/Wox,gnowxilef/Wox,Launchify/Launchify,kdar/Wox,mika76/Wox,kdar/Wox,JohnTheGr8/Wox,18098924759/Wox,apprentice3d/Wox,qianlifeng/Wox,Launchify/Launchify,lances101/Wox,kayone/Wox,jondaniels/Wox,qianlifeng/Wox,dstiert/Wox,danisein/Wox,medoni/Wox,18098924759/Wox,medoni/Wox,sanbinabu/Wox,apprentice3d/Wox,kayone/Wox,lances101/Wox,shangvven/Wox,vebin/Wox,gnowxilef/Wox,AlexCaranha/Wox,apprentice3d/Wox,danisein/Wox,zlphoenix/Wox,dstiert/Wox,18098924759/Wox,shangvven/Wox,EmuxEvans/Wox,sanbinabu/Wox,zlphoenix/Wox,yozora-hitagi/Saber,Megasware128/Wox,vebin/Wox,JohnTheGr8/Wox,EmuxEvans/Wox,gnowxilef/Wox,AlexCaranha/Wox,mika76/Wox,derekforeman/Wox,Megasware128/Wox,kayone/Wox,vebin/Wox,shangvven/Wox,kdar/Wox,derekforeman/Wox,yozora-hitagi/Saber,renzhn/Wox,sanbinabu/Wox,jondaniels/Wox,Wox-launcher/Wox
|
Wox.Infrastructure/UserSettings/ProgramSource.cs
|
Wox.Infrastructure/UserSettings/ProgramSource.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Wox.Infrastructure.UserSettings
{
[Serializable]
public class ProgramSource
{
public string Location { get; set; }
public string Type { get; set; }
public int BounsPoints { get; set; }
public bool Enabled { get; set; }
public Dictionary<string, string> Meta { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Wox.Infrastructure.UserSettings
{
[Serializable]
public class ProgramSource
{
public string Location { get; set; }
public string Assembly { get; set; }
public string Type { get; set; }
public int BounsPoints { get; set; }
public bool Enabled { get; set; }
public Dictionary<string, string> Meta { get; set; }
}
}
|
mit
|
C#
|
e357754973b2afa1aa09c80fb87b57106bfed509
|
Update the conneg koans.
|
panesofglass/WebApiKoans
|
Koans/AboutContentNegotiation.cs
|
Koans/AboutContentNegotiation.cs
|
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web.Http;
using FSharpKoans.Core;
namespace Koans
{
/**
* Lesson 5: About Content Negotiation
*
* As noted in the last section, Web API provides an abstraction to run
* content negotiation based on request headers. You are free to change
* this implementation with your own, but for now we'll stick with the
* DefaultContentNegotiator.
*/
[Koan(Sort = 5)]
public static partial class AboutContentNegotiation
{
// Automatic content negotiation
public static void NegotiateXml()
{
using (var config = new HttpConfiguration())
using (var server = new HttpServer(config))
using (var client = new HttpClient(server))
{
TraceConfig.Register(config);
config.Routes.MapHttpRoute("Api", "api");
using (var response = client.GetAsync("http://anything/api/negotiatexml").Result)
{
var body = response.Content.ReadAsAsync<Helpers.FILL_ME_IN>().Result;
Helpers.Assert(body.GetType() == typeof(Helpers.FILL_ME_IN));
}
}
}
}
public class NegotiateXmlController
{
public HttpResponseMessage Get(HttpRequestMessage request)
{
var person = new Person { FirstName = "Brad", LastName = "Wilson" };
// Web API includes a very handy extension method for HttpRequestMessage
// that will automatically perform content negotiation for you.
return request.CreateResponse(HttpStatusCode.OK, person);
}
}
public static partial class AboutContentNegotiation
{
// Manual content negotiation
public static void ManuallyNegotiateXml()
{
using (var config = new HttpConfiguration())
using (var server = new HttpServer(config))
using (var client = new HttpClient(server))
{
TraceConfig.Register(config);
config.Routes.MapHttpRoute("Api", "api");
using (var response = client.GetAsync("http://anything/api/manuallynegotiatexml").Result)
{
var body = response.Content.ReadAsAsync<Person>().Result;
Helpers.Assert(body.GetType() == typeof(Person));
}
}
}
}
public class ManuallyNegotiateXmlController
{
public HttpResponseMessage Get(HttpRequestMessage request)
{
var config = request.GetConfiguration();
// The IContentNegotiator instance is registered with
// the HttpConfiguration. By default, it uses an instance
// of DefaultContentNegotiator.
IContentNegotiator negotiator = config.Services.GetContentNegotiator();
// Negotiate takes the type, the request, and the formatters you
// wish to use. By default, Web API inserts the JsonMediaTypeFormatter
// and XmlMediaTypeFormatter, in that order.
ContentNegotiationResult result =
negotiator.Negotiate(typeof(Helpers.FILL_ME_IN), request, config.Formatters);
var person = new Person { FirstName = "Ryan", LastName = "Riley" };
// Use the ContentNegotiationResult with an ObjectContent to format the object.
var content = new ObjectContent<Person>(person, result.Formatter, result.MediaType);
return new HttpResponseMessage { Content = content };
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FSharpKoans.Core;
namespace Koans
{
/**
* Lesson 5: About Content Negotiation
*
* As noted in the last section, Web API provides an abstraction to run
* content negotiation based on request headers. You are free to change
* this implementation with your own, but for now we'll stick with the
* DefaultContentNegotiator.
*/
[Koan(Sort = 5)]
public static class AboutContentNegotiation
{
// Manual content negotiation
}
}
|
apache-2.0
|
C#
|
fe932f35cc29125102c8467b554d9dd0a102fed9
|
Add TransferProgress.DebuggerDisplay
|
whoisj/libgit2sharp,rcorre/libgit2sharp,GeertvanHorrik/libgit2sharp,jeffhostetler/public_libgit2sharp,jorgeamado/libgit2sharp,PKRoma/libgit2sharp,dlsteuer/libgit2sharp,Skybladev2/libgit2sharp,vivekpradhanC/libgit2sharp,sushihangover/libgit2sharp,GeertvanHorrik/libgit2sharp,ethomson/libgit2sharp,shana/libgit2sharp,AArnott/libgit2sharp,psawey/libgit2sharp,oliver-feng/libgit2sharp,xoofx/libgit2sharp,shana/libgit2sharp,psawey/libgit2sharp,github/libgit2sharp,vorou/libgit2sharp,libgit2/libgit2sharp,vorou/libgit2sharp,nulltoken/libgit2sharp,Zoxive/libgit2sharp,mono/libgit2sharp,dlsteuer/libgit2sharp,ethomson/libgit2sharp,AMSadek/libgit2sharp,Skybladev2/libgit2sharp,jorgeamado/libgit2sharp,vivekpradhanC/libgit2sharp,red-gate/libgit2sharp,OidaTiftla/libgit2sharp,rcorre/libgit2sharp,oliver-feng/libgit2sharp,github/libgit2sharp,whoisj/libgit2sharp,mono/libgit2sharp,OidaTiftla/libgit2sharp,jeffhostetler/public_libgit2sharp,AMSadek/libgit2sharp,sushihangover/libgit2sharp,AArnott/libgit2sharp,xoofx/libgit2sharp,Zoxive/libgit2sharp,red-gate/libgit2sharp,nulltoken/libgit2sharp
|
LibGit2Sharp/TransferProgress.cs
|
LibGit2Sharp/TransferProgress.cs
|
using System.Diagnostics;
using System.Globalization;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// Expose progress values from a fetch operation.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class TransferProgress
{
private GitTransferProgress gitTransferProgress;
/// <summary>
/// Empty constructor.
/// </summary>
protected TransferProgress()
{ }
/// <summary>
/// Constructor.
/// </summary>
internal TransferProgress(GitTransferProgress gitTransferProgress)
{
this.gitTransferProgress = gitTransferProgress;
}
/// <summary>
/// Total number of objects.
/// </summary>
public virtual int TotalObjects
{
get
{
return (int) gitTransferProgress.total_objects;
}
}
/// <summary>
/// Number of objects indexed.
/// </summary>
public virtual int IndexedObjects
{
get
{
return (int) gitTransferProgress.indexed_objects;
}
}
/// <summary>
/// Number of objects received.
/// </summary>
public virtual int ReceivedObjects
{
get
{
return (int) gitTransferProgress.received_objects;
}
}
/// <summary>
/// Number of bytes received.
/// </summary>
public virtual long ReceivedBytes
{
get
{
return (long) gitTransferProgress.received_bytes;
}
}
private string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
"{0}/{1}, {2} bytes", ReceivedObjects, TotalObjects, ReceivedBytes);
}
}
}
}
|
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// Expose progress values from a fetch operation.
/// </summary>
public class TransferProgress
{
private GitTransferProgress gitTransferProgress;
/// <summary>
/// Empty constructor.
/// </summary>
protected TransferProgress()
{ }
/// <summary>
/// Constructor.
/// </summary>
internal TransferProgress(GitTransferProgress gitTransferProgress)
{
this.gitTransferProgress = gitTransferProgress;
}
/// <summary>
/// Total number of objects.
/// </summary>
public virtual int TotalObjects
{
get
{
return (int) gitTransferProgress.total_objects;
}
}
/// <summary>
/// Number of objects indexed.
/// </summary>
public virtual int IndexedObjects
{
get
{
return (int) gitTransferProgress.indexed_objects;
}
}
/// <summary>
/// Number of objects received.
/// </summary>
public virtual int ReceivedObjects
{
get
{
return (int) gitTransferProgress.received_objects;
}
}
/// <summary>
/// Number of bytes received.
/// </summary>
public virtual long ReceivedBytes
{
get
{
return (long) gitTransferProgress.received_bytes;
}
}
}
}
|
mit
|
C#
|
f3ee9930bdf7712025ed5694ad09dbb32bbbefb8
|
Use static factory method for constructing Results class
|
pawotter/mastodon-api-cs
|
Mastodon.API/Entities/Results.cs
|
Mastodon.API/Entities/Results.cs
|
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Mastodon.API
{
/// <summary>
/// Results.
/// https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#results
/// </summary>
public class Results
{
[JsonProperty(PropertyName = "accounts")]
public IList<Account> Accounts { get; set; }
[JsonProperty(PropertyName = "statuses")]
public IList<Status> Statuses { get; set; }
[JsonProperty(PropertyName = "hashtags")]
public IList<string> Hashtags { get; set; }
internal Results() { }
Results(IList<Account> accounts, IList<Status> statuses, IList<string> hashtags)
{
Accounts = accounts;
Statuses = statuses;
Hashtags = hashtags;
}
public static Results create(IList<Account> accounts, IList<Status> statuses, IList<string> hashtags)
{
return new Results(accounts, statuses, hashtags);
}
public override string ToString()
{
return string.Format("[Results: Accounts={0}, Statuses={1}, Hashtags={2}]", Accounts, Statuses, Hashtags);
}
public override bool Equals(object obj)
{
var o = obj as Results;
if (o == null) return false;
return
Object.SequenceEqual(Accounts, o.Accounts) &&
Object.SequenceEqual(Statuses, o.Statuses) &&
Object.SequenceEqual(Hashtags, o.Hashtags);
}
public override int GetHashCode()
{
return Object.GetHashCode(Accounts, Statuses, Hashtags);
}
}
}
|
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Mastodon.API
{
/// <summary>
/// Results.
/// https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#results
/// </summary>
public class Results
{
[JsonProperty(PropertyName = "accounts")]
public IList<Account> Accounts { get; set; }
[JsonProperty(PropertyName = "statuses")]
public IList<Status> Statuses { get; set; }
[JsonProperty(PropertyName = "hashtags")]
public IList<string> Hashtags { get; set; }
public Results(IList<Account> accounts, IList<Status> statuses, IList<string> hashtags)
{
Accounts = accounts;
Statuses = statuses;
Hashtags = hashtags;
}
public override string ToString()
{
return string.Format("[Results: Accounts={0}, Statuses={1}, Hashtags={2}]", Accounts, Statuses, Hashtags);
}
public override bool Equals(object obj)
{
var o = obj as Results;
if (o == null) return false;
return
Object.SequenceEqual(Accounts, o.Accounts) &&
Object.SequenceEqual(Statuses, o.Statuses) &&
Object.SequenceEqual(Hashtags, o.Hashtags);
}
public override int GetHashCode()
{
return Object.GetHashCode(Accounts, Statuses, Hashtags);
}
}
}
|
mit
|
C#
|
a49b48103466b64f811bf3056111e7199330a130
|
Enable named parameters on DB2CoreDriver (#2546)
|
RogerKratz/nhibernate-core,ngbrown/nhibernate-core,gliljas/nhibernate-core,RogerKratz/nhibernate-core,RogerKratz/nhibernate-core,nhibernate/nhibernate-core,hazzik/nhibernate-core,RogerKratz/nhibernate-core,fredericDelaporte/nhibernate-core,gliljas/nhibernate-core,ngbrown/nhibernate-core,hazzik/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,gliljas/nhibernate-core,nhibernate/nhibernate-core,ngbrown/nhibernate-core,gliljas/nhibernate-core,nhibernate/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,nhibernate/nhibernate-core,fredericDelaporte/nhibernate-core
|
src/NHibernate/Driver/DB2CoreDriver.cs
|
src/NHibernate/Driver/DB2CoreDriver.cs
|
using System.Data.Common;
using NHibernate.SqlTypes;
namespace NHibernate.Driver
{
/// <summary>
/// A NHibernate Driver for using the IBM.Data.DB2.Core DataProvider.
/// </summary>
public class DB2CoreDriver : DB2DriverBase
{
public DB2CoreDriver() : base("IBM.Data.DB2.Core")
{
}
public override bool UseNamedPrefixInSql => true;
public override bool UseNamedPrefixInParameter => true;
public override string NamedPrefix => "@";
protected override void InitializeParameter(DbParameter dbParam, string name, SqlType sqlType)
{
dbParam.ParameterName = FormatNameForParameter(name);
base.InitializeParameter(dbParam, name, sqlType);
}
}
}
|
namespace NHibernate.Driver
{
/// <summary>
/// A NHibernate Driver for using the IBM.Data.DB2.Core DataProvider.
/// </summary>
public class DB2CoreDriver : DB2DriverBase
{
public DB2CoreDriver() : base("IBM.Data.DB2.Core")
{
}
}
}
|
lgpl-2.1
|
C#
|
faf1e81d87d976a40253702f1bdd1e3c415de133
|
clean up
|
tainicom/Aether
|
Source/Core/Visual/PointLight.cs
|
Source/Core/Visual/PointLight.cs
|
#region License
// Copyright 2015 Kastellanos Nikolaos
//
// 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.
#endregion
#if WINDOWS
using tainicom.Aether.Design.Converters;
#endif
using System.ComponentModel;
using tainicom.Aether.Elementary.Visual;
using tainicom.Aether.Elementary.Serialization;
using Microsoft.Xna.Framework;
using tainicom.Aether.Elementary.Spatial;
namespace tainicom.Aether.Core.Visual
{
public class PointLight : ILightSource, IPosition, IAetherSerialization
{
public Vector3 Position { get; set; }
#if WINDOWS
[Category("Light"), TypeConverter(typeof(Vector3EditAsColorConverter))]
#endif
public Vector3 LightSourceColor { get; set; }
#if WINDOWS
[Category("Light")]
#endif
public float Intensity { get; set; }
#if WINDOWS
[Category("Light")]
#endif
public float MaximumRadius { get; set; }
public Vector3 PremultiplyColor { get { return this.LightSourceColor * this.Intensity; } }
public PointLight(): base()
{
LightSourceColor = Vector3.One;
Intensity = 1;
MaximumRadius = float.MaxValue;
}
public virtual void Save(IAetherWriter writer)
{
writer.WriteVector3("Position", Position);
writer.WriteVector3("LightSourceColor", LightSourceColor);
writer.WriteFloat("Intensity", Intensity);
writer.WriteFloat("MaximumRadius", MaximumRadius);
}
public virtual void Load(IAetherReader reader)
{
Vector3 v3; float f;
reader.ReadVector3("Position", out v3); Position = v3;
reader.ReadVector3("LightSourceColor", out v3); LightSourceColor = v3;
reader.ReadFloat("Intensity", out f); Intensity = f;
reader.ReadFloat("MaximumRadius", out f); MaximumRadius = f;
}
}
}
|
#region License
// Copyright 2015 Kastellanos Nikolaos
//
// 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.
#endregion
#if WINDOWS
using tainicom.Aether.Design.Converters;
#endif
using System.ComponentModel;
using tainicom.Aether.Elementary.Visual;
using tainicom.Aether.Elementary.Serialization;
using Microsoft.Xna.Framework;
using tainicom.Aether.Elementary.Spatial;
namespace tainicom.Aether.Core.Visual
{
public class PointLight : ILightSource, IPosition, IAetherSerialization
{
public Vector3 Position { get; set; }
#if WINDOWS
[Category("Light"), TypeConverter(typeof(Vector3EditAsColorConverter))]
#endif
public Vector3 LightSourceColor { get; set; }
#if WINDOWS
[Category("Light")]
#endif
public float Intensity { get; set; }
#if WINDOWS
[Category("Light")]
#endif
public float MaximumRadius { get; set; }
public Vector3 PremultiplyColor { get { return this.LightSourceColor * this.Intensity; } }
public PointLight(): base()
{
LightSourceColor = Vector3.One;
Intensity = 1;
MaximumRadius = float.MaxValue;
}
public virtual void Save(IAetherWriter writer)
{
writer.WriteVector3("Position", Position);
writer.WriteVector3("LightSourceColor", LightSourceColor);
writer.WriteFloat("Intensity", Intensity);
writer.WriteFloat("MaximumRadius", MaximumRadius);
}
public virtual void Load(IAetherReader reader)
{
string str; Vector3 v3; float f;
reader.ReadVector3("Position", out v3); Position = v3;
reader.ReadVector3("LightSourceColor", out v3); LightSourceColor = v3;
reader.ReadFloat("Intensity", out f); Intensity = f;
reader.ReadFloat("MaximumRadius", out f); MaximumRadius = f;
}
}
}
|
apache-2.0
|
C#
|
6ab1678aea05e5fd15787e83d4504f94df840435
|
Add nullability for helper extensions
|
MrRoundRobin/telegram.bot
|
src/Telegram.Bot/Helpers/Extensions.cs
|
src/Telegram.Bot/Helpers/Extensions.cs
|
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
namespace Telegram.Bot.Helpers
{
/// <summary>
/// Extension Methods
/// </summary>
internal static class Extensions
{
static string EncodeUtf8(this string value) =>
new(Encoding.UTF8.GetBytes(value).Select(c => Convert.ToChar(c)).ToArray());
internal static void AddStreamContent(this MultipartFormDataContent multipartContent,
Stream content,
string name,
string? fileName = default)
{
fileName ??= name;
var contentDisposition = $@"form-data; name=""{name}""; filename=""{fileName}""".EncodeUtf8();
HttpContent mediaPartContent = new StreamContent(content)
{
Headers =
{
{"Content-Type", "application/octet-stream"},
{"Content-Disposition", contentDisposition}
}
};
multipartContent.Add(mediaPartContent, name, fileName);
}
internal static void AddContentIfInputFileStream(this MultipartFormDataContent multipartContent,
params IInputMedia[] inputMedia)
{
foreach (var input in inputMedia)
{
if (input.Media.FileType == FileType.Stream)
{
multipartContent.AddStreamContent(input.Media.Content, input.Media.FileName);
}
var mediaThumb = (input as IInputMediaThumb)?.Thumb;
if (mediaThumb?.FileType == FileType.Stream)
{
multipartContent.AddStreamContent(mediaThumb.Content, mediaThumb.FileName);
}
}
}
}
}
|
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
namespace Telegram.Bot.Helpers
{
/// <summary>
/// Extension Methods
/// </summary>
internal static class Extensions
{
static string EncodeUtf8(this string value) =>
new(Encoding.UTF8.GetBytes(value).Select(Convert.ToChar).ToArray());
internal static void AddStreamContent(
this MultipartFormDataContent multipartContent,
Stream content,
string name,
string fileName = default)
{
fileName ??= name;
var contentDisposition = $@"form-data; name=""{name}""; filename=""{fileName}""".EncodeUtf8();
HttpContent mediaPartContent = new StreamContent(content)
{
Headers =
{
{"Content-Type", "application/octet-stream"},
{"Content-Disposition", contentDisposition}
}
};
multipartContent.Add(mediaPartContent, name, fileName);
}
internal static void AddContentIfInputFileStream(
this MultipartFormDataContent multipartContent,
params IInputMedia[] inputMedia)
{
foreach (var input in inputMedia)
{
if (input.Media.FileType == FileType.Stream)
{
multipartContent.AddStreamContent(input.Media.Content, input.Media.FileName);
}
var mediaThumb = (input as IInputMediaThumb)?.Thumb;
if (mediaThumb?.FileType == FileType.Stream)
{
multipartContent.AddStreamContent(mediaThumb.Content, mediaThumb.FileName);
}
}
}
}
}
|
mit
|
C#
|
c6d2e2ce6c0aa817e0ae510abda9e887db89324d
|
Add necessary assembly info to project.
|
lijunle/Vsxmd
|
Vsxmd/Properties/AssemblyInfo.cs
|
Vsxmd/Properties/AssemblyInfo.cs
|
//-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Junle Li">
// Copyright (c) Junle Li. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Vsxmd")]
[assembly: AssemblyDescription("VS XML documentation -> Markdown syntax.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Junle Li")]
[assembly: AssemblyProduct("Vsxmd")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("1911d778-b05f-4eac-8fc8-4c2a8fd456ce")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
|
//-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Junle Li">
// Copyright (c) Junle Li. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Vsxmd")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Vsxmd")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("1911d778-b05f-4eac-8fc8-4c2a8fd456ce")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
|
mit
|
C#
|
8391ad96dff001a5d8cdf18e7ab8877b902b1d45
|
Fix build break in vNext (#2352)
|
rrector/orleans,hoopsomuah/orleans,jthelin/orleans,ashkan-saeedi-mazdeh/orleans,MikeHardman/orleans,sergeybykov/orleans,ReubenBond/orleans,Liversage/orleans,yevhen/orleans,jokin/orleans,Carlm-MS/orleans,jokin/orleans,LoveElectronics/orleans,Liversage/orleans,hoopsomuah/orleans,dotnet/orleans,ashkan-saeedi-mazdeh/orleans,centur/orleans,SoftWar1923/orleans,ibondy/orleans,dotnet/orleans,dVakulen/orleans,galvesribeiro/orleans,waynemunro/orleans,rrector/orleans,jokin/orleans,yevhen/orleans,pherbel/orleans,brhinescot/orleans,benjaminpetit/orleans,jdom/orleans,bstauff/orleans,ElanHasson/orleans,jason-bragg/orleans,amccool/orleans,gabikliot/orleans,dVakulen/orleans,gabikliot/orleans,jdom/orleans,brhinescot/orleans,amccool/orleans,shlomiw/orleans,Carlm-MS/orleans,SoftWar1923/orleans,ibondy/orleans,LoveElectronics/orleans,sergeybykov/orleans,bstauff/orleans,shlomiw/orleans,centur/orleans,brhinescot/orleans,ashkan-saeedi-mazdeh/orleans,waynemunro/orleans,dVakulen/orleans,veikkoeeva/orleans,galvesribeiro/orleans,Liversage/orleans,ElanHasson/orleans,amccool/orleans,MikeHardman/orleans,pherbel/orleans
|
vNext/src/Orleans/Shims/RuntimeStatisticsGroup.cs
|
vNext/src/Orleans/Shims/RuntimeStatisticsGroup.cs
|
using System;
namespace Orleans.Runtime
{
internal class RuntimeStatisticsGroup : IDisposable
{
private static readonly Logger logger = LogManager.GetLogger("RuntimeStatisticsGroup", LoggerType.Runtime);
public long MemoryUsage => 0;
public long TotalPhysicalMemory => int.MaxValue;
public long AvailableMemory => TotalPhysicalMemory;
public float CpuUsage => 0;
internal void Start()
{
logger.Warn(ErrorCode.PerfCounterNotRegistered,
"CPU & Memory perf counters are not available in .NET Standard. Load shedding will not work yet");
}
public void Stop()
{
}
public void Dispose()
{
}
}
}
|
namespace Orleans.Runtime
{
internal class RuntimeStatisticsGroup
{
private static readonly Logger logger = LogManager.GetLogger("RuntimeStatisticsGroup", LoggerType.Runtime);
public long MemoryUsage => 0;
public long TotalPhysicalMemory => int.MaxValue;
public long AvailableMemory => TotalPhysicalMemory;
public float CpuUsage => 0;
internal void Start()
{
logger.Warn(ErrorCode.PerfCounterNotRegistered,
"CPU & Memory perf counters are not available in .NET Standard. Load shedding will not work yet");
}
public void Stop()
{
}
}
}
|
mit
|
C#
|
50d520f2176ed864a17b25bc41a496df18c0b83a
|
Revert "Fixed typo in assembly company."
|
HPSoftware/hpaa-octane-dev,HPSoftware/hpaa-octane-dev,HPSoftware/hpaa-octane-dev,HPSoftware/hpaa-octane-dev,HPSoftware/hpaa-octane-dev
|
HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs
|
HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs
|
// (c) Copyright 2012 Hewlett-Packard Development Company, L.P.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System.Reflection;
using System.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("MicroFocusToolsLauncherTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Micro Focus Company")]
[assembly: AssemblyProduct("MicroFocusToolsLauncherTests")]
[assembly: AssemblyCopyright("Copyright © Micro Focus 2018")]
[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("0b4b1757-e8a2-4031-b869-92937d226472")]
// 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.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
// (c) Copyright 2012 Hewlett-Packard Development Company, L.P.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System.Reflection;
using System.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("MicroFocusToolsLauncherTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Micro Focus Company")]
[assembly: AssemblyProduct("MicroFocusToolsLauncherTests")]
[assembly: AssemblyCopyright("Copyright © Micro Focus Company 2018")]
[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("0b4b1757-e8a2-4031-b869-92937d226472")]
// 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.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
7fd99a7e04faddc8530b080c18f7834c101cf2c6
|
Update version in AssemblyInfo
|
vnbaaij/ImageProcessor.Web.Episerver,vnbaaij/ImageProcessor.Web.Episerver,vnbaaij/ImageProcessor.Web.Episerver
|
src/ImageProcessor.Web.Episerver/Properties/AssemblyInfo.cs
|
src/ImageProcessor.Web.Episerver/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("ImageProcessor.Web.Episerver")]
[assembly: AssemblyDescription("Use ImageProcessor in Episerver. Fluent API to manipulate images and generate progressive lazy loading responsive images using picture element")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vincent Baaij")]
[assembly: AssemblyProduct("ImageProcessor.Web.Episerver")]
[assembly: AssemblyCopyright("Copyright 2019")]
[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("2edae29a-d622-4b01-8853-d26f4d1c0fd8")]
// 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.0.0")]
[assembly: AssemblyVersion("5.8.0.*")]
[assembly: AssemblyFileVersion("5.8.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ImageProcessor.Web.Episerver")]
[assembly: AssemblyDescription("Use ImageProcessor in Episerver. Fluent API to manipulate images and generate progressive lazy loading responsive images using picture element")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vincent Baaij")]
[assembly: AssemblyProduct("ImageProcessor.Web.Episerver")]
[assembly: AssemblyCopyright("Copyright 2019")]
[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("2edae29a-d622-4b01-8853-d26f4d1c0fd8")]
// 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.0.0")]
[assembly: AssemblyVersion("5.7.0.*")]
[assembly: AssemblyFileVersion("5.7.0.0")]
|
mit
|
C#
|
61315a01558f7088fd607c879d5c7cf2b95ca1e3
|
Edit Spider confetti
|
NitorInc/NitoriWare,NitorInc/NitoriWare,Barleytree/NitoriWare,Barleytree/NitoriWare
|
Assets/Microgames/Spider/Scripts/SpiderConfetti.cs
|
Assets/Microgames/Spider/Scripts/SpiderConfetti.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpiderConfetti : MonoBehaviour
{
[SerializeField]
private Vector2 valueRange = new Vector2(.7f, .9f);
[SerializeField]
private Vector2 alphaRange = new Vector2(1f, 1f);
private ParticleSystem particles;
void Start()
{
particles = GetComponent<ParticleSystem>();
}
void Update()
{
var main = particles.main;
var color = new HSBColor(Random.Range(0f, 1f), 1f, MathHelper.randomRangeFromVector(valueRange)).ToColor();
color.a = MathHelper.randomRangeFromVector(alphaRange);
main.startColor = color;
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpiderConfetti : MonoBehaviour
{
private ParticleSystem particles;
void Start()
{
particles = GetComponent<ParticleSystem>();
}
void Update()
{
var main = particles.main;
main.startColor = new HSBColor(Random.Range(0f, 1f), 1f, Random.Range(.7f, .9f)).ToColor();
}
}
|
mit
|
C#
|
d49fd7441c52a7562f2fd227f0cd74c267c8719c
|
Add SM name to suta email
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
Battery-Commander.Web/Events/SUTARequestChanged.cs
|
Battery-Commander.Web/Events/SUTARequestChanged.cs
|
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Queries;
using BatteryCommander.Web.Services;
using FluentEmail.Core;
using FluentEmail.Core.Models;
using MediatR;
namespace BatteryCommander.Web.Events
{
public class SUTARequestChanged : INotification
{
public int Id { get; set; }
public string Event { get; set; }
private class Handler : INotificationHandler<SUTARequestChanged>
{
private readonly Database db;
private readonly IMediator dispatcher;
private readonly IFluentEmailFactory emailSvc;
public Handler(Database db, IMediator dispatcher, IFluentEmailFactory emailSvc)
{
this.db = db;
this.dispatcher = dispatcher;
this.emailSvc = emailSvc;
}
public async Task Handle(SUTARequestChanged notification, CancellationToken cancellationToken)
{
var suta = await dispatcher.Send(new GetSUTARequest { Id = notification.Id });
var recipients = new List<Address>();
recipients.AddRange(suta.Supervisor.GetEmails());
foreach (var soldier in await SoldierService.Filter(db, new SoldierService.Query { Ranks = new[] { Rank.E7, Rank.E8, Rank.E9, Rank.O1, Rank.O2, Rank.O3 }, Unit = suta.Soldier.UnitId }))
{
if (soldier.Id == suta.SupervisorId) continue;
recipients.AddRange(soldier.GetEmails());
}
await
emailSvc
.Create()
.To(recipients)
.BCC("SUTAs@RedLeg.app")
.Subject($"{suta.Soldier.Unit.Name} | SUTA Request {suta.Soldier} - {notification.Event}")
.UsingTemplateFromFile($"{Directory.GetCurrentDirectory()}/Views/SUTA/Email.html", suta)
.SendWithErrorCheck();
}
}
}
}
|
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Queries;
using BatteryCommander.Web.Services;
using FluentEmail.Core;
using FluentEmail.Core.Models;
using MediatR;
namespace BatteryCommander.Web.Events
{
public class SUTARequestChanged : INotification
{
public int Id { get; set; }
public string Event { get; set; }
private class Handler : INotificationHandler<SUTARequestChanged>
{
private readonly Database db;
private readonly IMediator dispatcher;
private readonly IFluentEmailFactory emailSvc;
public Handler(Database db, IMediator dispatcher, IFluentEmailFactory emailSvc)
{
this.db = db;
this.dispatcher = dispatcher;
this.emailSvc = emailSvc;
}
public async Task Handle(SUTARequestChanged notification, CancellationToken cancellationToken)
{
var suta = await dispatcher.Send(new GetSUTARequest { Id = notification.Id });
var recipients = new List<Address>();
recipients.AddRange(suta.Supervisor.GetEmails());
foreach (var soldier in await SoldierService.Filter(db, new SoldierService.Query { Ranks = new[] { Rank.E7, Rank.E8, Rank.E9, Rank.O1, Rank.O2, Rank.O3 }, Unit = suta.Soldier.UnitId }))
{
if (soldier.Id == suta.SupervisorId) continue;
recipients.AddRange(soldier.GetEmails());
}
await
emailSvc
.Create()
.To(recipients)
.BCC("SUTAs@RedLeg.app")
.Subject($"{suta.Soldier.Unit.Name} | SUTA Request {notification.Event}")
.UsingTemplateFromFile($"{Directory.GetCurrentDirectory()}/Views/SUTA/Email.html", suta)
.SendWithErrorCheck();
}
}
}
}
|
mit
|
C#
|
388721300611431886c245247a490233b3f3724d
|
Change code to use async defer call for Google Maps
|
Mantus667/GridMaps,Mantus667/GridMaps,Mantus667/GridMaps
|
GridMaps/GridMaps/Render/gridmapsgrideditor.cshtml
|
GridMaps/GridMaps/Render/gridmapsgrideditor.cshtml
|
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
@if (Model.value != null)
{
string value = Model.value.ToString();
var id = string.Format("{0}_map", Guid.NewGuid());
<div class="map gridmaps" id="@id" style="width:100%;"></div>
<script type="text/javascript">
function initializeMap() {
var mapElement = document.getElementById('@id');
var settings = @Html.Raw(value);
var mapCenter = new google.maps.LatLng(settings.latitude, settings.longitude);
mapElement.style.height = settings.height + "px";
var mapOptions = {
zoom: settings.zoom,
center: mapCenter,
mapTypeId: google.maps.MapTypeId[settings.mapType]
};
var map = new google.maps.Map(mapElement, mapOptions);
var marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(settings.latitude, settings.longitude),
draggable: true
});
marker.setMap(map);
}
</script>
}
|
@using System.Web.Mvc.Html
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
@if (Model.value != null)
{
string value = Model.value.ToString();
var id = Guid.NewGuid().ToString() + "_map";
var js_id = id.Replace('-', '_');
<div class="map gridmaps" id="@id" style="width:100%;"></div>
<script type="text/javascript">
var settings = @Html.Raw(value);
var mapCenter = new google.maps.LatLng(settings.latitude, settings.longitude);
var mapElement = document.getElementById('@id');
mapElement.style.height = settings.height + "px";
var mapOptions = {
zoom: settings.zoom,
center: mapCenter,
mapTypeId: google.maps.MapTypeId[settings.mapType]
};
var panoramaOptions = { position: mapCenter };
map = new google.maps.Map(mapElement, mapOptions);
if (settings.streetView) {
var panorama = new google.maps.StreetViewPanorama(mapElement, panoramaOptions);
map.setStreetView(panorama);
}
marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(settings.latitude, settings.longitude),
draggable: true
});
marker.setMap(map);
</script>
}
|
mit
|
C#
|
efbdf5eb7ec84e99247fba7448bee56f0981e0ea
|
Update description of "Path".
|
DheerendraRathor/azure-sdk-for-net,smithab/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AzCiS/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,smithab/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jamestao/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,btasdoven/azure-sdk-for-net,djyou/azure-sdk-for-net,smithab/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,samtoubia/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,djyou/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,shutchings/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,shutchings/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,pankajsn/azure-sdk-for-net,AzCiS/azure-sdk-for-net,begoldsm/azure-sdk-for-net,djyou/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,mihymel/azure-sdk-for-net,atpham256/azure-sdk-for-net,olydis/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,pilor/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,mihymel/azure-sdk-for-net,peshen/azure-sdk-for-net,shutchings/azure-sdk-for-net,nathannfan/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,pilor/azure-sdk-for-net,samtoubia/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,olydis/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,samtoubia/azure-sdk-for-net,nathannfan/azure-sdk-for-net,hyonholee/azure-sdk-for-net,hyonholee/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,btasdoven/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,pankajsn/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,stankovski/azure-sdk-for-net,nathannfan/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,stankovski/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,begoldsm/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,jamestao/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,begoldsm/azure-sdk-for-net,r22016/azure-sdk-for-net,peshen/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,mihymel/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,r22016/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,hyonholee/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,samtoubia/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,pankajsn/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,peshen/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,olydis/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,hyonholee/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,atpham256/azure-sdk-for-net,r22016/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,btasdoven/azure-sdk-for-net,markcowl/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AzCiS/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,atpham256/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,pilor/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net
|
src/ResourceManagement/Resource/Microsoft.Azure.Management.ResourceManager/Generated/Models/AliasPathType.cs
|
src/ResourceManagement/Resource/Microsoft.Azure.Management.ResourceManager/Generated/Models/AliasPathType.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.ResourceManager.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Microsoft.Rest.Azure;
/// <summary>
/// </summary>
public partial class AliasPathType
{
/// <summary>
/// Initializes a new instance of the AliasPathType class.
/// </summary>
public AliasPathType() { }
/// <summary>
/// Initializes a new instance of the AliasPathType class.
/// </summary>
public AliasPathType(string path = default(string), IList<string> apiVersions = default(IList<string>))
{
Path = path;
ApiVersions = apiVersions;
}
/// <summary>
/// The path of an alias.
/// </summary>
[JsonProperty(PropertyName = "path")]
public string Path { get; set; }
/// <summary>
/// The api versions.
/// </summary>
[JsonProperty(PropertyName = "apiVersions")]
public IList<string> ApiVersions { get; set; }
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.ResourceManager.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Microsoft.Rest.Azure;
/// <summary>
/// </summary>
public partial class AliasPathType
{
/// <summary>
/// Initializes a new instance of the AliasPathType class.
/// </summary>
public AliasPathType() { }
/// <summary>
/// Initializes a new instance of the AliasPathType class.
/// </summary>
public AliasPathType(string path = default(string), IList<string> apiVersions = default(IList<string>))
{
Path = path;
ApiVersions = apiVersions;
}
/// <summary>
/// The path.
/// </summary>
[JsonProperty(PropertyName = "path")]
public string Path { get; set; }
/// <summary>
/// The api versions.
/// </summary>
[JsonProperty(PropertyName = "apiVersions")]
public IList<string> ApiVersions { get; set; }
}
}
|
mit
|
C#
|
2df1000c3a273669b6c06012b3f89e0d3fabdbb4
|
Update SimpleEntryAlert.cs
|
Clancey/iOSHelpers
|
iOSHelpers/SimpleEntryAlert.cs
|
iOSHelpers/SimpleEntryAlert.cs
|
using System;
using System.Threading.Tasks;
using UIKit;
namespace iOSHelpers
{
public class SimpleEntryAlert : IDisposable
{
readonly string title;
readonly string details;
readonly string placeholder;
private readonly string defaultValue;
private readonly string okString;
private readonly string cancelString;
UIAlertController alertController;
UIAlertView alertView;
public SimpleEntryAlert(string title, string details = "", string placeholder = "", string defaultValue = "", string okString = "Ok",string cancelString = "Cancel")
{
this.title = title;
this.details = details;
this.placeholder = placeholder;
this.defaultValue = defaultValue;
this.okString = okString;
this.cancelString = cancelString;
alertController = UIAlertController.Create(title, details, UIAlertControllerStyle.Alert);
setupAlertController();
}
void setupAlertController()
{
UITextField entryField = null;
var cancel = UIAlertAction.Create(cancelString, UIAlertActionStyle.Cancel, (alert) => { tcs.TrySetCanceled(); });
var ok = UIAlertAction.Create(okString, UIAlertActionStyle.Default,
a => { tcs.TrySetResult(entryField.Text); });
alertController.AddTextField(field =>
{
field.Placeholder = placeholder;
field.Text = defaultValue;
entryField = field;
});
alertController.AddAction(ok);
alertController.AddAction(cancel);
}
TaskCompletionSource<string> tcs = new TaskCompletionSource<string>();
public Task<string> GetInput(UIViewController fromController)
{
if (alertController != null)
{
fromController.PresentViewControllerAsync(alertController, true);
}
else
{
alertView.Show();
}
return tcs.Task;
}
public void Dispose()
{
alertController?.Dispose();
alertView?.DismissWithClickedButtonIndex(alertView.CancelButtonIndex, true);
alertView?.Dispose();
tcs?.TrySetCanceled();
tcs = null;
}
}
}
|
using System;
using System.Threading.Tasks;
using UIKit;
namespace iOSHelpers
{
public class SimpleEntryAlert : IDisposable
{
readonly string title;
readonly string details;
readonly string placeholder;
private readonly string defaultValue;
UIAlertController alertController;
UIAlertView alertView;
public SimpleEntryAlert(string title, string details = "", string placeholder = "", string defaultValue = "")
{
this.title = title;
this.details = details;
this.placeholder = placeholder;
this.defaultValue = defaultValue;
alertController = UIAlertController.Create(title, details, UIAlertControllerStyle.Alert);
setupAlertController();
}
void setupAlertController()
{
UITextField entryField = null;
var cancel = UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, (alert) => { tcs.TrySetCanceled(); });
var ok = UIAlertAction.Create("Login", UIAlertActionStyle.Default,
a => { tcs.TrySetResult(entryField.Text); });
alertController.AddTextField(field =>
{
field.Placeholder = placeholder;
field.Text = defaultValue;
entryField = field;
});
alertController.AddAction(ok);
alertController.AddAction(cancel);
}
TaskCompletionSource<string> tcs = new TaskCompletionSource<string>();
public Task<string> GetInput(UIViewController fromController)
{
if (alertController != null)
{
fromController.PresentViewControllerAsync(alertController, true);
}
else
{
alertView.Show();
}
return tcs.Task;
}
public void Dispose()
{
alertController?.Dispose();
alertView?.DismissWithClickedButtonIndex(alertView.CancelButtonIndex, true);
alertView?.Dispose();
tcs?.TrySetCanceled();
tcs = null;
}
}
}
|
apache-2.0
|
C#
|
0094c4cf8741dba0f21e95a7aa865d7c6650a124
|
Fix unit test by specifying the font in the test image.
|
jkoritzinsky/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,Perspex/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,akrisiun/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,Perspex/Perspex,jkoritzinsky/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,grokys/Perspex,wieslawsoltes/Perspex,grokys/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia
|
tests/Avalonia.RenderTests/Controls/TextBlockTests.cs
|
tests/Avalonia.RenderTests/Controls/TextBlockTests.cs
|
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;
using Xunit;
#if AVALONIA_SKIA
namespace Avalonia.Skia.RenderTests
#else
namespace Avalonia.Direct2D1.RenderTests.Controls
#endif
{
public class TextBlockTests : TestBase
{
public TextBlockTests()
: base(@"Controls\TextBlock")
{
}
[Fact]
public async Task Wrapping_NoWrap()
{
Decorator target = new Decorator
{
FontFamily = new FontFamily("Courier New"),
Padding = new Thickness(8),
Width = 200,
Height = 200,
Child = new TextBlock
{
Background = Brushes.Red,
FontSize = 12,
Foreground = Brushes.Black,
Text = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit",
VerticalAlignment = VerticalAlignment.Top,
TextWrapping = TextWrapping.NoWrap,
}
};
await RenderToFile(target);
CompareImages();
}
}
}
|
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;
using Xunit;
#if AVALONIA_SKIA
namespace Avalonia.Skia.RenderTests
#else
namespace Avalonia.Direct2D1.RenderTests.Controls
#endif
{
public class TextBlockTests : TestBase
{
public TextBlockTests()
: base(@"Controls\TextBlock")
{
}
[Fact]
public async Task Wrapping_NoWrap()
{
Decorator target = new Decorator
{
Padding = new Thickness(8),
Width = 200,
Height = 200,
Child = new TextBlock
{
Background = Brushes.Red,
FontSize = 12,
Foreground = Brushes.Black,
Text = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit",
VerticalAlignment = VerticalAlignment.Top,
TextWrapping = TextWrapping.NoWrap,
}
};
await RenderToFile(target);
CompareImages();
}
}
}
|
mit
|
C#
|
5e3bd31862c2a754c8b3e5873ddb3988b529de93
|
Delete corrupted downloads after an error
|
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
|
lib/TweetLib.Core/Utils/WebUtils.cs
|
lib/TweetLib.Core/Utils/WebUtils.cs
|
using System;
using System.ComponentModel;
using System.IO;
using System.Net;
namespace TweetLib.Core.Utils{
public static class WebUtils{
private static bool HasMicrosoftBeenBroughtTo2008Yet;
private static void EnsureTLS12(){
if (!HasMicrosoftBeenBroughtTo2008Yet){
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
ServicePointManager.SecurityProtocol &= ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11);
HasMicrosoftBeenBroughtTo2008Yet = true;
}
}
public static WebClient NewClient(string userAgent){
EnsureTLS12();
WebClient client = new WebClient{ Proxy = null };
client.Headers[HttpRequestHeader.UserAgent] = userAgent;
return client;
}
public static AsyncCompletedEventHandler FileDownloadCallback(string file, Action? onSuccess, Action<Exception>? onFailure){
return (sender, args) => {
if (args.Cancelled){
TryDeleteFile(file);
}
else if (args.Error != null){
TryDeleteFile(file);
onFailure?.Invoke(args.Error);
}
else{
onSuccess?.Invoke();
}
};
}
private static void TryDeleteFile(string file){
try{
File.Delete(file);
}catch{
// didn't want it deleted anyways
}
}
}
}
|
using System;
using System.ComponentModel;
using System.IO;
using System.Net;
namespace TweetLib.Core.Utils{
public static class WebUtils{
private static bool HasMicrosoftBeenBroughtTo2008Yet;
private static void EnsureTLS12(){
if (!HasMicrosoftBeenBroughtTo2008Yet){
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
ServicePointManager.SecurityProtocol &= ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11);
HasMicrosoftBeenBroughtTo2008Yet = true;
}
}
public static WebClient NewClient(string userAgent){
EnsureTLS12();
WebClient client = new WebClient{ Proxy = null };
client.Headers[HttpRequestHeader.UserAgent] = userAgent;
return client;
}
public static AsyncCompletedEventHandler FileDownloadCallback(string file, Action? onSuccess, Action<Exception>? onFailure){
return (sender, args) => {
if (args.Cancelled){
try{
File.Delete(file);
}catch{
// didn't want it deleted anyways
}
}
else if (args.Error != null){
onFailure?.Invoke(args.Error);
}
else{
onSuccess?.Invoke();
}
};
}
}
}
|
mit
|
C#
|
d7892f6bad4fc78d7d2fa424480858440c4e5647
|
Fix null reference exception
|
openchargemap/ocm-system,openchargemap/ocm-system,openchargemap/ocm-system,openchargemap/ocm-system
|
API/OCM.Net/OCM.API.Core/Common/Extensions/UserComment.cs
|
API/OCM.Net/OCM.API.Core/Common/Extensions/UserComment.cs
|
using System.Linq;
namespace OCM.API.Common.Model.Extensions
{
public class UserComment
{
public static Model.UserComment FromDataModel(Core.Data.UserComment source, bool isVerboseMode, Model.CoreReferenceData refData = null)
{
var userComment = new Model.UserComment
{
ID = source.Id,
Comment = source.Comment,
Rating = source.Rating,
RelatedURL = source.RelatedUrl,
DateCreated = source.DateCreated,
ChargePointID = source.ChargePointId,
User = User.BasicFromDataModel(source.User),
IsActionedByEditor = source.IsActionedByEditor
};
if (isVerboseMode && refData != null)
{
userComment.CommentType = refData?.UserCommentTypes.FirstOrDefault(i => i.ID == source.UserCommentTypeId) ?? UserCommentType.FromDataModel(source.UserCommentType);
userComment.CommentTypeID = source.UserCommentTypeId;
}
else
{
userComment.CommentTypeID = source.UserCommentTypeId;
}
if (isVerboseMode && (refData != null || source.CheckinStatusType != null) && source.CheckinStatusTypeId!=null)
{
userComment.CheckinStatusType = refData?.CheckinStatusTypes.FirstOrDefault(i => i.ID == source.CheckinStatusTypeId) ?? CheckinStatusType.FromDataModel(source.CheckinStatusType);
userComment.CheckinStatusTypeID = source.CheckinStatusTypeId;
}
else
{
userComment.CheckinStatusTypeID = source.CheckinStatusTypeId;
}
if (userComment.User != null)
{
userComment.UserName = userComment.User.Username;
}
else
{
userComment.UserName = source.UserName;
}
return userComment;
}
}
}
|
using System.Linq;
namespace OCM.API.Common.Model.Extensions
{
public class UserComment
{
public static Model.UserComment FromDataModel(Core.Data.UserComment source, bool isVerboseMode, Model.CoreReferenceData refData = null)
{
var userComment = new Model.UserComment
{
ID = source.Id,
Comment = source.Comment,
Rating = source.Rating,
RelatedURL = source.RelatedUrl,
DateCreated = source.DateCreated,
ChargePointID = source.ChargePointId,
User = User.BasicFromDataModel(source.User),
IsActionedByEditor = source.IsActionedByEditor
};
if (isVerboseMode && refData != null)
{
userComment.CommentType = refData.UserCommentTypes.FirstOrDefault(i => i.ID == source.UserCommentTypeId) ?? UserCommentType.FromDataModel(source.UserCommentType);
userComment.CommentTypeID = source.UserCommentTypeId;
}
else
{
userComment.CommentTypeID = source.UserCommentTypeId;
}
if (isVerboseMode && (refData != null || source.CheckinStatusType != null) && source.CheckinStatusTypeId!=null)
{
userComment.CheckinStatusType = refData.CheckinStatusTypes.FirstOrDefault(i => i.ID == source.CheckinStatusTypeId) ?? CheckinStatusType.FromDataModel(source.CheckinStatusType);
userComment.CheckinStatusTypeID = source.CheckinStatusTypeId;
}
else
{
userComment.CheckinStatusTypeID = source.CheckinStatusTypeId;
}
if (userComment.User != null)
{
userComment.UserName = userComment.User.Username;
}
else
{
userComment.UserName = source.UserName;
}
return userComment;
}
}
}
|
mit
|
C#
|
862a7da755b13ab8f769fc9bebd263ba95dba827
|
Update ServiceProviderExtensions.cs
|
jbattermann/JB.Common
|
JB.Common/ExtensionMethods/ServiceProviderExtensions.cs
|
JB.Common/ExtensionMethods/ServiceProviderExtensions.cs
|
// -----------------------------------------------------------------------
// <copyright file="ServiceProviderExtensions.cs" company="Joerg Battermann">
// Copyright (c) 2015 Joerg Battermann. All rights reserved.
// </copyright>
// <author>Joerg Battermann</author>
// <summary></summary>
// -----------------------------------------------------------------------
using System;
using System.Diagnostics.Contracts;
namespace JB.ExtensionMethods
{
/// <summary>
/// Extension Methods for <see cref="IServiceProvider"/> instances.
/// </summary>
public static class ServiceProviderExtensions
{
/// <summary>
/// Gets the service of the specific type.
/// </summary>
/// <typeparam name="TService">Type of the service</typeparam>
/// <returns></returns>
[Pure]
public static TService GetService<TService>(this IServiceProvider serviceProvider)
{
if (serviceProvider == null) throw new ArgumentNullException(nameof(serviceProvider));
return (TService)serviceProvider.GetService(typeof(TService));
}
/// <summary>
/// Gets the service of the specific type for a given, known implementation.
/// </summary>
/// <typeparam name="TService">The type of the service interface.</typeparam>
/// <typeparam name="TKnownServiceImplementation">The known type of the service implementation.</typeparam>
/// <returns></returns>
[Pure]
public static TKnownServiceImplementation GetService<TService, TKnownServiceImplementation>(this IServiceProvider serviceProvider)
where TKnownServiceImplementation : class, TService
{
if (serviceProvider == null) throw new ArgumentNullException(nameof(serviceProvider));
return serviceProvider.GetService(typeof(TService)) as TKnownServiceImplementation;
}
}
}
|
// -----------------------------------------------------------------------
// <copyright file="ServiceProviderExtensions.cs" company="Joerg Battermann">
// Copyright (c) 2015 Joerg Battermann. All rights reserved.
// </copyright>
// <author>Joerg Battermann</author>
// <summary></summary>
// -----------------------------------------------------------------------
using System;
using System.Diagnostics.Contracts;
namespace JB.ExtensionMethods
{
/// <summary>
/// Extension Methods for <see cref="IServiceProvider"/> instances.
/// </summary>
public static class ServiceProviderExtensions
{
/// <summary>
/// Gets the service of the specific type.
/// </summary>
/// <typeparam name="TService">Type of the service</typeparam>
/// <returns></returns>
[Pure]
public static TService GetService<TService>(this IServiceProvider serviceProvider)
{
if (serviceProvider == null) throw new ArgumentNullException(nameof(serviceProvider));
return (TService)serviceProvider.GetService(typeof(TService));
}
/// <summary>
/// Gets the service of the specific type for a given, known implementation.
/// </summary>
/// <typeparam name="TService">The type of the service interface.</typeparam>
/// <typeparam name="TKnownServiceImplementation">The known type of the service implementation.</typeparam>
/// <returns></returns>
[Pure]
public static TService GetService<TService, TKnownServiceImplementation>(this IServiceProvider serviceProvider)
where TService : class
where TKnownServiceImplementation : TService
{
if (serviceProvider == null) throw new ArgumentNullException(nameof(serviceProvider));
return serviceProvider.GetService(typeof(TKnownServiceImplementation)) as TService;
}
}
}
|
apache-2.0
|
C#
|
5212b013d2a7d0a9101e15e6f86647776422f400
|
Make sure that if our token is canceled, the window immediately closes
|
jochenvangasse/Squirrel.Windows,flagbug/Squirrel.Windows,jochenvangasse/Squirrel.Windows,cguedel/Squirrel.Windows,Suninus/Squirrel.Windows,akrisiun/Squirrel.Windows,cguedel/Squirrel.Windows,ruisebastiao/Squirrel.Windows,allanrsmith/Squirrel.Windows,allanrsmith/Squirrel.Windows,yovannyr/Squirrel.Windows,JonMartinTx/AS400Report,punker76/Squirrel.Windows,JonMartinTx/AS400Report,willdean/Squirrel.Windows,GeertvanHorrik/Squirrel.Windows,BloomBooks/Squirrel.Windows,Squirrel/Squirrel.Windows,Squirrel/Squirrel.Windows,BarryThePenguin/Squirrel.Windows,Katieleeb84/Squirrel.Windows,yovannyr/Squirrel.Windows,hammerandchisel/Squirrel.Windows,sickboy/Squirrel.Windows,kenbailey/Squirrel.Windows,vaginessa/Squirrel.Windows,NeilSorensen/Squirrel.Windows,yovannyr/Squirrel.Windows,bowencode/Squirrel.Windows,EdZava/Squirrel.Windows,BloomBooks/Squirrel.Windows,allanrsmith/Squirrel.Windows,josenbo/Squirrel.Windows,Squirrel/Squirrel.Windows,jbeshir/Squirrel.Windows,airtimemedia/Squirrel.Windows,EdZava/Squirrel.Windows,willdean/Squirrel.Windows,kenbailey/Squirrel.Windows,BloomBooks/Squirrel.Windows,Katieleeb84/Squirrel.Windows,BarryThePenguin/Squirrel.Windows,1gurucoder/Squirrel.Windows,aneeff/Squirrel.Windows,aneeff/Squirrel.Windows,Suninus/Squirrel.Windows,markwal/Squirrel.Windows,awseward/Squirrel.Windows,vaginessa/Squirrel.Windows,markuscarlen/Squirrel.Windows,markuscarlen/Squirrel.Windows,josenbo/Squirrel.Windows,JonMartinTx/AS400Report,1gurucoder/Squirrel.Windows,jbeshir/Squirrel.Windows,NeilSorensen/Squirrel.Windows,GeertvanHorrik/Squirrel.Windows,awseward/Squirrel.Windows,jochenvangasse/Squirrel.Windows,markwal/Squirrel.Windows,ruisebastiao/Squirrel.Windows,airtimemedia/Squirrel.Windows,sickboy/Squirrel.Windows,cguedel/Squirrel.Windows,bowencode/Squirrel.Windows,punker76/Squirrel.Windows,awseward/Squirrel.Windows,hammerandchisel/Squirrel.Windows,airtimemedia/Squirrel.Windows,GeertvanHorrik/Squirrel.Windows,Katieleeb84/Squirrel.Windows,aneeff/Squirrel.Windows,punker76/Squirrel.Windows,jbeshir/Squirrel.Windows,josenbo/Squirrel.Windows,flagbug/Squirrel.Windows,NeilSorensen/Squirrel.Windows,EdZava/Squirrel.Windows,vaginessa/Squirrel.Windows,1gurucoder/Squirrel.Windows,markuscarlen/Squirrel.Windows,willdean/Squirrel.Windows,Suninus/Squirrel.Windows,ChaseFlorell/Squirrel.Windows,flagbug/Squirrel.Windows,ChaseFlorell/Squirrel.Windows,markwal/Squirrel.Windows,bowencode/Squirrel.Windows,ruisebastiao/Squirrel.Windows,sickboy/Squirrel.Windows,hammerandchisel/Squirrel.Windows,ChaseFlorell/Squirrel.Windows,BarryThePenguin/Squirrel.Windows,kenbailey/Squirrel.Windows
|
src/Update/AnimatedGifWindow.cs
|
src/Update/AnimatedGifWindow.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using WpfAnimatedGif;
namespace Squirrel.Update
{
public class AnimatedGifWindow : Window
{
public AnimatedGifWindow()
{
var src = new BitmapImage();
src.BeginInit();
var source = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"background.gif");
if (File.Exists(source)) {
src.StreamSource = File.OpenRead(source);
}
src.EndInit();
var img = new Image();
ImageBehavior.SetAnimatedSource(img, src);
this.Content = img;
this.Width = src.Width;
this.Height = src.Height;
this.AllowsTransparency = true;
this.WindowStyle = WindowStyle.None;
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
this.ShowInTaskbar = false;
this.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
}
public static void ShowWindow(TimeSpan initialDelay, CancellationToken token)
{
var wnd = default(AnimatedGifWindow);
var thread = new Thread(() => {
if (token.IsCancellationRequested) return;
try {
Task.Delay(initialDelay, token).ContinueWith(t => { return true; }).Wait();
} catch (Exception) {
return;
}
wnd = new AnimatedGifWindow();
wnd.Show();
token.Register(() => wnd.Dispatcher.BeginInvoke(new Action(wnd.Close)));
(new Application()).Run(wnd);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using WpfAnimatedGif;
namespace Squirrel.Update
{
public class AnimatedGifWindow : Window
{
public AnimatedGifWindow()
{
var src = new BitmapImage();
src.BeginInit();
var source = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"background.gif");
if (File.Exists(source)) {
src.StreamSource = File.OpenRead(source);
}
src.EndInit();
var img = new Image();
ImageBehavior.SetAnimatedSource(img, src);
this.Content = img;
this.Width = src.Width;
this.Height = src.Height;
this.AllowsTransparency = true;
this.WindowStyle = WindowStyle.None;
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
this.ShowInTaskbar = false;
this.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
}
public static void ShowWindow(TimeSpan initialDelay, CancellationToken token)
{
var wnd = default(AnimatedGifWindow);
var thread = new Thread(() => {
try {
Task.Delay(initialDelay, token).Wait();
} catch (OperationCanceledException) {
return;
}
wnd = new AnimatedGifWindow();
wnd.Show();
token.Register(() => wnd.Dispatcher.BeginInvoke(new Action(wnd.Close)));
(new Application()).Run(wnd);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
}
}
|
mit
|
C#
|
8a79781842a4d566c064aa844242b2448f4327ee
|
Remove meta charset from fortunes in ASP.NET
|
Rayne/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zapov/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,zapov/FrameworkBenchmarks,zloster/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,actframework/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,grob/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jamming/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,actframework/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,testn/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,methane/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,doom369/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,sgml/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,valyala/FrameworkBenchmarks,khellang/FrameworkBenchmarks,testn/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,jamming/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,grob/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zloster/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,khellang/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,joshk/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,valyala/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,jamming/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,valyala/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,jamming/FrameworkBenchmarks,zloster/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,Verber/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,denkab/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,testn/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,grob/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,khellang/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,methane/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,herloct/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,valyala/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,joshk/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,herloct/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,denkab/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,denkab/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,grob/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,actframework/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,sgml/FrameworkBenchmarks,denkab/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,joshk/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,valyala/FrameworkBenchmarks,grob/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,methane/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,denkab/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,sxend/FrameworkBenchmarks,methane/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,testn/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,sxend/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,zloster/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,sxend/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,grob/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,doom369/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,khellang/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,denkab/FrameworkBenchmarks,actframework/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,sgml/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,valyala/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,herloct/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,valyala/FrameworkBenchmarks,sgml/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,khellang/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,zapov/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,jamming/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,doom369/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,denkab/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,sgml/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,herloct/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,valyala/FrameworkBenchmarks,methane/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,testn/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,doom369/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,Verber/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,testn/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,valyala/FrameworkBenchmarks,zapov/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,doom369/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,valyala/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,Verber/FrameworkBenchmarks,joshk/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,zloster/FrameworkBenchmarks,grob/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,khellang/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,herloct/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,Verber/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,sxend/FrameworkBenchmarks,grob/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,testn/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,valyala/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,sgml/FrameworkBenchmarks,actframework/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,sgml/FrameworkBenchmarks,joshk/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,actframework/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,testn/FrameworkBenchmarks,methane/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,sxend/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,valyala/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,jamming/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,actframework/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,Verber/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,methane/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,zloster/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,zloster/FrameworkBenchmarks,joshk/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,doom369/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,Verber/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,khellang/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,herloct/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Verber/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,khellang/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,zapov/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,doom369/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,denkab/FrameworkBenchmarks,joshk/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,actframework/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,jamming/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,denkab/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,joshk/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,grob/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,herloct/FrameworkBenchmarks,actframework/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,doom369/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,zapov/FrameworkBenchmarks,sxend/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,joshk/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,actframework/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,Verber/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,denkab/FrameworkBenchmarks,actframework/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,testn/FrameworkBenchmarks,zapov/FrameworkBenchmarks,Verber/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,zloster/FrameworkBenchmarks,valyala/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,zloster/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,joshk/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,jamming/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,jamming/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,actframework/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,actframework/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,actframework/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,grob/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,zloster/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,valyala/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,grob/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,Verber/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,zloster/FrameworkBenchmarks,doom369/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,sxend/FrameworkBenchmarks,doom369/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,sgml/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,methane/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,methane/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,methane/FrameworkBenchmarks,grob/FrameworkBenchmarks,herloct/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,sxend/FrameworkBenchmarks,sxend/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,jamming/FrameworkBenchmarks,zapov/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,methane/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,khellang/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,joshk/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,zloster/FrameworkBenchmarks,herloct/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,denkab/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,sgml/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,khellang/FrameworkBenchmarks,herloct/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,doom369/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,joshk/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,zloster/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,denkab/FrameworkBenchmarks,khellang/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,jamming/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,denkab/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,grob/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,zapov/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,zapov/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,methane/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,sxend/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,doom369/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,herloct/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,testn/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,grob/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,zloster/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,psfblair/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,actframework/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,testn/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,Verber/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,k-r-g/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,khellang/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,zapov/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,testn/FrameworkBenchmarks,Verber/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,sgml/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,sgml/FrameworkBenchmarks,sgml/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,doom369/FrameworkBenchmarks,joshk/FrameworkBenchmarks,joshk/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,methane/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,khellang/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,sgml/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,denkab/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,zapov/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,zloster/FrameworkBenchmarks,doom369/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,Verber/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,alubbe/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,doom369/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,zloster/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,testn/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,testn/FrameworkBenchmarks,herloct/FrameworkBenchmarks,jamming/FrameworkBenchmarks,sgml/FrameworkBenchmarks,actframework/FrameworkBenchmarks,greg-hellings/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,zane-techempower/FrameworkBenchmarks,khellang/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,jebbstewart/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,herloct/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,herloct/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,Verber/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,herloct/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,jamming/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,zapov/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,zapov/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,doom369/FrameworkBenchmarks,methane/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,sagenschneider/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,hperadin/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,jamming/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,fabianmurariu/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,sxend/FrameworkBenchmarks,zloster/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,martin-g/FrameworkBenchmarks,doom369/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks
|
frameworks/CSharp/aspnet/src/Views/Fortunes.cshtml
|
frameworks/CSharp/aspnet/src/Views/Fortunes.cshtml
|
@model IEnumerable<Benchmarks.AspNet.Models.Fortune>
<!DOCTYPE html>
<html>
<head>
<title>Fortunes</title>
</head>
<body>
<table>
<tr>
<th>id</th>
<th>message</th>
</tr>
@foreach (var fortune in Model)
{
<tr>
<td>@fortune.ID</td>
<td>@fortune.Message</td>
</tr>
}
</table>
</body>
</html>
|
@model IEnumerable<Benchmarks.AspNet.Models.Fortune>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Fortunes</title>
</head>
<body>
<table>
<tr>
<th>id</th>
<th>message</th>
</tr>
@foreach (var fortune in Model)
{
<tr>
<td>@fortune.ID</td>
<td>@fortune.Message</td>
</tr>
}
</table>
</body>
</html>
|
bsd-3-clause
|
C#
|
7dde2f1f4c8e5f2b06d67a362752bb529a816b68
|
Change variable name per review request
|
chkr1011/MQTTnet,chkr1011/MQTTnet,chkr1011/MQTTnet,chkr1011/MQTTnet,chkr1011/MQTTnet
|
Source/MQTTnet/Adapter/MqttConnectingFailedException.cs
|
Source/MQTTnet/Adapter/MqttConnectingFailedException.cs
|
using MQTTnet.Client.Connecting;
using MQTTnet.Exceptions;
namespace MQTTnet.Adapter
{
public class MqttConnectingFailedException : MqttCommunicationException
{
public MqttConnectingFailedException(MqttClientAuthenticateResult result)
: base($"Connecting with MQTT server failed ({result.ResultCode.ToString()}).")
{
Result = result;
}
public MqttClientAuthenticateResult Result { get; }
public MqttClientConnectResultCode ResultCode => Result.ResultCode;
}
}
|
using MQTTnet.Client.Connecting;
using MQTTnet.Exceptions;
namespace MQTTnet.Adapter
{
public class MqttConnectingFailedException : MqttCommunicationException
{
public MqttConnectingFailedException(MqttClientAuthenticateResult resultCode)
: base($"Connecting with MQTT server failed ({resultCode.ResultCode.ToString()}).")
{
Result = resultCode;
}
public MqttClientAuthenticateResult Result { get; }
public MqttClientConnectResultCode ResultCode => Result.ResultCode;
}
}
|
mit
|
C#
|
f684807d9eac91d9d93b68048c8e3f79c96b4884
|
Delete dead method
|
mattscheffer/roslyn,MichalStrehovsky/roslyn,sharwell/roslyn,Hosch250/roslyn,paulvanbrenk/roslyn,genlu/roslyn,bkoelman/roslyn,jasonmalinowski/roslyn,DustinCampbell/roslyn,tmeschter/roslyn,brettfo/roslyn,gafter/roslyn,diryboy/roslyn,genlu/roslyn,KirillOsenkov/roslyn,reaction1989/roslyn,weltkante/roslyn,jmarolf/roslyn,diryboy/roslyn,Giftednewt/roslyn,eriawan/roslyn,wvdd007/roslyn,AlekseyTs/roslyn,brettfo/roslyn,abock/roslyn,aelij/roslyn,jasonmalinowski/roslyn,DustinCampbell/roslyn,shyamnamboodiripad/roslyn,gafter/roslyn,Hosch250/roslyn,tmeschter/roslyn,gafter/roslyn,mattscheffer/roslyn,jcouv/roslyn,tmat/roslyn,bartdesmet/roslyn,dotnet/roslyn,VSadov/roslyn,agocke/roslyn,jcouv/roslyn,genlu/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,VSadov/roslyn,abock/roslyn,davkean/roslyn,mavasani/roslyn,tmat/roslyn,xasx/roslyn,wvdd007/roslyn,weltkante/roslyn,CyrusNajmabadi/roslyn,orthoxerox/roslyn,physhi/roslyn,davkean/roslyn,tmat/roslyn,eriawan/roslyn,jamesqo/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,mgoertz-msft/roslyn,aelij/roslyn,swaroop-sridhar/roslyn,sharwell/roslyn,heejaechang/roslyn,MichalStrehovsky/roslyn,mgoertz-msft/roslyn,VSadov/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,nguerrera/roslyn,jasonmalinowski/roslyn,nguerrera/roslyn,lorcanmooney/roslyn,AlekseyTs/roslyn,dotnet/roslyn,ErikSchierboom/roslyn,orthoxerox/roslyn,CyrusNajmabadi/roslyn,tmeschter/roslyn,mavasani/roslyn,AmadeusW/roslyn,tannergooding/roslyn,reaction1989/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,stephentoub/roslyn,abock/roslyn,KevinRansom/roslyn,stephentoub/roslyn,eriawan/roslyn,sharwell/roslyn,OmarTawfik/roslyn,ErikSchierboom/roslyn,OmarTawfik/roslyn,heejaechang/roslyn,jamesqo/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,swaroop-sridhar/roslyn,lorcanmooney/roslyn,khyperia/roslyn,panopticoncentral/roslyn,nguerrera/roslyn,bartdesmet/roslyn,stephentoub/roslyn,reaction1989/roslyn,orthoxerox/roslyn,KirillOsenkov/roslyn,physhi/roslyn,mattscheffer/roslyn,tannergooding/roslyn,swaroop-sridhar/roslyn,Giftednewt/roslyn,panopticoncentral/roslyn,mavasani/roslyn,lorcanmooney/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,ErikSchierboom/roslyn,dpoeschl/roslyn,Hosch250/roslyn,AmadeusW/roslyn,dpoeschl/roslyn,dpoeschl/roslyn,cston/roslyn,paulvanbrenk/roslyn,cston/roslyn,AlekseyTs/roslyn,DustinCampbell/roslyn,weltkante/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,wvdd007/roslyn,diryboy/roslyn,agocke/roslyn,tannergooding/roslyn,khyperia/roslyn,KirillOsenkov/roslyn,khyperia/roslyn,cston/roslyn,physhi/roslyn,Giftednewt/roslyn,jamesqo/roslyn,bkoelman/roslyn,paulvanbrenk/roslyn,agocke/roslyn,jmarolf/roslyn,aelij/roslyn,davkean/roslyn,jmarolf/roslyn,MichalStrehovsky/roslyn,bkoelman/roslyn,jcouv/roslyn,KevinRansom/roslyn,xasx/roslyn,OmarTawfik/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,heejaechang/roslyn,xasx/roslyn
|
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Presentation/CompletionPresenter.cs
|
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Presentation/CompletionPresenter.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.Linq;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation
{
[Export(typeof(IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>))]
[Export(typeof(ICompletionSourceProvider))]
[Name(PredefinedCompletionPresenterNames.RoslynCompletionPresenter)]
[ContentType(ContentTypeNames.RoslynContentType)]
internal sealed class CompletionPresenter : ForegroundThreadAffinitizedObject, IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>, ICompletionSourceProvider
{
private readonly ICompletionBroker _completionBroker;
private readonly IGlyphService _glyphService;
[ImportingConstructor]
public CompletionPresenter(
ICompletionBroker completionBroker,
IGlyphService glyphService)
{
_completionBroker = completionBroker;
_glyphService = glyphService;
}
ICompletionPresenterSession IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>.CreateSession(
ITextView textView, ITextBuffer subjectBuffer, ICompletionSession session)
{
AssertIsForeground();
var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
return new CompletionPresenterSession(
_completionBroker, _glyphService, textView, subjectBuffer);
}
ICompletionSource ICompletionSourceProvider.TryCreateCompletionSource(ITextBuffer textBuffer)
{
AssertIsForeground();
return new CompletionSource();
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.Linq;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation
{
[Export(typeof(IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>))]
[Export(typeof(ICompletionSourceProvider))]
[Name(PredefinedCompletionPresenterNames.RoslynCompletionPresenter)]
[ContentType(ContentTypeNames.RoslynContentType)]
internal sealed class CompletionPresenter : ForegroundThreadAffinitizedObject, IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>, ICompletionSourceProvider
{
private readonly ICompletionBroker _completionBroker;
private readonly IGlyphService _glyphService;
[ImportingConstructor]
public CompletionPresenter(
ICompletionBroker completionBroker,
IGlyphService glyphService)
{
_completionBroker = completionBroker;
_glyphService = glyphService;
}
ICompletionPresenterSession IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>.CreateSession(
ITextView textView, ITextBuffer subjectBuffer, ICompletionSession session)
{
AssertIsForeground();
var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
return new CompletionPresenterSession(
_completionBroker, _glyphService, textView, subjectBuffer);
}
private bool NeedsDev15CompletionSetFactory(OptionSet options, string language)
{
return CompletionOptions.GetDev15CompletionOptions().Any(
o => options.GetOption(o, language));
}
ICompletionSource ICompletionSourceProvider.TryCreateCompletionSource(ITextBuffer textBuffer)
{
AssertIsForeground();
return new CompletionSource();
}
}
}
|
mit
|
C#
|
9fc115a174c53a756dbec2f5d9910284fea15ef1
|
Update src/Workspaces/Core/Portable/Workspace/Host/PersistentStorage/IPersistentStorageLocationService.cs
|
KirillOsenkov/roslyn,agocke/roslyn,ErikSchierboom/roslyn,aelij/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,tannergooding/roslyn,abock/roslyn,jmarolf/roslyn,AlekseyTs/roslyn,wvdd007/roslyn,KevinRansom/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,physhi/roslyn,diryboy/roslyn,diryboy/roslyn,mgoertz-msft/roslyn,diryboy/roslyn,sharwell/roslyn,KirillOsenkov/roslyn,mavasani/roslyn,dotnet/roslyn,eriawan/roslyn,KirillOsenkov/roslyn,agocke/roslyn,jasonmalinowski/roslyn,KevinRansom/roslyn,stephentoub/roslyn,gafter/roslyn,dotnet/roslyn,heejaechang/roslyn,mavasani/roslyn,tannergooding/roslyn,CyrusNajmabadi/roslyn,ErikSchierboom/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,jmarolf/roslyn,tmat/roslyn,KevinRansom/roslyn,gafter/roslyn,aelij/roslyn,davkean/roslyn,bartdesmet/roslyn,wvdd007/roslyn,aelij/roslyn,brettfo/roslyn,AmadeusW/roslyn,wvdd007/roslyn,weltkante/roslyn,bartdesmet/roslyn,ErikSchierboom/roslyn,davkean/roslyn,genlu/roslyn,heejaechang/roslyn,genlu/roslyn,genlu/roslyn,panopticoncentral/roslyn,abock/roslyn,tmat/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,sharwell/roslyn,abock/roslyn,reaction1989/roslyn,stephentoub/roslyn,agocke/roslyn,sharwell/roslyn,weltkante/roslyn,AlekseyTs/roslyn,shyamnamboodiripad/roslyn,physhi/roslyn,reaction1989/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,CyrusNajmabadi/roslyn,AmadeusW/roslyn,CyrusNajmabadi/roslyn,brettfo/roslyn,eriawan/roslyn,reaction1989/roslyn,AlekseyTs/roslyn,dotnet/roslyn,heejaechang/roslyn,mgoertz-msft/roslyn,tannergooding/roslyn,stephentoub/roslyn,jmarolf/roslyn,davkean/roslyn,gafter/roslyn,eriawan/roslyn,tmat/roslyn,physhi/roslyn,panopticoncentral/roslyn
|
src/Workspaces/Core/Portable/Workspace/Host/PersistentStorage/IPersistentStorageLocationService.cs
|
src/Workspaces/Core/Portable/Workspace/Host/PersistentStorage/IPersistentStorageLocationService.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.
#nullable enable
using System;
using System.Composition;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Host
{
interface IPersistentStorageLocationService : IWorkspaceService
{
bool IsSupported(Workspace workspace);
string? TryGetStorageLocation(Solution solution);
}
[ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
internal class DefaultPersistentStorageLocationService : IPersistentStorageLocationService
{
[ImportingConstructor]
public DefaultPersistentStorageLocationService()
{
}
public virtual bool IsSupported(Workspace workspace) => false;
public string? TryGetStorageLocation(Solution solution)
{
if (!IsSupported(solution.Workspace))
return null;
if (string.IsNullOrWhiteSpace(solution.FilePath))
return null;
// Ensure that each unique workspace kind for any given solution has a unique
// folder to store their data in.
// Store in the LocalApplicationData/Roslyn/hash folder (%appdatalocal%/... on Windows,
// ~/.local/share/... on unix). This will place the folder in a location we can trust
// to be able to get back to consistently as long as we're working with the same
// solution and the same workspace kind.
var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
var kind = StripInvalidPathChars(solution.Workspace.Kind ?? "");
var hash = StripInvalidPathChars(Checksum.Create(solution.FilePath).ToString());
return Path.Combine(appDataFolder, "Microsoft", "VisualStudio", "Roslyn", "Cache", kind, hash);
static string StripInvalidPathChars(string val)
{
var invalidPathChars = Path.GetInvalidPathChars();
val = new string(val.Where(c => !invalidPathChars.Contains(c)).ToArray());
return string.IsNullOrWhiteSpace(val) ? "None" : val;
}
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullable enable
using System;
using System.Composition;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Host
{
interface IPersistentStorageLocationService : IWorkspaceService
{
bool IsSupported(Workspace workspace);
string? TryGetStorageLocation(Solution solution);
}
[ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
internal class DefaultPersistentStorageLocationService : IPersistentStorageLocationService
{
[ImportingConstructor]
public DefaultPersistentStorageLocationService()
{
}
public virtual bool IsSupported(Workspace workspace) => false;
public string? TryGetStorageLocation(Solution solution)
{
if (!IsSupported(solution.Workspace))
return null;
if (string.IsNullOrWhiteSpace(solution.FilePath))
return null;
// Ensure that each unique workspace kind for any given solution has a unique
// folder to store their data in.
// Store in the LocalApplicationData/Roslyn/hash folder (%appdatalocal%/... on Windows,
// ~/.local/share/... on unix). This will place the folder in a location we can trust
// to be able to get back to consistently as long as we're working with the same
// solution and the same workspace kind.
var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
var kind = StripInvalidPathChars(solution.Workspace.Kind ?? "");
var hash = StripInvalidPathChars(Checksum.Create(solution.FilePath).ToString());
return Path.Combine(appDataFolder, "Roslyn", "Cache", kind, hash);
static string StripInvalidPathChars(string val)
{
var invalidPathChars = Path.GetInvalidPathChars();
val = new string(val.Where(c => !invalidPathChars.Contains(c)).ToArray());
return string.IsNullOrWhiteSpace(val) ? "None" : val;
}
}
}
}
|
mit
|
C#
|
5e3b7204089a68aeb1032eac6fe26897c4fc3ec0
|
Remove invalid method and P/Invoke in TextProperty
|
akrisiun/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,Gankov/gtk-sharp,sillsdev/gtk-sharp,sillsdev/gtk-sharp,Gankov/gtk-sharp,akrisiun/gtk-sharp,antoniusriha/gtk-sharp,openmedicus/gtk-sharp,orion75/gtk-sharp,openmedicus/gtk-sharp,openmedicus/gtk-sharp,antoniusriha/gtk-sharp,openmedicus/gtk-sharp,orion75/gtk-sharp,Gankov/gtk-sharp,akrisiun/gtk-sharp,antoniusriha/gtk-sharp,sillsdev/gtk-sharp,orion75/gtk-sharp,openmedicus/gtk-sharp,orion75/gtk-sharp,sillsdev/gtk-sharp,sillsdev/gtk-sharp,Gankov/gtk-sharp,orion75/gtk-sharp,antoniusriha/gtk-sharp,openmedicus/gtk-sharp,akrisiun/gtk-sharp,akrisiun/gtk-sharp,antoniusriha/gtk-sharp,Gankov/gtk-sharp
|
gdk/TextProperty.cs
|
gdk/TextProperty.cs
|
// Gdk.Text.cs - Custom implementation for Text class
//
// Authors: Mike Kestner <mkestner@ximian.com>
//
// Copyright (c) 2004 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
namespace Gdk {
using System;
using System.Runtime.InteropServices;
public class TextProperty {
[DllImport ("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int gdk_text_property_to_utf8_list_for_display(IntPtr display, IntPtr encoding, int format, byte[] text, int length, out IntPtr list);
public static string[] ToStringListForDisplay (Gdk.Display display, Gdk.Atom encoding, int format, byte[] text, int length)
{
IntPtr list_ptr;
int count = gdk_text_property_to_utf8_list_for_display (display.Handle, encoding.Handle, format, text, length, out list_ptr);
if (count == 0)
return new string [0];
string[] result = new string [count];
for (int i = 0; i < count; i++) {
IntPtr ptr = Marshal.ReadIntPtr (list_ptr, i * IntPtr.Size);
result [i] = GLib.Marshaller.Utf8PtrToString (ptr);
}
GLib.Marshaller.StrFreeV (list_ptr);
return result;
}
}
}
|
// Gdk.Text.cs - Custom implementation for Text class
//
// Authors: Mike Kestner <mkestner@ximian.com>
//
// Copyright (c) 2004 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
namespace Gdk {
using System;
using System.Runtime.InteropServices;
public class TextProperty {
[DllImport ("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_free_text_list(IntPtr ptr);
[DllImport ("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int gdk_text_property_to_utf8_list(IntPtr encoding, int format, byte[] text, int length, out IntPtr list);
public static string[] ToStringList (Gdk.Atom encoding, int format, byte[] text, int length)
{
IntPtr list_ptr;
int count = gdk_text_property_to_utf8_list(encoding.Handle, format, text, length, out list_ptr);
if (count == 0)
return new string [0];
string[] result = new string [count];
for (int i = 0; i < count; i++) {
IntPtr ptr = Marshal.ReadIntPtr (list_ptr, i * IntPtr.Size);
result [i] = GLib.Marshaller.Utf8PtrToString (ptr);
}
gdk_free_text_list (list_ptr);
return result;
}
[DllImport ("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int gdk_text_property_to_utf8_list_for_display(IntPtr display, IntPtr encoding, int format, byte[] text, int length, out IntPtr list);
public static string[] ToStringListForDisplay (Gdk.Display display, Gdk.Atom encoding, int format, byte[] text, int length)
{
IntPtr list_ptr;
int count = gdk_text_property_to_utf8_list_for_display (display.Handle, encoding.Handle, format, text, length, out list_ptr);
if (count == 0)
return new string [0];
string[] result = new string [count];
for (int i = 0; i < count; i++) {
IntPtr ptr = Marshal.ReadIntPtr (list_ptr, i * IntPtr.Size);
result [i] = GLib.Marshaller.Utf8PtrToString (ptr);
}
gdk_free_text_list (list_ptr);
return result;
}
}
}
|
lgpl-2.1
|
C#
|
17ef9600e55d520795e648ca93253c47adcb8d98
|
Clean diffs
|
bbqchickenrobot/Eto-1,l8s/Eto,l8s/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto,PowerOfCode/Eto,PowerOfCode/Eto,l8s/Eto,bbqchickenrobot/Eto-1
|
Source/Eto.Platform.Windows/Forms/DockLayoutHandler.cs
|
Source/Eto.Platform.Windows/Forms/DockLayoutHandler.cs
|
using System;
using SD = System.Drawing;
using SWF = System.Windows.Forms;
using Eto.Forms;
using Eto.Drawing;
namespace Eto.Platform.Windows
{
public class DockLayoutHandler : WindowsLayout<SWF.TableLayoutPanel, DockLayout>, IDockLayout
{
Control child;
Padding padding;
public DockLayoutHandler ()
{
padding = DockLayout.DefaultPadding;
Control = new SWF.TableLayoutPanel {
Dock = SWF.DockStyle.Fill,
RowCount = 1,
ColumnCount = 1,
Size = SD.Size.Empty,
AutoSizeMode = SWF.AutoSizeMode.GrowAndShrink,
AutoSize = true
};
Control.ColumnStyles.Add (new SWF.ColumnStyle (SWF.SizeType.Percent, 1));
Control.RowStyles.Add (new SWF.RowStyle (SWF.SizeType.Percent, 1));
Padding = DockLayout.DefaultPadding;
}
public override object LayoutObject
{
get { return Control; }
}
public override Size DesiredSize
{
get {
if (child != null)
{
var handler = child.Handler as IWindowsControl;
if (handler != null)
return handler.DesiredSize;
}
var container = Widget.Container.GetContainerControl();
return container != null ? container.PreferredSize.ToEto () : Size.Empty;
}
}
public override void SetScale (bool xscale, bool yscale)
{
base.SetScale (xscale, yscale);
if (child != null)
child.SetScale (xscale, yscale);
}
public Padding Padding {
get { return Control.Padding.ToEto (); }
set { Control.Padding = value.ToSWF (); }
}
public Control Content {
get { return child; }
set {
if (child == value)
return;
Control.SuspendLayout ();
SWF.Control childControl;
if (value != null) {
childControl = value.GetContainerControl();
childControl.Dock = SWF.DockStyle.Fill;
value.SetScale (XScale, YScale);
Control.Controls.Add (childControl, 0, 0);
}
if (this.child != null) {
child.SetScale (false, false);
childControl = this.child.GetContainerControl ();
Control.Controls.Remove (childControl);
}
this.child = value;
Control.ResumeLayout ();
}
}
}
}
|
using System;
using SD = System.Drawing;
using SWF = System.Windows.Forms;
using Eto.Forms;
using Eto.Drawing;
namespace Eto.Platform.Windows
{
public class DockLayoutHandler : WindowsLayout<SWF.TableLayoutPanel, DockLayout>, IDockLayout
{
Control child;
Padding padding;
public DockLayoutHandler ()
{
padding = DockLayout.DefaultPadding;
Control = new SWF.TableLayoutPanel {
Dock = SWF.DockStyle.Fill,
RowCount = 1,
ColumnCount = 1,
Size = SD.Size.Empty,
AutoSizeMode = SWF.AutoSizeMode.GrowAndShrink,
AutoSize = true
};
Control.ColumnStyles.Add (new SWF.ColumnStyle (SWF.SizeType.Percent, 1));
Control.RowStyles.Add (new SWF.RowStyle (SWF.SizeType.Percent, 1));
Padding = DockLayout.DefaultPadding;
}
public override object LayoutObject
{
get { return Control; }
}
public override Size DesiredSize
{
get {
if (child != null)
{
var handler = child.Handler as IWindowsControl;
if (handler != null)
return handler.DesiredSize;
}
var container = Widget.Container.GetContainerControl();
return container != null ? container.PreferredSize.ToEto () : Size.Empty;
}
}
public override void SetScale (bool xscale, bool yscale)
{
base.SetScale (xscale, yscale);
if (child != null)
child.SetScale (xscale, yscale);
}
public Padding Padding {
get { return Control.Padding.ToEto (); }
set { Control.Padding = value.ToSWF (); }
}
public Control Content {
get { return child; }
set {
if (child == value)
return;
Control.SuspendLayout ();
SWF.Control childControl;
if (value != null) {
childControl = value.GetContainerControl();
childControl.Dock = SWF.DockStyle.Fill;
value.SetScale (XScale, YScale);
Control.Controls.Add(childControl, 0, 0);
}
if (this.child != null) {
child.SetScale (false, false);
childControl = this.child.GetContainerControl ();
Control.Controls.Remove (childControl);
}
this.child = value;
Control.ResumeLayout ();
}
}
}
}
|
bsd-3-clause
|
C#
|
b2af78f15e7aa8981b1477306bb0e0f8bb7b1874
|
Update PolicyAuthorize.cs
|
AzureADQuickStarts/B2C-WebApp-OpenIdConnect-DotNet,AzureADQuickStarts/B2C-WebApp-OpenIdConnect-DotNet,Nsrose/Azure-B2C-Stripe-WebApp,Nsrose/Azure-B2C-Stripe-WebApp,Nsrose/Azure-B2C-Stripe-WebApp,AzureADQuickStarts/B2C-WebApp-OpenIdConnect-DotNet
|
WebApp-B2C-DotNet/PolicyAuthHelpers/PolicyAuthorize.cs
|
WebApp-B2C-DotNet/PolicyAuthHelpers/PolicyAuthorize.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using Microsoft.Owin.Security;
using System.Web;
using Microsoft.Owin.Security.OpenIdConnect;
namespace WebApp_OpenIDConnect_DotNet_B2C.Policies
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class PolicyAuthorize : System.Web.Mvc.AuthorizeAttribute
{
public string Policy { get; set; }
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
filterContext.HttpContext.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties(
new Dictionary<string, string>
{
{Startup.PolicyKey, Policy}
})
{
RedirectUri = "/",
}, OpenIdConnectAuthenticationDefaults.AuthenticationType);
base.HandleUnauthorizedRequest(filterContext);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using Microsoft.Owin.Security;
using System.Web;
using Microsoft.Owin.Security.OpenIdConnect;
namespace WebApp_OpenIDConnect_DotNet_B2C.Policies
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class PolicyAuthorize : System.Web.Mvc.AuthorizeAttribute
{
public string Policy { get; set; }
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
filterContext.HttpContext.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties(
new Dictionary<string, string>
{
{Startup.PolicyKey, Policy}
})
{
RedirectUri = "/",
}, OpenIdConnectAuthenticationDefaults.AuthenticationType);
}
}
}
|
apache-2.0
|
C#
|
45da435a076a96d8fdf974a6b680e6ff84335c3a
|
Update accessor constructor used for tests
|
tburnett80/blogApp,tburnett80/blogApp
|
BlogApp/BlogApp.Accessors/BlogCacheAccessor.cs
|
BlogApp/BlogApp.Accessors/BlogCacheAccessor.cs
|
using System;
using System.Threading.Tasks;
using BlogApp.Common.Contracts.Accessors;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using StackExchange.Redis;
namespace BlogApp.Accessors
{
public sealed class BlogCacheAccessor : ICacheAccessor
{
#region Constructor and private members
private readonly IConfiguration _config;
private readonly IConnectionMultiplexer _connectionMultiplexer;
public BlogCacheAccessor(IConfiguration config)
{
_config = config
?? throw new ArgumentNullException(nameof(config));
_connectionMultiplexer = ConnectionMultiplexer.Connect(_config["redis:endpoint"]);
}
internal BlogCacheAccessor(IConfiguration config, IConnectionMultiplexer multiplexer)
{
_config = config
?? throw new ArgumentNullException(nameof(config));
_connectionMultiplexer = multiplexer
?? throw new ArgumentNullException(nameof(multiplexer));
}
#endregion
public async Task<TEntity> GetEnt<TEntity>(string key) where TEntity : class
{
var db = _connectionMultiplexer.GetDatabase();
var text = await db.StringGetAsync(key);
return string.IsNullOrEmpty(text)
? null
: JsonConvert.DeserializeObject<TEntity>(text);
}
public async Task CacheEnt<TEntity>(string key, TEntity ent, TimeSpan? ttl = null)
{
if (ttl == null)
ttl = TimeSpan.FromMilliseconds(double.Parse(_config["redis:ttlMsDefault"]));
var db = _connectionMultiplexer.GetDatabase();
await db.StringSetAsync(key, JsonConvert.SerializeObject(ent), ttl, When.Always, CommandFlags.FireAndForget);
}
}
}
|
using System;
using System.Threading.Tasks;
using BlogApp.Common.Contracts.Accessors;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using StackExchange.Redis;
namespace BlogApp.Accessors
{
public sealed class BlogCacheAccessor : ICacheAccessor
{
#region Constructor and private members
private readonly IConfiguration _config;
private readonly IConnectionMultiplexer _connectionMultiplexer;
public BlogCacheAccessor(IConfiguration config)
{
_config = config
?? throw new ArgumentNullException(nameof(config));
_connectionMultiplexer = ConnectionMultiplexer.Connect(_config["redis:endpoint"]);
}
public BlogCacheAccessor(IConfiguration config, IConnectionMultiplexer multiplexer)
{
_config = config
?? throw new ArgumentNullException(nameof(config));
_connectionMultiplexer = multiplexer
?? throw new ArgumentNullException(nameof(multiplexer));
}
#endregion
public async Task<TEntity> GetEnt<TEntity>(string key) where TEntity : class
{
var db = _connectionMultiplexer.GetDatabase();
var text = await db.StringGetAsync(key);
return string.IsNullOrEmpty(text)
? null
: JsonConvert.DeserializeObject<TEntity>(text);
}
public async Task CacheEnt<TEntity>(string key, TEntity ent, TimeSpan? ttl = null)
{
if (ttl == null)
ttl = TimeSpan.FromMilliseconds(double.Parse(_config["redis:ttlMsDefault"]));
var db = _connectionMultiplexer.GetDatabase();
await db.StringSetAsync(key, JsonConvert.SerializeObject(ent), ttl, When.Always, CommandFlags.FireAndForget);
}
}
}
|
mit
|
C#
|
911784cc9a28573ae1690b46a605edb82ab37029
|
Add missing UsedImplicitly attribute to Mouse>Static
|
CoraleStudios/Colore,WolfspiritM/Colore
|
Corale.Colore/Razer/Mousepad/Effects/Static.cs
|
Corale.Colore/Razer/Mousepad/Effects/Static.cs
|
// ---------------------------------------------------------------------------------------
// <copyright file="Static.cs" company="Corale">
// Copyright © 2015 by Adam Hellberg and Brandon Scott.
//
// 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.
//
// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any
// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott
// do not take responsibility for any harm caused, direct or indirect, to any
// Razer peripherals via the use of Colore.
//
// "Razer" is a trademark of Razer USA Ltd.
// </copyright>
// ---------------------------------------------------------------------------------------
namespace Corale.Colore.Razer.Mousepad.Effects
{
using System.Runtime.InteropServices;
using Corale.Colore.Annotations;
using Corale.Colore.Core;
/// <summary>
/// Static effect for mouse pad.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Static
{
/// <summary>
/// The color to use.
/// </summary>
[UsedImplicitly]
public Color Color;
/// <summary>
/// Initializes a new instance of the <see cref="Static" /> struct.
/// </summary>
/// <param name="color">The color to use.</param>
public Static(Color color)
{
Color = color;
}
}
}
|
// ---------------------------------------------------------------------------------------
// <copyright file="Static.cs" company="Corale">
// Copyright © 2015 by Adam Hellberg and Brandon Scott.
//
// 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.
//
// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any
// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott
// do not take responsibility for any harm caused, direct or indirect, to any
// Razer peripherals via the use of Colore.
//
// "Razer" is a trademark of Razer USA Ltd.
// </copyright>
// ---------------------------------------------------------------------------------------
namespace Corale.Colore.Razer.Mousepad.Effects
{
using System.Runtime.InteropServices;
using Corale.Colore.Core;
/// <summary>
/// Static effect for mouse pad.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Static
{
/// <summary>
/// The color to use.
/// </summary>
public Color Color;
/// <summary>
/// Initializes a new instance of the <see cref="Static" /> struct.
/// </summary>
/// <param name="color">The color to use.</param>
public Static(Color color)
{
Color = color;
}
}
}
|
mit
|
C#
|
b81b7c080512902a3d97e9ced49eb1613f18c72f
|
Change contrast ratio to get close to 1.5:1 (#45526)
|
AmadeusW/roslyn,eriawan/roslyn,aelij/roslyn,brettfo/roslyn,stephentoub/roslyn,tmat/roslyn,jasonmalinowski/roslyn,stephentoub/roslyn,tmat/roslyn,panopticoncentral/roslyn,aelij/roslyn,brettfo/roslyn,dotnet/roslyn,weltkante/roslyn,sharwell/roslyn,AlekseyTs/roslyn,shyamnamboodiripad/roslyn,jmarolf/roslyn,sharwell/roslyn,mavasani/roslyn,mavasani/roslyn,KirillOsenkov/roslyn,CyrusNajmabadi/roslyn,mgoertz-msft/roslyn,jasonmalinowski/roslyn,physhi/roslyn,KevinRansom/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,mavasani/roslyn,tannergooding/roslyn,wvdd007/roslyn,KirillOsenkov/roslyn,tannergooding/roslyn,shyamnamboodiripad/roslyn,physhi/roslyn,stephentoub/roslyn,jmarolf/roslyn,KevinRansom/roslyn,eriawan/roslyn,ErikSchierboom/roslyn,gafter/roslyn,bartdesmet/roslyn,weltkante/roslyn,AmadeusW/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,tmat/roslyn,tannergooding/roslyn,AlekseyTs/roslyn,aelij/roslyn,bartdesmet/roslyn,eriawan/roslyn,sharwell/roslyn,mgoertz-msft/roslyn,genlu/roslyn,wvdd007/roslyn,ErikSchierboom/roslyn,AmadeusW/roslyn,heejaechang/roslyn,AlekseyTs/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,gafter/roslyn,KirillOsenkov/roslyn,heejaechang/roslyn,diryboy/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,heejaechang/roslyn,jasonmalinowski/roslyn,gafter/roslyn,panopticoncentral/roslyn,panopticoncentral/roslyn,genlu/roslyn,dotnet/roslyn,jmarolf/roslyn,diryboy/roslyn,physhi/roslyn,brettfo/roslyn,ErikSchierboom/roslyn,diryboy/roslyn,wvdd007/roslyn,genlu/roslyn
|
src/EditorFeatures/Core.Wpf/InlineRename/HighlightTags/RenameFieldBackgroundAndBorderTagDefinition.cs
|
src/EditorFeatures/Core.Wpf/InlineRename/HighlightTags/RenameFieldBackgroundAndBorderTagDefinition.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.Diagnostics.CodeAnalysis;
using System.Windows.Media;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.HighlightTags
{
[Export(typeof(EditorFormatDefinition))]
[Name(RenameFieldBackgroundAndBorderTag.TagId)]
[UserVisible(true)]
[ExcludeFromCodeCoverage]
internal class RenameFieldBackgroundAndBorderTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public RenameFieldBackgroundAndBorderTagDefinition()
{
// The Border color should match the BackgroundColor from the
// InlineRenameFieldFormatDefinition.
this.Border = new Pen(new SolidColorBrush(Color.FromRgb(0xFF, 0xFF, 0xFF)), thickness: 2.0);
this.BackgroundColor = Color.FromRgb(0xd3, 0xf8, 0xd3);
this.DisplayName = EditorFeaturesResources.Inline_Rename_Field_Background_and_Border;
// Needs to show above highlight references, but below the resolved/unresolved rename
// conflict tags.
this.ZOrder = 1;
}
}
}
|
// 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.Diagnostics.CodeAnalysis;
using System.Windows.Media;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.HighlightTags
{
[Export(typeof(EditorFormatDefinition))]
[Name(RenameFieldBackgroundAndBorderTag.TagId)]
[UserVisible(true)]
[ExcludeFromCodeCoverage]
internal class RenameFieldBackgroundAndBorderTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public RenameFieldBackgroundAndBorderTagDefinition()
{
// The Border color should match the BackgroundColor from the
// InlineRenameFieldFormatDefinition.
this.Border = new Pen(new SolidColorBrush(Color.FromRgb(0xFF, 0xFF, 0xFF)), thickness: 2.0);
this.BackgroundColor = Color.FromRgb(0xA6, 0xF1, 0xA6);
this.DisplayName = EditorFeaturesResources.Inline_Rename_Field_Background_and_Border;
// Needs to show above highlight references, but below the resolved/unresolved rename
// conflict tags.
this.ZOrder = 1;
}
}
}
|
mit
|
C#
|
2c0c920099d88e5fb8a8bfb6bc5b452c9c39894d
|
Add extra password properties
|
SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers
|
src/SFA.DAS.EmployerUsers.Infrastructure/Data/DocumentDbUser.cs
|
src/SFA.DAS.EmployerUsers.Infrastructure/Data/DocumentDbUser.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using SFA.DAS.EmployerUsers.Domain;
namespace SFA.DAS.EmployerUsers.Infrastructure.Data
{
internal class DocumentDbUser
{
[JsonProperty("id")]
public string Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string Salt { get; set; }
public string PasswordProfileId { get; set; }
public bool IsActive { get; set; }
internal static DocumentDbUser FromDomainUser(User user)
{
return new DocumentDbUser
{
Id = user.Id,
Email = user.Email,
FirstName = user.FirstName,
IsActive = user.IsActive,
LastName = user.LastName,
Password = user.Password,
Salt = user.Salt,
PasswordProfileId = user.PasswordProfileId
};
}
internal User ToDomainUser()
{
return new User
{
Id = Id,
Email = Email,
FirstName = FirstName,
IsActive = IsActive,
LastName = LastName,
Password = Password,
Salt = Salt,
PasswordProfileId = PasswordProfileId
};
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using SFA.DAS.EmployerUsers.Domain;
namespace SFA.DAS.EmployerUsers.Infrastructure.Data
{
internal class DocumentDbUser
{
[JsonProperty("id")]
public string Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public bool IsActive { get; set; }
internal static DocumentDbUser FromDomainUser(User user)
{
return new DocumentDbUser
{
Id = user.Id,
Email = user.Email,
FirstName = user.FirstName,
IsActive = user.IsActive,
LastName = user.LastName,
Password = user.Password
};
}
internal User ToDomainUser()
{
return new User
{
Id = Id,
Email = Email,
FirstName = FirstName,
IsActive = IsActive,
LastName = LastName,
Password = Password
};
}
}
}
|
mit
|
C#
|
d28912db04965ed1128fa38eb9a56d25021d996c
|
Comment should be // not ///
|
theraot/Theraot
|
Framework.Core/System/Runtime/CompilerServices/IsReadOnlyAttribute.cs
|
Framework.Core/System/Runtime/CompilerServices/IsReadOnlyAttribute.cs
|
#if LESSTHAN_NET471 || LESSTHAN_NETCOREAPP20 || LESSTHAN_NETSTANDARD21
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public sealed class IsReadOnlyAttribute : Attribute
{
// Empty
}
}
#endif
|
#if LESSTHAN_NET471 || LESSTHAN_NETCOREAPP20 || LESSTHAN_NETSTANDARD21
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public sealed class IsReadOnlyAttribute : Attribute
{
/// Empty
}
}
#endif
|
mit
|
C#
|
35fb8b5c529dea1ca544a883c028f16a6ead05fa
|
Create SLDR cache directory before trying to get file from SLDR in SldrWritingSystemFactory
|
gtryus/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,glasseyes/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,ermshiperete/libpalaso,mccarthyrb/libpalaso,mccarthyrb/libpalaso,tombogle/libpalaso,tombogle/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,ddaspit/libpalaso,tombogle/libpalaso,gtryus/libpalaso,ddaspit/libpalaso,ermshiperete/libpalaso,andrew-polk/libpalaso,ddaspit/libpalaso,andrew-polk/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso,andrew-polk/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,ddaspit/libpalaso,tombogle/libpalaso,mccarthyrb/libpalaso,andrew-polk/libpalaso,sillsdev/libpalaso,mccarthyrb/libpalaso
|
SIL.WritingSystems/SldrWritingSystemFactory.cs
|
SIL.WritingSystems/SldrWritingSystemFactory.cs
|
using System.IO;
namespace SIL.WritingSystems
{
public class SldrWritingSystemFactory : SldrWritingSystemFactory<WritingSystemDefinition>
{
protected override WritingSystemDefinition ConstructDefinition()
{
return new WritingSystemDefinition();
}
protected override WritingSystemDefinition ConstructDefinition(string ietfLanguageTag)
{
return new WritingSystemDefinition(ietfLanguageTag);
}
protected override WritingSystemDefinition ConstructDefinition(WritingSystemDefinition ws)
{
return new WritingSystemDefinition(ws);
}
}
public abstract class SldrWritingSystemFactory<T> : WritingSystemFactoryBase<T> where T : WritingSystemDefinition
{
public override T Create(string ietfLanguageTag)
{
// check SLDR for template
string sldrCachePath = Path.Combine(Path.GetTempPath(), "SldrCache");
if (!Directory.Exists(sldrCachePath))
Directory.CreateDirectory(sldrCachePath);
string templatePath;
string filename;
switch (GetLdmlFromSldr(sldrCachePath, ietfLanguageTag, out filename))
{
case SldrStatus.FileFromSldr:
case SldrStatus.FileFromSldrCache:
templatePath = Path.Combine(sldrCachePath, filename);
break;
default:
templatePath = null;
break;
}
// check template folder for template
if (string.IsNullOrEmpty(templatePath) && !string.IsNullOrEmpty(TemplateFolder))
{
templatePath = Path.Combine(TemplateFolder, ietfLanguageTag + ".ldml");
if (!File.Exists(templatePath))
templatePath = null;
}
T ws;
if (!string.IsNullOrEmpty(templatePath))
{
ws = ConstructDefinition();
var loader = new LdmlDataMapper(this);
loader.Read(templatePath, ws);
ws.Template = templatePath;
}
else
{
ws = ConstructDefinition(ietfLanguageTag);
}
return ws;
}
/// <summary>
/// The folder in which the repository looks for template LDML files when a writing system is wanted
/// that cannot be found in the local store, global store, or SLDR.
/// </summary>
public string TemplateFolder { get; set; }
/// <summary>
/// Gets the a LDML file from the SLDR.
/// </summary>
protected virtual SldrStatus GetLdmlFromSldr(string path, string id, out string filename)
{
return Sldr.GetLdmlFile(path, id, out filename);
}
}
}
|
using System.IO;
namespace SIL.WritingSystems
{
public class SldrWritingSystemFactory : SldrWritingSystemFactory<WritingSystemDefinition>
{
protected override WritingSystemDefinition ConstructDefinition()
{
return new WritingSystemDefinition();
}
protected override WritingSystemDefinition ConstructDefinition(string ietfLanguageTag)
{
return new WritingSystemDefinition(ietfLanguageTag);
}
protected override WritingSystemDefinition ConstructDefinition(WritingSystemDefinition ws)
{
return new WritingSystemDefinition(ws);
}
}
public abstract class SldrWritingSystemFactory<T> : WritingSystemFactoryBase<T> where T : WritingSystemDefinition
{
public override T Create(string ietfLanguageTag)
{
// check SLDR for template
string sldrCachePath = Path.Combine(Path.GetTempPath(), "SldrCache");
string templatePath;
string filename;
switch (GetLdmlFromSldr(sldrCachePath, ietfLanguageTag, out filename))
{
case SldrStatus.FileFromSldr:
case SldrStatus.FileFromSldrCache:
templatePath = Path.Combine(sldrCachePath, filename);
break;
default:
templatePath = null;
break;
}
// check template folder for template
if (string.IsNullOrEmpty(templatePath) && !string.IsNullOrEmpty(TemplateFolder))
{
templatePath = Path.Combine(TemplateFolder, ietfLanguageTag + ".ldml");
if (!File.Exists(templatePath))
templatePath = null;
}
T ws;
if (!string.IsNullOrEmpty(templatePath))
{
ws = ConstructDefinition();
var loader = new LdmlDataMapper(this);
loader.Read(templatePath, ws);
ws.Template = templatePath;
}
else
{
ws = ConstructDefinition(ietfLanguageTag);
}
return ws;
}
/// <summary>
/// The folder in which the repository looks for template LDML files when a writing system is wanted
/// that cannot be found in the local store, global store, or SLDR.
/// </summary>
public string TemplateFolder { get; set; }
/// <summary>
/// Gets the a LDML file from the SLDR.
/// </summary>
protected virtual SldrStatus GetLdmlFromSldr(string path, string id, out string filename)
{
return Sldr.GetLdmlFile(path, id, out filename);
}
}
}
|
mit
|
C#
|
6c58eb7592c938448f6c9ab353c941285aab8964
|
add view vehicle method [#136209745]
|
revaturelabs/revashare-svc-webapi
|
revashare-svc-webapi/revashare-svc-webapi.Logic/DriverLogic.cs
|
revashare-svc-webapi/revashare-svc-webapi.Logic/DriverLogic.cs
|
using revashare_svc_webapi.Logic.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using revashare_svc_webapi.Logic.Models;
using revashare_svc_webapi.Logic.RevaShareServiceReference;
using revashare_svc_webapi.Logic.Mappers;
namespace revashare_svc_webapi.Logic {
public class DriverLogic : IDriverRepository {
private RevaShareDataServiceClient svc = new RevaShareDataServiceClient();
public VehicleDTO ViewVehicleInfo(UserDTO driver) {
try {
return null;
}
catch (Exception) {
return null;
}
}
public bool UpdateVehicleInfo(VehicleDTO vehicle) {
try {
return svc.UpdateVehicle(VehicleMapper.mapToVehicleDAO(vehicle));
}
catch (Exception) {
return false;
}
}
public bool ReportRider(FlagDTO flag) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public bool SetAvailability(RideDTO ride) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public bool UpdateDriverProfile(UserDTO driver) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public bool ScheduleRide(RideDTO ride) {
try {
return svc.AddRide(RideMapper.mapToRideDAO(ride));
}
catch (Exception) {
return false;
}
}
public bool CancelRide(RideDTO ride) {
try {
return svc.DeleteRide(RideMapper.mapToRideDAO(ride));
}
catch (Exception) {
return false;
}
}
public List<SeatDTO> ViewPassengers() {
try {
return null;
}
catch (Exception) {
return null;
}
}
public bool AcceptPassenger(SeatDTO rider) {
try {
return true;
}
catch (Exception) {
return false;
}
}
}
}
|
using revashare_svc_webapi.Logic.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using revashare_svc_webapi.Logic.Models;
using revashare_svc_webapi.Logic.RevaShareServiceReference;
using revashare_svc_webapi.Logic.Mappers;
namespace revashare_svc_webapi.Logic {
public class DriverLogic : IDriverRepository {
private RevaShareDataServiceClient svc = new RevaShareDataServiceClient();
public bool UpdateVehicleInfo(VehicleDTO vehicle) {
try {
return svc.UpdateVehicle(VehicleMapper.mapToVehicleDAO(vehicle));
}
catch (Exception) {
return false;
}
}
public bool ReportRider(FlagDTO flag) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public bool SetAvailability(RideDTO ride) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public bool UpdateDriverProfile(UserDTO driver) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public bool ScheduleRide(RideDTO ride) {
try {
return svc.AddRide(RideMapper.mapToRideDAO(ride));
}
catch (Exception) {
return false;
}
}
public bool CancelRide(RideDTO ride) {
try {
return svc.DeleteRide(RideMapper.mapToRideDAO(ride));
}
catch (Exception) {
return false;
}
}
public List<SeatDTO> ViewPassengers() {
try {
return null;
}
catch (Exception) {
return null;
}
}
public bool AcceptPassenger(SeatDTO rider) {
try {
return true;
}
catch (Exception) {
return false;
}
}
public VehicleDTO ViewVehicleInfo(UserDTO driver) {
try {
return null;
}
catch (Exception) {
return null;
}
}
}
}
|
mit
|
C#
|
9a0eef932cb889ae5e9ce21ce899c6797dca3115
|
Fix AI crash (#10788)
|
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
|
Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs
|
Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs
|
using Content.Server.AI.Utility;
using Content.Server.AI.WorldState.States.Inventory;
using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Interaction;
using Robust.Shared.Containers;
namespace Content.Server.AI.Operators.Inventory
{
/// <summary>
/// If the target is in EntityStorage will open its parent container
/// </summary>
public sealed class OpenStorageOperator : AiOperator
{
private readonly EntityUid _owner;
private readonly EntityUid _target;
public OpenStorageOperator(EntityUid owner, EntityUid target)
{
_owner = owner;
_target = target;
}
public override Outcome Execute(float frameTime)
{
if (!_target.TryGetContainer(out var container))
{
return Outcome.Success;
}
if (!EntitySystem.Get<SharedInteractionSystem>().InRangeUnobstructed(_owner, container.Owner, popup: true))
{
return Outcome.Failed;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(container.Owner, out EntityStorageComponent? storageComponent) ||
storageComponent.IsWeldedShut)
{
return Outcome.Failed;
}
if (!storageComponent.Open)
{
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<EntityStorageSystem>().ToggleOpen(_owner, _target, storageComponent);
}
var blackboard = UtilityAiHelpers.GetBlackboard(_owner);
blackboard?.GetState<LastOpenedStorageState>().SetValue(container.Owner);
return Outcome.Success;
}
}
}
|
using Content.Server.AI.Utility;
using Content.Server.AI.WorldState.States.Inventory;
using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Interaction;
using Robust.Shared.Containers;
namespace Content.Server.AI.Operators.Inventory
{
/// <summary>
/// If the target is in EntityStorage will open its parent container
/// </summary>
public sealed class OpenStorageOperator : AiOperator
{
private readonly EntityUid _owner;
private readonly EntityUid _target;
public OpenStorageOperator(EntityUid owner, EntityUid target)
{
_owner = owner;
_target = target;
}
public override Outcome Execute(float frameTime)
{
if (!_target.TryGetContainer(out var container))
{
return Outcome.Success;
}
if (!EntitySystem.Get<SharedInteractionSystem>().InRangeUnobstructed(_owner, container.Owner, popup: true))
{
return Outcome.Failed;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(container.Owner, out EntityStorageComponent? storageComponent) ||
storageComponent.IsWeldedShut)
{
return Outcome.Failed;
}
if (!storageComponent.Open)
{
IoCManager.Resolve<EntityStorageSystem>().ToggleOpen(_owner, _target, storageComponent);
}
var blackboard = UtilityAiHelpers.GetBlackboard(_owner);
blackboard?.GetState<LastOpenedStorageState>().SetValue(container.Owner);
return Outcome.Success;
}
}
}
|
mit
|
C#
|
4a4ec9f79081bc9799fcd6355acc20f4b617aa58
|
Remove default paths.
|
xen2/SharpLang,xen2/SharpLang,xen2/SharpLang,xen2/SharpLang,xen2/SharpLang
|
src/SharpLang.Compiler/Cecil/CustomAssemblyResolver.cs
|
src/SharpLang.Compiler/Cecil/CustomAssemblyResolver.cs
|
using System.IO;
using Mono.Cecil;
namespace SharpLang.CompilerServices.Cecil
{
class CustomAssemblyResolver : DefaultAssemblyResolver
{
public CustomAssemblyResolver()
{
// Start with an empty search directory list
foreach (var searchDirectory in GetSearchDirectories())
{
RemoveSearchDirectory(searchDirectory);
}
}
/// <summary>
/// Registers the specified assembly.
/// </summary>
/// <param name="assembly">The assembly to register.</param>
public void Register(AssemblyDefinition assembly)
{
this.RegisterAssembly(assembly);
}
}
}
|
using System.IO;
using Mono.Cecil;
namespace SharpLang.CompilerServices.Cecil
{
class CustomAssemblyResolver : DefaultAssemblyResolver
{
/// <summary>
/// Registers the specified assembly.
/// </summary>
/// <param name="assembly">The assembly to register.</param>
public void Register(AssemblyDefinition assembly)
{
this.RegisterAssembly(assembly);
}
}
}
|
bsd-2-clause
|
C#
|
8c5c8efc98a0c2b832dbf65dbb381750d8bdbf74
|
Update BreakerException.cs
|
hprose/hprose-dotnet
|
src/Hprose.RPC.Plugins/CircuitBreaker/BreakerException.cs
|
src/Hprose.RPC.Plugins/CircuitBreaker/BreakerException.cs
|
/*--------------------------------------------------------*\
| |
| hprose |
| |
| Official WebSite: https://hprose.com |
| |
| BreakerException.cs |
| |
| BreakerException for C#. |
| |
| LastModified: Feb 1, 2019 |
| Author: Ma Bingyao <andot@hprose.com> |
| |
\*________________________________________________________*/
using System;
using System.Runtime.Serialization;
namespace Hprose.RPC.Plugins.CircuitBreaker {
[Serializable]
public class BreakerException : Exception {
public BreakerException() : base("Service breaked") { }
public BreakerException(string message) : base(message) { }
public BreakerException(string message, Exception innerException) : base(message, innerException) { }
#if !NET35_CF
protected BreakerException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endif
}
}
|
/*--------------------------------------------------------*\
| |
| hprose |
| |
| Official WebSite: https://hprose.com |
| |
| BreakerException.cs |
| |
| BreakerException for C#. |
| |
| LastModified: Feb 1, 2019 |
| Author: Ma Bingyao <andot@hprose.com> |
| |
\*________________________________________________________*/
using System;
using System.Runtime.Serialization;
namespace Hprose.RPC.Plugins.CircuitBreaker {
[Serializable]
public class BreakerException : Exception {
public BreakerException() : base("service breaked") { }
public BreakerException(string message) : base(message) { }
public BreakerException(string message, Exception innerException) : base(message, innerException) { }
#if !NET35_CF
protected BreakerException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endif
}
}
|
mit
|
C#
|
09915e8ec7fa63afcaa8c05e88916b4437e84229
|
bump verision to MiniProfiler's 3.1.1.140
|
romansp/MiniProfiler.Elasticsearch
|
src/MiniProfiler.Elasticsearch/Properties/AssemblyInfo.cs
|
src/MiniProfiler.Elasticsearch/Properties/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("MiniProfiler.Elasticsearch")]
[assembly: AssemblyDescription("Elasticsearch extensions for StackExchange.Profiling - http://miniprofiler.com")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("romansp")]
[assembly: AssemblyProduct("StackExchange.Profiling.Elasticsearch")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ed1db334-f263-4470-9be0-1c1e04c57fd5")]
[assembly: AssemblyVersion("3.1.1.140")]
[assembly: AssemblyFileVersion("3.1.1.140")]
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("MiniProfiler.Elasticsearch")]
[assembly: AssemblyDescription("Elasticsearch extensions for StackExchange.Profiling - http://miniprofiler.com")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("romansp")]
[assembly: AssemblyProduct("StackExchange.Profiling.Elasticsearch")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ed1db334-f263-4470-9be0-1c1e04c57fd5")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
2ffe4deec319bd9dcd81d3dd4a5bb47b38f472ae
|
Support for parity clique mixhash and nonce in SealFields
|
Nethereum/Nethereum,Nethereum/Nethereum,Nethereum/Nethereum,Nethereum/Nethereum,Nethereum/Nethereum
|
src/Nethereum.RPC/ModelFactories/BlockHeaderRPCFactory.cs
|
src/Nethereum.RPC/ModelFactories/BlockHeaderRPCFactory.cs
|
using Nethereum.Hex.HexConvertors.Extensions;
using Nethereum.Model;
using Nethereum.RPC.Eth.DTOs;
namespace Nethereum.RPC.ModelFactories
{
public class BlockHeaderRPCFactory
{
public static BlockHeader FromRPC(Block rpcBlock, bool mixHasAndhNonceInSealFields = false)
{
var blockHeader = new BlockHeader();
blockHeader.BlockNumber = rpcBlock.Number;
blockHeader.Coinbase = rpcBlock.Miner;
blockHeader.Difficulty = rpcBlock.Difficulty;
blockHeader.ExtraData = rpcBlock.ExtraData.HexToByteArray();
blockHeader.GasLimit = (long)rpcBlock.GasLimit.Value;
blockHeader.GasUsed = (long)rpcBlock.GasUsed.Value;
blockHeader.LogsBloom = rpcBlock.LogsBloom.HexToByteArray();
blockHeader.ParentHash = rpcBlock.ParentHash.HexToByteArray();
blockHeader.ReceiptHash = rpcBlock.ReceiptsRoot.HexToByteArray();
blockHeader.StateRoot = rpcBlock.StateRoot.HexToByteArray();
blockHeader.Timestamp = (long)rpcBlock.Timestamp.Value;
blockHeader.TransactionsHash = rpcBlock.TransactionsRoot.HexToByteArray();
blockHeader.UnclesHash = rpcBlock.Sha3Uncles.HexToByteArray();
if (mixHasAndhNonceInSealFields && rpcBlock.SealFields != null && rpcBlock.SealFields.Length >= 2)
{
blockHeader.MixHash = rpcBlock.SealFields[0].HexToByteArray();
blockHeader.Nonce = rpcBlock.SealFields[1].HexToByteArray();
}
else
{
blockHeader.MixHash = rpcBlock.MixHash.HexToByteArray();
blockHeader.Nonce = rpcBlock.Nonce.HexToByteArray();
}
return blockHeader;
}
}
}
|
using Nethereum.Hex.HexConvertors.Extensions;
using Nethereum.Model;
using Nethereum.RPC.Eth.DTOs;
namespace Nethereum.RPC.ModelFactories
{
public class BlockHeaderRPCFactory
{
public static BlockHeader FromRPC(Block rpcBlock)
{
var blockHeader = new BlockHeader();
blockHeader.BlockNumber = rpcBlock.Number;
blockHeader.Coinbase = rpcBlock.Miner;
blockHeader.Difficulty = rpcBlock.Difficulty;
blockHeader.ExtraData = rpcBlock.ExtraData.HexToByteArray();
blockHeader.GasLimit = (long)rpcBlock.GasLimit.Value;
blockHeader.GasUsed = (long)rpcBlock.GasUsed.Value;
blockHeader.LogsBloom = rpcBlock.LogsBloom.HexToByteArray();
blockHeader.MixHash = rpcBlock.MixHash.HexToByteArray();
blockHeader.Nonce = rpcBlock.Nonce.HexToByteArray();
blockHeader.ParentHash = rpcBlock.ParentHash.HexToByteArray();
blockHeader.ReceiptHash = rpcBlock.ReceiptsRoot.HexToByteArray();
blockHeader.StateRoot = rpcBlock.StateRoot.HexToByteArray();
blockHeader.Timestamp = (long)rpcBlock.Timestamp.Value;
blockHeader.TransactionsHash = rpcBlock.TransactionsRoot.HexToByteArray();
blockHeader.UnclesHash = rpcBlock.Sha3Uncles.HexToByteArray();
return blockHeader;
}
}
}
|
mit
|
C#
|
4128f4ed9cdb60488e4d962bf9dc6a7393d641e0
|
Update ImportingFromArray.cs
|
aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET
|
Examples/CSharp/Data/Handling/Importing/ImportingFromArray.cs
|
Examples/CSharp/Data/Handling/Importing/ImportingFromArray.cs
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Data.Handling.Importing
{
public class ImportingFromArray
{
public static void Main(string[] args)
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create directory if it is not already present.
bool IsExists = System.IO.Directory.Exists(dataDir);
if (!IsExists)
System.IO.Directory.CreateDirectory(dataDir);
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Creating an array containing names as string values
string[] names = new string[] { "laurence chen", "roman korchagin", "kyle huang" };
//Importing the array of names to 1st row and first column vertically
worksheet.Cells.ImportArray(names, 0, 0, true);
//Saving the Excel file
workbook.Save(dataDir + "DataImport.out.xls");
//ExEnd:1
}
}
}
|
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.Data.Handling.Importing
{
public class ImportingFromArray
{
public static void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create directory if it is not already present.
bool IsExists = System.IO.Directory.Exists(dataDir);
if (!IsExists)
System.IO.Directory.CreateDirectory(dataDir);
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Creating an array containing names as string values
string[] names = new string[] { "laurence chen", "roman korchagin", "kyle huang" };
//Importing the array of names to 1st row and first column vertically
worksheet.Cells.ImportArray(names, 0, 0, true);
//Saving the Excel file
workbook.Save(dataDir + "DataImport.out.xls");
}
}
}
|
mit
|
C#
|
f739887a03a9ecc0fcc05ec53449d3f4a5f35855
|
mark csrf token as SameSite=strict to be more secure (#1799)
|
joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net
|
src/JoinRpg.Portal/Infrastructure/CsrfTokenCookieMiddleware.cs
|
src/JoinRpg.Portal/Infrastructure/CsrfTokenCookieMiddleware.cs
|
using Microsoft.AspNetCore.Antiforgery;
namespace JoinRpg.Portal.Infrastructure;
// Purpose is to send CSRF token to JS-allowed cookie to allow APIs to use it
// see https://remibou.github.io/CSRF-protection-with-ASPNET-Core-and-Blazor-Week-29/
public class CsrfTokenCookieMiddleware
{
private readonly RequestDelegate _next;
public CsrfTokenCookieMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context, IAntiforgery antiforgery)
{
var token = antiforgery.GetAndStoreTokens(context);
context.Response.Cookies.Append(
"CSRF-TOKEN",
token.RequestToken!,
new CookieOptions { HttpOnly = false, SameSite = SameSiteMode.Strict });
await _next(context);
}
}
|
using Microsoft.AspNetCore.Antiforgery;
namespace JoinRpg.Portal.Infrastructure;
// Purpose is to send CSRF token to JS-allowed cookie to allow APIs to use it
// see https://remibou.github.io/CSRF-protection-with-ASPNET-Core-and-Blazor-Week-29/
public class CsrfTokenCookieMiddleware
{
private readonly RequestDelegate _next;
public CsrfTokenCookieMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context, IAntiforgery antiforgery)
{
var token = antiforgery.GetAndStoreTokens(context);
context.Response.Cookies.Append("CSRF-TOKEN", token.RequestToken!, new CookieOptions { HttpOnly = false });
await _next(context);
}
}
|
mit
|
C#
|
f2d40f26d2058e68f8f90fa722ff7fb33d1c58a8
|
Remove reason phrase from HttpExceptionMiddleware
|
ASP-NET-MVC-Boilerplate/Framework,ASP-NET-Core-Boilerplate/Framework,ASP-NET-Core-Boilerplate/Framework,ASP-NET-Core-Boilerplate/Framework,ASP-NET-Core-Boilerplate/Framework,ASP-NET-MVC-Boilerplate/Framework
|
Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs
|
Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs
|
namespace Boxed.AspNetCore.Middleware
{
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
internal class HttpExceptionMiddleware : IMiddleware
{
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
try
{
await next.Invoke(context).ConfigureAwait(false);
}
catch (HttpException httpException)
{
var factory = context.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = factory.CreateLogger<HttpExceptionMiddleware>();
logger.LogInformation(
httpException,
"Executing HttpExceptionMiddleware, setting HTTP status code {0}.",
httpException.StatusCode);
context.Response.StatusCode = httpException.StatusCode;
}
}
}
}
|
namespace Boxed.AspNetCore.Middleware
{
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
internal class HttpExceptionMiddleware : IMiddleware
{
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
try
{
await next.Invoke(context).ConfigureAwait(false);
}
catch (HttpException httpException)
{
var factory = context.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = factory.CreateLogger<HttpExceptionMiddleware>();
logger.LogInformation(
"Executing HttpExceptionMiddleware, setting HTTP status code {0}.",
httpException.StatusCode);
context.Response.StatusCode = httpException.StatusCode;
if (httpException != null)
{
var responseFeature = context.Features.Get<IHttpResponseFeature>();
responseFeature.ReasonPhrase = httpException.Message;
}
}
}
}
}
|
mit
|
C#
|
82e4050fddb27908c282a5f307f62b22ef62940c
|
Fix xmldoc
|
ppy/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,ppy/osu,peppy/osu-new,NeoAdonis/osu,UselessToucan/osu,peppy/osu,UselessToucan/osu,peppy/osu,UselessToucan/osu
|
osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBonusDisplay.cs
|
osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBonusDisplay.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
/// <summary>
/// Shows incremental bonus score achieved for a spinner.
/// </summary>
public class SpinnerBonusDisplay : CompositeDrawable
{
private readonly OsuSpriteText bonusCounter;
public SpinnerBonusDisplay()
{
AutoSizeAxes = Axes.Both;
InternalChild = bonusCounter = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.Numeric.With(size: 24),
Alpha = 0,
};
}
private int displayedCount;
public void SetBonusCount(int count)
{
if (displayedCount == count)
return;
displayedCount = count;
bonusCounter.Text = $"{1000 * count}";
bonusCounter.FadeOutFromOne(1500);
bonusCounter.ScaleTo(1.5f).Then().ScaleTo(1f, 1000, Easing.OutQuint);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
/// <summary>
/// A component that tracks spinner spins and add bonus score for it.
/// </summary>
public class SpinnerBonusDisplay : CompositeDrawable
{
private readonly OsuSpriteText bonusCounter;
public SpinnerBonusDisplay()
{
AutoSizeAxes = Axes.Both;
InternalChild = bonusCounter = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.Numeric.With(size: 24),
Alpha = 0,
};
}
private int displayedCount;
public void SetBonusCount(int count)
{
if (displayedCount == count)
return;
displayedCount = count;
bonusCounter.Text = $"{1000 * count}";
bonusCounter.FadeOutFromOne(1500);
bonusCounter.ScaleTo(1.5f).Then().ScaleTo(1f, 1000, Easing.OutQuint);
}
}
}
|
mit
|
C#
|
bf4d7680bee53140bd8ed70dfc934739a95d71e5
|
Fix IndexOutOfRangeException
|
vkuskov/Entitas-CSharp,vkuskov/Entitas-CSharp,sschmid/Entitas-CSharp,sschmid/Entitas-CSharp
|
Entitas.Unity/Assets/Entitas/Unity/Editor/EntitasEditorLayout.cs
|
Entitas.Unity/Assets/Entitas/Unity/Editor/EntitasEditorLayout.cs
|
using UnityEditor;
using UnityEngine;
namespace Entitas.Unity {
public static class EntitasEditorLayout {
public static void ShowWindow<T>(string title) where T : EditorWindow {
var window = EditorWindow.GetWindow<T>(true, title);
window.minSize = window.maxSize = new Vector2(415f, 520f);
window.Show();
}
public static Texture2D LoadTexture(string label) {
var assets = AssetDatabase.FindAssets(label);
if (assets.Length > 0) {
var guid = assets[0];
if (guid != null) {
var path = AssetDatabase.GUIDToAssetPath(guid);
return AssetDatabase.LoadAssetAtPath<Texture2D>(path);
}
}
return null;
}
public static float DrawHeaderTexture(EditorWindow window, Texture2D texture) {
// For unknown reasons OnGUI is called twice and and so is this method.
// var rect = GUILayoutUtility.GetRect(EditorGUILayout.GetControlRect().width, height);
// will return wrong width and height (1, 1) every other call
// workaround: hardcode scrollBarWidth
const int scollBarWidth = 15;
var ratio = texture.width / texture.height;
var width = window.position.width - 8 - scollBarWidth;
var height = width / ratio;
GUI.DrawTexture(new Rect(4, 2, width, height), texture, ScaleMode.ScaleToFit);
return height;
}
public static Rect BeginVertical() {
return EditorGUILayout.BeginVertical();
}
public static Rect BeginVerticalBox(GUIStyle style = null) {
return EditorGUILayout.BeginVertical(style ?? GUI.skin.box);
}
public static void EndVertical() {
EditorGUILayout.EndVertical();
}
public static Rect BeginHorizontal() {
return EditorGUILayout.BeginHorizontal();
}
public static void EndHorizontal() {
EditorGUILayout.EndHorizontal();
}
}
}
|
using UnityEditor;
using UnityEngine;
namespace Entitas.Unity {
public static class EntitasEditorLayout {
public static void ShowWindow<T>(string title) where T : EditorWindow {
var window = EditorWindow.GetWindow<T>(true, title);
window.minSize = window.maxSize = new Vector2(415f, 520f);
window.Show();
}
public static Texture2D LoadTexture(string label) {
var guid = AssetDatabase.FindAssets(label)[0];
if (guid != null) {
var path = AssetDatabase.GUIDToAssetPath(guid);
return AssetDatabase.LoadAssetAtPath<Texture2D>(path);
}
return null;
}
public static float DrawHeaderTexture(EditorWindow window, Texture2D texture) {
// For unknown reasons OnGUI is called twice and and so is this method.
// var rect = GUILayoutUtility.GetRect(EditorGUILayout.GetControlRect().width, height);
// will return wrong width and height (1, 1) every other call
// workaround: hardcode scrollBarWidth
const int scollBarWidth = 15;
var ratio = texture.width / texture.height;
var width = window.position.width - 8 - scollBarWidth;
var height = width / ratio;
GUI.DrawTexture(new Rect(4, 2, width, height), texture, ScaleMode.ScaleToFit);
return height;
}
public static Rect BeginVertical() {
return EditorGUILayout.BeginVertical();
}
public static Rect BeginVerticalBox(GUIStyle style = null) {
return EditorGUILayout.BeginVertical(style ?? GUI.skin.box);
}
public static void EndVertical() {
EditorGUILayout.EndVertical();
}
public static Rect BeginHorizontal() {
return EditorGUILayout.BeginHorizontal();
}
public static void EndHorizontal() {
EditorGUILayout.EndHorizontal();
}
}
}
|
mit
|
C#
|
ee99b1257325e296f9e8110f117d29730d3a0d64
|
fix compile error
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooserSources.cs
|
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooserSources.cs
|
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
namespace WalletWasabi.Gui.ManagedDialogs
{
public class ManagedFileChooserSources
{
public Func<ManagedFileChooserNavigationItem[]> GetUserDirectories { get; set; }
= DefaultGetUserDirectories;
public Func<ManagedFileChooserNavigationItem[]> GetFileSystemRoots { get; set; }
= DefaultGetFileSystemRoots;
public Func<ManagedFileChooserSources, ManagedFileChooserNavigationItem[]> GetAllItemsDelegate { get; set; }
= DefaultGetAllItems;
public ManagedFileChooserNavigationItem[] GetAllItems() => GetAllItemsDelegate(this);
public static ManagedFileChooserNavigationItem[] DefaultGetAllItems(ManagedFileChooserSources sources)
{
return sources.GetUserDirectories().Concat(sources.GetFileSystemRoots()).ToArray();
}
private static Environment.SpecialFolder[] s_folders = new[]
{
Environment.SpecialFolder.Desktop,
Environment.SpecialFolder.UserProfile,
Environment.SpecialFolder.MyDocuments,
Environment.SpecialFolder.MyMusic,
Environment.SpecialFolder.MyPictures,
Environment.SpecialFolder.MyVideos
};
public static ManagedFileChooserNavigationItem[] DefaultGetUserDirectories()
{
return s_folders.Select(Environment.GetFolderPath).Distinct()
.Where(d => !string.IsNullOrWhiteSpace(d))
.Where(Directory.Exists)
.Select(d => new ManagedFileChooserNavigationItem
{
Path = d,
DisplayName = Path.GetFileName(d)
}).ToArray();
}
public static ManagedFileChooserNavigationItem[] DefaultGetFileSystemRoots()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return DriveInfo.GetDrives().Select(d => new ManagedFileChooserNavigationItem
{
DisplayName = d.Name,
Path = d.RootDirectory.FullName
}).ToArray();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
var paths = Directory.GetDirectories("/Volumes");
return paths.Select(x => new ManagedFileChooserNavigationItem
{
DisplayName = Path.GetFileName(x),
Path = x
}).ToArray();
}
else
{
var paths = Directory.GetDirectories("/media/");
var drives = new ManagedFileChooserNavigationItem[]
{
new ManagedFileChooserNavigationItem
{
DisplayName = "File System",
Path = "/"
}
}.Concat(paths.Select(x => new ManagedFileChooserNavigationItem
{
DisplayName = Path.GetFileName(x),
Path = x
})).ToArray();
return drives;
}
}
}
}
|
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
namespace WalletWasabi.Gui.ManagedDialogs
{
public class ManagedFileChooserSources
{
public Func<ManagedFileChooserNavigationItem[]> GetUserDirectories { get; set; }
= DefaultGetUserDirectories;
public Func<ManagedFileChooserNavigationItem[]> GetFileSystemRoots { get; set; }
= DefaultGetFileSystemRoots;
public Func<ManagedFileChooserSources, ManagedFileChooserNavigationItem[]> GetAllItemsDelegate { get; set; }
= DefaultGetAllItems;
public ManagedFileChooserNavigationItem[] GetAllItems() => GetAllItemsDelegate(this);
public static ManagedFileChooserNavigationItem[] DefaultGetAllItems(ManagedFileChooserSources sources)
{
return sources.GetUserDirectories().Concat(sources.GetFileSystemRoots()).ToArray();
}
private static Environment.SpecialFolder[] s_folders = new[]
{
Environment.SpecialFolder.Desktop,
Environment.SpecialFolder.UserProfile,
Environment.SpecialFolder.MyDocuments,
Environment.SpecialFolder.MyMusic,
Environment.SpecialFolder.MyPictures,
Environment.SpecialFolder.MyVideos
};
public static ManagedFileChooserNavigationItem[] DefaultGetUserDirectories()
{
return s_folders.Select(Environment.GetFolderPath).Distinct()
.Where(d => !string.IsNullOrWhiteSpace(d))
.Where(Directory.Exists)
.Select(d => new ManagedFileChooserNavigationItem
{
Path = d,
DisplayName = Path.GetFileName(d)
}).ToArray();
}
public static ManagedFileChooserNavigationItem[] DefaultGetFileSystemRoots()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return DriveInfo.GetDrives().Select(d => new ManagedFileChooserNavigationItem
{
DisplayName = d.Name,
Path = d.RootDirectory.FullName
}).ToArray();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
var paths = Directory.GetDirectories("/Volumes");
return paths.Select(x => new ManagedFileChooserNavigationItem
{
DisplayName = Path.GetFileName(x),
Path = x
}).ToArray();
}
else
{
var paths = Directory.GetDirectories("/media/");
var drives = new ManagedFileChooserNavigationItem[]
{
new ManagedFileChooserNavigationItem
{
DisplayName = "File System",
Path = "/"
}
}.Concat(paths.Select(x => new ManagedFileChooserNavigationItem
{
DisplayName = Path.GetFileName(x),
Path = x
}).ToArray());
return drives;
}
}
}
}
|
mit
|
C#
|
62750cf99e57d7eb338435d3661882ef2d6aa358
|
Add comments to MouseBrush
|
momo-the-monster/workshop-trails
|
Assets/MMM/Trails/Scripts/MouseBrush.cs
|
Assets/MMM/Trails/Scripts/MouseBrush.cs
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
public class MouseBrush : MonoBehaviour {
public GameObject brushPrefab;
public int gridSnap = 1;
internal GameObject currentBrush;
internal Vector3 mousePositionPrevious;
// Use this for initialization
void Start () {
// Don't start up if we don't have a brush prefab selected
if (brushPrefab == null)
{
enabled = false;
}
// seed the start position of the mouse
mousePositionPrevious = Input.mousePosition;
}
void Update () {
// Detect Left Mouse Button Down
if (Input.GetMouseButtonDown(0))
{
AddBrush(0, GetBrushPositionFromMouse());
}
// Detect Left Mouse Button Up
if (Input.GetMouseButtonUp(0))
{
RemoveBrush(0);
}
// If mouse has moved
if (currentBrush != null && Vector3.Distance(mousePositionPrevious, Input.mousePosition) > 0)
{
// Move the current brush position to the mouse, snapping to the grid
currentBrush.transform.position = GetBrushPositionFromMouse();
}
}
// Add a brush to the scene, set as the current brush
void AddBrush(int index, Vector3 position)
{
GameObject g = (GameObject)GameObject.Instantiate(brushPrefab, position, Quaternion.identity);
currentBrush = g;
}
// Transform mouse position to world space, snap to the specified grid
Vector3 GetBrushPositionFromMouse()
{
Vector3 position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
position.x = gridSnap * Mathf.Round(position.x / gridSnap);
position.y = gridSnap * Mathf.Round(position.y / gridSnap);
position.z = 0;
return position;
}
// Call a delayed destroy on the brush, unset the currentBrush
void RemoveBrush(int index)
{
if (this.currentBrush != null)
{
this.currentBrush.GetComponent<DestroyDelayed>().Trigger(this.currentBrush.GetComponentInChildren<TrailRenderer>().time);
}
currentBrush = null;
}
}
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
public class MouseBrush : MonoBehaviour {
public GameObject brushPrefab;
public int gridSnap = 1;
internal GameObject currentBrush;
internal Vector3 mousePositionPrevious;
// Use this for initialization
void Start () {
if (brushPrefab == null)
{
enabled = false;
}
mousePositionPrevious = Input.mousePosition;
}
// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown(0))
{
AddBrush(0, GetBrushPositionFromMouse());
}
if (Input.GetMouseButtonUp(0))
{
RemoveBrush(0);
}
// If mouse has moved
if (currentBrush != null && Vector3.Distance(mousePositionPrevious, Input.mousePosition) > 0)
{
currentBrush.transform.position = GetBrushPositionFromMouse();
}
}
void AddBrush(int index, Vector3 position)
{
GameObject g = (GameObject)GameObject.Instantiate(brushPrefab, position, Quaternion.identity);
currentBrush = g;
}
Vector3 GetBrushPositionFromMouse()
{
Vector3 position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
position.x = gridSnap * Mathf.Round(position.x / gridSnap);
position.y = gridSnap * Mathf.Round(position.y / gridSnap);
position.z = 0;
return position;
}
void RemoveBrush(int index)
{
if (this.currentBrush != null)
{
this.currentBrush.GetComponent<DestroyDelayed>().Trigger(this.currentBrush.GetComponentInChildren<TrailRenderer>().time);
}
currentBrush = null;
}
}
|
mit
|
C#
|
75dcc28f0e9c2313689b0b5be9744a4d6e048596
|
Test coverage for simple void blocks with a variable
|
agileobjects/ReadableExpressions
|
ReadableExpressions.UnitTests/WhenTranslatingBlockExpressions.cs
|
ReadableExpressions.UnitTests/WhenTranslatingBlockExpressions.cs
|
namespace AgileObjects.ReadableExpressions.UnitTests
{
using System;
using System.Linq.Expressions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class WhenTranslatingBlockExpressions
{
[TestMethod]
public void ShouldTranslateANoVariableBlockWithNoReturnValue()
{
Expression<Action> writeLine = () => Console.WriteLine();
Expression<Func<int>> read = () => Console.Read();
Expression<Action> beep = () => Console.Beep();
var consoleBlock = Expression.Block(writeLine.Body, read.Body, beep.Body);
var translated = consoleBlock.ToReadableString();
const string EXPECTED = @"
Console.WriteLine();
Console.Read();
Console.Beep();";
Assert.AreEqual(EXPECTED.TrimStart(), translated);
}
[TestMethod]
public void ShouldTranslateANoVariableBlockWithAReturnValue()
{
Expression<Action> writeLine = () => Console.WriteLine();
Expression<Func<int>> read = () => Console.Read();
var consoleBlock = Expression.Block(writeLine.Body, read.Body);
var translated = consoleBlock.ToReadableString();
const string EXPECTED = @"
Console.WriteLine();
return Console.Read();";
Assert.AreEqual(EXPECTED.TrimStart(), translated);
}
[TestMethod]
public void ShouldTranslateAVariableBlockWithNoReturnValue()
{
var countVariable = Expression.Variable(typeof(int), "count");
var countEqualsZero = Expression.Assign(countVariable, Expression.Constant(0));
var incrementCount = Expression.Increment(countVariable);
var noReturnValue = Expression.Default(typeof(void));
var consoleBlock = Expression.Block(
new[] { countVariable },
countEqualsZero,
incrementCount,
noReturnValue);
var translated = consoleBlock.ToReadableString();
const string EXPECTED = @"
var count = 0;
++count;";
Assert.AreEqual(EXPECTED.TrimStart(), translated);
}
}
}
|
namespace AgileObjects.ReadableExpressions.UnitTests
{
using System;
using System.Linq.Expressions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class WhenTranslatingBlockExpressions
{
[TestMethod]
public void ShouldTranslateANoVariableNoReturnValueBlock()
{
Expression<Action> writeLine = () => Console.WriteLine();
Expression<Func<int>> read = () => Console.Read();
Expression<Action> beep = () => Console.Beep();
var consoleBlock = Expression.Block(writeLine.Body, read.Body, beep.Body);
var translated = consoleBlock.ToReadableString();
const string EXPECTED = @"
Console.WriteLine();
Console.Read();
Console.Beep();";
Assert.AreEqual(EXPECTED.TrimStart(), translated);
}
[TestMethod]
public void ShouldTranslateANoVariableBlockWithAReturnValue()
{
Expression<Action> writeLine = () => Console.WriteLine();
Expression<Func<int>> read = () => Console.Read();
var consoleBlock = Expression.Block(writeLine.Body, read.Body);
var translated = consoleBlock.ToReadableString();
const string EXPECTED = @"
Console.WriteLine();
return Console.Read();";
Assert.AreEqual(EXPECTED.TrimStart(), translated);
}
}
}
|
mit
|
C#
|
db56e45032488c1c15025c90d198c9a924818a17
|
Remove redundant call to SatisfyImportsOnce
|
github/VisualStudio,github/VisualStudio,github/VisualStudio
|
src/GitHub.App/Factories/ViewViewModelFactory.cs
|
src/GitHub.App/Factories/ViewViewModelFactory.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Windows;
using GitHub.Exports;
using GitHub.Services;
using GitHub.ViewModels;
namespace GitHub.Factories
{
/// <summary>
/// Factory for creating views and view models.
/// </summary>
[Export(typeof(IViewViewModelFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ViewViewModelFactory : IViewViewModelFactory
{
readonly IGitHubServiceProvider serviceProvider;
[ImportingConstructor]
public ViewViewModelFactory(
IGitHubServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
}
[ImportMany(AllowRecomposition = true)]
IEnumerable<ExportFactory<FrameworkElement, IViewModelMetadata>> Views { get; set; }
/// <inheritdoc/>
public TViewModel CreateViewModel<TViewModel>() where TViewModel : IViewModel
{
return serviceProvider.ExportProvider.GetExport<TViewModel>().Value;
}
/// <inheritdoc/>
public FrameworkElement CreateView<TViewModel>() where TViewModel : IViewModel
{
return CreateView(typeof(TViewModel));
}
/// <inheritdoc/>
public FrameworkElement CreateView(Type viewModel)
{
var f = Views.FirstOrDefault(x => x.Metadata.ViewModelType.Contains(viewModel));
return f?.CreateExport().Value;
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Windows;
using GitHub.Exports;
using GitHub.Services;
using GitHub.ViewModels;
namespace GitHub.Factories
{
/// <summary>
/// Factory for creating views and view models.
/// </summary>
[Export(typeof(IViewViewModelFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ViewViewModelFactory : IViewViewModelFactory
{
readonly IGitHubServiceProvider serviceProvider;
[ImportingConstructor]
public ViewViewModelFactory(
IGitHubServiceProvider serviceProvider,
ICompositionService cc)
{
this.serviceProvider = serviceProvider;
cc.SatisfyImportsOnce(this);
}
[ImportMany(AllowRecomposition = true)]
IEnumerable<ExportFactory<FrameworkElement, IViewModelMetadata>> Views { get; set; }
/// <inheritdoc/>
public TViewModel CreateViewModel<TViewModel>() where TViewModel : IViewModel
{
return serviceProvider.ExportProvider.GetExport<TViewModel>().Value;
}
/// <inheritdoc/>
public FrameworkElement CreateView<TViewModel>() where TViewModel : IViewModel
{
return CreateView(typeof(TViewModel));
}
/// <inheritdoc/>
public FrameworkElement CreateView(Type viewModel)
{
var f = Views.FirstOrDefault(x => x.Metadata.ViewModelType.Contains(viewModel));
return f?.CreateExport().Value;
}
}
}
|
mit
|
C#
|
85cca5a4196dfbb3776b7398e48e94fd16c3fb6c
|
Correct terminology in description
|
siwater/Cloudworks,siwater/Cloudworks,siwater/Cloudworks
|
Citrix.Cloudworks.Agent/AgentService.cs
|
Citrix.Cloudworks.Agent/AgentService.cs
|
/*
* Copyright (c) 2013 Citrix Systems, Inc. All Rights Reserved.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using Citrix.Diagnostics;
namespace Citrix.Cloudworks.Agent {
public partial class AgentService : ServiceBase {
public AgentService() {
InitializeComponent();
}
public static string DisplayName {
get {
return "Citrix Cloudworks Agent";
}
}
public static string Name {
get {
return "CtxCwSvc";
}
}
public static string Description {
get {
return "Windows agent for Citrix Cloudworks";
}
}
public static void StopService() {
ServiceController ctl = new ServiceController(Name);
ctl.Stop();
}
private CloudworksServices _Service;
protected override void OnStart(string[] args) {
CtxTrace.TraceInformation();
_Service = new CloudworksServices();
_Service.Start();
}
protected override void OnStop() {
CtxTrace.TraceInformation();
if (_Service != null) {
_Service.Stop();
}
}
}
}
|
/*
* Copyright (c) 2013 Citrix Systems, Inc. All Rights Reserved.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using Citrix.Diagnostics;
namespace Citrix.Cloudworks.Agent {
public partial class AgentService : ServiceBase {
public AgentService() {
InitializeComponent();
}
public static string DisplayName {
get {
return "Citrix StackMate Agent";
}
}
public static string Name {
get {
return "CtxCwSvc";
}
}
public static string Description {
get {
return "Windows agent for Citrix StackMate";
}
}
public static void StopService() {
ServiceController ctl = new ServiceController(Name);
ctl.Stop();
}
private CloudworksServices _Service;
protected override void OnStart(string[] args) {
CtxTrace.TraceInformation();
_Service = new CloudworksServices();
_Service.Start();
}
protected override void OnStop() {
CtxTrace.TraceInformation();
if (_Service != null) {
_Service.Stop();
}
}
}
}
|
mit
|
C#
|
ad37141c38eba363e083804343b45716fe017a3e
|
Update ForeignExchangeEntity.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Finance/ForeignExchange/Data/ForeignExchangeEntity.cs
|
TIKSN.Core/Finance/ForeignExchange/Data/ForeignExchangeEntity.cs
|
using System.Collections.Generic;
using TIKSN.Data;
namespace TIKSN.Finance.ForeignExchange.Data
{
public class ForeignExchangeEntity : IEntity<int>
{
public ForeignExchangeEntity() => this.ExchangeRates = new HashSet<ExchangeRateEntity>();
public int LongNameKey { get; set; }
public int ShortNameKey { get; set; }
public string CountryCode { get; set; }
public virtual ICollection<ExchangeRateEntity> ExchangeRates { get; set; }
public int ID { get; set; }
}
}
|
using System.Collections.Generic;
using TIKSN.Data;
namespace TIKSN.Finance.ForeignExchange.Data
{
public class ForeignExchangeEntity : IEntity<int>
{
public ForeignExchangeEntity()
{
ExchangeRates = new HashSet<ExchangeRateEntity>();
}
public int ID { get; set; }
public int LongNameKey { get; set; }
public int ShortNameKey { get; set; }
public string CountryCode { get; set; }
public virtual ICollection<ExchangeRateEntity> ExchangeRates { get; set; }
}
}
|
mit
|
C#
|
329465873e26fe1dfeecb82a313e27075a0d5aff
|
Allow double-clicking on an entry in the breach list to open an edit dialog
|
andrew-schofield/keepass2-haveibeenpwned
|
HaveIBeenPwned/BreachedEntriesDialog.cs
|
HaveIBeenPwned/BreachedEntriesDialog.cs
|
using KeePass.Plugins;
using KeePassLib;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
namespace HaveIBeenPwned
{
public partial class BreachedEntriesDialog : Form
{
private IPluginHost pluginHost;
public BreachedEntriesDialog(IPluginHost pluginHost)
{
this.pluginHost = pluginHost;
InitializeComponent();
}
public void AddBreaches(IList<BreachedEntry> breaches)
{
breachedEntryList.Items.Clear();
foreach (var breach in breaches)
{
var newItem = new ListViewItem(new[]
{
breach.Entry.Strings.ReadSafe(PwDefs.TitleField),
breach.Entry.Strings.ReadSafe(PwDefs.UserNameField),
breach.Entry.Strings.ReadSafe(PwDefs.UrlField),
breach.Entry.GetPasswordLastModified().ToShortDateString(),
breach.BreachDate.ToShortDateString()
})
{
Tag = breach.Entry
};
breachedEntryList.Items.Add(newItem);
}
}
[STAThread]
private void breachedEntryList_MouseDoubleClick(object sender, MouseEventArgs e)
{
if(breachedEntryList.SelectedItems != null && breachedEntryList.SelectedItems.Count == 1)
{
var entry = ((PwEntry)breachedEntryList.SelectedItems[0].Tag);
var pwForm = new KeePass.Forms.PwEntryForm();
pwForm.InitEx(entry, KeePass.Forms.PwEditMode.EditExistingEntry, pluginHost.Database, pluginHost.MainWindow.ClientIcons, false, false);
var thread = new Thread(() => pwForm.ShowDialog());
thread.SetApartmentState(ApartmentState.STA);
thread.IsBackground = true;
thread.Start();
}
}
}
}
|
using KeePass.Plugins;
using KeePassLib;
using System.Collections.Generic;
using System.Windows.Forms;
namespace HaveIBeenPwned
{
public partial class BreachedEntriesDialog : Form
{
private IPluginHost pluginHost;
public BreachedEntriesDialog(IPluginHost pluginHost)
{
this.pluginHost = pluginHost;
InitializeComponent();
}
public void AddBreaches(IList<BreachedEntry> breaches)
{
breachedEntryList.Items.Clear();
foreach (var breach in breaches)
{
var newItem = new ListViewItem(new[]
{
breach.Entry.Strings.ReadSafe(PwDefs.TitleField),
breach.Entry.Strings.ReadSafe(PwDefs.UserNameField),
breach.Entry.Strings.ReadSafe(PwDefs.UrlField),
breach.Entry.GetPasswordLastModified().ToShortDateString(),
breach.BreachDate.ToShortDateString()
})
{
Tag = breach.Entry
};
breachedEntryList.Items.Add(newItem);
}
}
private void breachedEntryList_MouseDoubleClick(object sender, MouseEventArgs e)
{
/*if(breachedEntryList.SelectedItems != null && breachedEntryList.SelectedItems.Count == 1)
{
var entry = ((PwEntry)breachedEntryList.SelectedItems[0].Tag);
var pwForm = new KeePass.Forms.PwEntryForm();
pwForm.InitEx(entry, KeePass.Forms.PwEditMode.EditExistingEntry, pluginHost.Database, pluginHost.MainWindow.ClientIcons, false, false);
pwForm.ShowDialog();
}*/
}
}
}
|
mit
|
C#
|
b7e7d215c9f439e0973380acd5452e5626997579
|
Update Field name.
|
nuitsjp/PrimerOfPrismForms
|
03.NavigationService/ViewModelFirstNavigation/ViewModelFirstNavigation/ViewModels/MainPageViewModel.cs
|
03.NavigationService/ViewModelFirstNavigation/ViewModelFirstNavigation/ViewModels/MainPageViewModel.cs
|
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
namespace ViewModelFirstNavigation.ViewModels
{
public class MainPageViewModel : BindableBase, INavigationAware
{
private string _title;
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public DelegateCommand NavigateNextCommand => new DelegateCommand(NavigateNext);
private void NavigateNext()
{
var oarameters = new NavigationParameters();
oarameters["Message"] = "Hello, Next Page!";
_navigationService.NavigateAsync<NextPageViewModel>(oarameters);
}
private readonly INavigationService _navigationService;
public MainPageViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
}
public void OnNavigatedFrom(NavigationParameters parameters)
{
}
public void OnNavigatedTo(NavigationParameters parameters)
{
if (parameters.ContainsKey("title"))
Title = (string)parameters["title"] + " and Prism";
}
}
}
|
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
namespace ViewModelFirstNavigation.ViewModels
{
public class MainPageViewModel : BindableBase, INavigationAware
{
private string _title;
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public DelegateCommand NavigateNextCommand => new DelegateCommand(NavigateNext);
private void NavigateNext()
{
var nextPageViewModel = new NavigationParameters();
nextPageViewModel["Message"] = "Hello, Next Page!";
_navigationService.NavigateAsync<NextPageViewModel>(nextPageViewModel);
}
private readonly INavigationService _navigationService;
public MainPageViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
}
public void OnNavigatedFrom(NavigationParameters parameters)
{
}
public void OnNavigatedTo(NavigationParameters parameters)
{
if (parameters.ContainsKey("title"))
Title = (string)parameters["title"] + " and Prism";
}
}
}
|
mit
|
C#
|
3107a60d831d4a6bdc9abca7011ef250ea7e0e62
|
Add docs
|
weltkante/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,dotnet/roslyn,dotnet/roslyn,bartdesmet/roslyn,mavasani/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,diryboy/roslyn,weltkante/roslyn,CyrusNajmabadi/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,shyamnamboodiripad/roslyn,KevinRansom/roslyn,diryboy/roslyn,KevinRansom/roslyn,mavasani/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,bartdesmet/roslyn,KevinRansom/roslyn
|
src/EditorFeatures/Core.Wpf/Adornments/BrushTag.cs
|
src/EditorFeatures/Core.Wpf/Adornments/BrushTag.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.Windows;
using System.Windows.Media;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Tagging;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Adornments
{
/// <summary>
/// Base type for tags that want to draw something with a simple configurable color. What is drawn will actually be
/// the responsibility of the particular <see cref="AbstractAdornmentManager{T}"/> subclass. Tags that want to draw
/// just a simple single <see cref="UIElement"/> should subclass <see cref="GraphicsTag"/>. In that case the <see
/// cref="AbstractAdornmentManager{T}"/> will just defer to the tag itself to create the element rather than
/// computing it itself.
/// </summary>
internal abstract class BrushTag : ITag
{
private static readonly Color s_lightGray = Color.FromRgb(0xA5, 0xA5, 0xA5);
private readonly IEditorFormatMap _editorFormatMap;
private Brush? _brush;
protected BrushTag(IEditorFormatMap editorFormatMap)
=> _editorFormatMap = editorFormatMap;
public Brush GetBrush(IWpfTextView view)
// If we can't get the color for some reason, fall back to a hard-coded value the editor has for outlining.
=> _brush ??= new SolidColorBrush(this.GetColor(view, _editorFormatMap) ?? s_lightGray);
protected abstract Color? GetColor(IWpfTextView view, IEditorFormatMap editorFormatMap);
}
}
|
// 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.Windows.Media;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Tagging;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Adornments
{
internal abstract class BrushTag : ITag
{
private static readonly Color s_lightGray = Color.FromRgb(0xA5, 0xA5, 0xA5);
private readonly IEditorFormatMap _editorFormatMap;
private Brush? _brush;
protected BrushTag(IEditorFormatMap editorFormatMap)
=> _editorFormatMap = editorFormatMap;
public Brush GetBrush(IWpfTextView view)
// If we can't get the color for some reason, fall back to a hard-coded value the editor has for outlining.
=> _brush ??= new SolidColorBrush(this.GetColor(view, _editorFormatMap) ?? s_lightGray);
protected abstract Color? GetColor(IWpfTextView view, IEditorFormatMap editorFormatMap);
}
}
|
mit
|
C#
|
f01e5430a78b103299b55771ed5f7d363311432a
|
Change signatures
|
sakapon/Samples-2014,sakapon/Samples-2014,sakapon/Samples-2014
|
RxSample/MouseRx2Wpf/MainWindow.xaml.cs
|
RxSample/MouseRx2Wpf/MainWindow.xaml.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MouseRx2Wpf
{
/// <summary>
/// MainWindow.xaml の相互作用ロジック
/// </summary>
public partial class MainWindow : Window
{
public static readonly DependencyProperty DeltaProperty =
DependencyProperty.Register(nameof(Delta), typeof(Vector?), typeof(MainWindow), new PropertyMetadata(null, (d, e) => ((MainWindow)d).DeltaChanged()));
public Vector? Delta
{
get { return (Vector?)GetValue(DeltaProperty); }
set { SetValue(DeltaProperty, value); }
}
public static readonly DependencyProperty OrientationProperty =
DependencyProperty.Register(nameof(Orientation), typeof(string), typeof(MainWindow), new PropertyMetadata(null));
public string Orientation
{
get { return (string)GetValue(OrientationProperty); }
private set { SetValue(OrientationProperty, value); }
}
public MainWindow()
{
InitializeComponent();
var events = new EventsExtension(this);
events.MouseDrag.Subscribe(d => d.Subscribe(v => Delta = v, () => Delta = null));
}
void DeltaChanged()
{
Orientation = Delta == null ? null : ToOrientation(Delta.Value);
}
const double π = Math.PI;
static readonly string[] orientationSymbols = new[] { "→", "↘", "↓", "↙", "←", "↖", "↑", "↗" };
static readonly double zoneAngleRange = 2 * π / orientationSymbols.Length;
static string ToOrientation(Vector v)
{
var angle = 2 * π + Math.Atan2(v.Y, v.X);
var zone = (int)Math.Round(angle / zoneAngleRange) % orientationSymbols.Length;
return orientationSymbols[zone];
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MouseRx2Wpf
{
/// <summary>
/// MainWindow.xaml の相互作用ロジック
/// </summary>
public partial class MainWindow : Window
{
public static readonly DependencyProperty DeltaProperty =
DependencyProperty.Register(nameof(Delta), typeof(Vector?), typeof(MainWindow), new PropertyMetadata(null, (d, e) => DeltaChanged((MainWindow)d)));
public Vector? Delta
{
get { return (Vector?)GetValue(DeltaProperty); }
set { SetValue(DeltaProperty, value); }
}
public static readonly DependencyProperty OrientationProperty =
DependencyProperty.Register(nameof(Orientation), typeof(string), typeof(MainWindow), new PropertyMetadata(null));
public string Orientation
{
get { return (string)GetValue(OrientationProperty); }
private set { SetValue(OrientationProperty, value); }
}
public MainWindow()
{
InitializeComponent();
var events = new EventsExtension(this);
events.MouseDrag.Subscribe(d => d.Subscribe(v => Delta = v, () => Delta = null));
}
static void DeltaChanged(MainWindow window)
{
window.Orientation = window.Delta == null ? null : ToOrientation(window.Delta.Value);
}
const double π = Math.PI;
static readonly string[] orientationSymbols = new[] { "→", "↘", "↓", "↙", "←", "↖", "↑", "↗" };
static readonly double zoneAngleRange = 2 * π / orientationSymbols.Length;
static string ToOrientation(Vector v)
{
var angle = 2 * π + Math.Atan2(v.Y, v.X);
var zone = (int)Math.Round(angle / zoneAngleRange) % orientationSymbols.Length;
return orientationSymbols[zone];
}
}
}
|
mit
|
C#
|
dcf3148d23578776ecb8f484b1abb551935cb037
|
Fix osu!mania failing due to 0 hp.
|
peppy/osu-new,naoey/osu,EVAST9919/osu,EVAST9919/osu,2yangk23/osu,peppy/osu,smoogipoo/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,ZLima12/osu,johnneijzen/osu,DrabWeb/osu,Damnae/osu,johnneijzen/osu,smoogipoo/osu,Frontear/osuKyzer,DrabWeb/osu,UselessToucan/osu,ppy/osu,DrabWeb/osu,Nabile-Rahmani/osu,Drezi126/osu,peppy/osu,osu-RP/osu-RP,UselessToucan/osu,2yangk23/osu,ppy/osu,tacchinotacchi/osu,UselessToucan/osu,ppy/osu,ZLima12/osu,NeoAdonis/osu,naoey/osu,peppy/osu,naoey/osu,NeoAdonis/osu
|
osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
|
osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Mania.Scoring
{
internal class ManiaScoreProcessor : ScoreProcessor<ManiaHitObject, ManiaJudgement>
{
public ManiaScoreProcessor()
{
}
public ManiaScoreProcessor(HitRenderer<ManiaHitObject, ManiaJudgement> hitRenderer)
: base(hitRenderer)
{
}
protected override void OnNewJudgement(ManiaJudgement judgement)
{
}
protected override void Reset()
{
base.Reset();
Health.Value = 1;
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Mania.Scoring
{
internal class ManiaScoreProcessor : ScoreProcessor<ManiaHitObject, ManiaJudgement>
{
public ManiaScoreProcessor()
{
}
public ManiaScoreProcessor(HitRenderer<ManiaHitObject, ManiaJudgement> hitRenderer)
: base(hitRenderer)
{
}
protected override void OnNewJudgement(ManiaJudgement judgement)
{
}
}
}
|
mit
|
C#
|
1feed61d9e1a2fbb91abd6e97dcbfd5af09fd5f2
|
Put not in place stating that we are essentially project complete
|
johnnyreilly/jQuery.Validation.Unobtrusive.Native,johnnyreilly/jQuery.Validation.Unobtrusive.Native,johnnyreilly/jQuery.Validation.Unobtrusive.Native
|
jVUNDemo/Views/Home/Index.cshtml
|
jVUNDemo/Views/Home/Index.cshtml
|
@section metatags{
<meta name="Description" content="Provides MVC HTML helper extensions that marry jQuery Validation's native unobtrusive support for validation driven by HTML 5 data attributes with MVC's ability to generate data attributes from Model metadata. With this in place you can use jQuery Validation as it is - you don't need to include jquery.validate.unobtrusive.js.">
}
<h3>What is jQuery Validation Unobtrusive Native?</h3>
<p>jQuery Validation Unobtrusive Native is a collection of ASP.Net MVC HTML helper extensions. These make use of jQuery Validation's native support for validation driven by HTML 5 data attributes. Microsoft shipped <a href="http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html" target="_blank">jquery.validate.unobtrusive.js</a> back with MVC 3. It provided a way to apply data model validations to the client side using a combination of jQuery Validation and HTML 5 data attributes (that's the "unobtrusive" part).</p>
<p>The principal of this was and is fantastic. But since that time the jQuery Validation project has implemented its own support for driving validation unobtrusively (which shipped with <a href="http://jquery.bassistance.de/validate/changelog.txt" target="_blank">jQuery Validation 1.11.0</a>). The main advantages of using the native support over jquery.validate.unobtrusive.js are:</p>
<ol>
<li>Dynamically created form elements are parsed automatically. jquery.validate.unobtrusive.js does not support this whilst jQuery Validation does.<br />
@Html.ActionLink("See a demo", "Dynamic", "AdvancedDemo")<br /><br /></li>
<li>jquery.validate.unobtrusive.js restricts how you use jQuery Validation. If you want to use showErrors or something similar then you may find that you need to go native (or at least you may find that significantly easier than working with the jquery.validate.unobtrusive.js defaults)...<br />
@Html.ActionLink("See a demo", "Tooltip", "AdvancedDemo")<br /><br /></li>
<li>Send less code to your browser, make your browser to do less work, get a performance benefit (though in all honesty you'd probably have to be the Flash to actually notice the difference...)</li>
</ol>
<p>This project intends to be a bridge between MVC's inbuilt support for driving validation from data attributes and jQuery Validation's native support for the same. This is achieved by hooking into the MVC data attribute creation mechanism and using it to generate the data attributes used by jQuery Validation.</p>
<h4>State of the Union</h4>
<p>This is basically a "done" project. Work is complete and I'm not aware of any missing pieces. I could port this to ASP.Net Core / MVC 6 when it ships but I don't have any immediate plans to. Never say never though.</p>
<p>Help is appreciated so feel free to pitch in! You can find the project on <a href="http://github.com/johnnyreilly/jQuery.Validation.Unobtrusive.Native" target="_blank">GitHub</a>...</p>
|
@section metatags{
<meta name="Description" content="Provides MVC HTML helper extensions that marry jQuery Validation's native unobtrusive support for validation driven by HTML 5 data attributes with MVC's ability to generate data attributes from Model metadata. With this in place you can use jQuery Validation as it is - you don't need to include jquery.validate.unobtrusive.js.">
}
<h3>What is jQuery Validation Unobtrusive Native?</h3>
<p>jQuery Validation Unobtrusive Native is a collection of ASP.Net MVC HTML helper extensions. These make use of jQuery Validation's native support for validation driven by HTML 5 data attributes. Microsoft shipped <a href="http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html" target="_blank">jquery.validate.unobtrusive.js</a> back with MVC 3. It provided a way to apply data model validations to the client side using a combination of jQuery Validation and HTML 5 data attributes (that's the "unobtrusive" part).</p>
<p>The principal of this was and is fantastic. But since that time the jQuery Validation project has implemented its own support for driving validation unobtrusively (which shipped with <a href="http://jquery.bassistance.de/validate/changelog.txt" target="_blank">jQuery Validation 1.11.0</a>). The main advantages of using the native support over jquery.validate.unobtrusive.js are:</p>
<ol>
<li>Dynamically created form elements are parsed automatically. jquery.validate.unobtrusive.js does not support this whilst jQuery Validation does.<br />
@Html.ActionLink("See a demo", "Dynamic", "AdvancedDemo")<br /><br /></li>
<li>jquery.validate.unobtrusive.js restricts how you use jQuery Validation. If you want to use showErrors or something similar then you may find that you need to go native (or at least you may find that significantly easier than working with the jquery.validate.unobtrusive.js defaults)...<br />
@Html.ActionLink("See a demo", "Tooltip", "AdvancedDemo")<br /><br /></li>
<li>Send less code to your browser, make your browser to do less work, get a performance benefit (though in all honesty you'd probably have to be the Flash to actually notice the difference...)</li>
</ol>
<p>This project intends to be a bridge between MVC's inbuilt support for driving validation from data attributes and jQuery Validation's native support for the same. This is achieved by hooking into the MVC data attribute creation mechanism and using it to generate the data attributes used by jQuery Validation.</p>
<h4>Future Plans</h4>
<p>So far the basic set of the HtmlHelpers and their associated unobtrusive mappings have been implemented. If any have been missed then let me know. As time goes by I intend to:</p>
<ul>
<li>fill in any missing gaps there may be</li>
<li>maintain MVC 3, 4, 5 (and when the time comes 6+) versions of this on Nuget</li>
<li>get the unit test coverage to a good level and (most importantly)</li>
<li>create some really useful demos and documentation. (hopefully that's what these are)</li>
</ul>
<p>Help is appreciated so feel free to pitch in! You can find the project on <a href="http://github.com/johnnyreilly/jQuery.Validation.Unobtrusive.Native" target="_blank">GitHub</a>...</p>
|
mit
|
C#
|
245d2ea21211177a39c739d5866285d1c7caf85d
|
Switch repo name in tests from deprecated dotnet/cli to the new dotnet/sdk
|
NuKeeperDotNet/NuKeeper,AnthonySteele/NuKeeper,skolima/NuKeeper,NuKeeperDotNet/NuKeeper,skolima/NuKeeper,AnthonySteele/NuKeeper,AnthonySteele/NuKeeper,AnthonySteele/NuKeeper,skolima/NuKeeper,NuKeeperDotNet/NuKeeper,NuKeeperDotNet/NuKeeper,skolima/NuKeeper
|
NuKeeper.Integration.Tests/Engine/RepositoryFilterTests.cs
|
NuKeeper.Integration.Tests/Engine/RepositoryFilterTests.cs
|
using System;
using System.Threading.Tasks;
using NSubstitute;
using NuKeeper.Abstractions.CollaborationPlatform;
using NuKeeper.Abstractions.Configuration;
using NuKeeper.Abstractions.Logging;
using NuKeeper.Engine;
using NuKeeper.GitHub;
using NUnit.Framework;
namespace NuKeeper.Integration.Tests.Engine
{
[TestFixture]
public class RepositoryFilterTests
{
[Test]
public async Task ShouldFilterOutNonDotnetRepository()
{
IRepositoryFilter subject = MakeRepositoryFilter();
var result =
await subject.ContainsDotNetProjects(new RepositorySettings
{
RepositoryName = "jquery",
RepositoryOwner = "jquery"
});
Assert.False(result);
}
[Test]
public async Task ShouldNotFilterOutADotnetRepository()
{
IRepositoryFilter subject = MakeRepositoryFilter();
var result =
await subject.ContainsDotNetProjects(new RepositorySettings { RepositoryName = "sdk", RepositoryOwner = "dotnet" });
Assert.True(result);
}
private static RepositoryFilter MakeRepositoryFilter()
{
const string testKeyWithOnlyPublicAccess = "c13d2ce7774d39ae99ddaad46bd69c3d459b9992";
var logger = Substitute.For<INuKeeperLogger>();
var collaborationFactory = Substitute.For<ICollaborationFactory>();
var gitHubClient = new OctokitClient(logger);
gitHubClient.Initialise(new AuthSettings(new Uri("https://api.github.com"), testKeyWithOnlyPublicAccess));
collaborationFactory.CollaborationPlatform.Returns(gitHubClient);
return new RepositoryFilter(collaborationFactory, logger);
}
}
}
|
using System;
using System.Threading.Tasks;
using NSubstitute;
using NuKeeper.Abstractions.CollaborationPlatform;
using NuKeeper.Abstractions.Configuration;
using NuKeeper.Abstractions.Logging;
using NuKeeper.Engine;
using NuKeeper.GitHub;
using NUnit.Framework;
namespace NuKeeper.Integration.Tests.Engine
{
[TestFixture]
public class RepositoryFilterTests
{
[Test]
public async Task ShouldFilterOutNonDotnetRepository()
{
IRepositoryFilter subject = MakeRepositoryFilter();
var result =
await subject.ContainsDotNetProjects(new RepositorySettings
{
RepositoryName = "jquery",
RepositoryOwner = "jquery"
});
Assert.False(result);
}
[Test]
public async Task ShouldNotFilterOutADotnetRepository()
{
IRepositoryFilter subject = MakeRepositoryFilter();
var result =
await subject.ContainsDotNetProjects(new RepositorySettings { RepositoryName = "cli", RepositoryOwner = "dotnet" });
Assert.True(result);
}
private static RepositoryFilter MakeRepositoryFilter()
{
const string testKeyWithOnlyPublicAccess = "c13d2ce7774d39ae99ddaad46bd69c3d459b9992";
var logger = Substitute.For<INuKeeperLogger>();
var collaborationFactory = Substitute.For<ICollaborationFactory>();
var gitHubClient = new OctokitClient(logger);
gitHubClient.Initialise(new AuthSettings(new Uri("https://api.github.com"), testKeyWithOnlyPublicAccess));
collaborationFactory.CollaborationPlatform.Returns(gitHubClient);
return new RepositoryFilter(collaborationFactory, logger);
}
}
}
|
apache-2.0
|
C#
|
98b2c163f0c3ec38b7e9528d7989e066aa9c1399
|
update vuokaavio 3
|
JuusoLo/Programming-basics
|
Conditional-Statements/conditional-statement/loop_example_3/Program.cs
|
Conditional-Statements/conditional-statement/loop_example_3/Program.cs
|
using System;
namespace loop_example_3
{
class Program
{
static void Main(string[] args)
{
Console.OutputEncoding = System.Text.Encoding.UTF8;
Console.WriteLine("Ohjelma laskee. Anna luku, mistä parillisten ja parittomien summan:");
string userInput = Console.ReadLine();
int number = int.Parse(userInput);
//int.TryParse(userInput, out int number);
int i = 0;
int parillinen = 0;
int pariton = 0;
while (i <= number)
{
if (i % 2 == 0)
{
parillinen = parillinen + i;
}
else
{
pariton = pariton + i;
}
i = i + 1;
}
Console.WriteLine($"Parillisten ja parittomien lukujen summa: {parillinen} ja {pariton}");
Console.ReadKey();
}
}
}
|
using System;
namespace loop_example_3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
|
mit
|
C#
|
b0ee0383f334b080cb512da69df0ce5f62bff4ae
|
Update information about valid archive types
|
arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5
|
src/Arkivverket.Arkade.CLI/ArchiveProcessingOptions.cs
|
src/Arkivverket.Arkade.CLI/ArchiveProcessingOptions.cs
|
using CommandLine;
namespace Arkivverket.Arkade.CLI
{
public abstract class ArchiveProcessingOptions : OutputOptions
{
[Option('t', "type", HelpText = "Optional. Archive type, valid values: noark3, noark4, noark5 or fagsystem")]
public string ArchiveType { get; set; }
[Option('a', "archive", HelpText = "Archive directory or file (.tar) to process.", Required = true)]
public string Archive { get; set; }
[Option('p', "processing-area", HelpText = "Directory to place temporary files and logs.", Required = true)]
public string ProcessingArea { get; set; }
}
}
|
using CommandLine;
namespace Arkivverket.Arkade.CLI
{
public abstract class ArchiveProcessingOptions : OutputOptions
{
[Option('t', "type", HelpText = "Optional. Archive type, valid values: noark3, noark5 or fagsystem")]
public string ArchiveType { get; set; }
[Option('a', "archive", HelpText = "Archive directory or file (.tar) to process.", Required = true)]
public string Archive { get; set; }
[Option('p', "processing-area", HelpText = "Directory to place temporary files and logs.", Required = true)]
public string ProcessingArea { get; set; }
}
}
|
agpl-3.0
|
C#
|
95f3307a1e74d0766b6513c5c87d2c8102968ee8
|
remove bad comment
|
pharring/ApplicationInsights-dotnet,pharring/ApplicationInsights-dotnet,Microsoft/ApplicationInsights-dotnet,pharring/ApplicationInsights-dotnet
|
src/Microsoft.ApplicationInsights/Channel/ITelemetry.cs
|
src/Microsoft.ApplicationInsights/Channel/ITelemetry.cs
|
namespace Microsoft.ApplicationInsights.Channel
{
using System;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
/// <summary>
/// The base telemetry type for application insights.
/// </summary>
public interface ITelemetry
{
/// <summary>
/// Gets or sets date and time when telemetry was recorded.
/// </summary>
DateTimeOffset Timestamp { get; set; }
/// <summary>
/// Gets the context associated with this telemetry instance.
/// </summary>
TelemetryContext Context { get; }
/// <summary>
/// Gets or sets gets the extension used to extend this telemetry instance using new strongly
/// typed object.
/// </summary>
IExtension Extension { get; set; }
/// <summary>
/// Gets or sets the value that defines absolute order of the telemetry item.
/// </summary>
/// <remarks>
/// The sequence is used to track absolute order of uploaded telemetry items. It is a two-part value that includes
/// a stable identifier for the current boot session and an incrementing identifier for each event added to the upload queue:
/// For UTC this would increment for all events across the system.
/// For Persistence this would increment for all events emitted from the hosting process.
/// The Sequence helps track how many events were fired and how many events were uploaded and enables identification
/// of data lost during upload and de-duplication of events on the ingress server.
/// From <a href="https://microsoft.sharepoint.com/teams/CommonSchema/Shared%20Documents/Schema%20Specs/Common%20Schema%202%20-%20Language%20Specification.docx"/>.
/// </remarks>
string Sequence { get; set; }
/// <summary>
/// Sanitizes the properties of the telemetry item based on DP constraints.
/// </summary>
void Sanitize();
/// <summary>
/// Clones the telemetry object deeply, so that the original object and the clone share no state
/// and can be modified independently.
/// </summary>
/// <returns>The cloned object.</returns>
ITelemetry DeepClone();
/// <summary>
/// Writes serialization info about the class using the given <see cref="ISerializationWriter"/>
/// </summary>
void Serialize(ISerializationWriter serializationWriter);
}
}
|
namespace Microsoft.ApplicationInsights.Channel
{
using System;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
/// <summary>
/// The base telemetry type for application insights.
/// </summary>
public interface ITelemetry
{
/// <summary>
/// Gets or sets date and time when telemetry was recorded.
/// </summary>
DateTimeOffset Timestamp { get; set; }
/// <summary>
/// Gets the context associated with this telemetry instance.
/// </summary>
TelemetryContext Context { get; }
/// <summary>
/// Gets or sets gets the extension used to extend this telemetry instance using new strongly
/// typed object. <TODO: Write a note about customers using AI Default channels>
/// </summary>
IExtension Extension { get; set; }
/// <summary>
/// Gets or sets the value that defines absolute order of the telemetry item.
/// </summary>
/// <remarks>
/// The sequence is used to track absolute order of uploaded telemetry items. It is a two-part value that includes
/// a stable identifier for the current boot session and an incrementing identifier for each event added to the upload queue:
/// For UTC this would increment for all events across the system.
/// For Persistence this would increment for all events emitted from the hosting process.
/// The Sequence helps track how many events were fired and how many events were uploaded and enables identification
/// of data lost during upload and de-duplication of events on the ingress server.
/// From <a href="https://microsoft.sharepoint.com/teams/CommonSchema/Shared%20Documents/Schema%20Specs/Common%20Schema%202%20-%20Language%20Specification.docx"/>.
/// </remarks>
string Sequence { get; set; }
/// <summary>
/// Sanitizes the properties of the telemetry item based on DP constraints.
/// </summary>
void Sanitize();
/// <summary>
/// Clones the telemetry object deeply, so that the original object and the clone share no state
/// and can be modified independently.
/// </summary>
/// <returns>The cloned object.</returns>
ITelemetry DeepClone();
/// <summary>
/// Writes serialization info about the class using the given <see cref="ISerializationWriter"/>
/// </summary>
void Serialize(ISerializationWriter serializationWriter);
}
}
|
mit
|
C#
|
365406c0f925b1fa52bc6ddf37ca154d718fe15b
|
fix build error
|
NServiceKit/NServiceKit,timba/NServiceKit,MindTouch/NServiceKit,NServiceKit/NServiceKit,nataren/NServiceKit,ZocDoc/ServiceStack,ZocDoc/ServiceStack,timba/NServiceKit,MindTouch/NServiceKit,ZocDoc/ServiceStack,NServiceKit/NServiceKit,MindTouch/NServiceKit,nataren/NServiceKit,NServiceKit/NServiceKit,ZocDoc/ServiceStack,timba/NServiceKit,nataren/NServiceKit,nataren/NServiceKit,timba/NServiceKit,MindTouch/NServiceKit
|
src/ServiceStack.Common/ServiceClient.Web/HttpMethod.cs
|
src/ServiceStack.Common/ServiceClient.Web/HttpMethod.cs
|
using System;
namespace ServiceStack.ServiceClient.Web
{
[Obsolete("Moved to ServiceStack.Common.Web.HttpMethods")]
public static class HttpMethod
{
public const string Get = "GET";
public const string Put = "PUT";
public const string Post = "POST";
public const string Delete = "DELETE";
public const string Options = "OPTIONS";
public const string Head = "HEAD";
public const string Patch = "PATCH";
}
}
|
using System;
namespace ServiceStack.ServiceClient.Web
{
[Obsolete("Moved to ServiceStack.Common.Web.HttpMethods")]
public static class HttpMethod
{
public const string Get = "GET";
public const string Put = "PUT";
public const string Post = "POST";
public const string Delete = "DELETE";
public const string Options = "OPTIONS";
public const string Head = "HEAD";
public const string Patch = "PATCH";
}
public static class HttpMethods
{
public const string Get = "GET";
public const string Put = "PUT";
public const string Post = "POST";
public const string Delete = "DELETE";
public const string Options = "OPTIONS";
public const string Head = "HEAD";
public const string Patch = "PATCH";
public static string[] AllVerbs
{
get
{
return new string[] { Get, Put, Post, Delete, Options, Head, Patch };
}
}
}
}
|
bsd-3-clause
|
C#
|
a23901c07a748dce1d2e1ef372447b4ed1950cb5
|
Enable email address as macro parameter editor
|
umbraco/Umbraco-CMS,lars-erik/Umbraco-CMS,lars-erik/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,rasmuseeg/Umbraco-CMS,aaronpowell/Umbraco-CMS,tcmorris/Umbraco-CMS,tompipe/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,WebCentrum/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,robertjf/Umbraco-CMS,abryukhov/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,mattbrailsford/Umbraco-CMS,madsoulswe/Umbraco-CMS,tompipe/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,bjarnef/Umbraco-CMS,WebCentrum/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,rasmuseeg/Umbraco-CMS,arknu/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS,NikRimington/Umbraco-CMS,hfloyd/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,madsoulswe/Umbraco-CMS,aaronpowell/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,bjarnef/Umbraco-CMS,lars-erik/Umbraco-CMS,lars-erik/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abjerner/Umbraco-CMS,WebCentrum/Umbraco-CMS,mattbrailsford/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,leekelleher/Umbraco-CMS,abryukhov/Umbraco-CMS,lars-erik/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,hfloyd/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,tcmorris/Umbraco-CMS,arknu/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,madsoulswe/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,tompipe/Umbraco-CMS,tcmorris/Umbraco-CMS,aaronpowell/Umbraco-CMS,rasmuseeg/Umbraco-CMS,umbraco/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS
|
src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs
|
src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs
|
using Umbraco.Core;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.EmailAddressAlias, "Email address", "email", IsParameterEditor = true, Icon ="icon-message")]
public class EmailAddressPropertyEditor : PropertyEditor
{
protected override PropertyValueEditor CreateValueEditor()
{
var editor = base.CreateValueEditor();
//add an email address validator
editor.Validators.Add(new EmailValidator());
return editor;
}
protected override PreValueEditor CreatePreValueEditor()
{
return new EmailAddressePreValueEditor();
}
internal class EmailAddressePreValueEditor : PreValueEditor
{
//TODO: This doesn't seem necessary since it can be specified at the property type level - this will however be useful if/when
// we support overridden property value pre-value options.
[PreValueField("Required?", "boolean")]
public bool IsRequired { get; set; }
}
}
}
|
using Umbraco.Core;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.EmailAddressAlias, "Email address", "email", Icon="icon-message")]
public class EmailAddressPropertyEditor : PropertyEditor
{
protected override PropertyValueEditor CreateValueEditor()
{
var editor = base.CreateValueEditor();
//add an email address validator
editor.Validators.Add(new EmailValidator());
return editor;
}
protected override PreValueEditor CreatePreValueEditor()
{
return new EmailAddressePreValueEditor();
}
internal class EmailAddressePreValueEditor : PreValueEditor
{
//TODO: This doesn't seem necessary since it can be specified at the property type level - this will however be useful if/when
// we support overridden property value pre-value options.
[PreValueField("Required?", "boolean")]
public bool IsRequired { get; set; }
}
}
}
|
mit
|
C#
|
b43b84afce38dd4a9aeefa847e6a2096f93b59b0
|
Normalize newlines in json test.
|
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
|
test/AsmResolver.DotNet.Tests/Bundles/BundleFileTest.cs
|
test/AsmResolver.DotNet.Tests/Bundles/BundleFileTest.cs
|
using System.Linq;
using System.Text;
using AsmResolver.DotNet.Bundles;
using AsmResolver.PE.DotNet.Metadata.Strings;
using AsmResolver.PE.DotNet.Metadata.Tables;
using AsmResolver.PE.DotNet.Metadata.Tables.Rows;
using Xunit;
namespace AsmResolver.DotNet.Tests.Bundles
{
public class BundleFileTest
{
[Fact]
public void ReadUncompressedStringContents()
{
var manifest = BundleManifest.FromBytes(Properties.Resources.HelloWorld_SingleFile_V6);
var file = manifest.Files.First(f => f.Type == BundleFileType.RuntimeConfigJson);
string contents = Encoding.UTF8.GetString(file.GetData()).Replace("\r", "");
Assert.Equal(@"{
""runtimeOptions"": {
""tfm"": ""net6.0"",
""framework"": {
""name"": ""Microsoft.NETCore.App"",
""version"": ""6.0.0""
},
""configProperties"": {
""System.Reflection.Metadata.MetadataUpdater.IsSupported"": false
}
}
}".Replace("\r", ""), contents);
}
[Fact]
public void ReadUncompressedAssemblyContents()
{
var manifest = BundleManifest.FromBytes(Properties.Resources.HelloWorld_SingleFile_V6);
var bundleFile = manifest.Files.First(f => f.RelativePath == "HelloWorld.dll");
var embeddedImage = ModuleDefinition.FromBytes(bundleFile.GetData());
Assert.Equal("HelloWorld.dll", embeddedImage.Name);
}
}
}
|
using System.Linq;
using System.Text;
using AsmResolver.DotNet.Bundles;
using AsmResolver.PE.DotNet.Metadata.Strings;
using AsmResolver.PE.DotNet.Metadata.Tables;
using AsmResolver.PE.DotNet.Metadata.Tables.Rows;
using Xunit;
namespace AsmResolver.DotNet.Tests.Bundles
{
public class BundleFileTest
{
[Fact]
public void ReadUncompressedStringContents()
{
var manifest = BundleManifest.FromBytes(Properties.Resources.HelloWorld_SingleFile_V6);
var file = manifest.Files.First(f => f.Type == BundleFileType.RuntimeConfigJson);
string contents = Encoding.UTF8.GetString(file.GetData());
Assert.Equal(@"{
""runtimeOptions"": {
""tfm"": ""net6.0"",
""framework"": {
""name"": ""Microsoft.NETCore.App"",
""version"": ""6.0.0""
},
""configProperties"": {
""System.Reflection.Metadata.MetadataUpdater.IsSupported"": false
}
}
}", contents);
}
[Fact]
public void ReadUncompressedAssemblyContents()
{
var manifest = BundleManifest.FromBytes(Properties.Resources.HelloWorld_SingleFile_V6);
var bundleFile = manifest.Files.First(f => f.RelativePath == "HelloWorld.dll");
var embeddedImage = ModuleDefinition.FromBytes(bundleFile.GetData());
Assert.Equal("HelloWorld.dll", embeddedImage.Name);
}
}
}
|
mit
|
C#
|
a213b76347766c25512d7b9b91da37a35e001b5b
|
Update TestBrand.cs
|
plivo/plivo-dotnet,plivo/plivo-dotnet
|
tests_netcore/Plivo.NetCore.Test/Resources/TestBrand.cs
|
tests_netcore/Plivo.NetCore.Test/Resources/TestBrand.cs
|
using System.Collections.Generic;
using Xunit;
using Plivo.Http;
using Plivo.Resource;
using Plivo.Resource.Brand;
using Plivo.Utilities;
using System;
namespace Plivo.NetCore.Test.Resources
{
public class TestBrand : BaseTestCase
{
[Fact]
public void TestBrandList()
{
var data = new Dictionary<string, object>();
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/brandListResponse.json"
);
Setup<ListResponse<ListBrands>>(
200,
response
);
res = Api.Brand.List();
AssertRequest(request);
}
[Fact]
public void TestBrandGet()
{
var id = "BRPXS6E";
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/" + id + "/",
"");
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/brandGetResponse.json"
);
Setup<GetBrand>(
200,
response
);
res = Api.Brand.Get(id);
AssertRequest(request);
}
}
}
|
using System.Collections.Generic;
using Xunit;
using Plivo.Http;
using Plivo.Resource;
using Plivo.Resource.Brand;
using Plivo.Utilities;
using System;
namespace Plivo.NetCore.Test.Resources
{
public class TestBrand : BaseTestCase
{
[Fact]
public void TestBrandList()
{
var data = new Dictionary<string, object>();
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/brandListResponse.json"
);
Setup<ListResponse<ListBrands>>(
200,
response
);
res = Api.Brand.List());
AssertRequest(request);
}
[Fact]
public void TestBrandGet()
{
var id = "BRPXS6E";
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/" + id + "/",
"");
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/brandGetResponse.json"
);
Setup<GetBrand>(
200,
response
);
res = Api.Brand.Get(id));
AssertRequest(request);
}
}
}
|
mit
|
C#
|
3a101f76b3e06fc25cbbf91548ad696319d137ae
|
remove comment.
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
|
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
|
using ReactiveUI;
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.Dialogs
{
/// <summary>
/// Base ViewModel class for Dialogs that returns a value back.
/// Do not reuse all types derived from this after calling ShowDialogAsync.
/// Spawn a new instance instead after that.
/// </summary>
/// <typeparam name="TResult">The type of the value to be returned when the dialog is finished.</typeparam>
public abstract class DialogViewModelBase<TResult> : DialogViewModelBase
{
private readonly IDisposable _disposable;
private readonly TaskCompletionSource<TResult> _currentTaskCompletionSource;
protected DialogViewModelBase(NavigationStateViewModel navigationState) : base(navigationState)
{
_currentTaskCompletionSource = new TaskCompletionSource<TResult>();
_disposable = this.WhenAnyValue(x => x.IsDialogOpen)
.Skip(1) // Skip the initial value change (which is false).
.DistinctUntilChanged()
.Subscribe(OnIsDialogOpenChanged);
CancelCommand = ReactiveCommand.Create(() => Close());
}
protected override void OnNavigatedFrom()
{
Close();
base.OnNavigatedFrom();
}
private void OnIsDialogOpenChanged(bool dialogState)
{
// Triggered when closed abruptly (via the dialog overlay or the back button).
if (!dialogState)
{
Close();
}
}
/// <summary>
/// Method to be called when the dialog intends to close
/// and ready to pass a value back to the caller.
/// </summary>
/// <param name="value">The return value of the dialog</param>
protected void Close(TResult value = default)
{
if (_currentTaskCompletionSource.Task.IsCompleted)
{
return;
}
_currentTaskCompletionSource.SetResult(value);
_disposable.Dispose();
IsDialogOpen = false;
OnDialogClosed();
}
/// <summary>
/// Shows the dialog.
/// </summary>
/// <returns>The value to be returned when the dialog is finished.</returns>
public Task<TResult> ShowDialogAsync(IDialogHost? host = null)
{
if (host is null)
{
host = MainViewModel.Instance;
}
if (host is { })
{
host.CurrentDialog = this;
}
IsDialogOpen = true;
return _currentTaskCompletionSource.Task;
}
/// <summary>
/// Gets the dialog result.
/// </summary>
/// <returns>The value to be returned when the dialog is finished.</returns>
public Task<TResult> GetDialogResultAsync()
{
IsDialogOpen = true;
return _currentTaskCompletionSource.Task;
}
/// <summary>
/// Method that is triggered when the dialog is closed.
/// </summary>
protected abstract void OnDialogClosed();
}
}
|
using ReactiveUI;
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.Dialogs
{
/// <summary>
/// Base ViewModel class for Dialogs that returns a value back.
/// Do not reuse all types derived from this after calling ShowDialogAsync.
/// Spawn a new instance instead after that.
/// </summary>
/// <typeparam name="TResult">The type of the value to be returned when the dialog is finished.</typeparam>
public abstract class DialogViewModelBase<TResult> : DialogViewModelBase
{
private readonly IDisposable _disposable;
private readonly TaskCompletionSource<TResult> _currentTaskCompletionSource;
protected DialogViewModelBase(NavigationStateViewModel navigationState) : base(navigationState)
{
_currentTaskCompletionSource = new TaskCompletionSource<TResult>();
_disposable = this.WhenAnyValue(x => x.IsDialogOpen)
.Skip(1) // Skip the initial value change (which is false).
.DistinctUntilChanged()
.Subscribe(OnIsDialogOpenChanged);
CancelCommand = ReactiveCommand.Create(() => Close());
// this.WhenNavigatedTo(() => Disposable.Create(() => Close()));
}
protected override void OnNavigatedFrom()
{
Close();
base.OnNavigatedFrom();
}
private void OnIsDialogOpenChanged(bool dialogState)
{
// Triggered when closed abruptly (via the dialog overlay or the back button).
if (!dialogState)
{
Close();
}
}
/// <summary>
/// Method to be called when the dialog intends to close
/// and ready to pass a value back to the caller.
/// </summary>
/// <param name="value">The return value of the dialog</param>
protected void Close(TResult value = default)
{
if (_currentTaskCompletionSource.Task.IsCompleted)
{
return;
}
_currentTaskCompletionSource.SetResult(value);
_disposable.Dispose();
IsDialogOpen = false;
OnDialogClosed();
}
/// <summary>
/// Shows the dialog.
/// </summary>
/// <returns>The value to be returned when the dialog is finished.</returns>
public Task<TResult> ShowDialogAsync(IDialogHost? host = null)
{
if (host is null)
{
host = MainViewModel.Instance;
}
if (host is { })
{
host.CurrentDialog = this;
}
IsDialogOpen = true;
return _currentTaskCompletionSource.Task;
}
/// <summary>
/// Gets the dialog result.
/// </summary>
/// <returns>The value to be returned when the dialog is finished.</returns>
public Task<TResult> GetDialogResultAsync()
{
IsDialogOpen = true;
return _currentTaskCompletionSource.Task;
}
/// <summary>
/// Method that is triggered when the dialog is closed.
/// </summary>
protected abstract void OnDialogClosed();
}
}
|
mit
|
C#
|
0969455179b4fc298b4260b13492d0ae790ad720
|
fix build
|
konradsikorski/smartCAML
|
KoS.Apps.SharePoint.SmartCAML/KoS.Apps.SharePoint.SmartCAML.SharePointProvider/SharePointProviderType.cs
|
KoS.Apps.SharePoint.SmartCAML/KoS.Apps.SharePoint.SmartCAML.SharePointProvider/SharePointProviderType.cs
|
namespace KoS.Apps.SharePoint.SmartCAML.SharePointProvider
{
public enum SharePointProviderType
{
Fake = 0,
SharePoint2013ServerModel = 1,
SharePoint2013ClientModel = 2,
SharePointOnline
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KoS.Apps.SharePoint.SmartCAML.SharePointProvider
{
public enum SharePointProviderType
{
Fake = 0,
SharePoint2010ServerModel = 1,
SharePoint2010ClientModel = 2,
SharePoint2013ServerModel = 3,
SharePoint2013ClientModel = 4
}
}
|
apache-2.0
|
C#
|
0dd5ba61ab102062bf026f5dcea10b23210380cc
|
Clean up unused culture attribute
|
KevinJump/Umbraco-CMS,NikRimington/Umbraco-CMS,rasmuseeg/Umbraco-CMS,hfloyd/Umbraco-CMS,bjarnef/Umbraco-CMS,tcmorris/Umbraco-CMS,madsoulswe/Umbraco-CMS,tcmorris/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,bjarnef/Umbraco-CMS,arknu/Umbraco-CMS,rasmuseeg/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,NikRimington/Umbraco-CMS,hfloyd/Umbraco-CMS,madsoulswe/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,rasmuseeg/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,bjarnef/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,KevinJump/Umbraco-CMS,NikRimington/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,mattbrailsford/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS
|
src/Umbraco.Web/WebApi/Filters/HttpQueryStringFilterAttribute.cs
|
src/Umbraco.Web/WebApi/Filters/HttpQueryStringFilterAttribute.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace Umbraco.Web.WebApi.Filters
{
/// <summary>
/// Allows an Action to execute with an arbitrary number of QueryStrings
/// </summary>
/// <remarks>
/// Just like you can POST an arbitrary number of parameters to an Action, you can't GET an arbitrary number
/// but this will allow you to do it
/// </remarks>
public sealed class HttpQueryStringFilterAttribute : ActionFilterAttribute
{
public string ParameterName { get; private set; }
public HttpQueryStringFilterAttribute(string parameterName)
{
if (string.IsNullOrEmpty(parameterName))
throw new ArgumentException("ParameterName is required.");
ParameterName = parameterName;
}
public override void OnActionExecuting(HttpActionContext actionContext)
{
//get the query strings from the request properties
if (actionContext.Request.Properties.ContainsKey("MS_QueryNameValuePairs"))
{
var queryStrings = actionContext.Request.Properties["MS_QueryNameValuePairs"] as IEnumerable<KeyValuePair<string, string>>;
if (queryStrings == null) return;
var queryStringKeys = queryStrings.Select(kvp => kvp.Key).ToArray();
var additionalParameters = new Dictionary<string, string>();
if(queryStringKeys.Contains("culture") == false) {
additionalParameters["culture"] = actionContext.Request.ClientCulture();
}
var formData = new FormDataCollection(queryStrings.Union(additionalParameters));
actionContext.ActionArguments[ParameterName] = formData;
}
base.OnActionExecuting(actionContext);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace Umbraco.Web.WebApi.Filters
{
/// <summary>
/// Allows an Action to execute with an arbitrary number of QueryStrings
/// </summary>
/// <remarks>
/// Just like you can POST an arbitrary number of parameters to an Action, you can't GET an arbitrary number
/// but this will allow you to do it
/// </remarks>
public sealed class HttpQueryStringFilterAttribute : ActionFilterAttribute
{
public string ParameterName { get; private set; }
public HttpQueryStringFilterAttribute(string parameterName)
{
if (string.IsNullOrEmpty(parameterName))
throw new ArgumentException("ParameterName is required.");
ParameterName = parameterName;
}
public override void OnActionExecuting(HttpActionContext actionContext)
{
//get the query strings from the request properties
if (actionContext.Request.Properties.ContainsKey("MS_QueryNameValuePairs"))
{
var queryStrings = actionContext.Request.Properties["MS_QueryNameValuePairs"] as IEnumerable<KeyValuePair<string, string>>;
if (queryStrings == null) return;
var queryStringKeys = queryStrings.Select(kvp => kvp.Key).ToArray();
var additionalParameters = new Dictionary<string, string>();
if(queryStringKeys.Contains("culture") == false) {
additionalParameters["culture"] = actionContext.Request.ClientCulture();
}
var formData = new FormDataCollection(queryStrings.Union(additionalParameters));
actionContext.ActionArguments[ParameterName] = formData;
}
base.OnActionExecuting(actionContext);
}
}
public sealed class UnwrapClientCultureFilterAttribute : ActionFilterAttribute
{
private readonly string _parameterName;
public UnwrapClientCultureFilterAttribute(string parameterName = "culture")
{
if (string.IsNullOrEmpty(parameterName))
throw new ArgumentException("ParameterName is required.");
_parameterName = parameterName;
}
public override void OnActionExecuting(HttpActionContext actionContext)
{
if (actionContext.ActionArguments.ContainsKey(_parameterName) && string.IsNullOrWhiteSpace(actionContext.ActionArguments[_parameterName]?.ToString()) == false)
{
return;
}
actionContext.ActionArguments[_parameterName] = actionContext.Request.ClientCulture();
base.OnActionExecuting(actionContext);
}
}
}
|
mit
|
C#
|
77c0b8dfa937a76ed071b1c195e4e2f6939a7080
|
Fix stray typo
|
smoogipoo/osu,peppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,ppy/osu,NeoAdonis/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu
|
osu.Game/Migrations/20180628011956_RemoveNegativeSetIDs.cs
|
osu.Game/Migrations/20180628011956_RemoveNegativeSetIDs.cs
|
using Microsoft.EntityFrameworkCore.Migrations;
namespace osu.Game.Migrations
{
public partial class RemoveNegativeSetIDs : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// There was a change that beatmaps were being loaded with "-1" online IDs, which is completely incorrect.
// This ensures there will not be unique key conflicts as a result of these incorrectly imported beatmaps.
migrationBuilder.Sql("UPDATE BeatmapSetInfo SET OnlineBeatmapSetID = null WHERE OnlineBeatmapSetID <= 0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
|
using Microsoft.EntityFrameworkCore.Migrations;
namespace osu.Game.Migrations
{
public partial class RemoveNegativeSetIDs : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// There was a change that baetmaps were being loaded with "-1" online IDs, which is completely incorrect.
// This ensures there will not be unique key conflicts as a result of these incorrectly imported beatmaps.
migrationBuilder.Sql("UPDATE BeatmapSetInfo SET OnlineBeatmapSetID = null WHERE OnlineBeatmapSetID <= 0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
|
mit
|
C#
|
017319c9b45cc6451c91703b8772e6878de23f2e
|
Bump version.
|
EamonNerbonne/a-vs-an,EamonNerbonne/a-vs-an,EamonNerbonne/a-vs-an,EamonNerbonne/a-vs-an
|
A-vs-An/A-vs-An-DotNet/Properties/AssemblyInfo.cs
|
A-vs-An/A-vs-An-DotNet/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("AvsAn")]
[assembly: AssemblyDescription("Find the english language indeterminate article ('a' or 'an') for a word. Based on real usage patterns extracted from the wikipedia text dump; can therefore even deal with tricky edge cases such as acronyms (FIAT vs. FAA, NASA vs. NSA) and odd symbols. (Requires .NET 2.0 or higher)")]
[assembly: AssemblyCompany("Eamon Nerbonne")]
[assembly: AssemblyProduct("AvsAn")]
[assembly: AssemblyCopyright("Copyright Eamon Nerbonne © 2014")]
// 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("2b71f785-8bd8-4579-acfa-6e7bc523d475")]
[assembly: InternalsVisibleTo("WikipediaAvsAnTrieExtractor")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2.1")]
|
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("AvsAn")]
[assembly: AssemblyDescription("Find the english language indeterminate article ('a' or 'an') for a word. Based on real usage patterns extracted from the wikipedia text dump; can therefore even deal with tricky edge cases such as acronyms (FIAT vs. FAA, NASA vs. NSA) and odd symbols. (Requires .NET 2.0 or higher)")]
[assembly: AssemblyCompany("Eamon Nerbonne")]
[assembly: AssemblyProduct("AvsAn")]
[assembly: AssemblyCopyright("Copyright Eamon Nerbonne © 2014")]
// 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("2b71f785-8bd8-4579-acfa-6e7bc523d475")]
[assembly: InternalsVisibleTo("WikipediaAvsAnTrieExtractor")]
// 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.0")]
|
apache-2.0
|
C#
|
35edef1aef0bad8360f203848a07d23c46e72180
|
Update to Castle Rock header text
|
opencolorado/.NET-Wrapper-for-CKAN-API,DenverDev/.NET-Wrapper-for-CKAN-API,opencolorado/.NET-Wrapper-for-CKAN-API,DenverDev/.NET-Wrapper-for-CKAN-API,opencolorado/.NET-Wrapper-for-CKAN-API
|
CkanDotNet.Web/Views/Theme/CastleRock/_HomeHeader.cshtml
|
CkanDotNet.Web/Views/Theme/CastleRock/_HomeHeader.cshtml
|
@using CkanDotNet.Web.Models.Helpers
<p>As part of an initiative to improve the accessibility, transparency, and
accountability of the Town of Castle Rock, this catalog provides open access to town-managed data.
</p>
@if (SettingsHelper.GetUserVoiceEnabled()) {
<p>We invite you to actively participate in shaping the future of this data catalog by
<a href="javascript:UserVoice.showPopupWidget();" title="Suggest additional datasets">suggesting additional datasets</a>
or building applications with the available data.</p>
}
<p><span class="header-package-count">@Html.Action("PackageCount", "Widget") registered datasets are available.</span></p>
|
@using CkanDotNet.Web.Models.Helpers
<p>As part of an initiative to improve the accessibility, transparency, and
accountability of the Town of Castle Rock, this catalog provides open access to City-managed data.
</p>
@if (SettingsHelper.GetUserVoiceEnabled()) {
<p>We invite you to actively participate in shaping the future of this data catalog by
<a href="javascript:UserVoice.showPopupWidget();" title="Suggest additional datasets">suggesting additional datasets</a>
or building applications with the available data.</p>
}
<p><span class="header-package-count">@Html.Action("PackageCount", "Widget") registered datasets are available.</span></p>
|
apache-2.0
|
C#
|
7082785eadfbe3088079a26996588210159c5497
|
Update to Problem 10. Fibonacci Numbers
|
SimoPrG/CSharpPart1Homework
|
Console-IO-Homework/FibonacciNumbers/FibonacciNumbers.cs
|
Console-IO-Homework/FibonacciNumbers/FibonacciNumbers.cs
|
/*Problem 10. Fibonacci Numbers
Write a program that reads a number n and prints on the console the first n members of the Fibonacci sequence
(at a single line, separated by comma and space - ,) : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ….
Note: You may need to learn how to use loops.
Examples:
n comments
1 0
3 0 1 1
10 0 1 1 2 3 5 8 13 21 34
*/
using System;
class FibonacciNumbers
{
static void Main()
{
Console.Title = "Fibonacci Numbers"; //Changing the title of the console.
Console.Write("Enter an integer n to see the first n members of the Fibonacci sequence: ");
int n = int.Parse(Console.ReadLine());
string[] fiboMembers = new string[n]; // This array will keep the members of the Fibonacci sequence.
for (long i = 0, a = 0, b = 1; i < n; i++)// In the for loop we declare a counter i and the first two members of the sequence (0 and 1).
{
fiboMembers[i] = a.ToString(); //We convert the member to string and we place it in its array position.
b = a + b;//Then we add the previous member to the next member.
a = b - a;//From the new next member we substract the previous member. (b=a+b and so b - a is a+b - a = b)
}
Console.WriteLine(string.Join(", ",fiboMembers)); //Creating a string in the requested format and printing it.
Console.ReadKey(); // Keeping the console opened.
}
}
|
/*Problem 10. Fibonacci Numbers
Write a program that reads a number n and prints on the console the first n members of the Fibonacci sequence
(at a single line, separated by comma and space - ,) : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ….
Note: You may need to learn how to use loops.
Examples:
n comments
1 0
3 0 1 1
10 0 1 1 2 3 5 8 13 21 34
*/
using System;
class FibonacciNumbers
{
static void Main()
{
Console.Title = "Fibonacci Numbers"; //Changing the title of the console.
Console.Write("Enter an integer n to see the first n members of the Fibonacci sequence: ");
int n = int.Parse(Console.ReadLine());
string[] fiboMembers = new string[n]; // This array will keep the members of the Fibonacci sequence.
for (long i = 0, previousMember = 0, nextMember = 1, temp; i < n; i++)
// In the for loop we declare the first two members of the sequence (0 and 1) and a temp variable
// needed for the calculations.
{
fiboMembers[i] = previousMember.ToString(); //We convert the member to string and we place it in its array position.
temp = nextMember;//After that we assign the value of the next member to temp.
nextMember += previousMember;//Then we add the previous member to the next member.
previousMember = temp;//Finally, we assign the value of the temp to the previous member.
}
Console.WriteLine(string.Join(", ",fiboMembers)); //Creating a string in the requested format and printing it.
Console.ReadKey(); // Keeping the console opened.
}
}
|
mit
|
C#
|
70c95da106bbc997d4f63a3915f5da363a4bcb68
|
remove settingfields.none
|
AsrOneSdk/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,markcowl/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,stankovski/azure-sdk-for-net,hyonholee/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,hyonholee/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,stankovski/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,hyonholee/azure-sdk-for-net,hyonholee/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net
|
src/SDKs/Azure.ApplicationModel.Configuration/data-plane/Azure.ApplicationModel.Configuration/SettingFields.cs
|
src/SDKs/Azure.ApplicationModel.Configuration/data-plane/Azure.ApplicationModel.Configuration/SettingFields.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
using System;
namespace Azure.ApplicationModel.Configuration
{
[Flags]
public enum SettingFields : uint
{
Key = 0x0001,
Label = 0x0002,
Value = 0x0004,
ContentType = 0x0008,
ETag = 0x0010,
LastModified = 0x0020,
Locked = 0x0040,
Tags = 0x0080,
All = uint.MaxValue
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
using System;
namespace Azure.ApplicationModel.Configuration
{
[Flags]
public enum SettingFields : uint
{
None = 0x0000,
Key = 0x0001,
Label = 0x0002,
Value = 0x0004,
ContentType = 0x0008,
ETag = 0x0010,
LastModified = 0x0020,
Locked = 0x0040,
Tags = 0x0080,
All = uint.MaxValue
}
}
|
mit
|
C#
|
ac7d56ecdbe334b831f733b6230e08702bcb1830
|
Remove unused constructor and dependencies
|
larsbrubaker/MatterControl,mmoening/MatterControl,jlewin/MatterControl,jlewin/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,unlimitedbacon/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,mmoening/MatterControl,mmoening/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,larsbrubaker/MatterControl
|
MatterControlLib/SlicerConfiguration/SliceSettingData.cs
|
MatterControlLib/SlicerConfiguration/SliceSettingData.cs
|
/*
Copyright (c) 2018, Kevin Pope, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
public class QuickMenuNameValue
{
public string MenuName;
public string Value;
}
public class SliceSettingData
{
[JsonConverter(typeof(StringEnumConverter))]
public enum DataEditTypes { STRING, READONLY_STRING, WIDE_STRING, INT, INT_OR_MM, DOUBLE, POSITIVE_DOUBLE, OFFSET, DOUBLE_OR_PERCENT, VECTOR2, OFFSET2, CHECK_BOX, LIST, MULTI_LINE_TEXT, MARKDOWN_TEXT, HARDWARE_PRESENT, COM_PORT, IP_LIST };
public string SlicerConfigName { get; set; }
public string PresentationName { get; set; }
public string ShowIfSet { get; set; }
public string EnableIfSet { get; set; }
public string DefaultValue { get; set; }
public DataEditTypes DataEditType { get; set; }
public string HelpText { get; set; } = "";
public string Units { get; set; } = "";
public string ListValues { get; set; } = "";
public bool ShowAsOverride { get; set; } = true;
public List<QuickMenuNameValue> QuickMenuSettings = new List<QuickMenuNameValue>();
public List<Dictionary<string, string>> SetSettingsOnChange = new List<Dictionary<string,string>>();
public bool ResetAtEndOfPrint { get; set; } = false;
public bool RebuildGCodeOnChange { get; set; } = true;
public bool ReloadUiWhenChanged { get; set; } = false;
public SettingsOrganizer.SubGroup OrganizerSubGroup { get; set; }
}
}
|
/*
Copyright (c) 2018, Kevin Pope, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System.Collections.Generic;
using MatterHackers.Localizations;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
public class QuickMenuNameValue
{
public string MenuName;
public string Value;
}
public class SliceSettingData
{
[JsonConverter(typeof(StringEnumConverter))]
public enum DataEditTypes { STRING, READONLY_STRING, WIDE_STRING, INT, INT_OR_MM, DOUBLE, POSITIVE_DOUBLE, OFFSET, DOUBLE_OR_PERCENT, VECTOR2, OFFSET2, CHECK_BOX, LIST, MULTI_LINE_TEXT, MARKDOWN_TEXT, HARDWARE_PRESENT, COM_PORT, IP_LIST };
public string SlicerConfigName { get; set; }
public string PresentationName { get; set; }
public string ShowIfSet { get; set; }
public string EnableIfSet { get; set; }
public string DefaultValue { get; set; }
public DataEditTypes DataEditType { get; set; }
public string HelpText { get; set; } = "";
public string Units { get; set; } = "";
public string ListValues { get; set; } = "";
public bool ShowAsOverride { get; set; } = true;
public List<QuickMenuNameValue> QuickMenuSettings = new List<QuickMenuNameValue>();
public List<Dictionary<string, string>> SetSettingsOnChange = new List<Dictionary<string,string>>();
public bool ResetAtEndOfPrint { get; set; } = false;
public bool RebuildGCodeOnChange { get; set; } = true;
public bool ReloadUiWhenChanged { get; set; } = false;
public SettingsOrganizer.SubGroup OrganizerSubGroup { get; set; }
public SliceSettingData(string slicerConfigName, string presentationName, DataEditTypes dataEditType, string helpText = "")
{
// During deserialization Json.net has to call this constructor but may fail to find the optional ExtraSettings
// value. When this occurs, it passes null overriding the default empty string. To ensure empty string instead
// of null, we conditionally reassign "" if null
this.SlicerConfigName = slicerConfigName;
this.PresentationName = presentationName;
this.DataEditType = dataEditType;
this.HelpText = helpText.Localize();
}
}
}
|
bsd-2-clause
|
C#
|
2a5a3f5992663ce45a0e4080f03514eb4946ee5c
|
Change default HttpTimeout to 120 seconds
|
MrHant/tiver-fowl.Drivers,MrHant/tiver-fowl.Drivers
|
Tiver.Fowl.Drivers/Configuration/DriversConfiguration.cs
|
Tiver.Fowl.Drivers/Configuration/DriversConfiguration.cs
|
using System.IO;
using System.Reflection;
namespace Tiver.Fowl.Drivers.Configuration
{
public class DriversConfiguration
{
/// <summary>
/// Location for binaries to be saved
/// Defaults to assembly location
/// </summary>
public string DownloadLocation { get; set; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
/// <summary>
/// Configured driver instances
/// </summary>
public DriverElement[] Drivers { get; set; } = {};
/// <summary>
/// Timeout to be used for HTTP requests
/// Value in seconds
/// </summary>
public int HttpTimeout { get; set; } = 120;
}
}
|
using System.IO;
using System.Reflection;
namespace Tiver.Fowl.Drivers.Configuration
{
public class DriversConfiguration
{
/// <summary>
/// Location for binaries to be saved
/// Defaults to assembly location
/// </summary>
public string DownloadLocation { get; set; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
/// <summary>
/// Configured driver instances
/// </summary>
public DriverElement[] Drivers { get; set; } = {};
/// <summary>
/// Timeout to be used for HTTP requests
/// Value in seconds
/// </summary>
public int HttpTimeout { get; set; } = 100;
}
}
|
mit
|
C#
|
705bd5f766cce0ace4c2dfe8269c32c33a8e0b02
|
Use new labels
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Fluent/ViewModels/TestLineChartViewModel.cs
|
WalletWasabi.Fluent/ViewModels/TestLineChartViewModel.cs
|
using System.Collections.Generic;
namespace WalletWasabi.Fluent.ViewModels
{
public class TestLineChartViewModel
{
public List<double> Values => new List<double>()
{
15,
22,
44,
50,
64,
68,
92,
114,
118,
142,
182,
222,
446,
548,
600
};
public List<string> Labels => new List<string>()
{
"6d",
"4d",
"3d",
"1d",
"22h",
"20h",
"18h",
"10h",
"6h",
"4h",
"2h",
"1h",
"50m",
"30m",
"20m"
};
// public List<string> Labels => new List<string>()
// {
// "6 days",
// "4 days",
// "3 days",
// "1 day",
// "22 hours",
// "20 hours",
// "18 hours",
// "10 hours",
// "6 hours",
// "4 hours",
// "2 hours",
// "1 hour",
// "50 min",
// "30 min",
// "20 min"
// };
}
}
|
using System.Collections.Generic;
namespace WalletWasabi.Fluent.ViewModels
{
public class TestLineChartViewModel
{
public List<double> Values => new List<double>()
{
15,
22,
44,
50,
64,
68,
92,
114,
118,
142,
182,
222,
446,
548,
600
};
public List<string> Labels => new List<string>()
{
"6 days",
"4 days",
"3 days",
"1 day",
"22 hours",
"20 hours",
"18 hours",
"10 hours",
"6 hours",
"4 hours",
"2 hours",
"1 hour",
"50 min",
"30 min",
"20 min"
};
}
}
|
mit
|
C#
|
eda7b081fa0b91c1dd41a647e647d65438823196
|
Support complex field- and record separators
|
arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5
|
src/Arkivverket.Arkade/Core/Addml/Definitions/Separator.cs
|
src/Arkivverket.Arkade/Core/Addml/Definitions/Separator.cs
|
using System;
using System.Collections.Generic;
using Arkivverket.Arkade.Util;
namespace Arkivverket.Arkade.Core.Addml.Definitions
{
public class Separator
{
private static readonly Dictionary<string, string> SpecialSeparators = new Dictionary<string, string>
{
{"CRLF", "\r\n"},
{"LF", "\n"}
};
public static readonly Separator CRLF = new Separator("CRLF");
private readonly string _name;
private readonly string _separator;
public Separator(string separator)
{
Assert.AssertNotNullOrEmpty("separator", separator);
_name = separator;
_separator = Convert(separator);
}
public string Get()
{
return _separator;
}
public override string ToString()
{
return _name;
}
protected bool Equals(Separator other)
{
return string.Equals(_name, other._name);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Separator) obj);
}
public override int GetHashCode()
{
return _name?.GetHashCode() ?? 0;
}
private static string Convert(string separator)
{
foreach (string key in SpecialSeparators.Keys)
if (separator.Contains(key))
separator = separator.Replace(key, SpecialSeparators[key]);
return separator;
}
internal int GetLength()
{
return _separator.Length;
}
}
}
|
using System;
using System.Collections.Generic;
using Arkivverket.Arkade.Util;
namespace Arkivverket.Arkade.Core.Addml.Definitions
{
public class Separator
{
private static readonly Dictionary<string, string> SpecialSeparators = new Dictionary<string, string>
{
{"CRLF", "\r\n"},
{"LF", "\n"}
};
public static readonly Separator CRLF = new Separator("CRLF");
private readonly string _name;
private readonly string _separator;
public Separator(string separator)
{
Assert.AssertNotNullOrEmpty("separator", separator);
_name = separator;
_separator = Convert(separator);
}
public string Get()
{
return _separator;
}
public override string ToString()
{
return _name;
}
protected bool Equals(Separator other)
{
return string.Equals(_name, other._name);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Separator) obj);
}
public override int GetHashCode()
{
return _name?.GetHashCode() ?? 0;
}
private string Convert(string s)
{
return SpecialSeparators.ContainsKey(s) ? SpecialSeparators[s] : s;
}
internal int GetLength()
{
return _separator.Length;
}
}
}
|
agpl-3.0
|
C#
|
d10cf47c1eef0a7974f162285310b38df4621f3f
|
Add equality methods to MethodImplementation.
|
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
|
src/AsmResolver.DotNet/MethodImplementation.cs
|
src/AsmResolver.DotNet/MethodImplementation.cs
|
using System;
namespace AsmResolver.DotNet
{
/// <summary>
/// Defines an explicit implementation of a method defined by an interface.
/// </summary>
public readonly struct MethodImplementation : IEquatable<MethodImplementation>
{
/// <summary>
/// Creates a new explicit implementation of a method.
/// </summary>
/// <param name="declaration">The interface method that is implemented.</param>
/// <param name="body">The method implementing the base method.</param>
public MethodImplementation(IMethodDefOrRef? declaration, IMethodDefOrRef? body)
{
Declaration = declaration;
Body = body;
}
/// <summary>
/// Gets the interface method that is implemented.
/// </summary>
public IMethodDefOrRef? Declaration
{
get;
}
/// <summary>
/// Gets the method that implements the base method.
/// </summary>
public IMethodDefOrRef? Body
{
get;
}
/// <inheritdoc />
public override string ToString() => $".override {Declaration} with {Body}";
/// <summary>
/// Determines whether two method implementations record are equal.
/// </summary>
/// <param name="other">The other implementation record.</param>
/// <returns><c>true</c> if they are considered equal, <c>false</c> otherwise.</returns>
public bool Equals(MethodImplementation other)
{
return Equals(Declaration, other.Declaration) && Equals(Body, other.Body);
}
/// <inheritdoc />
public override bool Equals(object? obj)
{
return obj is MethodImplementation other && Equals(other);
}
/// <inheritdoc />
public override int GetHashCode()
{
unchecked
{
return ((Declaration != null ? Declaration.GetHashCode() : 0) * 397) ^ (Body != null ? Body.GetHashCode() : 0);
}
}
}
}
|
namespace AsmResolver.DotNet
{
/// <summary>
/// Defines an explicit implementation of a method defined by an interface.
/// </summary>
public readonly struct MethodImplementation
{
/// <summary>
/// Creates a new explicit implementation of a method.
/// </summary>
/// <param name="declaration">The interface method that is implemented.</param>
/// <param name="body">The method implementing the base method.</param>
public MethodImplementation(IMethodDefOrRef? declaration, IMethodDefOrRef? body)
{
Declaration = declaration;
Body = body;
}
/// <summary>
/// Gets the interface method that is implemented.
/// </summary>
public IMethodDefOrRef? Declaration
{
get;
}
/// <summary>
/// Gets the method that implements the base method.
/// </summary>
public IMethodDefOrRef? Body
{
get;
}
/// <inheritdoc />
public override string ToString() =>
$".override {Declaration} with {Body}";
}
}
|
mit
|
C#
|
791b2adabe05303c26be9d3ba9113e0e04dcfb28
|
Remove unused ctor
|
AlexanderSher/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS
|
src/Common/Core/Test/Registry/RegistryMocks.cs
|
src/Common/Core/Test/Registry/RegistryMocks.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.Common.Core.OS;
using Microsoft.Win32;
namespace Microsoft.Common.Core.Test.Registry {
public sealed class RegistryMock : IRegistry {
private readonly RegistryKeyMock[] _keys;
public RegistryMock(RegistryKeyMock[] keys) {
_keys = keys;
}
public IRegistryKey OpenBaseKey(RegistryHive hive, RegistryView view) {
return new RegistryBaseKeyMock(_keys);
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.Common.Core.OS;
using Microsoft.Win32;
namespace Microsoft.Common.Core.Test.Registry {
public sealed class RegistryMock : IRegistry {
private readonly RegistryKeyMock[] _keys;
public RegistryMock(): this(new RegistryKeyMock[0]) { }
public RegistryMock(RegistryKeyMock[] keys) {
_keys = keys;
}
public IRegistryKey OpenBaseKey(RegistryHive hive, RegistryView view) {
return new RegistryBaseKeyMock(_keys);
}
}
}
|
mit
|
C#
|
8ea473a00165cc9da021a40ee076d0077aaa8961
|
Format Format0SubTable
|
SixLabors/Fonts
|
src/SixLabors.Fonts/Tables/General/CMap/Format0SubTable.cs
|
src/SixLabors.Fonts/Tables/General/CMap/Format0SubTable.cs
|
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Collections.Generic;
using SixLabors.Fonts.WellKnownIds;
namespace SixLabors.Fonts.Tables.General.CMap
{
internal sealed class Format0SubTable : CMapSubTable
{
public Format0SubTable(ushort language, PlatformIDs platform, ushort encoding, byte[] glyphIds)
: base(platform, encoding, 0)
{
this.Language = language;
this.GlyphIds = glyphIds;
}
public ushort Language { get; }
public byte[] GlyphIds { get; }
public override ushort GetGlyphId(int codePoint)
{
uint b = (uint)codePoint;
if (b >= this.GlyphIds.Length)
{
return 0;
}
return this.GlyphIds[b];
}
public static IEnumerable<Format0SubTable> Load(IEnumerable<EncodingRecord> encodings, BinaryReader reader)
{
// format has already been read by this point skip it
ushort length = reader.ReadUInt16();
ushort language = reader.ReadUInt16();
int glyphsCount = length - 6;
// char 'A' == 65 thus glyph = glyphIds[65];
byte[] glyphIds = reader.ReadBytes(glyphsCount);
foreach (EncodingRecord encoding in encodings)
{
yield return new Format0SubTable(language, encoding.PlatformID, encoding.EncodingID, glyphIds);
}
}
}
}
|
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Collections.Generic;
using SixLabors.Fonts.WellKnownIds;
namespace SixLabors.Fonts.Tables.General.CMap
{
internal sealed class Format0SubTable : CMapSubTable
{
internal byte[] GlyphIds { get; }
public Format0SubTable(ushort language, PlatformIDs platform, ushort encoding, byte[] glyphIds)
: base(platform, encoding, 0)
{
this.Language = language;
this.GlyphIds = glyphIds;
}
public ushort Language { get; }
public override ushort GetGlyphId(int codePoint)
{
uint b = (uint)codePoint;
if (b >= this.GlyphIds.Length)
{
return 0;
}
return this.GlyphIds[b];
}
public static IEnumerable<Format0SubTable> Load(IEnumerable<EncodingRecord> encodings, BinaryReader reader)
{
// format has already been read by this point skip it
ushort length = reader.ReadUInt16();
ushort language = reader.ReadUInt16();
int glyphsCount = length - 6;
// char 'A' == 65 thus glyph = glyphIds[65];
byte[] glyphIds = reader.ReadBytes(glyphsCount);
foreach (EncodingRecord encoding in encodings)
{
yield return new Format0SubTable(language, encoding.PlatformID, encoding.EncodingID, glyphIds);
}
}
}
}
|
apache-2.0
|
C#
|
3da117a50f0d28882579066452057926d7a3536a
|
Use awake in GameController
|
emazzotta/unity-tower-defense
|
Assets/Scripts/GameController.cs
|
Assets/Scripts/GameController.cs
|
using UnityEngine;
using System.Collections;
public class GameController : MonoBehaviour {
public GameObject towerBaseWrap;
public GameObject originalTowerBase;
public GameObject gameField;
private GameObject[,] towerBases;
private GameObject[] waypoints;
private int gameFieldWidth = 0;
private int gameFieldHeight = 0;
private Color wayColor;
void Awake () {
this.wayColor = Color.Lerp(Color.red, Color.green, 0F);
this.gameFieldWidth = (int)(gameField.transform.localScale.x);
this.gameFieldHeight = (int)(gameField.transform.localScale.z);
this.towerBases = new GameObject[this.gameFieldWidth, this.gameFieldHeight];
this.waypoints = new GameObject[this.gameFieldWidth];
this.initGamePlatform ();
this.drawWaypoint ();
}
void initGamePlatform() {
for (int x = 0; x < this.gameFieldWidth; x++) {
for (int z = 0; z < this.gameFieldHeight; z++) {
GameObject newTowerBase = Instantiate (originalTowerBase);
newTowerBase.GetComponent<TowerBaseController>().setBuildable(true);
newTowerBase.transform.position = new Vector3 (originalTowerBase.transform.position.x + x, 0.1f, originalTowerBase.transform.position.z - z);
this.towerBases [x, z] = newTowerBase;
newTowerBase.transform.SetParent (towerBaseWrap.transform);
}
}
Destroy (originalTowerBase);
}
void drawWaypoint() {
for (int x = 0; x < this.gameFieldWidth; x++) {
GameObject baseZ = this.towerBases [x, 5];
baseZ.GetComponent<Renderer> ().material.color = wayColor;
baseZ.GetComponent<TowerBaseController>().setBuildable(false);
this.waypoints[x] = baseZ;
}
}
public GameObject[] getWaypoints() {
return this.waypoints;
}
}
|
using UnityEngine;
using System.Collections;
public class GameController : MonoBehaviour {
public GameObject towerBaseWrap;
public GameObject originalTowerBase;
public GameObject gameField;
private GameObject[,] towerBases;
private GameObject[] waypoints;
private int gameFieldWidth = 0;
private int gameFieldHeight = 0;
private Color wayColor;
void Start () {
this.wayColor = Color.Lerp(Color.red, Color.green, 0F);
this.gameFieldWidth = (int)(gameField.transform.localScale.x);
this.gameFieldHeight = (int)(gameField.transform.localScale.z);
this.towerBases = new GameObject[this.gameFieldWidth, this.gameFieldHeight];
this.waypoints = new GameObject[this.gameFieldWidth];
this.initGamePlatform ();
this.drawWaypoint ();
}
void initGamePlatform() {
for (int x = 0; x < this.gameFieldWidth; x++) {
for (int z = 0; z < this.gameFieldHeight; z++) {
GameObject newTowerBase = Instantiate (originalTowerBase);
newTowerBase.GetComponent<TowerBaseController>().setBuildable(true);
newTowerBase.transform.position = new Vector3 (originalTowerBase.transform.position.x + x, 0.1f, originalTowerBase.transform.position.z - z);
this.towerBases [x, z] = newTowerBase;
newTowerBase.transform.SetParent (towerBaseWrap.transform);
}
}
Destroy (originalTowerBase);
}
void drawWaypoint() {
for (int x = 0; x < this.gameFieldWidth; x++) {
GameObject baseZ = this.towerBases [x, 5];
baseZ.GetComponent<Renderer> ().material.color = wayColor;
baseZ.GetComponent<TowerBaseController>().setBuildable(false);
this.waypoints[x] = baseZ;
}
}
public GameObject[] getWaypoints() {
return this.waypoints;
}
}
|
mit
|
C#
|
a57306caeef34ed3705639afa88ca230027f1e0a
|
Check to make sure we have jukebox songs before trying to play one.
|
winnitron/WinnitronLauncher,winnitron/WinnitronLauncher
|
Assets/Scripts/System/Jukebox.cs
|
Assets/Scripts/System/Jukebox.cs
|
using UnityEngine;
using UnityEngine.UI;
public class Jukebox : MonoBehaviour {
public bool isPlaying;
public Text artistName;
public Text songName;
private int currentTrack;
private AudioSource source;
protected void Start() {
source = gameObject.GetComponent<AudioSource> ();
NextTrack();
}
void Update() {
// Player 2 Joystick controls song
if (Input.GetKeyDown(GM.options.keys.P2Left) || Input.GetKey(KeyCode.Minus))
LastTrack();
if (Input.GetKeyDown(GM.options.keys.P2Right) || Input.GetKey(KeyCode.Equals))
NextTrack();
// Stop & Play from keyboard
if (Input.GetKeyDown(GM.options.keys.P2Button1) || Input.GetKeyDown(GM.options.keys.P2Button2)) {
if (isPlaying)
Stop();
else
PlayRandom();
}
// Check for song end
if (!source.isPlaying && isPlaying)
NextTrack();
//Make sure there's a track playing when the launcher is going
if (GM.state.worldState == StateManager.WorldState.Launcher && !isPlaying)
PlayRandom();
}
public void Stop() {
source.Stop();
isPlaying = false;
}
public void PlayRandom() {
if (GM.data.songs.Count > 0) {
currentTrack = UnityEngine.Random.Range(0, GM.data.songs.Count);
source.clip = GM.data.songs[currentTrack].clip;
Play();
}
}
public void NextTrack() {
if (GM.data.songs.Count <= 0)
return;
Stop();
currentTrack = (currentTrack + 1) % GM.data.songs.Count;
source.clip = GM.data.songs[currentTrack].clip;
Play();
}
public void LastTrack() {
Stop();
if (currentTrack <= 1)
currentTrack = GM.data.songs.Count - 1;
else
currentTrack--;
source.clip = GM.data.songs[currentTrack].clip;
Play();
}
public void Play() {
isPlaying = true;
source.Play();
songName.text = GM.data.songs[currentTrack].name;
artistName.text = GM.data.songs[currentTrack].author;
}
}
|
using UnityEngine;
using UnityEngine.UI;
public class Jukebox : MonoBehaviour {
public bool isPlaying;
public Text artistName;
public Text songName;
private int currentTrack;
private AudioSource source;
protected void Start() {
source = gameObject.GetComponent<AudioSource> ();
NextTrack();
}
void Update() {
// Player 2 Joystick controls song
if (Input.GetKeyDown(GM.options.keys.P2Left) || Input.GetKey(KeyCode.Minus))
LastTrack();
if (Input.GetKeyDown(GM.options.keys.P2Right) || Input.GetKey(KeyCode.Equals))
NextTrack();
// Stop & Play from keyboard
if (Input.GetKeyDown(GM.options.keys.P2Button1) || Input.GetKeyDown(GM.options.keys.P2Button2)) {
if (isPlaying)
Stop();
else
PlayRandom();
}
// Check for song end
if (!source.isPlaying && isPlaying)
NextTrack();
//Make sure there's a track playing when the launcher is going
if (GM.state.worldState == StateManager.WorldState.Launcher && !isPlaying)
PlayRandom();
}
public void Stop() {
source.Stop();
isPlaying = false;
}
public void PlayRandom() {
currentTrack = UnityEngine.Random.Range(0, GM.data.songs.Count);
source.clip = GM.data.songs[currentTrack].clip;
Play();
}
public void NextTrack() {
if (GM.data.songs.Count <= 0)
return;
Stop();
currentTrack = (currentTrack + 1) % GM.data.songs.Count;
source.clip = GM.data.songs[currentTrack].clip;
Play();
}
public void LastTrack() {
Stop();
if (currentTrack <= 1)
currentTrack = GM.data.songs.Count - 1;
else
currentTrack--;
source.clip = GM.data.songs[currentTrack].clip;
Play();
}
public void Play() {
isPlaying = true;
source.Play();
songName.text = GM.data.songs[currentTrack].name;
artistName.text = GM.data.songs[currentTrack].author;
}
}
|
mit
|
C#
|
a8e8c25f32b091d257b66269bbfd2cb66a251e7b
|
Add MoveLeft to MainCharacter
|
runnersQueue/3minutes
|
CC-X/CC-X/Model/MainCharacter.cs
|
CC-X/CC-X/Model/MainCharacter.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Urho;
namespace CC_X.Model
{
class MainCharacter : World, Serializer
{
public Vector3 PositionSinceLastCollide { get; set; }
public MainCharacter()
{
type = WorldType.MainChar;
IsDead = false;
}
//If not dead, sets MainCharacter.Position to position
public override void UpdatePos(Vector3 position)
{
throw new NotImplementedException();
}
//Returns true if collided with other World objects. If World object type == WorldType.Enemies and MainChar.PositionSinceLastCollide != MainChar.Position, subtracts enemy damage from health
public override bool DetectCollision(Dictionary<int, World> worldObjs)
{
throw new NotImplementedException();
}
public void ReceiveDamage(int damagePow)
{
}
public void MoveLeft(float howMuch)
{
Position = new Vector3(-howMuch,Position.Y,Position.Z);
}
public bool IsMainCharDead()
{
throw new NotImplementedException();
}
// Store information concerning the Main Character
public string Serialize()
{
//string info = string.Format("'{0}', {1}, {2}, {3}", pos, id, pow, health);
//return info;
throw new NotImplementedException();
}
// Load information concerning the Main Character
public void DeSerialize(string fileinfo)
{
//string[] info = fileinfo.Split(',');
//string[] tempnums = info[0].Split(',');
//int[] nums = new int[3];
//for (int i = 0; i < 3; ++i)
// nums[i] = Convert.ToInt32(tempnums[i]);
//this.Position = new Vector3(nums[0], nums[1], nums[2]); // cannot implicitly convert string to vector3
//this.ID = Convert.ToInt32(info[1]);
//this.Damage = Convert.ToInt32(info[2]);
//this.Health = Convert.ToInt32(info[3]);
throw new NotImplementedException();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Urho;
namespace CC_X.Model
{
class MainCharacter : World, Serializer
{
public Vector3 PositionSinceLastCollide { get; set; }
public MainCharacter()
{
type = WorldType.MainChar;
IsDead = false;
}
//If not dead, sets MainCharacter.Position to position
public override void UpdatePos(Vector3 position)
{
throw new NotImplementedException();
}
//Returns true if collided with other World objects. If World object type == WorldType.Enemies and MainChar.PositionSinceLastCollide != MainChar.Position, subtracts enemy damage from health
public override bool DetectCollision(Dictionary<int, World> worldObjs)
{
throw new NotImplementedException();
}
public void ReceiveDamage(int damagePow)
{
}
public bool IsMainCharDead()
{
throw new NotImplementedException();
}
// Store information concerning the Main Character
public string Serialize()
{
//string info = string.Format("'{0}', {1}, {2}, {3}", pos, id, pow, health);
//return info;
throw new NotImplementedException();
}
// Load information concerning the Main Character
public void DeSerialize(string fileinfo)
{
//string[] info = fileinfo.Split(',');
//string[] tempnums = info[0].Split(',');
//int[] nums = new int[3];
//for (int i = 0; i < 3; ++i)
// nums[i] = Convert.ToInt32(tempnums[i]);
//this.Position = new Vector3(nums[0], nums[1], nums[2]); // cannot implicitly convert string to vector3
//this.ID = Convert.ToInt32(info[1]);
//this.Damage = Convert.ToInt32(info[2]);
//this.Health = Convert.ToInt32(info[3]);
throw new NotImplementedException();
}
}
}
|
mit
|
C#
|
9e7b2df9b2f7b8dc14bff481799b49df131d041d
|
add alternate data path to support CLI vs VS seed test
|
collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists
|
tests/FilterLists.Data.Tests/SeedFilterListsDbContextTests.cs
|
tests/FilterLists.Data.Tests/SeedFilterListsDbContextTests.cs
|
using System.IO;
using FilterLists.Data.Seed.Extensions;
using Microsoft.EntityFrameworkCore;
using MySql.Data.MySqlClient;
using Xunit;
namespace FilterLists.Data.Tests
{
public class SeedFilterListsDbContextTests
{
private const string CiTestServerConnString = "Server=localhost;Uid=travis;";
private const string CiTestDatabaseConnString = CiTestServerConnString + "Database=filterlistsdatatest;";
/// <summary>
/// requires "CREATE USER 'travis'@'localhost';" on non-Travis mysql instance
/// </summary>
[Fact]
public async void SeedOrUpdateAsync_DoesNotThrowException()
{
var options = new DbContextOptionsBuilder<FilterListsDbContext>()
.UseMySql(CiTestDatabaseConnString, m => m.MigrationsAssembly("FilterLists.Api"))
.Options;
using (var context = new FilterListsDbContext(options))
{
await context.Database.EnsureDeletedAsync();
using (var conn = new MySqlConnection(CiTestServerConnString))
{
await conn.OpenAsync();
var cmd = new MySqlCommand(
"CREATE DATABASE filterlistsdatatest CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;",
conn);
await cmd.ExecuteNonQueryAsync();
}
await context.Database.MigrateAsync();
if (Directory.Exists("../../../../../data"))
await SeedFilterListsDbContext.SeedOrUpdateAsync(context, "../../../../../data");
else
await SeedFilterListsDbContext.SeedOrUpdateAsync(context, "../../../../../../../../data");
}
}
}
}
|
using FilterLists.Data.Seed.Extensions;
using Microsoft.EntityFrameworkCore;
using MySql.Data.MySqlClient;
using Xunit;
namespace FilterLists.Data.Tests
{
public class SeedFilterListsDbContextTests
{
private const string CiTestServerConnString = "Server=localhost;Uid=travis;";
private const string CiTestDatabaseConnString = CiTestServerConnString + "Database=filterlistsdatatest;";
/// <summary>
/// requires "CREATE USER 'travis'@'localhost';" on non-Travis mysql instance
/// </summary>
[Fact]
public async void SeedOrUpdateAsync_DoesNotThrowException()
{
var options = new DbContextOptionsBuilder<FilterListsDbContext>()
.UseMySql(CiTestDatabaseConnString, m => m.MigrationsAssembly("FilterLists.Api"))
.Options;
using (var context = new FilterListsDbContext(options))
{
await context.Database.EnsureDeletedAsync();
using (var conn = new MySqlConnection(CiTestServerConnString))
{
await conn.OpenAsync();
var cmd = new MySqlCommand(
"CREATE DATABASE filterlistsdatatest CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;",
conn);
await cmd.ExecuteNonQueryAsync();
}
await context.Database.MigrateAsync();
await SeedFilterListsDbContext.SeedOrUpdateAsync(context, "../../../../../data");
}
}
}
}
|
mit
|
C#
|
5a32e601417afa8943cdb097652e0e17ad15c956
|
Use of UnityWebRequest for default http client.
|
clanofthecloud/unity-sdk,clanofthecloud/unity-sdk,xtralifecloud/unity-sdk,xtralifecloud/unity-sdk,clanofthecloud/unity-sdk,clanofthecloud/unity-sdk,xtralifecloud/unity-sdk,clanofthecloud/unity-sdk,xtralifecloud/unity-sdk,clanofthecloud/unity-sdk
|
CotcSdk/Internal/CotcSettings.cs
|
CotcSdk/Internal/CotcSettings.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace CotcSdk {
/** @cond private */
[Serializable]
public class CotcSettings : ScriptableObject {
public const string AssetPath = "Assets/Resources/CotcSettings.asset";
public static CotcSettings Instance {
get {
if (instance == null) {
instance = Resources.Load(Path.GetFileNameWithoutExtension(AssetPath)) as CotcSettings;
}
return instance;
}
}
private static CotcSettings instance;
[Serializable]
public class Environment {
[SerializeField]
public string Name;
[SerializeField]
public string ApiKey;
[SerializeField]
public string ApiSecret;
[SerializeField]
public string ServerUrl;
[SerializeField]
public int LbCount = 1;
[SerializeField]
public bool HttpVerbose = true;
[SerializeField]
public int HttpTimeout = 60;
[SerializeField]
public int HttpClientType = 1;
}
[SerializeField]
public int FileVersion = 2;
[SerializeField]
public List<Environment> Environments = new List<Environment>();
[SerializeField]
public int SelectedEnvironment = 0;
}
/** @endcond */
}
|
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace CotcSdk {
/** @cond private */
[Serializable]
public class CotcSettings : ScriptableObject {
public const string AssetPath = "Assets/Resources/CotcSettings.asset";
public static CotcSettings Instance {
get {
if (instance == null) {
instance = Resources.Load(Path.GetFileNameWithoutExtension(AssetPath)) as CotcSettings;
}
return instance;
}
}
private static CotcSettings instance;
[Serializable]
public class Environment {
[SerializeField]
public string Name;
[SerializeField]
public string ApiKey;
[SerializeField]
public string ApiSecret;
[SerializeField]
public string ServerUrl;
[SerializeField]
public int LbCount = 1;
[SerializeField]
public bool HttpVerbose = true;
[SerializeField]
public int HttpTimeout = 60;
[SerializeField]
public int HttpClientType = 0;
}
[SerializeField]
public int FileVersion = 2;
[SerializeField]
public List<Environment> Environments = new List<Environment>();
[SerializeField]
public int SelectedEnvironment = 0;
}
/** @endcond */
}
|
mit
|
C#
|
172034f4b1ed868e2ae8d51b259a9999be5fd4bd
|
Test window move.
|
JohanLarsson/Gu.Wpf.UiAutomation
|
Gu.Wpf.UiAutomation.UiTests/Elements/WindowTests.cs
|
Gu.Wpf.UiAutomation.UiTests/Elements/WindowTests.cs
|
namespace Gu.Wpf.UiAutomation.UiTests.Elements
{
using System.Globalization;
using System.Linq;
using NUnit.Framework;
public class WindowTests
{
private const string ExeFileName = "WpfApplication.exe";
[Test]
public void Close()
{
using (var app = Application.Launch(ExeFileName, "EmptyWindow"))
{
var window = app.MainWindow;
window.Close();
}
}
[Test]
public void Dialog()
{
using (var app = Application.Launch(ExeFileName, "DialogWindow"))
{
var window = app.MainWindow;
window.FindButton("Show Dialog").Click();
var dialog = window.ModalWindows.Single();
Assert.AreEqual("Message", dialog.FindTextBlock().Text);
dialog.Close();
}
}
[Test]
public void Resize()
{
using (var app = Application.Launch(ExeFileName, "EmptyWindow"))
{
var window = app.MainWindow;
Assert.AreEqual(true, window.CanResize);
Assert.AreEqual("300,300", window.Bounds.Size.ToString(CultureInfo.InvariantCulture));
window.Resize(270, 280);
Assert.AreEqual(true, window.CanResize);
Assert.AreEqual("270,280", window.Bounds.Size.ToString(CultureInfo.InvariantCulture));
}
}
[Test]
public void Move()
{
using (var app = Application.Launch(ExeFileName, "EmptyWindow"))
{
var window = app.MainWindow;
Assert.AreEqual(true, window.CanMove);
window.MoveTo(10, 20);
Assert.AreEqual(true, window.CanMove);
Assert.AreEqual("10,20,300,300", window.Bounds.ToString(CultureInfo.InvariantCulture));
window.MoveTo(30, 40);
Assert.AreEqual(true, window.CanMove);
Assert.AreEqual("30,40,300,300", window.Bounds.ToString(CultureInfo.InvariantCulture));
}
}
}
}
|
namespace Gu.Wpf.UiAutomation.UiTests.Elements
{
using System.Globalization;
using System.Linq;
using NUnit.Framework;
public class WindowTests
{
private const string ExeFileName = "WpfApplication.exe";
[Test]
public void Close()
{
using (var app = Application.Launch(ExeFileName, "EmptyWindow"))
{
var window = app.MainWindow;
window.Close();
}
}
[Test]
public void Dialog()
{
using (var app = Application.Launch(ExeFileName, "DialogWindow"))
{
var window = app.MainWindow;
window.FindButton("Show Dialog").Click();
var dialog = window.ModalWindows.Single();
Assert.AreEqual("Message", dialog.FindTextBlock().Text);
dialog.Close();
}
}
[Test]
public void Resize()
{
using (var app = Application.Launch(ExeFileName, "EmptyWindow"))
{
var window = app.MainWindow;
Assert.AreEqual(true, window.CanResize);
Assert.AreEqual("300,300", window.Bounds.Size.ToString(CultureInfo.InvariantCulture));
window.Resize(270, 280);
Assert.AreEqual(true, window.CanResize);
Assert.AreEqual("270,280", window.Bounds.Size.ToString(CultureInfo.InvariantCulture));
}
}
}
}
|
mit
|
C#
|
f8ef53a62e0f4fecc26a614373749ccf08b14d43
|
Fix tests.
|
smoogipoo/osu,ppy/osu,smoogipooo/osu,ppy/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,peppy/osu,smoogipoo/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,UselessToucan/osu
|
osu.Game.Tests/Visual/Gameplay/TestSceneOverlayActivation.cs
|
osu.Game.Tests/Visual/Gameplay/TestSceneOverlayActivation.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 NUnit.Framework;
using osu.Game.Configuration;
using osu.Game.Overlays;
using osu.Game.Rulesets;
namespace osu.Game.Tests.Visual.Gameplay
{
public class TestSceneOverlayActivation : OsuPlayerTestScene
{
private OverlayTestPlayer testPlayer;
public override void SetUpSteps()
{
AddStep("disable overlay activation during gameplay", () => LocalConfig.Set(OsuSetting.GameplayDisableOverlayActivation, true));
base.SetUpSteps();
}
[Test]
public void TestGameplayOverlayActivation()
{
AddAssert("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
}
[Test]
public void TestGameplayOverlayActivationDisabled()
{
AddStep("enable overlay activation during gameplay", () => LocalConfig.Set(OsuSetting.GameplayDisableOverlayActivation, false));
AddAssert("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
}
[Test]
public void TestGameplayOverlayActivationPaused()
{
AddUntilStep("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
AddStep("pause gameplay", () => testPlayer.Pause());
AddUntilStep("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
}
[Test]
public void TestGameplayOverlayActivationReplayLoaded()
{
AddAssert("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
AddStep("load a replay", () => testPlayer.DrawableRuleset.HasReplayLoaded.Value = true);
AddAssert("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
}
protected override TestPlayer CreatePlayer(Ruleset ruleset) => testPlayer = new OverlayTestPlayer();
private class OverlayTestPlayer : TestPlayer
{
public new OverlayActivation OverlayActivationMode => base.OverlayActivationMode.Value;
}
}
}
|
// 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 NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Game.Overlays;
using osu.Game.Rulesets;
namespace osu.Game.Tests.Visual.Gameplay
{
public class TestSceneOverlayActivation : OsuPlayerTestScene
{
private OverlayTestPlayer testPlayer;
[Resolved]
private OsuConfigManager config { get; set; }
public override void SetUpSteps()
{
AddStep("disable overlay activation during gameplay", () => config.Set(OsuSetting.GameplayDisableOverlayActivation, true));
base.SetUpSteps();
}
[Test]
public void TestGameplayOverlayActivationSetting()
{
AddAssert("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
}
[Test]
public void TestGameplayOverlayActivationPaused()
{
AddUntilStep("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
AddStep("pause gameplay", () => testPlayer.Pause());
AddUntilStep("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
}
[Test]
public void TestGameplayOverlayActivationReplayLoaded()
{
AddAssert("activation mode is disabled", () => testPlayer.OverlayActivationMode == OverlayActivation.Disabled);
AddStep("load a replay", () => testPlayer.DrawableRuleset.HasReplayLoaded.Value = true);
AddAssert("activation mode is user triggered", () => testPlayer.OverlayActivationMode == OverlayActivation.UserTriggered);
}
protected override TestPlayer CreatePlayer(Ruleset ruleset) => testPlayer = new OverlayTestPlayer();
private class OverlayTestPlayer : TestPlayer
{
public new OverlayActivation OverlayActivationMode => base.OverlayActivationMode.Value;
}
}
}
|
mit
|
C#
|
21543a78e7c6d8aea949ee83b421afc804c1040b
|
Fix the display of the door
|
DragonEyes7/ConcoursUBI17,DragonEyes7/ConcoursUBI17
|
Proto/Assets/Scripts/Time/Recorders/DoorRecorder.cs
|
Proto/Assets/Scripts/Time/Recorders/DoorRecorder.cs
|
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class DoorRecorder : Recorder
{
private RecordState _previousState;
private bool _isOpen;
private readonly Dictionary<int, DoorRecordState> _states = new Dictionary<int, DoorRecordState>();
[SerializeField]
private new void Start()
{
_isOpen = false;
base.Start();
}
internal override RecordState FindClosestState(int key)
{
var index = FindClosestKey(key, new List<int>(_states.Keys));
return !_states.ContainsKey(index) ? _previousState : _states[index];
}
protected override int DoOnTick(int time)
{
if (this == null) return 0;
var curState = new DoorRecordState(_isOpen);
if (curState.Equals(_previousState)) return 0;
_previousState = curState;
_states[time] = curState;
return 0;
}
public void DoorInteraction(bool isOpen)
{
_isOpen = isOpen;
OpenDoor();
}
public bool DoorStatus()
{
return _isOpen;
}
[PunRPC]
internal override void DoRewind(int time)
{
if (this == null) return;
if (_states.ContainsKey(time))
{
PlayState(_states[time]);
}
else
{
PlayState(_states.Last().Key < time ? _previousState : FindClosestState(time));
}
}
internal override void PlayState<T>(T recordState)
{
if (!(recordState is DoorRecordState)) return;
var state = recordState as DoorRecordState;
DoorInteraction(state.IsOpen);
}
private void OpenDoor()
{
GetComponent<PhotonView>().RPC("RPCDoorInteract", PhotonTargets.All, DoorStatus());
}
[PunRPC]
void RPCDoorInteract(bool isOpen)
{
//if (!PhotonNetwork.isMasterClient) return;
//if (isOpen) PhotonNetwork.Destroy(gameObject);
//else
GetComponent<Renderer>().enabled = !isOpen;
}
}
|
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class DoorRecorder : Recorder
{
private RecordState _previousState;
private bool _isOpen;
private readonly Dictionary<int, DoorRecordState> _states = new Dictionary<int, DoorRecordState>();
[SerializeField]
private new void Start()
{
_isOpen = false;
base.Start();
}
internal override RecordState FindClosestState(int key)
{
var index = FindClosestKey(key, new List<int>(_states.Keys));
return !_states.ContainsKey(index) ? _previousState : _states[index];
}
protected override int DoOnTick(int time)
{
if (this == null) return 0;
var curState = new DoorRecordState(_isOpen);
if (curState.Equals(_previousState)) return 0;
_previousState = curState;
_states[time] = curState;
return 0;
}
public void DoorInteraction(bool isOpen)
{
_isOpen = isOpen;
OpenDoor();
}
public bool DoorStatus()
{
return _isOpen;
}
[PunRPC]
internal override void DoRewind(int time)
{
if (this == null) return;
if (_states.ContainsKey(time))
{
PlayState(_states[time]);
}
else
{
PlayState(_states.Last().Key < time ? _previousState : FindClosestState(time));
}
}
internal override void PlayState<T>(T recordState)
{
if (!(recordState is DoorRecordState)) return;
var state = recordState as DoorRecordState;
DoorInteraction(state.IsOpen);
}
private void OpenDoor()
{
GetComponent<PhotonView>().RPC("RPCDoorInteract", PhotonTargets.All, DoorStatus());
}
[PunRPC]
void RPCDoorInteract(bool isOpen)
{
//if (!PhotonNetwork.isMasterClient) return;
//if (isOpen) PhotonNetwork.Destroy(gameObject);
//else
GetComponent<Renderer>().enabled = isOpen;
}
}
|
mit
|
C#
|
37ae30eb4f85417502794bdc1c0b22d5f6158237
|
add stop method
|
splitice/RespServer,splitice/RespServer
|
RespServer/RespServerListener.cs
|
RespServer/RespServerListener.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Mina.Core.Service;
using Mina.Core.Session;
using Mina.Filter.Codec;
using Mina.Transport.Socket;
using RespServer.Commands;
using RespServer.Mina;
using RespServer.Protocol;
namespace RespServer
{
public class RespServerListener
{
private readonly RespCommandRegistry _respCommands;
private IoAcceptor _server;
private Dictionary<IoSession,RespConnection> _connections = new Dictionary<IoSession, RespConnection>();
public bool Started;
public RespServerListener(RespCommandRegistry respCommands)
{
_respCommands = respCommands;
_server = new AsyncSocketAcceptor();
}
public void Start(IPEndPoint bind)
{
if (Started)
{
throw new Exception("Already Started");
}
_server.SessionOpened += (s,e) =>
{
RespConnection connection = new RespConnection(e.Session, _respCommands);
_connections.Add(e.Session,connection);
connection.OnDisconnect += (a, b) => _connections.Remove(e.Session);
};
_server.SessionClosed += (s, e) =>
{
_connections[e.Session].HandleDisconnect();
};
_server.MessageReceived += (s, e) =>
{
_connections[e.Session].HandleMessage(e.Message as RespPart);
};
_server.FilterChain.AddLast("codec", new ProtocolCodecFilter(new RespProtocolFactory()));
_server.Bind(bind);
Started = true;
}
public void Stop()
{
_server.Unbind();
Started = false;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Mina.Core.Service;
using Mina.Core.Session;
using Mina.Filter.Codec;
using Mina.Transport.Socket;
using RespServer.Commands;
using RespServer.Mina;
using RespServer.Protocol;
namespace RespServer
{
public class RespServerListener
{
private readonly RespCommandRegistry _respCommands;
private IoAcceptor _server;
private Dictionary<IoSession,RespConnection> _connections = new Dictionary<IoSession, RespConnection>();
public bool Started;
public RespServerListener(RespCommandRegistry respCommands)
{
_respCommands = respCommands;
_server = new AsyncSocketAcceptor();
}
public void Start(IPEndPoint bind)
{
if (Started)
{
throw new Exception("Already Started");
}
_server.SessionOpened += (s,e) =>
{
RespConnection connection = new RespConnection(e.Session, _respCommands);
_connections.Add(e.Session,connection);
connection.OnDisconnect += (a, b) => _connections.Remove(e.Session);
};
_server.SessionClosed += (s, e) =>
{
_connections[e.Session].HandleDisconnect();
};
_server.MessageReceived += (s, e) =>
{
_connections[e.Session].HandleMessage(e.Message as RespPart);
};
_server.FilterChain.AddLast("codec", new ProtocolCodecFilter(new RespProtocolFactory()));
_server.Bind(bind);
Started = true;
}
}
}
|
mit
|
C#
|
a76ac89222b9fb3967fc9bd2635bc355650b4855
|
Fix issue where test wasn't completing in SL runner.
|
JasonBock/csla,BrettJaner/csla,jonnybee/csla,JasonBock/csla,ronnymgm/csla-light,rockfordlhotka/csla,ronnymgm/csla-light,BrettJaner/csla,rockfordlhotka/csla,BrettJaner/csla,MarimerLLC/csla,ronnymgm/csla-light,MarimerLLC/csla,MarimerLLC/csla,jonnybee/csla,jonnybee/csla,rockfordlhotka/csla,JasonBock/csla
|
cslatest/Csla.Test/Utilities/CorerseValueTests.cs
|
cslatest/Csla.Test/Utilities/CorerseValueTests.cs
|
using Csla;
using Csla.DataPortalClient;
using Csla.Testing.Business.ReadOnlyTest;
using System;
using Csla.Testing.Business.Security;
using UnitDriven;
#if NUNIT
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestSetup = NUnit.Framework.SetUpAttribute;
#elif MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif
namespace Csla.Test.Utilities
{
[TestClass]
public class CoerseValueTests : TestBase
{
[TestMethod]
public void TestCoerseValue()
{
UnitTestContext context = GetContext();
UtilitiesTestHelper helper = new UtilitiesTestHelper();
helper.IntProperty = 0;
helper.StringProperty = "1";
helper.IntProperty = (int)Csla.Utilities.CoerceValue(typeof(int), typeof(string), null, helper.StringProperty);
context.Assert.AreEqual(1, helper.IntProperty, "Should have converted to int");
helper.IntProperty = 2;
helper.StringProperty = "";
helper.StringProperty = (string)Csla.Utilities.CoerceValue(typeof(string), typeof(int), null, helper.IntProperty);
context.Assert.AreEqual("2", helper.StringProperty, "Should have converted to string");
helper.StringProperty = "1";
helper.NullableStringProperty = null;
object convertedValue = Csla.Utilities.CoerceValue(typeof(string), typeof(string), null, helper.NullableStringProperty);
context.Assert.IsNull(helper.NullableStringProperty);
context.Assert.IsNull(convertedValue);
context.Assert.AreEqual(UtilitiesTestHelper.ToStringValue, (string)Csla.Utilities.CoerceValue(typeof(string), typeof(UtilitiesTestHelper), null, helper), "Should have issued ToString()");
context.Assert.Success();
context.Complete();
}
[TestMethod]
public void SmartDateCoerseValue()
{
UnitTestContext context = GetContext();
var date = DateTime.Now;
var smart = Csla.Utilities.CoerceValue<Csla.SmartDate>(typeof(DateTime), new Csla.SmartDate(), date);
context.Assert.AreEqual(date, smart.Date, "Dates should be equal");
context.Assert.Success();
context.Complete();
}
}
}
|
using Csla;
using Csla.DataPortalClient;
using Csla.Testing.Business.ReadOnlyTest;
using System;
using Csla.Testing.Business.Security;
using UnitDriven;
#if NUNIT
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestSetup = NUnit.Framework.SetUpAttribute;
#elif MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif
namespace Csla.Test.Utilities
{
[TestClass]
public class CoerseValueTests : TestBase
{
[TestMethod]
public void TestCoerseValue()
{
UnitTestContext context = GetContext();
UtilitiesTestHelper helper = new UtilitiesTestHelper();
helper.IntProperty = 0;
helper.StringProperty = "1";
helper.IntProperty = (int)Csla.Utilities.CoerceValue(typeof(int), typeof(string), null, helper.StringProperty);
context.Assert.AreEqual(1, helper.IntProperty, "Should have converted to int");
helper.IntProperty = 2;
helper.StringProperty = "";
helper.StringProperty = (string)Csla.Utilities.CoerceValue(typeof(string), typeof(int), null, helper.IntProperty);
context.Assert.AreEqual("2", helper.StringProperty, "Should have converted to string");
helper.StringProperty = "1";
helper.NullableStringProperty = null;
object convertedValue = Csla.Utilities.CoerceValue(typeof(string), typeof(string), null, helper.NullableStringProperty);
context.Assert.IsNull(helper.NullableStringProperty);
context.Assert.IsNull(convertedValue);
context.Assert.AreEqual(UtilitiesTestHelper.ToStringValue, (string)Csla.Utilities.CoerceValue(typeof(string), typeof(UtilitiesTestHelper), null, helper), "Should have issued ToString()");
context.Assert.Success();
context.Complete();
}
[TestMethod]
public void SmartDateCoerseValue()
{
UnitTestContext context = GetContext();
var date = DateTime.Now;
var smart = Csla.Utilities.CoerceValue<Csla.SmartDate>(typeof(DateTime), new Csla.SmartDate(), date);
context.Assert.AreEqual(date, smart.Date, "Dates should be equal");
}
}
}
|
mit
|
C#
|
b22c88b567cfcc279a8cd3d6bbc766586c4cd766
|
Fix CDN urls to match the fallback source folders' versions
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
src/UI/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml
|
src/UI/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml
|
<environment include="Development">
<script src="~/Identity/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/Identity/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.17.0/jquery.validate.min.js"
asp-fallback-src="~/Identity/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
crossorigin="anonymous"
integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.9/jquery.validate.unobtrusive.min.js"
asp-fallback-src="~/Identity/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
crossorigin="anonymous"
integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH">
</script>
</environment>
|
<environment include="Development">
<script src="~/Identity/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/Identity/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
asp-fallback-src="~/Identity/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
crossorigin="anonymous"
integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js"
asp-fallback-src="~/Identity/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
crossorigin="anonymous"
integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH">
</script>
</environment>
|
apache-2.0
|
C#
|
54a493f87aa8b7772cd826c2170f902b54766bf1
|
Use svg as symbol in WritableLayerSample
|
charlenni/Mapsui,charlenni/Mapsui
|
Samples/Mapsui.Samples.Common/Maps/Special/WritableLayerSample.cs
|
Samples/Mapsui.Samples.Common/Maps/Special/WritableLayerSample.cs
|
using Mapsui.Layers;
using Mapsui.Nts;
using Mapsui.Samples.Common;
using Mapsui.Styles;
using Mapsui.Tiling;
using Mapsui.UI;
using Mapsui.Utilities;
using NetTopologySuite.Geometries;
namespace Mapsui.Tests.Common.Maps
{
public class WritableLayerSample : ISample
{
public string Name => "WritableLayer";
public string Category => "Special";
public void Setup(IMapControl mapControl)
{
mapControl.Map = CreateMap();
}
private Map CreateMap()
{
var map = new Map();
map.Layers.Add(OpenStreetMap.CreateTileLayer());
var writableLayer = new WritableLayer();
var pinId = typeof(Map).LoadSvgId("Resources.Images.Pin.svg");
writableLayer.Style = new SymbolStyle { BitmapId = pinId, SymbolOffset = new Offset(0.0, 0.5, true) };
map.Layers.Add(writableLayer);
map.Info += (s, e) =>
{
if (e.MapInfo?.WorldPosition == null) return;
writableLayer?.Add(new GeometryFeature
{
Geometry = new Point(e.MapInfo.WorldPosition.X, e.MapInfo.WorldPosition.Y)
});
// To notify the map that a redraw is needed.
writableLayer?.DataHasChanged();
return;
};
return map;
}
}
}
|
using Mapsui.Layers;
using Mapsui.Nts;
using Mapsui.Samples.Common;
using Mapsui.Tiling;
using Mapsui.UI;
using NetTopologySuite.Geometries;
namespace Mapsui.Tests.Common.Maps
{
public class WritableLayerSample : ISample
{
public string Name => "WritableLayer";
public string Category => "Special";
public void Setup(IMapControl mapControl)
{
mapControl.Map = CreateMap();
}
private Map CreateMap()
{
var map = new Map();
map.Layers.Add(OpenStreetMap.CreateTileLayer());
var writableLayer = new WritableLayer();
map.Layers.Add(writableLayer);
map.Info += (s, e) =>
{
if (e.MapInfo?.WorldPosition == null) return;
writableLayer?.Add(new GeometryFeature
{
Geometry = new Point(e.MapInfo.WorldPosition.X, e.MapInfo.WorldPosition.Y)
});
// To notify the map that a redraw is needed.
writableLayer?.DataHasChanged();
return;
};
return map;
}
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.