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 |
|---|---|---|---|---|---|---|---|---|
a30866f535321983fcab6492ca4129e2d4609fa9
|
Update ListUxStringsOrSomething.cs
|
overtools/OWLib
|
DataTool/ToolLogic/List/Misc/ListUxStringsOrSomething.cs
|
DataTool/ToolLogic/List/Misc/ListUxStringsOrSomething.cs
|
using System.Collections.Generic;
using System.Diagnostics;
using DataTool.DataModels;
using DataTool.Flag;
using DataTool.Helper;
using DataTool.JSON;
using TankLib;
using TankLib.STU.Types;
using static DataTool.Program;
using static DataTool.Helper.Logger;
namespace DataTool.ToolLogic.List.Misc {
[Tool("list-ux-strings-or-something", CustomFlags = typeof(ListFlags), IsSensitive = true)]
public class ListUxStringsOrSomething : JSONTool, ITool {
public void Parse(ICLIFlags toolFlags) {
var data = GetData();
if (toolFlags is ListFlags flags)
if (flags.JSON) {
OutputJSON(data, flags);
return;
}
}
private static List<UxStringContainer> GetData() {
var @return = new List<UxStringContainer>();
foreach (ulong key in TrackedFiles[0x114]) {
var stu = STUHelper.GetInstance<STU_6649A4C0>(key);
var stringContainer = new UxStringContainer {
GUID = (teResourceGUID) key,
Strings = new List<UxString>()
};
foreach (var str in stu.m_81125A2C) {
stringContainer.Strings.Add(new UxString {
VirtualO1C = str.m_id,
DisplayName = IO.GetString(str.m_displayName)
});
}
@return.Add(stringContainer);
}
return @return;
}
public class UxStringContainer {
public teResourceGUID GUID;
public List<UxString> Strings;
}
public class UxString {
public teResourceGUID VirtualO1C;
public string DisplayName;
}
}
}
|
using System.Collections.Generic;
using System.Diagnostics;
using DataTool.DataModels;
using DataTool.Flag;
using DataTool.Helper;
using DataTool.JSON;
using TankLib;
using TankLib.STU.Types;
using static DataTool.Program;
using static DataTool.Helper.Logger;
namespace DataTool.ToolLogic.List.Misc {
[Tool("list-ux-strings-or-something", CustomFlags = typeof(ListFlags), IsSensitive = true)]
public class ListUxStringsOrSomething : JSONTool, ITool {
public void Parse(ICLIFlags toolFlags) {
var data = GetData();
if (toolFlags is ListFlags flags)
if (flags.JSON) {
OutputJSON(data, flags);
return;
}
}
private static List<UxStringContainer> GetData() {
var @return = new List<UxStringContainer>();
foreach (ulong key in TrackedFiles[0x114]) {
var stu = STUHelper.GetInstance<STU_6649A4C0>(key);
var stringContainer = new UxStringContainer {
GUID = (teResourceGUID) key,
Strings = new List<UxString>()
};
foreach (var str in stu.m_81125A2C) {
stringContainer.Strings.Add(new UxString {
VirtualO1C = str.m_id,
DisplayName = IO.GetString(str.m_displayName)
});
}
@return.Add(stringContainer);
}
return @return;
}
private class UxStringContainer {
public teResourceGUID GUID;
public List<UxString> Strings;
}
private class UxString {
public teResourceGUID VirtualO1C;
public string DisplayName;
}
}
}
|
mit
|
C#
|
b1f62041dd7edaf77acc42c9eb208f50f1f46cb0
|
update build.cake
|
yuleyule66/Npoi.Core,yuleyule66/Npoi.Core
|
build.cake
|
build.cake
|
#addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json&version=9.0.1"
#load "./build/index.cake"
var target = Argument("target", "Default");
var build = BuildParameters.Create(Context);
var util = new Util(Context, build);
Task("Clean")
.Does(() =>
{
if (DirectoryExists("./artifacts"))
{
DeleteDirectory("./artifacts", true);
}
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
ArgumentCustomization = args =>
{
args.Append($"/p:VersionSuffix={build.Version.Suffix}");
return args;
}
};
DotNetCoreRestore(settings);
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = build.Configuration,
VersionSuffix = build.Version.Suffix,
ArgumentCustomization = args =>
{
args.Append($"/p:InformationalVersion={build.Version.VersionWithSuffix()}");
return args;
}
};
foreach (var project in build.ProjectFiles)
{
DotNetCoreBuild(project.FullPath, settings);
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
foreach (var testProject in build.TestProjectFiles)
{
//DotNetCoreTest(testProject.FullPath);
}
});
Task("Pack")
.Does(() =>
{
var settings = new DotNetCorePackSettings
{
Configuration = build.Configuration,
VersionSuffix = build.Version.Suffix,
IncludeSymbols = true,
OutputDirectory = "./artifacts/packages"
};
foreach (var project in build.ProjectFiles)
{
DotNetCorePack(project.FullPath, settings);
}
});
Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack")
.Does(() =>
{
util.PrintInfo();
});
Task("Version")
.Does(() =>
{
Information($"{build.FullVersion()}");
});
Task("Print")
.Does(() =>
{
util.PrintInfo();
});
RunTarget(target);
|
#addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json&version=9.0.1"
#load "./build/index.cake"
var target = Argument("target", "Default");
var build = BuildParameters.Create(Context);
var util = new Util(Context, build);
Task("Clean")
.Does(() =>
{
if (DirectoryExists("./artifacts"))
{
DeleteDirectory("./artifacts", true);
}
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
ArgumentCustomization = args =>
{
args.Append($"/p:VersionSuffix={build.Version.Suffix}");
return args;
}
};
DotNetCoreRestore(settings);
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = build.Configuration,
VersionSuffix = build.Version.Suffix,
ArgumentCustomization = args =>
{
args.Append($"/p:InformationalVersion={build.Version.VersionWithSuffix()}");
return args;
}
};
foreach (var project in build.ProjectFiles)
{
DotNetCoreBuild(project.FullPath, settings);
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
foreach (var testProject in build.TestProjectFiles)
{
//DotNetCoreTest(testProject.FullPath);
}
});
Task("Pack")
.Does(() =>
{
var settings = new DotNetCorePackSettings
{
Configuration = build.Configuration,
VersionSuffix = build.Version.Suffix,
IncludeSymbols = true,
OutputDirectory = "./artifacts/packages"
};
foreach (var project in build.ProjectFiles)
{
//DotNetCorePack(project.FullPath, settings);
}
});
Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack")
.Does(() =>
{
util.PrintInfo();
});
Task("Version")
.Does(() =>
{
Information($"{build.FullVersion()}");
});
Task("Print")
.Does(() =>
{
util.PrintInfo();
});
RunTarget(target);
|
apache-2.0
|
C#
|
60e0798aa16a95dce660db80a86dd45db719929c
|
Add namespace to ReadOnlyAttribute
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit/Attributes/ReadOnlyAttribute.cs
|
Assets/MixedRealityToolkit/Attributes/ReadOnlyAttribute.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit
{
public class ReadOnlyAttribute : PropertyAttribute { }
public class BeginReadOnlyGroupAttribute : PropertyAttribute { }
public class EndReadOnlyGroupAttribute : PropertyAttribute { }
}
|
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute {}
public class BeginReadOnlyGroupAttribute : PropertyAttribute {}
public class EndReadOnlyGroupAttribute : PropertyAttribute {}
|
mit
|
C#
|
b38552f80b1d11b629511619016b935a5b7a93ac
|
Check for Fixie library reference
|
JohnStov/ReSharperFixieRunner
|
ReSharperFixieRunner/UnitTestProvider/FixieTestFileExplorer.cs
|
ReSharperFixieRunner/UnitTestProvider/FixieTestFileExplorer.cs
|
using System;
using System.Linq;
using JetBrains.Application;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.Tree;
using JetBrains.ReSharper.UnitTestFramework;
namespace ReSharperFixieRunner.UnitTestProvider
{
[FileUnitTestExplorer]
public class FixieTestFileExplorer : IUnitTestFileExplorer
{
private readonly FixieTestProvider provider;
private readonly UnitTestElementFactory unitTestElementFactory;
public FixieTestFileExplorer(FixieTestProvider provider, UnitTestElementFactory unitTestElementFactory)
{
this.provider = provider;
this.unitTestElementFactory = unitTestElementFactory;
}
public void ExploreFile(IFile psiFile, UnitTestElementLocationConsumer consumer, CheckForInterrupt interrupted)
{
if (interrupted())
return;
// don't bother going any further if there's isn't a project with a reference to the Fixie assembly
var project = psiFile.GetProject();
if (project == null)
return;
if(project.GetModuleReferences().All(module => module.Name != "Fixie"))
return;
psiFile.ProcessDescendants(new FixiePsiFileExplorer(unitTestElementFactory, consumer, psiFile, interrupted));
}
public IUnitTestProvider Provider { get { return provider; } }
}
}
|
using System;
using JetBrains.Application;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.Tree;
using JetBrains.ReSharper.UnitTestFramework;
namespace ReSharperFixieRunner.UnitTestProvider
{
[FileUnitTestExplorer]
public class FixieTestFileExplorer : IUnitTestFileExplorer
{
private readonly FixieTestProvider provider;
private readonly UnitTestElementFactory unitTestElementFactory;
public FixieTestFileExplorer(FixieTestProvider provider, UnitTestElementFactory unitTestElementFactory)
{
this.provider = provider;
this.unitTestElementFactory = unitTestElementFactory;
}
public void ExploreFile(IFile psiFile, UnitTestElementLocationConsumer consumer, CheckForInterrupt interrupted)
{
if (interrupted())
return;
psiFile.ProcessDescendants(new FixiePsiFileExplorer(unitTestElementFactory, consumer, psiFile, interrupted));
}
public IUnitTestProvider Provider { get { return provider; } }
}
}
|
mit
|
C#
|
fb1620d7164cf956e481bdf8f52822e88f0e5d7f
|
Bump version to 0.6.0
|
quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot
|
CactbotOverlay/Properties/AssemblyInfo.cs
|
CactbotOverlay/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.5.2.0")]
[assembly: AssemblyFileVersion("0.5.2.0")]
|
apache-2.0
|
C#
|
3b8e7089cc5dcbc6128fbf3c7255595ac76035b0
|
Update SettingsEngine.cs
|
dimmpixeye/Unity3dTools
|
Runtime/Settings/SettingsEngine.cs
|
Runtime/Settings/SettingsEngine.cs
|
// Project : ACTORS
// Contacts : Pixeye - ask@pixeye.games
using System;
namespace Pixeye.Actors
{
[Serializable]
public class SettingsEngine
{
public int SizeEntities = 1024;
public int SizeComponents = 128;
public int SizeGenerations = 4;
public int SizeGroups = 256;
public bool DebugNames = true;
public string Namespace = "";
}
}
|
// Project : ACTORS
// Contacts : Pixeye - ask@pixeye.games
using System;
namespace Pixeye.Actors
{
[Serializable]
public class SettingsEngine
{
public int SizeEntities = 1024;
public int SizeComponents = 128;
public int SizeGenerations = 4;
public int SizeGroups = 256;
public bool DebugNames = true;
public string Namespace = "Pixeye.Source";
}
}
|
mit
|
C#
|
660d1842456f22abe83622615e9791e3e4444705
|
fix CA1709
|
masaru-b-cl/VS-Code-Analysis
|
CodeAnalysis/Class1.cs
|
CodeAnalysis/Class1.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeAnalysis
{
public class SomeClass
{
public void DoSomething(int count, int i)
{
var newCount = countUp(count);
}
private int countUp(int count)
{
return count + 1;
}
private static void UnUseMethod()
{
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace codeAnalysis
{
public class someClass
{
public void doSomething(int count, int i)
{
var newCount = countUp(count);
}
private int countUp(int count)
{
return count + 1;
}
private static void UnUseMethod()
{
}
}
}
|
mit
|
C#
|
07683b727947f46acbc7d9c0c3cbe2dcab8bdfa0
|
Fix author name on commits
|
BeefEX/ships
|
Ships-Client/Rendering/Renderer.cs
|
Ships-Client/Rendering/Renderer.cs
|
using System;
using Ships_Common;
namespace Ships_Client {
public static class Renderer {
public static char[][,] loadingCircle = {
new [,] {
{'\\', '_', '/'}, {' ', ' ', ' '}, {' ', ' ', ' '}
},
new [,] {
{'\\', '_', ' '}, {'|', ' ', ' '}, {' ', ' ', ' '}
},
new [,] {
{'\\', ' ', ' '}, {'|', ' ', ' '}, {'/', ' ', ' '}
},
new [,] {
{' ', ' ', ' '}, {'|', ' ', ' '}, {'/', '=', ' '}
},
new [,] {
{' ', ' ', ' '}, {' ', ' ', ' '}, {'/', '=', '\\'}
},
new [,] {
{' ', ' ', ' '}, {' ', ' ', '|'}, {' ', '=', '\\'}
},
new [,] {
{' ', ' ', '/'}, {' ', ' ', '|'}, {' ', ' ', '\\'}
},
new [,] {
{' ', '_', '/'}, {' ', ' ', '|'}, {' ', ' ', ' '}
}
};
public static void renderShip (Ship ship, Vector2 offset = new Vector2()) {
if (ship == default(Ship))
return;
Vector2 pos = ship.position + offset;
for (int i = 0; i < ship.shape.Length; i++) {
Vector2 vector = pos + ship.shape[i];
if (ship.hits[i])
drawPixel(vector, 'X');//drawPatternAsPixel(vector, Ship.Parts.PART_EXPLODED);
else
drawPixel(vector, '#');
}
}
public static void drawPixel (Vector2 position, char character) {
/*
for (int x = position.x; x <= position.x + 5; x++) {
for (int y = position.y; y <= position.y + 2; y++) {
if (x < 0 || y < 0 || x > Console.WindowWidth || y > Console.WindowHeight)
continue;
Console.SetCursorPosition(x, y);
Console.Write(character);
}
}
*/
Console.SetCursorPosition((int)position.x, (int)position.y);
Console.Write(character);
}
public static void drawPatternAsPixel (Vector2 position, char[,] pattern) {
for (int x = (int)position.x - 1; x <= position.x + 1; x++) {
for (int y = (int)position.y - 1; y <= position.y + 1; y++) {
if (x < 0 || y < 0 || x > Console.WindowWidth || y > Console.WindowHeight)
continue;
Console.SetCursorPosition(x, y);
Console.Write(pattern[1 - (y - (int)position.y), 1 + (x - (int)position.x)]);
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Reflection.Emit;
using Ships_Common;
namespace Ships_Client {
public static class Renderer {
public static char[][,] loadingCircle = {
new [,] {
{'\\', '_', '/'}, {' ', ' ', ' '}, {' ', ' ', ' '}
},
new [,] {
{'\\', '_', ' '}, {'|', ' ', ' '}, {' ', ' ', ' '}
},
new [,] {
{'\\', ' ', ' '}, {'|', ' ', ' '}, {'/', ' ', ' '}
},
new [,] {
{' ', ' ', ' '}, {'|', ' ', ' '}, {'/', '=', ' '}
},
new [,] {
{' ', ' ', ' '}, {' ', ' ', ' '}, {'/', '=', '\\'}
},
new [,] {
{' ', ' ', ' '}, {' ', ' ', '|'}, {' ', '=', '\\'}
},
new [,] {
{' ', ' ', '/'}, {' ', ' ', '|'}, {' ', ' ', '\\'}
},
new [,] {
{' ', '_', '/'}, {' ', ' ', '|'}, {' ', ' ', ' '}
}
};
public static void renderShip (Ship ship, Vector2 offset = new Vector2()) {
if (ship == default(Ship))
return;
Vector2 pos = ship.position + offset;
for (int i = 0; i < ship.shape.Length; i++) {
Vector2 vector = pos + ship.shape[i];
if (ship.hits[i])
drawPixel(vector, 'X');//drawPatternAsPixel(vector, Ship.Parts.PART_EXPLODED);
else
drawPixel(vector, '#');
}
}
public static void drawPixel (Vector2 position, char character) {
/*
for (int x = position.x; x <= position.x + 5; x++) {
for (int y = position.y; y <= position.y + 2; y++) {
if (x < 0 || y < 0 || x > Console.WindowWidth || y > Console.WindowHeight)
continue;
Console.SetCursorPosition(x, y);
Console.Write(character);
}
}
*/
Console.SetCursorPosition((int)position.x, (int)position.y);
Console.Write(character);
}
public static void drawPatternAsPixel (Vector2 position, char[,] pattern) {
for (int x = (int)position.x - 1; x <= position.x + 1; x++) {
for (int y = (int)position.y - 1; y <= position.y + 1; y++) {
if (x < 0 || y < 0 || x > Console.WindowWidth || y > Console.WindowHeight)
continue;
Console.SetCursorPosition(x, y);
Console.Write(pattern[1 - (y - (int)position.y), 1 + (x - (int)position.x)]);
}
}
}
}
}
|
mit
|
C#
|
9971d252156987288cf107d33836e72d0aeeb279
|
Update Test
|
luni64/TeensySharp,luni64/TeensySharp,luni64/TeensySharp
|
Simple_Test_Console_App/Program.cs
|
Simple_Test_Console_App/Program.cs
|
using System;
using System.IO;
using TeensySharp;
namespace SimpleTestApp
{
class Program
{
static void Main(string[] args)
{
// Two test files
string file1 = "blink_slow.hex";
string file2 = "blink_fast.hex";
string testfile = file2;
// Define the board to be programmed (all boards are implemented but currently only Teensy 3.1 is tested)
var Board = PJRC_Board.Teensy_31;
// Obtain an empty flash image with the correct size and all bytes cleared (set to 0xFF)
var FlashImage = SharpUploader.GetEmptyFlashImage(Board);
using (var HexStream = File.OpenText(testfile))
{
// parse the file and write output to the image
SharpHexParser.ParseStream(HexStream, FlashImage);
HexStream.Close();
}
// Upload image to the board and reboot
int result = SharpUploader.Upload(FlashImage, Board, reboot: true);
// Show result
switch (result)
{
case 0:
Console.WriteLine("Successfully uploaded");
break;
case 1:
Console.WriteLine("Found no board with running HalfKay. Did you press the programming button?");
Console.WriteLine("Aborting...");
break;
case 2:
Console.WriteLine("Error during upload.");
Console.WriteLine("Aborting...");
break;
}
Console.WriteLine("\nPress any key");
while (!Console.KeyAvailable) ;
}
}
}
|
using System;
using System.IO;
using TeensySharp;
namespace SimpleTestApp
{
class Program
{
static void Main(string[] args)
{
// Two test files
string file1 = "blink_slow.hex";
string file2 = "blink_fast.hex";
string testfile = file1;
// Define the board to be programmed (all boards are implemented but currently only Teensy 3.1 is tested)
var Board = PJRC_Board.Teensy_31;
// Obtain an empty flash image with the correct size and all bytes cleared (set to 0xFF)
var FlashImage = SharpUploader.GetEmptyFlashImage(Board);
using (var HexStream = File.OpenText(testfile))
{
// parse the file and write output to the image
SharpHexParser.ParseStream(HexStream, FlashImage);
HexStream.Close();
}
// Upload image to the board and reboot
int result = SharpUploader.Upload(FlashImage, Board, reboot: true);
// Show result
switch (result)
{
case 0:
Console.WriteLine("Successfully uploaded");
break;
case 1:
Console.WriteLine("Found no board with running HalfKay. Did you press the programming button?");
Console.WriteLine("Aborting...");
break;
case 2:
Console.WriteLine("Error during upload.");
Console.WriteLine("Aborting...");
break;
}
Console.WriteLine("\nPress any key");
while (!Console.KeyAvailable) ;
}
}
}
|
mit
|
C#
|
8243407c0bdcea9a3e7fc4adf09a195942a3b33c
|
simplify IsTrimable check
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi/Extensions/StringExtensions.cs
|
WalletWasabi/Extensions/StringExtensions.cs
|
using System.Linq;
namespace System
{
public static class StringExtensions
{
public static bool Equals(this string source, string value, StringComparison comparisonType, bool trimmed)
{
if (comparisonType == StringComparison.Ordinal)
{
if (trimmed)
{
return string.CompareOrdinal(source.Trim(), value.Trim()) == 0;
}
return string.CompareOrdinal(source, value) == 0;
}
if (trimmed)
{
return source.Trim().Equals(value.Trim(), comparisonType);
}
return source.Equals(value, comparisonType);
}
public static bool Contains(this string source, string toCheck, StringComparison comp)
{
return source.IndexOf(toCheck, comp) >= 0;
}
public static string[] Split(this string me, string separator, StringSplitOptions options = StringSplitOptions.None)
{
return me.Split(separator.ToCharArray(), options);
}
/// <summary>
/// Removes one leading and trailing occurrence of the specified string
/// </summary>
public static string Trim(this string me, string trimString, StringComparison comparisonType)
{
return me.TrimStart(trimString, comparisonType).TrimEnd(trimString, comparisonType);
}
/// <summary>
/// Removes one leading occurrence of the specified string
/// </summary>
public static string TrimStart(this string me, string trimString, StringComparison comparisonType)
{
if (me.StartsWith(trimString, comparisonType))
{
return me.Substring(trimString.Length);
}
return me;
}
/// <summary>
/// Removes one trailing occurrence of the specified string
/// </summary>
public static string TrimEnd(this string me, string trimString, StringComparison comparisonType)
{
if (me.EndsWith(trimString, comparisonType))
{
return me.Substring(0, me.Length - trimString.Length);
}
return me;
}
public static bool IsTrimable(this string? me)
{
if (string.IsNullOrEmpty(me))
{
return false;
}
return char.IsWhiteSpace(me.First()) || char.IsWhiteSpace(me.Last());
}
}
}
|
namespace System
{
public static class StringExtensions
{
public static bool Equals(this string source, string value, StringComparison comparisonType, bool trimmed)
{
if (comparisonType == StringComparison.Ordinal)
{
if (trimmed)
{
return string.CompareOrdinal(source.Trim(), value.Trim()) == 0;
}
return string.CompareOrdinal(source, value) == 0;
}
if (trimmed)
{
return source.Trim().Equals(value.Trim(), comparisonType);
}
return source.Equals(value, comparisonType);
}
public static bool Contains(this string source, string toCheck, StringComparison comp)
{
return source.IndexOf(toCheck, comp) >= 0;
}
public static string[] Split(this string me, string separator, StringSplitOptions options = StringSplitOptions.None)
{
return me.Split(separator.ToCharArray(), options);
}
/// <summary>
/// Removes one leading and trailing occurrence of the specified string
/// </summary>
public static string Trim(this string me, string trimString, StringComparison comparisonType)
{
return me.TrimStart(trimString, comparisonType).TrimEnd(trimString, comparisonType);
}
/// <summary>
/// Removes one leading occurrence of the specified string
/// </summary>
public static string TrimStart(this string me, string trimString, StringComparison comparisonType)
{
if (me.StartsWith(trimString, comparisonType))
{
return me.Substring(trimString.Length);
}
return me;
}
/// <summary>
/// Removes one trailing occurrence of the specified string
/// </summary>
public static string TrimEnd(this string me, string trimString, StringComparison comparisonType)
{
if (me.EndsWith(trimString, comparisonType))
{
return me.Substring(0, me.Length - trimString.Length);
}
return me;
}
public static bool IsTrimable(this string? me)
{
if (me is null)
{
return false;
}
if (me.Length != me.Trim().Length)
{
return true;
}
return false;
}
}
}
|
mit
|
C#
|
7284a0732116dd73f097257545bbab36c8b9b3e0
|
Fix FontDefinitionCloneableTests
|
ermshiperete/libpalaso,mccarthyrb/libpalaso,sillsdev/libpalaso,glasseyes/libpalaso,ddaspit/libpalaso,tombogle/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,glasseyes/libpalaso,ermshiperete/libpalaso,ddaspit/libpalaso,gmartin7/libpalaso,andrew-polk/libpalaso,tombogle/libpalaso,gtryus/libpalaso,gtryus/libpalaso,gtryus/libpalaso,sillsdev/libpalaso,ermshiperete/libpalaso,andrew-polk/libpalaso,mccarthyrb/libpalaso,tombogle/libpalaso,andrew-polk/libpalaso,ddaspit/libpalaso,andrew-polk/libpalaso,ddaspit/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,gtryus/libpalaso,sillsdev/libpalaso,mccarthyrb/libpalaso,mccarthyrb/libpalaso,gmartin7/libpalaso,glasseyes/libpalaso,sillsdev/libpalaso,tombogle/libpalaso
|
SIL.WritingSystems.Tests/FontDefinitionCloneableTests.cs
|
SIL.WritingSystems.Tests/FontDefinitionCloneableTests.cs
|
using NUnit.Framework;
using System.Collections.Generic;
using Palaso.TestUtilities;
namespace SIL.WritingSystems.Tests
{
public class FontDefinitionCloneableTests : CloneableTests<FontDefinition>
{
public override FontDefinition CreateNewCloneable()
{
return new FontDefinition("font1");
}
protected override bool Equals(FontDefinition x, FontDefinition y)
{
if (x == null)
return y == null;
return x.ValueEquals(y);
}
public override string ExceptionList
{
get { return "|IsChanged|_urls|"; }
}
protected override List<ValuesToSet> DefaultValuesForTypes
{
get
{
return new List<ValuesToSet>
{
new ValuesToSet("to be", "!(to be)"),
new ValuesToSet(12.0f, 13.0f),
new ValuesToSet(FontEngines.Graphite, FontEngines.OpenType),
new ValuesToSet(FontRoles.Default, FontRoles.Emphasis)
};
}
}
/// <summary>
/// The generic test that clone copies everything can't handle lists.
/// </summary>
[Test]
public void CloneCopiesUrls()
{
var original = new FontDefinition("font1");
string url1 = "url1";
string url2 = "url2";
original.Urls.Add(url1);
original.Urls.Add(url2);
FontDefinition copy = original.Clone();
Assert.That(copy.Urls.Count, Is.EqualTo(2));
Assert.That(copy.Urls[0] == url1, Is.True);
}
[Test]
public void ValueEqualsComparesUrls()
{
FontDefinition first = new FontDefinition("font1");
string url1 = "url1";
string url2 = "url2";
first.Urls.Add(url1);
first.Urls.Add(url2);
FontDefinition second = new FontDefinition("font1");
string url3 = "url1";
string url4 = "url3";
Assert.That(first.ValueEquals(second), Is.False, "fd with empty urls should not equal one with some");
second.Urls.Add(url3);
Assert.That(first.ValueEquals(second), Is.False, "fd's with different length url lists should not be equal");
second.Urls.Add(url2);
Assert.That(first.ValueEquals(second), Is.True, "fd's with same font lists should be equal");
second = new FontDefinition("font1");
second.Urls.Add(url3);
second.Urls.Add(url4);
Assert.That(first.ValueEquals(second), Is.False, "fd with same-length lists of different URLs should not be equal");
}
}
}
|
using System.Collections.Generic;
using Palaso.TestUtilities;
namespace SIL.WritingSystems.Tests
{
public class FontDefinitionCloneableTests : CloneableTests<FontDefinition>
{
public override FontDefinition CreateNewCloneable()
{
return new FontDefinition("font1");
}
protected override bool Equals(FontDefinition x, FontDefinition y)
{
if (x == null)
return y == null;
return x.ValueEquals(y);
}
public override string ExceptionList
{
get { return "|IsChanged|"; }
}
protected override List<ValuesToSet> DefaultValuesForTypes
{
get
{
return new List<ValuesToSet>
{
new ValuesToSet("to be", "!(to be)"),
new ValuesToSet(12.0f, 13.0f),
new ValuesToSet(FontEngines.Graphite, FontEngines.OpenType),
new ValuesToSet(FontRoles.Default, FontRoles.Emphasis)
};
}
}
}
}
|
mit
|
C#
|
2ca20b6700090292a59a61d2eb0195a5baf3ad0c
|
Add DocumentSymbolParams type
|
PowerShell/PowerShellEditorServices
|
src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceSymbols.cs
|
src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceSymbols.cs
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public enum SymbolKind
{
File = 1,
Module = 2,
Namespace = 3,
Package = 4,
Class = 5,
Method = 6,
Property = 7,
Field = 8,
Constructor = 9,
Enum = 10,
Interface = 11,
Function = 12,
Variable = 13,
Constant = 14,
String = 15,
Number = 16,
Boolean = 17,
Array = 18,
}
public class SymbolInformation
{
public string Name { get; set; }
public SymbolKind Kind { get; set; }
public Location Location { get; set; }
public string ContainerName { get; set;}
}
public class DocumentSymbolRequest
{
public static readonly
RequestType<DocumentSymbolParams, SymbolInformation[]> Type =
RequestType<DocumentSymbolParams, SymbolInformation[]>.Create("textDocument/documentSymbol");
}
/// <summary>
/// Parameters for a DocumentSymbolRequest
/// </summary>
public class DocumentSymbolParams
{
/// <summary>
/// The text document.
/// </summary>
public TextDocumentIdentifier TextDocument { get; set; }
}
public class WorkspaceSymbolRequest
{
public static readonly
RequestType<WorkspaceSymbolParams, SymbolInformation[]> Type =
RequestType<WorkspaceSymbolParams, SymbolInformation[]>.Create("workspace/symbol");
}
public class WorkspaceSymbolParams
{
public string Query { get; set;}
}
}
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public enum SymbolKind
{
File = 1,
Module = 2,
Namespace = 3,
Package = 4,
Class = 5,
Method = 6,
Property = 7,
Field = 8,
Constructor = 9,
Enum = 10,
Interface = 11,
Function = 12,
Variable = 13,
Constant = 14,
String = 15,
Number = 16,
Boolean = 17,
Array = 18,
}
public class SymbolInformation
{
public string Name { get; set; }
public SymbolKind Kind { get; set; }
public Location Location { get; set; }
public string ContainerName { get; set;}
}
public class DocumentSymbolRequest
{
public static readonly
RequestType<TextDocumentIdentifier, SymbolInformation[]> Type =
RequestType<TextDocumentIdentifier, SymbolInformation[]>.Create("textDocument/documentSymbol");
}
public class WorkspaceSymbolRequest
{
public static readonly
RequestType<WorkspaceSymbolParams, SymbolInformation[]> Type =
RequestType<WorkspaceSymbolParams, SymbolInformation[]>.Create("workspace/symbol");
}
public class WorkspaceSymbolParams
{
public string Query { get; set;}
}
}
|
mit
|
C#
|
4f71fc4d9b7cc9061f6cf1d8cc7cbe4f3f661656
|
Update FlurlHandshakeClient.cs
|
noobot/SlackConnector
|
src/SlackConnector/Connections/Clients/Handshake/FlurlHandshakeClient.cs
|
src/SlackConnector/Connections/Clients/Handshake/FlurlHandshakeClient.cs
|
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;
using SlackConnector.Connections.Responses;
namespace SlackConnector.Connections.Clients.Handshake
{
internal class FlurlHandshakeClient : IHandshakeClient
{
private readonly IResponseVerifier _responseVerifier;
internal const string HANDSHAKE_PATH = "/api/rtm.connect";
public FlurlHandshakeClient(IResponseVerifier responseVerifier)
{
_responseVerifier = responseVerifier;
}
public async Task<HandshakeResponse> FirmShake(string slackKey)
{
var response = await ClientConstants
.SlackApiHost
.AppendPathSegment(HANDSHAKE_PATH)
.SetQueryParam("token", slackKey)
.GetJsonAsync<HandshakeResponse>();
_responseVerifier.VerifyResponse(response);
return response;
}
}
}
|
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;
using SlackConnector.Connections.Responses;
namespace SlackConnector.Connections.Clients.Handshake
{
internal class FlurlHandshakeClient : IHandshakeClient
{
private readonly IResponseVerifier _responseVerifier;
internal const string HANDSHAKE_PATH = "/api/rtm.start";
public FlurlHandshakeClient(IResponseVerifier responseVerifier)
{
_responseVerifier = responseVerifier;
}
public async Task<HandshakeResponse> FirmShake(string slackKey)
{
var response = await ClientConstants
.SlackApiHost
.AppendPathSegment(HANDSHAKE_PATH)
.SetQueryParam("token", slackKey)
.GetJsonAsync<HandshakeResponse>();
_responseVerifier.VerifyResponse(response);
return response;
}
}
}
|
mit
|
C#
|
6373c252451cc8888ba5d10cef70db1be21bed29
|
Switch to the memory repository
|
ytechie/Manufacturing.DataPusher
|
DataPusherContainer.cs
|
DataPusherContainer.cs
|
using Bootstrap.StructureMap;
using Manufacturing.DataCollector;
using Manufacturing.DataCollector.Datasources.Simulation;
using StructureMap;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
using StructureMap.Pipeline;
namespace Manufacturing.DataPusher
{
public class DataPusherContainer : IStructureMapRegistration
{
public void Register(IContainer container)
{
container.Configure(x => x.Scan(y =>
{
y.TheCallingAssembly();
y.SingleImplementationsOfInterface().OnAddedPluginTypes(z => z.LifecycleIs(new TransientLifecycle()));
y.ExcludeType<IDataPusher>();
x.AddRegistry(new DataPusherRegistry());
x.For<RandomDatasource>().LifecycleIs<SingletonLifecycle>();
x.For<ILocalRecordRepository>().Use<MemoryRecordRepository>();
}));
}
}
public class DataPusherRegistry : Registry
{
public DataPusherRegistry()
{
For<IDataPusher>().Use<EventHubsDataPusher>();
}
}
}
|
using Bootstrap.StructureMap;
using Manufacturing.DataCollector.Datasources.Simulation;
using StructureMap;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
using StructureMap.Pipeline;
namespace Manufacturing.DataPusher
{
public class DataPusherContainer : IStructureMapRegistration
{
public void Register(IContainer container)
{
container.Configure(x => x.Scan(y =>
{
y.TheCallingAssembly();
y.SingleImplementationsOfInterface().OnAddedPluginTypes(z => z.LifecycleIs(new TransientLifecycle()));
y.ExcludeType<IDataPusher>();
x.AddRegistry(new DataPusherRegistry());
x.For<RandomDatasource>().LifecycleIs<SingletonLifecycle>();
}));
}
}
public class DataPusherRegistry : Registry
{
public DataPusherRegistry()
{
For<IDataPusher>().Use<EventHubsDataPusher>();
}
}
}
|
apache-2.0
|
C#
|
e80583d7e3ad863a714f4996bcc5a27f172bb1b7
|
test updated
|
Ar3sDevelopment/UnitOfWork.NET.EntityFramework
|
UnitOfWork.NET.EntityFramework.NUnit/Classes/UnitOfWork.cs
|
UnitOfWork.NET.EntityFramework.NUnit/Classes/UnitOfWork.cs
|
using UnitOfWork.NET.EntityFramework.Classes;
using UnitOfWork.NET.EntityFramework.NUnit.Data.Models;
using UnitOfWork.NET.EntityFramework.NUnit.Repositories;
using System;
namespace UnitOfWork.NET.EntityFramework.NUnit.Classes
{
public class TestUnitOfWork : EntityUnitOfWork<TestDbContext>
{
public UserRepository Users { get; set; }
public override void AfterSaveChanges(System.Data.Entity.DbContext context)
{
base.AfterSaveChanges(context);
Console.WriteLine("DbContext After SaveChanges");
}
public override void AfterSaveChanges(TestDbContext context)
{
base.AfterSaveChanges(context);
Console.WriteLine("TestDbContext After SaveChanges");
}
public override void BeforeSaveChanges(System.Data.Entity.DbContext context)
{
base.BeforeSaveChanges(context);
Console.WriteLine("DbContext Before SaveChanges");
}
public override void BeforeSaveChanges(TestDbContext context)
{
base.BeforeSaveChanges(context);
Console.WriteLine("TestDbContext Before SaveChanges");
}
}
}
|
using UnitOfWork.NET.EntityFramework.Classes;
using UnitOfWork.NET.EntityFramework.NUnit.Data.Models;
using UnitOfWork.NET.EntityFramework.NUnit.Repositories;
namespace UnitOfWork.NET.EntityFramework.NUnit.Classes
{
public class TestUnitOfWork : EntityUnitOfWork<TestDbContext>
{
public UserRepository Users { get; set; }
}
}
|
mit
|
C#
|
6c6695d73c154a7d417c27a731c735ee069b6eae
|
Check early for commit on current branch
|
ermshiperete/GitVersion,gep13/GitVersion,gep13/GitVersion,asbjornu/GitVersion,ermshiperete/GitVersion,ermshiperete/GitVersion,ParticularLabs/GitVersion,asbjornu/GitVersion,GitTools/GitVersion,ermshiperete/GitVersion,ParticularLabs/GitVersion,GitTools/GitVersion
|
src/GitVersionCore/VersionCalculation/BaseVersionCalculators/FallbackVersionStrategy.cs
|
src/GitVersionCore/VersionCalculation/BaseVersionCalculators/FallbackVersionStrategy.cs
|
using System;
using System.Collections.Generic;
using GitVersion.Common;
using LibGit2Sharp;
namespace GitVersion.VersionCalculation
{
/// <summary>
/// Version is 0.1.0.
/// BaseVersionSource is the "root" commit reachable from the current commit.
/// Does not increment.
/// </summary>
public class FallbackVersionStrategy : VersionStrategyBase
{
private readonly IRepositoryMetadataProvider repositoryMetadataProvider;
public FallbackVersionStrategy(IRepositoryMetadataProvider repositoryMetadataProvider, Lazy<GitVersionContext> versionContext) : base(versionContext)
{
this.repositoryMetadataProvider = repositoryMetadataProvider;
}
public override IEnumerable<BaseVersion> GetVersions()
{
Commit baseVersionSource;
var currentBranchTip = Context.CurrentBranch.Tip;
if (currentBranchTip == null)
{
throw new GitVersionException("No commits found on the current branch.");
}
try
{
baseVersionSource = repositoryMetadataProvider.GetBaseVersionSource(currentBranchTip);
}
catch (NotFoundException exception)
{
throw new GitVersionException($"Can't find commit {currentBranchTip.Sha}. Please ensure that the repository is an unshallow clone with `git fetch --unshallow`.", exception);
}
yield return new BaseVersion("Fallback base version", false, new SemanticVersion(minor: 1), baseVersionSource, null);
}
}
}
|
using System;
using System.Collections.Generic;
using GitVersion.Common;
using LibGit2Sharp;
namespace GitVersion.VersionCalculation
{
/// <summary>
/// Version is 0.1.0.
/// BaseVersionSource is the "root" commit reachable from the current commit.
/// Does not increment.
/// </summary>
public class FallbackVersionStrategy : VersionStrategyBase
{
private readonly IRepositoryMetadataProvider repositoryMetadataProvider;
public FallbackVersionStrategy(IRepositoryMetadataProvider repositoryMetadataProvider, Lazy<GitVersionContext> versionContext) : base(versionContext)
{
this.repositoryMetadataProvider = repositoryMetadataProvider;
}
public override IEnumerable<BaseVersion> GetVersions()
{
Commit baseVersionSource;
var currentBranchTip = Context.CurrentBranch.Tip;
try
{
baseVersionSource = repositoryMetadataProvider.GetBaseVersionSource(currentBranchTip);
}
catch (NotFoundException exception)
{
throw new GitVersionException($"Can't find commit {currentBranchTip.Sha}. Please ensure that the repository is an unshallow clone with `git fetch --unshallow`.", exception);
}
yield return new BaseVersion("Fallback base version", false, new SemanticVersion(minor: 1), baseVersionSource, null);
}
}
}
|
mit
|
C#
|
653f8d92ce84a4f9c867d28afeed5e6b6bcc8868
|
Change label to "None" (#3965)
|
xkproject/Orchard2,petedavis/Orchard2,OrchardCMS/Brochard,petedavis/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,petedavis/Orchard2,petedavis/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard,stevetayloruk/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard
|
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Select.Edit.cshtml
|
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Select.Edit.cshtml
|
@model OrchardCore.ContentFields.ViewModels.EditNumericFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;
@{
var settings = Model.PartFieldDefinition.Settings.ToObject<NumericFieldSettings>();
string name = Model.PartFieldDefinition.DisplayName();
decimal step = (decimal)Math.Pow(10, 0 - settings.Scale);
decimal from = settings.Minimum.HasValue ? settings.Minimum.Value : 0;
decimal to = settings.Maximum.HasValue ? settings.Maximum.Value : 10;
}
<fieldset class="form-group">
<div class="row col-sm-3">
<label asp-for="Value">@name</label>
<select asp-for="Value" class="form-control content-preview-select">
@if (!settings.Required)
{
<option value="">@T["None"]</option>
}
@for (decimal d = from; d <= to; d += step)
{
<option value="@d">@d</option>
}
</select>
<span class="hint">@settings.Hint</span>
</div>
</fieldset>
|
@model OrchardCore.ContentFields.ViewModels.EditNumericFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;
@{
var settings = Model.PartFieldDefinition.Settings.ToObject<NumericFieldSettings>();
string name = Model.PartFieldDefinition.DisplayName();
decimal step = (decimal)Math.Pow(10, 0 - settings.Scale);
decimal from = settings.Minimum.HasValue ? settings.Minimum.Value : 0;
decimal to = settings.Maximum.HasValue ? settings.Maximum.Value : 10;
}
<fieldset class="form-group">
<div class="row col-sm-3">
<label asp-for="Value">@name</label>
<select asp-for="Value" class="form-control content-preview-select">
@if (!settings.Required)
{
<option value="">@T["Choose an option..."]</option>
}
@for (decimal d = from; d <= to; d += step)
{
<option value="@d">@d</option>
}
</select>
<span class="hint">@settings.Hint</span>
</div>
</fieldset>
|
bsd-3-clause
|
C#
|
3bf94aa0473111edd79d534667a2779eea51e836
|
remove Kafka
|
AndriaTurner/nhs111-dotnet-beta,NHSChoices/nhs111-dotnet-beta,AndriaTurner/nhs111-dotnet-beta,NHSChoices/nhs111-dotnet-beta,AndriaTurner/nhs111-dotnet-beta,NHSChoices/nhs111-dotnet-beta
|
NHS111/NHS111.Utils/IoC/UtilsRegistry.cs
|
NHS111/NHS111.Utils/IoC/UtilsRegistry.cs
|
using System;
using System.Configuration;
using KafkaNet;
using KafkaNet.Model;
using NHS111.Utils.Cache;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
namespace NHS111.Utils.IoC
{
public class UtilsRegistry : Registry
{
public UtilsRegistry()
{
//For<Producer>().Use(new Producer(new BrokerRouter(new KafkaOptions(new Uri("net.tcp://kafka.dev.medplus.steinhauer.technology:9092")))));
Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
});
}
}
}
|
using System;
using System.Configuration;
using KafkaNet;
using KafkaNet.Model;
using NHS111.Utils.Cache;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
namespace NHS111.Utils.IoC
{
public class UtilsRegistry : Registry
{
public UtilsRegistry()
{
For<Producer>().Use(new Producer(new BrokerRouter(new KafkaOptions(new Uri("net.tcp://kafka.dev.medplus.steinhauer.technology:9092")))));
Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
});
}
}
}
|
apache-2.0
|
C#
|
3bfd23bf141622a1edfc3d054427eb510cb017a9
|
Fix dependency property setter to set correct value.
|
decred/Paymetheus,jrick/Paymetheus,btcsuite/Paymetheus,madferreiro/Paymetheus-Fork
|
Paymetheus/ConfirmationIndicator.xaml.cs
|
Paymetheus/ConfirmationIndicator.xaml.cs
|
// Copyright (c) 2016 The btcsuite developers
// Licensed under the ISC license. See LICENSE file in the project root for full license information.
using System;
using System.Windows;
using System.Windows.Controls;
namespace Paymetheus
{
/// <summary>
/// Interaction logic for ConfirmationIndicator.xaml
/// </summary>
public partial class ConfirmationIndicator : UserControl
{
public ConfirmationIndicator()
{
InitializeComponent();
Render();
}
public const double Radius = 11;
static readonly Size ArcSize = new Size(Radius, Radius);
public int Confirmations
{
get { return (int)GetValue(ConfirmationsProperty); }
set { SetValue(ConfirmationsProperty, value); }
}
public int RequiredConfirmations
{
get { return (int)GetValue(RequiredConfirmationsProperty); }
set { SetValue(RequiredConfirmationsProperty, value); }
}
public static readonly DependencyProperty ConfirmationsProperty =
DependencyProperty.Register(nameof(Confirmations), typeof(int), typeof(ConfirmationIndicator), new PropertyMetadata(0, new PropertyChangedCallback(OnPropertyChanged)));
public static readonly DependencyProperty RequiredConfirmationsProperty =
DependencyProperty.Register(nameof(RequiredConfirmations), typeof(int), typeof(ConfirmationIndicator), new PropertyMetadata(6, new PropertyChangedCallback(OnPropertyChanged)));
private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
var indicator = (ConfirmationIndicator)sender;
indicator.Render();
}
private void Render()
{
var confirms = Confirmations;
var radians = 2 * Math.PI * confirms / RequiredConfirmations;
var endPoint = CartesianCoordinate(radians);
var largeArc = radians > Math.PI;
arc.Point = endPoint;
arc.Size = ArcSize;
arc.IsLargeArc = largeArc;
confirmationLabel.Content = confirms;
}
private static Point CartesianCoordinate(double radians)
{
var x = Radius * Math.Sin(radians);
var y = Radius * Math.Cos(radians);
return new Point(x, y);
}
}
}
|
// Copyright (c) 2016 The btcsuite developers
// Licensed under the ISC license. See LICENSE file in the project root for full license information.
using System;
using System.Windows;
using System.Windows.Controls;
namespace Paymetheus
{
/// <summary>
/// Interaction logic for ConfirmationIndicator.xaml
/// </summary>
public partial class ConfirmationIndicator : UserControl
{
public ConfirmationIndicator()
{
InitializeComponent();
Render();
}
public const double Radius = 11;
static readonly Size ArcSize = new Size(Radius, Radius);
public int Confirmations
{
get { return (int)GetValue(ConfirmationsProperty); }
set { SetValue(ConfirmationsProperty, value); }
}
public int RequiredConfirmations
{
get { return (int)GetValue(RequiredConfirmationsProperty); }
set { SetValue(ConfirmationsProperty, value); }
}
public static readonly DependencyProperty ConfirmationsProperty =
DependencyProperty.Register(nameof(Confirmations), typeof(int), typeof(ConfirmationIndicator), new PropertyMetadata(0, new PropertyChangedCallback(OnPropertyChanged)));
public static readonly DependencyProperty RequiredConfirmationsProperty =
DependencyProperty.Register(nameof(RequiredConfirmations), typeof(int), typeof(ConfirmationIndicator), new PropertyMetadata(6, new PropertyChangedCallback(OnPropertyChanged)));
private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
var indicator = (ConfirmationIndicator)sender;
indicator.Render();
}
private void Render()
{
var confirms = Confirmations;
var radians = 2 * Math.PI * confirms / RequiredConfirmations;
var endPoint = CartesianCoordinate(radians);
var largeArc = radians > Math.PI;
arc.Point = endPoint;
arc.Size = ArcSize;
arc.IsLargeArc = largeArc;
confirmationLabel.Content = confirms;
}
private static Point CartesianCoordinate(double radians)
{
var x = Radius * Math.Sin(radians);
var y = Radius * Math.Cos(radians);
return new Point(x, y);
}
}
}
|
isc
|
C#
|
67d8e11bd8e53229429d69c124c549f2856cd467
|
remove empty Update method
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,vladkol/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,StephenHodgson/MixedRealityToolkit-Unity,vladkol/MixedRealityToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,vladkol/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit-Examples/Demos/Diagnostics/Scripts/DiagnosticsDemoControls.cs
|
Assets/MixedRealityToolkit-Examples/Demos/Diagnostics/Scripts/DiagnosticsDemoControls.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Diagnostics;
using Microsoft.MixedReality.Toolkit.Core.Services;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
public class DiagnosticsDemoControls : MonoBehaviour
{
private IMixedRealityDiagnosticsSystem diagnosticsSystem = null;
/// <summary>
/// Provides the instance, if enabled, of the diagnostics system.
/// </summary>
private IMixedRealityDiagnosticsSystem DiagnosticsSystem => diagnosticsSystem ?? (diagnosticsSystem = MixedRealityToolkit.DiagnosticsSystem);
/// <summary>
/// Shows or hides the diagnostics information display.
/// </summary>
public void OnToggleDiagnostics()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.Visible = !(DiagnosticsSystem.Visible);
}
/// <summary>
/// Shows or hides the frame rate display.
/// </summary>
public void OnToggleFrameRate()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.ShowFps = !(DiagnosticsSystem.ShowFps);
}
/// <summary>
/// Shows or hides the memory usage display.
/// </summary>
public void OnToggleMemory()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.ShowMemory = !(DiagnosticsSystem.ShowMemory);
}
/// <summary>
/// Shows or hides the processor usage display.
/// </summary>
public void OnToggleProcessor()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.ShowCpu = !(DiagnosticsSystem.ShowCpu);
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Diagnostics;
using Microsoft.MixedReality.Toolkit.Core.Services;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
public class DiagnosticsDemoControls : MonoBehaviour
{
private IMixedRealityDiagnosticsSystem diagnosticsSystem = null;
/// <summary>
/// Provides the instance, if enabled, of the diagnostics system.
/// </summary>
private IMixedRealityDiagnosticsSystem DiagnosticsSystem => diagnosticsSystem ?? (diagnosticsSystem = MixedRealityToolkit.DiagnosticsSystem);
private void Update()
{ }
/// <summary>
/// Shows or hides the diagnostics information display.
/// </summary>
public void OnToggleDiagnostics()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.Visible = !(DiagnosticsSystem.Visible);
}
/// <summary>
/// Shows or hides the frame rate display.
/// </summary>
public void OnToggleFrameRate()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.ShowFps = !(DiagnosticsSystem.ShowFps);
}
/// <summary>
/// Shows or hides the memory usage display.
/// </summary>
public void OnToggleMemory()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.ShowMemory = !(DiagnosticsSystem.ShowMemory);
}
/// <summary>
/// Shows or hides the processor usage display.
/// </summary>
public void OnToggleProcessor()
{
if (DiagnosticsSystem == null) { return; }
DiagnosticsSystem.ShowCpu = !(DiagnosticsSystem.ShowCpu);
}
}
}
|
mit
|
C#
|
2b63c35397a46b01d55de1d075b21cd1229dfa8d
|
Replace \r with br.
|
cliftonm/clifton,cliftonm/clifton,cliftonm/clifton
|
Clifton.Core/Services/Clifton.EmailExceptionLoggerService/EmailExceptionLoggerService.cs
|
Clifton.Core/Services/Clifton.EmailExceptionLoggerService/EmailExceptionLoggerService.cs
|
using System;
using System.Text;
using Clifton.Core.ModuleManagement;
using Clifton.Core.Semantics;
using Clifton.Core.ServiceInterfaces;
using Clifton.Core.ServiceManagement;
namespace Clifton.ConsoleLoggerService
{
public class EmailExceptionModule : IModule
{
public void InitializeServices(IServiceManager serviceManager)
{
serviceManager.RegisterSingleton<IEmailExceptionLoggerService, EmailExceptionLoggerService>();
}
}
public class EmailExceptionLoggerService : ServiceBase, IEmailExceptionLoggerService
{
private Email CreateEmail()
{
Email email = new Email();
IAppConfigService config = ServiceManager.Get<IAppConfigService>();
email.AddTo(config.GetValue("emailExceptionTo"));
email.Subject = config.GetValue("emailExceptionSubject");
return email;
}
public override void FinishedInitialization()
{
base.FinishedInitialization();
ServiceManager.Get<ISemanticProcessor>().Register<LoggerMembrane, EmailExceptionLoggerReceptor>();
}
public virtual void Log(string msg)
{
Email email = CreateEmail();
email.Body = msg;
ServiceManager.Get<IEmailService>().Send(email);
}
public virtual void Log(ExceptionMessage msg)
{
Email email = CreateEmail();
email.Body = msg.Value;
ServiceManager.Get<IEmailService>().Send(email);
}
public virtual void Log(Exception ex)
{
StringBuilder sb = new StringBuilder();
Email email = CreateEmail();
while (ex != null)
{
sb.AppendLine(ex.Message);
sb.AppendLine(ex.StackTrace);
ex = ex.InnerException;
if (ex != null)
{
sb.AppendLine("========= Inner Exception =========");
}
}
email.Body = sb.ToString().Replace("\r", "<br/>").Replace("\n", "<br/>");
ServiceManager.Get<IEmailService>().Send(email);
}
}
public class EmailExceptionLoggerReceptor : IReceptor
{
public void Process(ISemanticProcessor proc, IMembrane membrane, ST_Exception exception)
{
proc.ServiceManager.Get<IEmailExceptionLoggerService>().Log(exception.Exception);
}
public void Process(ISemanticProcessor proc, IMembrane membrane, ST_ExceptionObject exception)
{
proc.ServiceManager.Get<IEmailExceptionLoggerService>().Log(exception.ExceptionMessage.Value);
}
public void Process(ISemanticProcessor proc, IMembrane membrane, ST_CompilerError error)
{
proc.ServiceManager.Get<IConsoleLoggerService>().Log(error.Error);
}
}
}
|
using System;
using System.Text;
using Clifton.Core.ModuleManagement;
using Clifton.Core.Semantics;
using Clifton.Core.ServiceInterfaces;
using Clifton.Core.ServiceManagement;
namespace Clifton.ConsoleLoggerService
{
public class EmailExceptionModule : IModule
{
public void InitializeServices(IServiceManager serviceManager)
{
serviceManager.RegisterSingleton<IEmailExceptionLoggerService, EmailExceptionLoggerService>();
}
}
public class EmailExceptionLoggerService : ServiceBase, IEmailExceptionLoggerService
{
private Email CreateEmail()
{
Email email = new Email();
IAppConfigService config = ServiceManager.Get<IAppConfigService>();
email.AddTo(config.GetValue("emailExceptionTo"));
email.Subject = config.GetValue("emailExceptionSubject");
return email;
}
public override void FinishedInitialization()
{
base.FinishedInitialization();
ServiceManager.Get<ISemanticProcessor>().Register<LoggerMembrane, EmailExceptionLoggerReceptor>();
}
public virtual void Log(string msg)
{
Email email = CreateEmail();
email.Body = msg;
ServiceManager.Get<IEmailService>().Send(email);
}
public virtual void Log(ExceptionMessage msg)
{
Email email = CreateEmail();
email.Body = msg.Value;
ServiceManager.Get<IEmailService>().Send(email);
}
public virtual void Log(Exception ex)
{
StringBuilder sb = new StringBuilder();
Email email = CreateEmail();
while (ex != null)
{
sb.AppendLine(ex.Message);
sb.AppendLine(ex.StackTrace);
ex = ex.InnerException;
if (ex != null)
{
sb.AppendLine("========= Inner Exception =========");
}
}
email.Body = sb.ToString();
ServiceManager.Get<IEmailService>().Send(email);
}
}
public class EmailExceptionLoggerReceptor : IReceptor
{
public void Process(ISemanticProcessor proc, IMembrane membrane, ST_Exception exception)
{
proc.ServiceManager.Get<IEmailExceptionLoggerService>().Log(exception.Exception);
}
public void Process(ISemanticProcessor proc, IMembrane membrane, ST_ExceptionObject exception)
{
proc.ServiceManager.Get<IEmailExceptionLoggerService>().Log(exception.ExceptionMessage.Value);
}
public void Process(ISemanticProcessor proc, IMembrane membrane, ST_CompilerError error)
{
proc.ServiceManager.Get<IConsoleLoggerService>().Log(error.Error);
}
}
}
|
mit
|
C#
|
19fd0466b48e4d14234f954639a2f5fc5b54815a
|
Fix typo
|
CodefoundryDE/LegacyWrapper,CodefoundryDE/LegacyWrapper
|
LegacyWrapperTest/Client/EdgeCaseTests.cs
|
LegacyWrapperTest/Client/EdgeCaseTests.cs
|
using System;
using System.Net;
using LegacyWrapperClient.Client;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LegacyWrapperTest.Client
{
[TestClass]
public class EdgeCaseTests
{
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void TestTypeIsNotAnInterface()
{
// Test a random class that's derived from IDisposable but not an interface
using (WrapperClientFactory<HttpListener>.CreateWrapperClient())
{
// Do nothing
}
}
}
}
|
using System;
using System.Net;
using LegacyWrapperClient.Client;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LegacyWrapperTest.Client
{
[TestClass]
public class EdgeCaseTests
{
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void TestTypeIsNotAnInterface()
{
// Test a random class that's derrived from IDisposable but not an interface
using (WrapperClientFactory<HttpListener>.CreateWrapperClient())
{
// Do nothing
}
}
}
}
|
mit
|
C#
|
bc7c44fce98559b345a032c952c5870b0a20cda1
|
fix e2e test failure due to null collection change
|
lewischeng-ms/WebApi,lewischeng-ms/WebApi
|
OData/test/E2ETest/WebStack.QA.Test.OData/Formatter/ErrorMessagesTests.cs
|
OData/test/E2ETest/WebStack.QA.Test.OData/Formatter/ErrorMessagesTests.cs
|
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
using System.Web.OData;
using System.Web.OData.Builder;
using System.Web.OData.Extensions;
using System.Web.OData.Routing;
using System.Web.OData.Routing.Conventions;
using Microsoft.OData.Edm;
using Nuwa;
using Xunit;
namespace WebStack.QA.Test.OData.Formatter
{
[NuwaFramework]
public class ErrorMessagesTests
{
[NuwaBaseAddress]
public string BaseAddress { get; set; }
[NuwaHttpClient]
public HttpClient Client { get; set; }
[NuwaConfiguration]
public static void UpdateConfiguration(HttpConfiguration config)
{
config.Routes.Clear();
config.MapODataServiceRoute("odata", "odata", GetModel(), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault());
}
private static IEdmModel GetModel()
{
ODataModelBuilder builder = new ODataConventionModelBuilder();
EntitySetConfiguration<ErrorCustomer> customers = builder.EntitySet<ErrorCustomer>("ErrorCustomers");
return builder.GetEdmModel();
}
}
public class ErrorCustomersController : ODataController
{
[EnableQuery(PageSize = 10, MaxExpansionDepth = 2)]
public IHttpActionResult Get()
{
return Ok(Enumerable.Range(0, 1).Select(i => new ErrorCustomer
{
Id = i,
Name = "Name i",
Numbers = null
}));
}
}
public class ErrorCustomer
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<int> Numbers { get; set; }
}
}
|
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
using System.Web.OData;
using System.Web.OData.Builder;
using System.Web.OData.Extensions;
using System.Web.OData.Routing;
using System.Web.OData.Routing.Conventions;
using Microsoft.OData.Edm;
using Nuwa;
using Xunit;
namespace WebStack.QA.Test.OData.Formatter
{
[NuwaFramework]
public class ErrorMessagesTests
{
[NuwaBaseAddress]
public string BaseAddress { get; set; }
[NuwaHttpClient]
public HttpClient Client { get; set; }
[NuwaConfiguration]
public static void UpdateConfiguration(HttpConfiguration config)
{
config.Routes.Clear();
config.MapODataServiceRoute("odata", "odata", GetModel(), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault());
}
private static IEdmModel GetModel()
{
ODataModelBuilder builder = new ODataConventionModelBuilder();
EntitySetConfiguration<ErrorCustomer> customers = builder.EntitySet<ErrorCustomer>("ErrorCustomers");
return builder.GetEdmModel();
}
[Fact]
public void ThrowsClearErrorMessageWhenACollectionPropertyIsNull()
{
// Arrange
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, BaseAddress + "/odata/ErrorCustomers");
// Act
HttpResponseMessage response = Client.SendAsync(request).Result;
// Assert
Assert.NotNull(response);
Assert.NotNull(response.Content);
string result = response.Content.ReadAsStringAsync().Result;
Assert.NotNull(result);
Assert.Contains("Null collections cannot be serialized.", result);
}
}
public class ErrorCustomersController : ODataController
{
[EnableQuery(PageSize = 10, MaxExpansionDepth = 2)]
public IHttpActionResult Get()
{
return Ok(Enumerable.Range(0, 1).Select(i => new ErrorCustomer
{
Id = i,
Name = "Name i",
Numbers = null
}));
}
}
public class ErrorCustomer
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<int> Numbers { get; set; }
}
}
|
mit
|
C#
|
6e2ef8d63229f80f281286309dc78504d9c3a714
|
Remove all network operation codes
|
HelloKitty/317refactor
|
src/Rs317.Extended.Packets/RsNetworkOperationCode.cs
|
src/Rs317.Extended.Packets/RsNetworkOperationCode.cs
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Rs317.Extended
{
/// <summary>
/// Operation codes for the RS317 packets.
/// </summary>
public enum RsNetworkOperationCode : byte
{
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Rs317.Extended
{
/// <summary>
/// Operation codes for the RS317 packets.
/// </summary>
public enum RsNetworkOperationCode : byte
{
/// <summary>
/// Operation code for packet type that indicates a login
/// success.
/// </summary>
ConnectionInitialized = 0,
}
}
|
mit
|
C#
|
70d372001315b551e03e8765c5a07b531915a478
|
Build and publish nuget package
|
RockFramework/Rock.Messaging
|
Rock.Messaging/Properties/AssemblyInfo.cs
|
Rock.Messaging/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("Rock.Messaging")]
[assembly: AssemblyDescription("Rock Messaging.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("Rock.Messaging")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("58c2f915-e27e-436d-bd97-b6cb117ffd6b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.6")]
[assembly: AssemblyInformationalVersion("0.9.6")]
|
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("Rock.Messaging")]
[assembly: AssemblyDescription("Rock Messaging.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quicken Loans")]
[assembly: AssemblyProduct("Rock.Messaging")]
[assembly: AssemblyCopyright("Copyright © Quicken Loans 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("58c2f915-e27e-436d-bd97-b6cb117ffd6b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.5")]
[assembly: AssemblyInformationalVersion("0.9.5")]
|
mit
|
C#
|
aaf851f2489d26a3cd3e106c55a926e354c89a02
|
Make the constraint on RestfulHttpMethodConstraint, so the match will work.
|
restful-routing/restful-routing,stevehodgkiss/restful-routing,restful-routing/restful-routing,stevehodgkiss/restful-routing,stevehodgkiss/restful-routing,restful-routing/restful-routing
|
src/RestfulRouting/Mapper.cs
|
src/RestfulRouting/Mapper.cs
|
using System.Web.Routing;
namespace RestfulRouting
{
public abstract class Mapper
{
private readonly IRouteHandler _routeHandler;
protected Mapper(IRouteHandler routeHandler)
{
_routeHandler = routeHandler;
}
protected Route GenerateRoute(string path, string controller, string action, string[] httpMethods)
{
return new Route(path,
new RouteValueDictionary(new { controller, action }),
new RouteValueDictionary(new { httpMethod = new RestfulHttpMethodConstraint(httpMethods) }),
_routeHandler);
}
}
}
|
using System.Web.Routing;
namespace RestfulRouting
{
public abstract class Mapper
{
private readonly IRouteHandler _routeHandler;
protected Mapper(IRouteHandler routeHandler)
{
_routeHandler = routeHandler;
}
protected Route GenerateRoute(string path, string controller, string action, string[] httpMethods)
{
return new Route(path,
new RouteValueDictionary(new { controller, action }),
new RouteValueDictionary(new { httpMethod = new HttpMethodConstraint(httpMethods) }),
_routeHandler);
}
}
}
|
mit
|
C#
|
d77750cc533bdc9af0f6948295f1d792b86001c5
|
add helpers for creating documents in a transaction
|
Weingartner/SolidworksAddinFramework
|
XUnit.Solidworks.Addin/SolidWorksSpec.cs
|
XUnit.Solidworks.Addin/SolidWorksSpec.cs
|
using System;
using System.Reactive.Disposables;
using SolidworksAddinFramework;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using XUnitRemote.Local;
namespace XUnit.Solidworks.Addin
{
public abstract class SolidWorksSpec
{
private static CompositeDisposable _keptStuff = new CompositeDisposable();
protected static ISldWorks SwApp => (ISldWorks)XUnitService.Data[nameof(ISldWorks)];
/// <summary>
/// Create a part using the standard template
/// </summary>
/// <returns></returns>
protected IModelDoc2 CreatePartDoc()
{
var partTemplateName = SwApp.GetUserPreferenceStringValue((int) swUserPreferenceStringValue_e.swDefaultTemplatePart);
return (IModelDoc2)SwApp.NewDocument(partTemplateName, 0, 0, 0);
}
/// <summary>
/// Create a part doc which will be deleted after the action even if the test fails
/// </summary>
/// <param name="action"></param>
protected void CreatePartDoc(Action<IModelDoc2> action)
{
CreatePartDoc().Using(SwApp, action);
}
/// <summary>
/// Create a part doc which will be deleted if keep is false. This is mainly useful
/// just for debugging so that the document is kept open after a test is run so you
/// can eyeball the results.
/// </summary>
/// <param name="keep"></param>
/// <param name="action"></param>
protected void CreatePartDoc(bool keep, Func<IModelDoc2, IDisposable> action)
{
if (keep)
{
var doc =CreatePartDoc();
_keptStuff.Add(action(doc));
}
else
{
CreatePartDoc().Using(SwApp, m => action(m).Dispose());
}
}
}
}
|
using System;
using SolidWorks.Interop.sldworks;
using XUnitRemote.Local;
namespace XUnit.Solidworks.Addin
{
public abstract class SolidWorksSpec
{
protected static ISldWorks SwApp => (ISldWorks)XUnitService.Data[nameof(ISldWorks)];
}
}
|
mit
|
C#
|
88094eba92e4a93005c016e8372a2f8fcb52e9ca
|
Make ID type nullable
|
GetTabster/Tabster.Data
|
Library/LibraryItem.cs
|
Library/LibraryItem.cs
|
#region
using System;
using System.IO;
#endregion
namespace Tabster.Data.Library
{
public class LibraryItem
{
protected LibraryItem()
{
}
protected LibraryItem(ITabsterFile file, FileInfo fileInfo)
{
File = file;
FileInfo = fileInfo;
}
public long? ID { get; set; }
public FileInfo FileInfo { get; private set; }
public virtual ITabsterFile File { get; private set; }
}
}
|
#region
using System;
using System.IO;
#endregion
namespace Tabster.Data.Library
{
public class LibraryItem
{
protected LibraryItem()
{
}
protected LibraryItem(ITabsterFile file, FileInfo fileInfo)
{
File = file;
FileInfo = fileInfo;
}
public int ID { get; set; }
public FileInfo FileInfo { get; private set; }
public virtual ITabsterFile File { get; private set; }
}
}
|
apache-2.0
|
C#
|
a249b0a0921c57342db6e6b509dced8c8276ffdd
|
use IEnumreable instead of IList
|
zmira/abremir.AllMyBricks
|
abremir.AllMyBricks.Data/Models/Theme.cs
|
abremir.AllMyBricks.Data/Models/Theme.cs
|
using LiteDB;
using System.Collections.Generic;
namespace abremir.AllMyBricks.Data.Models
{
public class Theme
{
[BsonId(false)]
public string Name { get; set; }
public ushort SetCount { get; set; }
public ushort SubthemeCount { get; set; }
public ushort YearFrom { get; set; }
public ushort YearTo { get; set; }
public IEnumerable<YearSetCount> SetCountPerYear { get; set; }
}
}
|
using LiteDB;
using System.Collections.Generic;
namespace abremir.AllMyBricks.Data.Models
{
public class Theme
{
[BsonId(false)]
public string Name { get; set; }
public ushort SetCount { get; set; }
public ushort SubthemeCount { get; set; }
public ushort YearFrom { get; set; }
public ushort YearTo { get; set; }
public IList<YearSetCount> SetCountPerYear { get; set; }
}
}
|
mit
|
C#
|
096d9e017c088ce15ad6a9cbeb7934e3fb0cc7ee
|
Replace string queries with GUID for DummyAlembic.abc
|
unity3d-jp/AlembicImporter,unity3d-jp/AlembicImporter,unity3d-jp/AlembicImporter
|
com.unity.formats.alembic/Tests/Editor/AssetRenameTests.cs
|
com.unity.formats.alembic/Tests/Editor/AssetRenameTests.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Formats.Alembic.Importer;
namespace UnityEditor.Formats.Alembic.Exporter.UnitTests
{
public class AssetRenameTests
{
readonly List<string> deleteFileList = new List<string>();
const string copiedAbcFile = "Assets/abc.abc";
GameObject go;
[SetUp]
public void SetUp()
{
const string dummyGUID = "1a066d124049a413fb12b82470b82811"; // GUID of DummyAlembic.abc
var path = AssetDatabase.GUIDToAssetPath(dummyGUID);
var srcDummyFile = AssetDatabase.LoadAllAssetsAtPath(path).OfType<AlembicStreamPlayer>().First().StreamDescriptor.PathToAbc;
File.Copy(srcDummyFile,copiedAbcFile, true);
AssetDatabase.Refresh();
var asset = AssetDatabase.LoadMainAssetAtPath(copiedAbcFile);
go = PrefabUtility.InstantiatePrefab(asset) as GameObject;
}
[TearDown]
public void TearDown()
{
foreach (var file in deleteFileList)
{
AssetDatabase.DeleteAsset(file);
}
deleteFileList.Clear();
}
[Test]
public void TestRenameDoesNotRenameInstances()
{
Assert.AreEqual("abc",go.name);
var ret = AssetDatabase.RenameAsset(copiedAbcFile,"new.abc");
AssetDatabase.Refresh();
Assert.AreEqual("abc",go.name);
Assert.IsEmpty(ret);
deleteFileList.Add("Assets/new.abc");
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Formats.Alembic.Importer;
namespace UnityEditor.Formats.Alembic.Exporter.UnitTests
{
public class AssetRenameTests
{
readonly List<string> deleteFileList = new List<string>();
const string copiedAbcFile = "Assets/abc.abc";
GameObject go;
[SetUp]
public void SetUp()
{
var srcDummyFile = AssetDatabase.FindAssets("Dummy").Select(AssetDatabase.GUIDToAssetPath).SelectMany(AssetDatabase.LoadAllAssetsAtPath).OfType<AlembicStreamPlayer>().First().StreamDescriptor.PathToAbc;
File.Copy(srcDummyFile,copiedAbcFile, true);
AssetDatabase.Refresh();
var asset = AssetDatabase.LoadMainAssetAtPath(copiedAbcFile);
go = PrefabUtility.InstantiatePrefab(asset) as GameObject;
}
[TearDown]
public void TearDown()
{
foreach (var file in deleteFileList)
{
AssetDatabase.DeleteAsset(file);
}
deleteFileList.Clear();
}
[Test]
public void TestRenameDoesNotRenameInstances()
{
Assert.AreEqual("abc",go.name);
var ret = AssetDatabase.RenameAsset(copiedAbcFile,"new.abc");
AssetDatabase.Refresh();
Assert.AreEqual("abc",go.name);
Assert.IsEmpty(ret);
deleteFileList.Add("Assets/new.abc");
}
}
}
|
mit
|
C#
|
bde229373bf4e7bf21dc1a000d455ebf845391b4
|
Update BookSearchField.cs
|
adamkrogh/goodreads-dotnet,adamkrogh/goodreads-dotnet
|
Goodreads/Models/Request/BookSearchField.cs
|
Goodreads/Models/Request/BookSearchField.cs
|
using Goodreads.Http;
namespace Goodreads.Models.Request
{
/// <summary>
/// The fields to search for books by.
/// </summary>
[QueryParameterKey("search[field]")]
public enum BookSearchField
{
/// <summary>
/// Search books by all fields.
/// </summary>
[QueryParameterValue("all")]
All,
/// <summary>
/// Search by the title of the book.
/// </summary>
[QueryParameterValue("title")]
Title,
/// <summary>
/// Search by the author of the book.
/// </summary>
[QueryParameterValue("author")]
Author,
/// <summary>
/// Search by the genre of the book.
/// </summary>
[QueryParameterValue("genre")]
Genre
}
}
|
using Goodreads.Http;
namespace Goodreads.Models.Request
{
/// <summary>
/// The fields to search for books by.
/// </summary>
[QueryParameterKey("search[field]")]
public enum BookSearchField
{
/// <summary>
/// Search books by all fields.
/// </summary>
[QueryParameterValue("all")]
All,
/// <summary>
/// Search by the title of the book.
/// </summary>
[QueryParameterValue("title")]
Title,
/// <summary>
/// Search by the author of the book.
/// </summary>
[QueryParameterValue("author")]
Author
/// <summary>
/// Search by the genre of the book.
/// </summary>
[QueryParameterValue("genre")]
Genre
}
}
|
mit
|
C#
|
89e1768264179f6e7e5436d350c8d7c2fd4b14f7
|
Set version to 0.2.
|
joeyespo/google-apps-client
|
GoogleAppsClient/Properties/AssemblyInfo.cs
|
GoogleAppsClient/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Google Apps Client")]
[assembly: AssemblyDescription("Access Google Apps and get notifications on your desktop.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GoogleAppsClient")]
[assembly: AssemblyCopyright("Copyright © Joe Esposito 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Google Apps Client")]
[assembly: AssemblyDescription("Access Google Apps and get notifications on your desktop.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GoogleAppsClient")]
[assembly: AssemblyCopyright("Copyright © Joe Esposito 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
|
mit
|
C#
|
1d878080163a907aa5b4c3df5f4c2fd8c3d2d352
|
Fix TAttribute Rebus extension
|
evicertia/HermaFx,evicertia/HermaFx,evicertia/HermaFx
|
HermaFx.Rebus/TimeToBeReceivedExtensions.cs
|
HermaFx.Rebus/TimeToBeReceivedExtensions.cs
|
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using HermaFx.DataAnnotations;
using Rebus;
using Rebus.Shared;
using Rebus.Configuration;
namespace HermaFx.Rebus
{
public static class RebusConfigurerExtensions
{
public static RebusConfigurer SetTimeToBeReceivedFrom<TAttribute>(this RebusConfigurer configurer, Func<TAttribute, TimeSpan> getter)
where TAttribute : System.Attribute
{
Guard.IsNotNull(() => configurer, configurer);
Guard.IsNotNull(() => getter, getter);
return configurer.Events(e =>
{
e.MessageSent += (advbus, destination, message) =>
{
var attribute = message.GetType()
.GetCustomAttributes(typeof(TAttribute), false)
.Cast<TAttribute>()
.SingleOrDefault();
if (attribute != null)
{
advbus.AttachHeader(message, Headers.TimeToBeReceived, getter(attribute).ToString());
}
};
});
}
public static RebusConfigurer UseTimeoutAttribute(this RebusConfigurer configurer)
{
return configurer.SetTimeToBeReceivedFrom<TimeoutAttribute>(x => x.Timeout);
}
public static RebusConfigurer RequireTimeToBeReceivedUsing<TAttribute>(this RebusConfigurer configurer)
where TAttribute : System.Attribute
{
Guard.IsNotNull(() => configurer, configurer);
return configurer.Events(e =>
{
e.BeforeMessage += (bus, message) =>
{
if (message == null) return;
var type = message.GetType();
var context = MessageContext.GetCurrent();
if (type.GetCustomAttribute<TAttribute>() != null
&& !context.Headers.ContainsKey(Headers.TimeToBeReceived))
{
throw new InvalidOperationException("Message is missing 'TimeToBeReceived' header!");
}
};
});
}
public static RebusConfigurer RequireTimeoutAttribute(this RebusConfigurer configurer)
{
return RequireTimeToBeReceivedUsing<TimeoutAttribute>(configurer);
}
}
}
|
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using HermaFx.DataAnnotations;
using Rebus;
using Rebus.Shared;
using Rebus.Configuration;
namespace HermaFx.Rebus
{
public static class RebusConfigurerExtensions
{
public static RebusConfigurer SetTimeToBeReceivedFrom<TAttribute>(this RebusConfigurer configurer, Func<TAttribute, TimeSpan> getter)
where TAttribute : System.Attribute
{
Guard.IsNotNull(() => configurer, configurer);
Guard.IsNotNull(() => getter, getter);
return configurer.Events(e =>
{
e.MessageSent += (advbus, destination, message) =>
{
var attribute = message.GetType()
.GetCustomAttributes(typeof(TimeoutAttribute), false)
.Cast<TimeoutAttribute>()
.SingleOrDefault();
if (attribute != null)
{
advbus.AttachHeader(message, Headers.TimeToBeReceived, getter.ToString());
}
};
});
}
public static RebusConfigurer UseTimeoutAttribute(this RebusConfigurer configurer)
{
return configurer.SetTimeToBeReceivedFrom<TimeoutAttribute>(x => x.Timeout);
}
public static RebusConfigurer RequireTimeToBeReceivedUsing<TAttribute>(this RebusConfigurer configurer)
where TAttribute : System.Attribute
{
Guard.IsNotNull(() => configurer, configurer);
return configurer.Events(e =>
{
e.BeforeMessage += (bus, message) =>
{
if (message == null) return;
var type = message.GetType();
var context = MessageContext.GetCurrent();
if (type.GetCustomAttribute<TAttribute>() != null
&& !context.Headers.ContainsKey(Headers.TimeToBeReceived))
{
throw new InvalidOperationException("Message is missing 'TimeToBeReceived' header!");
}
};
});
}
public static RebusConfigurer RequireTimeoutAttribute(this RebusConfigurer configurer)
{
return RequireTimeToBeReceivedUsing<TimeoutAttribute>(configurer);
}
}
}
|
mit
|
C#
|
d228386e231284ae2aa70abb93654304dc515bd7
|
Return if input is null or empty
|
lawliet89/InternetSeparationAdapter
|
InternetSeparationAdapter/UtilsExtension.cs
|
InternetSeparationAdapter/UtilsExtension.cs
|
using System;
using System.Text.RegularExpressions;
namespace InternetSeparationAdapter
{
public static class UtilsExtension
{
// http://stackoverflow.com/a/33113820
public static string Base64UrlEncode(this byte[] arg)
{
var s = Convert.ToBase64String(arg); // Regular base64 encoder
s = s.Split('=')[0]; // Remove any trailing '='s
s = s.Replace('+', '-'); // 62nd char of encoding
s = s.Replace('/', '_'); // 63rd char of encoding
return s;
}
public static byte[] Base64UrlDecode(this string arg)
{
var s = arg;
s = s.Replace('-', '+'); // 62nd char of encoding
s = s.Replace('_', '/'); // 63rd char of encoding
switch (s.Length % 4) // Pad with trailing '='s
{
case 0:
break; // No pad chars in this case
case 2:
s += "==";
break; // Two pad chars
case 3:
s += "=";
break; // One pad char
default:
throw new InvalidOperationException("This code should never be executed");
}
return Convert.FromBase64String(s); // Standard base64 decoder
}
public static string StripSuccessiveNewLines(this string input)
{
if (string.IsNullOrEmpty(input)) return input;
const string pattern = @"(\r\n|\n|\n\r){2,}";
var regex = new Regex(pattern);
return regex.Replace(input, "\n\n");
}
}
}
|
using System;
using System.Text.RegularExpressions;
namespace InternetSeparationAdapter
{
public static class UtilsExtension
{
// http://stackoverflow.com/a/33113820
public static string Base64UrlEncode(this byte[] arg)
{
var s = Convert.ToBase64String(arg); // Regular base64 encoder
s = s.Split('=')[0]; // Remove any trailing '='s
s = s.Replace('+', '-'); // 62nd char of encoding
s = s.Replace('/', '_'); // 63rd char of encoding
return s;
}
public static byte[] Base64UrlDecode(this string arg)
{
var s = arg;
s = s.Replace('-', '+'); // 62nd char of encoding
s = s.Replace('_', '/'); // 63rd char of encoding
switch (s.Length % 4) // Pad with trailing '='s
{
case 0:
break; // No pad chars in this case
case 2:
s += "==";
break; // Two pad chars
case 3:
s += "=";
break; // One pad char
default:
throw new InvalidOperationException("This code should never be executed");
}
return Convert.FromBase64String(s); // Standard base64 decoder
}
public static string StripSuccessiveNewLines(this string input)
{
const string pattern = @"(\r\n|\n|\n\r){2,}";
var regex = new Regex(pattern);
return regex.Replace(input, "\n\n");
}
}
}
|
mit
|
C#
|
695e46a358ba1dd75da161ee70e09bd19d462334
|
Fix AutoPilot mod failing to block touch input
|
peppy/osu,peppy/osu-new,smoogipoo/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,ppy/osu,peppy/osu,ppy/osu,UselessToucan/osu
|
osu.Game.Rulesets.Osu/OsuInputManager.cs
|
osu.Game.Rulesets.Osu/OsuInputManager.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.ComponentModel;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu
{
public class OsuInputManager : RulesetInputManager<OsuAction>
{
public IEnumerable<OsuAction> PressedActions => KeyBindingContainer.PressedActions;
public bool AllowUserPresses
{
set => ((OsuKeyBindingContainer)KeyBindingContainer).AllowUserPresses = value;
}
/// <summary>
/// Whether the user's cursor movement events should be accepted.
/// Can be used to block only movement while still accepting button input.
/// </summary>
public bool AllowUserCursorMovement { get; set; } = true;
protected override KeyBindingContainer<OsuAction> CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
=> new OsuKeyBindingContainer(ruleset, variant, unique);
public OsuInputManager(RulesetInfo ruleset)
: base(ruleset, 0, SimultaneousBindingMode.Unique)
{
}
protected override bool Handle(UIEvent e)
{
if ((e is MouseMoveEvent || e is TouchMoveEvent) && !AllowUserCursorMovement) return false;
return base.Handle(e);
}
private class OsuKeyBindingContainer : RulesetKeyBindingContainer
{
public bool AllowUserPresses = true;
public OsuKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
: base(ruleset, variant, unique)
{
}
protected override bool Handle(UIEvent e)
{
if (!AllowUserPresses) return false;
return base.Handle(e);
}
}
}
public enum OsuAction
{
[Description("Left button")]
LeftButton,
[Description("Right button")]
RightButton
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.ComponentModel;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu
{
public class OsuInputManager : RulesetInputManager<OsuAction>
{
public IEnumerable<OsuAction> PressedActions => KeyBindingContainer.PressedActions;
public bool AllowUserPresses
{
set => ((OsuKeyBindingContainer)KeyBindingContainer).AllowUserPresses = value;
}
/// <summary>
/// Whether the user's cursor movement events should be accepted.
/// Can be used to block only movement while still accepting button input.
/// </summary>
public bool AllowUserCursorMovement { get; set; } = true;
protected override KeyBindingContainer<OsuAction> CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
=> new OsuKeyBindingContainer(ruleset, variant, unique);
public OsuInputManager(RulesetInfo ruleset)
: base(ruleset, 0, SimultaneousBindingMode.Unique)
{
}
protected override bool Handle(UIEvent e)
{
if (e is MouseMoveEvent && !AllowUserCursorMovement) return false;
return base.Handle(e);
}
private class OsuKeyBindingContainer : RulesetKeyBindingContainer
{
public bool AllowUserPresses = true;
public OsuKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
: base(ruleset, variant, unique)
{
}
protected override bool Handle(UIEvent e)
{
if (!AllowUserPresses) return false;
return base.Handle(e);
}
}
}
public enum OsuAction
{
[Description("Left button")]
LeftButton,
[Description("Right button")]
RightButton
}
}
|
mit
|
C#
|
6f59e5feec4bf12c88c729e2b93d0d9f06a0f2e6
|
Add null check on stream
|
Nabile-Rahmani/osu,Damnae/osu,2yangk23/osu,naoey/osu,johnneijzen/osu,NeoAdonis/osu,Frontear/osuKyzer,2yangk23/osu,peppy/osu,EVAST9919/osu,Drezi126/osu,ppy/osu,smoogipoo/osu,naoey/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,ZLima12/osu,johnneijzen/osu,ppy/osu,DrabWeb/osu,DrabWeb/osu,UselessToucan/osu,DrabWeb/osu,NeoAdonis/osu,EVAST9919/osu,smoogipoo/osu,ppy/osu,naoey/osu,ZLima12/osu,smoogipooo/osu,peppy/osu-new,UselessToucan/osu
|
osu.Game/Beatmaps/IO/OszArchiveReader.cs
|
osu.Game/Beatmaps/IO/OszArchiveReader.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 System.IO;
using System.Linq;
using Ionic.Zip;
using osu.Game.Beatmaps.Formats;
namespace osu.Game.Beatmaps.IO
{
public sealed class OszArchiveReader : ArchiveReader
{
public static void Register()
{
AddReader<OszArchiveReader>((storage, path) =>
{
using (var stream = storage.GetStream(path))
return stream != null && ZipFile.IsZipFile(stream, false);
});
OsuLegacyDecoder.Register();
}
private readonly Stream archiveStream;
private readonly ZipFile archive;
public OszArchiveReader(Stream archiveStream)
{
this.archiveStream = archiveStream;
archive = ZipFile.Read(archiveStream);
BeatmapFilenames = archive.Entries.Where(e => e.FileName.EndsWith(@".osu")).Select(e => e.FileName).ToArray();
if (BeatmapFilenames.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps");
StoryboardFilename = archive.Entries.Where(e => e.FileName.EndsWith(@".osb")).Select(e => e.FileName).FirstOrDefault();
}
public override Stream GetStream(string name)
{
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);
if (entry == null)
throw new FileNotFoundException();
return entry.OpenReader();
}
public override void Dispose()
{
archive.Dispose();
archiveStream.Dispose();
}
public override Stream GetUnderlyingStream() => archiveStream;
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.IO;
using System.Linq;
using Ionic.Zip;
using osu.Game.Beatmaps.Formats;
namespace osu.Game.Beatmaps.IO
{
public sealed class OszArchiveReader : ArchiveReader
{
public static void Register()
{
AddReader<OszArchiveReader>((storage, path) =>
{
using (var stream = storage.GetStream(path))
return ZipFile.IsZipFile(stream, false);
});
OsuLegacyDecoder.Register();
}
private readonly Stream archiveStream;
private readonly ZipFile archive;
public OszArchiveReader(Stream archiveStream)
{
this.archiveStream = archiveStream;
archive = ZipFile.Read(archiveStream);
BeatmapFilenames = archive.Entries.Where(e => e.FileName.EndsWith(@".osu")).Select(e => e.FileName).ToArray();
if (BeatmapFilenames.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps");
StoryboardFilename = archive.Entries.Where(e => e.FileName.EndsWith(@".osb")).Select(e => e.FileName).FirstOrDefault();
}
public override Stream GetStream(string name)
{
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);
if (entry == null)
throw new FileNotFoundException();
return entry.OpenReader();
}
public override void Dispose()
{
archive.Dispose();
archiveStream.Dispose();
}
public override Stream GetUnderlyingStream() => archiveStream;
}
}
|
mit
|
C#
|
fbcc2789325e35ca50d5ee61718145750ec3189f
|
Fix Copy method after previous commit logic messed it up
|
mono/cocos2d-xna,zmaruo/CocosSharp,zmaruo/CocosSharp,mono/CocosSharp,TukekeSoft/CocosSharp,TukekeSoft/CocosSharp,mono/cocos2d-xna,MSylvia/CocosSharp,MSylvia/CocosSharp,haithemaraissia/CocosSharp,haithemaraissia/CocosSharp,hig-ag/CocosSharp,netonjm/CocosSharp,mono/CocosSharp,hig-ag/CocosSharp,netonjm/CocosSharp
|
cocos2d/actions/action/CCAction.cs
|
cocos2d/actions/action/CCAction.cs
|
namespace cocos2d
{
public enum ActionTag
{
//! Default tag
kCCActionTagInvalid = -1,
}
public class CCAction : ICopyable
{
protected int m_nTag;
protected CCNode m_pOriginalTarget;
protected CCNode m_pTarget;
public CCAction()
{
m_nTag = (int) ActionTag.kCCActionTagInvalid;
}
public CCAction(CCAction action)
{
m_nTag = action.m_nTag;
}
public CCNode Target
{
get { return m_pTarget; }
set { m_pTarget = value; }
}
public CCNode OriginalTarget
{
get { return m_pOriginalTarget; }
/*
set
{
m_pOriginalTarget = value;
}
*/
}
public int Tag
{
get { return m_nTag; }
set { m_nTag = value; }
}
public virtual CCAction Copy()
{
return (CCAction)Copy(null);
}
public virtual object Copy(ICopyable zone)
{
if (zone != null)
{
((CCAction) zone).m_nTag = m_nTag;
return zone;
}
else
{
return new CCAction(this);
}
}
public virtual bool IsDone
{
get { return true; }
}
public virtual void StartWithTarget(CCNode target)
{
m_pOriginalTarget = m_pTarget = target;
}
public virtual void Stop()
{
m_pTarget = null;
}
public virtual void Step(float dt)
{
CCLog.Log("[Action step]. override me");
}
public virtual void Update(float time)
{
CCLog.Log("[Action update]. override me");
}
}
}
|
namespace cocos2d
{
public enum ActionTag
{
//! Default tag
kCCActionTagInvalid = -1,
}
public class CCAction : ICopyable
{
protected int m_nTag;
protected CCNode m_pOriginalTarget;
protected CCNode m_pTarget;
public CCAction()
{
m_nTag = (int) ActionTag.kCCActionTagInvalid;
}
public CCAction(CCAction action)
{
m_nTag = action.m_nTag;
}
public CCNode Target
{
get { return m_pTarget; }
set { m_pTarget = value; }
}
public CCNode OriginalTarget
{
get { return m_pOriginalTarget; }
/*
set
{
m_pOriginalTarget = value;
}
*/
}
public int Tag
{
get { return m_nTag; }
set { m_nTag = value; }
}
public virtual CCAction Copy()
{
return (CCAction)Copy(null);
}
public virtual object Copy(ICopyable zone)
{
return zone == null ? new CCAction() : new CCAction((CCAction)zone);
}
public virtual bool IsDone
{
get { return true; }
}
public virtual void StartWithTarget(CCNode target)
{
m_pOriginalTarget = m_pTarget = target;
}
public virtual void Stop()
{
m_pTarget = null;
}
public virtual void Step(float dt)
{
CCLog.Log("[Action step]. override me");
}
public virtual void Update(float time)
{
CCLog.Log("[Action update]. override me");
}
}
}
|
mit
|
C#
|
bcf760b1732afb286347e7f2dedaa483f479679a
|
Support 'Is focus required' property modification in runtime (#5227)
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit.SDK/Features/Input/Handlers/BaseInputHandler.cs
|
Assets/MixedRealityToolkit.SDK/Features/Input/Handlers/BaseInputHandler.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Base class for the Mixed Reality Toolkit's SDK input handlers.
/// </summary>
public abstract class BaseInputHandler : InputSystemGlobalHandlerListener
{
[SerializeField]
[Tooltip("Is Focus required to receive input events on this GameObject?")]
private bool isFocusRequired = true;
// Helper variable used to register/unregister handlers during play mode
private bool isFocusRequiredRuntime = true;
/// <summary>
/// Is Focus required to receive input events on this GameObject?
/// </summary>
public virtual bool IsFocusRequired
{
get { return isFocusRequired; }
protected set { isFocusRequired = value; }
}
#region MonoBehaviour Implementation
protected override void OnEnable()
{
if (!isFocusRequired)
{
base.OnEnable();
}
}
protected override void Start()
{
if (!isFocusRequired)
{
base.Start();
}
isFocusRequiredRuntime = isFocusRequired;
}
protected void Update()
{
if(isFocusRequiredRuntime != isFocusRequired)
{
isFocusRequiredRuntime = isFocusRequired;
// If focus wasn't required before and is required now, unregister global handlers.
// Otherwise, register them.
if (isFocusRequired)
{
UnregisterHandlers();
}
else
{
RegisterHandlers();
}
}
}
protected override void OnDisable()
{
if (!isFocusRequiredRuntime)
{
base.OnDisable();
}
}
#endregion MonoBehaviour Implementation
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Base class for the Mixed Reality Toolkit's SDK input handlers.
/// </summary>
public abstract class BaseInputHandler : InputSystemGlobalHandlerListener
{
[SerializeField]
[Tooltip("Is Focus required to receive input events on this GameObject?")]
private bool isFocusRequired = true;
/// <summary>
/// Is Focus required to receive input events on this GameObject?
/// </summary>
public virtual bool IsFocusRequired
{
get { return isFocusRequired; }
protected set { isFocusRequired = value; }
}
#region MonoBehaviour Implementation
protected override void OnEnable()
{
if (!isFocusRequired)
{
base.OnEnable();
}
}
protected override void Start()
{
if (!isFocusRequired)
{
base.Start();
}
}
protected override void OnDisable()
{
if (!isFocusRequired)
{
base.OnDisable();
}
}
#endregion MonoBehaviour Implementation
}
}
|
mit
|
C#
|
8a165b8e183e5bcb2e59bcf4bed01fcbe64703b0
|
remove size estimate from transaction
|
ArsenShnurkov/BitSharp
|
BitSharp.Data/Blockchain/Transaction.cs
|
BitSharp.Data/Blockchain/Transaction.cs
|
using BitSharp.Common;
using BitSharp.Common.ExtensionMethods;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
namespace BitSharp.Data
{
public class Transaction
{
private readonly UInt32 _version;
private readonly ImmutableArray<TxInput> _inputs;
private readonly ImmutableArray<TxOutput> _outputs;
private readonly UInt32 _lockTime;
private readonly UInt256 _hash;
public Transaction(UInt32 version, ImmutableArray<TxInput> inputs, ImmutableArray<TxOutput> outputs, UInt32 lockTime, UInt256? hash = null)
{
this._version = version;
this._inputs = inputs;
this._outputs = outputs;
this._lockTime = lockTime;
this._hash = hash ?? DataCalculator.CalculateTransactionHash(version, inputs, outputs, lockTime);
}
public UInt32 Version { get { return this._version; } }
public ImmutableArray<TxInput> Inputs { get { return this._inputs; } }
public ImmutableArray<TxOutput> Outputs { get { return this._outputs; } }
public UInt32 LockTime { get { return this._lockTime; } }
public UInt256 Hash { get { return this._hash; } }
public Transaction With(UInt32? Version = null, ImmutableArray<TxInput>? Inputs = null, ImmutableArray<TxOutput>? Outputs = null, UInt32? LockTime = null)
{
return new Transaction
(
Version ?? this.Version,
Inputs ?? this.Inputs,
Outputs ?? this.Outputs,
LockTime ?? this.LockTime
);
}
}
}
|
using BitSharp.Common;
using BitSharp.Common.ExtensionMethods;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
namespace BitSharp.Data
{
public class Transaction
{
private readonly UInt32 _version;
private readonly ImmutableArray<TxInput> _inputs;
private readonly ImmutableArray<TxOutput> _outputs;
private readonly UInt32 _lockTime;
private readonly UInt256 _hash;
private readonly long _sizeEstimate;
public Transaction(UInt32 version, ImmutableArray<TxInput> inputs, ImmutableArray<TxOutput> outputs, UInt32 lockTime, UInt256? hash = null)
{
this._version = version;
this._inputs = inputs;
this._outputs = outputs;
this._lockTime = lockTime;
var sizeEstimate = 0L;
for (var i = 0; i < inputs.Count; i++)
sizeEstimate += inputs[i].ScriptSignature.Count;
for (var i = 0; i < outputs.Count; i++)
sizeEstimate += outputs[i].ScriptPublicKey.Count;
sizeEstimate = (long)(sizeEstimate * 1.5);
this._sizeEstimate = sizeEstimate;
this._hash = hash ?? DataCalculator.CalculateTransactionHash(version, inputs, outputs, lockTime);
}
public UInt32 Version { get { return this._version; } }
public ImmutableArray<TxInput> Inputs { get { return this._inputs; } }
public ImmutableArray<TxOutput> Outputs { get { return this._outputs; } }
public UInt32 LockTime { get { return this._lockTime; } }
public UInt256 Hash { get { return this._hash; } }
public long SizeEstimate { get { return this._sizeEstimate; } }
public Transaction With(UInt32? Version = null, ImmutableArray<TxInput>? Inputs = null, ImmutableArray<TxOutput>? Outputs = null, UInt32? LockTime = null)
{
return new Transaction
(
Version ?? this.Version,
Inputs ?? this.Inputs,
Outputs ?? this.Outputs,
LockTime ?? this.LockTime
);
}
}
}
|
unlicense
|
C#
|
b53517cedf3ea399aa7f6da1f53560462c0fd60f
|
update Move method to execute the request on its own
|
smartfile/client-csharp
|
SmartFile/SmartFile.cs
|
SmartFile/SmartFile.cs
|
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using RestSharp;
using RestSharp.Extensions;
namespace SmartFile
{
public class Client : RestClient
{
// Constructor
public Client(string baseUrl) : base(baseUrl)
{
}
public static RestRequest GetUploadRequest(string filename)
{
var request = new RestRequest("/path/data/", Method.POST);
request.AddFile("file", filename);
return request;
}
public static IRestResponse Upload(RestClient client, string filename)
{
var request = GetUploadRequest(filename);
return client.Execute(request);
}
public static RestRequest GetDownloadRequest(string downloadName)
{
var request = new RestRequest("/path/data/" + downloadName, Method.GET);
return request;
}
public static IRestResponse Download(RestClient client, string downloadName, string downloadLocation)
{
var request = GetDownloadRequest(downloadName);
client.DownloadData(request).SaveAs(downloadLocation);
return client.Execute(request);
}
public static RestRequest GetMoveRequest(string sourceFile, string destinationFolder)
{
var request = new RestRequest("/path/oper/move/", Method.POST);
request.AddParameter("src", sourceFile);
request.AddParameter("dst", destinationFolder);
return request;
}
public static IRestResponse Move(RestClient client, string sourceFile, string destinationFolder)
{
var request = GetMoveRequest(sourceFile, destinationFolder);
return client.Execute(request);
}
public static RestRequest Remove(string FileToBeDeleted)
{
var request = new RestRequest("/path/oper/remove/", Method.POST);
request.AddParameter("path", FileToBeDeleted);
return request;
}
}
}
|
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using RestSharp;
using RestSharp.Extensions;
namespace SmartFile
{
public class Client : RestClient
{
// Constructor
public Client(string baseUrl) : base(baseUrl)
{
}
public static RestRequest GetUploadRequest(string filename)
{
var request = new RestRequest("/path/data/", Method.POST);
request.AddFile("file", filename);
return request;
}
public static IRestResponse Upload(RestClient client, string filename)
{
var request = GetUploadRequest(filename);
return client.Execute(request);
}
public static RestRequest GetDownloadRequest(string downloadName)
{
var request = new RestRequest("/path/data/" + downloadName, Method.GET);
return request;
}
public static IRestResponse Download(RestClient client, string downloadName, string downloadLocation)
{
var request = GetDownloadRequest(downloadName);
client.DownloadData(request).SaveAs(downloadLocation);
return client.Execute(request);
}
public static RestRequest Move(string sourceFile, string destinationFolder)
{
var request = new RestRequest("/path/oper/move/", Method.POST);
request.AddParameter("src", sourceFile);
request.AddParameter("dst", destinationFolder);
return request;
}
public static RestRequest Remove(string FileToBeDeleted)
{
var request = new RestRequest("/path/oper/remove/", Method.POST);
request.AddParameter("path", FileToBeDeleted);
return request;
}
}
}
|
bsd-3-clause
|
C#
|
2b4e953da0be4eac81d76c9106328c1c543756bd
|
Fix cache key construct for CachedRequestBuilderImplementation
|
PKRoma/refit
|
Refit/CachedRequestBuilderImplementation.cs
|
Refit/CachedRequestBuilderImplementation.cs
|
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Net.Http;
namespace Refit
{
class CachedRequestBuilderImplementation<T> : CachedRequestBuilderImplementation, IRequestBuilder<T>
{
public CachedRequestBuilderImplementation(IRequestBuilder<T> innerBuilder) : base(innerBuilder)
{
}
}
class CachedRequestBuilderImplementation : IRequestBuilder
{
public CachedRequestBuilderImplementation(IRequestBuilder innerBuilder)
{
this.innerBuilder = innerBuilder;
}
readonly IRequestBuilder innerBuilder;
readonly ConcurrentDictionary<string, Func<HttpClient, object[], object>> methodDictionary = new ConcurrentDictionary<string, Func<HttpClient, object[], object>>();
public Func<HttpClient, object[], object> BuildRestResultFuncForMethod(string methodName, Type[] parameterTypes = null, Type[] genericArgumentTypes = null)
{
var cacheKey = GetCacheKey(methodName, parameterTypes, genericArgumentTypes);
var func = methodDictionary.GetOrAdd(cacheKey, _ => innerBuilder.BuildRestResultFuncForMethod(methodName, parameterTypes, genericArgumentTypes));
return func;
}
string GetCacheKey(string methodName, Type[] parameterTypes, Type[] genericArgumentTypes)
{
var genericDefinition = GetGenericString(genericArgumentTypes);
var argumentString = GetArgumentString(parameterTypes);
return $"{methodName}{genericDefinition}({argumentString})";
}
string GetArgumentString(Type[] parameterTypes)
{
if (parameterTypes == null || parameterTypes.Length == 0)
{
return "";
}
return string.Join(", ", parameterTypes.Select(t => t.FullName));
}
string GetGenericString(Type[] genericArgumentTypes)
{
if (genericArgumentTypes == null || genericArgumentTypes.Length == 0)
{
return "";
}
return "<" + string.Join(", ", genericArgumentTypes.Select(t => t.FullName)) + ">";
}
}
}
|
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Net.Http;
namespace Refit
{
class CachedRequestBuilderImplementation<T> : CachedRequestBuilderImplementation, IRequestBuilder<T>
{
public CachedRequestBuilderImplementation(IRequestBuilder<T> innerBuilder) : base(innerBuilder)
{
}
}
class CachedRequestBuilderImplementation : IRequestBuilder
{
public CachedRequestBuilderImplementation(IRequestBuilder innerBuilder)
{
this.innerBuilder = innerBuilder;
}
readonly IRequestBuilder innerBuilder;
readonly ConcurrentDictionary<string, Func<HttpClient, object[], object>> methodDictionary = new ConcurrentDictionary<string, Func<HttpClient, object[], object>>();
public Func<HttpClient, object[], object> BuildRestResultFuncForMethod(string methodName, Type[] parameterTypes = null, Type[] genericArgumentTypes = null)
{
var cacheKey = GetCacheKey(methodName, parameterTypes, genericArgumentTypes);
var func = methodDictionary.GetOrAdd(cacheKey, _ => innerBuilder.BuildRestResultFuncForMethod(methodName, parameterTypes, genericArgumentTypes));
return func;
}
string GetCacheKey(string methodName, Type[] parameterTypes, Type[] genericArgumentTypes)
{
var genericDefinition = GetGenericString(genericArgumentTypes);
var argumentString = GetArgumentString(parameterTypes);
return $"{methodName}{genericDefinition}({argumentString})";
}
string GetArgumentString(Type[] parameterTypes)
{
if (parameterTypes == null || parameterTypes.Length == 0)
{
return "";
}
return string.Join(", ", parameterTypes.Select(t => t.Name));
}
string GetGenericString(Type[] genericArgumentTypes)
{
if (genericArgumentTypes == null || genericArgumentTypes.Length == 0)
{
return "";
}
return "<" + string.Join(", ", genericArgumentTypes.Select(t => t.Name)) + ">";
}
}
}
|
mit
|
C#
|
fb377a1b96bf747603883fc0936de7bdf9ff71c1
|
Fix hard crash if PerformanceOverlay is toggled before loaded
|
peppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework
|
osu.Framework/Graphics/Performance/PerformanceOverlay.cs
|
osu.Framework/Graphics/Performance/PerformanceOverlay.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Containers;
using osu.Framework.Threading;
using System.Collections.Generic;
namespace osu.Framework.Graphics.Performance
{
internal class PerformanceOverlay : FillFlowContainer<FrameStatisticsDisplay>, IStateful<FrameStatisticsMode>
{
private readonly IEnumerable<GameThread> threads;
private FrameStatisticsMode state;
public event Action<FrameStatisticsMode> StateChanged;
private bool initialised;
public FrameStatisticsMode State
{
get => state;
set
{
if (state == value) return;
state = value;
if (IsLoaded)
updateState();
}
}
protected override void LoadComplete()
{
base.LoadComplete();
updateState();
}
private void updateState()
{
switch (state)
{
case FrameStatisticsMode.None:
this.FadeOut(100);
break;
case FrameStatisticsMode.Minimal:
case FrameStatisticsMode.Full:
if (!initialised)
{
initialised = true;
foreach (GameThread t in threads)
Add(new FrameStatisticsDisplay(t) { State = state });
}
this.FadeIn(100);
break;
}
foreach (FrameStatisticsDisplay d in Children)
d.State = state;
StateChanged?.Invoke(State);
}
public PerformanceOverlay(IEnumerable<GameThread> threads)
{
this.threads = threads;
Direction = FillDirection.Vertical;
}
}
public enum FrameStatisticsMode
{
None,
Minimal,
Full
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Containers;
using osu.Framework.Threading;
using System.Collections.Generic;
namespace osu.Framework.Graphics.Performance
{
internal class PerformanceOverlay : FillFlowContainer<FrameStatisticsDisplay>, IStateful<FrameStatisticsMode>
{
private readonly IEnumerable<GameThread> threads;
private FrameStatisticsMode state;
public event Action<FrameStatisticsMode> StateChanged;
private bool initialised;
public FrameStatisticsMode State
{
get => state;
set
{
if (state == value) return;
state = value;
switch (state)
{
case FrameStatisticsMode.None:
this.FadeOut(100);
break;
case FrameStatisticsMode.Minimal:
case FrameStatisticsMode.Full:
if (!initialised)
{
initialised = true;
foreach (GameThread t in threads)
Add(new FrameStatisticsDisplay(t) { State = state });
}
this.FadeIn(100);
break;
}
foreach (FrameStatisticsDisplay d in Children)
d.State = state;
StateChanged?.Invoke(State);
}
}
public PerformanceOverlay(IEnumerable<GameThread> threads)
{
this.threads = threads;
Direction = FillDirection.Vertical;
}
}
public enum FrameStatisticsMode
{
None,
Minimal,
Full
}
}
|
mit
|
C#
|
9b95ce1045e0d1eba172e41cf96367e656bedffd
|
Change wrong values used to form target URL
|
EVAST9919/osu,ppy/osu,peppy/osu,smoogipoo/osu,smoogipooo/osu,EVAST9919/osu,ppy/osu,peppy/osu-new,ppy/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,smoogipoo/osu,2yangk23/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,2yangk23/osu,UselessToucan/osu,UselessToucan/osu,johnneijzen/osu,johnneijzen/osu,peppy/osu
|
osu.Game/Online/API/Requests/MarkChannelAsReadRequest.cs
|
osu.Game/Online/API/Requests/MarkChannelAsReadRequest.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class MarkChannelAsReadRequest : APIRequest
{
private readonly Channel channel;
private readonly Message message;
public MarkChannelAsReadRequest(Channel channel, Message message)
{
this.channel = channel;
this.message = message;
}
protected override string Target => $"chat/channels/{channel.Id}/mark-as-read/{message.Id}";
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class MarkChannelAsReadRequest : APIRequest
{
private readonly Channel channel;
private readonly Message message;
public MarkChannelAsReadRequest(Channel channel, Message message)
{
this.channel = channel;
this.message = message;
}
protected override string Target => $"/chat/channels/{channel}/mark-as-read/{message}";
}
}
|
mit
|
C#
|
60e0fe905ba5ed413cd0c04e23868ce2ccb47ddc
|
increment patch version,
|
jwChung/Experimentalism,jwChung/Experimentalism
|
build/CommonAssemblyInfo.cs
|
build/CommonAssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.5.1")]
[assembly: AssemblyInformationalVersion("0.5.1")]
/*
* Version 0.5.1
*
* - FixtureType property를 노출함으로써, NaiveTheoremAttribute의 fixtureType
* argument 노출에 대한 code analysis warning(CA1019)을 해결하였음.
*/
|
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Jin-Wook Chung")]
[assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyVersion("0.5.0")]
[assembly: AssemblyInformationalVersion("0.5.0")]
/*
* Version 0.5.0
*
* - Experiment.AutoFixtureWithExample is release newly, which is to show
* examples for how to use Experiment.AutoFixture.
*/
|
mit
|
C#
|
18f59f4da7da330f27c0593600b9d3ef06c50eda
|
Set version to 1.0.0
|
bblanchon/WpfBindingErrors
|
WpfBindingErrors/Properties/AssemblyInfo.cs
|
WpfBindingErrors/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WpfBindingErrors")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Benoit Blanchon")]
[assembly: AssemblyProduct("WpfBindingErrors")]
[assembly: AssemblyCopyright("Copyright © Benoit Blanchon 2013-2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WpfBindingErrors")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Benoit Blanchon")]
[assembly: AssemblyProduct("WpfBindingErrors")]
[assembly: AssemblyCopyright("Copyright © Benoit Blanchon 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0")]
|
mit
|
C#
|
3e3485081d8420044bc95b68a62c617d7c487345
|
Add configuration roles support to 8.2.0 and 8.2.1
|
Sitecore/Sitecore-Instance-Manager,sergeyshushlyapin/Sitecore-Instance-Manager,Brad-Christie/Sitecore-Instance-Manager
|
src/SIM.Tool.Windows/UserControls/Install/InstanceRole.xaml.cs
|
src/SIM.Tool.Windows/UserControls/Install/InstanceRole.xaml.cs
|
using System.Diagnostics;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Navigation;
using Sitecore.Diagnostics.Logging;
namespace SIM.Tool.Windows.UserControls.Install
{
using System;
using SIM.Tool.Base.Pipelines;
using SIM.Tool.Base.Wizards;
using Sitecore.Diagnostics.Base;
using JetBrains.Annotations;
public partial class InstanceRole : IWizardStep
{
public InstanceRole()
{
InitializeComponent();
}
public void InitializeStep([NotNull] WizardArgs wizardArgs)
{
Assert.ArgumentNotNull(wizardArgs, nameof(wizardArgs));
InstallRoles.IsEnabled = false;
InstallRoles.IsChecked = false;
var args = (InstallWizardArgs)wizardArgs;
try
{
var ver = args.Product.Version;
var upd = args.Product.Update;
var txt = $"{ver}.{upd}";
if (txt == "8.1.3" || txt.StartsWith("8.2))
{
InstallRoles.IsEnabled = true;
if (!string.IsNullOrEmpty(args.InstallRoles))
{
InstallRoles.IsChecked = true;
var radio = (RadioButton)RoleName.FindName(args.InstallRoles);
Assert.IsNotNull(radio, $"{args.InstallRoles} is not supported");
radio.IsChecked = true;
}
}
}
catch (Exception e)
{
Log.Error(e, "Something is wrong");
}
}
public bool SaveChanges([NotNull] WizardArgs wizardArgs)
{
Assert.ArgumentNotNull(wizardArgs, nameof(wizardArgs));
var args = (InstallWizardArgs)wizardArgs;
if (InstallRoles.IsChecked != true)
{
args.InstallRoles = "";
InstallWizardArgs.SaveLastTimeOption(nameof(args.InstallRoles), args.InstallRoles);
return true;
}
var role = RoleName.Children.OfType<RadioButton>().FirstOrDefault(x => x.IsChecked == true).IsNotNull("role").Name;
args.InstallRoles = role;
InstallWizardArgs.SaveLastTimeOption(nameof(args.InstallRoles), args.InstallRoles);
return true;
}
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}
|
using System.Diagnostics;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Navigation;
using Sitecore.Diagnostics.Logging;
namespace SIM.Tool.Windows.UserControls.Install
{
using System;
using SIM.Tool.Base.Pipelines;
using SIM.Tool.Base.Wizards;
using Sitecore.Diagnostics.Base;
using JetBrains.Annotations;
public partial class InstanceRole : IWizardStep
{
public InstanceRole()
{
InitializeComponent();
}
public void InitializeStep([NotNull] WizardArgs wizardArgs)
{
Assert.ArgumentNotNull(wizardArgs, nameof(wizardArgs));
InstallRoles.IsEnabled = false;
InstallRoles.IsChecked = false;
var args = (InstallWizardArgs)wizardArgs;
try
{
var ver = args.Product.Version;
var upd = args.Product.Update;
var txt = $"{ver}.{upd}";
if (txt == "8.1.3" || txt == "8.2.2" || txt == "8.2.3")
{
InstallRoles.IsEnabled = true;
if (!string.IsNullOrEmpty(args.InstallRoles))
{
InstallRoles.IsChecked = true;
var radio = (RadioButton)RoleName.FindName(args.InstallRoles);
Assert.IsNotNull(radio, $"{args.InstallRoles} is not supported");
radio.IsChecked = true;
}
}
}
catch (Exception e)
{
Log.Error(e, "Something is wrong");
}
}
public bool SaveChanges([NotNull] WizardArgs wizardArgs)
{
Assert.ArgumentNotNull(wizardArgs, nameof(wizardArgs));
var args = (InstallWizardArgs)wizardArgs;
if (InstallRoles.IsChecked != true)
{
args.InstallRoles = "";
InstallWizardArgs.SaveLastTimeOption(nameof(args.InstallRoles), args.InstallRoles);
return true;
}
var role = RoleName.Children.OfType<RadioButton>().FirstOrDefault(x => x.IsChecked == true).IsNotNull("role").Name;
args.InstallRoles = role;
InstallWizardArgs.SaveLastTimeOption(nameof(args.InstallRoles), args.InstallRoles);
return true;
}
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}
|
mit
|
C#
|
c05fc29aee3180aa3723f195c5c7e9a1f5f13037
|
Fix typo in BareRepositoryException
|
github/libgit2sharp,rcorre/libgit2sharp,ethomson/libgit2sharp,oliver-feng/libgit2sharp,AMSadek/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,Zoxive/libgit2sharp,xoofx/libgit2sharp,mono/libgit2sharp,vorou/libgit2sharp,jeffhostetler/public_libgit2sharp,jeffhostetler/public_libgit2sharp,vivekpradhanC/libgit2sharp,mono/libgit2sharp,oliver-feng/libgit2sharp,OidaTiftla/libgit2sharp,AArnott/libgit2sharp,jorgeamado/libgit2sharp,Skybladev2/libgit2sharp,ethomson/libgit2sharp,red-gate/libgit2sharp,shana/libgit2sharp,jorgeamado/libgit2sharp,sushihangover/libgit2sharp,dlsteuer/libgit2sharp,vorou/libgit2sharp,shana/libgit2sharp,whoisj/libgit2sharp,github/libgit2sharp,Zoxive/libgit2sharp,libgit2/libgit2sharp,jamill/libgit2sharp,AArnott/libgit2sharp,AMSadek/libgit2sharp,nulltoken/libgit2sharp,rcorre/libgit2sharp,whoisj/libgit2sharp,sushihangover/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,Skybladev2/libgit2sharp,PKRoma/libgit2sharp,GeertvanHorrik/libgit2sharp,nulltoken/libgit2sharp,xoofx/libgit2sharp,OidaTiftla/libgit2sharp,GeertvanHorrik/libgit2sharp,jamill/libgit2sharp,psawey/libgit2sharp,psawey/libgit2sharp,vivekpradhanC/libgit2sharp,dlsteuer/libgit2sharp,red-gate/libgit2sharp
|
LibGit2Sharp/BareRepositoryException.cs
|
LibGit2Sharp/BareRepositoryException.cs
|
using System;
using System.Runtime.Serialization;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// The exception that is thrown when an operation which requires a
/// working directory is performed against a bare repository.
/// </summary>
[Serializable]
public class BareRepositoryException : LibGit2SharpException
{
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class.
/// </summary>
public BareRepositoryException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class with a specified error message.
/// </summary>
/// <param name = "message">A message that describes the error. </param>
public BareRepositoryException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name = "message">The error message that explains the reason for the exception. </param>
/// <param name = "innerException">The exception that is the cause of the current exception. If the <paramref name = "innerException" /> parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
public BareRepositoryException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class with a serialized data.
/// </summary>
/// <param name = "info">The <see cref="SerializationInfo "/> that holds the serialized object data about the exception being thrown.</param>
/// <param name = "context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected BareRepositoryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
internal BareRepositoryException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
{
}
}
}
|
using System;
using System.Runtime.Serialization;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// The exception that is thrown when an operation which requires a
/// working directory is performed against a bare repository.
/// </summary>
[Serializable]
public class BareRepositoryException : LibGit2SharpException
{
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class.
/// </summary>
public BareRepositoryException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class with a specified error message.
/// </summary>
/// <param name = "message">A message that describes the error. </param>
public BareRepositoryException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.BareRepositoryException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name = "message">The error message that explains the reason for the exception. </param>
/// <param name = "innerException">The exception that is the cause of the current exception. If the <paramref name = "innerException" /> parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
public BareRepositoryException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref = "LibGit2Sharp.AmbiguousException" /> class with a serialized data.
/// </summary>
/// <param name = "info">The <see cref="SerializationInfo "/> that holds the serialized object data about the exception being thrown.</param>
/// <param name = "context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected BareRepositoryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
internal BareRepositoryException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
{
}
}
}
|
mit
|
C#
|
fabce1163fdfda9c982ab3eeb57c5fd7971f8e6d
|
Fix typos in DefaultHtmlEncoder.cs
|
AngleSharp/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp
|
src/AngleSharp/Html/Forms/Submitters/DefaultHtmlEncoder.cs
|
src/AngleSharp/Html/Forms/Submitters/DefaultHtmlEncoder.cs
|
namespace AngleSharp.Html.Forms.Submitters
{
using AngleSharp.Text;
using System.Runtime.CompilerServices;
using System.Text;
/// <summary>
/// Represents the default HTML encoder.
/// </summary>
public class DefaultHtmlEncoder : IHtmlEncoder
{
/// <summary>
/// Replaces characters in names and values that cannot be expressed by using the given
/// encoding with &#...; base-10 unicode point.
/// </summary>
/// <param name="value">The value to sanitize.</param>
/// <param name="encoding">The encoding to consider.</param>
/// <returns>The sanitized value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string Encode(string value, Encoding encoding)
{
return value.HtmlEncode(encoding);
}
}
}
|
namespace AngleSharp.Html.Forms.Submitters
{
using AngleSharp.Text;
using System.Runtime.CompilerServices;
using System.Text;
/// <summary>
/// Represents the default HTML encoder.
/// </summary>
public class DefaultHtmlEncoder : IHtmlEncoder
{
/// <summary>
/// Replaces characters in names and values that cannot be expressed by using the given
/// encoding with &#...; base-10 unicode point.
/// </summary>
/// <param name="value">The value to sanatize.</param>
/// <param name="encoding">The encoding to consider.</param>
/// <returns>The sanatized value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string Encode(string value, Encoding encoding)
{
return value.HtmlEncode(encoding);
}
}
}
|
mit
|
C#
|
d4e72afb17f1a7e69c2595dc49c2205656260ddd
|
Add more unit tests for ToPersianNumbers and ToEnglishNumbers.
|
VahidN/DNTPersianUtils.Core,VahidN/DNTPersianUtils.Core
|
src/DNTPersianUtils.Core.Tests/PersianNumbersUtilsTests.cs
|
src/DNTPersianUtils.Core.Tests/PersianNumbersUtilsTests.cs
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace DNTPersianUtils.Core.Tests
{
[TestClass]
public class PersianNumbersUtilsTests
{
[TestMethod]
public void Test_English_ToPersianNumbers_Works()
{
var actual = 123.ToPersianNumbers();
Assert.AreEqual(expected: "۱۲۳", actual: actual);
}
[TestMethod]
public void Test_Arabic_ToPersianNumbers_Works()
{
var actual = "\u06F1\u06F2\u06F3".ToPersianNumbers();
Assert.AreEqual(expected: "۱۲۳", actual: actual);
}
[TestMethod]
public void Test_Persian_ToEnglishNumbers_Works()
{
var actual = "١٢٣".ToEnglishNumbers();
Assert.AreEqual(expected: "123", actual: actual);
}
[TestMethod]
public void Test_Arabic_ToEnglishNumbers_Works()
{
var actual = "\u06F1\u06F2\u06F3".ToEnglishNumbers();
Assert.AreEqual(expected: "123", actual: actual);
}
}
}
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace DNTPersianUtils.Core.Tests
{
[TestClass]
public class PersianNumbersUtilsTests
{
[TestMethod]
public void Test_ToPersianNumbers_Works()
{
var actual = 123.ToPersianNumbers();
Assert.AreEqual(expected: "۱۲۳", actual: actual);
}
}
}
|
apache-2.0
|
C#
|
c3d4f594236c070bf2e52054b74b17775fda8045
|
Use TypeStub for testing hehe
|
FreecraftCore/FreecraftCore.Serializer,FreecraftCore/FreecraftCore.Serializer
|
src/FreecraftCore.Serializer.Compiler/Template/TypeStub.cs
|
src/FreecraftCore.Serializer.Compiler/Template/TypeStub.cs
|
using System;
using System.Collections.Generic;
using System.Text;
namespace FreecraftCore.Serializer
{
[WireDataContract]
public sealed class TypeStub
{
[WireMember(1)]
public int Hello { get; internal set; }
[SendSize(SendSizeAttribute.SizeType.UInt16)]
[Encoding(EncodingType.UTF32)]
[WireMember(2)]
public string TestString { get; internal set; }
[WireMember(3)]
public ushort HelloAgain { get; internal set; }
public TypeStub()
{
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace FreecraftCore.Serializer
{
[WireDataContract]
internal sealed class TypeStub
{
[WireMember(1)]
public int Hello { get; internal set; }
public TypeStub()
{
}
}
}
|
agpl-3.0
|
C#
|
15a9859b2e59e2e6f026cb4600823b2159eda2e4
|
Fix type decoder related ones.
|
undeadlabs/msgpack-cli,undeadlabs/msgpack-cli,modulexcite/msgpack-cli,msgpack/msgpack-cli,msgpack/msgpack-cli,modulexcite/msgpack-cli
|
src/MsgPack/Binary.cs
|
src/MsgPack/Binary.cs
|
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010-2014 FUJIWARA, Yusuke
//
// 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 -- License Terms --
using System;
using System.Text;
namespace MsgPack
{
/// <summary>
/// Defines binary related utilities.
/// </summary>
internal static class Binary
{
/// <summary>
/// Singleton empty <see cref="Byte"/>[].
/// </summary>
public static readonly byte[] Empty = new byte[ 0 ];
public static string ToHexString( byte[] blob )
{
return ToHexString( blob, true );
}
public static string ToHexString( byte[] blob, bool withPrefix )
{
if ( blob == null || blob.Length == 0 )
{
return String.Empty;
}
var buffer = new StringBuilder( blob.Length * 2 + (withPrefix ? 2 : 0 ) );
ToHexStringCore( blob, buffer, withPrefix );
return buffer.ToString();
}
public static void ToHexString( byte[] blob, StringBuilder buffer )
{
if ( blob == null || blob.Length == 0 )
{
return;
}
ToHexStringCore( blob, buffer, true );
}
private static void ToHexStringCore( byte[] blob, StringBuilder buffer, bool withPrefix )
{
if ( withPrefix )
{
buffer.Append( "0x" );
}
foreach ( var b in blob )
{
buffer.Append( ToHexChar( b >> 4 ) );
buffer.Append( ToHexChar( b & 0xF ) );
}
}
private static char ToHexChar( int b )
{
if ( b < 10 )
{
return unchecked( ( char )( '0' + b ) );
}
else
{
return unchecked( ( char )( 'A' + ( b - 10 ) ) );
}
}
}
}
|
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010-2014 FUJIWARA, Yusuke
//
// 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 -- License Terms --
using System;
using System.Text;
namespace MsgPack
{
/// <summary>
/// Defines binary related utilities.
/// </summary>
internal static class Binary
{
/// <summary>
/// Singleton empty <see cref="Byte"/>[].
/// </summary>
public static readonly byte[] Empty = new byte[ 0 ];
public static string ToHexString( byte[] blob )
{
if ( blob == null || blob.Length == 0 )
{
return String.Empty;
}
var buffer = new StringBuilder( blob.Length * 2 + 2 );
ToHexStringCore( blob, buffer );
return buffer.ToString();
}
public static void ToHexString( byte[] blob, StringBuilder buffer )
{
if ( blob == null || blob.Length == 0 )
{
return;
}
ToHexStringCore( blob, buffer );
}
private static void ToHexStringCore( byte[] blob, StringBuilder buffer )
{
buffer.Append( "0x" );
foreach ( var b in blob )
{
buffer.Append( ToHexChar( b >> 4 ) );
buffer.Append( ToHexChar( b & 0xF ) );
}
}
private static char ToHexChar( int b )
{
if ( b < 10 )
{
return unchecked( ( char )( '0' + b ) );
}
else
{
return unchecked( ( char )( 'A' + ( b - 10 ) ) );
}
}
}
}
|
apache-2.0
|
C#
|
3405f0a1e227e48d78de6181c392fa7072ac08c1
|
Implement equality on Credit struct
|
danielchalmers/WpfAboutView
|
WpfAboutView/Credit.cs
|
WpfAboutView/Credit.cs
|
using System;
using System.Collections.Generic;
namespace WpfAboutView
{
public struct Credit : IEquatable<Credit>
{
public string Name { get; set; }
public string Author { get; set; }
public Uri Website { get; set; }
public string LicenseText { get; set; }
public override bool Equals(object obj) =>
obj is Credit && Equals((Credit)obj);
public bool Equals(Credit other) =>
Name == other.Name &&
Author == other.Author &&
EqualityComparer<Uri>.Default.Equals(Website, other.Website) &&
LicenseText == other.LicenseText;
public override int GetHashCode()
{
var hashCode = 2101635641;
hashCode = (hashCode * -1521134295) + EqualityComparer<string>.Default.GetHashCode(Name);
hashCode = (hashCode * -1521134295) + EqualityComparer<string>.Default.GetHashCode(Author);
hashCode = (hashCode * -1521134295) + EqualityComparer<Uri>.Default.GetHashCode(Website);
hashCode = (hashCode * -1521134295) + EqualityComparer<string>.Default.GetHashCode(LicenseText);
return hashCode;
}
public static bool operator ==(Credit left, Credit right) => left.Equals(right);
public static bool operator !=(Credit left, Credit right) => !(left == right);
}
}
|
using System;
namespace WpfAboutView
{
public struct Credit
{
public string Name { get; set; }
public string Author { get; set; }
public Uri Website { get; set; }
public string LicenseText { get; set; }
}
}
|
mit
|
C#
|
64768da3abbfb42ec310d5aadea0e82390f042c7
|
Use UsePlatformDetect
|
wieslawsoltes/PanAndZoom,PanAndZoom/PanAndZoom,wieslawsoltes/MatrixPanAndZoomDemo,PanAndZoom/PanAndZoom,wieslawsoltes/PanAndZoom
|
samples/AvaloniaDemo/Program.cs
|
samples/AvaloniaDemo/Program.cs
|
using Avalonia;
using Avalonia.Controls;
using Avalonia.Logging.Serilog;
using Serilog;
using System;
using System.Diagnostics;
namespace AvaloniaDemo
{
internal class Program
{
private static void Main(string[] args)
{
try
{
InitializeLogging();
AppBuilder.Configure<App>()
.UsePlatformDetect()
.Start<MainWindow>();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}
private static void InitializeLogging()
{
#if DEBUG
SerilogLogger.Initialize(new LoggerConfiguration()
.MinimumLevel.Warning()
.WriteTo.Trace(outputTemplate: "{Area}: {Message}")
.CreateLogger());
#endif
}
}
}
|
using Avalonia;
using Avalonia.Controls;
using Avalonia.Logging.Serilog;
using Serilog;
using System;
using System.Diagnostics;
namespace AvaloniaDemo
{
internal class Program
{
private static void Main(string[] args)
{
try
{
InitializeLogging();
AppBuilder.Configure<App>()
.UseWin32()
.UseDirect2D1()
.Start<MainWindow>();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}
private static void InitializeLogging()
{
#if DEBUG
SerilogLogger.Initialize(new LoggerConfiguration()
.MinimumLevel.Warning()
.WriteTo.Trace(outputTemplate: "{Area}: {Message}")
.CreateLogger());
#endif
}
}
}
|
mit
|
C#
|
fcace25fdcdec94bb8489db10e494ea7a51ba15d
|
Switch RequestProfiler consumers over to using provider
|
peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype
|
src/Glimpse.Agent.Web/Framework/MasterRequestProfiler.cs
|
src/Glimpse.Agent.Web/Framework/MasterRequestProfiler.cs
|
using Glimpse.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Glimpse.Agent.Web
{
public class MasterRequestProfiler : IRequestRuntime
{
private readonly IEnumerable<IRequestProfiler> _requestProfiliers;
private readonly IEnumerable<IIgnoredRequestPolicy> _ignoredRequestPolicies;
public MasterRequestProfiler(IRequestProfilerProvider requestProfilerProvider, IIgnoredRequestProvider ignoredRequestProvider)
{
_requestProfiliers = requestProfilerProvider.Profilers;
_ignoredRequestPolicies = ignoredRequestProvider.Policies;
}
public async Task Begin(IHttpContext context)
{
if (ShouldProfile(context))
{
foreach (var requestRuntime in _requestProfiliers)
{
await requestRuntime.Begin(context);
}
}
}
public async Task End(IHttpContext context)
{
if (ShouldProfile(context))
{
foreach (var requestRuntime in _requestProfiliers)
{
await requestRuntime.End(context);
}
}
}
public bool ShouldProfile(IHttpContext context)
{
if (_ignoredRequestPolicies.Any())
{
foreach (var policy in _ignoredRequestPolicies)
{
if (policy.ShouldIgnore(context))
{
return false;
}
}
}
return true;
}
}
}
|
using Glimpse.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Glimpse.Agent.Web
{
public class MasterRequestProfiler : IRequestRuntime
{
private readonly IDiscoverableCollection<IRequestProfiler> _requestProfiliers;
private readonly IEnumerable<IIgnoredRequestPolicy> _ignoredRequestPolicies;
public MasterRequestProfiler(IDiscoverableCollection<IRequestProfiler> requestProfiliers, IIgnoredRequestProvider ignoredRequestProvider)
{
_requestProfiliers = requestProfiliers;
_requestProfiliers.Discover();
_ignoredRequestPolicies = ignoredRequestProvider.Policies;
}
public async Task Begin(IHttpContext context)
{
if (ShouldProfile(context))
{
foreach (var requestRuntime in _requestProfiliers)
{
await requestRuntime.Begin(context);
}
}
}
public async Task End(IHttpContext context)
{
if (ShouldProfile(context))
{
foreach (var requestRuntime in _requestProfiliers)
{
await requestRuntime.End(context);
}
}
}
public bool ShouldProfile(IHttpContext context)
{
if (_ignoredRequestPolicies.Any())
{
foreach (var policy in _ignoredRequestPolicies)
{
if (policy.ShouldIgnore(context))
{
return false;
}
}
}
return true;
}
}
}
|
mit
|
C#
|
426e066a079932e5da30c95dda4fb48f3709446d
|
Update title attributes for sign-in partial
|
martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site
|
src/LondonTravel.Site/Views/Shared/_SignInPartial.cshtml
|
src/LondonTravel.Site/Views/Shared/_SignInPartial.cshtml
|
@inject SiteOptions Options
@inject Microsoft.AspNetCore.Identity.SignInManager<LondonTravelUser> SignInManager
@if (SignInManager.IsSignedIn(User))
{
<form asp-route="SignOut" method="post" id="signOutForm" class="navbar-right">
<ul class="nav navbar-nav navbar-right">
<li>
<a asp-route="Manage" rel="nofollow" title="Manage your London Travel account">
@User.GetDisplayName()
<lazyimg alt="@User.Identity.Name" src="@User.GetAvatarUrl(Url.CdnContent("avatar.png", Options))" aria-hidden="true" />
</a>
</li>
<li>
<button type="submit" class="btn btn-link navbar-btn navbar-link">
Sign out
<i class="fa fa-sign-out" aria-hidden="true"></i>
</button>
</li>
</ul>
</form>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-route="SignIn" rel="nofollow" title="Sign in to your London Travel account">Sign in</a></li>
<li><a asp-route="Register" title="Register for a London Travel account">Register</a></li>
</ul>
}
|
@inject SiteOptions Options
@inject Microsoft.AspNetCore.Identity.SignInManager<LondonTravelUser> SignInManager
@if (SignInManager.IsSignedIn(User))
{
<form asp-route="SignOut" method="post" id="signOutForm" class="navbar-right">
<ul class="nav navbar-nav navbar-right">
<li>
<a asp-route="Manage" rel="nofollow" title="Manage your London Travel account">
@User.GetDisplayName()
<lazyimg alt="@User.Identity.Name" src="@User.GetAvatarUrl(Url.CdnContent("avatar.png", Options))" aria-hidden="true" />
</a>
</li>
<li>
<button type="submit" class="btn btn-link navbar-btn navbar-link">
Sign out
<i class="fa fa-sign-out" aria-hidden="true"></i>
</button>
</li>
</ul>
</form>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-route="SignIn" rel="nofollow" title="Sign in">Sign in</a></li>
<li><a asp-route="Register" title="Register">Register</a></li>
</ul>
}
|
apache-2.0
|
C#
|
2296d9bf209e741610f8c052ee5a0a6ca6d0bd11
|
Fix two-digit number overflow in voicestats command.
|
Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW
|
src/MitternachtBot/Modules/Utility/VoiceStatsCommands.cs
|
src/MitternachtBot/Modules/Utility/VoiceStatsCommands.cs
|
using Discord;
using Discord.Commands;
using Mitternacht.Common.Attributes;
using Mitternacht.Modules.Utility.Services;
using Mitternacht.Database;
using System;
using System.Threading.Tasks;
namespace Mitternacht.Modules.Utility {
public partial class Utility {
public class VoiceStatsCommands : MitternachtSubmodule<VoiceStatsService> {
private readonly IUnitOfWork uow;
public VoiceStatsCommands(IUnitOfWork uow) {
this.uow = uow;
}
[MitternachtCommand, Description, Usage, Aliases]
[RequireContext(ContextType.Guild)]
public async Task VoiceStats(IGuildUser user = null) {
user ??= Context.User as IGuildUser;
if(uow.VoiceChannelStats.TryGetTime(user.GuildId, user.Id, out var time)) {
var timespan = TimeSpan.FromSeconds(time);
await ConfirmLocalized("voicestats_time", user.ToString(), $"{(timespan.Days > 0 ? $"{timespan.Days}d" : "")}{(timespan.Hours > 0 ? $"{timespan:hh}h" : "")}{(timespan.Minutes > 0 ? $"{timespan:mm}min" : "")}{timespan:ss}s").ConfigureAwait(false);
} else
await ConfirmLocalized("voicestats_untracked", user.ToString()).ConfigureAwait(false);
}
[MitternachtCommand, Description, Usage, Aliases]
[RequireContext(ContextType.Guild)]
[OwnerOrGuildPermission(GuildPermission.Administrator)]
public async Task VoiceStatsReset(IGuildUser user) {
if(user == null)
return;
uow.VoiceChannelStats.Reset(user.GuildId, user.Id);
await uow.SaveChangesAsync(false).ConfigureAwait(false);
await ConfirmLocalized("voicestats_reset", user.ToString()).ConfigureAwait(false);
}
}
}
}
|
using Discord;
using Discord.Commands;
using Mitternacht.Common.Attributes;
using Mitternacht.Modules.Utility.Services;
using Mitternacht.Database;
using System;
using System.Threading.Tasks;
namespace Mitternacht.Modules.Utility {
public partial class Utility {
public class VoiceStatsCommands : MitternachtSubmodule<VoiceStatsService> {
private readonly IUnitOfWork uow;
public VoiceStatsCommands(IUnitOfWork uow) {
this.uow = uow;
}
[MitternachtCommand, Description, Usage, Aliases]
[RequireContext(ContextType.Guild)]
public async Task VoiceStats(IGuildUser user = null) {
user ??= Context.User as IGuildUser;
if(uow.VoiceChannelStats.TryGetTime(user.GuildId, user.Id, out var time)) {
var timespan = TimeSpan.FromSeconds(time);
await ConfirmLocalized("voicestats_time", user.ToString(), $"{(timespan.Days > 0 ? $"{timespan:dd}d" : "")}{(timespan.Hours > 0 ? $"{timespan:hh}h" : "")}{(timespan.Minutes > 0 ? $"{timespan:mm}min" : "")}{timespan:ss}s").ConfigureAwait(false);
} else
await ConfirmLocalized("voicestats_untracked", user.ToString()).ConfigureAwait(false);
}
[MitternachtCommand, Description, Usage, Aliases]
[RequireContext(ContextType.Guild)]
[OwnerOrGuildPermission(GuildPermission.Administrator)]
public async Task VoiceStatsReset(IGuildUser user) {
if(user == null)
return;
uow.VoiceChannelStats.Reset(user.GuildId, user.Id);
await uow.SaveChangesAsync(false).ConfigureAwait(false);
await ConfirmLocalized("voicestats_reset", user.ToString()).ConfigureAwait(false);
}
}
}
}
|
mit
|
C#
|
851ec58bed860450e9e0fcf72d2b3bcd00ed9ed9
|
Test boton random
|
Portafolio-titulo2017-Grupo3/Sistema_escritorio_NET
|
OrionEscritorio/OrionEscritorio/TEST_RAMA.Designer.cs
|
OrionEscritorio/OrionEscritorio/TEST_RAMA.Designer.cs
|
namespace OrionEscritorio
{
partial class TEST_RAMA
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(58, 97);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
//
// TEST_RAMA
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.button1);
this.Name = "TEST_RAMA";
this.Text = "Nombre Cambiado";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
}
}
|
namespace OrionEscritorio
{
partial class TEST_RAMA
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// TEST_RAMA
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Name = "TEST_RAMA";
this.Text = "Nombre Cambiado";
this.ResumeLayout(false);
}
#endregion
}
}
|
mit
|
C#
|
9a17449a02a6c4a98ada40956fb999502f3888ab
|
Format NewSubHeaderType
|
adamhathcock/sharpcompress,adamhathcock/sharpcompress,adamhathcock/sharpcompress
|
src/SharpCompress/Common/Rar/Headers/NewSubHeaderType.cs
|
src/SharpCompress/Common/Rar/Headers/NewSubHeaderType.cs
|
using System;
namespace SharpCompress.Common.Rar.Headers
{
internal sealed class NewSubHeaderType : IEquatable<NewSubHeaderType>
{
internal static readonly NewSubHeaderType SUBHEAD_TYPE_CMT = new ('C', 'M', 'T');
//internal static final NewSubHeaderType SUBHEAD_TYPE_ACL = new (new byte[]{'A','C','L'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_STREAM = new (new byte[]{'S','T','M'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_UOWNER = new (new byte[]{'U','O','W'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_AV = new (new byte[]{'A','V'});
internal static readonly NewSubHeaderType SUBHEAD_TYPE_RR = new ('R', 'R');
//internal static final NewSubHeaderType SUBHEAD_TYPE_OS2EA = new (new byte[]{'E','A','2'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_BEOSEA = new (new byte[]{'E','A','B','E'});
private readonly byte[] _bytes;
private NewSubHeaderType(params char[] chars)
{
_bytes = new byte[chars.Length];
for (int i = 0; i < chars.Length; ++i)
{
_bytes[i] = (byte)chars[i];
}
}
internal bool Equals(byte[] bytes)
{
if (_bytes.Length != bytes.Length)
{
return false;
}
return _bytes.AsSpan().SequenceEqual(bytes);
}
public bool Equals(NewSubHeaderType? other)
{
return other is not null && Equals(other._bytes);
}
}
}
|
using System;
namespace SharpCompress.Common.Rar.Headers
{
internal class NewSubHeaderType : IEquatable<NewSubHeaderType>
{
internal static readonly NewSubHeaderType SUBHEAD_TYPE_CMT = new NewSubHeaderType('C', 'M', 'T');
//internal static final NewSubHeaderType SUBHEAD_TYPE_ACL = new NewSubHeaderType(new byte[]{'A','C','L'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_STREAM = new NewSubHeaderType(new byte[]{'S','T','M'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_UOWNER = new NewSubHeaderType(new byte[]{'U','O','W'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_AV = new NewSubHeaderType(new byte[]{'A','V'});
internal static readonly NewSubHeaderType SUBHEAD_TYPE_RR = new NewSubHeaderType('R', 'R');
//internal static final NewSubHeaderType SUBHEAD_TYPE_OS2EA = new NewSubHeaderType(new byte[]{'E','A','2'});
//internal static final NewSubHeaderType SUBHEAD_TYPE_BEOSEA = new NewSubHeaderType(new byte[]{'E','A','B','E'});
private readonly byte[] _bytes;
private NewSubHeaderType(params char[] chars)
{
_bytes = new byte[chars.Length];
for (int i = 0; i < chars.Length; ++i)
{
_bytes[i] = (byte)chars[i];
}
}
internal bool Equals(byte[] bytes)
{
if (_bytes.Length != bytes.Length)
{
return false;
}
for (int i = 0; i < bytes.Length; ++i)
{
if (_bytes[i] != bytes[i])
{
return false;
}
}
return true;
}
public bool Equals(NewSubHeaderType? other)
{
return other is not null && Equals(other._bytes);
}
}
}
|
mit
|
C#
|
2a0d59950e67f26aab569750d7ea566cb8779e0e
|
Initialize Disposables first
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/Controls/LockScreen/LockScreenViewModelBase.cs
|
WalletWasabi.Gui/Controls/LockScreen/LockScreenViewModelBase.cs
|
using System;
using ReactiveUI;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Gui.Controls.LockScreen
{
public abstract class LockScreenViewModelBase : ViewModelBase
{
private bool _isAnimating;
private bool _isLocked;
private bool _canSlide;
private volatile bool _disposedValue = false; // To detect redundant calls
public LockScreenViewModelBase()
{
Disposables = new CompositeDisposable();
IsLocked = true;
}
protected CompositeDisposable Disposables { get; }
public bool CanSlide
{
get => _canSlide;
set => this.RaiseAndSetIfChanged(ref _canSlide, value);
}
public bool IsLocked
{
get => _isLocked;
set => this.RaiseAndSetIfChanged(ref _isLocked, value);
}
public bool IsAnimating
{
get => _isAnimating;
set => this.RaiseAndSetIfChanged(ref _isAnimating, value);
}
public void Initialize()
{
OnInitialize(Disposables);
}
protected virtual void OnInitialize(CompositeDisposable disposables)
{
}
protected void Close()
{
IsLocked = false;
this.WhenAnyValue(x => x.IsAnimating)
.Where(x => !x)
.Take(1)
.Subscribe(x => MainWindowViewModel.Instance?.CloseLockScreen(this));
}
#region IDisposable Support
protected virtual void Dispose(bool disposing)
{
if (!_disposedValue)
{
if (disposing)
{
Disposables?.Dispose();
}
_disposedValue = true;
}
}
public void Dispose()
{
Dispose(true);
}
#endregion IDisposable Support
}
}
|
using System;
using ReactiveUI;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Gui.Controls.LockScreen
{
public abstract class LockScreenViewModelBase : ViewModelBase
{
private bool _isAnimating;
private bool _isLocked;
private bool _canSlide;
private volatile bool _disposedValue = false; // To detect redundant calls
public LockScreenViewModelBase()
{
IsLocked = true;
Disposables = new CompositeDisposable();
}
protected CompositeDisposable Disposables { get; }
public bool CanSlide
{
get => _canSlide;
set => this.RaiseAndSetIfChanged(ref _canSlide, value);
}
public bool IsLocked
{
get => _isLocked;
set => this.RaiseAndSetIfChanged(ref _isLocked, value);
}
public bool IsAnimating
{
get => _isAnimating;
set => this.RaiseAndSetIfChanged(ref _isAnimating, value);
}
public void Initialize()
{
OnInitialize(Disposables);
}
protected virtual void OnInitialize(CompositeDisposable disposables)
{
}
protected void Close()
{
IsLocked = false;
this.WhenAnyValue(x => x.IsAnimating)
.Where(x => !x)
.Take(1)
.Subscribe(x => MainWindowViewModel.Instance?.CloseLockScreen(this));
}
#region IDisposable Support
protected virtual void Dispose(bool disposing)
{
if (!_disposedValue)
{
if (disposing)
{
Disposables?.Dispose();
}
_disposedValue = true;
}
}
public void Dispose()
{
Dispose(true);
}
#endregion IDisposable Support
}
}
|
mit
|
C#
|
1ae67e1e6313b7324a92f1a62bf4685ee98b6f96
|
Fix typo. (#1093)
|
FormsCommunityToolkit/FormsCommunityToolkit
|
samples/XCT.Sample/ViewModels/Converters/ItemSelectedEventArgsViewModel.cs
|
samples/XCT.Sample/ViewModels/Converters/ItemSelectedEventArgsViewModel.cs
|
using System.Collections.Generic;
using System.Windows.Input;
using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms;
namespace Xamarin.CommunityToolkit.Sample.ViewModels.Converters
{
public class ItemSelectedEventArgsViewModel
{
public IEnumerable<Person> Items { get; } =
new List<Person>()
{
new Person() { Id = 1, Name = "Person 1" },
new Person() { Id = 2, Name = "Person 2" },
new Person() { Id = 3, Name = "Person 3" }
};
public ICommand ItemSelectedCommand { get; private set; } = new AsyncCommand<Person>(person
=> Application.Current.MainPage.DisplayAlert("Item Tapped: ", person.Name, "Cancel"));
}
}
|
using System.Collections.Generic;
using System.Windows.Input;
using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms;
namespace Xamarin.CommunityToolkit.Sample.ViewModels.Converters
{
public class ItemSelectedEventArgsViewModel
{
public IEnumerable<Person> Items { get; } =
new List<Person>()
{
new Person() { Id = 1, Name = "Person 1" },
new Person() { Id = 2, Name = "Person 2" },
new Person() { Id = 3, Name = "Person 3" }
};
public ICommand ItemSelectedCommand { get; private set; } = new AsyncCommand<Person>(person
=> Application.Current.MainPage.DisplayAlert("Item Tapped: ", person.Name, "Cancelf"));
}
}
|
mit
|
C#
|
2e7c45e30b098bf37ab1b63fdea62ba0e9a7c347
|
address info
|
Appleseed/base,Appleseed/base
|
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Program.cs
|
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SendGrid;
using SendGrid.Helpers.Mail;
using System.Net;
using System.IO;
using Newtonsoft.Json;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using Dapper;
namespace Appleseed.Base.Alerts
{
class Program
{
class UserAlert
{
public Guid user_id { get; set; }
public string email { get; set; }
public string name { get; set; }
public string source { get; set; }
}
class RootSolrObject
{
public SolrResponse response { get; set; }
}
class SolrResponse
{
public SolrResponseItem[] docs { get; set; }
}
class SolrResponseItem
{
public string id { get; set; }
public string[] item_type { get; set; }
public string[] address_1 { get; set; }
public string city { get; set; }
public string state { get; set; }
public string classification { get; set; }
public string country { get; set; }
public string[] postal_code { get; set; }
}
static void Main(string[] args)
{
}
#region helpers
static string UppercaseFirst(string s)
{
if (string.IsNullOrEmpty(s))
{
return string.Empty;
}
char[] a = s.ToCharArray();
a[0] = char.ToUpper(a[0]);
return new string(a);
}
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SendGrid;
using SendGrid.Helpers.Mail;
using System.Net;
using System.IO;
using Newtonsoft.Json;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using Dapper;
namespace Appleseed.Base.Alerts
{
class Program
{
class UserAlert
{
public Guid user_id { get; set; }
public string email { get; set; }
public string name { get; set; }
public string source { get; set; }
}
class RootSolrObject
{
public SolrResponse response { get; set; }
}
class SolrResponse
{
public SolrResponseItem[] docs { get; set; }
}
class SolrResponseItem
{
public string id { get; set; }
public string[] item_type { get; set; }
public string[] address_1 { get; set; }
}
static void Main(string[] args)
{
}
#region helpers
static string UppercaseFirst(string s)
{
if (string.IsNullOrEmpty(s))
{
return string.Empty;
}
char[] a = s.ToCharArray();
a[0] = char.ToUpper(a[0]);
return new string(a);
}
#endregion
}
}
|
apache-2.0
|
C#
|
6d2b330429d6f2828041b1194445ea37e51192c9
|
Update anchor within help link (follow-up to r3671). Closes #3647.
|
pkdevbox/trac,pkdevbox/trac,pkdevbox/trac,pkdevbox/trac
|
templates/anydiff.cs
|
templates/anydiff.cs
|
<?cs include "header.cs"?>
<div id="ctxtnav" class="nav"></div>
<div id="content" class="changeset">
<div id="title">
<h1>Select Base and Target for Diff:</h1>
</div>
<div id="anydiff">
<form action="<?cs var:anydiff.changeset_href ?>" method="get">
<table>
<tr>
<th><label for="old_path">From:</label></th>
<td>
<input type="text" id="old_path" name="old_path" value="<?cs
var:anydiff.old_path ?>" size="44" />
<label for="old_rev">at Revision:</label>
<input type="text" id="old_rev" name="old" value="<?cs
var:anydiff.old_rev ?>" size="4" />
</td>
</tr>
<tr>
<th><label for="new_path">To:</label></th>
<td>
<input type="text" id="new_path" name="new_path" value="<?cs
var:anydiff.new_path ?>" size="44" />
<label for="new_rev">at Revision:</label>
<input type="text" id="new_rev" name="new" value="<?cs
var:anydiff.new_rev ?>" size="4" />
</td>
</tr>
</table>
<div class="buttons">
<input type="submit" value="View changes" />
</div>
</form>
</div>
<div id="help">
<strong>Note:</strong> See <a href="<?cs var:trac.href.wiki
?>/TracChangeset#ExaminingDifferencesBetweenBranches">TracChangeset</a> for help on using the arbitrary diff feature.
</div>
</div>
<?cs include "footer.cs"?>
|
<?cs include "header.cs"?>
<div id="ctxtnav" class="nav"></div>
<div id="content" class="changeset">
<div id="title">
<h1>Select Base and Target for Diff:</h1>
</div>
<div id="anydiff">
<form action="<?cs var:anydiff.changeset_href ?>" method="get">
<table>
<tr>
<th><label for="old_path">From:</label></th>
<td>
<input type="text" id="old_path" name="old_path" value="<?cs
var:anydiff.old_path ?>" size="44" />
<label for="old_rev">at Revision:</label>
<input type="text" id="old_rev" name="old" value="<?cs
var:anydiff.old_rev ?>" size="4" />
</td>
</tr>
<tr>
<th><label for="new_path">To:</label></th>
<td>
<input type="text" id="new_path" name="new_path" value="<?cs
var:anydiff.new_path ?>" size="44" />
<label for="new_rev">at Revision:</label>
<input type="text" id="new_rev" name="new" value="<?cs
var:anydiff.new_rev ?>" size="4" />
</td>
</tr>
</table>
<div class="buttons">
<input type="submit" value="View changes" />
</div>
</form>
</div>
<div id="help">
<strong>Note:</strong> See <a href="<?cs var:trac.href.wiki
?>/TracChangeset#ExaminingArbitraryDifferences">TracChangeset</a> for help on using the arbitrary diff feature.
</div>
</div>
<?cs include "footer.cs"?>
|
bsd-3-clause
|
C#
|
76b6080e5f0e9422af73bcbd5bda1ca4d061a1c7
|
Change "Weather" "Font Size" default value
|
danielchalmers/DesktopWidgets
|
DesktopWidgets/Widgets/Weather/Settings.cs
|
DesktopWidgets/Widgets/Weather/Settings.cs
|
using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.Weather
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Style.FontSettings.FontSize = 16;
}
[Category("Style")]
[DisplayName("Unit Type")]
public TemperatureUnitType UnitType { get; set; }
[Category("General")]
[DisplayName("Refresh Interval")]
public TimeSpan RefreshInterval { get; set; } = TimeSpan.FromHours(1);
[Category("General")]
[DisplayName("Zip Code")]
public int ZipCode { get; set; }
[Category("Style")]
[DisplayName("Show Icon")]
public bool ShowIcon { get; set; } = true;
[Category("Style")]
[DisplayName("Show Temperature")]
public bool ShowTemperature { get; set; } = true;
[Category("Style")]
[DisplayName("Show Temperature Range")]
public bool ShowTempMinMax { get; set; } = false;
[Category("Style")]
[DisplayName("Show Description")]
public bool ShowDescription { get; set; } = true;
}
}
|
using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.Weather
{
public class Settings : WidgetSettingsBase
{
[Category("Style")]
[DisplayName("Unit Type")]
public TemperatureUnitType UnitType { get; set; }
[Category("General")]
[DisplayName("Refresh Interval")]
public TimeSpan RefreshInterval { get; set; } = TimeSpan.FromHours(1);
[Category("General")]
[DisplayName("Zip Code")]
public int ZipCode { get; set; }
[Category("Style")]
[DisplayName("Show Icon")]
public bool ShowIcon { get; set; } = true;
[Category("Style")]
[DisplayName("Show Temperature")]
public bool ShowTemperature { get; set; } = true;
[Category("Style")]
[DisplayName("Show Temperature Range")]
public bool ShowTempMinMax { get; set; } = false;
[Category("Style")]
[DisplayName("Show Description")]
public bool ShowDescription { get; set; } = true;
}
}
|
apache-2.0
|
C#
|
0442d0f94fd1a0c5823fb90237112f194f6ca9ca
|
Fix build on macos
|
jinyuliao/GenericGraph,jinyuliao/GenericGraph,jinyuliao/GenericGraph
|
Source/GenericGraphEditor/GenericGraphEditor.Build.cs
|
Source/GenericGraphEditor/GenericGraphEditor.Build.cs
|
using UnrealBuildTool;
public class GenericGraphEditor : ModuleRules
{
public GenericGraphEditor(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
bLegacyPublicIncludePaths = false;
ShadowVariableWarningLevel = WarningLevel.Error;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
"GenericGraphEditor/Private",
"GenericGraphEditor/Public",
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"UnrealEd",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"GenericGraphRuntime",
"AssetTools",
"Slate",
"InputCore",
"SlateCore",
"GraphEditor",
"PropertyEditor",
"EditorStyle",
"Kismet",
"KismetWidgets",
"ApplicationCore",
"ToolMenus",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
|
using UnrealBuildTool;
public class GenericGraphEditor : ModuleRules
{
public GenericGraphEditor(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
bLegacyPublicIncludePaths = false;
ShadowVariableWarningLevel = WarningLevel.Error;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
"GenericGraphEditor/Private",
"GenericGraphEditor/Public",
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"UnrealEd",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"GenericGraphRuntime",
"AssetTools",
"Slate",
"SlateCore",
"GraphEditor",
"PropertyEditor",
"EditorStyle",
"Kismet",
"KismetWidgets",
"ApplicationCore",
"ToolMenus",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
|
mit
|
C#
|
ae12f8ff653f2fea0d2f15bd8789eb8cc05d9e4c
|
Bump version to 0.2
|
jamesfoster/DeepEqual
|
src/DeepEqual/Properties/AssemblyInfo.cs
|
src/DeepEqual/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("DeepEqual")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeepEqual")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2db8921a-dc9f-4b4a-b651-cd71eac66b39")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.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("DeepEqual")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeepEqual")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2db8921a-dc9f-4b4a-b651-cd71eac66b39")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
|
mit
|
C#
|
94964836c986b901289a05616225b93c835598cb
|
remove unused setter for {Source,Target}BranchChangesetId and TfsBranchPath
|
git-tfs/git-tfs,PKRoma/git-tfs
|
src/GitTfs/Core/TfsInterop/RootBranch.cs
|
src/GitTfs/Core/TfsInterop/RootBranch.cs
|
using System.Diagnostics;
namespace GitTfs.Core.TfsInterop
{
[DebuggerDisplay("{DebuggerDisplay}")]
public class RootBranch
{
public RootBranch(int sourceBranchChangesetId, string tfsBranchPath)
: this(sourceBranchChangesetId, -1, tfsBranchPath)
{
}
public RootBranch(int sourceBranchChangesetId, int targetBranchChangesetId, string tfsBranchPath)
{
SourceBranchChangesetId = sourceBranchChangesetId;
TargetBranchChangesetId = targetBranchChangesetId;
TfsBranchPath = tfsBranchPath;
}
public int SourceBranchChangesetId { get; }
public int TargetBranchChangesetId { get; }
public string TfsBranchPath { get; }
public bool IsRenamedBranch { get; set; }
private string DebuggerDisplay
{
get
{
return string.Format("{0} C{1}{2}{3}",
/* {0} */ TfsBranchPath,
/* {1} */ SourceBranchChangesetId,
/* {2} */ TargetBranchChangesetId > -1 ? string.Format(" (target C{0})", TargetBranchChangesetId) : string.Empty,
/* {3} */ IsRenamedBranch ? " renamed" : ""
);
}
}
}
}
|
using System.Diagnostics;
namespace GitTfs.Core.TfsInterop
{
[DebuggerDisplay("{DebuggerDisplay}")]
public class RootBranch
{
public RootBranch(int sourceBranchChangesetId, string tfsBranchPath)
: this(sourceBranchChangesetId, -1, tfsBranchPath)
{
}
public RootBranch(int sourceBranchChangesetId, int targetBranchChangesetId, string tfsBranchPath)
{
SourceBranchChangesetId = sourceBranchChangesetId;
TargetBranchChangesetId = targetBranchChangesetId;
TfsBranchPath = tfsBranchPath;
}
public int SourceBranchChangesetId { get; private set; }
public int TargetBranchChangesetId { get; private set; }
public string TfsBranchPath { get; private set; }
public bool IsRenamedBranch { get; set; }
private string DebuggerDisplay
{
get
{
return string.Format("{0} C{1}{2}{3}",
/* {0} */ TfsBranchPath,
/* {1} */ SourceBranchChangesetId,
/* {2} */ TargetBranchChangesetId > -1 ? string.Format(" (target C{0})", TargetBranchChangesetId) : string.Empty,
/* {3} */ IsRenamedBranch ? " renamed" : ""
);
}
}
}
}
|
apache-2.0
|
C#
|
f2540353a45c59e26e5b2e6d2481c2a274a9b419
|
Improve output.
|
jp7677/hellocoreclr,jp7677/hellocoreclr,jp7677/hellocoreclr,jp7677/hellocoreclr
|
src/HelloCoreClrApp/Health/CpuMonitor.cs
|
src/HelloCoreClrApp/Health/CpuMonitor.cs
|
using System;
using System.Diagnostics;
using Serilog;
namespace HelloCoreClrApp.Health
{
public class CpuMonitor: IMonitor
{
private static readonly ILogger Log = Serilog.Log.ForContext<SystemMonitor>();
public void LogUsage()
{
var runningTime = DateTime.Now - Process.GetCurrentProcess().StartTime;
var usage = (double)Process.GetCurrentProcess().TotalProcessorTime.Ticks / runningTime.Ticks
/ Environment.ProcessorCount;
usage = Math.Round(usage * 100, 2);
Log.Information("Processor usage since application start:{0}",
$"{Environment.NewLine}{usage}% for {Process.GetCurrentProcess().ProcessName}");
}
}
}
|
using System.Diagnostics;
using Serilog;
namespace HelloCoreClrApp.Health
{
public class CpuMonitor: IMonitor
{
private static readonly ILogger Log = Serilog.Log.ForContext<SystemMonitor>();
public void LogUsage()
{
Log.Information("Total processor time: {0} {1}",
Process.GetCurrentProcess().ProcessName,
Process.GetCurrentProcess().TotalProcessorTime);
}
}
}
|
mit
|
C#
|
2c196f7e556a4b14b58823cf383241d3b09e3675
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.63.*")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.62.*")]
|
mit
|
C#
|
0a9bea61ebae5c4ea8c99abe7230fc4d8a3bae81
|
Update UnityProject/Assets/Scripts/Items/Others/Restraint.cs
|
fomalsd/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,Necromunger/unitystation,fomalsd/unitystation,Necromunger/unitystation,Necromunger/unitystation,krille90/unitystation,fomalsd/unitystation,krille90/unitystation,fomalsd/unitystation,Necromunger/unitystation,Necromunger/unitystation,fomalsd/unitystation,krille90/unitystation
|
UnityProject/Assets/Scripts/Items/Others/Restraint.cs
|
UnityProject/Assets/Scripts/Items/Others/Restraint.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Restraint : Interactable<HandApply>
{
/// <summary>
/// How long it takes to apply the restraints
/// </summary>
public float applyTime;
/// <summary>
/// How long it takes for another person to remove the restraints
/// </summary>
public float removeTime;
// TODO: Add time it takes to resist out of handcuffs
/// <summary>
/// Sound to be played when applying restraints
/// </summary>
public string sound = "Handcuffs";
protected override bool WillInteract(HandApply interaction, NetworkSide side)
{
if (!base.WillInteract(interaction, side)) return false;
PlayerMove targetPM = interaction.TargetObject?.GetComponent<PlayerMove>();
// Interacts iff the target isn't cuffed
return interaction.UsedObject == gameObject
&& targetPM != null
&& targetPM.IsCuffed == false;
}
protected override void ServerPerformInteraction(HandApply interaction)
{
GameObject target = interaction.TargetObject;
GameObject performer = interaction.Performer;
SoundManager.PlayNetworkedAtPos(sound, target.transform.position);
var progressFinishAction = new FinishProgressAction(
reason =>
{
if (reason == FinishProgressAction.FinishReason.COMPLETED)
{
if(performer.GetComponent<PlayerScript>()?.IsInReach(target, true) ?? false) {
target.GetComponent<PlayerMove>().Cuff(gameObject);
// Hacky! Hand doesn't automatically update so we have to do it manually
performer.GetComponent<PlayerNetworkActions>()?.UpdatePlayerEquipSprites(InventoryManager.GetSlotFromItem(gameObject), null);
}
}
}
);
UIManager.ProgressBar.StartProgress(target.transform.position, applyTime, progressFinishAction, performer);
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Restraint : Interactable<HandApply>
{
/// <summary>
/// How long it takes to apply the restraints
/// </summary>
public float applyTime;
/// <summary>
/// How long it takes for another person to remove the restraints
/// </summary>
public float removeTime;
// TODO: Add time it takes to resist out of handcuffs
/// <summary>
/// Sound to be played when applying restraints
/// </summary>
public string sound = "Handcuffs";
protected override bool WillInteract(HandApply interaction, NetworkSide side)
{
PlayerMove targetPM = interaction.TargetObject?.GetComponent<PlayerMove>();
// Interacts iff the target isn't cuffed
return interaction.UsedObject == gameObject
&& targetPM != null
&& targetPM.IsCuffed == false;
}
protected override void ServerPerformInteraction(HandApply interaction)
{
GameObject target = interaction.TargetObject;
GameObject performer = interaction.Performer;
SoundManager.PlayNetworkedAtPos(sound, target.transform.position);
var progressFinishAction = new FinishProgressAction(
reason =>
{
if (reason == FinishProgressAction.FinishReason.COMPLETED)
{
if(performer.GetComponent<PlayerScript>()?.IsInReach(target, true) ?? false) {
target.GetComponent<PlayerMove>().Cuff(gameObject);
// Hacky! Hand doesn't automatically update so we have to do it manually
performer.GetComponent<PlayerNetworkActions>()?.UpdatePlayerEquipSprites(InventoryManager.GetSlotFromItem(gameObject), null);
}
}
}
);
UIManager.ProgressBar.StartProgress(target.transform.position, applyTime, progressFinishAction, performer);
}
}
|
agpl-3.0
|
C#
|
dc12a5c812f69bb754bd5afe14c64e7262d9fb06
|
Improve expression helper
|
joinrpg/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net
|
src/JoinRpg.Helpers/ExpressionHelpers.cs
|
src/JoinRpg.Helpers/ExpressionHelpers.cs
|
using System;
using System.Linq.Expressions;
using System.Reflection;
using JetBrains.Annotations;
namespace JoinRpg.Helpers
{
public static class ExpressionHelpers
{
[CanBeNull]
public static string? AsPropertyName<T1, T2>(this Expression<Func<T1, T2>> expression)
=> expression.AsPropertyAccess()?.Name;
public static string? AsPropertyName<T1>(this Expression<Func<T1>> expression)
=> expression.AsPropertyAccess()?.Name;
[CanBeNull]
public static PropertyInfo? AsPropertyAccess<T1, T2>(this Expression<Func<T1, T2>> expression)
=> AsPropetyAccessImpl(expression.Body);
[CanBeNull]
public static PropertyInfo? AsPropertyAccess<T>(this Expression<Func<T>> expression)
=> AsPropetyAccessImpl(expression.Body);
private static PropertyInfo? AsPropetyAccessImpl(Expression expression)
{
if (expression is UnaryExpression convertExpression &&
convertExpression.NodeType == ExpressionType.Convert)
{
return AsPropertyAccess(convertExpression.Operand);
}
return AsPropertyAccess(expression);
}
[CanBeNull]
private static PropertyInfo? AsPropertyAccess(Expression body)
{
return (body as MemberExpression)?.Member as PropertyInfo;
}
}
}
|
using System;
using System.Linq.Expressions;
using System.Reflection;
using JetBrains.Annotations;
namespace JoinRpg.Helpers
{
public static class ExpressionHelpers
{
[CanBeNull]
public static string? AsPropertyName<T1, T2>(this Expression<Func<T1, T2>> expression) => expression.AsPropertyAccess()?.Name;
[CanBeNull]
public static PropertyInfo? AsPropertyAccess<T1, T2>(
this Expression<Func<T1, T2>> expression)
{
if (expression.Body is UnaryExpression convertExpression &&
convertExpression.NodeType == ExpressionType.Convert)
{
return AsPropertyAccess(convertExpression.Operand);
}
return AsPropertyAccess(expression.Body);
}
[CanBeNull]
private static PropertyInfo? AsPropertyAccess(Expression body)
{
var memberExpression = body as MemberExpression;
return memberExpression?.Member as PropertyInfo;
}
public static string AsPropertyName<T1>(this Expression<Func<T1>> expression) => ((MemberExpression)expression.Body).Member.Name;
}
}
|
mit
|
C#
|
affd5724ed4cd60378754a21d78d6b9858591835
|
patch for MvvmVisualStatesBehaviorUWPApp1 project
|
Myfreedom614/UWP-Samples,Myfreedom614/UWP-Samples,Myfreedom614/UWP-Samples,Myfreedom614/UWP-Samples,Myfreedom614/UWP-Samples
|
MvvmVisualStatesBehaviorUWPApp1/MvvmVisualStatesBehaviorUWPApp1/ViewModel/MainViewModel.cs
|
MvvmVisualStatesBehaviorUWPApp1/MvvmVisualStatesBehaviorUWPApp1/ViewModel/MainViewModel.cs
|
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
namespace MvvmVisualStatesBehaviorUWPApp1.ViewModel
{
public class MainViewModel : ViewModelBase
{
public enum ViewModelState
{
Default,
Details
}
private ViewModelState currentState;
public ViewModelState CurrentState
{
get { return currentState; }
set
{
this.Set(ref currentState, value);
OnCurrentStateChanged(value);
}
}
public RelayCommand GotoDetailsStateCommand { get; set; }
public RelayCommand GotoDefaultStateCommand { get; set; }
public MainViewModel()
{
GotoDetailsStateCommand = new RelayCommand(() =>
{
CurrentState = ViewModelState.Details;
});
GotoDefaultStateCommand = new RelayCommand(() =>
{
CurrentState = ViewModelState.Default;
});
}
public void OnCurrentStateChanged(ViewModelState e)
{
Debug.WriteLine("CurrentStateChanged: " + e.ToString());
}
}
}
|
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
namespace MvvmVisualStatesBehaviorUWPApp1.ViewModel
{
public class MainViewModel : ViewModelBase
{
public enum ViewModelState
{
Default,
Details
}
private ViewModelState currentState;
public ViewModelState CurrentState
{
get { return currentState; }
set
{
this.Set(ref currentState, value);
}
}
public RelayCommand GotoDetailsStateCommand { get; set; }
public RelayCommand GotoDefaultStateCommand { get; set; }
public MainViewModel()
{
GotoDetailsStateCommand = new RelayCommand(() =>
{
CurrentState = ViewModelState.Details;
});
GotoDefaultStateCommand = new RelayCommand(() =>
{
CurrentState = ViewModelState.Default;
});
}
public void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
{
Debug.WriteLine("CurrentStateChanged!");
}
}
}
|
mit
|
C#
|
f6313258ba2f375370ae9cdacb9376936783420a
|
Fix nearest-station to be a double?
|
amweiss/dark-sky-core
|
src/DarkSkyCore/Models/Flags.cs
|
src/DarkSkyCore/Models/Flags.cs
|
namespace DarkSky.Models
{
using System.Collections.Generic;
using Newtonsoft.Json;
/// <summary>
/// The flags object contains various metadata information related to the request.
/// </summary>
public class Flags
{
/// <summary>
/// Undocumented, presumably a list of stations.
/// </summary>
[JsonProperty(PropertyName = "darksky-stations")]
public List<string> DarkskyStations { get; set; }
/// <summary>
/// The presence of this property indicates that the Dark Sky data source supports the given
/// location, but a temporary error (such as a radar station being down for maintenance) has
/// made the data unavailable.
/// </summary>
/// <remarks>optional</remarks>
[JsonProperty(PropertyName = "darksky-unavailable")]
public string DarkskyUnavailable { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "isd-stations")]
public List<string> IsdStations { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "lamp-stations")]
public List<string> LampStations { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "madis-stations")]
public List<string> MadisStations { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "metno-license")]
public string MetnoLicense { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "nearest-station")]
public double? NearestStation { get; set; }
/// <summary>
/// This property contains an array of IDs for each <a
/// href="https://darksky.net/dev/docs/sources">data source</a> utilized in servicing this request.
/// </summary>
[JsonProperty(PropertyName = "sources")]
public List<string> Sources { get; set; }
/// <summary>
/// Indicates the units which were used for the data in this request.
/// </summary>
[JsonProperty(PropertyName = "units")]
public string Units { get; set; }
}
}
|
namespace DarkSky.Models
{
using System.Collections.Generic;
using Newtonsoft.Json;
/// <summary>
/// The flags object contains various metadata information related to the request.
/// </summary>
public class Flags
{
/// <summary>
/// Undocumented, presumably a list of stations.
/// </summary>
[JsonProperty(PropertyName = "darksky-stations")]
public List<string> DarkskyStations { get; set; }
/// <summary>
/// The presence of this property indicates that the Dark Sky data source supports the given
/// location, but a temporary error (such as a radar station being down for maintenance) has
/// made the data unavailable.
/// </summary>
/// <remarks>optional</remarks>
[JsonProperty(PropertyName = "darksky-unavailable")]
public string DarkskyUnavailable { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "isd-stations")]
public List<string> IsdStations { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "lamp-stations")]
public List<string> LampStations { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "madis-stations")]
public List<string> MadisStations { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "metno-license")]
public string MetnoLicense { get; set; }
/// <summary>
/// Undocumented.
/// </summary>
[JsonProperty(PropertyName = "nearest-station")]
public string NearestStation { get; set; }
/// <summary>
/// This property contains an array of IDs for each <a
/// href="https://darksky.net/dev/docs/sources">data source</a> utilized in servicing this request.
/// </summary>
[JsonProperty(PropertyName = "sources")]
public List<string> Sources { get; set; }
/// <summary>
/// Indicates the units which were used for the data in this request.
/// </summary>
[JsonProperty(PropertyName = "units")]
public string Units { get; set; }
}
}
|
mit
|
C#
|
b723f5c74aad19a8086a2ad9f0ff2825eb6be3eb
|
Add ability to generate an area of chunks
|
jakebacker/YAMC
|
Assets/resources/Scripts/WorldBuilder.cs
|
Assets/resources/Scripts/WorldBuilder.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WorldBuilder : MonoBehaviour {
public const int CHUNK_SIZE = 8;
// Use this for initialization
void Start () {
//GenerateChunk(new Vector2(-4, -4), 0);
//GenerateChunk(new Vector2(4, 4), 0);
GenerateArea(2, 2, new Vector2(0, 0));
GenerateBlock(new Vector3(0,1,1), BlockType.GRASS_BLOCK);
}
// Update is called once per frame
void Update () {
}
/// <summary>
/// Generates a block.
/// </summary>
/// <param name="location">Block Location.</param>
/// <param name="blockType">Block type.</param>
public static void GenerateBlock(Vector3 location, string blockType) {
((GameObject)Instantiate(Resources.Load("Prefabs/" + blockType))).transform.position = location;
}
/// <summary>
/// Generates an CHUNK_SIZE by CHUNK_SIZE layer of blocks.
/// </summary>
/// <param name="startingPos">The most negative corner of the layer (in x and z)</param>
/// <param name="yHeight">The y height of the layer</param>
/// <param name="type">The type of block to make the layer with</param>
void GenerateLayer(Vector2 startingPos, int yHeight, string type) {
// For now, ignore that yHeight has to change the blocks
for (int x=(int)startingPos.x; x<(int)startingPos.x+CHUNK_SIZE; x++) {
for (int z = (int)startingPos.y; z < (int)startingPos.y + CHUNK_SIZE; z++) {
GenerateBlock(new Vector3(x, yHeight, z), type);
}
}
}
/// <summary>
/// Generates a chunk from maxHeight down to -20.
/// </summary>
/// <param name="startingPos">Starting position.</param>
/// <param name="maxHeight">Top height of the chunk</param>
void GenerateChunk(Vector2 startingPos, int maxHeight) {
// Generate from top down to prevent buggyness
GenerateLayer(startingPos, maxHeight, BlockType.GRASS_BLOCK);
for (int i = maxHeight-1; i > -20; i--) { // 20 blocks tall for now
GenerateLayer(startingPos, i, BlockType.DIRT_BLOCK);
}
}
/// <summary>
/// Generates an area of chunks. Use sparingly
/// </summary>
/// <param name="chunkWidth">Number of chunks wide</param>
/// <param name="chunkDepth">Number of chunks deep</param>
/// <param name="startingPos">Starting position</param>
void GenerateArea(int chunkWidth, int chunkDepth, Vector2 startingPos) {
int width = chunkWidth * CHUNK_SIZE;
int depth = chunkDepth * CHUNK_SIZE;
for (int i = 0; i < width; i+=8)
{
for (int ii = 0; ii < depth; ii+=8)
{
GenerateChunk(startingPos + new Vector2(i, ii), 0);
}
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WorldBuilder : MonoBehaviour {
// Use this for initialization
void Start () {
GenerateChunk(new Vector2(-4, -4), 0);
GenerateChunk(new Vector2(4, 4), 0);
GenerateBlock(new Vector3(0,1,1), BlockType.GRASS_BLOCK);
}
// Update is called once per frame
void Update () {
}
/// <summary>
/// Generates a block.
/// </summary>
/// <param name="location">Block Location.</param>
/// <param name="blockType">Block type.</param>
public static void GenerateBlock(Vector3 location, string blockType) {
((GameObject)Instantiate(Resources.Load("Prefabs/" + blockType))).transform.position = location;
}
/// <summary>
/// Generates an 8 by 8 layer of blocks.
/// </summary>
/// <param name="startingPos">The most negative corner of the layer (in x and z)</param>
/// <param name="yHeight">The y height of the layer</param>
/// <param name="type">The type of block to make the layer with</param>
void GenerateLayer(Vector2 startingPos, int yHeight, string type) {
// For now, ignore that yHeight has to change the blocks
for (int x=(int)startingPos.x; x<(int)startingPos.x+8; x++) {
for (int z = (int)startingPos.y; z < (int)startingPos.y + 8; z++) {
GenerateBlock(new Vector3(x, yHeight, z), type);
}
}
}
/// <summary>
/// Generates a chunk from maxHeight down to -20.
/// </summary>
/// <param name="startingPos">Starting position.</param>
/// <param name="maxHeight">Top height of the chunk</param>
void GenerateChunk(Vector2 startingPos, int maxHeight) {
// Generate from top down to prevent buggyness
GenerateLayer(startingPos, maxHeight, BlockType.GRASS_BLOCK);
for (int i = maxHeight-1; i > -20; i--) { // 20 blocks tall for now
GenerateLayer(startingPos, i, BlockType.DIRT_BLOCK);
}
}
}
|
apache-2.0
|
C#
|
698dd4abe7cce95412bff88539bb322c749287ae
|
Fix version checker warning formatting
|
iBicha/UnityNativePluginBuilder,iBicha/UnityNativePluginBuilder
|
Assets/NativePluginBuilder/Editor/NativeVersionChecker.cs
|
Assets/NativePluginBuilder/Editor/NativeVersionChecker.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Build;
using UnityEditor;
using System.Text;
using System;
namespace iBicha
{
public class NativeVersionChecker : IPreprocessBuild {
public void OnPreprocessBuild (UnityEditor.BuildTarget target, string path)
{
StringBuilder warningStringBuilder = new StringBuilder();
PluginImporter[] pluginImporters = PluginImporter.GetImporters (target);
foreach (PluginImporter pluginImporter in pluginImporters) {
NativePlugin plugin = GetPluginByName(pluginImporter.GetEditorData ("PLUGIN_NAME"));
if (plugin != null) {
string version = pluginImporter.GetEditorData ("PLUGIN_VERSION");
if (plugin.Version != version) {
warningStringBuilder.AppendFormat (@"Plugin version number mismatch: ""{0}"" is set to ""{1}"", while ""{2}"" was built with ""{3}""" + '\n',
plugin.Name, plugin.Version, target.ToString(), version);
}
string buildNumberStr = pluginImporter.GetEditorData ("PLUGIN_BUILD_NUMBER");
int buildNumber;
if(int.TryParse(buildNumberStr, out buildNumber)){
if (plugin.BuildNumber != buildNumber) {
warningStringBuilder.AppendFormat (@"Plugin build number mismatch: ""{0}"" is set to ""{1}"", while ""{2}"" was built with ""{3}""" + '\n',
plugin.Name, plugin.BuildNumber, target.ToString(), buildNumber);
}
}
string buildTypeStr = pluginImporter.GetEditorData ("BUILD_TYPE");
BuildType buildType = (BuildType) Enum.Parse(typeof(BuildType), buildTypeStr, true);
if ((EditorUserBuildSettings.development && buildType == BuildType.Release) ||
(!EditorUserBuildSettings.development && buildType == BuildType.Debug)) {
warningStringBuilder.AppendFormat (@"Plugin build type mismatch: current build is set to development=""{0}"", while plugin ""{1}"" for ""{2}"" is ""{3}""." + '\n',
EditorUserBuildSettings.development, plugin.Name, target, buildType);
}
}
}
string warnings = warningStringBuilder.ToString ();
if (!string.IsNullOrEmpty(warnings)) {
Debug.LogWarning (warnings);
}
}
public int callbackOrder {
get {
return 0;
}
}
private NativePlugin GetPluginByName(string name) {
if (string.IsNullOrEmpty (name)) {
return null;
}
for (int i = 0; i < NativePluginSettings.plugins.Count; i++) {
if (NativePluginSettings.plugins [i].Name == name) {
return NativePluginSettings.plugins [i];
}
}
return null;
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Build;
using UnityEditor;
using System.Text;
using System;
namespace iBicha
{
public class NativeVersionChecker : IPreprocessBuild {
public void OnPreprocessBuild (UnityEditor.BuildTarget target, string path)
{
StringBuilder warningStringBuilder = new StringBuilder();
PluginImporter[] pluginImporters = PluginImporter.GetImporters (target);
foreach (PluginImporter pluginImporter in pluginImporters) {
NativePlugin plugin = GetPluginByName(pluginImporter.GetEditorData ("PLUGIN_NAME"));
if (plugin != null) {
string version = pluginImporter.GetEditorData ("PLUGIN_VERSION");
if (plugin.Version != version) {
warningStringBuilder.AppendFormat (@"Plugin version number mismatch: ""{0}"" is set to ""{1}"", while ""{2}"" was built with ""{3}""",
plugin.Name, plugin.Version, target.ToString(), version);
}
string buildNumberStr = pluginImporter.GetEditorData ("PLUGIN_BUILD_NUMBER");
int buildNumber;
if(int.TryParse(buildNumberStr, out buildNumber)){
if (plugin.BuildNumber != buildNumber) {
warningStringBuilder.AppendFormat (@"Plugin build number mismatch: ""{0}"" is set to ""{1}"", while ""{2}"" was built with ""{3}""",
plugin.Name, plugin.BuildNumber, target.ToString(), buildNumber);
}
}
string buildTypeStr = pluginImporter.GetEditorData ("BUILD_TYPE");
BuildType buildType = (BuildType) Enum.Parse(typeof(BuildType), buildTypeStr, true);
if ((EditorUserBuildSettings.development && buildType == BuildType.Release) ||
(!EditorUserBuildSettings.development && buildType == BuildType.Debug)) {
warningStringBuilder.AppendFormat (@"Plugin build type mismatch: current build is set to development=""{0}"", while plugin ""{0}"" for ""{0}"" is ""{0}"".\n",
EditorUserBuildSettings.development, plugin.Name, target, buildType);
}
}
}
string warnings = warningStringBuilder.ToString ();
if (!string.IsNullOrEmpty(warnings)) {
Debug.LogWarning (warnings);
}
}
public int callbackOrder {
get {
return 0;
}
}
private NativePlugin GetPluginByName(string name) {
if (string.IsNullOrEmpty (name)) {
return null;
}
for (int i = 0; i < NativePluginSettings.plugins.Count; i++) {
if (NativePluginSettings.plugins [i].Name == name) {
return NativePluginSettings.plugins [i];
}
}
return null;
}
}
}
|
mit
|
C#
|
ae6e1bfd85ea3bbced6088b069e68a5cef0edf8e
|
Update UpdateCoinSwitchSettings.cshtml
|
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
|
BTCPayServer/Views/Stores/UpdateCoinSwitchSettings.cshtml
|
BTCPayServer/Views/Stores/UpdateCoinSwitchSettings.cshtml
|
@using Microsoft.AspNetCore.Mvc.Rendering
@model UpdateCoinSwitchSettingsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(StoreNavPages.Index, "Update Store CoinSwitch Settings");
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" for="StatusMessage"/>
<div class="row">
<div class="col-md-10">
<form method="post">
<p>
You can obtain a merchant id at
<a href="https://coinswitch.co/switch/setup/btcpay" target="_blank">
https://coinswitch.co
</a>
</p>
<div class="form-group">
<label asp-for="MerchantId"></label>
<input asp-for="MerchantId" class="form-control"/>
<span asp-validation-for="MerchantId" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Mode"></label>
<select asp-for="Mode" asp-items="Model.Modes" class="form-control" >
</select>
</div>
<div class="form-group">
<label asp-for="Enabled"></label>
<input asp-for="Enabled" type="checkbox" class="form-check"/>
</div>
<button name="command" type="submit" value="save" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
}
|
@using Microsoft.AspNetCore.Mvc.Rendering
@model UpdateCoinSwitchSettingsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(StoreNavPages.Index, "Update Store CoinSwitch Settings");
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" for="StatusMessage"/>
<div class="row">
<div class="col-md-10">
<form method="post">
<p>
You can obtain a merchant id at
<a href="https://coinwitch.co/switch/setup/btcpay" target="_blank">
https://coinswitch.co
</a>
</p>
<div class="form-group">
<label asp-for="MerchantId"></label>
<input asp-for="MerchantId" class="form-control"/>
<span asp-validation-for="MerchantId" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Mode"></label>
<select asp-for="Mode" asp-items="Model.Modes" class="form-control" >
</select>
</div>
<div class="form-group">
<label asp-for="Enabled"></label>
<input asp-for="Enabled" type="checkbox" class="form-check"/>
</div>
<button name="command" type="submit" value="save" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
}
|
mit
|
C#
|
cad92d3431f88285f70761af7489f93907f69857
|
Add ticker and period information to partial candle tokenizer
|
alexeykuzmin0/DTW
|
DTW/Finance/PartialCandleTokenizer.cs
|
DTW/Finance/PartialCandleTokenizer.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Finance
{
public class PartialCandleTokenizer : AbstractCandleTokenizer
{
private AbstractCandleTokenizer ct;
private int start;
private int length;
public PartialCandleTokenizer(AbstractCandleTokenizer ct, int start, int length)
{
this.ct = ct;
this.start = start;
this.length = length;
ticker = ct.GetTicker();
period = ct.GetPeriod();
}
public override Candle this[int index]
{
get
{
return ct[index + start];
}
}
public override int GetLength()
{
return length;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Finance
{
public class PartialCandleTokenizer : AbstractCandleTokenizer
{
private AbstractCandleTokenizer ct;
private int start;
private int length;
public PartialCandleTokenizer(AbstractCandleTokenizer ct, int start, int length)
{
this.ct = ct;
this.start = start;
this.length = length;
}
public override Candle this[int index]
{
get
{
return ct[index + start];
}
}
public override int GetLength()
{
return length;
}
}
}
|
apache-2.0
|
C#
|
f4a79c4c59e750b7ff4da1a22a6c797b660fb164
|
Update GoogleAnalyticsPlatform.cs
|
KSemenenko/GoogleAnalyticsForXamarinForms,KSemenenko/Google-Analytics-for-Xamarin-Forms
|
Plugin.GoogleAnalytics/Plugin.GoogleAnalytics.iOS/GoogleAnalyticsPlatform.cs
|
Plugin.GoogleAnalytics/Plugin.GoogleAnalytics.iOS/GoogleAnalyticsPlatform.cs
|
using System;
using System.Threading;
namespace Plugin.GoogleAnalytics
{
public partial class GoogleAnalytics
{
static GoogleAnalytics()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
if (!Current.Config.ReportUncaughtExceptions)
return;
Current.Tracker.SendException(e.ExceptionObject as Exception, true);
Thread.Sleep(1000); //delay
}
}
}
|
using System;
using System.Threading;
namespace Plugin.GoogleAnalytics
{
public partial class GoogleAnalytics
{
static GoogleAnalytics()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Current.Tracker.SendException(e.ExceptionObject as Exception, true);
Thread.Sleep(1000); //delay
}
}
}
|
mit
|
C#
|
06572a843b6b541d78251f8735a90f19feeb4340
|
fix for GA
|
autumn009/TanoCSharpSamples
|
chap36/NativeInts/NativeInts/Program.cs
|
chap36/NativeInts/NativeInts/Program.cs
|
using System;
class Program
{
static void Main()
{
// ↓数値で初期化できない
IntPtr oldType = new IntPtr(0);
// ↓数値で初期化できる
nint newType = 0;
// ↓できない
//oldType++;
// ↓できる
newType++;
// ↓できる
newType = oldType;
// ↓できる
oldType = newType;
// 値の型名を教えて
Console.WriteLine(oldType.GetType().Name);
Console.WriteLine(newType.GetType().Name);
}
}
|
using System;
class Program
{
static void Main()
{
// ↓数値で初期化できない
IntPtr oldType = new IntPtr(0);
// ↓数値で初期化できる
nint newType = 0;
// ↓できない
//oldType++;
// ↓できる
newType++;
// ↓できる
Console.WriteLine(IntPtr.MaxValue);
// ↓できない
//Console.WriteLine(nint.MaxValue);
// 値の型名を教えて
Console.WriteLine(oldType.GetType().Name);
Console.WriteLine(newType.GetType().Name);
}
}
|
mit
|
C#
|
77b4e1dd48a9d9e528973ee7bec23ccd5d13bc10
|
hide code flow until it is supported
|
rfavillejr/Thinktecture.IdentityServer.v2,kjnilsson/Thinktecture.IdentityServer.v2,rfavillejr/Thinktecture.IdentityServer.v2,IdentityServer/IdentityServer2,rfavillejr/Thinktecture.IdentityServer.v2,kjnilsson/Thinktecture.IdentityServer.v2,IdentityServer/IdentityServer2,kjnilsson/Thinktecture.IdentityServer.v2,IdentityServer/IdentityServer2
|
src/Libraries/Thinktecture.IdentityServer.Core/Models/Client.cs
|
src/Libraries/Thinktecture.IdentityServer.Core/Models/Client.cs
|
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license.txt
*/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Thinktecture.IdentityServer.Models
{
public class Client : IValidatableObject
{
[UIHint("HiddenInput")]
public int ID { get; set; }
[Display(Name = "Name", Description = "Display name.")]
public string Name { get; set; }
[Display(Name = "Description", Description = "Description.")]
public string Description { get; set; }
[Display(Name = "Client ID", Description = "Client ID.")]
[Required]
public string ClientId { get; set; }
[Display(Name = "Client Secret", Description = "Client secret.")]
[UIHint("SymmetricKey")]
[Required]
public string ClientSecret { get; set; }
[AbsoluteUri]
[Display(Name = "Redirect URI", Description = "Redirect URI.")]
public Uri RedirectUri { get; set; }
[Display(Name = "Native Client", Description = "Native Client.")]
[UIHint("HiddenInput")]
public bool NativeClient { get; set; }
[Display(Name = "Allow Implicit Flow", Description = "Allow implicit flow.")]
public bool AllowImplicitFlow { get; set; }
[Display(Name = "Allow Resource Owner Flow", Description = "Allow Resource Owner Flow.")]
public bool AllowResourceOwnerFlow { get; set; }
[Display(Name = "Allow Code Flow", Description = "Allow code flow.")]
[UIHint("HiddenInput")]
public bool AllowCodeFlow { get; set; }
public System.Collections.Generic.IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var errors = new List<ValidationResult>();
//if (String.IsNullOrWhiteSpace(this.ClientSecret) &&
// (this.AllowCodeFlow || this.AllowResourceOwnerFlow))
//{
// errors.Add(new ValidationResult("Client Secret is required for Code and Resource Owner Flows.", new string[] { "ClientSecret" }));
//}
if (this.RedirectUri == null &&
(this.AllowCodeFlow || this.AllowImplicitFlow))
{
errors.Add(new ValidationResult("Redirect URI is required for Code and Implicit Flows.", new string[] { "RedirectUri" }));
}
return errors;
}
}
}
|
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license.txt
*/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Thinktecture.IdentityServer.Models
{
public class Client : IValidatableObject
{
[UIHint("HiddenInput")]
public int ID { get; set; }
[Display(Name = "Name", Description = "Display name.")]
public string Name { get; set; }
[Display(Name = "Description", Description = "Description.")]
public string Description { get; set; }
[Display(Name = "Client ID", Description = "Client ID.")]
[Required]
public string ClientId { get; set; }
[Display(Name = "Client Secret", Description = "Client secret.")]
[UIHint("SymmetricKey")]
[Required]
public string ClientSecret { get; set; }
[AbsoluteUri]
[Display(Name = "Redirect URI", Description = "Redirect URI.")]
public Uri RedirectUri { get; set; }
[Display(Name = "Native Client", Description = "Native Client.")]
[UIHint("HiddenInput")]
public bool NativeClient { get; set; }
[Display(Name = "Allow Implicit Flow", Description = "Allow implicit flow.")]
public bool AllowImplicitFlow { get; set; }
[Display(Name = "Allow Resource Owner Flow", Description = "Allow Resource Owner Flow.")]
public bool AllowResourceOwnerFlow { get; set; }
[Display(Name = "Allow Code Flow", Description = "Allow code flow.")]
public bool AllowCodeFlow { get; set; }
public System.Collections.Generic.IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var errors = new List<ValidationResult>();
//if (String.IsNullOrWhiteSpace(this.ClientSecret) &&
// (this.AllowCodeFlow || this.AllowResourceOwnerFlow))
//{
// errors.Add(new ValidationResult("Client Secret is required for Code and Resource Owner Flows.", new string[] { "ClientSecret" }));
//}
if (this.RedirectUri == null &&
(this.AllowCodeFlow || this.AllowImplicitFlow))
{
errors.Add(new ValidationResult("Redirect URI is required for Code and Implicit Flows.", new string[] { "RedirectUri" }));
}
return errors;
}
}
}
|
bsd-3-clause
|
C#
|
9e0204279818869b43c7cb4695b726c2960be662
|
Fix cookie middleware name for interop package
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
src/Microsoft.AspNet.Identity.AspNetCoreCompat/CookieInterop.cs
|
src/Microsoft.AspNet.Identity.AspNetCoreCompat/CookieInterop.cs
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Interop;
namespace Owin
{
public static class CookieInterop
{
public static ISecureDataFormat<AuthenticationTicket> CreateSharedDataFormat(DirectoryInfo keyDirectory, string authenticationType)
{
var dataProtector = DataProtectionProvider.Create(keyDirectory)
.CreateProtector("Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware", // full name of the ASP.NET 5 type
authenticationType, "v2");
return new AspNetTicketDataFormat(new DataProtectorShim(dataProtector));
}
}
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Interop;
namespace Owin
{
public static class CookieInterop
{
public static ISecureDataFormat<AuthenticationTicket> CreateSharedDataFormat(DirectoryInfo keyDirectory, string authenticationType)
{
var dataProtector = DataProtectionProvider.Create(keyDirectory)
.CreateProtector("Microsoft.AspNet.Authentication.Cookies.CookieAuthenticationMiddleware", // full name of the ASP.NET 5 type
authenticationType, "v2");
return new AspNetTicketDataFormat(new DataProtectorShim(dataProtector));
}
}
}
|
apache-2.0
|
C#
|
733ba3c6f2bed5184b1d127003de41d74676f740
|
Update DatabaseLoader.cs
|
erdenbatuhan/Venture
|
Assets/Scripts/DatabaseLoader.cs
|
Assets/Scripts/DatabaseLoader.cs
|
//
// DatabaseLoader.cs
// Venture
//
// Created by Batuhan Erden.
// Copyright © 2016 Batuhan Erden. All rights reserved.
//
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class DatabaseLoader : MonoBehaviour {
private const string URL_LOAD_USERS = "http://138.68.143.170/VailaBall_DATA/Computer_DATA/l7237h2347g2387d3b2f7g32b3e7geb2u2g3infn2unz.php";
public static bool databaseLoaded = false;
private void OnGUI() {
if (!databaseLoaded)
GUI.TextArea(new Rect(30, Screen.height - 45, Screen.width - 60, 25), GameMaster.CONSOLE_INITIAL + "Connecting to database....");
}
private void Update() {
// Print users if '@' is pressed.
if (Input.GetKeyDown(KeyCode.RightShift))
foreach (User user in GameMaster.users)
print(user);
// Force database to load if 'F' is pressed.
if (Input.GetKeyDown(KeyCode.F))
StartCoroutine(loadDatabase()); // Load the database again.
}
private void Start() {
StartCoroutine(loadDatabase());
}
public static IEnumerator loadDatabase() {
databaseLoaded = false;
WWW www = new WWW(URL_LOAD_USERS);
yield return www; // Wait for the data to be downloaded.
string text = www.text;
extractDataFromDatabase(text.Split(';'));
databaseLoaded = true;
}
private static void extractDataFromDatabase(string[] data) {
GameMaster.users = new List<User>();
for (int i = 0; i < data.Length && !data[i].Equals(""); i++) {
string[] temp = data[i].Split('|');
GameMaster.users.Add(new User(int.Parse(temp[0]), temp[1], temp[2], int.Parse(temp[3]), int.Parse(temp[4])));
}
GameMaster.users = GameMaster.users.OrderByDescending(user => user.getLevelsCompleted()).ToList();
}
}
|
//
// DatabaseLoader.cs
// A Vaila Ball - Computer
//
// Created by Batuhan Erden.
// Copyright © 2016 Batuhan Erden. All rights reserved.
//
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class DatabaseLoader : MonoBehaviour {
private const string URL_LOAD_USERS = "http://138.68.143.170/VailaBall_DATA/Computer_DATA/l7237h2347g2387d3b2f7g32b3e7geb2u2g3infn2unz.php";
public static bool databaseLoaded = false;
private void OnGUI() {
if (!databaseLoaded)
GUI.TextArea(new Rect(30, Screen.height - 45, Screen.width - 60, 25), GameMaster.CONSOLE_INITIAL + "Connecting to database....");
}
private void Update() {
// Print users if '@' is pressed.
if (Input.GetKeyDown(KeyCode.RightShift))
foreach (User user in GameMaster.users)
print(user);
// Force database to load if 'F' is pressed.
if (Input.GetKeyDown(KeyCode.F))
StartCoroutine(loadDatabase()); // Load the database again.
}
private void Start() {
StartCoroutine(loadDatabase());
}
public static IEnumerator loadDatabase() {
databaseLoaded = false;
WWW www = new WWW(URL_LOAD_USERS);
yield return www; // Wait for the data to be downloaded.
string text = www.text;
extractDataFromDatabase(text.Split(';'));
databaseLoaded = true;
}
private static void extractDataFromDatabase(string[] data) {
GameMaster.users = new List<User>();
for (int i = 0; i < data.Length && !data[i].Equals(""); i++) {
string[] temp = data[i].Split('|');
GameMaster.users.Add(new User(int.Parse(temp[0]), temp[1], temp[2], int.Parse(temp[3]), int.Parse(temp[4])));
}
GameMaster.users = GameMaster.users.OrderByDescending(user => user.getLevelsCompleted()).ToList();
}
}
|
mit
|
C#
|
8afb8b26f210f6bd652ec251cdbab3b8aacc1530
|
Fix assembly name in Client.net40
|
InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET
|
IntegrationEngine.Client.net40/Properties/AssemblyInfo.cs
|
IntegrationEngine.Client.net40/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("IntegrationEngine.Client")]
// 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("446e2264-b09d-4fb2-91d6-cae870d1b4d6")]
|
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("IntegrationEngine.Client.net40")]
// 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("446e2264-b09d-4fb2-91d6-cae870d1b4d6")]
|
mit
|
C#
|
d366bbb5ce8547e5d7a42ff8eac345a9d5c82782
|
Test case renaming within the DependencyTests to better match with their semantic
|
Martin-Bohring/fixieSpec
|
tests/FixieSpec.Tests/DependencyTests.cs
|
tests/FixieSpec.Tests/DependencyTests.cs
|
// <copyright>
// Copyright (c) Martin Bohring. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
namespace FixieSpec.Tests
{
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using Shouldly;
public sealed class DependencyTests
{
[Input("FakeItEasy")]
[Input("Ploeh.AutoFixture")]
[Input("Ploeh.AutoFixture.AutoFakeItEasy")]
[Input("Shouldly")]
public void ShouldNotReference(string assemblyName)
{
var references = typeof(FixieSpecConvention).Assembly.GetReferencedAssemblies();
references.ShouldNotContain(reference => reference.Name == assemblyName);
}
public void ShouldAtLeastRequireNet45()
{
var quirksAreEnabled = Uri.EscapeDataString("'") == "'";
quirksAreEnabled.ShouldBeFalse();
var targetFramework =
Assembly.GetExecutingAssembly()
.GetCustomAttributes(typeof(TargetFrameworkAttribute), true)
.Cast<TargetFrameworkAttribute>()
.Single()
.FrameworkName;
quirksAreEnabled.ShouldBe(!targetFramework.Contains("4.5"));
}
}
}
|
// <copyright>
// Copyright (c) Martin Bohring. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
namespace FixieSpec.Tests
{
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using Shouldly;
public sealed class DependencyTests
{
[Input("FakeItEasy")]
[Input("Ploeh.AutoFixture")]
[Input("Ploeh.AutoFixture.AutoFakeItEasy")]
[Input("Shouldly")]
public void FixieSpecShouldNotReference(string assemblyName)
{
var references = typeof(FixieSpecConvention).Assembly.GetReferencedAssemblies();
references.ShouldNotContain(reference => reference.Name == assemblyName);
}
public void ShouldtLeastRequireNet45()
{
var quirksAreEnabled = Uri.EscapeDataString("'") == "'";
quirksAreEnabled.ShouldBeFalse();
var targetFramework =
Assembly.GetExecutingAssembly()
.GetCustomAttributes(typeof(TargetFrameworkAttribute), true)
.Cast<TargetFrameworkAttribute>()
.Single()
.FrameworkName;
quirksAreEnabled.ShouldBe(!targetFramework.Contains("4.5"));
}
}
}
|
mit
|
C#
|
a67caa791d1fb9b39056d7f5b0c9a88e18371eec
|
Fix wrong uper case for relations to follow iana.org
|
bluehands/WebApiHypermediaExtensions,bluehands/WebApiHypermediaExtensions
|
Source/Hypermedia.Relations/DefaultHypermediaRelations.cs
|
Source/Hypermedia.Relations/DefaultHypermediaRelations.cs
|
namespace Hypermedia.Relations
{
/// <summary>
/// Collection of basic relations commonly used.
/// For a comprehensive list <see href="https://www.iana.org/assignments/link-relations/link-relations.xhtml"/>
/// </summary>
public static class DefaultHypermediaRelations
{
/// <summary>
/// Relation indicating that this relates to the HypermediaObject itselve.
/// </summary>
public const string Self = "self";
/// <summary>
/// Relations commonly used for query results.
/// </summary>
public class Queries
{
public const string First = "first";
public const string Previous = "previous";
public const string Next = "next";
public const string Last = "last";
public const string All = "all";
}
/// <summary>
/// Relations commonly used for embedded entities.
/// </summary>
public class EmbeddedEntities
{
/// <summary>
/// Indicates that the embedded Entity is a collection or list item.
/// </summary>
public const string Item = "item";
public const string Parent = "parent";
public const string Child = "child";
}
}
}
|
namespace Hypermedia.Relations
{
/// <summary>
/// Collection of basic relations commonly used.
/// For a comprehensive list <see href="https://www.iana.org/assignments/link-relations/link-relations.xhtml"/>
/// </summary>
public static class DefaultHypermediaRelations
{
/// <summary>
/// Relation indicating that this relates to the HypermediaObject itselve.
/// </summary>
public const string Self = "Self";
/// <summary>
/// Relations commonly used for query results.
/// </summary>
public class Queries
{
public const string First = "First";
public const string Previous = "Previous";
public const string Next = "Next";
public const string Last = "Last";
public const string All = "All";
}
/// <summary>
/// Relations commonly used for embedded entities.
/// </summary>
public class EmbeddedEntities
{
/// <summary>
/// Indicates that the embedded Entity is a collection or list item.
/// </summary>
public const string Item = "Item";
public const string Parent = "Parent";
public const string Child = "Child";
}
}
}
|
mit
|
C#
|
1876a10b2695afa356d60c31714f3ffc4f9adfa6
|
Abort example if env variables are not set
|
JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET,JohnnyCrazy/SpotifyAPI-NET
|
SpotifyAPI.Web.Examples/Example.CLI.CustomHTML/Program.cs
|
SpotifyAPI.Web.Examples/Example.CLI.CustomHTML/Program.cs
|
using System.Reflection;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SpotifyAPI.Web;
using SpotifyAPI.Web.Auth;
using static SpotifyAPI.Web.Scopes;
namespace Example.CLI.CustomHTML
{
public class Program
{
private static readonly string clientId = Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_ID");
private static readonly string clientSecret = Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_SECRET");
private static EmbedIOAuthServer _server;
public static async Task Main()
{
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
throw new NullReferenceException(
"Please set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET via environment variables before starting the program"
);
}
_server = new EmbedIOAuthServer(
new Uri("http://localhost:5000/callback"),
5000,
Assembly.GetExecutingAssembly(),
"Example.CLI.CustomHTML.Resources.custom_site"
);
await _server.Start();
_server.AuthorizationCodeReceived += OnAuthorizationCodeReceived;
var request = new LoginRequest(_server.BaseUri, clientId, LoginRequest.ResponseType.Code)
{
Scope = new List<string> { UserReadEmail }
};
Uri uri = request.ToUri();
try
{
BrowserUtil.Open(uri);
}
catch (Exception)
{
Console.WriteLine("Unable to open URL, manually open: {0}", uri);
}
Console.ReadKey();
}
private static async Task OnAuthorizationCodeReceived(object sender, AuthorizationCodeResponse response)
{
await _server.Stop();
AuthorizationCodeTokenResponse token = await new OAuthClient().RequestToken(
new AuthorizationCodeTokenRequest(clientId, clientSecret, response.Code, _server.BaseUri)
);
var config = SpotifyClientConfig.CreateDefault().WithToken(token.AccessToken, token.TokenType);
var spotify = new SpotifyClient(config);
var me = await spotify.UserProfile.Current();
Console.WriteLine($"Your E-Mail: {me.Email}");
Environment.Exit(0);
}
}
}
|
using System.Reflection;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SpotifyAPI.Web;
using SpotifyAPI.Web.Auth;
using static SpotifyAPI.Web.Scopes;
namespace Example.CLI.CustomHTML
{
public class Program
{
private static readonly string clientId = Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_ID");
private static readonly string clientSecret = Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_SECRET");
private static EmbedIOAuthServer _server;
public static async Task Main()
{
_server = new EmbedIOAuthServer(
new Uri("http://localhost:5000/callback"),
5000,
Assembly.GetExecutingAssembly(),
"Example.CLI.CustomHTML.Resources.custom_site"
);
await _server.Start();
_server.AuthorizationCodeReceived += OnAuthorizationCodeReceived;
var request = new LoginRequest(_server.BaseUri, clientId, LoginRequest.ResponseType.Code)
{
Scope = new List<string> { UserReadEmail }
};
Uri uri = request.ToUri();
try
{
BrowserUtil.Open(uri);
}
catch (Exception)
{
Console.WriteLine("Unable to open URL, manually open: {0}", uri);
}
Console.ReadKey();
}
private static async Task OnAuthorizationCodeReceived(object sender, AuthorizationCodeResponse response)
{
await _server.Stop();
AuthorizationCodeTokenResponse token = await new OAuthClient().RequestToken(
new AuthorizationCodeTokenRequest(clientId, clientSecret, response.Code, _server.BaseUri)
);
var config = SpotifyClientConfig.CreateDefault().WithToken(token.AccessToken, token.TokenType);
var spotify = new SpotifyClient(config);
var me = await spotify.UserProfile.Current();
Console.WriteLine($"Your E-Mail: {me.Email}");
Environment.Exit(0);
}
}
}
|
mit
|
C#
|
88a416829c70c6d4eff2e0cbe5748863c7b9c74f
|
Fix warning.
|
JohanLarsson/Gu.Persist,JohanLarsson/Gu.Settings
|
Gu.Persist.Core/Internals/Kernel32.cs
|
Gu.Persist.Core/Internals/Kernel32.cs
|
namespace Gu.Persist.Core
{
using System.Runtime.InteropServices;
/// <summary>
/// Calls to Kernel32.dll.
/// </summary>
internal static class Kernel32
{
/// <summary>
/// Moves an existing file or directory, including its children, with various move options.
/// </summary>
/// <param name="lpExistingFileName">The current name of the file or directory on the local computer.</param>
/// <param name="lpNewFileName">The new name of the file or directory on the local computer.</param>
/// <param name="dwFlags">The <see cref="MoveFileFlags"/>.</param>
/// <returns>True if the function succeeds.</returns>
[return: MarshalAs(UnmanagedType.Bool)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, MoveFileFlags dwFlags);
}
}
|
namespace Gu.Persist.Core
{
using System.Runtime.InteropServices;
/// <summary>
/// Calls to Kernel32.dll.
/// </summary>
internal static class Kernel32
{
/// <summary>
/// Moves an existing file or directory, including its children, with various move options.
/// </summary>
/// <param name="lpExistingFileName">The current name of the file or directory on the local computer.</param>
/// <param name="lpNewFileName">The new name of the file or directory on the local computer.</param>
/// <param name="dwFlags">The <see cref="MoveFileFlags"/>.</param>
/// <returns>True if the function succeeds.</returns>
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, MoveFileFlags dwFlags);
}
}
|
mit
|
C#
|
e180d315852bf5f682e2a99ec74618969598f036
|
Use intValue instead of enumValueIndex
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MRTK/SDK/Editor/Inspectors/Audio/TextToSpeechInspector.cs
|
Assets/MRTK/SDK/Editor/Inspectors/Audio/TextToSpeechInspector.cs
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Audio.Editor
{
[CustomEditor(typeof(TextToSpeech))]
public class TextToSpeechInspector : UnityEditor.Editor
{
private SerializedProperty voiceProperty;
private void OnEnable()
{
voiceProperty = serializedObject.FindProperty("voice");
}
public override void OnInspectorGUI()
{
if (voiceProperty.intValue == (int)TextToSpeechVoice.Other)
{
DrawDefaultInspector();
EditorGUILayout.HelpBox("Use the links below to find more available voices (for non en-US languages):", MessageType.Info);
using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button("Voices for HoloLens 2", EditorStyles.miniButton))
{
Application.OpenURL("https://docs.microsoft.com/hololens/hololens2-language-support");
}
if (GUILayout.Button("Voices for desktop Windows", EditorStyles.miniButton))
{
Application.OpenURL("https://support.microsoft.com/windows/appendix-a-supported-languages-and-voices-4486e345-7730-53da-fcfe-55cc64300f01#WindowsVersion=Windows_11");
}
}
}
else
{
DrawPropertiesExcluding(serializedObject, "customVoice");
}
serializedObject.ApplyModifiedProperties();
}
}
}
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Audio.Editor
{
[CustomEditor(typeof(TextToSpeech))]
public class TextToSpeechInspector : UnityEditor.Editor
{
private SerializedProperty voiceProperty;
private void OnEnable()
{
voiceProperty = serializedObject.FindProperty("voice");
}
public override void OnInspectorGUI()
{
if (voiceProperty.enumValueIndex == (int)TextToSpeechVoice.Other)
{
DrawDefaultInspector();
EditorGUILayout.HelpBox("Use the links below to find more available voices (for non en-US languages):", MessageType.Info);
using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button("Voices for HoloLens 2", EditorStyles.miniButton))
{
Application.OpenURL("https://docs.microsoft.com/hololens/hololens2-language-support");
}
if (GUILayout.Button("Voices for desktop Windows", EditorStyles.miniButton))
{
Application.OpenURL("https://support.microsoft.com/windows/appendix-a-supported-languages-and-voices-4486e345-7730-53da-fcfe-55cc64300f01#WindowsVersion=Windows_11");
}
}
}
else
{
DrawPropertiesExcluding(serializedObject, "customVoice");
}
serializedObject.ApplyModifiedProperties();
}
}
}
|
mit
|
C#
|
8e61745b193dcd943bee78a2af523d347558251e
|
Revert from Scrollable back to Panel.
|
mcneel/RhinoCycles
|
Settings/CollapsibleSectionUIPanel.cs
|
Settings/CollapsibleSectionUIPanel.cs
|
using System;
using Eto.Forms;
using Rhino.UI.Controls;
namespace RhinoCycles.Settings
{
public class CollapsibleSectionUIPanel : Panel
{
/// <summary>
/// Returns the ID of this panel.
/// </summary>
public static Guid PanelId
{
get
{
return typeof(CollapsibleSectionUIPanel).GUID;
}
}
/// <summary>
/// Public constructor
/// </summary>
public CollapsibleSectionUIPanel()
{
InitializeComponents();
InitializeLayout();
}
private EtoCollapsibleSectionHolder m_holder;
private void InitializeComponents()
{
m_holder = new EtoCollapsibleSectionHolder();
}
private void InitializeLayout()
{
// Create holder for sections. The holder can expand/collaps sections and
// displays a title for each section
// Create two sections
AddUserdataSection section0 = new AddUserdataSection();
section0.ViewDataChanged += Section0_ViewDataChanged;
IntegratorSection section1 = new IntegratorSection();
SessionSection section2 = new SessionSection();
DeviceSection section3 = new DeviceSection();
// Populate the holder with sections
m_holder.Add(section0);
m_holder.Add(section1);
m_holder.Add(section2);
m_holder.Add(section3);
// Create a tablelayout that contains the holder and add it to the UI
// Content
TableLayout tableLayout = new TableLayout()
{
Rows =
{
m_holder
}
};
Content = tableLayout;
}
public event EventHandler ViewDataChanged;
private void Section0_ViewDataChanged(object sender, EventArgs e)
{
ViewDataChanged?.Invoke(sender, e);
}
public void NoUserdataAvailable()
{
(m_holder.SectionAt(0) as Section)?.Show(null);
(m_holder.SectionAt(1) as Section)?.Hide();
(m_holder.SectionAt(2) as Section)?.Hide();
(m_holder.SectionAt(3) as Section)?.Hide();
m_holder.Invalidate(true);
Invalidate(true);
}
public void UserdataAvailable(ViewportSettings vud)
{
(m_holder.SectionAt(0) as Section)?.Hide();
(m_holder.SectionAt(1) as Section)?.Show(vud);
(m_holder.SectionAt(2) as Section)?.Show(vud);
(m_holder.SectionAt(3) as Section)?.Show(vud);
m_holder.Invalidate(true);
Invalidate(true);
}
}
}
|
using System;
using Eto.Forms;
using Rhino.UI.Controls;
namespace RhinoCycles.Settings
{
public class CollapsibleSectionUIPanel : Scrollable
{
/// <summary>
/// Returns the ID of this panel.
/// </summary>
public static Guid PanelId
{
get
{
return typeof(CollapsibleSectionUIPanel).GUID;
}
}
/// <summary>
/// Public constructor
/// </summary>
public CollapsibleSectionUIPanel()
{
InitializeComponents();
InitializeLayout();
}
private EtoCollapsibleSectionHolder m_holder;
private void InitializeComponents()
{
m_holder = new EtoCollapsibleSectionHolder();
}
private void InitializeLayout()
{
// Create holder for sections. The holder can expand/collaps sections and
// displays a title for each section
// Create two sections
AddUserdataSection section0 = new AddUserdataSection();
section0.ViewDataChanged += Section0_ViewDataChanged;
IntegratorSection section1 = new IntegratorSection();
SessionSection section2 = new SessionSection();
DeviceSection section3 = new DeviceSection();
// Populate the holder with sections
m_holder.Add(section0);
m_holder.Add(section1);
m_holder.Add(section2);
m_holder.Add(section3);
// Create a tablelayout that contains the holder and add it to the UI
// Content
TableLayout tableLayout = new TableLayout()
{
Rows =
{
m_holder
}
};
Content = tableLayout;
}
public event EventHandler ViewDataChanged;
private void Section0_ViewDataChanged(object sender, EventArgs e)
{
ViewDataChanged?.Invoke(sender, e);
}
public void NoUserdataAvailable()
{
(m_holder.SectionAt(0) as Section)?.Show(null);
(m_holder.SectionAt(1) as Section)?.Hide();
(m_holder.SectionAt(2) as Section)?.Hide();
(m_holder.SectionAt(3) as Section)?.Hide();
}
public void UserdataAvailable(ViewportSettings vud)
{
(m_holder.SectionAt(0) as Section)?.Hide();
(m_holder.SectionAt(1) as Section)?.Show(vud);
(m_holder.SectionAt(2) as Section)?.Show(vud);
(m_holder.SectionAt(3) as Section)?.Show(vud);
}
}
}
|
apache-2.0
|
C#
|
9c8cde53f39750948ec1d74806f8400821f0f75c
|
Send callback sets wrong user state object
|
rajeshganesh/amqpnetlite,ChugR/amqpnetlite,CedarLogic/amqpnetlite,Azure/amqpnetlite,mbroadst/amqpnetlite,timhermann/amqpnetlite
|
src/Delivery.cs
|
src/Delivery.cs
|
// ------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this
// file except in compliance with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR
// CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------------------
namespace Amqp
{
using Amqp.Framing;
class Delivery : INode
{
Message message;
public ByteBuffer Buffer;
public uint Handle;
public byte[] Tag;
public SequenceNumber DeliveryId;
public int BytesTransfered;
public DeliveryState State;
public OutcomeCallback OnOutcome;
public object UserToken;
public bool Settled;
public Link Link;
public INode Previous { get; set; }
public INode Next { get; set; }
public Message Message
{
get { return this.message; }
set { this.message = value; value.Delivery = this; }
}
public static void ReleaseAll(Delivery delivery, Error error)
{
Outcome outcome;
if (error == null)
{
outcome = new Released();
}
else
{
outcome = new Rejected() { Error = error };
}
while (delivery != null)
{
if (delivery.OnOutcome != null)
{
delivery.OnOutcome(delivery.Message, outcome, delivery.UserToken);
}
delivery = (Delivery)delivery.Next;
}
}
public void OnStateChange(DeliveryState state)
{
this.State = state;
this.Link.OnDeliveryStateChanged(this);
}
}
}
|
// ------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this
// file except in compliance with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR
// CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------------------
namespace Amqp
{
using Amqp.Framing;
class Delivery : INode
{
Message message;
public ByteBuffer Buffer;
public uint Handle;
public byte[] Tag;
public SequenceNumber DeliveryId;
public int BytesTransfered;
public DeliveryState State;
public OutcomeCallback OnOutcome;
public object UserToken;
public bool Settled;
public Link Link;
public INode Previous { get; set; }
public INode Next { get; set; }
public Message Message
{
get { return this.message; }
set { this.message = value; value.Delivery = this; }
}
public static void ReleaseAll(Delivery delivery, Error error)
{
Outcome outcome;
if (error == null)
{
outcome = new Released();
}
else
{
outcome = new Rejected() { Error = error };
}
while (delivery != null)
{
if (delivery.OnOutcome != null)
{
delivery.OnOutcome(delivery.Message, outcome, delivery.State);
}
delivery = (Delivery)delivery.Next;
}
}
public void OnStateChange(DeliveryState state)
{
this.State = state;
this.Link.OnDeliveryStateChanged(this);
}
}
}
|
apache-2.0
|
C#
|
6896e3e42a4b39753d571db649b1657ea366a215
|
Update IPPacket.cs
|
cocowalla/Snifter,cocowalla/Snifter
|
src/IPPacket.cs
|
src/IPPacket.cs
|
using System;
using System.Net;
namespace Snifter
{
// ReSharper disable once InconsistentNaming
public class IPPacket
{
public int Version { get; }
public int HeaderLength { get; }
public int Protocol { get; }
public IPAddress SourceAddress { get; }
public IPAddress DestAddress { get; }
public ushort SourcePort { get; }
public ushort DestPort { get; }
public IPPacket(byte[] data)
{
var versionAndLength = data[0];
this.Version = versionAndLength >> 4;
// Only parse IPv4 packets for now
if (this.Version != 4)
return;
this.HeaderLength = (versionAndLength & 0x0F) << 2;
this.Protocol = Convert.ToInt32(data[9]);
this.SourceAddress = new IPAddress(BitConverter.ToUInt32(data, 12));
this.DestAddress = new IPAddress(BitConverter.ToUInt32(data, 16));
if (Enum.IsDefined(typeof(ProtocolsWithPort), this.Protocol))
{
// Ensure big-endian
this.SourcePort = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(data, this.HeaderLength));
this.DestPort = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(data, this.HeaderLength + 2));
}
}
}
/// <summary>
/// Protocols that have a port abstraction
/// </summary>
internal enum ProtocolsWithPort
{
TCP = 6,
UDP = 17,
SCTP = 132
}
}
|
using System;
using System.Net;
namespace Snifter
{
// ReSharper disable once InconsistentNaming
public class IPPacket
{
public int Version { get; }
public int HeaderLength { get; }
public int Protocol { get; }
public IPAddress SourceAddress { get; }
public IPAddress DestAddress { get; }
public ushort SourcePort { get; }
public ushort DestPort { get; }
public IPPacket(byte[] data)
{
var versionAndLength = data[0];
this.Version = versionAndLength >> 4;
// Only parse IPv4 packets for now
if (this.Version != 4)
return;
this.HeaderLength = (versionAndLength & 0x0F) << 2;
this.Protocol = Convert.ToInt32(data[9]);
this.SourceAddress = new IPAddress(BitConverter.ToUInt32(data, 12));
this.DestAddress = new IPAddress(BitConverter.ToUInt32(data, 16));
if (Enum.IsDefined(typeof(ProtocolsWithPort), this.Protocol))
{
// Ensure big-endian
this.SourcePort = (ushort)((data[this.HeaderLength] << 8) | data[this.HeaderLength + 1]);
this.DestPort = (ushort)((data[this.HeaderLength + 2] << 8) | data[this.HeaderLength + 3]);
}
}
}
/// <summary>
/// Protocols that have a port abstraction
/// </summary>
internal enum ProtocolsWithPort
{
TCP = 6,
UDP = 17,
SCTP = 132
}
}
|
apache-2.0
|
C#
|
0da4e738f9a995383c1143dda6a94fe8b666ea4b
|
Change attribute names RetencionFactura
|
datil/link-dotnet
|
DatilClientLibrary/RetencionFactura.cs
|
DatilClientLibrary/RetencionFactura.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatilClientLibrary
{
/// <summary>
/// Retención en la factura.
///
/// Caso específico de Retenciones en la Comercializadores / Distribuidores
/// de derivados del Petróleo y Retención presuntiva de IVA a los Editores,
/// Distribuidores y Voceadores que participan en la comercialización de
/// periódicos y/o revistas.
/// </summary>
public class RetencionFactura
{
/// <summary>Código del tipo de impuesto para la retención en la factura.</summary>
public string Codigo { get; set; }
/// <summary>Código del porcentaje del impuesto.</summary>
public string CodigoPorcentaje { get; set; }
/// <summary>Porcentaje actual del impuesto. Máximo 3 enteros y 2 decimales.</summary>
public double Porcentaje { get; set; }
/// <summary>Valor del impuesto. Máximo 12 enteros y 2 decimales.</summary>
public double Valor { get; set; }
/// <summary>Construir Retención en la factura</summary>
public RetencionFactura(string Codigo,
string CodigoPorcentaje,
double Porcentaje,
double Valor)
{
this.Codigo = Codigo;
this.CodigoPorcentaje = CodigoPorcentaje;
this.Porcentaje = Porcentaje;
this.Valor = Valor;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatilClientLibrary
{
/// <summary>
/// Retención en la factura.
///
/// Caso específico de Retenciones en la Comercializadores / Distribuidores
/// de derivados del Petróleo y Retención presuntiva de IVA a los Editores,
/// Distribuidores y Voceadores que participan en la comercialización de
/// periódicos y/o revistas.
/// </summary>
public class RetencionFactura
{
/// <summary>Código del tipo de impuesto para la retención en la factura.</summary>
public string TipoImpuesto { get; set; }
/// <summary>Código del porcentaje del impuesto.</summary>
public string CodigoPorcentaje { get; set; }
/// <summary>Porcentaje actual del impuesto. Máximo 3 enteros y 2 decimales.</summary>
public double Tarifa { get; set; }
/// <summary>Valor del impuesto. Máximo 12 enteros y 2 decimales.</summary>
public double Valor { get; set; }
/// <summary>Construir Retención en la factura</summary>
public RetencionFactura(string TipoImpuesto,
string CodigoPorcentaje,
double Tarifa,
double Valor)
{
this.TipoImpuesto = TipoImpuesto;
this.CodigoPorcentaje = CodigoPorcentaje;
this.Tarifa = Tarifa;
this.Valor = Valor;
}
}
}
|
mit
|
C#
|
fd55e04b91b0d0a76d47e11091b9ad24bcedd3f2
|
Add new property.
|
LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform
|
src/CompetitionPlatform/Data/AzureRepositories/Project/IProjectRepository.cs
|
src/CompetitionPlatform/Data/AzureRepositories/Project/IProjectRepository.cs
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CompetitionPlatform.Models;
namespace CompetitionPlatform.Data.AzureRepositories.Project
{
public interface IProjectData
{
string Id { get; }
string Name { get; set; }
string Overview { get; set; }
string Description { get; set; }
Status Status { get; set; }
string ProjectStatus { get; set; }
string Category { get; set; }
string Tags { get; set; }
DateTime CompetitionRegistrationDeadline { get; set; }
DateTime ImplementationDeadline { get; set; }
DateTime VotingDeadline { get; set; }
double BudgetFirstPlace { get; set; }
double? BudgetSecondPlace { get; set; }
int VotesFor { get; set; }
int VotesAgainst { get; set; }
DateTime Created { get; set; }
DateTime LastModified { get; set; }
string AuthorId { get; set; }
string AuthorFullName { get; set; }
int ParticipantsCount { get; set; }
string ProgrammingResourceName { get; set; }
string ProgrammingResourceLink { get; set; }
string UserAgent { get; set; }
bool SkipVoting { get; set; }
}
public interface IProjectRepository
{
Task<IProjectData> GetAsync(string id);
Task<IEnumerable<IProjectData>> GetProjectsAsync();
Task<string> SaveAsync(IProjectData projectData);
Task UpdateAsync(IProjectData projectData);
}
}
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CompetitionPlatform.Models;
namespace CompetitionPlatform.Data.AzureRepositories.Project
{
public interface IProjectData
{
string Id { get; }
string Name { get; set; }
string Overview { get; set; }
string Description { get; set; }
Status Status { get; set; }
string ProjectStatus { get; set; }
string Category { get; set; }
string Tags { get; set; }
DateTime CompetitionRegistrationDeadline { get; set; }
DateTime ImplementationDeadline { get; set; }
DateTime VotingDeadline { get; set; }
double BudgetFirstPlace { get; set; }
double? BudgetSecondPlace { get; set; }
int VotesFor { get; set; }
int VotesAgainst { get; set; }
DateTime Created { get; set; }
DateTime LastModified { get; set; }
string AuthorId { get; set; }
string AuthorFullName { get; set; }
int ParticipantsCount { get; set; }
string ProgrammingResourceName { get; set; }
string ProgrammingResourceLink { get; set; }
string UserAgent { get; set; }
}
public interface IProjectRepository
{
Task<IProjectData> GetAsync(string id);
Task<IEnumerable<IProjectData>> GetProjectsAsync();
Task<string> SaveAsync(IProjectData projectData);
Task UpdateAsync(IProjectData projectData);
}
}
|
mit
|
C#
|
db190b506a4711df288321daff5020fb281fdc69
|
Fix summary.
|
PenguinF/sandra-three
|
Eutherion/Shared/Text/Json/JsonSymbol.cs
|
Eutherion/Shared/Text/Json/JsonSymbol.cs
|
#region License
/*********************************************************************************
* JsonSymbol.cs
*
* Copyright (c) 2004-2020 Henk Nicolai
*
* 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
using System.Collections.Generic;
using System.Linq;
namespace Eutherion.Text.Json
{
public abstract class JsonSymbol : ISpan
{
public virtual bool IsBackground => false;
public virtual bool IsValueStartSymbol => false;
/// <summary>
/// Gets if there are any errors associated with this symbol.
/// </summary>
public virtual bool HasErrors => false;
/// <summary>
/// If <see cref="HasErrors"/> is true, generates a non-empty sequence of errors associated
/// with this symbol at a given start position.
/// </summary>
/// <param name="startPosition">
/// The start position for which to generate the errors.
/// </param>
/// <returns>
/// A sequence of errors associated with this symbol.
/// </returns>
public virtual IEnumerable<JsonErrorInfo> GetErrors(int startPosition) => Enumerable.Empty<JsonErrorInfo>();
public abstract int Length { get; }
public abstract void Accept(JsonSymbolVisitor visitor);
public abstract TResult Accept<TResult>(JsonSymbolVisitor<TResult> visitor);
public abstract TResult Accept<T, TResult>(JsonSymbolVisitor<T, TResult> visitor, T arg);
}
}
|
#region License
/*********************************************************************************
* JsonSymbol.cs
*
* Copyright (c) 2004-2020 Henk Nicolai
*
* 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
using System.Collections.Generic;
using System.Linq;
namespace Eutherion.Text.Json
{
public abstract class JsonSymbol : ISpan
{
public virtual bool IsBackground => false;
public virtual bool IsValueStartSymbol => false;
/// <summary>
/// Gets if there are any errors associated with this symbol.
/// </summary>
public virtual bool HasErrors => false;
/// <summary>
/// If <see cref="HasErrors"/> is true, generates a non-empty sequence of errors associated
/// with this symbol at a given start position.
/// </summary>
/// <param name="startPosition">
/// The start position for which to generate the error.
/// </param>
/// <returns>
/// A sequence of errors associated with this symbol.
/// </returns>
public virtual IEnumerable<JsonErrorInfo> GetErrors(int startPosition) => Enumerable.Empty<JsonErrorInfo>();
public abstract int Length { get; }
public abstract void Accept(JsonSymbolVisitor visitor);
public abstract TResult Accept<TResult>(JsonSymbolVisitor<TResult> visitor);
public abstract TResult Accept<T, TResult>(JsonSymbolVisitor<T, TResult> visitor, T arg);
}
}
|
apache-2.0
|
C#
|
ef22ab9340d152cb9713b4aded8957321f6b5412
|
remove bindable
|
smoogipoo/osu,NeoAdonis/osu,ZLima12/osu,UselessToucan/osu,smoogipooo/osu,EVAST9919/osu,ZLima12/osu,UselessToucan/osu,johnneijzen/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,NeoAdonis/osu,2yangk23/osu,johnneijzen/osu,peppy/osu,smoogipoo/osu,ppy/osu,peppy/osu-new,EVAST9919/osu,2yangk23/osu
|
osu.Game/Screens/Play/ReplayPlayerLoader.cs
|
osu.Game/Screens/Play/ReplayPlayerLoader.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
namespace osu.Game.Screens.Play
{
public class ReplayPlayerLoader : PlayerLoader
{
private readonly IReadOnlyList<Mod> mods;
public ReplayPlayerLoader(Score score)
: base(() => new ReplayPlayer(score))
{
mods = score.ScoreInfo.Mods;
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
// Overwrite the global mods here for use in the mod hud.
Mods.Value = mods;
return dependencies;
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
namespace osu.Game.Screens.Play
{
public class ReplayPlayerLoader : PlayerLoader
{
private readonly Bindable<IReadOnlyList<Mod>> mods;
public ReplayPlayerLoader(Score score)
: base(() => new ReplayPlayer(score))
{
mods = new Bindable<IReadOnlyList<Mod>>(score.ScoreInfo.Mods);
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
dependencies.Cache(mods);
// Overwrite the global mods here for use in the mod hud.
Mods.Value = mods.Value;
return dependencies;
}
}
}
|
mit
|
C#
|
a6379695a6e0eeade7d30d50a2aec16c10329929
|
fix ViewLogConfigurationEntity
|
AlejandroCano/extensions,signumsoftware/extensions,signumsoftware/framework,AlejandroCano/extensions,signumsoftware/extensions,signumsoftware/framework,MehdyKarimpour/extensions,MehdyKarimpour/extensions
|
Signum.Entities.Extensions/ViewLog/ViewLogConfigurationEntity.cs
|
Signum.Entities.Extensions/ViewLog/ViewLogConfigurationEntity.cs
|
using Signum.Entities.Basics;
using Signum.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Signum.Entities.ViewLog
{
[Serializable]
public class ViewLogConfigurationEntity : EmbeddedEntity
{
bool active;
public bool Active
{
get { return active; }
set { Set(ref active, value); }
}
bool queryUrlLog;
public bool QueryUrlLog
{
get { return queryUrlLog; }
set { queryUrlLog = value; }
}
bool queryTextLog;
public bool QueryTextLog
{
get { return queryTextLog; }
set { queryTextLog = value; }
}
[NotNullable, PreserveOrder]
MList<TypeEntity> typeList = new MList<TypeEntity>();
[NotNullValidator, NoRepeatValidator]
public MList<TypeEntity> TypeList
{
get { return typeList; }
set {
if (Set(ref typeList, value))
types = null;
}
}
[Ignore]
HashSet<Type> types = null;
public HashSet<Type> Types
{
get {
if (types == null)
types = TypeList.Select(t => t.ToType()).ToHashSet();
return types;
}
}
}
}
|
using Signum.Entities.Basics;
using Signum.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Signum.Entities.ViewLog
{
[Serializable]
public class ViewLogConfigurationEntity : EmbeddedEntity
{
bool active;
public bool Active
{
get { return active; }
set { Set(ref active, value); }
}
bool queryUrlLog;
public bool QueryUrlLog
{
get { return queryUrlLog; }
set { queryUrlLog = value; }
}
bool queryTextLog;
public bool QueryTextLog
{
get { return queryTextLog; }
set { queryTextLog = value; }
}
[NotNullable, PreserveOrder]
MList<TypeEntity> typeList = new MList<TypeEntity>();
[NotNullValidator, NoRepeatValidator]
public MList<TypeEntity> TypeList
{
get { return typeList; }
set { Set(ref typeList, value); }
}
[Ignore]
HashSet<Type> types = null;
public HashSet<Type> Types
{
get {
if (types == null)
types = TypeList.Select(t => t.ToType()).ToHashSet();
return types;
}
}
}
}
|
mit
|
C#
|
f87d993f15a7db00a5637cd1ca4cd9c9b0e2d1ad
|
Update AssemblyInfo.cs
|
asimarslan/hazelcast-csharp-client,asimarslan/hazelcast-csharp-client
|
Hazelcast.Net/Properties/AssemblyInfo.cs
|
Hazelcast.Net/Properties/AssemblyInfo.cs
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Reflection.AssemblyTitle("Hazelcast .Net Client")]
[assembly: System.Reflection.AssemblyDescription("Hazelcast .Net Client ")]
[assembly: System.Reflection.AssemblyCompany("Hazelcast Inc.")]
[assembly: System.Reflection.AssemblyProduct("Hazelcast Enterprise Edition")]
[assembly: System.Reflection.AssemblyCopyright("Copyright (c) 2008-2014, Hazelcast, Inc")]
[assembly: System.Reflection.AssemblyConfiguration("Commit cfcea21")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.CLSCompliant(true)]
[assembly: System.Reflection.AssemblyVersion("3.4.1.0")]
[assembly: System.Reflection.AssemblyFileVersion("3.4.1.0")]
[assembly: System.Reflection.AssemblyInformationalVersion("3.4.1.0")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Hazelcast.Test")]
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Reflection.AssemblyTitle("Hazelcast .Net Client")]
[assembly: System.Reflection.AssemblyDescription("Hazelcast .Net Client ")]
[assembly: System.Reflection.AssemblyCompany("Hazelcast Inc.")]
[assembly: System.Reflection.AssemblyProduct("Hazelcast Enterprise Edition")]
[assembly: System.Reflection.AssemblyCopyright("Copyright (c) 2008-2014, Hazelcast, Inc")]
[assembly: System.Reflection.AssemblyConfiguration("Commit cfcea21")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.CLSCompliant(true)]
[assembly: System.Reflection.AssemblyVersion("3.4.0.3")]
[assembly: System.Reflection.AssemblyFileVersion("3.4.0.3")]
[assembly: System.Reflection.AssemblyInformationalVersion("3.4.0.3")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Hazelcast.Test")]
|
apache-2.0
|
C#
|
e45dc33661ec4190a73baea992768799475c8c88
|
add RefreshBrower()
|
NDark/ndinfrastructure,NDark/ndinfrastructure
|
Unity/UnityTools/OnClickOpenBrower.cs
|
Unity/UnityTools/OnClickOpenBrower.cs
|
/**
MIT License
Copyright (c) 2017 NDark
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.
*/
/**
@file OnClickOpenBrower.cs
@author NDark
@date 20170501 . file started.
*/
using UnityEngine;
public class OnClickOpenBrower : MonoBehaviour
{
public string m_Url = string.Empty ;
public void OpenBrower()
{
// Debug.Log( Application.platform ) ;
if( Application.platform == RuntimePlatform.WebGLPlayer )
{
string url = "window.open('" + m_Url + "','aNewWindow')" ;
// Debug.Log( url ) ;
Application.ExternalEval( url );
}
else /*if( Application.platform == RuntimePlatform.WindowsPlayer ||
Application.platform == RuntimePlatform.WindowsEditor )*/
{
Application.OpenURL( m_Url ) ;
}
}
public void RefreshBrower()
{
// Debug.Log( Application.platform ) ;
if( Application.platform == RuntimePlatform.WebGLPlayer )
{
string url = "window.open('" + m_Url + "')" ;
// Debug.Log( url ) ;
Application.ExternalEval( url );
}
else /*if( Application.platform == RuntimePlatform.WindowsPlayer ||
Application.platform == RuntimePlatform.WindowsEditor )*/
{
Application.OpenURL( m_Url ) ;
}
}
void OnClick()
{
OpenBrower() ;
}
}
|
/**
MIT License
Copyright (c) 2017 NDark
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.
*/
/**
@file OnClickOpenBrower.cs
@author NDark
@date 20170501 . file started.
*/
using UnityEngine;
public class OnClickOpenBrower : MonoBehaviour
{
public string m_Url = string.Empty ;
public void OpenBrower()
{
// Debug.Log( Application.platform ) ;
if( Application.platform == RuntimePlatform.WebGLPlayer )
{
string url = "window.open('" + m_Url + "','aNewWindow')" ;
// Debug.Log( url ) ;
Application.ExternalEval( url );
}
else /*if( Application.platform == RuntimePlatform.WindowsPlayer ||
Application.platform == RuntimePlatform.WindowsEditor )*/
{
Application.OpenURL( m_Url ) ;
}
}
void OnClick()
{
OpenBrower() ;
}
}
|
mit
|
C#
|
cbe60bd7c7a8f2372a463bbec1843bc5d3e2d33d
|
Disable hanging OSX NetworkInformation test
|
cartermp/corefx,khdang/corefx,weltkante/corefx,richlander/corefx,dotnet-bot/corefx,axelheer/corefx,krk/corefx,the-dwyer/corefx,fgreinacher/corefx,twsouthwick/corefx,dotnet-bot/corefx,ellismg/corefx,parjong/corefx,jhendrixMSFT/corefx,manu-silicon/corefx,jhendrixMSFT/corefx,iamjasonp/corefx,ravimeda/corefx,nchikanov/corefx,MaggieTsang/corefx,JosephTremoulet/corefx,parjong/corefx,dhoehna/corefx,krk/corefx,zhenlan/corefx,lggomez/corefx,wtgodbe/corefx,ViktorHofer/corefx,BrennanConroy/corefx,stone-li/corefx,lggomez/corefx,yizhang82/corefx,rahku/corefx,ravimeda/corefx,dotnet-bot/corefx,ericstj/corefx,Jiayili1/corefx,jhendrixMSFT/corefx,elijah6/corefx,nbarbettini/corefx,Chrisboh/corefx,adamralph/corefx,wtgodbe/corefx,manu-silicon/corefx,Priya91/corefx-1,MaggieTsang/corefx,yizhang82/corefx,zhenlan/corefx,Ermiar/corefx,mmitche/corefx,cartermp/corefx,Priya91/corefx-1,rubo/corefx,krytarowski/corefx,nbarbettini/corefx,lggomez/corefx,krk/corefx,elijah6/corefx,cydhaselton/corefx,MaggieTsang/corefx,nbarbettini/corefx,cydhaselton/corefx,rahku/corefx,dsplaisted/corefx,stephenmichaelf/corefx,krytarowski/corefx,nbarbettini/corefx,seanshpark/corefx,shimingsg/corefx,mmitche/corefx,Jiayili1/corefx,alphonsekurian/corefx,YoupHulsebos/corefx,rjxby/corefx,manu-silicon/corefx,stephenmichaelf/corefx,rahku/corefx,seanshpark/corefx,YoupHulsebos/corefx,jhendrixMSFT/corefx,rjxby/corefx,shimingsg/corefx,shmao/corefx,richlander/corefx,mazong1123/corefx,DnlHarvey/corefx,krk/corefx,Jiayili1/corefx,Chrisboh/corefx,stone-li/corefx,twsouthwick/corefx,jlin177/corefx,MaggieTsang/corefx,nbarbettini/corefx,krytarowski/corefx,khdang/corefx,tijoytom/corefx,nchikanov/corefx,rahku/corefx,ViktorHofer/corefx,manu-silicon/corefx,lggomez/corefx,ViktorHofer/corefx,iamjasonp/corefx,dhoehna/corefx,rahku/corefx,ericstj/corefx,krk/corefx,billwert/corefx,ravimeda/corefx,nbarbettini/corefx,stone-li/corefx,marksmeltzer/corefx,richlander/corefx,gkhanna79/corefx,stone-li/corefx,Petermarcu/corefx,ptoonen/corefx,BrennanConroy/corefx,the-dwyer/corefx,parjong/corefx,iamjasonp/corefx,parjong/corefx,parjong/corefx,cydhaselton/corefx,alexperovich/corefx,parjong/corefx,twsouthwick/corefx,twsouthwick/corefx,shmao/corefx,iamjasonp/corefx,Chrisboh/corefx,Jiayili1/corefx,billwert/corefx,rjxby/corefx,elijah6/corefx,dotnet-bot/corefx,axelheer/corefx,JosephTremoulet/corefx,manu-silicon/corefx,Ermiar/corefx,fgreinacher/corefx,ViktorHofer/corefx,tstringer/corefx,ellismg/corefx,the-dwyer/corefx,mazong1123/corefx,MaggieTsang/corefx,gkhanna79/corefx,manu-silicon/corefx,billwert/corefx,weltkante/corefx,Jiayili1/corefx,alexperovich/corefx,khdang/corefx,YoupHulsebos/corefx,Priya91/corefx-1,ellismg/corefx,Petermarcu/corefx,ViktorHofer/corefx,marksmeltzer/corefx,manu-silicon/corefx,fgreinacher/corefx,shimingsg/corefx,JosephTremoulet/corefx,shimingsg/corefx,Jiayili1/corefx,axelheer/corefx,alexperovich/corefx,rubo/corefx,adamralph/corefx,axelheer/corefx,marksmeltzer/corefx,nchikanov/corefx,iamjasonp/corefx,wtgodbe/corefx,elijah6/corefx,YoupHulsebos/corefx,gkhanna79/corefx,cartermp/corefx,tijoytom/corefx,shmao/corefx,tstringer/corefx,tijoytom/corefx,elijah6/corefx,yizhang82/corefx,twsouthwick/corefx,twsouthwick/corefx,marksmeltzer/corefx,ericstj/corefx,Ermiar/corefx,zhenlan/corefx,mmitche/corefx,wtgodbe/corefx,dotnet-bot/corefx,zhenlan/corefx,ptoonen/corefx,Ermiar/corefx,alexperovich/corefx,DnlHarvey/corefx,DnlHarvey/corefx,weltkante/corefx,cartermp/corefx,lggomez/corefx,gkhanna79/corefx,rubo/corefx,mmitche/corefx,billwert/corefx,yizhang82/corefx,alphonsekurian/corefx,rubo/corefx,krytarowski/corefx,stephenmichaelf/corefx,weltkante/corefx,shimingsg/corefx,marksmeltzer/corefx,tijoytom/corefx,Chrisboh/corefx,tstringer/corefx,alphonsekurian/corefx,alexperovich/corefx,ViktorHofer/corefx,krytarowski/corefx,khdang/corefx,billwert/corefx,dhoehna/corefx,fgreinacher/corefx,axelheer/corefx,Priya91/corefx-1,stephenmichaelf/corefx,tijoytom/corefx,ericstj/corefx,richlander/corefx,Petermarcu/corefx,cydhaselton/corefx,shmao/corefx,richlander/corefx,dotnet-bot/corefx,stone-li/corefx,DnlHarvey/corefx,the-dwyer/corefx,alphonsekurian/corefx,ravimeda/corefx,krk/corefx,dsplaisted/corefx,wtgodbe/corefx,ericstj/corefx,khdang/corefx,parjong/corefx,YoupHulsebos/corefx,YoupHulsebos/corefx,jlin177/corefx,the-dwyer/corefx,mazong1123/corefx,ellismg/corefx,elijah6/corefx,jhendrixMSFT/corefx,jlin177/corefx,shimingsg/corefx,shmao/corefx,tijoytom/corefx,rjxby/corefx,wtgodbe/corefx,JosephTremoulet/corefx,yizhang82/corefx,ptoonen/corefx,jlin177/corefx,MaggieTsang/corefx,shimingsg/corefx,wtgodbe/corefx,JosephTremoulet/corefx,Petermarcu/corefx,ravimeda/corefx,MaggieTsang/corefx,Priya91/corefx-1,zhenlan/corefx,jhendrixMSFT/corefx,yizhang82/corefx,ericstj/corefx,dhoehna/corefx,stephenmichaelf/corefx,Petermarcu/corefx,billwert/corefx,weltkante/corefx,stone-li/corefx,Ermiar/corefx,lggomez/corefx,Chrisboh/corefx,zhenlan/corefx,weltkante/corefx,axelheer/corefx,seanshpark/corefx,marksmeltzer/corefx,seanshpark/corefx,shmao/corefx,cartermp/corefx,zhenlan/corefx,rjxby/corefx,ptoonen/corefx,the-dwyer/corefx,nchikanov/corefx,dsplaisted/corefx,dhoehna/corefx,tstringer/corefx,dhoehna/corefx,cydhaselton/corefx,DnlHarvey/corefx,rubo/corefx,DnlHarvey/corefx,mazong1123/corefx,weltkante/corefx,ellismg/corefx,rahku/corefx,alexperovich/corefx,Priya91/corefx-1,Petermarcu/corefx,seanshpark/corefx,ptoonen/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,richlander/corefx,gkhanna79/corefx,mazong1123/corefx,Jiayili1/corefx,nchikanov/corefx,marksmeltzer/corefx,jlin177/corefx,cydhaselton/corefx,mmitche/corefx,elijah6/corefx,rahku/corefx,stone-li/corefx,ptoonen/corefx,ericstj/corefx,adamralph/corefx,tstringer/corefx,gkhanna79/corefx,alexperovich/corefx,krk/corefx,ravimeda/corefx,alphonsekurian/corefx,shmao/corefx,gkhanna79/corefx,cydhaselton/corefx,lggomez/corefx,mmitche/corefx,stephenmichaelf/corefx,JosephTremoulet/corefx,jlin177/corefx,mazong1123/corefx,dhoehna/corefx,billwert/corefx,stephenmichaelf/corefx,jhendrixMSFT/corefx,tstringer/corefx,mazong1123/corefx,alphonsekurian/corefx,ellismg/corefx,rjxby/corefx,richlander/corefx,nchikanov/corefx,khdang/corefx,rjxby/corefx,seanshpark/corefx,YoupHulsebos/corefx,tijoytom/corefx,alphonsekurian/corefx,krytarowski/corefx,yizhang82/corefx,BrennanConroy/corefx,cartermp/corefx,the-dwyer/corefx,iamjasonp/corefx,Petermarcu/corefx,nbarbettini/corefx,DnlHarvey/corefx,ravimeda/corefx,seanshpark/corefx,Chrisboh/corefx,ptoonen/corefx,ViktorHofer/corefx,nchikanov/corefx,iamjasonp/corefx,twsouthwick/corefx,Ermiar/corefx,mmitche/corefx,jlin177/corefx,krytarowski/corefx,Ermiar/corefx
|
src/System.Net.NetworkInformation/tests/FunctionalTests/NetworkChangeTest.cs
|
src/System.Net.NetworkInformation/tests/FunctionalTests/NetworkChangeTest.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 Xunit;
namespace System.Net.NetworkInformation.Tests
{
public class NetworkChangeTest
{
[Fact]
[ActiveIssue(8066, PlatformID.OSX)]
public void NetworkAddressChanged_AddRemove_Success()
{
NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
NetworkChange.NetworkAddressChanged += handler;
NetworkChange.NetworkAddressChanged -= handler;
}
[Fact]
public void NetworkAddressChanged_JustRemove_Success()
{
NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
NetworkChange.NetworkAddressChanged -= handler;
}
private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
}
|
// 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 Xunit;
namespace System.Net.NetworkInformation.Tests
{
public class NetworkChangeTest
{
[Fact]
public void NetworkAddressChanged_AddRemove_Success()
{
NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
NetworkChange.NetworkAddressChanged += handler;
NetworkChange.NetworkAddressChanged -= handler;
}
[Fact]
public void NetworkAddressChanged_JustRemove_Success()
{
NetworkAddressChangedEventHandler handler = NetworkChange_NetworkAddressChanged;
NetworkChange.NetworkAddressChanged -= handler;
}
private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
}
|
mit
|
C#
|
bcd6e184eac1cdac6e2460a984ee055f2fc4938a
|
Switch 'FunctionTable.this[uint]' back to old-style accessors
|
jonathanvdc/cs-wasm,jonathanvdc/cs-wasm
|
libwasm-interpret/FunctionTable.cs
|
libwasm-interpret/FunctionTable.cs
|
using System.Collections.Generic;
using System.Linq;
namespace Wasm.Interpret
{
/// <summary>
/// Defines a table of function values.
/// </summary>
public sealed class FunctionTable
{
/// <summary>
/// Creates a function table from the given resizable limits.
/// The table's initial contents are trap values.
/// </summary>
/// <param name="Limits">The table's limits.</param>
public FunctionTable(ResizableLimits Limits)
{
this.Limits = Limits;
this.contents = new List<FunctionDefinition>((int)Limits.Initial);
var funcDef = new ThrowFunctionDefinition(new WasmException("Indirect call target not initialized yet."));
for (int i = 0; i < Limits.Initial; i++)
{
contents.Add(funcDef);
}
}
/// <summary>
/// Gets this function table's limits.
/// </summary>
/// <returns>The function table's limits.</returns>
public ResizableLimits Limits { get; private set; }
private List<FunctionDefinition> contents;
/// <summary>
/// Gets or sets the function definition at the given index in the table.
/// </summary>
public FunctionDefinition this[uint Index]
{
get { return contents[(int)Index]; }
set { contents[(int)Index] = value; }
}
}
}
|
using System.Collections.Generic;
using System.Linq;
namespace Wasm.Interpret
{
/// <summary>
/// Defines a table of function values.
/// </summary>
public sealed class FunctionTable
{
/// <summary>
/// Creates a function table from the given resizable limits.
/// The table's initial contents are trap values.
/// </summary>
/// <param name="Limits">The table's limits.</param>
public FunctionTable(ResizableLimits Limits)
{
this.Limits = Limits;
this.contents = new List<FunctionDefinition>((int)Limits.Initial);
var funcDef = new ThrowFunctionDefinition(new WasmException("Indirect call target not initialized yet."));
for (int i = 0; i < Limits.Initial; i++)
{
contents.Add(funcDef);
}
}
/// <summary>
/// Gets this function table's limits.
/// </summary>
/// <returns>The function table's limits.</returns>
public ResizableLimits Limits { get; private set; }
private List<FunctionDefinition> contents;
/// <summary>
/// Gets or sets the function definition at the given index in the table.
/// </summary>
public FunctionDefinition this[uint Index]
{
get => contents[(int)Index];
set => contents[(int)Index] = value;
}
}
}
|
mit
|
C#
|
fe98bec4d957882ba813eed17845b67ae498930a
|
Add other rollbar client tests
|
Valetude/Valetude.Rollbar
|
Rollbar.Net.Test/RollbarClientFixture.cs
|
Rollbar.Net.Test/RollbarClientFixture.cs
|
using Newtonsoft.Json;
using Xunit;
namespace Rollbar.Test {
public class RollbarClientFixture {
private readonly RollbarClient _rollbarClient;
public RollbarClientFixture() {
this._rollbarClient= new RollbarClient();
}
[Fact]
public void Client_rendered_as_dict_when_empty() {
Assert.Equal("{}", JsonConvert.SerializeObject(_rollbarClient));
}
[Fact]
public void Client_renders_arbitrary_keys_correctly() {
_rollbarClient["test-key"] = "test-value";
Assert.Equal("{\"test-key\":\"test-value\"}", JsonConvert.SerializeObject(_rollbarClient));
}
[Fact]
public void Client_renders_javascript_entry_correctly() {
_rollbarClient.Javascript = new RollbarJavascriptClient();
Assert.Equal("{\"javascript\":{}}", JsonConvert.SerializeObject(_rollbarClient));
}
}
}
|
using Newtonsoft.Json;
using Xunit;
namespace Rollbar.Test {
public class RollbarClientFixture {
private readonly RollbarClient _rollbarClient;
public RollbarClientFixture() {
this._rollbarClient= new RollbarClient();
}
[Fact]
public void Client_rendered_as_dict_when_empty() {
Assert.Equal("{}", JsonConvert.SerializeObject(_rollbarClient));
}
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.