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 |
---|---|---|---|---|---|---|---|---|
5005ff51336c12f584969354928960a287606371
|
fix LightEntityLineHelper FillToString
|
AlejandroCano/framework,avifatal/framework,signumsoftware/framework,AlejandroCano/framework,signumsoftware/framework,avifatal/framework
|
Signum.Web/LineHelpers/LightEntityLineHelper.cs
|
Signum.Web/LineHelpers/LightEntityLineHelper.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Linq.Expressions;
using Signum.Utilities;
using System.Web.Mvc.Html;
using Signum.Entities;
using Signum.Entities.Reflection;
using System.Web;
using Signum.Engine;
namespace Signum.Web
{
public static class LightEntityLineHelper
{
public static MvcHtmlString LightEntityLine(this HtmlHelper helper, Lite<IIdentifiable> lite, bool isSearchEntity)
{
if (lite == null)
return MvcHtmlString.Empty;
if (lite.ToString() == null)
Database.FillToString(lite);
MvcHtmlString result = Navigator.IsNavigable(lite.EntityType, null, isSearchEntity) ?
helper.Href("",
lite.ToString(),
Navigator.NavigateRoute(lite),
HttpUtility.HtmlEncode(EntityControlMessage.View.NiceToString()),
"", null) :
lite.ToString().EncodeHtml();
return result;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Linq.Expressions;
using Signum.Utilities;
using System.Web.Mvc.Html;
using Signum.Entities;
using Signum.Entities.Reflection;
using System.Web;
using Signum.Engine;
namespace Signum.Web
{
public static class LightEntityLineHelper
{
public static MvcHtmlString LightEntityLine(this HtmlHelper helper, Lite<IIdentifiable> lite, bool isSearchEntity)
{
if (lite == null)
return MvcHtmlString.Empty;
if (string.IsNullOrEmpty(lite.ToString()))
Database.FillToString(lite);
MvcHtmlString result = Navigator.IsNavigable(lite.EntityType, null, isSearchEntity) ?
helper.Href("",
lite.ToString(),
Navigator.NavigateRoute(lite),
HttpUtility.HtmlEncode(EntityControlMessage.View.NiceToString()),
"", null) :
lite.ToString().EncodeHtml();
return result;
}
}
}
|
mit
|
C#
|
ab1996b153e318fe4ff4d02ce918f8b351eaf859
|
Update PartialOutputRaster.cs
|
LANDIS-II-Foundation/Landis-Spatial-Modeling-Library
|
src/api/PartialOutputRaster.cs
|
src/api/PartialOutputRaster.cs
|
// Copyright 2005-2006 University of Wisconsin
// All rights reserved.
//
// Contributors:
// James Domingo, UW-Madison, Forest Landscape Ecology Lab
namespace Landis.SpatialModeling
{
/// <summary>
/// Provides events and methods for handling output rasters that are
/// closed before all their data is written.
/// </summary>
public static class PartialOutputRaster
{
/// <summary>
/// Signature for methods called with a partial output raster is
/// closed.
/// </summary>
public delegate void CloseEventHandler(string path,
Dimensions dimensions,
int pixelsWritten);
//---------------------------------------------------------------------
/// <summary>
/// The event when a partial output raster is called.
/// </summary>
public static event CloseEventHandler CloseEvent;
//---------------------------------------------------------------------
/// <summary>
/// Called when a partial output raster is closed.
/// </summary>
public static void Closed(string path,
Dimensions dimensions,
int pixelsWritten)
{
if (CloseEvent != null)
CloseEvent(path, dimensions, pixelsWritten);
}
}
}
|
// Copyright 2005-2006 University of Wisconsin
// All rights reserved.
//
// The copyright holders license this file under the New (3-clause) BSD
// License (the "License"). You may not use this file except in
// compliance with the License. A copy of the License is available at
//
// http://www.opensource.org/licenses/BSD-3-Clause
//
// and is included in the NOTICE.txt file distributed with this work.
//
// Contributors:
// James Domingo, UW-Madison, Forest Landscape Ecology Lab
namespace Landis.SpatialModeling
{
/// <summary>
/// Provides events and methods for handling output rasters that are
/// closed before all their data is written.
/// </summary>
public static class PartialOutputRaster
{
/// <summary>
/// Signature for methods called with a partial output raster is
/// closed.
/// </summary>
public delegate void CloseEventHandler(string path,
Dimensions dimensions,
int pixelsWritten);
//---------------------------------------------------------------------
/// <summary>
/// The event when a partial output raster is called.
/// </summary>
public static event CloseEventHandler CloseEvent;
//---------------------------------------------------------------------
/// <summary>
/// Called when a partial output raster is closed.
/// </summary>
public static void Closed(string path,
Dimensions dimensions,
int pixelsWritten)
{
if (CloseEvent != null)
CloseEvent(path, dimensions, pixelsWritten);
}
}
}
|
apache-2.0
|
C#
|
5e3fafc7554e4d4e6c5f8a94eccedc78af86c29d
|
Refactor BackgroundPatternTracer
|
setchi/n_back_tracer,setchi/n_back_tracer
|
Assets/Scripts/BackgroundPatternTracer.cs
|
Assets/Scripts/BackgroundPatternTracer.cs
|
using UnityEngine;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UniRx;
public class BackgroundPatternTracer : MonoBehaviour {
[SerializeField] GameObject Tile;
[SerializeField] int col;
[SerializeField] int row;
void Awake () {
transform.localPosition = new Vector3(-col * 1.7f / 2, -row * 1.7f / 2, 10);
var tiles = Enumerable.Range(0, row).SelectMany(y => Enumerable.Range(0, col).Select(x => {
var obj = Instantiate(Tile) as GameObject;
obj.transform.SetParent(transform);
obj.transform.localPosition = new Vector3(x, y) * 1.7f;
return obj.GetComponent<Tile>();
})).ToArray();
var patterns = BackgroundPatternStore.GetPatterns();
var tileEffectEmitters = new List<Action<Tile>> {
tile => tile.EmitMarkEffect(),
tile => tile.EmitHintEffect()
};
Observable.Interval (TimeSpan.FromMilliseconds (700))
.Zip(patterns.ToObservable(), (_, p) => p).Repeat().Subscribe(pattern => {
Observable.Interval (TimeSpan.FromMilliseconds (100))
.Zip(pattern.ToObservable(), (_, i) => tiles[i])
.Do(tileEffectEmitters[pattern.Peek() % 2])
.Buffer(2, 1).Where(b => b.Count > 1)
.Subscribe(b => b[0].DrawLine(b[1].gameObject.transform.position))
.AddTo(gameObject);
}).AddTo(gameObject);
}
}
|
using UnityEngine;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UniRx;
public class BackgroundPatternTracer : MonoBehaviour {
[SerializeField] GameObject Tile;
[SerializeField] int col;
[SerializeField] int row;
void Awake () {
transform.localPosition = new Vector3(-col * 1.7f / 2, -row * 1.7f / 2, 10);
var tiles = Enumerable.Range(0, row).SelectMany(y => Enumerable.Range(0, col).Select(x => {
var obj = Instantiate(Tile) as GameObject;
obj.transform.SetParent(transform);
obj.transform.localPosition = new Vector3(x, y) * 1.7f;
return obj.GetComponent<Tile>();
})).ToArray();
var patterns = BackgroundPatternStore.GetPatterns();
var tileEffectEmitters = new List<Action<Tile>> {
tile => tile.EmitMarkEffect(),
tile => tile.EmitHintEffect()
};
Observable.Interval (TimeSpan.FromMilliseconds (700))
.Zip(patterns.ToObservable(), (_, p) => p).Repeat().Subscribe(pattern => {
var traceStream = Observable.Interval (TimeSpan.FromMilliseconds (100))
.Zip(pattern.ToObservable(), (_, i) => tiles[i]);
traceStream.Do(tileEffectEmitters[pattern.Peek() % 2])
.Zip(traceStream.Skip(1), (prev, current) => new { prev, current })
.Subscribe(tile => tile.current.DrawLine(tile.prev.gameObject.transform.position))
.AddTo(gameObject);
}).AddTo(gameObject);
}
}
|
mit
|
C#
|
ee7bf0085fdad00a901b4a28237164ca133b9a58
|
Prepare release 1.1.0.12
|
physion/BarcodePrinter
|
BarcodePrinter/Properties/AssemblyInfo.cs
|
BarcodePrinter/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Physion.BarcodePrinter")]
[assembly: AssemblyDescription("Barcode printer for Zebra thermal printers")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Physion LLC")]
[assembly: AssemblyProduct("BarcodePrinter")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//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.1.0.12")]
[assembly: AssemblyFileVersion("1.1.0.12")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Physion.BarcodePrinter")]
[assembly: AssemblyDescription("Barcode printer for Zebra thermal printers")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Physion LLC")]
[assembly: AssemblyProduct("BarcodePrinter")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//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.1.0.11")]
[assembly: AssemblyFileVersion("1.1.0.11")]
|
apache-2.0
|
C#
|
1acc37d4f53c3dc17ede6feb069ebf91db1a06d9
|
Update BankAccount.cs
|
kiyoaki/bitflyer-api-dotnet-client
|
BitFlyer.Apis/ResponseData/BankAccount.cs
|
BitFlyer.Apis/ResponseData/BankAccount.cs
|
using System.Runtime.Serialization;
using System.Text;
using Utf8Json;
namespace BitFlyer.Apis
{
public class BankAccount
{
[DataMember(Name = "id")]
public long Id { get; set; }
[DataMember(Name = "is_verified")]
public bool IsVerified { get; set; }
[DataMember(Name = "bank_name")]
public string BankName { get; set; }
[DataMember(Name = "branch_name")]
public string BranchName { get; set; }
[DataMember(Name = "account_type")]
public string AccountType { get; set; }
[DataMember(Name = "account_number")]
public string AccountNumber { get; set; }
[DataMember(Name = "account_name")]
public string AccountName { get; set; }
public override string ToString()
{
return Encoding.UTF8.GetString(JsonSerializer.Serialize(this));
}
}
}
|
using System.Runtime.Serialization;
using System.Text;
using Utf8Json;
namespace BitFlyer.Apis
{
public class BankAccount
{
[DataMember(Name = "id")]
public long Id { get; set; }
[DataMember(Name = "is_verified")]
public bool IsVerified { get; set; }
[DataMember(Name = "bank_name")]
public string BankName { get; set; }
[DataMember(Name = "branch_name")]
public string BranchName { get; set; }
[DataMember(Name = "account_type")]
public string AccountType { get; set; }
[DataMember(Name = "account_number")]
public string AccountNumber { get; set; }
[DataMember(Name = "account_name")]
public string AccountName { get; set; }
public override string ToString()
{
return Encoding.UTF8.GetString(JsonSerializer.Serialize(this));
}
}
}
|
mit
|
C#
|
490e9dbfd67d5961e7fb33d63985504c8700b308
|
Change icon color to be consistent with other section icon colors
|
FALM-Umbraco-Projects/FALM-Housekeeping-v7,FALM-Umbraco-Projects/FALM-Housekeeping-v7,FALM-Umbraco-Projects/FALM-Housekeeping-v7
|
FALMHousekeeping/Constants/HKConstants.cs
|
FALMHousekeeping/Constants/HKConstants.cs
|
namespace FALM.Housekeeping.Constants
{
/// <summary>
/// HkConstants
/// </summary>
public class HkConstants
{
/// <summary>
/// Application
/// </summary>
public class Application
{
/// <summary>Name of the Application</summary>
public const string Name = "F.A.L.M.";
/// <summary>Alias of the Application</summary>
public const string Alias = "FALM";
/// <summary>Icon of the Application</summary>
public const string Icon = "icon-speed-gauge";
/// <summary>Title of the Application</summary>
public const string Title = "F.A.L.M. Housekeeping";
}
/// <summary>
/// Tree
/// </summary>
public class Tree
{
/// <summary>Name of the Tree</summary>
public const string Name = "Housekeeping Tools";
/// <summary>Alias of the Tree</summary>
public const string Alias = "housekeeping";
/// <summary>Icon of the Tree</summary>
public const string Icon = "icon-umb-deploy";
/// <summary>Title of the Tree</summary>
public const string Title = "Menu";
}
/// <summary>
/// Controller
/// </summary>
public class Controller
{
/// <summary>Alias of the Controller</summary>
public const string Alias = "FALM";
}
}
}
|
namespace FALM.Housekeeping.Constants
{
/// <summary>
/// HkConstants
/// </summary>
public class HkConstants
{
/// <summary>
/// Application
/// </summary>
public class Application
{
/// <summary>Name of the Application</summary>
public const string Name = "F.A.L.M.";
/// <summary>Alias of the Application</summary>
public const string Alias = "FALM";
/// <summary>Icon of the Application</summary>
public const string Icon = "icon-speed-gauge color-yellow";
/// <summary>Title of the Application</summary>
public const string Title = "F.A.L.M. Housekeeping";
}
/// <summary>
/// Tree
/// </summary>
public class Tree
{
/// <summary>Name of the Tree</summary>
public const string Name = "Housekeeping Tools";
/// <summary>Alias of the Tree</summary>
public const string Alias = "housekeeping";
/// <summary>Icon of the Tree</summary>
public const string Icon = "icon-umb-deploy";
/// <summary>Title of the Tree</summary>
public const string Title = "Menu";
}
/// <summary>
/// Controller
/// </summary>
public class Controller
{
/// <summary>Alias of the Controller</summary>
public const string Alias = "FALM";
}
}
}
|
mit
|
C#
|
96a7ebe685fd9f8f2bb043ecaba27531cc3501bf
|
Update JsResource.cs
|
sorenhl/Glimpse.NLog,rho24/Glimpse.NLog,rho24/Glimpse.NLog,rho24/Glimpse.NLog,sorenhl/Glimpse.NLog,sorenhl/Glimpse.NLog
|
Glimpse.NLog/Resource/JsResource.cs
|
Glimpse.NLog/Resource/JsResource.cs
|
using System.Collections.Generic;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Resource;
namespace Glimpse.NLog.Resource
{
public class JsResource : FileResource, IDynamicClientScript
{
private const string InternalName = "glimpse_nlog_js";
protected override EmbeddedResourceInfo GetEmbeddedResourceInfo(IResourceContext context)
{
return new EmbeddedResourceInfo(this.GetType().Assembly, "Glimpse.NLog.Resource.glimpse.nlog.js", @"application/x-javascript");
}
public JsResource() {
Name = InternalName;
}
public ScriptOrder Order {
get { return ScriptOrder.IncludeAfterClientInterfaceScript; }
}
public string GetResourceName() {
return InternalName;
}
}
}
|
using System.Collections.Generic;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Resource;
namespace Glimpse.NLog.Resource
{
public class JsResource : FileResource, IDynamicClientScript
{
private const string InternalName = "glimpse_nlog_js";
public JsResource() {
ResourceName = "Glimpse.NLog.Resource.glimpse.nlog.js";
ResourceType = @"application/x-javascript";
Name = InternalName;
}
public ScriptOrder Order {
get { return ScriptOrder.IncludeAfterClientInterfaceScript; }
}
public string GetResourceName() {
return InternalName;
}
}
}
|
mit
|
C#
|
c3fcac2ee27a414af76ccbc4fb3eec3f21590e29
|
Change name of SQL connection string
|
IsaacSchemm/AnonymousPhotoBin,IsaacSchemm/AnonymousPhotoBin,IsaacSchemm/AnonymousPhotoBin,IsaacSchemm/AnonymousPhotoBin
|
AnonymousPhotoBin/Startup.cs
|
AnonymousPhotoBin/Startup.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using AnonymousPhotoBin.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace AnonymousPhotoBin
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
if (env.IsDevelopment()) {
builder.AddUserSecrets<Startup>();
}
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddDbContext<PhotoBinDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("SqlConnectionString")));
services.AddSingleton<IConfiguration>(Configuration);
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
if (!env.IsDevelopment())
app.UseHsts();
app.UseMvc();
app.UseDefaultFiles();
app.UseHttpsRedirection();
app.UseStaticFiles();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using AnonymousPhotoBin.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace AnonymousPhotoBin
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
if (env.IsDevelopment()) {
builder.AddUserSecrets<Startup>();
}
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddDbContext<PhotoBinDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddSingleton<IConfiguration>(Configuration);
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
if (!env.IsDevelopment())
app.UseHsts();
app.UseMvc();
app.UseDefaultFiles();
app.UseHttpsRedirection();
app.UseStaticFiles();
}
}
}
|
agpl-3.0
|
C#
|
99d60832cb81599140dec567821cb08cc61108eb
|
correct spelling i comment
|
RogerKratz/mbcache
|
MbCache/Logic/MethodInfoComparer.cs
|
MbCache/Logic/MethodInfoComparer.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace MbCache.Logic
{
public class MethodInfoComparer : IEqualityComparer<MethodInfo>
{
public bool Equals(MethodInfo x, MethodInfo y)
{
//no need to check what type methodinfo is on - already checked before entering this method
if (!x.Name.Equals(y.Name))
return false;
var xParams = x.GetParameters();
var yParams = y.GetParameters();
var xParamCount = xParams.Count();
if(xParamCount != yParams.Count())
return false;
for (var i = 0; i < xParamCount; i++)
{
if(xParams[i].ParameterType != yParams[i].ParameterType)
return false;
}
return true;
}
public int GetHashCode(MethodInfo obj)
{
throw new NotImplementedException("Not currently used by MbCache");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace MbCache.Logic
{
public class MethodInfoComparer : IEqualityComparer<MethodInfo>
{
public bool Equals(MethodInfo x, MethodInfo y)
{
//no need to check what type methodinfo is on - already check before entering this method
if (!x.Name.Equals(y.Name))
return false;
var xParams = x.GetParameters();
var yParams = y.GetParameters();
var xParamCount = xParams.Count();
if(xParamCount != yParams.Count())
return false;
for (var i = 0; i < xParamCount; i++)
{
if(xParams[i].ParameterType != yParams[i].ParameterType)
return false;
}
return true;
}
public int GetHashCode(MethodInfo obj)
{
throw new NotImplementedException("Not currently used by MbCache");
}
}
}
|
mit
|
C#
|
44c306731e242702ee05009360553f12eee278d3
|
fix assembly info
|
DotNetDevs/Synology,matteobruni/Synology,DotNetDevs/Synology,Ar3sDevelopment/Synology,Matt-Co/Synology
|
Synology/Properties/AssemblyInfo.cs
|
Synology/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Synology")]
[assembly: AssemblyDescription("Synology API for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Caelan")]
[assembly: AssemblyProduct("Synology")]
[assembly: AssemblyCopyright("Caelan © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Synology")]
[assembly: AssemblyDescription("Synology API for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Matteo Bruni")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
apache-2.0
|
C#
|
e4ad517cb1f51a0f1872905ac14a287b24386611
|
Handle exceptions when clearing temp files BECAUSE NO ONE REPORTED IT
|
TorchAPI/Torch
|
Torch/Managers/FilesystemManager.cs
|
Torch/Managers/FilesystemManager.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NLog;
using Torch.API;
namespace Torch.Managers
{
public class FilesystemManager : Manager
{
private static readonly Logger _log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Temporary directory for Torch that is cleared every time the program is started.
/// </summary>
public string TempDirectory { get; }
/// <summary>
/// Directory that contains the current Torch assemblies.
/// </summary>
public string TorchDirectory { get; }
public FilesystemManager(ITorchBase torchInstance) : base(torchInstance)
{
var torch = new FileInfo(typeof(FilesystemManager).Assembly.Location).Directory.FullName;
TempDirectory = Directory.CreateDirectory(Path.Combine(torch, "tmp")).FullName;
TorchDirectory = torch;
_log.Debug($"Clearing tmp directory at {TempDirectory}");
ClearTemp();
}
private void ClearTemp()
{
foreach (var file in Directory.GetFiles(TempDirectory, "*", SearchOption.AllDirectories))
{
try
{
File.Delete(file);
}
catch (UnauthorizedAccessException)
{
_log.Debug($"Failed to delete file {file}, it's probably in use by another process'");
}
catch (Exception ex)
{
_log.Warn($"Unhandled exception when clearing temp files. You may ignore this. {ex}");
}
}
}
/// <summary>
/// Move the given file (if it exists) to a temporary directory that will be cleared the next time the application starts.
/// </summary>
public void SoftDelete(string path, string file)
{
string source = Path.Combine(path, file);
if (!File.Exists(source))
return;
var rand = Path.GetRandomFileName();
var dest = Path.Combine(TempDirectory, rand);
File.Move(source, rand);
string rsource = Path.Combine(path, rand);
File.Move(rsource, dest);
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NLog;
using Torch.API;
namespace Torch.Managers
{
public class FilesystemManager : Manager
{
private static readonly Logger _log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Temporary directory for Torch that is cleared every time the program is started.
/// </summary>
public string TempDirectory { get; }
/// <summary>
/// Directory that contains the current Torch assemblies.
/// </summary>
public string TorchDirectory { get; }
public FilesystemManager(ITorchBase torchInstance) : base(torchInstance)
{
var torch = new FileInfo(typeof(FilesystemManager).Assembly.Location).Directory.FullName;
TempDirectory = Directory.CreateDirectory(Path.Combine(torch, "tmp")).FullName;
TorchDirectory = torch;
_log.Debug($"Clearing tmp directory at {TempDirectory}");
ClearTemp();
}
private void ClearTemp()
{
foreach (var file in Directory.GetFiles(TempDirectory, "*", SearchOption.AllDirectories))
File.Delete(file);
}
/// <summary>
/// Move the given file (if it exists) to a temporary directory that will be cleared the next time the application starts.
/// </summary>
public void SoftDelete(string path, string file)
{
string source = Path.Combine(path, file);
if (!File.Exists(source))
return;
var rand = Path.GetRandomFileName();
var dest = Path.Combine(TempDirectory, rand);
File.Move(source, rand);
string rsource = Path.Combine(path, rand);
File.Move(rsource, dest);
}
}
}
|
apache-2.0
|
C#
|
4f14dd3c48635ec41fd57a0450921174d36be304
|
Add InternalsVisibleTo for test project
|
anjdreas/UnitsNet,neutmute/UnitsNet,BrandonLWhite/UnitsNet,BrandonLWhite/UnitsNet,anjdreas/UnitsNet
|
UnitsNet/Properties/AssemblyInfo.cs
|
UnitsNet/Properties/AssemblyInfo.cs
|
// Copyright(c) 2007 Andreas Gullberg Larsen
// https://github.com/anjdreas/UnitsNet
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
// 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("Units.NET")]
[assembly: AssemblyDescription("Units.NET gives you all the common units of measurement and the conversions between them. It is light-weight, unit tested and supports PCL.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Andreas Gullberg Larsen")]
[assembly: AssemblyProduct("Units.NET")]
[assembly: AssemblyCopyright("Copyright © 2007 Andreas Gullberg Larsen")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("")]
[assembly: CLSCompliant(true)]
// Give access to internal members for testing
[assembly: InternalsVisibleTo("UnitsNet.Tests")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.28.1")]
[assembly: AssemblyFileVersion("3.28.1")]
|
// Copyright(c) 2007 Andreas Gullberg Larsen
// https://github.com/anjdreas/UnitsNet
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Reflection;
using System.Resources;
// 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("Units.NET")]
[assembly: AssemblyDescription("Units.NET gives you all the common units of measurement and the conversions between them. It is light-weight, unit tested and supports PCL.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Andreas Gullberg Larsen")]
[assembly: AssemblyProduct("Units.NET")]
[assembly: AssemblyCopyright("Copyright © 2007 Andreas Gullberg Larsen")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("")]
[assembly: CLSCompliant(true)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.28.1")]
[assembly: AssemblyFileVersion("3.28.1")]
|
mit
|
C#
|
913a0a6ce80bfdbe22a3ec273164b0abf8fd819c
|
Make SimControlHandler pass up the slider's initial value
|
futurechris/zombai
|
Assets/Scripts/SimControlHandler.cs
|
Assets/Scripts/SimControlHandler.cs
|
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class SimControlHandler : MonoBehaviour {
public Text simSpeedLabel;
public Slider simSpeedSlider;
public WorldMap map;
private bool initialSet = false;
// Use this for initialization
// void Start () {}
// Update is called once per frame
void Update()
{
if(!initialSet)
{
simulationSpeedChanged();
initialSet = true;
}
}
public void simulationSpeedChanged()
{
float multiplier = simSpeedSlider.value;
if(multiplier > 1.0f)
{
multiplier *= multiplier;
}
simSpeedLabel.text = string.Format("Simulation Speed: {0,-3:N1}x", Mathf.Ceil(10.0f*multiplier)/10.0f);
simSpeedLabel.SetAllDirty();
// map.setSimulationSpeed(multiplier);
Time.timeScale = multiplier;
}
}
|
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class SimControlHandler : MonoBehaviour {
public Text simSpeedLabel;
public Slider simSpeedSlider;
public WorldMap map;
// Use this for initialization
// void Start () {}
// Update is called once per frame
// void Update () {}
public void simulationSpeedChanged()
{
float multiplier = simSpeedSlider.value;
if(multiplier > 1.0f)
{
multiplier *= multiplier;
}
simSpeedLabel.text = string.Format("Simulation Speed: {0,-3:N1}x", Mathf.Ceil(10.0f*multiplier)/10.0f);
simSpeedLabel.SetAllDirty();
// map.setSimulationSpeed(multiplier);
Time.timeScale = multiplier;
}
}
|
mit
|
C#
|
5209bc144a107d48cfd738bf936b7ae5f85a8387
|
Bump to version 0.1.4.
|
FacilityApi/FacilityJavaScript,FacilityApi/FacilityJavaScript,FacilityApi/FacilityJavaScript
|
SolutionInfo.cs
|
SolutionInfo.cs
|
using System.Reflection;
[assembly: AssemblyVersion("0.1.4.0")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright 2016 Ed Ball")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
|
using System.Reflection;
[assembly: AssemblyVersion("0.1.3.0")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright 2016 Ed Ball")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
|
mit
|
C#
|
9ef1b351f0fad7797141613ec570a93189a0b719
|
support removing logger
|
ubikuity/QuartzNetWebConsole,ubikuity/QuartzNetWebConsole,ubikuity/QuartzNetWebConsole,codevlabs/QuartzNetWebConsole
|
QuartzNetWebConsole/Setup.cs
|
QuartzNetWebConsole/Setup.cs
|
using System;
using Quartz;
namespace QuartzNetWebConsole {
public static class Setup {
public static Func<IScheduler> Scheduler { get; set; }
private static ILogger logger;
public static ILogger Logger {
get { return logger; }
set {
var scheduler = Scheduler();
if (logger != null) {
scheduler.RemoveGlobalJobListener(logger);
scheduler.RemoveGlobalTriggerListener(logger);
scheduler.RemoveSchedulerListener(logger);
}
if (value != null) {
scheduler.AddGlobalJobListener(value);
scheduler.AddGlobalTriggerListener(value);
scheduler.AddSchedulerListener(value);
}
logger = value;
}
}
static Setup() {
Scheduler = () => { throw new Exception("Define QuartzNetWebConsole.Setup.Scheduler"); };
}
}
}
|
using System;
using Quartz;
namespace QuartzNetWebConsole {
public static class Setup {
public static Func<IScheduler> Scheduler { get; set; }
private static ILogger logger;
public static ILogger Logger {
get { return logger; }
set {
var scheduler = Scheduler();
if (logger != null) {
scheduler.RemoveGlobalJobListener(logger);
scheduler.RemoveGlobalTriggerListener(logger);
scheduler.RemoveSchedulerListener(logger);
}
scheduler.AddGlobalJobListener(value);
scheduler.AddGlobalTriggerListener(value);
scheduler.AddSchedulerListener(value);
logger = value;
}
}
static Setup() {
Scheduler = () => { throw new Exception("Define QuartzNetWebConsole.Setup.Scheduler"); };
}
}
}
|
apache-2.0
|
C#
|
237a22d497966659b752cc123004fc76e33ba484
|
Fix failing quot test.
|
TheBerkin/Rant
|
Rant.Tests/Capitalization.cs
|
Rant.Tests/Capitalization.cs
|
using NUnit.Framework;
namespace Rant.Tests
{
[TestFixture]
public class Capitalization
{
private readonly RantEngine rant = new RantEngine();
[Test]
public void Uppercase()
{
Assert.AreEqual("HELLO WORLD", rant.Do(@"[caps:upper]hello world").Main);
}
[Test]
public void Lowercase()
{
Assert.AreEqual("hello world", rant.Do(@"[caps:lower]HeLlO wOrLd").Main);
}
[Test]
public void TitleCase()
{
Assert.AreEqual("This Is a Title", rant.Do(@"[caps:title]this is a title").Main);
Assert.AreEqual("This Is a Test of the Automatic Capitalization",
rant.Do(@"[`.+`:this is a test of the automatic capitalization;[caps:title][match]]").Main);
}
[TestCase(@"[caps:sentence]this is a sentence. this is another sentence.", "This is a sentence. This is another sentence.")]
[TestCase(@"[caps:sentence][numfmt:verbal][n:1] is a number.", "One is a number.")]
public void SentenceCase(string pattern, string expected)
{
Assert.AreEqual(expected, rant.Do(pattern).Main);
}
[Test]
public void QuotedSentence()
{
Assert.AreEqual("“This is a sentence. This is another sentence.”",
rant.Do(@"[quot:[caps:sentence]this is a sentence. this is another sentence.]").Main);
}
[Test]
public void FirstCase()
{
Assert.AreEqual("Hello world", rant.Do(@"[caps:first]hello world").Main);
}
[Test]
public void WordCase()
{
Assert.AreEqual("Hello World", rant.Do(@"[caps:word]hello world").Main);
}
}
}
|
using NUnit.Framework;
namespace Rant.Tests
{
[TestFixture]
public class Capitalization
{
private readonly RantEngine rant = new RantEngine();
[Test]
public void Uppercase()
{
Assert.AreEqual("HELLO WORLD", rant.Do(@"[caps:upper]hello world").Main);
}
[Test]
public void Lowercase()
{
Assert.AreEqual("hello world", rant.Do(@"[caps:lower]HeLlO wOrLd").Main);
}
[Test]
public void TitleCase()
{
Assert.AreEqual("This Is a Title", rant.Do(@"[caps:title]this is a title").Main);
Assert.AreEqual("This Is a Test of the Automatic Capitalization",
rant.Do(@"[`.+`:this is a test of the automatic capitalization;[caps:title][match]]").Main);
}
[TestCase(@"[caps:sentence]this is a sentence. this is another sentence.", "This is a sentence. This is another sentence.")]
[TestCase(@"[caps:sentence][numfmt:verbal][n:1] is a number.", "One is a number.")]
public void SentenceCase(string pattern, string expected)
{
Assert.AreEqual(expected, rant.Do(pattern).Main);
}
[Test]
public void QuotedSentence()
{
Assert.AreEqual("“This is a sentence. This is another sentence.”",
rant.Do(@"[q:[caps:sentence]this is a sentence. this is another sentence.]").Main);
}
[Test]
public void FirstCase()
{
Assert.AreEqual("Hello world", rant.Do(@"[caps:first]hello world").Main);
}
[Test]
public void WordCase()
{
Assert.AreEqual("Hello World", rant.Do(@"[caps:word]hello world").Main);
}
}
}
|
mit
|
C#
|
1fc0a1a54852b8ac96719e9457c3d3ea277a7d63
|
Update version number again
|
mattfrear/Swashbuckle.Examples,mattfrear/Swashbuckle.Examples,mattfrear/Swashbuckle.Examples
|
Swashbuckle.Examples/Properties/AssemblyInfo.cs
|
Swashbuckle.Examples/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("Swashbuckle.Examples")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Swashbuckle.Examples")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("46db6f33-2b22-4675-bbed-d915753e41cd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Swashbuckle.Examples")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Swashbuckle.Examples")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("46db6f33-2b22-4675-bbed-d915753e41cd")]
// 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("1.0.0.0")]
|
mit
|
C#
|
07114149fda68aa5b1d745471958c7747dba38a1
|
fix dakuryon cage debuff?
|
Foglio1024/Tera-custom-cooldowns,Foglio1024/Tera-custom-cooldowns
|
TCC.Core/Data/Abnormality.cs
|
TCC.Core/Data/Abnormality.cs
|
namespace TCC.Data
{
public class Abnormality
{
public string IconName { get; set; }
public uint Id { get; set; }
public string Name { get; set; }
public string ToolTip { get; set; }
public bool IsBuff { get; set; }
public bool IsShow { get; set; }
public bool Infinity { get; set; }
public AbnormalityType Type { get; set; }
public uint ShieldSize { get; private set; }
public bool IsShield { get; private set; }
public Abnormality(uint id, bool isShow, bool isBuff, bool infinity, AbnormalityType prop)
{
Id = id;
IsBuff = isBuff;
IsShow = isShow;
Infinity = infinity;
Type = prop;
if (!IsBuff && prop == AbnormalityType.Buff) Type = AbnormalityType.Debuff;
}
public void SetIcon(string iconName)
{
IconName = iconName;
}
public void SetInfo(string name, string toolTip)
{
Name = name;
ToolTip = toolTip;
}
public void SetShield(uint size)
{
IsShield = true;
ShieldSize = size;
}
}
}
|
namespace TCC.Data
{
public class Abnormality
{
//Bitmap iconBitmap;
public string IconName { get; set; }
public uint Id { get; set; }
public string Name { get; set; }
public string ToolTip { get; set; }
public bool IsBuff { get; set; }
public bool IsShow { get; set; }
public bool Infinity { get; set; }
public AbnormalityType Type { get; set; }
public uint ShieldSize { get; private set; }
public bool IsShield { get; private set; }
public Abnormality(uint id, bool isShow, bool isBuff, bool infinity, AbnormalityType prop)
{
Id = id;
IsBuff = isBuff;
IsShow = isShow;
Infinity = infinity;
Type = prop;
}
public void SetIcon(string iconName)
{
IconName = iconName;
}
public void SetInfo(string name, string toolTip)
{
Name = name;
ToolTip = toolTip;
}
public void SetShield(uint size)
{
IsShield = true;
ShieldSize = size;
}
}
}
|
mit
|
C#
|
214c0775ec735c5b96cad7dbbc358aece7dad6aa
|
Make rumble more robust.
|
Eusth/VRGIN
|
VRGIN/Controls/Handlers/BodyRumbleHandler.cs
|
VRGIN/Controls/Handlers/BodyRumbleHandler.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using VRGIN.Core;
using VRGIN.Helpers;
namespace VRGIN.Controls.Handlers
{
public class BodyRumbleHandler : ProtectedBehaviour
{
private Controller _Controller;
private int _TouchCounter = 0;
private RumbleSession _Rumble;
protected override void OnStart()
{
base.OnStart();
_Controller = GetComponent<Controller>();
}
protected override void OnLevel(int level)
{
base.OnLevel(level);
OnStop();
}
protected void OnDisable()
{
OnStop();
}
protected void OnTriggerEnter(Collider collider)
{
if (VR.Interpreter.IsBody(collider))
{
_TouchCounter++;
if (_Rumble == null)
{
_Rumble = new RumbleSession(50, 10, 1f);
_Controller.StartRumble(_Rumble);
}
}
}
protected void OnTriggerStay(Collider collider)
{
if (collider.gameObject.layer == LayerMask.NameToLayer("ToLiquidCollision"))
{
_Rumble.Restart();
}
}
protected void OnTriggerExit(Collider collider)
{
if (collider.gameObject.layer == LayerMask.NameToLayer("ToLiquidCollision"))
{
_TouchCounter--;
if (_TouchCounter == 0)
{
OnStop();
}
}
}
protected void OnStop()
{
_TouchCounter = 0;
_Rumble.Close();
_Rumble = null;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using VRGIN.Core;
using VRGIN.Helpers;
namespace VRGIN.Controls.Handlers
{
public class BodyRumbleHandler : ProtectedBehaviour
{
private Controller _Controller;
private int _TouchCounter = 0;
private RumbleSession _Rumble;
protected override void OnStart()
{
base.OnStart();
_Controller = GetComponent<Controller>();
}
protected void OnTriggerEnter(Collider collider)
{
if (VR.Interpreter.IsBody(collider))
{
_TouchCounter++;
if (_Rumble == null)
{
_Rumble = new RumbleSession(50, 10, 1f);
_Controller.StartRumble(_Rumble);
}
}
}
protected void OnTriggerStay(Collider collider)
{
if (collider.gameObject.layer == LayerMask.NameToLayer("ToLiquidCollision"))
{
_Rumble.Restart();
}
}
protected void OnTriggerExit(Collider collider)
{
if (collider.gameObject.layer == LayerMask.NameToLayer("ToLiquidCollision"))
{
_TouchCounter--;
if (_TouchCounter == 0)
{
_Rumble.Close();
_Rumble = null;
}
}
}
}
}
|
mit
|
C#
|
46582d419210c817413040b9234894c37e945bbf
|
fix bug
|
vostok/core
|
Vostok.Core/RetriableCall/ExceptionFinder.cs
|
Vostok.Core/RetriableCall/ExceptionFinder.cs
|
using System;
namespace Vostok.RetriableCall
{
public static class ExceptionFinder
{
public static bool HasException<TException>(Exception rootEx)
where TException : Exception
{
return FindException<TException>(rootEx) != null;
}
public static TException FindException<TException>(Exception rootEx)
where TException : Exception
{
return FindException(rootEx, e => e is TException) as TException;
}
public static TException FindException<TException>(Exception rootEx, Func<TException, bool> condition)
where TException : Exception
{
return FindException(rootEx,
ex => ex is TException te && condition(te)) as TException;
}
public static Exception FindException(Exception rootEx, Func<Exception, bool> condition)
{
var ex = rootEx;
while (ex != null && !condition(ex))
{
if (!(ex is AggregateException aggregateEx))
ex = ex.InnerException;
else
{
foreach (var innerException in aggregateEx.InnerExceptions)
{
var exInner = FindException(innerException, condition);
if (exInner != null)
return exInner;
}
return null;
}
}
return ex;
}
}
}
|
using System;
namespace Vostok.RetriableCall
{
public static class ExceptionFinder
{
public static bool HasException<TException>(Exception rootEx)
where TException : Exception
{
return FindException<TException>(rootEx) != null;
}
public static TException FindException<TException>(Exception rootEx)
where TException : Exception
{
return FindException(rootEx, e => e is TException) as TException;
}
public static TException FindException<TException>(Exception rootEx, Func<TException, bool> condition)
where TException : Exception
{
return FindException(rootEx,
ex => ex is TException te && condition(te)) as TException;
}
public static Exception FindException(Exception rootEx, Func<Exception, bool> condition)
{
var ex = rootEx;
while (ex != null && !condition(ex))
{
if (!(rootEx is AggregateException aggregateEx))
ex = ex.InnerException;
else
{
foreach (var innerException in aggregateEx.InnerExceptions)
{
var exInner = FindException(innerException, condition);
if (exInner != null)
return exInner;
}
}
}
return ex;
}
}
}
|
mit
|
C#
|
8ce4704ffd6b0ff95c61d198e34e7bad308bf5a8
|
FIX CIT-785 Hide EDIT button for all users in hub
|
ndrmc/cats,ndrmc/cats,ndrmc/cats
|
Web/Areas/Hub/Views/Shared/DisplayHub.cshtml
|
Web/Areas/Hub/Views/Shared/DisplayHub.cshtml
|
@using Cats.Models.Hubs
@using Cats.Web.Hub.Helpers
@using Telerik.Web.Mvc.UI
@{
var usr = @Html.GetCurrentUser();
var mdl = new CurrentUserModel(usr);
}
<div align="right">
@{
string title = "";
if(ViewBag.Title != null)
{
title = ViewBag.Title;
}
}
</div>
<div class="row-fluid form-inline">
<h4 class="page-header">@Html.Translate(title)
@Html.Label("Owner", mdl.Owner) - @Html.Label("WH", mdl.Name) @Html.Translate(" Hub ")
@*@{
if(usr.UserAllowedHubs.Count > 1)
{
@Html.HubSelectionLink(Html.Translate("Change Warehouse"), Url.Action("HubList", "CurrentHub"), Html.Translate("Change Hub"))
}
}*@ </h4>
</div>
|
@using Cats.Models.Hubs
@using Cats.Web.Hub.Helpers
@using Telerik.Web.Mvc.UI
@{
var usr = @Html.GetCurrentUser();
var mdl = new CurrentUserModel(usr);
}
<div align="right">
@{
string title = "";
if(ViewBag.Title != null)
{
title = ViewBag.Title;
}
}
</div>
<div class="row-fluid form-inline">
<h4 class="page-header">@Html.Translate(title)
@Html.Label("Owner", mdl.Owner) - @Html.Label("WH", mdl.Name) @Html.Translate(" Hub ")
@{
if(usr.UserAllowedHubs.Count > 1)
{
@Html.HubSelectionLink(Html.Translate("Change Warehouse"), Url.Action("HubList", "CurrentHub"), Html.Translate("Change Hub"))
}
} </h4>
</div>
|
apache-2.0
|
C#
|
06dbb33b511271732941263c234203467b09d7a4
|
Add test Notes.UpdateTest.WithExistingTags
|
orodriguez/FTF,orodriguez/FTF,orodriguez/FTF
|
FTF.Tests.XUnit/Notes/UpdateTest.cs
|
FTF.Tests.XUnit/Notes/UpdateTest.cs
|
using System;
using System.Linq;
using FTF.Api.Exceptions;
using Xunit;
namespace FTF.Tests.XUnit.Notes
{
public class UpdateTest : UserAuthenticatedTest
{
[Fact]
public void SimpleTextUpdate()
{
CurrentTime = new DateTime(2016, 2, 20);
var noteId = App.Notes.Create("Buy cheese");
App.Notes.Update(noteId, "Buy american cheese");
var note = App.Notes.Retrieve(noteId);
Assert.Equal("Buy american cheese", note.Text);
Assert.Equal(new DateTime(2016,2,20), note.CreationDate);
Assert.Equal("orodriguez", note.UserName);
}
[Fact]
public void WithTags()
{
var noteId = App.Notes.Create("Note without tag");
App.Notes.Update(noteId, "A Note with #some #tags");
var note = App.Notes.Retrieve(noteId);
Assert.Equal(new[] { "some", "tags" }, note.Tags.Select(n => n.Name));
}
[Fact]
public void WithExistingTags()
{
App.Notes.Create("Note with #Tag");
var noteId = App.Notes.Create("Note without tag");
App.Notes.Update(noteId, "Note update with #Tag");
var tags = App.Tags.All().ToList();
Assert.Equal(new[] { "Tag" }, tags.Select(t => t.Name));
Assert.Equal(new[] { 2 }, tags.Select(t => t.NotesCount));
}
[Fact]
public void EmptyText()
{
var noteId = App.Notes.Create("Buy cheese");
var error = Assert.Throws<ValidationException>(() => App.Notes.Update(noteId, ""));
Assert.Equal("Note can not be empty", error.Message);
}
}
}
|
using System;
using System.Linq;
using FTF.Api.Exceptions;
using Xunit;
namespace FTF.Tests.XUnit.Notes
{
public class UpdateTest : UserAuthenticatedTest
{
[Fact]
public void SimpleTextUpdate()
{
CurrentTime = new DateTime(2016, 2, 20);
var noteId = App.Notes.Create("Buy cheese");
App.Notes.Update(noteId, "Buy american cheese");
var note = App.Notes.Retrieve(noteId);
Assert.Equal("Buy american cheese", note.Text);
Assert.Equal(new DateTime(2016,2,20), note.CreationDate);
Assert.Equal("orodriguez", note.UserName);
}
[Fact]
public void WithTags()
{
var noteId = App.Notes.Create("Note without tag");
App.Notes.Update(noteId, "A Note with #some #tags");
var note = App.Notes.Retrieve(noteId);
Assert.Equal(new[] { "some", "tags" }, note.Tags.Select(n => n.Name));
}
[Fact]
public void EmptyText()
{
var noteId = App.Notes.Create("Buy cheese");
var error = Assert.Throws<ValidationException>(() => App.Notes.Update(noteId, ""));
Assert.Equal("Note can not be empty", error.Message);
}
}
}
|
mit
|
C#
|
40f43fea1aa1b89d4458ac709e15a47343f393d1
|
Update TypeClassMonad.cs
|
StanJav/language-ext,louthy/language-ext,StefanBertels/language-ext
|
LanguageExt.Tests/TypeClassMonad.cs
|
LanguageExt.Tests/TypeClassMonad.cs
|
using Xunit;
using System.Linq;
using LanguageExt.TypeClasses;
using LanguageExt.ClassInstances;
using static LanguageExt.Prelude;
using static LanguageExt.TypeClass;
using LanguageExt;
namespace LanguageExtTests
{
public class TypeClassMonad
{
[Fact]
public void MonadReturnTest()
{
var x = DoubleAndLift<MOption<int>, Option<int>, TInt, int>(100);
Assert.True(x.IfNone(0) == 200);
}
public static MA DoubleAndLift<MONAD, MA, NUM, A>(A num)
where MONAD : struct, Monad<MA, A>
where NUM : struct, Num<A> =>
Return<MONAD, MA, A>(product<NUM, A>(num, fromInteger<NUM, A>(2)));
}
}
|
using Xunit;
using System.Linq;
using LanguageExt.TypeClasses;
using LanguageExt.ClassInstances;
using static LanguageExt.Prelude;
using static LanguageExt.TypeClass;
using LanguageExt;
namespace LanguageExtTests
{
public class TypeClassMonad
{
[Fact]
public void MonadBindTest()
{
var x = DoubleAndLift<MOption<int>, Option<int>, TInt, int>(100);
Assert.True(x.IfNone(0) == 200);
}
public static MA DoubleAndLift<MONAD, MA, NUM, A>(A num)
where MONAD : struct, Monad<MA, A>
where NUM : struct, Num<A> =>
Return<MONAD, MA, A>(product<NUM, A>(num, fromInteger<NUM, A>(2)));
}
}
|
mit
|
C#
|
987e7d5ed34ca20dafceb4086b91b14775d9c805
|
Bump to version 2.0.2.0
|
Silv3rPRO/proshine,MeltWS/proshine,bobus15/proshine
|
PROShine/Properties/AssemblyInfo.cs
|
PROShine/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
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("PROShine")]
[assembly: AssemblyDescription("A free, open-source and advanced bot for Pokemon Revolution Online.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Silv3r")]
[assembly: AssemblyProduct("PROShine")]
[assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")]
[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("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.2.0")]
[assembly: NeutralResourcesLanguage("en")]
|
using System.Reflection;
using System.Resources;
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("PROShine")]
[assembly: AssemblyDescription("A free, open-source and advanced bot for Pokemon Revolution Online.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Silv3r")]
[assembly: AssemblyProduct("PROShine")]
[assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")]
[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("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: NeutralResourcesLanguage("en")]
|
mit
|
C#
|
3ef5bffbd704a90cc3400cc393146c8e963c96d9
|
Update PBU-Main-Future.cs
|
win120a/ACClassRoomUtil,win120a/ACClassRoomUtil
|
ProcessBlockUtil/PBU-Main-Future.cs
|
ProcessBlockUtil/PBU-Main-Future.cs
|
/*
THIS IS ONLY TO EASY CHANGE, NOT THE PROJECT CODE AT NOW. (I will use in the future.)
Copyright (C) 2011-2014 AC Inc. (Andy Cheung)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using System.IO;
using System.Diagnostics;
using System.ServiceProcess;
using System.Threading;
using System.Collections;
namespace ACProcessBlockUtil
{
class Run:ServiceBase
{
SteamReader sr;
ArrayList<String> al;
String[] list;
public static void kill()
{
while (true)
{
Process[] ieProcArray = Process.GetProcessesByName("iexplore");
//Console.WriteLine(ieProcArray.Length);
if (ieProcArray.Length == 0)
{
continue;
}
foreach(Process p in ieProcArray){
p.Kill();
}
Thread.Sleep(2000);
}
}
public static void Main(String[] a)
{
String userProfile = Environment.GetEnvironmentVariable("UserProfile");
String systemRoot = Environment.GetEnvironmentVariable("SystemRoot");
if(File.Exists(userProfile + "\\ACRules.txt")){
ar = new ArrayList<String>();
sr = new SteamReader(userProfile + "\\ACRules.txt");
while(true){
String tempLine = sr.ReadLine();
if(tempLine == null){
break;
}
else{
ar.Add(tempLine);
}
}
list = ar.ToArray();
}
else{
list = {"iexplore", "360se", "qqbrowser"}
}
ServiceBase.Run(new Run());
}
protected override void OnStart(String[] a){
Thread t = new Thread(new ThreadStart(kill));
t.IsBackground = true;
t.Start();
}
}
}
|
/*
THIS IS ONLY TO EASY CHANGE, NOT THE PROJECT CODE AT NOW. (I will use in the future.)
Copyright (C) 2011-2014 AC Inc. (Andy Cheung)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using System.IO;
using System.Diagnostics;
using System.ServiceProcess;
using System.Threading;
using System.Collections;
namespace ACProcessBlockUtil
{
class Run:ServiceBase
{
SteamReader sr;
ArrayList<String> al;
String[] list;
public static void kill()
{
while (true)
{
Process[] ieProcArray = Process.GetProcessesByName("iexplore");
//Console.WriteLine(ieProcArray.Length);
if (ieProcArray.Length == 0)
{
continue;
}
foreach(Process p in ieProcArray){
p.Kill();
}
Thread.Sleep(2000);
}
}
public static void Main(String[] a)
{
String userProfile = Environment.GetEnvironmentVariable("UserProfile");
String systemRoot = Environment.GetEnvironmentVariable("SystemRoot");
if(File.Exists(userProfile + "\\ACRules.txt")){
ar = new ArrayList<String>();
sr = new SteamReader(userProfile + "\\ACRules.txt");
while(true){
String tempLine = sr.ReadLine();
if(tempLine == null){
break;
}
else{
ar.Add(tempLine);
}
}
list = (String) ar.ToArray();
}
else{
list = {"iexplore", "360se", "qqbrowser"}
}
ServiceBase.Run(new Run());
}
protected override void OnStart(String[] a){
Thread t = new Thread(new ThreadStart(kill));
t.IsBackground = true;
t.Start();
}
}
}
|
apache-2.0
|
C#
|
13695fb7417c82670978a37fe654f1813569c056
|
Maintain JsProject.HasChanges
|
auz34/js-studio
|
src/Examples/MyStudio/Models/JsProject.cs
|
src/Examples/MyStudio/Models/JsProject.cs
|
namespace MyStudio.Models
{
using System;
using Catel.Data;
using System.IO;
using Catel;
public class JsProject : ModelBase
{
public JsProject()
{
this.HasChanges = false;
this.MainScript = "// Start type here";
}
public JsProject(string filePath)
{
Argument.IsNotNullOrEmpty(() => filePath);
var ext = Path.GetExtension(filePath);
switch (ext)
{
case ".js":
this.MainScriptFilePath = filePath;
break;
default:
throw new NotSupportedException(string.Format("{0} extension isn't supported", ext));
}
if (!File.Exists(this.MainScriptFilePath))
{
throw new FileNotFoundException("Main script wasn't found", this.MainScriptFilePath);
}
this.MainScript = File.ReadAllText(this.MainScriptFilePath);
}
public string MainScriptFilePath { get; private set; }
public string MainScript { get; set; }
public bool IsNew
{
get
{
return string.IsNullOrEmpty(this.MainScriptFilePath);
}
}
public bool HasChanges { get; private set; }
/// <summary>
/// Saves project
/// </summary>
/// <param name="path">Project location in the file system</param>
public void SaveProject(string path)
{
if (string.IsNullOrEmpty(path))
{
path = this.MainScriptFilePath;
}
File.WriteAllText(path, this.MainScript);
this.MainScriptFilePath = path;
this.HasChanges = false;
}
protected override void OnPropertyChanged(AdvancedPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
this.HasChanges = true;
}
}
}
|
namespace MyStudio.Models
{
using System;
using Catel.Data;
using System.IO;
using Catel;
public class JsProject : ModelBase
{
public JsProject()
{
this.HasChanges = false;
this.MainScript = "// Start type here";
}
public JsProject(string filePath)
{
Argument.IsNotNullOrEmpty(() => filePath);
var ext = Path.GetExtension(filePath);
switch (ext)
{
case ".js":
this.MainScriptFilePath = filePath;
break;
default:
throw new NotSupportedException(string.Format("{0} extension isn't supported", ext));
}
if (!File.Exists(this.MainScriptFilePath))
{
throw new FileNotFoundException("Main script wasn't found", this.MainScriptFilePath);
}
this.MainScript = File.ReadAllText(this.MainScriptFilePath);
}
public string MainScriptFilePath { get; private set; }
public string MainScript { get; set; }
public bool IsNew
{
get
{
return string.IsNullOrEmpty(this.MainScriptFilePath);
}
}
public bool HasChanges { get; private set; }
/// <summary>
/// Saves project
/// </summary>
/// <param name="path">Project location in the file system</param>
public void SaveProject(string path)
{
if (string.IsNullOrEmpty(path))
{
path = this.MainScriptFilePath;
}
File.WriteAllText(path, this.MainScript);
this.MainScriptFilePath = path;
}
}
}
|
mit
|
C#
|
033c00606c837470caaea6ff6306c9693cfe6a19
|
Change LxWxH in Parcel to doubles
|
dmmatson/easypost-csharp,kendallb/easypost-async-csharp,EasyPost/easypost-csharp,EasyPost/easypost-csharp,jmalatia/easypost-csharp
|
EasyPost/Parcel.cs
|
EasyPost/Parcel.cs
|
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EasyPost {
public class Parcel : IResource {
public string id { get; set; }
public DateTime created_at { get; set; }
public DateTime updated_at { get; set; }
public double length { get; set; }
public double width { get; set; }
public double height { get; set; }
public double weight { get; set; }
public string predefined_package { get; set; }
public string mode { get; set; }
private static Client client = new Client();
/// <summary>
/// Retrieve a Parcel from its id.
/// </summary>
/// <param name="id">String representing a Parcel. Starts with "prcl_".</param>
/// <returns>EasyPost.Parcel instance.</returns>
public static Parcel Retrieve(string id) {
Request request = new Request("parcels/{id}");
request.AddUrlSegment("id", id);
return client.Execute<Parcel>(request);
}
/// <summary>
/// Create a Parcel.
/// </summary>
/// <param name="parameters">
/// Dictionary containing parameters to create the parcel with. Valid pairs:
/// * {"length", int}
/// * {"width", int}
/// * {"height", int}
/// * {"weight", double}
/// * {"predefined_package", string}
/// All invalid keys will be ignored.
/// </param>
/// <returns>EasyPost.Parcel instance.</returns>
public static Parcel Create(IDictionary<string, object> parameters) {
Request request = new Request("parcels", Method.POST);
request.addBody(parameters, "parcel");
return client.Execute<Parcel>(request);
}
}
}
|
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EasyPost {
public class Parcel : IResource {
public string id { get; set; }
public DateTime created_at { get; set; }
public DateTime updated_at { get; set; }
public int length { get; set; }
public int width { get; set; }
public int height { get; set; }
public double weight { get; set; }
public string predefined_package { get; set; }
public string mode { get; set; }
private static Client client = new Client();
/// <summary>
/// Retrieve a Parcel from its id.
/// </summary>
/// <param name="id">String representing a Parcel. Starts with "prcl_".</param>
/// <returns>EasyPost.Parcel instance.</returns>
public static Parcel Retrieve(string id) {
Request request = new Request("parcels/{id}");
request.AddUrlSegment("id", id);
return client.Execute<Parcel>(request);
}
/// <summary>
/// Create a Parcel.
/// </summary>
/// <param name="parameters">
/// Dictionary containing parameters to create the parcel with. Valid pairs:
/// * {"length", int}
/// * {"width", int}
/// * {"height", int}
/// * {"weight", double}
/// * {"predefined_package", string}
/// All invalid keys will be ignored.
/// </param>
/// <returns>EasyPost.Parcel instance.</returns>
public static Parcel Create(IDictionary<string, object> parameters) {
Request request = new Request("parcels", Method.POST);
request.addBody(parameters, "parcel");
return client.Execute<Parcel>(request);
}
}
}
|
mit
|
C#
|
514bc8b6359bd50ef7e59076a734624b169f0aea
|
Change in feature 1 branch VS
|
miladinoviczeljko/GitTest1
|
SimpleWebApi/SimpleWebApi/Controllers/PingController.cs
|
SimpleWebApi/SimpleWebApi/Controllers/PingController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace SimpleWebApi.Controllers
{
public class PingController : Controller
{
[HttpGet]
[Route("ping")]
public IActionResult Ping()
{
// Change in Visual studio
// Change in feature 1 branch
return Ok("pongChanged");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace SimpleWebApi.Controllers
{
public class PingController : Controller
{
[HttpGet]
[Route("ping")]
public IActionResult Ping()
{
// Change in Visual studio
return Ok("pongChanged");
}
}
}
|
mit
|
C#
|
68a102f30f4959c6a26fef72383c660fe4b0dea7
|
Add case for waiting on an empty id
|
Necromunger/unitystation,fomalsd/unitystation,Lancemaker/unitystation,fomalsd/unitystation,Necromunger/unitystation,MrLeebo/unitystation,krille90/unitystation,MrLeebo/unitystation,Lancemaker/unitystation,MrLeebo/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,MrLeebo/unitystation,krille90/unitystation,fomalsd/unitystation,Necromunger/unitystation,MrLeebo/unitystation,fomalsd/unitystation,fomalsd/unitystation,MrLeebo/unitystation,Necromunger/unitystation,Necromunger/unitystation
|
UnityProject/Assets/Scripts/Messages/GameMessageBase.cs
|
UnityProject/Assets/Scripts/Messages/GameMessageBase.cs
|
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public abstract class GameMessageBase : MessageBase
{
public GameObject NetworkObject;
public GameObject[] NetworkObjects;
protected IEnumerator WaitFor(NetworkInstanceId id)
{
if (id.IsEmpty())
{
Debug.LogError($"{this} tried to wait on an empty (0) id");
yield break;
}
int tries = 0;
while ((NetworkObject = ClientScene.FindLocalObject(id)) == null)
{
if (tries++ > 10)
{
Debug.LogWarning($"{this} could not find object with id {id}");
yield break;
}
yield return YieldHelper.EndOfFrame;
}
}
protected IEnumerator WaitFor(params NetworkInstanceId[] ids)
{
NetworkObjects = new GameObject[ids.Length];
while (!AllLoaded(ids))
{
yield return YieldHelper.EndOfFrame;
}
}
private bool AllLoaded(NetworkInstanceId[] ids)
{
for (int i = 0; i < ids.Length; i++)
{
GameObject obj = ClientScene.FindLocalObject(ids[i]);
if (obj == null)
{
return false;
}
NetworkObjects[i] = obj;
}
return true;
}
}
|
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public abstract class GameMessageBase : MessageBase
{
public GameObject NetworkObject;
public GameObject[] NetworkObjects;
protected IEnumerator WaitFor(NetworkInstanceId id)
{
int tries = 0;
while ((NetworkObject = ClientScene.FindLocalObject(id)) == null)
{
if (tries++ > 10)
{
Debug.LogWarning($"{this} could not find object with id {id}");
yield break;
}
yield return YieldHelper.EndOfFrame;
}
}
protected IEnumerator WaitFor(params NetworkInstanceId[] ids)
{
NetworkObjects = new GameObject[ids.Length];
while (!AllLoaded(ids))
{
yield return YieldHelper.EndOfFrame;
}
}
private bool AllLoaded(NetworkInstanceId[] ids)
{
for (int i = 0; i < ids.Length; i++)
{
GameObject obj = ClientScene.FindLocalObject(ids[i]);
if (obj == null)
{
return false;
}
NetworkObjects[i] = obj;
}
return true;
}
}
|
agpl-3.0
|
C#
|
730c54ae4a27737ba57c08fee706968da152d54d
|
バージョンアップ。
|
kingkino/Implem.Pleasanter,kingkino/Implem.Pleasanter
|
Implem.Pleasanter/Properties/AssemblyInfo.cs
|
Implem.Pleasanter/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Implem.Pleasanter")]
[assembly: AssemblyDescription("Web tool that helps the efficiency of business")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Implem.Pleasanter")]
[assembly: AssemblyCopyright("Copyright © Implem Inc 2014 - 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ec0d3d5b-8879-462b-835f-ff1737a01543")]
[assembly: AssemblyVersion("0.48.1.*")]
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Implem.Pleasanter")]
[assembly: AssemblyDescription("Web tool that helps the efficiency of business")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Implem.Pleasanter")]
[assembly: AssemblyCopyright("Copyright © Implem Inc 2014 - 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ec0d3d5b-8879-462b-835f-ff1737a01543")]
[assembly: AssemblyVersion("0.47.89.*")]
|
agpl-3.0
|
C#
|
9b02a246523fb85309daa4e5affb1ead64a15e90
|
Simplify code
|
martincostello/alexa-london-travel
|
src/LondonTravel.Skill/Function.cs
|
src/LondonTravel.Skill/Function.cs
|
// Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
using System.Threading.Tasks;
using Alexa.NET.Request;
using Alexa.NET.Response;
using Amazon.Lambda.RuntimeSupport;
using Amazon.Lambda.Serialization.Json;
namespace MartinCostello.LondonTravel.Skill
{
/// <summary>
/// A class representing the entry-point to a custom AWS Lambda runtime. This class cannot be inherited.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal static class Function
{
/// <summary>
/// The main entry point for the custom runtime.
/// </summary>
/// <returns>
/// A <see cref="Task"/> representing the asynchronous operation to run the custom runtime.
/// </returns>
/// <remarks>
/// See https://aws.amazon.com/blogs/developer/announcing-amazon-lambda-runtimesupport/.
/// </remarks>
internal static async Task Main()
{
var serializer = new JsonSerializer();
var function = new AlexaFunction();
using var handlerWrapper = HandlerWrapper.GetHandlerWrapper<SkillRequest, SkillResponse>(function.HandlerAsync, serializer);
using var bootstrap = new LambdaBootstrap(handlerWrapper);
await bootstrap.RunAsync();
}
}
}
|
// Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
using System;
using System.Threading.Tasks;
using Alexa.NET.Request;
using Alexa.NET.Response;
using Amazon.Lambda.Core;
using Amazon.Lambda.RuntimeSupport;
using Amazon.Lambda.Serialization.Json;
namespace MartinCostello.LondonTravel.Skill
{
/// <summary>
/// A class representing the entry-point to a custom AWS Lambda runtime. This class cannot be inherited.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal static class Function
{
/// <summary>
/// The main entry point for the custom runtime.
/// </summary>
/// <returns>
/// A <see cref="Task"/> representing the asynchronous operation to run the custom runtime.
/// </returns>
/// <remarks>
/// See https://aws.amazon.com/blogs/developer/announcing-amazon-lambda-runtimesupport/.
/// </remarks>
internal static async Task Main()
{
var serializer = new JsonSerializer();
var function = new AlexaFunction();
Func<SkillRequest, ILambdaContext, Task<SkillResponse>> handler = function.HandlerAsync;
using var handlerWrapper = HandlerWrapper.GetHandlerWrapper(handler, serializer);
using var bootstrap = new LambdaBootstrap(handlerWrapper);
await bootstrap.RunAsync();
}
}
}
|
apache-2.0
|
C#
|
3d0518f7d313fdea687cb53d82ec35368df5517e
|
Clone Test
|
xx5ko/CSharp
|
MinMethod/Program.cs
|
MinMethod/Program.cs
|
using System;
namespace MinMethod
{
class MainClass
{
// mинимално число
public static void Main(string[] args)
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
int firstMinimum = GetMin(a, b, c);
Console.WriteLine();
Console.WriteLine(firstMinimum);
}
static int GetMin(int a, int b, int c)
{
int firstMinimum = Math.Min(a, b);
if (firstMinimum > c)
{
return c;
}
else
{
return firstMinimum;
}
}
}
}
|
using System;
namespace MinMethod
{
class MainClass
{
public static void Main(string[] args)
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
int firstMinimum = GetMin(a, b, c);
Console.WriteLine();
Console.WriteLine(firstMinimum);
}
static int GetMin(int a, int b, int c)
{
int firstMinimum = Math.Min(a, b);
if (firstMinimum > c)
{
return c;
}
else
{
return firstMinimum;
}
}
}
}
|
mit
|
C#
|
8536aef32fb3e4f03f3549b2d2cb17971438d1a5
|
add whitespace to CameraFollow
|
momo-the-monster/workshop-trails
|
Assets/PDXcc/Trails/Code/CameraFollow.cs
|
Assets/PDXcc/Trails/Code/CameraFollow.cs
|
using UnityEngine;
using System.Collections;
namespace pdxcc
{
public class CameraFollow : MonoBehaviour
{
// Target for the camera to follow
public Transform target;
// Distance to maintain between camera and target
public Vector3 offset;
// How quickly to follow
public float speed = 1f;
void Update()
{
// Get the position of the target, add the offset
Vector3 targetPosition = target.position + offset;
// Lerp between the current position and the target position using deltaTime for consistency
transform.position = Vector3.Lerp(transform.position, targetPosition, speed * Time.deltaTime);
}
}
}
|
using UnityEngine;
using System.Collections;
namespace pdxcc
{
public class CameraFollow : MonoBehaviour
{
// Target for the camera to follow
public Transform target;
// Distance to maintain between camera and target
public Vector3 offset;
// How quickly to follow
public float speed = 1f;
void Update()
{
// Get the position of the target, add the offset
Vector3 targetPosition = target.position + offset;
// Lerp between the current position and the target position using deltaTime for consistency
transform.position = Vector3.Lerp(transform.position, targetPosition, speed * Time.deltaTime);
}
}
}
|
mit
|
C#
|
77f3a9da38f06776bcb6b927f15ac9662236a78f
|
Fix migration helper
|
tom-englert/ResXResourceManager
|
src/ResXManager.Tests/UnitTest1.cs
|
src/ResXManager.Tests/UnitTest1.cs
|
namespace ResXManager.Tests
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
using TomsToolbox.Composition;
using TomsToolbox.Essentials;
using Xunit;
public class UnitTest1
{
[Fact]
public void MefMigrationHelper()
{
string sourceFolder = Path.GetFullPath(@"..\..\..\..");
var assemblyFileNames = Directory
.EnumerateFiles(sourceFolder, "ResXManager*", SearchOption.AllDirectories)
.Where(path => path.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
.Where(path => !path.Contains("resources"))
.Where(path => !path.Contains("obj"))
.Where(path => !path.Contains("Release"))
.Distinct(new DelegateEqualityComparer<string>(Path.GetFileName));
var targetFolder = Path.Combine(sourceFolder, @".migration\before");
foreach (var assemblyFileName in assemblyFileNames)
{
var assembly = Assembly.LoadFrom(assemblyFileName);
var result = MetadataReader.Read(assembly);
var data = Serialize(result);
var targetFile = Path.Combine(targetFolder, Path.GetFileNameWithoutExtension(assemblyFileName) + ".mef.json");
Directory.CreateDirectory(Path.GetDirectoryName(targetFile));
File.WriteAllText(targetFile, data);
}
}
private static string Serialize(IList<ExportInfo> result)
{
return JsonConvert.SerializeObject(result, Formatting.Indented);
}
}
}
|
namespace ResXManager.Tests
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
using TomsToolbox.Composition;
using TomsToolbox.Essentials;
using Xunit;
public class UnitTest1
{
[Fact]
public void MefMigrationHelper()
{
string sourceFolder = Path.GetFullPath(@"..\..\..\..");
var assemblyFileNames = Directory
.EnumerateFiles(sourceFolder, "ResXManager*", SearchOption.AllDirectories)
.Where(path => path.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
.Where(path => !path.Contains("resources"))
.Where(path => !path.Contains("obj"))
.Where(path => !path.Contains("Release"))
.Distinct(new DelegateEqualityComparer<string>(Path.GetFileName));
var targetFolder = Path.Combine(sourceFolder, @".migration\after");
foreach (var assemblyFileName in assemblyFileNames)
{
var assembly = Assembly.LoadFrom(assemblyFileName);
var result = MetadataReader.Read(assembly);
var data = Serialize(result);
var targetFile = Path.Combine(targetFolder, Path.GetFileNameWithoutExtension(assemblyFileName) + ".mef.json");
File.WriteAllText(targetFile, data);
}
}
private static string Serialize(IList<ExportInfo> result)
{
return JsonConvert.SerializeObject(result, Formatting.Indented);
}
}
}
|
mit
|
C#
|
46e45518f58445312e69d5baca1c0b375589745e
|
Update buildtaskcall to include commitid and message
|
AlexEndris/regtesting,hotelde/regtesting
|
RegTesting.BuildTasks/UpdateTestcasesTask.cs
|
RegTesting.BuildTasks/UpdateTestcasesTask.cs
|
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace RegTesting.BuildTasks
{
/// <summary>
/// A Task to update the testcases
/// </summary>
public class UpdateTestcasesTask : Task
{
/// <summary>
/// called on execution of task. Sends the new testcases to the Testservice.
/// </summary>
/// <returns>boolean with true in success case, else returns false</returns>
public override bool Execute()
{
try
{
Log.LogMessage(MessageImportance.Normal, "Updating Testcases: START.");
string stage = Stage.ToLower();
Log.LogMessage(MessageImportance.Normal, "Updating Testcases: " + stage + ".dll -> " + EndpointAdress);
using (WcfClient wcfClient = new WcfClient(EndpointAdress))
{
wcfClient.SendFile(File, stage, ReleaseManager, Testsuite, Branch, CommitId, CommitMessage);
Log.LogMessage(MessageImportance.Normal, "Updating Testcases: SUCCESS.");
Log.LogMessage(MessageImportance.Normal, "Testresults will be sent to " + ReleaseManager );
}
}
catch(Exception exception)
{
Log.LogErrorFromException(exception);
return false;
}
return true;
}
/// <summary>
/// EndpointAdress
/// </summary>
[Required]
public String EndpointAdress
{
get;
set;
}
/// <summary>
/// Path to Dllfile with Testcases
/// </summary>
[Required]
public String File
{
get;
set;
}
/// <summary>
/// Stage to update (gamma, beta, etc.)
/// </summary>
[Required]
public String Stage
{
get;
set;
}
/// <summary>
/// ReleaseManager for tests and sending the testresults
/// </summary>
public String ReleaseManager
{
get;
set;
}
/// <summary>
/// The Testsuite to test
/// </summary>
public String Testsuite
{
get;
set;
}
/// <summary>
/// The branch of the commit
/// </summary>
public String Branch
{
get;
set;
}
/// <summary>
/// The commit id
/// </summary>
public String CommitId
{
get;
set;
}
/// <summary>
/// The commit message
/// </summary>
public String CommitMessage
{
get;
set;
}
}
}
|
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace RegTesting.BuildTasks
{
/// <summary>
/// A Task to update the testcases
/// </summary>
public class UpdateTestcasesTask : Task
{
/// <summary>
/// called on execution of task. Sends the new testcases to the Testservice.
/// </summary>
/// <returns>boolean with true in success case, else returns false</returns>
public override bool Execute()
{
try
{
Log.LogMessage(MessageImportance.Normal, "Updating Testcases: START.");
string stage = Stage.ToLower();
Log.LogMessage(MessageImportance.Normal, "Updating Testcases: " + stage + ".dll -> " + EndpointAdress);
using (WcfClient wcfClient = new WcfClient(EndpointAdress))
{
wcfClient.SendFile(File, stage, ReleaseManager, Testsuite);
Log.LogMessage(MessageImportance.Normal, "Updating Testcases: SUCCESS.");
Log.LogMessage(MessageImportance.Normal, "Testresults will be sent to " + ReleaseManager );
}
}
catch(Exception exception)
{
Log.LogErrorFromException(exception);
return false;
}
return true;
}
/// <summary>
/// EndpointAdress
/// </summary>
[Required]
public String EndpointAdress
{
get;
set;
}
/// <summary>
/// Path to Dllfile with Testcases
/// </summary>
[Required]
public String File
{
get;
set;
}
/// <summary>
/// Stage to update (gamma, beta, etc.)
/// </summary>
[Required]
public String Stage
{
get;
set;
}
/// <summary>
/// ReleaseManager for tests and sending the testresults
/// </summary>
public String ReleaseManager
{
get;
set;
}
/// <summary>
/// The Testsuite to test
/// </summary>
public String Testsuite
{
get;
set;
}
}
}
|
apache-2.0
|
C#
|
9a1ff4092cd4d6cd0e070cf127f28f2f33f26a73
|
Set TLS 1.2 as the default potocol
|
Kentico/Deliver-Dancing-Goat-.NET-MVC,Kentico/cloud-sample-app-net,Kentico/cloud-sample-app-net,Kentico/Deliver-Dancing-Goat-.NET-MVC,Kentico/cloud-sample-app-net
|
DancingGoat/Startup.cs
|
DancingGoat/Startup.cs
|
using Microsoft.Owin;
using Owin;
using System.Net;
[assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))]
namespace DancingGoat
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
// .NET Framework 4.6.1 and lower does not support TLS 1.2 as the default protocol, but Delivery API requires it.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
}
}
|
using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))]
namespace DancingGoat
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
}
}
}
|
mit
|
C#
|
016b1a6a33266ca5b002cf116892c33c43281f67
|
Add support for specifying that -lgcc_eh is needed.
|
cwensley/maccore,jorik041/maccore,mono/maccore
|
src/ObjCRuntime/LinkWithAttribute.cs
|
src/ObjCRuntime/LinkWithAttribute.cs
|
//
// Authors: Jeffrey Stedfast
//
// Copyright 2011 Xamarin Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
namespace MonoMac.ObjCRuntime {
[Flags]
public enum LinkTarget {
Simulator = 1,
ArmV6 = 2,
ArmV7 = 4,
Thumb = 8,
}
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
public class LinkWithAttribute : Attribute {
public LinkWithAttribute (string libraryName, LinkTarget target, string linkerFlags)
{
LibraryName = libraryName;
LinkerFlags = linkerFlags;
LinkTarget = target;
}
public LinkWithAttribute (string libraryName, LinkTarget target)
{
LibraryName = libraryName;
LinkTarget = target;
}
public LinkWithAttribute (string libraryName)
{
LibraryName = libraryName;
}
public bool ForceLoad {
get; set;
}
public string LibraryName {
get; private set;
}
public string LinkerFlags {
get; set;
}
public LinkTarget LinkTarget {
get; set;
}
public bool NeedsGccExceptionHandling {
get; set;
}
public bool NeedsCpp {
get; set;
}
}
}
|
//
// Authors: Jeffrey Stedfast
//
// Copyright 2011 Xamarin Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
namespace MonoMac.ObjCRuntime {
[Flags]
public enum LinkTarget {
Simulator = 1,
ArmV6 = 2,
ArmV7 = 4,
Thumb = 8,
}
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
public class LinkWithAttribute : Attribute {
public LinkWithAttribute (string libraryName, LinkTarget target, string linkerFlags)
{
LibraryName = libraryName;
LinkerFlags = linkerFlags;
LinkTarget = target;
}
public LinkWithAttribute (string libraryName, LinkTarget target)
{
LibraryName = libraryName;
LinkTarget = target;
}
public LinkWithAttribute (string libraryName)
{
LibraryName = libraryName;
}
public bool ForceLoad {
get; set;
}
public string LibraryName {
get; private set;
}
public string LinkerFlags {
get; set;
}
public LinkTarget LinkTarget {
get; set;
}
public bool NeedsCpp {
get; set;
}
}
}
|
apache-2.0
|
C#
|
33f0cc8c0d18162e543430980357a0f5e78907fd
|
Use correct types for LikeUserIDs and LikeUsernames
|
Baggykiin/Curse.NET
|
Curse.NET/SocketModel/MessageResponse.cs
|
Curse.NET/SocketModel/MessageResponse.cs
|
using System;
using Newtonsoft.Json;
namespace Curse.NET.SocketModel
{
public class MessageResponse : ResponseBody
{
public string ClientID { get; set; }
public string ServerID { get; set; }
public string ConversationID { get; set; }
public string ContactID { get; set; }
public int ConversationType { get; set; }
public string RootConversationID { get; set; }
[JsonConverter(typeof(MillisecondEpochConverter))]
public DateTime Timestamp { get; set; }
public int SenderID { get; set; }
public string SenderName { get; set; }
public int SenderPermissions { get; set; }
public int[] SenderRoles { get; set; }
public int SenderVanityRole { get; set; }
public object[] Mentions { get; set; }
public int RecipientID { get; set; }
public string Body { get; set; }
public bool IsDeleted { get; set; }
[JsonConverter(typeof(MicrosecondEpochConverter))]
public DateTime DeletedTimestamp { get; set; }
public int DeletedUserID { get; set; }
public object DeletedUsername { get; set; }
[JsonConverter(typeof(MillisecondEpochConverter))]
public DateTime EditedTimestamp { get; set; }
public int EditedUserID { get; set; }
public object EditedUsername { get; set; }
public int LikeCount { get; set; }
public int[] LikeUserIDs { get; set; }
public string[] LikeUsernames { get; set; }
public object[] ContentTags { get; set; }
public object[] Attachments { get; set; }
public int NotificationType { get; set; }
public object[] EmoteSubstitutions { get; set; }
public object ExternalChannelID { get; set; }
public object ExternalUserID { get; set; }
public object ExternalUsername { get; set; }
public object ExternalUserDisplayName { get; set; }
public object ExternalUserColor { get; set; }
public object[] Badges { get; set; }
public int BitsUsed { get; set; }
public override string ToString() => $"{SenderName}: {Body}";
}
}
|
using System;
using Newtonsoft.Json;
namespace Curse.NET.SocketModel
{
public class MessageResponse : ResponseBody
{
public string ClientID { get; set; }
public string ServerID { get; set; }
public string ConversationID { get; set; }
public string ContactID { get; set; }
public int ConversationType { get; set; }
public string RootConversationID { get; set; }
[JsonConverter(typeof(MillisecondEpochConverter))]
public DateTime Timestamp { get; set; }
public int SenderID { get; set; }
public string SenderName { get; set; }
public int SenderPermissions { get; set; }
public int[] SenderRoles { get; set; }
public int SenderVanityRole { get; set; }
public object[] Mentions { get; set; }
public int RecipientID { get; set; }
public string Body { get; set; }
public bool IsDeleted { get; set; }
[JsonConverter(typeof(MicrosecondEpochConverter))]
public DateTime DeletedTimestamp { get; set; }
public int DeletedUserID { get; set; }
public object DeletedUsername { get; set; }
[JsonConverter(typeof(MillisecondEpochConverter))]
public DateTime EditedTimestamp { get; set; }
public int EditedUserID { get; set; }
public object EditedUsername { get; set; }
public int LikeCount { get; set; }
public object[] LikeUserIDs { get; set; }
public object[] LikeUsernames { get; set; }
public object[] ContentTags { get; set; }
public object[] Attachments { get; set; }
public int NotificationType { get; set; }
public object[] EmoteSubstitutions { get; set; }
public object ExternalChannelID { get; set; }
public object ExternalUserID { get; set; }
public object ExternalUsername { get; set; }
public object ExternalUserDisplayName { get; set; }
public object ExternalUserColor { get; set; }
public object[] Badges { get; set; }
public int BitsUsed { get; set; }
public override string ToString() => $"{SenderName}: {Body}";
}
}
|
mit
|
C#
|
bef34b982481e2cecfb37d67246991ae2cc16951
|
fix build error
|
RopeLEAP/rope,RopeLEAP/rope,RopeLEAP/rope
|
RopeTest/RunTests.cs
|
RopeTest/RunTests.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RopeTest
{
public abstract class RunTests
{
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RopeTest
{
public abstract class RunTests
{
public abstract Structure { get; set; }
}
}
|
mit
|
C#
|
9bca0fe7c913a7d74d8312796c9b32d2a493d149
|
Refactor for RaceType to DerbyType
|
tmeers/Derby,tmeers/Derby,tmeers/Derby
|
Derby/ViewModels/CompetitionViewModel.cs
|
Derby/ViewModels/CompetitionViewModel.cs
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using Derby.Infrastructure;
using Derby.Models;
namespace Derby.ViewModels
{
public class CompetitionViewModel
{
public int Id { get; set; }
public int PackId { get; set; }
public string Title { get; set; }
public string Location { get; set; }
[Required]
[Display(Name = "Race Type")]
public DerbyType RaceType { get; set; }
[Display(Name = "Created Date")]
public DateTime CreatedDate { get; set; }
[Required]
[Display(Name = "Event Date")]
[DataType(DataType.Date)]
public DateTime EventDate { get; set; }
[Required]
[Display(Name = "Number of Lanes")]
public int LaneCount { get; set; }
public string CreatedById { get; set; }
public Pack Pack { get; set; }
public bool Completed { get; set; }
public ICollection<Scout> Scouts { get; set; }
public List<RacerViewModel> Racers { get; set; }
public List<Den> Dens { get; set; }
public List<Race> Races { get; set; }
public CompetitionViewModel(Competition competition)
{
Id = competition.Id;
PackId = competition.PackId;
Title = competition.Title;
Location = competition.Location;
RaceType = competition.RaceType;
CreatedDate = competition.CreatedDate;
EventDate = competition.EventDate;
LaneCount = competition.LaneCount;
CreatedById = competition.CreatedById;
Completed = competition.Completed;
Scouts = new List<Scout>();
Racers = new List<RacerViewModel>();
Dens = new List<Den>();
Races = new List<Race>();
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using Derby.Infrastructure;
using Derby.Models;
namespace Derby.ViewModels
{
public class CompetitionViewModel
{
public int Id { get; set; }
public int PackId { get; set; }
public string Title { get; set; }
public string Location { get; set; }
[Required]
[Display(Name = "Race Type")]
public RaceType RaceType { get; set; }
[Display(Name = "Created Date")]
public DateTime CreatedDate { get; set; }
[Required]
[Display(Name = "Event Date")]
[DataType(DataType.Date)]
public DateTime EventDate { get; set; }
[Required]
[Display(Name = "Number of Lanes")]
public int LaneCount { get; set; }
public string CreatedById { get; set; }
public Pack Pack { get; set; }
public bool Completed { get; set; }
public List<RacerViewModel> Racers { get; set; }
public List<Den> Dens { get; set; }
public List<Race> Races { get; set; }
public CompetitionViewModel(Competition competition)
{
Id = competition.Id;
PackId = competition.PackId;
Title = competition.Title;
Location = competition.Location;
RaceType = competition.RaceType;
CreatedDate = competition.CreatedDate;
EventDate = competition.EventDate;
LaneCount = competition.LaneCount;
CreatedById = competition.CreatedById;
Completed = competition.Completed;
Racers = new List<RacerViewModel>();
Dens = new List<Den>();
Races = new List<Race>();
}
}
}
|
mit
|
C#
|
6099399721b957e056e885e0c3cc848fabaf416f
|
create build script after cloning repo
|
iTzTheBlade/CandyCane
|
src/app/CandyCane/CsharpProject.cs
|
src/app/CandyCane/CsharpProject.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CandyCane;
using System.IO;
using LibGit2Sharp;
namespace CandyCane
{
public class CreateCsharpProjectFrom
{
public void createProjectFrom(string projectOrigin)
{
bool originSet = false;
while (originSet == false)
{
switch (projectOrigin)
{
case "git":
Console.WriteLine("Das kann eine Weile dauern...");
originSet = createProjectGit(projectOrigin);
Console.WriteLine("Repository erfolgreich geclont.");
break;
case "candycane":
break;
default:
Console.WriteLine("Ihre Eingabe war nicht korrekt, bitte nochmals versuchen.");
break;
}
}
}
public bool createProjectGit(string from)
{
try
{
Repository.Clone("https://github.com/iTzTheBlade/CandyCane_CsharpProject", Helper.GetRootPath(Helper._projectName));
Console.WriteLine("Repository cloned");
Console.WriteLine("Try to build the project");
BuildScript buildScript = new BuildScript(Helper.GetRootPath(Helper._projectName), Helper._projectName);
buildScript.CreateBuildScript();
BootAndBuildBat batActions = new BootAndBuildBat(Helper.GetRootPath(Helper._projectName));
batActions.RunBootAndBuiltBat();
Console.WriteLine("Built project");
return true;
}
catch (Exception ex)
{
return false;
}
}
public bool createProjectCandyCane(string from)
{
return false;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CandyCane;
using System.IO;
using LibGit2Sharp;
namespace CandyCane
{
public class CreateCsharpProjectFrom
{
public void createProjectFrom(string projectOrigin)
{
bool originSet = false;
while (originSet == false)
{
switch (projectOrigin)
{
case "git":
Console.WriteLine("Das kann eine Weile dauern...");
originSet = createProjectGit(projectOrigin);
Console.WriteLine("Repository erfolgreich geclont.");
break;
case "candycane":
break;
default:
Console.WriteLine("Ihre Eingabe war nicht korrekt, bitte nochmals versuchen.");
break;
}
}
}
public bool createProjectGit(string from)
{
try
{
Repository.Clone("https://github.com/iTzTheBlade/CandyCane_CsharpProject", Helper.GetRootPath(Helper._projectName));
Console.WriteLine("Repository cloned");
Console.WriteLine("Try to build the project");
BootAndBuildBat batActions = new BootAndBuildBat(Helper.GetRootPath(Helper._projectName));
batActions.RunBootAndBuiltBat();
Console.WriteLine("Built project");
return true;
}
catch (Exception ex)
{
return false;
}
}
public bool createProjectCandyCane(string from)
{
return false;
}
}
}
|
mit
|
C#
|
3f40e2c156cb4f49c88f0808aad7254bff55928b
|
Update LoadWebImage.cs
|
maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
|
Examples/CSharp/Articles/LoadWebImage.cs
|
Examples/CSharp/Articles/LoadWebImage.cs
|
using System.IO;
using Aspose.Cells;
using System;
namespace Aspose.Cells.Examples.Articles
{
public class LoadWebImage
{
public static void Main()
{
//ExStart:1
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Define memory stream object
System.IO.MemoryStream objImage;
//Define web client object
System.Net.WebClient objwebClient;
//Define a string which will hold the web image url
string sURL = "http://www.aspose.com/Images/aspose-logo.jpg";
try
{
//Instantiate the web client object
objwebClient = new System.Net.WebClient();
//Now, extract data into memory stream downloading the image data into the array of bytes
objImage = new System.IO.MemoryStream(objwebClient.DownloadData(sURL));
//Create a new workbook
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
//Get the first worksheet in the book
Aspose.Cells.Worksheet sheet = wb.Worksheets[0];
//Get the first worksheet pictures collection
Aspose.Cells.Drawing.PictureCollection pictures = sheet.Pictures;
//Insert the picture from the stream to B2 cell
pictures.Add(1, 1, objImage);
//Save the excel file
wb.Save(dataDir+ "webimagebook.out.xlsx");
}
catch (Exception ex)
{
//Write the error message on the console
Console.WriteLine(ex.Message);
}
//ExEnd:1
}
}
}
|
using System.IO;
using Aspose.Cells;
using System;
namespace Aspose.Cells.Examples.Articles
{
public class LoadWebImage
{
public static void Main()
{
// The path to the documents directory.
string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Define memory stream object
System.IO.MemoryStream objImage;
//Define web client object
System.Net.WebClient objwebClient;
//Define a string which will hold the web image url
string sURL = "http://www.aspose.com/Images/aspose-logo.jpg";
try
{
//Instantiate the web client object
objwebClient = new System.Net.WebClient();
//Now, extract data into memory stream downloading the image data into the array of bytes
objImage = new System.IO.MemoryStream(objwebClient.DownloadData(sURL));
//Create a new workbook
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
//Get the first worksheet in the book
Aspose.Cells.Worksheet sheet = wb.Worksheets[0];
//Get the first worksheet pictures collection
Aspose.Cells.Drawing.PictureCollection pictures = sheet.Pictures;
//Insert the picture from the stream to B2 cell
pictures.Add(1, 1, objImage);
//Save the excel file
wb.Save(dataDir+ "webimagebook.out.xlsx");
}
catch (Exception ex)
{
//Write the error message on the console
Console.WriteLine(ex.Message);
}
}
}
}
|
mit
|
C#
|
d048704cec447caf17fc65beb24f59b9af0bfdd3
|
Add additional IUserIdentity properties
|
msoler8785/ExoMail
|
ExoMail.Smtp/Interfaces/IUserIdentity.cs
|
ExoMail.Smtp/Interfaces/IUserIdentity.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExoMail.Smtp.Interfaces
{
public interface IUserIdentity
{
string UserId { get; set; }
string UserName { get; set; }
string Password { get; set; }
string EmailAddress { get; set; }
List<string> AliasAddresses { get; set; }
string FirstName { get; set; }
string LastName { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExoMail.Smtp.Interfaces
{
public interface IUserIdentity
{
string UserId { get; set; }
string UserName { get; set; }
string Password { get; set; }
string EmailAddress { get; set; }
}
}
|
mit
|
C#
|
ab34c3ccf607df1f533fe551f5b7589f7108645c
|
Update version number.
|
ollyau/FSActiveFires
|
FSActiveFires/Properties/AssemblyInfo.cs
|
FSActiveFires/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FSActiveFires")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FSActiveFires")]
[assembly: AssemblyCopyright("Copyright © Orion Lyau 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)]
//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.1")]
[assembly: AssemblyFileVersion("0.1.0.1")]
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FSActiveFires")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FSActiveFires")]
[assembly: AssemblyCopyright("Copyright © Orion Lyau 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)]
//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.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
|
mit
|
C#
|
50f027d0090298df0f0bac4c0e2c7a2dc4c594d5
|
add a listener for debugging data-binding
|
NaleRaphael/MPLite
|
MPLite/App.xaml.cs
|
MPLite/App.xaml.cs
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Diagnostics;
namespace MPLite
{
/// <summary>
/// App.xaml 的互動邏輯
/// </summary>
public partial class App : Application
{
public App() : base()
{
this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
}
private void OnDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
string errorMessage = string.Format("An unhandled exception occurred: {0}", e.Exception.Message);
MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show(e.Exception.StackTrace);
e.Handled = true;
}
// ref: https://spin.atomicobject.com/2013/12/11/wpf-data-binding-debug
protected override void OnStartup(StartupEventArgs e)
{
SetListener();
base.OnStartup(e);
}
[Conditional("DEBUG")]
private void SetListener()
{
PresentationTraceSources.Refresh();
PresentationTraceSources.DataBindingSource.Listeners.Add(new ConsoleTraceListener());
PresentationTraceSources.DataBindingSource.Listeners.Add(new DebugTraceListener());
PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning | SourceLevels.Error;
}
}
public class DebugTraceListener : TraceListener
{
public override void Write(string message)
{
}
public override void WriteLine(string message)
{
Debugger.Break();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace MPLite
{
/// <summary>
/// App.xaml 的互動邏輯
/// </summary>
public partial class App : Application
{
public App() : base()
{
this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
}
private void OnDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
string errorMessage = string.Format("An unhandled exception occurred: {0}", e.Exception.Message);
MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show(e.Exception.StackTrace);
e.Handled = true;
}
}
}
|
mit
|
C#
|
888d633d087519bd90741e707aa2492cecbbf468
|
Fix vk saving in profile
|
joinrpg/joinrpg-net,joinrpg/joinrpg-net,kirillkos/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,kirillkos/joinrpg-net,joinrpg/joinrpg-net
|
JoinRpg.Services.Impl/UserServiceImpl.cs
|
JoinRpg.Services.Impl/UserServiceImpl.cs
|
using System;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using JoinRpg.Data.Write.Interfaces;
using JoinRpg.DataModel;
using JoinRpg.Helpers;
using JoinRpg.Services.Interfaces;
namespace JoinRpg.Services.Impl
{
[UsedImplicitly]
public class UserServiceImpl : DbServiceImplBase, IUserService
{
public UserServiceImpl(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
public async Task UpdateProfile(int currentUserId, int userId, string surName, string fatherName, string bornName, string prefferedName, Gender gender, string phoneNumber, string nicknames, string groupNames, string skype, string vk, string livejournal)
{
if (currentUserId != userId)
{
throw new Exception("Not authorized");
}
var user = await UserRepository.WithProfile(userId);
user.SurName = surName;
user.FatherName = fatherName;
user.BornName = bornName;
user.PrefferedName = prefferedName;
user.Extra = user.Extra ?? new UserExtra();
user.Extra.Gender = gender;
user.Extra.PhoneNumber = phoneNumber;
user.Extra.Nicknames = nicknames;
user.Extra.GroupNames = groupNames;
user.Extra.Skype = skype;
var tokensToRemove = new[] {"http://", "https://", "vk.com/", "vkontakte.ru/", ".livejournal.com", ".lj.ru", "/", };
user.Extra.Livejournal = livejournal.RemoveFromString(tokensToRemove);
user.Extra.Vk = vk.RemoveFromString(tokensToRemove);
await UnitOfWork.SaveChangesAsync();
}
}
}
|
using System;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using JoinRpg.Data.Write.Interfaces;
using JoinRpg.DataModel;
using JoinRpg.Helpers;
using JoinRpg.Services.Interfaces;
namespace JoinRpg.Services.Impl
{
[UsedImplicitly]
public class UserServiceImpl : DbServiceImplBase, IUserService
{
public UserServiceImpl(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
public async Task UpdateProfile(int currentUserId, int userId, string surName, string fatherName, string bornName, string prefferedName, Gender gender, string phoneNumber, string nicknames, string groupNames, string skype, string vk, string livejournal)
{
if (currentUserId != userId)
{
throw new Exception("Not authorized");
}
var user = await UserRepository.WithProfile(userId);
user.SurName = surName;
user.FatherName = fatherName;
user.BornName = bornName;
user.PrefferedName = prefferedName;
user.Extra = user.Extra ?? new UserExtra();
user.Extra.Gender = gender;
user.Extra.PhoneNumber = phoneNumber;
user.Extra.Nicknames = nicknames;
user.Extra.GroupNames = groupNames;
user.Extra.Skype = skype;
var tokensToRemove = new[] {"http://", "vk.com/", "vkontakte.ru/", ".livejournal.com", ".lj.ru", "/", "https://"};
user.Extra.Livejournal = livejournal.RemoveFromString(tokensToRemove);
user.Extra.Vk = vk.RemoveFromString(tokensToRemove);
await UnitOfWork.SaveChangesAsync();
}
}
}
|
mit
|
C#
|
4ee22a5ba7ee9d43d49002235eed22f7c68cb8a3
|
Update /guitars page description
|
michaelp0730/MichaelsMusic,michaelp0730/MichaelsMusic,michaelp0730/MichaelsMusic
|
MichaelsMusic/Views/Guitars/index.cshtml
|
MichaelsMusic/Views/Guitars/index.cshtml
|
@model MichaelsMusic.Models.GuitarCollection
@{
Layout = "~/Views/Shared/_Layout.cshtml";
ViewBag.Title = "Guitars";
ViewBag.Description = "This is the guitars collection page. If you want to look at guitars, but you're not sure which ones, this is the right place to start.";
ViewBag.Keywords = "guitars, mcnaught guitars, mcnaught vintage double cut, prs, prs guitars, paul reed smith, paul reed smith guitars, paul reed smith custom 24, prs custom 24, paul reed smith mccarty, prs mccarty, peavey hp custom, gibson midtown custom, king bee oak cliff, 1980 gibson les paul custom, collings city limits deluxe, collings cl deluxe";
}
<section class="section section-size1">
<div class="row">
<div class="nine columns">
<h1>Guitars</h1>
<p>This is the guitars collection page. If you want to look at guitars, but you're not sure which ones, this is the right place to start.</p>
</div>
</div>
<div class="row">
<div class="column">
<ul class="item-collection">
@foreach (var guitar in Model.Guitars)
{
<li class="clearfix">
<p class="title">
<a href="@($"/guitars/{guitar.Slug}/")">@guitar.DisplayName</a>
</p>
<a href="@($"/guitars/{guitar.Slug}/")">
<img src=@($"/images/guitars/{guitar.Thumbnail}") alt="" />
</a>
<p>@guitar.ShortDescription</p>
<p>
<a href="@($"/guitars/{guitar.Slug}/")">Learn more »</a>
</p>
</li>
}
</ul>
</div>
</div>
</section>
|
@model MichaelsMusic.Models.GuitarCollection
@{
Layout = "~/Views/Shared/_Layout.cshtml";
ViewBag.Title = "Guitars";
ViewBag.Description = "This is the guitar collections page. These are all guitars that I either: own, used to own, or wish I owned (which is most of them). If you want to look at guitars, but you're not sure which ones, this is the right place to start.";
ViewBag.Keywords = "guitars, mcnaught guitars, mcnaught vintage double cut, prs, prs guitars, paul reed smith, paul reed smith guitars, paul reed smith custom 24, prs custom 24, paul reed smith mccarty, prs mccarty, peavey hp custom, gibson midtown custom, king bee oak cliff, 1980 gibson les paul custom, collings city limits deluxe, collings cl deluxe";
}
<section class="section section-size1">
<div class="row">
<div class="nine columns">
<h1>Guitars</h1>
<p>This is the guitars collection page. If you want to look at guitars, but you're not sure which ones, this is the right place to start.</p>
</div>
</div>
<div class="row">
<div class="column">
<ul class="item-collection">
@foreach (var guitar in Model.Guitars)
{
<li class="clearfix">
<p class="title">
<a href="@($"/guitars/{guitar.Slug}/")">@guitar.DisplayName</a>
</p>
<a href="@($"/guitars/{guitar.Slug}/")">
<img src=@($"/images/guitars/{guitar.Thumbnail}") alt="" />
</a>
<p>@guitar.ShortDescription</p>
<p>
<a href="@($"/guitars/{guitar.Slug}/")">Learn more »</a>
</p>
</li>
}
</ul>
</div>
</div>
</section>
|
mit
|
C#
|
f8acdc70845c3e73076991789fe7964dc596c2af
|
Add PropertyClass documentation (closes #31)
|
felipebz/ndapi
|
Ndapi/PropertyClass.cs
|
Ndapi/PropertyClass.cs
|
using System.Collections.Generic;
using Ndapi.Core.Handles;
using Ndapi.Enums;
using Ndapi.Core;
namespace Ndapi
{
/// <summary>
/// Represent a property class.
/// </summary>
public class PropertyClass : NdapiObject
{
/// <summary>
/// Creates a property class.
/// </summary>
/// <param name="module">Property class owner.</param>
/// <param name="name">Property class name.</param>
public PropertyClass(FormModule module, string name)
{
Create(name, ObjectType.PropertyClass, module);
}
/// <summary>
/// Creates a property class.
/// </summary>
/// <param name="module">Property class owner.</param>
/// <param name="name">Property class name.</param>
public PropertyClass(MenuModule module, string name)
{
Create(name, ObjectType.PropertyClass, module);
}
/// <summary>
/// Creates a property class.
/// </summary>
/// <param name="group">Property class owner.</param>
/// <param name="name">Property class name.</param>
public PropertyClass(ObjectGroup group, string name)
{
Create(name, ObjectType.PropertyClass, group);
}
/// <summary>
/// Creates a property class.
/// </summary>
/// <param name="library">Property class owner.</param>
/// <param name="name">Property class name.</param>
public PropertyClass(LibraryModule library, string name)
{
Create(name, ObjectType.PropertyClass, library);
}
internal PropertyClass(ObjectSafeHandle handle) : base(handle)
{
}
/// <summary>
/// Gets or sets the comment.
/// </summary>
public string Comment
{
get { return GetStringProperty(NdapiConstants.D2FP_COMMENT); }
set { SetStringProperty(NdapiConstants.D2FP_COMMENT, value); }
}
/// <summary>
/// Gets all the triggers attached to this property class.
/// </summary>
public IEnumerable<Trigger> Triggers =>
GetObjectList<Trigger>(NdapiConstants.D2FP_TRIGGER);
/// <summary>
/// Remove the specified property from the property class.
/// </summary>
/// <param name="propertyId">Property id (see <see cref="NdapiConstants"/>).</param>
public void RemoveProperty(int propertyId)
{
var status = NativeMethods.d2fppcrp_RemoveProp(NdapiContext.Context, _handle, propertyId);
Ensure.Success(status);
}
}
}
|
using System.Collections.Generic;
using Ndapi.Core.Handles;
using Ndapi.Enums;
using Ndapi.Core;
namespace Ndapi
{
public class PropertyClass : NdapiObject
{
public PropertyClass(FormModule module, string name)
{
Create(name, ObjectType.PropertyClass, module);
}
internal PropertyClass(ObjectSafeHandle handle) : base(handle)
{
}
public string Comment
{
get { return GetStringProperty(NdapiConstants.D2FP_COMMENT); }
set { SetStringProperty(NdapiConstants.D2FP_COMMENT, value); }
}
public IEnumerable<Trigger> Triggers =>
GetObjectList<Trigger>(NdapiConstants.D2FP_TRIGGER);
public void RemoveProperty(int propertyId)
{
var status = NativeMethods.d2fppcrp_RemoveProp(NdapiContext.Context, _handle, propertyId);
Ensure.Success(status);
}
}
}
|
mit
|
C#
|
16e6acfe6ff9fe03d0827faa3f40bd4861ba3ec0
|
add new mess
|
toannvqo/dnn_publish
|
Components/ProductController.cs
|
Components/ProductController.cs
|
using DotNetNuke.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Christoc.Modules.DNNModule1.Components
{
public class ProductController
{
public Product GetProduct(int productId)
{
Product p;
using (IDataContext ctx = DataContext.Instance())
{
Console.WriteLine("hello world");
Console.WriteLine("hello world");
var rep = ctx.GetRepository<Product>();
p = rep.GetById(productId);
}
return p;
}
public IEnumerable<Product> getAll()
{
IEnumerable<Product> p;
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
p = rep.Get();
}
return p;
}
public void CreateProduct(Product p)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
rep.Insert(p);
}
}
public void DeleteProduct(int productId)
{
var p = GetProduct(productId);
DeleteProduct(p);
}
public void DeleteProduct(Product p)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
rep.Delete(p);
}
}
public void UpdateProduct(Product p)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
rep.Update(p);
}
}
}
}
|
using DotNetNuke.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Christoc.Modules.DNNModule1.Components
{
public class ProductController
{
public Product GetProduct(int productId)
{
Product p;
using (IDataContext ctx = DataContext.Instance())
{
Console.WriteLine("hello world");
var rep = ctx.GetRepository<Product>();
p = rep.GetById(productId);
}
return p;
}
public IEnumerable<Product> getAll()
{
IEnumerable<Product> p;
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
p = rep.Get();
}
return p;
}
public void CreateProduct(Product p)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
rep.Insert(p);
}
}
public void DeleteProduct(int productId)
{
var p = GetProduct(productId);
DeleteProduct(p);
}
public void DeleteProduct(Product p)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
rep.Delete(p);
}
}
public void UpdateProduct(Product p)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<Product>();
rep.Update(p);
}
}
}
}
|
mit
|
C#
|
d78c1c03fb46aabd8d77e988b5a2197e58007b75
|
Disable GDB + Bochs GUI
|
zarlo/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos
|
Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs
|
Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs
|
using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<RunTargetEnum> RunTargets
{
get
{
yield return RunTargetEnum.Bochs;
//yield return RunTargetEnum.VMware;
//yield return RunTargetEnum.HyperV;
//yield return RunTargetEnum.Qemu;
}
}
public virtual bool RunWithGDB => false;
public virtual bool StartBochsDebugGUI => false;
public virtual bool DebugIL2CPU => false;
public virtual string KernelPkg => String.Empty;
public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User;
public virtual bool EnableStackCorruptionChecks => true;
public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.MethodFooters;
public virtual DebugMode DebugMode => DebugMode.Source;
public virtual IEnumerable<string> KernelAssembliesToRun
{
get
{
foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun())
{
yield return xKernelType.Assembly.Location;
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<RunTargetEnum> RunTargets
{
get
{
yield return RunTargetEnum.Bochs;
//yield return RunTargetEnum.VMware;
//yield return RunTargetEnum.HyperV;
//yield return RunTargetEnum.Qemu;
}
}
public virtual bool RunWithGDB => true;
public virtual bool StartBochsDebugGUI => true;
public virtual bool DebugIL2CPU => false;
public virtual string KernelPkg => String.Empty;
public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User;
public virtual bool EnableStackCorruptionChecks => true;
public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.MethodFooters;
public virtual DebugMode DebugMode => DebugMode.Source;
public virtual IEnumerable<string> KernelAssembliesToRun
{
get
{
foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun())
{
yield return xKernelType.Assembly.Location;
}
}
}
}
}
|
bsd-3-clause
|
C#
|
859b0dbee6a5d95fcb43bf9597a57936245557cf
|
make an interface for this
|
jquintus/TrelloWorld,jquintus/TrelloWorld
|
TrelloWorld/TrelloWorld.Server/Services/MarkdownService.cs
|
TrelloWorld/TrelloWorld.Server/Services/MarkdownService.cs
|
using MarkdownSharp;
using System.IO;
using System.Threading.Tasks;
namespace TrelloWorld.Server.Services
{
public interface IMarkdownService
{
Task<string> GetConfigureAppKey();
}
public class MarkdownService : IMarkdownService
{
private readonly Markdown _md;
private readonly string _rootPath;
public MarkdownService(string rootPath)
{
_rootPath = rootPath;
_md = new Markdown();
}
public async Task<string> GetConfigureAppKey()
{
return await GetMarkdown(Path.Combine(_rootPath, "ConfigureAppKey.md"));
}
private async Task<string> GetMarkdown(string fileName)
{
using (var reader = new StreamReader(fileName))
{
var raw = await reader.ReadToEndAsync();
return _md.Transform(raw);
}
}
}
}
|
using MarkdownSharp;
using System.IO;
using System.Threading.Tasks;
namespace TrelloWorld.Server.Services
{
public class MarkdownService
{
private readonly string _rootPath;
public MarkdownService(string rootPath)
{
_rootPath = rootPath;
}
public async Task<string> GetConfigureAppKey()
{
return await GetMarkdown(Path.Combine(_rootPath, "ConfigureAppKey.md"));
}
private static async Task<string> GetMarkdown(string fileName)
{
Markdown md = new Markdown();
using (var reader = new StreamReader(fileName))
{
var raw = await reader.ReadToEndAsync();
return md.Transform(raw);
}
}
}
}
|
mit
|
C#
|
787672b63ed9e5b0fb38f919e7d896bc8dcb72dc
|
test number 2
|
llthelinkll/opencv_project_1,llthelinkll/PowYingChub,llthelinkll/opencv_project_1,llthelinkll/opencv_project_1,llthelinkll/PowYingChub,llthelinkll/PowYingChub,llthelinkll/PowYingChub,llthelinkll/opencv_project_1
|
Unity/PowYingChub/Assets/SocketClient.cs
|
Unity/PowYingChub/Assets/SocketClient.cs
|
using UnityEngine;
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
public class SocketClient : MonoBehaviour {
// Use this for initialization
//private const int listenPort = 5005;
public GameObject hero;
private float xPos = 10.0f;
private int test;
public int test2;
Thread receiveThread;
UdpClient client;
public int port;
//info
public string lastReceivedUDPPacket = "";
public string allReceivedUDPPackets = "";
void Start () {
init();
}
void OnGUI(){
Rect rectObj=new Rect (40,10,200,400);
GUIStyle style = new GUIStyle ();
style .alignment = TextAnchor.UpperLeft;
GUI .Box (rectObj,"# UDPReceive\n127.0.0.1 "+port +" #\n"
//+ "shell> nc -u 127.0.0.1 : "+port +" \n"
+ "\nLast Packet: \n"+ lastReceivedUDPPacket
//+ "\n\nAll Messages: \n"+allReceivedUDPPackets
,style );
}
private void init(){
print ("UPDSend.init()");
port = 5005;
print ("Sending to 127.0.0.1 : " + port);
receiveThread = new Thread (new ThreadStart(ReceiveData));
receiveThread.IsBackground = true;
receiveThread.Start ();
}
private void ReceiveData(){
client = new UdpClient (port);
while (true) {
try{
IPEndPoint anyIP = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port);
byte[] data = client.Receive(ref anyIP);
string text = Encoding.UTF8.GetString(data);
print (">> " + text);
lastReceivedUDPPacket=text;
allReceivedUDPPackets=allReceivedUDPPackets+text;
xPos = float.Parse(text);
xPos *= 0.021818f;
}catch(Exception e){
print (e.ToString());
}
}
}
public string getLatestUDPPacket(){
allReceivedUDPPackets = "";
return lastReceivedUDPPacket;
}
// Update is called once per frame
void Update () {
hero.transform.position = new Vector3(xPos-6.0f,-3,0);
}
void OnApplicationQuit(){
if (receiveThread != null) {
receiveThread.Abort();
Debug.Log(receiveThread.IsAlive); //must be false
}
}
}
|
using UnityEngine;
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
public class SocketClient : MonoBehaviour {
// Use this for initialization
//private const int listenPort = 5005;
public GameObject hero;
private float xPos = 10.0f;
private int test;
Thread receiveThread;
UdpClient client;
public int port;
//info
public string lastReceivedUDPPacket = "";
public string allReceivedUDPPackets = "";
void Start () {
init();
}
void OnGUI(){
Rect rectObj=new Rect (40,10,200,400);
GUIStyle style = new GUIStyle ();
style .alignment = TextAnchor.UpperLeft;
GUI .Box (rectObj,"# UDPReceive\n127.0.0.1 "+port +" #\n"
//+ "shell> nc -u 127.0.0.1 : "+port +" \n"
+ "\nLast Packet: \n"+ lastReceivedUDPPacket
//+ "\n\nAll Messages: \n"+allReceivedUDPPackets
,style );
}
private void init(){
print ("UPDSend.init()");
port = 5005;
print ("Sending to 127.0.0.1 : " + port);
receiveThread = new Thread (new ThreadStart(ReceiveData));
receiveThread.IsBackground = true;
receiveThread.Start ();
}
private void ReceiveData(){
client = new UdpClient (port);
while (true) {
try{
IPEndPoint anyIP = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port);
byte[] data = client.Receive(ref anyIP);
string text = Encoding.UTF8.GetString(data);
print (">> " + text);
lastReceivedUDPPacket=text;
allReceivedUDPPackets=allReceivedUDPPackets+text;
xPos = float.Parse(text);
xPos *= 0.021818f;
}catch(Exception e){
print (e.ToString());
}
}
}
public string getLatestUDPPacket(){
allReceivedUDPPackets = "";
return lastReceivedUDPPacket;
}
// Update is called once per frame
void Update () {
hero.transform.position = new Vector3(xPos-6.0f,-3,0);
}
void OnApplicationQuit(){
if (receiveThread != null) {
receiveThread.Abort();
Debug.Log(receiveThread.IsAlive); //must be false
}
}
}
|
mit
|
C#
|
4aabf1c6e1d9c4fe5ebbac8697306c5a0884d5dd
|
Bump nuget version
|
managed-commons/SvgNet
|
SvgNet/AssemblyInfo.cs
|
SvgNet/AssemblyInfo.cs
|
/*
Copyright © 2003 RiskCare Ltd. All rights reserved.
Copyright © 2010 SvgNet & SvgGdi Bridge Project. All rights reserved.
Copyright © 2015, 2017 Rafael Teixeira, Mojmír Němeček, Benjamin Peterson and Other Contributors
Original source code licensed with BSD-2-Clause spirit, treat it thus, see accompanied LICENSE for more
*/
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("SvgNet")]
[assembly: AssemblyDescription("C# framework for creating SVG images")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RiskCare Ltd, SvgNet and SvgGdi Bridge Project, Rafael Teixeira, Mojmír Němeček, Benjamin Peterson")]
[assembly: AssemblyProduct("SvgNet")]
[assembly: AssemblyCopyright("Copyright 2003, 2010, 2015, 2017 RiskCare Ltd, SvgNet and SvgGdi Bridge Project, Rafael Teixeira, Mojmír Němeček, Benjamin Peterson")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.4")]
[assembly: AssemblyInformationalVersion("1.0.4")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
|
/*
Copyright © 2003 RiskCare Ltd. All rights reserved.
Copyright © 2010 SvgNet & SvgGdi Bridge Project. All rights reserved.
Copyright © 2015, 2017 Rafael Teixeira, Mojmír Němeček, Benjamin Peterson and Other Contributors
Original source code licensed with BSD-2-Clause spirit, treat it thus, see accompanied LICENSE for more
*/
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("SvgNet")]
[assembly: AssemblyDescription("C# framework for creating SVG images")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RiskCare Ltd, SvgNet and SvgGdi Bridge Project, Rafael Teixeira, Mojmír Němeček, Benjamin Peterson")]
[assembly: AssemblyProduct("SvgNet")]
[assembly: AssemblyCopyright("Copyright 2003, 2010, 2015, 2017 RiskCare Ltd, SvgNet and SvgGdi Bridge Project, Rafael Teixeira, Mojmír Němeček, Benjamin Peterson")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.3")]
[assembly: AssemblyInformationalVersion("1.0.3")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
|
bsd-3-clause
|
C#
|
b980bf01179e4adae7b6b9bdc9725a975fdc5155
|
Write track, head and sector number to each sector
|
rolfmichelsen/dragontools
|
DragonTools.test/Disk/DiskTest.cs
|
DragonTools.test/Disk/DiskTest.cs
|
/*
Copyright 2011-2020 Rolf Michelsen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using FluentAssertions;
using System;
using Xunit;
using RolfMichelsen.Dragon.DragonTools.IO.Disk;
namespace RolfMichelsen.Dragon.DragonTools.Test.Disk
{
/// <summary>
/// Tests all common functionality for the Disk interface.
/// </summary>
public class DiskTest
{
private readonly string testdata = "Testdata\\Disk\\";
[Theory]
[InlineData("testdisk-1s-40t.vdk", typeof(VdkDisk), 1, 40)]
[InlineData("testdisk-2s-40t.vdk", typeof(VdkDisk), 2, 40)]
[InlineData("testdisk-2s-80t.vdk", typeof(VdkDisk), 2, 80)]
[InlineData("testdisk-1s-40t.hfe", typeof(HfeDisk), 1, 40)]
[InlineData("testdisk-1s-40t.dmk", typeof(DmkDisk), 1, 40)]
[InlineData("testdisk-1s-40t.dsk", typeof(JvcDisk), 1, 40)]
public void DiskGeometry(string imagename, Type classtype, int heads, int tracks)
{
using (var disk = DiskFactory.OpenDisk(testdata + imagename, false))
{
disk.GetType().Should().Be(classtype);
disk.Heads.Should().Be(heads);
disk.Tracks.Should().Be(tracks);
}
}
[Theory]
[InlineData("testdisk-1s-40t.vdk")]
[InlineData("testdisk-2s-40t.vdk")]
public void ReadSectors(string imagename)
{
using (var disk = DiskFactory.OpenDisk(testdata + imagename, false))
{
foreach (var sector in disk)
{
int t = sector[0];
int h = sector[1];
int s = sector[2];
t.Should().Be(sector.Track);
h.Should().Be(sector.Head);
s.Should().Be(sector.Sector);
}
}
}
}
}
|
/*
Copyright 2011-2020 Rolf Michelsen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using FluentAssertions;
using System;
using Xunit;
using RolfMichelsen.Dragon.DragonTools.IO.Disk;
namespace RolfMichelsen.Dragon.DragonTools.Test.Disk
{
/// <summary>
/// Tests all common functionality for the Disk interface.
/// </summary>
public class DiskTest
{
private readonly string testdata = "Testdata\\Disk\\";
[Theory]
[InlineData("testdisk-1s-40t.vdk", typeof(VdkDisk), 1, 40)]
[InlineData("testdisk-2s-40t.vdk", typeof(VdkDisk), 2, 40)]
[InlineData("testdisk-2s-80t.vdk", typeof(VdkDisk), 2, 80)]
[InlineData("testdisk-1s-40t.hfe", typeof(HfeDisk), 1, 40)]
[InlineData("testdisk-1s-40t.dmk", typeof(DmkDisk), 1, 40)]
[InlineData("testdisk-1s-40t.dsk", typeof(JvcDisk), 1, 40)]
public void DiskGeometry(string imagename, Type classtype, int heads, int tracks)
{
using (var disk = DiskFactory.OpenDisk(testdata + imagename, false))
{
disk.GetType().Should().Be(classtype);
disk.Heads.Should().Be(heads);
disk.Tracks.Should().Be(tracks);
}
}
}
}
|
apache-2.0
|
C#
|
2eb8367c14df7698329cd01521ce215dcd96d423
|
Tweak class visibility
|
mkropat/RouteHandlerHttpModule
|
RouteHandlerHttpModule/FileHandlerLocator.cs
|
RouteHandlerHttpModule/FileHandlerLocator.cs
|
using System.IO;
using System.Web;
namespace RouteHandlerHttpModule
{
public static class FileHandlerLocator
{
public static string Locate(HttpContext context)
{
var requestPath = context.Request.Url.AbsolutePath;
var filePath = context.Request.MapPath(requestPath);
return File.Exists(filePath)
? filePath
: null;
}
}
}
|
using System.IO;
using System.Web;
namespace RouteHandlerHttpModule
{
internal static class FileHandlerLocator
{
public static string Locate(HttpContext context)
{
var requestPath = context.Request.Url.AbsolutePath;
var filePath = context.Request.MapPath(requestPath);
return File.Exists(filePath)
? filePath
: null;
}
}
}
|
mit
|
C#
|
dbcfd53389211ffc429d2797d1413ee9ac2e39f1
|
Fix handling main menu utility
|
DMagic1/KSP_Better_Maneuvering
|
Source/BetterManeuvering/ManeuverMainMenu.cs
|
Source/BetterManeuvering/ManeuverMainMenu.cs
|
#region license
/*The MIT License (MIT)
ManeuverMainMenu - Monobehaviour to attach settings file persistence logic to new game creation
Copyright (c) 2016 DMagic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using TMPro;
namespace BetterManeuvering
{
[KSPAddon(KSPAddon.Startup.MainMenu, false)]
public class ManeuverMainMenu : MonoBehaviour
{
private MainMenu menu;
private void Start()
{
menu = GameObject.FindObjectOfType<MainMenu>();
if (menu == null)
return;
menu.newGameBtn.onTap = (Callback)Delegate.Combine(menu.newGameBtn.onTap, new Callback(onTap));
}
private void onTap()
{
StartCoroutine(AddListener());
}
private IEnumerator AddListener()
{
yield return new WaitForSeconds(0.5f);
var buttons = GameObject.FindObjectsOfType<Button>();
if (buttons.Length > 0)
{
var button = buttons[buttons.Length - 1];
button.onClick.AddListener(new UnityAction(onSettingsApply));
}
}
private void onSettingsApply()
{
StartCoroutine(ApplySettings());
}
private IEnumerator ApplySettings()
{
while (HighLogic.CurrentGame == null)
yield return null;
if (ManeuverPersistence.Instance == null)
yield break;
ManeuverPersistence.Instance.SettingsApplied();
}
}
}
|
#region license
/*The MIT License (MIT)
ManeuverMainMenu - Monobehaviour to attach settings file persistence logic to new game creation
Copyright (c) 2016 DMagic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using TMPro;
namespace BetterManeuvering
{
[KSPAddon(KSPAddon.Startup.MainMenu, false)]
public class ManeuverMainMenu : MonoBehaviour
{
private MainMenu menu;
private Callback newGameTap;
private void Start()
{
menu = GameObject.FindObjectOfType<MainMenu>();
if (menu == null)
return;
newGameTap = menu.newGameBtn.onTap;
menu.newGameBtn.onTap = new Callback(onTap);
}
private void onTap()
{
newGameTap.Invoke();
StartCoroutine(AddListener());
}
private IEnumerator AddListener()
{
yield return new WaitForSeconds(0.5f);
var buttons = GameObject.FindObjectsOfType<Button>();
for (int i = buttons.Length - 1; i >= 0; i--)
{
Button button = buttons[i];
if (button == null)
continue;
TextMeshProUGUI tmp = button.GetComponentInChildren<TextMeshProUGUI>();
if (tmp == null)
continue;
if (tmp.text != "Start!")
continue;
button.onClick.AddListener(new UnityAction(onSettingsApply));
}
}
private void onSettingsApply()
{
StartCoroutine(ApplySettings());
}
private IEnumerator ApplySettings()
{
while (HighLogic.CurrentGame == null)
yield return null;
if (ManeuverPersistence.Instance == null)
yield break;
ManeuverPersistence.Instance.SettingsApplied();
}
}
}
|
mit
|
C#
|
311a08cfd2a50efb214c7028be97a3d51de8803b
|
Move usings inside namespace in stringextensionstests
|
Hammerstad/Moya
|
TestMoya/Extensions/StringExtensionsTests.cs
|
TestMoya/Extensions/StringExtensionsTests.cs
|
namespace TestMoya.Extensions
{
using Moya.Extensions;
using Xunit;
public class StringExtensionsTests
{
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithStrings()
{
const string Expected = "Hello world!";
var actual = "{0} {1}".FormatWith("Hello", "world!");
Assert.Equal(Expected, actual);
}
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithIntegers()
{
const string Expected = "1 2 3 4";
var actual = "{0} {1} {2} {3}".FormatWith(1, 2, 3, 4);
Assert.Equal(Expected, actual);
}
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithIntegersAndStrings()
{
const string Expected = "1 2 Hello World!";
var actual = "{0} {1} {2} {3}".FormatWith(1, 2, "Hello", "World!");
Assert.Equal(Expected, actual);
}
}
}
|
using Moya.Extensions;
using Xunit;
namespace TestMoya.Extensions
{
public class StringExtensionsTests
{
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithStrings()
{
const string Expected = "Hello world!";
var actual = "{0} {1}".FormatWith("Hello", "world!");
Assert.Equal(Expected, actual);
}
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithIntegers()
{
const string Expected = "1 2 3 4";
var actual = "{0} {1} {2} {3}".FormatWith(1, 2, 3, 4);
Assert.Equal(Expected, actual);
}
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithIntegersAndStrings()
{
const string Expected = "1 2 Hello World!";
var actual = "{0} {1} {2} {3}".FormatWith(1, 2, "Hello", "World!");
Assert.Equal(Expected, actual);
}
}
}
|
mit
|
C#
|
d9c96406ad7a05ecd53fbd41b5ef7f9ad0a6d1bf
|
Fix crash caused by previous commit
|
NTumbleBit/NTumbleBit,DanGould/NTumbleBit
|
NTumbleBit/BouncyCastle/security/SecureRandom.cs
|
NTumbleBit/BouncyCastle/security/SecureRandom.cs
|
using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NTumbleBit.BouncyCastle.Security
{
internal class SecureRandom : Random
{
public SecureRandom()
{
}
public override int Next()
{
return RandomUtils.GetInt32();
}
public override int Next(int maxValue)
{
return (int)(RandomUtils.GetUInt32() % maxValue);
}
public override int Next(int minValue, int maxValue)
{
throw new NotImplementedException();
}
public override void NextBytes(byte[] buffer)
{
RandomUtils.GetBytes(buffer);
}
}
}
|
using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NTumbleBit.BouncyCastle.Security
{
internal class SecureRandom : Random
{
public SecureRandom()
{
}
public override int Next()
{
return RandomUtils.GetInt32();
}
public override int Next(int maxValue)
{
throw new NotImplementedException();
}
public override int Next(int minValue, int maxValue)
{
throw new NotImplementedException();
}
public override void NextBytes(byte[] buffer)
{
RandomUtils.GetBytes(buffer);
}
}
}
|
mit
|
C#
|
a90ce74775ae462ed7db89b363483d54d2b8a629
|
Remove wrong type for username and e-mail field
|
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
|
Oogstplanner.Web/Views/Account/_LoginForm.cshtml
|
Oogstplanner.Web/Views/Account/_LoginForm.cshtml
|
@model LoginOrRegisterViewModel
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new { @class="form-signin", @role="form"}))
{
<div class="form-group">
@Html.ValidationSummary(true)
</div>
<h2 class="form-signin-heading dark">Meld u alstublieft aan</h2>
@Html.LabelFor(vm => vm.Login.UserName, new { @class="sr-only" })
@Html.TextBoxFor(vm => vm.Login.UserName,
new { @class = "form-control", @placeholder = "Gebruikersnaam of e-mailadres" })
@Html.LabelFor(vm => vm.Login.Password, new { @class="sr-only" })
@Html.PasswordFor(vm => vm.Login.Password,
new { @class = "form-control", @placeholder = "Wachtwoord" })
<div class="checkbox dark">
<label class="pull-left">
@Html.CheckBoxFor(vm => vm.Login.RememberMe)
Onthoud mij.
</label>
@Html.ActionLink("Wachtwoord vergeten?", "LostPassword", null, new { @class = "pull-right" })
<br/>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Inloggen</button>
if(ViewData.ModelState.ContainsKey("registration"))
{
@ViewData.ModelState["registration"].Errors.First().ErrorMessage;
}
}
|
@model LoginOrRegisterViewModel
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new { @class="form-signin", @role="form"}))
{
<div class="form-group">
@Html.ValidationSummary(true)
</div>
<h2 class="form-signin-heading dark">Meld u alstublieft aan</h2>
@Html.LabelFor(vm => vm.Login.UserName, new { @class="sr-only" })
@Html.TextBoxFor(vm => vm.Login.UserName,
new { @class = "form-control", @type="email", @placeholder = "Gebruikersnaam of e-mailadres" })
@Html.LabelFor(vm => vm.Login.Password, new { @class="sr-only" })
@Html.PasswordFor(vm => vm.Login.Password,
new { @class = "form-control", @placeholder = "Wachtwoord" })
<div class="checkbox dark">
<label class="pull-left">
@Html.CheckBoxFor(vm => vm.Login.RememberMe)
Onthoud mij.
</label>
@Html.ActionLink("Wachtwoord vergeten?", "LostPassword", null, new { @class = "pull-right" })
<br/>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Inloggen</button>
if(ViewData.ModelState.ContainsKey("registration"))
{
@ViewData.ModelState["registration"].Errors.First().ErrorMessage;
}
}
|
mit
|
C#
|
8dddabe0766c45af3fb90f8f880ad1faefb8904a
|
Remove outdated todo comment
|
nopara73/HBitcoin
|
src/HBitcoin.Tests/TrackingTests.cs
|
src/HBitcoin.Tests/TrackingTests.cs
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using HBitcoin.FullBlockSpv;
using HBitcoin.Models;
using NBitcoin;
using Xunit;
namespace HBitcoin.Tests
{
public class TrackingTests
{
[Fact]
public void TrackingBlockTest()
{
SmartMerkleBlock smartMerkleBlock = new SmartMerkleBlock(4, Network.Main.GetGenesis());
var bytes = smartMerkleBlock.ToBytes();
var same = SmartMerkleBlock.FromBytes(bytes);
Assert.Equal(smartMerkleBlock.TransactionCount, same.TransactionCount);
Assert.Equal(smartMerkleBlock.Height, same.Height);
Assert.Equal(smartMerkleBlock.MerkleBlock.Header.GetHash(), same.MerkleBlock.Header.GetHash());
// todo fix default constructor byte serialization in NBitcoin MerkleBlock
// todo implement equality comparators for NBitcoin MerkleBlock
var block = Network.Main.GetGenesis();
var tx = new Transaction(
"0100000001997ae2a654ddb2432ea2fece72bc71d3dbd371703a0479592efae21bf6b7d5100100000000ffffffff01e00f9700000000001976a9142a495afa8b8147ec2f01713b18693cb0a85743b288ac00000000");
block.AddTransaction(tx);
var tb2 = new SmartMerkleBlock(1, block, tx.GetHash());
var bytes2 = tb2.ToBytes();
var same2 = SmartMerkleBlock.FromBytes(bytes2);
Assert.Equal(tb2.Height, same2.Height);
Assert.Equal(tb2.MerkleBlock.Header.GetHash(), same2.MerkleBlock.Header.GetHash());
var txid1 = tb2.GetMatchedTransactions().FirstOrDefault();
var txid2 = same2.GetMatchedTransactions().FirstOrDefault();
Assert.Equal(txid1, txid2);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using HBitcoin.FullBlockSpv;
using HBitcoin.Models;
using NBitcoin;
using Xunit;
namespace HBitcoin.Tests
{
public class TrackingTests
{
[Fact]
public void TrackingBlockTest()
{
SmartMerkleBlock smartMerkleBlock = new SmartMerkleBlock(4, Network.Main.GetGenesis());
var bytes = smartMerkleBlock.ToBytes();
var same = SmartMerkleBlock.FromBytes(bytes);
Assert.Equal(smartMerkleBlock.TransactionCount, same.TransactionCount);
Assert.Equal(smartMerkleBlock.Height, same.Height);
Assert.Equal(smartMerkleBlock.MerkleBlock.Header.GetHash(), same.MerkleBlock.Header.GetHash());
// todo fix default constructor byte serialization in NBitcoin MerkleBlock
// todo implement equality comparators for NBitcoin MerkleBlock
// todo implement equality comparators for TrackingBlock
var block = Network.Main.GetGenesis();
var tx = new Transaction(
"0100000001997ae2a654ddb2432ea2fece72bc71d3dbd371703a0479592efae21bf6b7d5100100000000ffffffff01e00f9700000000001976a9142a495afa8b8147ec2f01713b18693cb0a85743b288ac00000000");
block.AddTransaction(tx);
var tb2 = new SmartMerkleBlock(1, block, tx.GetHash());
var bytes2 = tb2.ToBytes();
var same2 = SmartMerkleBlock.FromBytes(bytes2);
Assert.Equal(tb2.Height, same2.Height);
Assert.Equal(tb2.MerkleBlock.Header.GetHash(), same2.MerkleBlock.Header.GetHash());
var txid1 = tb2.GetMatchedTransactions().FirstOrDefault();
var txid2 = same2.GetMatchedTransactions().FirstOrDefault();
Assert.Equal(txid1, txid2);
}
}
}
|
mit
|
C#
|
4961a26fe52c6700cf3e8c946c2cbe6733f987c8
|
Improve visual of checkouts list
|
azarkevich/VssSvnConverter
|
VssSvnConverter/LinksBuilder.cs
|
VssSvnConverter/LinksBuilder.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mime;
using SourceSafeTypeLib;
using vcslib;
namespace VssSvnConverter
{
class LinksBuilder
{
public const string DataFileName = "3-state-links.txt";
public const string DataFileUiName = "3-state-links-ui.txt";
public const string DataFileCoName = "3-state-checkouts.txt";
public const string DataFileCoByDateName = "3-state-checkouts-by-date.txt";
public void Build(Options opts, IList<Tuple<string, int>> files)
{
var coDict = new Dictionary<DateTime, List<Tuple<string, string>>>();
var xrefsCo = new XRefMap();
var xrefs = new XRefMap();
foreach (var file in files.Select(t => t.Item1))
{
Console.WriteLine(file);
var item = opts.DB.VSSItem[file];
foreach (IVSSItem vssLink in item.Links)
{
if (!String.Equals(item.Spec, vssLink.Spec, StringComparison.OrdinalIgnoreCase) && !vssLink.Deleted)
xrefs.AddRef(item.Spec, vssLink.Spec);
foreach (IVSSCheckout vssCheckout in vssLink.Checkouts)
{
xrefsCo.AddRef(item.Spec, vssCheckout.Username + " at " + vssCheckout.Date);
var coDate = vssCheckout.Date.Date;
List<Tuple<string, string>> list;
if(!coDict.TryGetValue(coDate, out list))
{
list = new List<Tuple<string, string>>();
coDict[coDate] = list;
}
list.Add(Tuple.Create(vssCheckout.Username, item.Spec));
}
}
}
xrefs.Save(DataFileName);
xrefs.Save(DataFileUiName, true);
xrefsCo.Save(DataFileCoName, true);
// save co dict by dates
using (var tw = File.CreateText(DataFileCoByDateName))
{
foreach (var kvp in coDict.OrderByDescending(kvp => kvp.Key))
{
tw.WriteLine("{0:yyyy-MM-dd} ({1} days ago)", kvp.Key, (int)(DateTime.Now - kvp.Key).TotalDays);
foreach (var tuple in kvp.Value)
{
tw.WriteLine("\t{0} at {1}", tuple.Item1, tuple.Item2);
}
tw.WriteLine();
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mime;
using SourceSafeTypeLib;
using vcslib;
namespace VssSvnConverter
{
class LinksBuilder
{
public const string DataFileName = "3-state-links.txt";
public const string DataFileUiName = "3-state-links-ui.txt";
public const string DataFileCoName = "3-state-checkouts.txt";
public const string DataFileCoByDateName = "3-state-checkouts-by-date.txt";
public void Build(Options opts, IList<Tuple<string, int>> files)
{
var coDict = new Dictionary<DateTime, List<Tuple<string, string>>>();
var xrefsCo = new XRefMap();
var xrefs = new XRefMap();
foreach (var file in files.Select(t => t.Item1))
{
Console.WriteLine(file);
var item = opts.DB.VSSItem[file];
foreach (IVSSItem vssLink in item.Links)
{
if (!String.Equals(item.Spec, vssLink.Spec, StringComparison.OrdinalIgnoreCase) && !vssLink.Deleted)
xrefs.AddRef(item.Spec, vssLink.Spec);
foreach (IVSSCheckout vssCheckout in vssLink.Checkouts)
{
xrefsCo.AddRef(item.Spec, vssCheckout.Username + " at " + vssCheckout.Date);
var coDate = vssCheckout.Date.Date;
List<Tuple<string, string>> list;
if(!coDict.TryGetValue(coDate, out list))
{
list = new List<Tuple<string, string>>();
coDict[coDate] = list;
}
list.Add(Tuple.Create(vssCheckout.Username, item.Spec));
}
}
}
xrefs.Save(DataFileName);
xrefs.Save(DataFileUiName, true);
xrefsCo.Save(DataFileCoName, true);
// save co dict by dates
using (var tw = File.CreateText(DataFileCoByDateName))
{
foreach (var kvp in coDict.OrderByDescending(kvp => kvp.Key))
{
tw.WriteLine("{0}", kvp.Key);
foreach (var tuple in kvp.Value)
{
tw.WriteLine("{0} at {1}", tuple.Item1, tuple.Item2);
}
tw.WriteLine();
}
}
}
}
}
|
mit
|
C#
|
31d1cba327dd1047b7d3ae2607a413381c84ade8
|
Update Index.cshtml
|
Longfld/ASPNETCoreAngular2,Longfld/ASPNETCoreAngular2,Longfld/ASPNETCoreAngular2,Longfld/ASPNETCoreAngular2
|
webapp/src/webapp/Views/Home/Index.cshtml
|
webapp/src/webapp/Views/Home/Index.cshtml
|
<!doctype html>
<html>
<head>
<title>webapp</title>
<base href="~/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,100" />
<link rel="stylesheet" href="styles.css" />
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(console.error.bind(console));
</script>
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
|
<!doctype html>
<html>
<head>
<title>webapp</title>
<base href="~/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="node_modules/material-design-lite/dist/material.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,100" />
<link rel="stylesheet" href="styles.css" />
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(console.error.bind(console));
</script>
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
|
mit
|
C#
|
9d16e90c8514c3aa85f9f1476cef5df3f8bf7ac0
|
Update SceneSwitcher.cs
|
hsnabn/duality-samples
|
SceneTransitions/SceneSwitcher.cs
|
SceneTransitions/SceneSwitcher.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Duality;
using Duality.Resources;
namespace SceneTransitions
{
/// <summary>
/// This static class provides functions related to scenes, such as switching,
/// dispose then switch, and scene reloading.
/// </summary>
public static class SceneSwitcher
{
// We are going to use ContentRefs instead of using Scene Resources directly
/// <summary>
/// Function to switch to another scene.
/// </summary>
/// <param name="scene">The ContentRef of the scene to switch to.</param>
public static void Switch(ContentRef<Scene> scene)
{
// Note that we are not doing any scene disposal here. This means that
// the current scene will not be removed from memory, and that it will
// retain changes made to it.
Scene.SwitchTo(scene);
}
/// <summary>
/// Function to switch to another scene after disposing the specified scene.
/// </summary>
/// <param name="nextScene">The ContentRef of the scene to dispose.</param>
/// <param name="nextScene">The ContentRef of the scene to switch to.</param>
public static void DisposeAndSwitch(ContentRef<Scene> disposeScene,
ContentRef<Scene> nextScene)
{
// In this function, the current scene will be disposed, or removed
// from memory before the switch to the next scene commences.
// We are using DisposeLater() for safety, it will only dispose the
// scene after the current update cycle is over.
disposeScene.Res.DisposeLater();
Scene.SwitchTo(nextScene);
}
/// <summary>
/// Function to reload the current scene.
/// </summary>
public static void Reload()
{
Scene.Reload();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Duality;
using Duality.Resources;
namespace SceneTransitions
{
/// <summary>
/// This static class provides functions related to scenes, such as switching,
/// dispos then switch, and scene reloading.
/// </summary>
public static class SceneSwitcher
{
// We are going to use ContentRefs instead of using Scene directly
/// <summary>
/// Function to switch to another scene.
/// </summary>
/// <param name="scene">The ContentRef of the scene to switch to.</param>
public static void Switch(ContentRef<Scene> scene)
{
// Note that we are not doing any scene disposal here. This means that
// the current scene will not be removed from memory, and that it will
// retain changes made to it.
Scene.SwitchTo(scene);
}
/// <summary>
/// Function to switch to another scene after disposing the specified scene.
/// </summary>
/// <param name="nextScene">The ContentRef of the scene to dispose.</param>
/// <param name="nextScene">The ContentRef of the scene to switch to.</param>
public static void DisposeAndSwitch(ContentRef<Scene> disposeScene,
ContentRef<Scene> nextScene)
{
// In this function, the current scene will be disposed, or removed
// from memory before the switch to the next scene commences.
// We are using DisposeLater() for safety, it will only dispose the
// scene after the current update cycle is over.
disposeScene.Res.DisposeLater();
Scene.SwitchTo(nextScene);
}
/// <summary>
/// Function to reload the current scene.
/// </summary>
public static void Reload()
{
Scene.Reload();
}
}
}
|
mit
|
C#
|
fa56e80a8c0f25bd8401640dd1191b1b7f991d5d
|
Fix mistype
|
dncuug/dot-net.in.ua,dncuug/dot-net.in.ua,dncuug/dot-net.in.ua
|
src/WebSite/Views/Home/Index.cshtml
|
src/WebSite/Views/Home/Index.cshtml
|
@using X.PagedList;
@using X.PagedList.Mvc.Core;
@model IPagedList<Core.ViewModels.PublicationViewModel>
@{
ViewData["Title"] = "Welcome!";
}
@section head {
<meta property="og:title" content="@Core.Settings.Current.WebSiteTitle" />
<meta property="og:type" content="website" />
<meta property="og:url" content="@Core.Settings.Current.WebSiteUrl" />
<meta property="og:image" content="@Core.Settings.Current.FacebookImage" />
<meta property="og:description" content="@Core.Settings.Current.DefaultDescription" />
<meta name="keywords" content="@Core.Settings.Current.DefaultKeywords" />
<meta name="description" content="@Core.Settings.Current.DefaultDescription" />
}
@section top {
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<div class="col-md-8">
<h1>Welcome to the Developers Digest!</h1>
<h3 style="color: #FFF">All news and events will be here!</h3>
<span style="color: #FFF">
Project supported by .NET Core Ukrainian User Group, Microsoft Azure Ukraine User Group and Xamarin Ukraine User Group !
</span>
</div>
<div class="col-md-4 social text-right">
<ul class="social-icons">
<li><a class="fa fa-telegram" href="https://telegram.me/dncuug"></a></li>
<li><a class="fa fa-github" href="https://github.com/dncuug"></a></li>
<li><a class="fa fa-facebook-official" href="https://facebook.com/groups/dncuug"></a></li>
</ul>
</div>
</div>
</div>
}
@for (var i=0; i<Model.Count(); i++)
{
@Html.Partial("_Publication", Model[i])
@if (i == 2) { @Html.Partial("_InFeedAd") }
}
@Html.PagedListPager(Model, page => $"/page/{page}")
|
@using X.PagedList;
@using X.PagedList.Mvc.Core;
@model IPagedList<Core.ViewModels.PublicationViewModel>
@{
ViewData["Title"] = "Welcome!";
}
@section head {
<meta property="og:title" content="@Core.Settings.Current.WebSiteTitle" />
<meta property="og:type" content="website" />
<meta property="og:url" content="@Core.Settings.Current.WebSiteUrl" />
<meta property="og:image" content="@Core.Settings.Current.FacebookImage" />
<meta property="og:description" content="@Core.Settings.Current.DefaultDescription" />
<meta name="keywords" content="@Core.Settings.Current.DefaultKeywords" />
<meta name="description" content="@Core.Settings.Current.DefaultDescription" />
}
@section top {
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<div class="col-md-8">
<h1>Welcome to the Developers Digest!</h1>
<h3 style="color: #FFF">All news and event will be here!</h3>
<span style="color: #FFF">
Project supported by .NET Core Ukrainian User Group, Microsoft Azure Ukraine User Group and Xamarin Ukraine User Group !
</span>
</div>
<div class="col-md-4 social text-right">
<ul class="social-icons">
<li><a class="fa fa-telegram" href="https://telegram.me/dncuug"></a></li>
<li><a class="fa fa-github" href="https://github.com/dncuug"></a></li>
<li><a class="fa fa-facebook-official" href="https://facebook.com/groups/dncuug"></a></li>
</ul>
</div>
</div>
</div>
}
@for (var i=0; i<Model.Count(); i++)
{
@Html.Partial("_Publication", Model[i])
@if (i == 2) { @Html.Partial("_InFeedAd") }
}
@Html.PagedListPager(Model, page => $"/page/{page}")
|
mit
|
C#
|
d6418892b46cb27f16ec717cd5fc4e749a6af425
|
Remove unnecessary override
|
smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework
|
osu.Framework/Graphics/UserInterface/BasicTabControl.cs
|
osu.Framework/Graphics/UserInterface/BasicTabControl.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Sprites;
using osuTK.Graphics;
namespace osu.Framework.Graphics.UserInterface
{
public class BasicTabControl<T> : TabControl<T>
{
protected override Dropdown<T> CreateDropdown()
=> new BasicDropdown<T>();
protected override TabItem<T> CreateTabItem(T value)
=> new BasicTabItem(value);
public class BasicTabItem : TabItem<T>
{
private readonly SpriteText text;
public BasicTabItem(T value)
: base(value)
{
AutoSizeAxes = Axes.Both;
Add(text = new SpriteText
{
Margin = new MarginPadding(2),
Text = value.ToString(),
Font = new FontUsage(size: 18),
});
}
protected override void OnActivated()
=> text.Colour = Color4.MediumPurple;
protected override void OnDeactivated()
=> text.Colour = Color4.White;
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Sprites;
using osuTK.Graphics;
namespace osu.Framework.Graphics.UserInterface
{
public class BasicTabControl<T> : TabControl<T>
{
protected override Dropdown<T> CreateDropdown()
=> new BasicDropdown<T>();
protected override TabItem<T> CreateTabItem(T value)
=> new BasicTabItem(value);
public class BasicTabItem : TabItem<T>
{
private readonly SpriteText text;
public override bool IsRemovable => true;
public BasicTabItem(T value)
: base(value)
{
AutoSizeAxes = Axes.Both;
Add(text = new SpriteText
{
Margin = new MarginPadding(2),
Text = value.ToString(),
Font = new FontUsage(size: 18),
});
}
protected override void OnActivated()
=> text.Colour = Color4.MediumPurple;
protected override void OnDeactivated()
=> text.Colour = Color4.White;
}
}
}
|
mit
|
C#
|
08849539a72ccb7163bee028fd70fea20aa13b67
|
Update comment
|
wieslawsoltes/Perspex,Perspex/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Perspex,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,grokys/Perspex,Perspex/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,grokys/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia
|
src/Avalonia.Controls/Diagnostics/ToolTipDiagnostics.cs
|
src/Avalonia.Controls/Diagnostics/ToolTipDiagnostics.cs
|
#nullable enable
namespace Avalonia.Controls.Diagnostics
{
/// <summary>
/// Helper class to provide diagnostics information for <see cref="ToolTip"/>.
/// </summary>
public static class ToolTipDiagnostics
{
/// <summary>
/// Provides access to the internal <see cref="ToolTip.ToolTipProperty"/> for use in DevTools.
/// </summary>
public static AvaloniaProperty<ToolTip?> ToolTipProperty = ToolTip.ToolTipProperty;
}
}
|
#nullable enable
namespace Avalonia.Controls.Diagnostics
{
/// <summary>
/// Helper class to provide diagnostics information for <see cref="ToolTip"/>.
/// </summary>
public static class ToolTipDiagnostics
{
public static AvaloniaProperty<ToolTip?> ToolTipProperty = ToolTip.ToolTipProperty;
}
}
|
mit
|
C#
|
f44591540014ebfde95c324770e5d53c7ab0109f
|
Update src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
|
OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
|
src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
|
src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OmniSharp.Options
{
public class RoslynExtensionsOptions : OmniSharpExtensionsOptions
{
public bool EnableDecompilationSupport { get; set; }
public bool EnableAnalyzersSupport { get; set; }
public bool EnableImportCompletion { get; set; }
public bool EnableAsyncCompletion { get; set; }
public int DocumentAnalysisTimeoutMs { get; set; } = 10 * 1000;
public int AnalyzerThreadCount { get; set; } = Math.Max(1, Environment.ProcessorCount / 2);
}
public class OmniSharpExtensionsOptions
{
public string[] LocationPaths { get; set; }
public IEnumerable<string> GetNormalizedLocationPaths(IOmniSharpEnvironment env)
{
if (LocationPaths == null || LocationPaths.Length == 0) return Enumerable.Empty<string>();
var normalizePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var locationPath in LocationPaths)
{
if (Path.IsPathRooted(locationPath))
{
normalizePaths.Add(locationPath);
}
else
{
normalizePaths.Add(Path.Combine(env.TargetDirectory, locationPath));
}
}
return normalizePaths;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OmniSharp.Options
{
public class RoslynExtensionsOptions : OmniSharpExtensionsOptions
{
public bool EnableDecompilationSupport { get; set; }
public bool EnableAnalyzersSupport { get; set; }
public bool EnableImportCompletion { get; set; }
public bool EnableAsyncCompletion { get; set; }
public int DocumentAnalysisTimeoutMs { get; set; } = 10 * 1000;
public int ThreadsToUseForAnalyzers { get; set; } = Environment.ProcessorCount == 1
? 1
: Environment.ProcessorCount / 2;
}
public class OmniSharpExtensionsOptions
{
public string[] LocationPaths { get; set; }
public IEnumerable<string> GetNormalizedLocationPaths(IOmniSharpEnvironment env)
{
if (LocationPaths == null || LocationPaths.Length == 0) return Enumerable.Empty<string>();
var normalizePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var locationPath in LocationPaths)
{
if (Path.IsPathRooted(locationPath))
{
normalizePaths.Add(locationPath);
}
else
{
normalizePaths.Add(Path.Combine(env.TargetDirectory, locationPath));
}
}
return normalizePaths;
}
}
}
|
mit
|
C#
|
761c48db5034ab748bf89f53552dc42a026d58de
|
fix line endings.
|
quamotion/discutils,breezechen/DiscUtils,breezechen/DiscUtils,drebrez/DiscUtils
|
src/Iso9660/CDReader.cs
|
src/Iso9660/CDReader.cs
|
//
// Copyright (c) 2008-2010, Kenneth Bell
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
using System.IO;
using DiscUtils.Vfs;
namespace DiscUtils.Iso9660
{
/// <summary>
/// Class for reading existing ISO images.
/// </summary>
public class CDReader : VfsFileSystemFacade
{
/// <summary>
/// Creates a new instance.
/// </summary>
/// <param name="data">The stream to read the ISO image from.</param>
/// <param name="joliet">Whether to read Joliet extensions.</param>
public CDReader(Stream data, bool joliet)
: base(new VfsCDReader(data, joliet, false))
{
}
/// <summary>
/// Creates a new instance.
/// </summary>
/// <param name="data">The stream to read the ISO image from.</param>
/// <param name="joliet">Whether to read Joliet extensions.</param>
/// <param name="hideVersions">Hides version numbers (e.g. ";1") from the end of files</param>
public CDReader(Stream data, bool joliet, bool hideVersions)
: base(new VfsCDReader(data, joliet, hideVersions))
{
}
}
}
|
//
// Copyright (c) 2008-2010, Kenneth Bell
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
using System.IO;
using DiscUtils.Vfs;
namespace DiscUtils.Iso9660
{
/// <summary>
/// Class for reading existing ISO images.
/// </summary>
public class CDReader : VfsFileSystemFacade
{
/// <summary>
/// Creates a new instance.
/// </summary>
/// <param name="data">The stream to read the ISO image from.</param>
/// <param name="joliet">Whether to read Joliet extensions.</param>
public CDReader(Stream data, bool joliet)
: base(new VfsCDReader(data, joliet, false))
{
}
/// <summary>
/// Creates a new instance.
/// </summary>
/// <param name="data">The stream to read the ISO image from.</param>
/// <param name="joliet">Whether to read Joliet extensions.</param>
/// <param name="hideVersions">Hides version numbers (e.g. ";1") from the end of files</param>
public CDReader(Stream data, bool joliet, bool hideVersions)
: base(new VfsCDReader(data, joliet, hideVersions))
{
}
}
}
|
mit
|
C#
|
7053806975831e65410c2665cac31e6c500f63a6
|
improve versioning for artifacts
|
dazinator/GitVersion,ermshiperete/GitVersion,asbjornu/GitVersion,gep13/GitVersion,GitTools/GitVersion,ParticularLabs/GitVersion,ermshiperete/GitVersion,dazinator/GitVersion,asbjornu/GitVersion,ParticularLabs/GitVersion,gep13/GitVersion,ermshiperete/GitVersion,ermshiperete/GitVersion,GitTools/GitVersion
|
build/version.cake
|
build/version.cake
|
public class BuildVersion
{
public string Version { get; private set; }
public string SemVersion { get; private set; }
public string NuGetVersion { get; private set; }
public string DotNetAsterix { get; private set; }
public string DotNetVersion { get; private set; }
public string PreReleaseTag { get; private set; }
public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters, GitVersion gitVersion)
{
var version = gitVersion.MajorMinorPatch;
var preReleaseTag = gitVersion.PreReleaseTag;
var semVersion = gitVersion.LegacySemVerPadded;
var dotnetVersion = version;
semVersion += "." + gitVersion.CommitsSinceVersionSource;
dotnetVersion += "." + gitVersion.CommitsSinceVersionSource;
return new BuildVersion
{
Version = version,
SemVersion = semVersion,
NuGetVersion = gitVersion.NuGetVersion,
DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'),
DotNetVersion = dotnetVersion,
PreReleaseTag = preReleaseTag
};
}
}
|
public class BuildVersion
{
public string Version { get; private set; }
public string SemVersion { get; private set; }
public string NuGetVersion { get; private set; }
public string DotNetAsterix { get; private set; }
public string DotNetVersion { get; private set; }
public string PreReleaseTag { get; private set; }
public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters, GitVersion gitVersion)
{
var version = gitVersion.MajorMinorPatch;
var preReleaseTag = gitVersion.PreReleaseTag;
var semVersion = gitVersion.LegacySemVerPadded;
var dotnetVersion = version;
if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaDataPadded)) {
semVersion += "." + gitVersion.BuildMetaDataPadded;
dotnetVersion += "." + gitVersion.BuildMetaDataPadded;
}
return new BuildVersion
{
Version = version,
SemVersion = semVersion,
NuGetVersion = gitVersion.NuGetVersion,
DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'),
DotNetVersion = dotnetVersion,
PreReleaseTag = preReleaseTag
};
}
}
|
mit
|
C#
|
4a0082dfee1a31a1f239ca330841e891ec651633
|
Update the caching change.
|
anytao/AtCache
|
Anytao.Common.Caching/ICache.cs
|
Anytao.Common.Caching/ICache.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Anytao.Common.Caching
{
/// <summary>
/// Abstractioin for caching.
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
/// <code>https://github.com/anytao/atcache</code>
public interface ICache<TKey, TValue>
{
// Define the cache abstractioin
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Anytao.Common.Caching
{
/// <summary>
/// Abstractioin for caching.
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
/// <code>https://github.com/anytao/atcache</code>
public interface ICache<TKey, TValue>
{
}
}
|
apache-2.0
|
C#
|
9024d11967a6c0e64f8a7bbb162cd43d7a9aaac4
|
Update Cake.Issues.Recipe to 0.4.2
|
cake-contrib/Cake.Recipe,cake-contrib/Cake.Recipe
|
Cake.Recipe/Content/addins.cake
|
Cake.Recipe/Content/addins.cake
|
///////////////////////////////////////////////////////////////////////////////
// ADDINS
///////////////////////////////////////////////////////////////////////////////
#addin nuget:?package=Cake.Codecov&version=0.9.1
#addin nuget:?package=Cake.Coveralls&version=0.10.2
#addin nuget:?package=Cake.Coverlet&version=2.5.1
#addin nuget:?package=Portable.BouncyCastle&version=1.8.5
#addin nuget:?package=MimeKit&version=2.9.1
#addin nuget:?package=MailKit&version=2.8.0
#addin nuget:?package=MimeTypesMap&version=1.0.8
#addin nuget:?package=Cake.Email.Common&version=0.4.2
#addin nuget:?package=Cake.Email&version=0.10.0
#addin nuget:?package=Cake.Figlet&version=1.3.1
#addin nuget:?package=Cake.Gitter&version=0.11.1
#addin nuget:?package=Cake.Incubator&version=5.1.0
#addin nuget:?package=Cake.Kudu&version=0.11.0
#addin nuget:?package=Cake.MicrosoftTeams&version=0.9.0
#addin nuget:?package=Cake.Slack&version=0.13.0
#addin nuget:?package=Cake.Transifex&version=0.9.1
#addin nuget:?package=Cake.Twitter&version=0.10.1
#addin nuget:?package=Cake.Wyam&version=2.2.9
#load nuget:?package=Cake.Issues.Recipe&version=0.4.2
Action<string, IDictionary<string, string>> RequireAddin = (code, envVars) => {
var script = MakeAbsolute(File(string.Format("./{0}.cake", Guid.NewGuid())));
try
{
System.IO.File.WriteAllText(script.FullPath, code);
var arguments = new Dictionary<string, string>();
if (BuildParameters.CakeConfiguration.GetValue("NuGet_UseInProcessClient") != null) {
arguments.Add("nuget_useinprocessclient", BuildParameters.CakeConfiguration.GetValue("NuGet_UseInProcessClient"));
}
if (BuildParameters.CakeConfiguration.GetValue("Settings_SkipVerification") != null) {
arguments.Add("settings_skipverification", BuildParameters.CakeConfiguration.GetValue("Settings_SkipVerification"));
}
CakeExecuteScript(script,
new CakeSettings
{
EnvironmentVariables = envVars,
Arguments = arguments
});
}
finally
{
if (FileExists(script))
{
DeleteFile(script);
}
}
};
|
///////////////////////////////////////////////////////////////////////////////
// ADDINS
///////////////////////////////////////////////////////////////////////////////
#addin nuget:?package=Cake.Codecov&version=0.9.1
#addin nuget:?package=Cake.Coveralls&version=0.10.2
#addin nuget:?package=Cake.Coverlet&version=2.5.1
#addin nuget:?package=Portable.BouncyCastle&version=1.8.5
#addin nuget:?package=MimeKit&version=2.9.1
#addin nuget:?package=MailKit&version=2.8.0
#addin nuget:?package=MimeTypesMap&version=1.0.8
#addin nuget:?package=Cake.Email.Common&version=0.4.2
#addin nuget:?package=Cake.Email&version=0.10.0
#addin nuget:?package=Cake.Figlet&version=1.3.1
#addin nuget:?package=Cake.Gitter&version=0.11.1
#addin nuget:?package=Cake.Incubator&version=5.1.0
#addin nuget:?package=Cake.Kudu&version=0.11.0
#addin nuget:?package=Cake.MicrosoftTeams&version=0.9.0
#addin nuget:?package=Cake.Slack&version=0.13.0
#addin nuget:?package=Cake.Transifex&version=0.9.1
#addin nuget:?package=Cake.Twitter&version=0.10.1
#addin nuget:?package=Cake.Wyam&version=2.2.9
#load nuget:?package=Cake.Issues.Recipe&version=0.4.1
Action<string, IDictionary<string, string>> RequireAddin = (code, envVars) => {
var script = MakeAbsolute(File(string.Format("./{0}.cake", Guid.NewGuid())));
try
{
System.IO.File.WriteAllText(script.FullPath, code);
var arguments = new Dictionary<string, string>();
if (BuildParameters.CakeConfiguration.GetValue("NuGet_UseInProcessClient") != null) {
arguments.Add("nuget_useinprocessclient", BuildParameters.CakeConfiguration.GetValue("NuGet_UseInProcessClient"));
}
if (BuildParameters.CakeConfiguration.GetValue("Settings_SkipVerification") != null) {
arguments.Add("settings_skipverification", BuildParameters.CakeConfiguration.GetValue("Settings_SkipVerification"));
}
CakeExecuteScript(script,
new CakeSettings
{
EnvironmentVariables = envVars,
Arguments = arguments
});
}
finally
{
if (FileExists(script))
{
DeleteFile(script);
}
}
};
|
mit
|
C#
|
3405f4e1cb9ea9f77dd2611cb8cb56dff45bc435
|
Remove #if directives from AssemblyLoader.cs.
|
AIWolfSharp/AIWolf_NET
|
ClientStarter/AssemblyLoader.cs
|
ClientStarter/AssemblyLoader.cs
|
//
// AssemblyLoader.cs
//
// Copyright (c) 2017 Takashi OTSUKI
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
using Microsoft.Extensions.DependencyModel;
using System.Runtime.Loader;
using System.IO;
using System.Linq;
using System.Reflection;
namespace AIWolf
{
public class AssemblyLoader : AssemblyLoadContext
{
string folderPath;
public AssemblyLoader(string folderPath) => this.folderPath = folderPath;
protected override Assembly Load(AssemblyName assemblyName)
{
var cl = DependencyContext.Default.CompileLibraries.Where(d => d.Name.Contains(assemblyName.Name));
if (cl.Count() > 0)
{
return Assembly.Load(new AssemblyName(cl.First().Name));
}
else
{
var fileInfo = new FileInfo($"{folderPath}{Path.DirectorySeparatorChar}{assemblyName.Name}.dll");
if (File.Exists(fileInfo.FullName))
{
var asl = new AssemblyLoader(fileInfo.DirectoryName);
return asl.LoadFromAssemblyPath(fileInfo.FullName);
}
}
return Assembly.Load(assemblyName);
}
}
}
|
//
// AssemblyLoader.cs
//
// Copyright (c) 2017 Takashi OTSUKI
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
#if NETCOREAPP1_1
using Microsoft.Extensions.DependencyModel;
using System.Runtime.Loader;
#endif
using System.IO;
using System.Linq;
using System.Reflection;
namespace AIWolf
{
#if NETCOREAPP1_1
public class AssemblyLoader : AssemblyLoadContext
{
string folderPath;
public AssemblyLoader(string folderPath) => this.folderPath = folderPath;
protected override Assembly Load(AssemblyName assemblyName)
{
var cl = DependencyContext.Default.CompileLibraries.Where(d => d.Name.Contains(assemblyName.Name));
if (cl.Count() > 0)
{
return Assembly.Load(new AssemblyName(cl.First().Name));
}
else
{
var fileInfo = new FileInfo($"{folderPath}{Path.DirectorySeparatorChar}{assemblyName.Name}.dll");
if (File.Exists(fileInfo.FullName))
{
var asl = new AssemblyLoader(fileInfo.DirectoryName);
return asl.LoadFromAssemblyPath(fileInfo.FullName);
}
}
return Assembly.Load(assemblyName);
}
}
#endif
}
|
mit
|
C#
|
97a5a1780910bd5e6e69af4346b0c374513c10cc
|
fix quickhelp on SerializedParameterAttribute
|
dot42/api
|
Dot42/SerializedParameterAttribute.cs
|
Dot42/SerializedParameterAttribute.cs
|
using System;
namespace Dot42
{
/// <summary>
/// Specifies this parameter is used in serialization. Types and objects passed
/// as this parameter will have all their public fields and public and private
/// properties preserved and not pruned.
/// <para/>
/// <para/>
/// Can be used on normal and generic method parameters.
/// <para>
/// Propagates recursivly to the types of fields and properties of the passed type.
/// </para>
/// <para/>
/// Note that this Attribute is not inherited when used on generic method parameters.
/// </summary>
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.GenericParameter, Inherited = true, AllowMultiple = false)]
[Ignore]
public class SerializedParameterAttribute : Attribute
{
}
}
|
using System;
namespace Dot42
{
/// <summary>
/// Specifies this parameter is used in serialization. Types and objects passed
/// as this parameter will have all their public fields and public and private
/// properties preserved and not pruned.
/// <para/>
/// <para/>
/// Can be used on normal and generic method parameters.
/// <para/>
/// Note that this Attribute is not inherited when used on generic method parameters.
/// </summary>
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.GenericParameter, Inherited = true, AllowMultiple = false)]
[Ignore]
public class SerializedParameterAttribute : Attribute
{
}
}
|
apache-2.0
|
C#
|
66c2540bc6f183d7317f29f488a850b0b6c4a96f
|
Fix version number
|
File-New-Project/EarTrumpet
|
EarTrumpet/Properties/AssemblyInfo.cs
|
EarTrumpet/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Ear Trumpet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("File-New-Project")]
[assembly: AssemblyProduct("Ear Trumpet")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Ear Trumpet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("File-New-Project")]
[assembly: AssemblyProduct("Ear Trumpet")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
mit
|
C#
|
2c9d0caf0a6bc719a79e2f4c0a21348b61d42282
|
Remove extra spaces
|
RoyalVeterinaryCollege/Orchard,hbulzy/Orchard,Dolphinsimon/Orchard,cryogen/orchard,grapto/Orchard.CloudBust,MetSystem/Orchard,rtpHarry/Orchard,salarvand/Portal,smartnet-developers/Orchard,openbizgit/Orchard,rtpHarry/Orchard,vard0/orchard.tan,xiaobudian/Orchard,SouleDesigns/SouleDesigns.Orchard,Lombiq/Orchard,huoxudong125/Orchard,omidnasri/Orchard,tobydodds/folklife,angelapper/Orchard,hbulzy/Orchard,bedegaming-aleksej/Orchard,andyshao/Orchard,harmony7/Orchard,planetClaire/Orchard-LETS,bigfont/orchard-cms-modules-and-themes,omidnasri/Orchard,omidnasri/Orchard,MpDzik/Orchard,xkproject/Orchard,jersiovic/Orchard,sfmskywalker/Orchard,geertdoornbos/Orchard,fassetar/Orchard,ehe888/Orchard,escofieldnaxos/Orchard,andyshao/Orchard,MetSystem/Orchard,Serlead/Orchard,hannan-azam/Orchard,AEdmunds/beautiful-springtime,phillipsj/Orchard,Fogolan/OrchardForWork,infofromca/Orchard,SzymonSel/Orchard,alejandroaldana/Orchard,dburriss/Orchard,jimasp/Orchard,vairam-svs/Orchard,caoxk/orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,vard0/orchard.tan,enspiral-dev-academy/Orchard,DonnotRain/Orchard,TaiAivaras/Orchard,IDeliverable/Orchard,Inner89/Orchard,caoxk/orchard,cooclsee/Orchard,cooclsee/Orchard,neTp9c/Orchard,patricmutwiri/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,kouweizhong/Orchard,planetClaire/Orchard-LETS,ericschultz/outercurve-orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,MetSystem/Orchard,dozoft/Orchard,angelapper/Orchard,cooclsee/Orchard,Sylapse/Orchard.HttpAuthSample,Fogolan/OrchardForWork,bedegaming-aleksej/Orchard,TalaveraTechnologySolutions/Orchard,AdvantageCS/Orchard,hbulzy/Orchard,SzymonSel/Orchard,mvarblow/Orchard,hbulzy/Orchard,xkproject/Orchard,vairam-svs/Orchard,hbulzy/Orchard,KeithRaven/Orchard,Praggie/Orchard,jtkech/Orchard,salarvand/orchard,aaronamm/Orchard,fortunearterial/Orchard,sfmskywalker/Orchard,neTp9c/Orchard,caoxk/orchard,smartnet-developers/Orchard,mgrowan/Orchard,Serlead/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,sebastienros/msc,arminkarimi/Orchard,jerryshi2007/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,SouleDesigns/SouleDesigns.Orchard,SouleDesigns/SouleDesigns.Orchard,luchaoshuai/Orchard,jagraz/Orchard,dozoft/Orchard,jersiovic/Orchard,stormleoxia/Orchard,Morgma/valleyviewknolls,ehe888/Orchard,salarvand/orchard,johnnyqian/Orchard,escofieldnaxos/Orchard,qt1/Orchard,Anton-Am/Orchard,dcinzona/Orchard-Harvest-Website,marcoaoteixeira/Orchard,enspiral-dev-academy/Orchard,openbizgit/Orchard,jaraco/orchard,austinsc/Orchard,kgacova/Orchard,fassetar/Orchard,m2cms/Orchard,brownjordaninternational/OrchardCMS,Fogolan/OrchardForWork,abhishekluv/Orchard,Anton-Am/Orchard,oxwanawxo/Orchard,fortunearterial/Orchard,OrchardCMS/Orchard-Harvest-Website,jersiovic/Orchard,JRKelso/Orchard,DonnotRain/Orchard,kgacova/Orchard,johnnyqian/Orchard,qt1/Orchard,abhishekluv/Orchard,enspiral-dev-academy/Orchard,AndreVolksdorf/Orchard,fassetar/Orchard,Fogolan/OrchardForWork,grapto/Orchard.CloudBust,xiaobudian/Orchard,m2cms/Orchard,Praggie/Orchard,jtkech/Orchard,jagraz/Orchard,Lombiq/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,phillipsj/Orchard,jtkech/Orchard,yonglehou/Orchard,xiaobudian/Orchard,Ermesx/Orchard,TalaveraTechnologySolutions/Orchard,hannan-azam/Orchard,aaronamm/Orchard,smartnet-developers/Orchard,bigfont/orchard-cms-modules-and-themes,li0803/Orchard,asabbott/chicagodevnet-website,smartnet-developers/Orchard,jimasp/Orchard,geertdoornbos/Orchard,li0803/Orchard,Morgma/valleyviewknolls,kouweizhong/Orchard,oxwanawxo/Orchard,dcinzona/Orchard-Harvest-Website,TalaveraTechnologySolutions/Orchard,AdvantageCS/Orchard,alejandroaldana/Orchard,salarvand/orchard,dmitry-urenev/extended-orchard-cms-v10.1,ehe888/Orchard,andyshao/Orchard,AndreVolksdorf/Orchard,huoxudong125/Orchard,cryogen/orchard,KeithRaven/Orchard,bigfont/orchard-cms-modules-and-themes,aaronamm/Orchard,qt1/orchard4ibn,tobydodds/folklife,qt1/Orchard,Sylapse/Orchard.HttpAuthSample,vard0/orchard.tan,kouweizhong/Orchard,yonglehou/Orchard,jchenga/Orchard,ehe888/Orchard,infofromca/Orchard,bedegaming-aleksej/Orchard,JRKelso/Orchard,andyshao/Orchard,phillipsj/Orchard,brownjordaninternational/OrchardCMS,hhland/Orchard,Lombiq/Orchard,NIKASoftwareDevs/Orchard,RoyalVeterinaryCollege/Orchard,johnnyqian/Orchard,OrchardCMS/Orchard-Harvest-Website,grapto/Orchard.CloudBust,spraiin/Orchard,salarvand/orchard,SzymonSel/Orchard,jchenga/Orchard,TaiAivaras/Orchard,jimasp/Orchard,jagraz/Orchard,rtpHarry/Orchard,JRKelso/Orchard,openbizgit/Orchard,arminkarimi/Orchard,TaiAivaras/Orchard,Dolphinsimon/Orchard,omidnasri/Orchard,salarvand/Portal,spraiin/Orchard,Codinlab/Orchard,sebastienros/msc,MpDzik/Orchard,huoxudong125/Orchard,abhishekluv/Orchard,omidnasri/Orchard,armanforghani/Orchard,jerryshi2007/Orchard,ericschultz/outercurve-orchard,mvarblow/Orchard,grapto/Orchard.CloudBust,Codinlab/Orchard,dozoft/Orchard,grapto/Orchard.CloudBust,DonnotRain/Orchard,qt1/orchard4ibn,escofieldnaxos/Orchard,TalaveraTechnologySolutions/Orchard,qt1/Orchard,luchaoshuai/Orchard,OrchardCMS/Orchard-Harvest-Website,geertdoornbos/Orchard,tobydodds/folklife,OrchardCMS/Orchard-Harvest-Website,kgacova/Orchard,Sylapse/Orchard.HttpAuthSample,MpDzik/Orchard,Praggie/Orchard,patricmutwiri/Orchard,kouweizhong/Orchard,jaraco/orchard,jchenga/Orchard,TalaveraTechnologySolutions/Orchard,sfmskywalker/Orchard,huoxudong125/Orchard,patricmutwiri/Orchard,asabbott/chicagodevnet-website,JRKelso/Orchard,geertdoornbos/Orchard,brownjordaninternational/OrchardCMS,SeyDutch/Airbrush,omidnasri/Orchard,emretiryaki/Orchard,mgrowan/Orchard,ericschultz/outercurve-orchard,Ermesx/Orchard,qt1/Orchard,mvarblow/Orchard,abhishekluv/Orchard,rtpHarry/Orchard,dcinzona/Orchard,marcoaoteixeira/Orchard,dburriss/Orchard,Sylapse/Orchard.HttpAuthSample,planetClaire/Orchard-LETS,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,salarvand/Portal,dozoft/Orchard,AdvantageCS/Orchard,OrchardCMS/Orchard,austinsc/Orchard,cryogen/orchard,SouleDesigns/SouleDesigns.Orchard,yersans/Orchard,jersiovic/Orchard,Ermesx/Orchard,OrchardCMS/Orchard,OrchardCMS/Orchard-Harvest-Website,dcinzona/Orchard,dcinzona/Orchard,bedegaming-aleksej/Orchard,spraiin/Orchard,IDeliverable/Orchard,yonglehou/Orchard,SouleDesigns/SouleDesigns.Orchard,SeyDutch/Airbrush,planetClaire/Orchard-LETS,Fogolan/OrchardForWork,emretiryaki/Orchard,asabbott/chicagodevnet-website,grapto/Orchard.CloudBust,escofieldnaxos/Orchard,harmony7/Orchard,Ermesx/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,OrchardCMS/Orchard,smartnet-developers/Orchard,rtpHarry/Orchard,KeithRaven/Orchard,angelapper/Orchard,patricmutwiri/Orchard,KeithRaven/Orchard,neTp9c/Orchard,yersans/Orchard,hhland/Orchard,asabbott/chicagodevnet-website,xkproject/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,mgrowan/Orchard,Inner89/Orchard,stormleoxia/Orchard,bigfont/orchard-continuous-integration-demo,hannan-azam/Orchard,hannan-azam/Orchard,Dolphinsimon/Orchard,TalaveraTechnologySolutions/Orchard,mgrowan/Orchard,mgrowan/Orchard,SeyDutch/Airbrush,vairam-svs/Orchard,Codinlab/Orchard,spraiin/Orchard,hhland/Orchard,Inner89/Orchard,TaiAivaras/Orchard,NIKASoftwareDevs/Orchard,gcsuk/Orchard,vairam-svs/Orchard,yersans/Orchard,dozoft/Orchard,MetSystem/Orchard,enspiral-dev-academy/Orchard,LaserSrl/Orchard,Cphusion/Orchard,stormleoxia/Orchard,OrchardCMS/Orchard,arminkarimi/Orchard,Inner89/Orchard,bigfont/orchard-cms-modules-and-themes,sebastienros/msc,RoyalVeterinaryCollege/Orchard,sfmskywalker/Orchard,SeyDutch/Airbrush,bigfont/orchard-cms-modules-and-themes,yonglehou/Orchard,sfmskywalker/Orchard,MpDzik/Orchard,huoxudong125/Orchard,vairam-svs/Orchard,patricmutwiri/Orchard,LaserSrl/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,SzymonSel/Orchard,dburriss/Orchard,kgacova/Orchard,AdvantageCS/Orchard,Lombiq/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,dcinzona/Orchard-Harvest-Website,sfmskywalker/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,bigfont/orchard-continuous-integration-demo,dcinzona/Orchard-Harvest-Website,jagraz/Orchard,marcoaoteixeira/Orchard,Lombiq/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,planetClaire/Orchard-LETS,bedegaming-aleksej/Orchard,AEdmunds/beautiful-springtime,Serlead/Orchard,arminkarimi/Orchard,Praggie/Orchard,jimasp/Orchard,jerryshi2007/Orchard,NIKASoftwareDevs/Orchard,li0803/Orchard,hhland/Orchard,armanforghani/Orchard,oxwanawxo/Orchard,fortunearterial/Orchard,dcinzona/Orchard,MpDzik/Orchard,luchaoshuai/Orchard,Cphusion/Orchard,caoxk/orchard,Praggie/Orchard,vard0/orchard.tan,yersans/Orchard,cryogen/orchard,qt1/orchard4ibn,IDeliverable/Orchard,AndreVolksdorf/Orchard,Anton-Am/Orchard,ericschultz/outercurve-orchard,jersiovic/Orchard,jaraco/orchard,gcsuk/Orchard,kgacova/Orchard,spraiin/Orchard,IDeliverable/Orchard,xkproject/Orchard,vard0/orchard.tan,yersans/Orchard,brownjordaninternational/OrchardCMS,brownjordaninternational/OrchardCMS,abhishekluv/Orchard,dcinzona/Orchard-Harvest-Website,bigfont/orchard-continuous-integration-demo,TalaveraTechnologySolutions/Orchard,xiaobudian/Orchard,hhland/Orchard,LaserSrl/Orchard,arminkarimi/Orchard,Inner89/Orchard,Dolphinsimon/Orchard,SeyDutch/Airbrush,Serlead/Orchard,openbizgit/Orchard,infofromca/Orchard,li0803/Orchard,Morgma/valleyviewknolls,dburriss/Orchard,salarvand/Portal,jerryshi2007/Orchard,MetSystem/Orchard,ehe888/Orchard,mvarblow/Orchard,hannan-azam/Orchard,KeithRaven/Orchard,mvarblow/Orchard,jagraz/Orchard,Ermesx/Orchard,OrchardCMS/Orchard-Harvest-Website,RoyalVeterinaryCollege/Orchard,alejandroaldana/Orchard,luchaoshuai/Orchard,TalaveraTechnologySolutions/Orchard,alejandroaldana/Orchard,cooclsee/Orchard,abhishekluv/Orchard,xkproject/Orchard,marcoaoteixeira/Orchard,dcinzona/Orchard,li0803/Orchard,gcsuk/Orchard,NIKASoftwareDevs/Orchard,omidnasri/Orchard,yonglehou/Orchard,johnnyqian/Orchard,enspiral-dev-academy/Orchard,vard0/orchard.tan,omidnasri/Orchard,armanforghani/Orchard,OrchardCMS/Orchard,fassetar/Orchard,emretiryaki/Orchard,salarvand/Portal,infofromca/Orchard,Serlead/Orchard,phillipsj/Orchard,AndreVolksdorf/Orchard,angelapper/Orchard,infofromca/Orchard,neTp9c/Orchard,Sylapse/Orchard.HttpAuthSample,jaraco/orchard,TaiAivaras/Orchard,AEdmunds/beautiful-springtime,jtkech/Orchard,sebastienros/msc,jtkech/Orchard,bigfont/orchard-continuous-integration-demo,cooclsee/Orchard,LaserSrl/Orchard,Anton-Am/Orchard,Cphusion/Orchard,gcsuk/Orchard,tobydodds/folklife,m2cms/Orchard,DonnotRain/Orchard,fortunearterial/Orchard,tobydodds/folklife,Morgma/valleyviewknolls,oxwanawxo/Orchard,aaronamm/Orchard,NIKASoftwareDevs/Orchard,alejandroaldana/Orchard,Dolphinsimon/Orchard,Anton-Am/Orchard,sfmskywalker/Orchard,austinsc/Orchard,geertdoornbos/Orchard,Codinlab/Orchard,armanforghani/Orchard,Morgma/valleyviewknolls,AEdmunds/beautiful-springtime,harmony7/Orchard,harmony7/Orchard,johnnyqian/Orchard,marcoaoteixeira/Orchard,luchaoshuai/Orchard,kouweizhong/Orchard,Cphusion/Orchard,LaserSrl/Orchard,emretiryaki/Orchard,dburriss/Orchard,neTp9c/Orchard,stormleoxia/Orchard,salarvand/orchard,jerryshi2007/Orchard,fortunearterial/Orchard,m2cms/Orchard,xiaobudian/Orchard,armanforghani/Orchard,sfmskywalker/Orchard,emretiryaki/Orchard,phillipsj/Orchard,jimasp/Orchard,harmony7/Orchard,qt1/orchard4ibn,oxwanawxo/Orchard,escofieldnaxos/Orchard,DonnotRain/Orchard,SzymonSel/Orchard,Codinlab/Orchard,jchenga/Orchard,stormleoxia/Orchard,JRKelso/Orchard,Cphusion/Orchard,jchenga/Orchard,tobydodds/folklife,AndreVolksdorf/Orchard,IDeliverable/Orchard,omidnasri/Orchard,m2cms/Orchard,angelapper/Orchard,aaronamm/Orchard,austinsc/Orchard,fassetar/Orchard,dcinzona/Orchard-Harvest-Website,openbizgit/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,gcsuk/Orchard,austinsc/Orchard,AdvantageCS/Orchard,MpDzik/Orchard,qt1/orchard4ibn,qt1/orchard4ibn,RoyalVeterinaryCollege/Orchard,sebastienros/msc,andyshao/Orchard
|
src/Orchard/IDependency.cs
|
src/Orchard/IDependency.cs
|
using Orchard.Localization;
using Orchard.Logging;
namespace Orchard {
public interface IDependency {
}
public interface ISingletonDependency : IDependency {
}
public interface ITransientDependency : IDependency {
}
public abstract class Component : IDependency {
protected Component() {
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
public ILogger Logger { get; set; }
public Localizer T { get; set; }
}
}
|
using Orchard.Localization;
using Orchard.Logging;
namespace Orchard {
public interface IDependency {
}
public interface ISingletonDependency : IDependency {
}
public interface ITransientDependency : IDependency {
}
public abstract class Component : IDependency {
protected Component() {
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
public ILogger Logger { get; set; }
public Localizer T { get; set; }
}
}
|
bsd-3-clause
|
C#
|
34d1735465c104fb03b0834e639eb076f4a3a77b
|
Set up PuzzleMaster for playing sounds
|
gadauto/OCDEscape
|
Assets/OCDRoomEscape/Scripts/Interaction/PuzzleMaster.cs
|
Assets/OCDRoomEscape/Scripts/Interaction/PuzzleMaster.cs
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PuzzleMaster : MonoBehaviour
{
public float timeBetweenSounds = 15f;
public WallManager wallMgr;
public List<Puzzle> puzzles;
float increment;
float weightedIncrementTotal;
bool isGameOver = false;
// Use this for initialization
void Awake ()
{
foreach (var puzzle in puzzles) {
Debug.Log("Puzzle added: "+puzzle);
}
}
void Start()
{
// We'll consider the puzzle's weight when determining how much it affects the room movement
foreach (var puzzle in puzzles) {
weightedIncrementTotal += puzzle.puzzleWeight;
}
}
public void PuzzleCompleted(Puzzle puzzle)
{
if (isGameOver) {
Debug.Log("GAME OVER!!! Let the player know!!");
return;
}
var growthIncrement = puzzle.puzzleWeight / weightedIncrementTotal;
// Notify room of growth increment
wallMgr.Resize(wallMgr.transformRoom + growthIncrement);
KickOffSoundForPuzzle(puzzle);
if (puzzle.IsResetable() && puzzles.Contains(puzzle)) {
Debug.Log("Puzzle marked for reset");
puzzle.MarkForReset();
}
// Remove the puzzle, but also allow it to remain in the list multiple times
puzzles.Remove(puzzle);
Debug.Log("Finished puzzle: "+puzzle+", "+puzzles.Count+" left, room growing to: "+(wallMgr.transformRoom + growthIncrement));
if (wallMgr.transformRoom >= 1f) {
isGameOver = true;
Debug.Log("GAME OVER!!!");
}
}
private void KickOffSoundForPuzzle(Puzzle puzzle) {
AudioSource source = puzzle.SoundForPuzzle();
if (source) {
StartCoroutine(PlaySound(source));
} else {
Debug.Log(puzzle+" does not have an associated AudioSource");
}
}
private IEnumerator PlaySound(AudioSource source) {
while (true) {
source.Play();
yield return new WaitForSeconds(timeBetweenSounds);
}
}
}
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PuzzleMaster : MonoBehaviour
{
public float timeBetweenSounds = 15f;
public WallManager wallMgr;
public List<Puzzle> puzzles;
float increment;
float weightedIncrementTotal;
bool isGameOver = false;
// Use this for initialization
void Awake ()
{
foreach (var puzzle in puzzles) {
Debug.Log("Puzzle added: "+puzzle);
}
}
void Start()
{
// We'll consider the puzzle's weight when determining how much it affects the room movement
foreach (var puzzle in puzzles) {
weightedIncrementTotal += puzzle.puzzleWeight;
}
}
public void PuzzleCompleted(Puzzle puzzle)
{
if (isGameOver) {
Debug.Log("GAME OVER!!! Let the player know!!");
return;
}
var growthIncrement = puzzle.puzzleWeight / weightedIncrementTotal;
// TODO: Notify room of growth increment
wallMgr.Resize(wallMgr.transformRoom + growthIncrement);
if (puzzle.IsResetable() && puzzles.Contains(puzzle)) {
Debug.Log("Puzzle marked for reset");
puzzle.MarkForReset();
}
// Remove the puzzle, but also allow it to remain in the list multiple times
puzzles.Remove(puzzle);
Debug.Log("Finished puzzle: "+puzzle+", "+puzzles.Count+" left, room growing to: "+(wallMgr.transformRoom + growthIncrement));
if (wallMgr.transformRoom >= 1f) {
isGameOver = true;
Debug.Log("GAME OVER!!!");
}
}
private void KickOffSoundForPuzzle(Puzzle puzzle) {
AudioSource source = puzzle.SoundForPuzzle();
if (source) {
StartCoroutine(PlaySound(source));
} else {
Debug.Log(puzzle+" does not have an associated AudioSource");
}
}
private IEnumerator PlaySound(AudioSource source) {
while (true) {
source.Play();
yield return new WaitForSeconds(timeBetweenSounds);
}
}
}
|
apache-2.0
|
C#
|
8e04657a0d01458a85774a5cd70eb6c6da1098b7
|
Update UriTemplate.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Web/UriTemplate.cs
|
TIKSN.Core/Web/UriTemplate.cs
|
using System;
using System.Collections.Generic;
namespace TIKSN.Web
{
public class UriTemplate
{
private readonly string _template;
private readonly Dictionary<string, string> _values;
public UriTemplate(string template)
{
this._template = template;
this._values = new Dictionary<string, string>();
}
public Uri Compose()
{
var resourceLocation = this._template;
foreach (var parameter in this._values)
{
var parameterName = $"{{{parameter.Key}}}";
var escapedParameterValue = Uri.EscapeUriString(parameter.Value) ?? string.Empty;
if (resourceLocation.Contains(parameterName))
{
resourceLocation = resourceLocation.Replace(parameterName, escapedParameterValue);
}
else
{
var queryToAppend = $"{parameterName}={escapedParameterValue}";
if (resourceLocation.EndsWith("?"))
{
resourceLocation = $"{resourceLocation}{queryToAppend}";
}
else if (resourceLocation.Contains("?"))
{
resourceLocation = $"{resourceLocation}&{queryToAppend}";
}
else
{
resourceLocation = $"{resourceLocation}?{queryToAppend}";
}
}
}
return new Uri(resourceLocation, UriKind.Relative);
}
public void Fill(string name, string value) => this._values.Add(name, value);
public void Unfill(string name) => this._values.Remove(name);
}
}
|
using System;
using System.Collections.Generic;
namespace TIKSN.Web
{
public class UriTemplate
{
private readonly string _template;
private readonly Dictionary<string, string> _values;
public UriTemplate(string template)
{
_template = template;
_values = new Dictionary<string, string>();
}
public Uri Compose()
{
var resourceLocation = _template;
foreach (var parameter in _values)
{
var parameterName = $"{{{parameter.Key}}}";
var escapedParameterValue = Uri.EscapeUriString(parameter.Value) ?? string.Empty;
if (resourceLocation.Contains(parameterName))
resourceLocation = resourceLocation.Replace(parameterName, escapedParameterValue);
else
{
var queryToAppend = $"{parameterName}={escapedParameterValue}";
if (resourceLocation.EndsWith("?"))
resourceLocation = $"{resourceLocation}{queryToAppend}";
else if (resourceLocation.Contains("?"))
resourceLocation = $"{resourceLocation}&{queryToAppend}";
else
resourceLocation = $"{resourceLocation}?{queryToAppend}";
}
}
return new Uri(resourceLocation, UriKind.Relative);
}
public void Fill(string name, string value)
{
_values.Add(name, value);
}
public void Unfill(string name)
{
_values.Remove(name);
}
}
}
|
mit
|
C#
|
bc611cdb0b6bd3a613f071fa2438e378f9f16a0a
|
Revert check-in message to use CommitterDisplay rather than Committer
|
timclipsham/tfs-hipchat
|
TfsHipChat/HipChatNotifier.cs
|
TfsHipChat/HipChatNotifier.cs
|
using HipChat;
using TfsHipChat.Tfs.Events;
namespace TfsHipChat
{
public class HipChatNotifier : INotifier
{
private readonly HipChatClient _hipChatClient;
public HipChatNotifier()
{
_hipChatClient = new HipChatClient
{
Token = Properties.Settings.Default.HipChat_Token,
From = Properties.Settings.Default.HipChat_From
};
}
public void SendCheckinNotification(CheckinEvent checkinEvent, int roomId)
{
var message = string.Format("{0} checked in changeset <a href=\"{1}\">{2}</a> ({4})<br>{3}",
checkinEvent.CommitterDisplay, checkinEvent.GetChangesetUrl(), checkinEvent.Number,
checkinEvent.Comment, checkinEvent.TeamProject);
_hipChatClient.RoomId = roomId;
_hipChatClient.SendMessage(message, HipChatClient.BackgroundColor.yellow);
}
public void SendBuildCompletionFailedNotification(BuildCompletionEvent buildEvent, int roomId)
{
var message = string.Format("{0} build <a href=\"{1}\">{2}</a> {3} (requested by {4})",
buildEvent.TeamProject, buildEvent.Url, buildEvent.Id, buildEvent.CompletionStatus,
buildEvent.RequestedBy);
_hipChatClient.RoomId = roomId;
_hipChatClient.SendMessage(message, HipChatClient.BackgroundColor.red);
}
public void SendBuildCompletionSuccessNotification(BuildCompletionEvent buildEvent, int roomId)
{
var message = string.Format("{0} build <a href=\"{1}\">{2}</a> {3} (requested by {4})",
buildEvent.TeamProject, buildEvent.Url, buildEvent.Id, buildEvent.CompletionStatus,
buildEvent.RequestedBy);
_hipChatClient.RoomId = roomId;
_hipChatClient.SendMessage(message, HipChatClient.BackgroundColor.green);
}
}
}
|
using HipChat;
using TfsHipChat.Tfs.Events;
namespace TfsHipChat
{
public class HipChatNotifier : INotifier
{
private readonly HipChatClient _hipChatClient;
public HipChatNotifier()
{
_hipChatClient = new HipChatClient
{
Token = Properties.Settings.Default.HipChat_Token,
From = Properties.Settings.Default.HipChat_From
};
}
public void SendCheckinNotification(CheckinEvent checkinEvent, int roomId)
{
var message = string.Format("{0} checked in changeset <a href=\"{1}\">{2}</a> ({4})<br>{3}",
checkinEvent.Committer, checkinEvent.GetChangesetUrl(), checkinEvent.Number,
checkinEvent.Comment, checkinEvent.TeamProject);
_hipChatClient.RoomId = roomId;
_hipChatClient.SendMessage(message, HipChatClient.BackgroundColor.yellow);
}
public void SendBuildCompletionFailedNotification(BuildCompletionEvent buildEvent, int roomId)
{
var message = string.Format("{0} build <a href=\"{1}\">{2}</a> {3} (requested by {4})",
buildEvent.TeamProject, buildEvent.Url, buildEvent.Id, buildEvent.CompletionStatus,
buildEvent.RequestedBy);
_hipChatClient.RoomId = roomId;
_hipChatClient.SendMessage(message, HipChatClient.BackgroundColor.red);
}
public void SendBuildCompletionSuccessNotification(BuildCompletionEvent buildEvent, int roomId)
{
var message = string.Format("{0} build <a href=\"{1}\">{2}</a> {3} (requested by {4})",
buildEvent.TeamProject, buildEvent.Url, buildEvent.Id, buildEvent.CompletionStatus,
buildEvent.RequestedBy);
_hipChatClient.RoomId = roomId;
_hipChatClient.SendMessage(message, HipChatClient.BackgroundColor.green);
}
}
}
|
mit
|
C#
|
79cace5e3c4938e0e506c7ede76a933b40450abd
|
Add doc comments to RaygunIdentifierMessage
|
ddunkin/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,tdiehl/raygun4net,articulate/raygun4net,ddunkin/raygun4net,tdiehl/raygun4net,nelsonsar/raygun4net,MindscapeHQ/raygun4net,nelsonsar/raygun4net,articulate/raygun4net
|
Mindscape.Raygun4Net/Messages/RaygunIdentifierMessage.cs
|
Mindscape.Raygun4Net/Messages/RaygunIdentifierMessage.cs
|
namespace Mindscape.Raygun4Net.Messages
{
public class RaygunIdentifierMessage
{
public RaygunIdentifierMessage(string user)
{
Identifier = user;
}
/// <summary>
/// Unique Identifier for this user. Set this to the identifier you use internally to look up users,
/// or a correlation id for anonymous users if you have one. It doesn't have to be unique, but we will
/// treat any duplicated values as the same user.
/// </summary>
public string Identifier { get; set; }
/// <summary>
/// Flag indicating whether a user is anonymous or not.
/// </summary>
public bool IsAnonymous { get; set; }
/// <summary>
/// User's email address
/// </summary>
public string Email { get; set; }
/// <summary>
/// User's full name. If you are going to set any names, you should probably set this one too.
/// </summary>
public string FullName { get; set; }
/// <summary>
/// User's first name.
/// </summary>
public string FirstName { get; set; }
/// <summary>
/// User's last name.
/// </summary>
public string LastName { get; set; }
}
}
|
namespace Mindscape.Raygun4Net.Messages
{
public class RaygunIdentifierMessage
{
public RaygunIdentifierMessage(string user)
{
Identifier = user;
}
public string Identifier { get; set; }
public bool IsAnonymous { get; set; }
public string Email { get; set; }
public string FullName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
}
|
mit
|
C#
|
077a0740c1edc7841c69968497403feca7c92929
|
テストFailure時の詳細メッセージを強化。でもまだたりナス。
|
hidari/UstdCsv2Ju
|
UstdCsv2Ju/ResultXmlWriter.cs
|
UstdCsv2Ju/ResultXmlWriter.cs
|
using System.Linq;
using System.Xml;
namespace Hidari0415.UstdCsv2Ju
{
internal class ResultXmlWriter
{
public string InputCsv { get; private set; }
public int Threshold { get; private set; }
public string OutputXml { get; private set; }
public ResultXmlWriter(string inputCsv, int threshold, string outputXml)
{
InputCsv = inputCsv;
Threshold = threshold;
OutputXml = outputXml;
}
internal void WriteResultFile()
{
// CSVファイルを読み込んでレコードをMetricRecordのリストとして保持する
var records = UstdCsvReader.ReadMetricRecords(InputCsv);
// 読み込んだレコードをXMLの元になるJUnitStyleTestCaseに詰め込む
var result = records.Select(CreateTestCase).ToList();
// TODO: メソッドに切り分けるほうが良さそう
// XmlDocumentを構築
var xmlDocument = new XmlDocument();
var testSuite = xmlDocument.CreateElement("testsuite");
xmlDocument.AppendChild(testSuite);
foreach (var jUnitStyleTestCase in result)
{
var testCase = xmlDocument.CreateElement("testcase");
testCase.SetAttribute("classname", jUnitStyleTestCase.ClassName);
testCase.SetAttribute("name", jUnitStyleTestCase.Name);
testCase.SetAttribute("time", jUnitStyleTestCase.Time);
if (jUnitStyleTestCase.IsFailed)
{
var failure = xmlDocument.CreateElement("failure");
failure.SetAttribute("type", jUnitStyleTestCase.FailureElement.Type);
failure.SetAttribute("message", jUnitStyleTestCase.FailureElement.Message);
testCase.AppendChild(failure);
}
testSuite.AppendChild(testCase);
}
// 構築したXmlDocumentをファイルに書き出す
xmlDocument.Save(OutputXml);
}
private JUnitStyleTestCase CreateTestCase(MetricRecord metricRecord)
{
var testCase = new JUnitStyleTestCase()
{
ClassName = metricRecord.File.Replace('.', '_').Replace('\\', '.'),
Name = metricRecord.Name,
Time = "0.00"
};
// Failureを判定
if (metricRecord.Value > Threshold)
{
testCase.FailureElement = new JUnitStyleFailureElement(
string.Format("Threshold is {0}.", Threshold),
string.Format(@"Threshold: {0}
Actual:{1}
Over: {2}", Threshold, metricRecord.Value, (metricRecord.Value - Threshold))
);
testCase.IsFailed = true;
}
else
{
testCase.FailureElement = new JUnitStyleFailureElement();
}
return testCase;
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using System.Xml;
namespace Hidari0415.UstdCsv2Ju
{
internal class ResultXmlWriter
{
public string InputCsv { get; private set; }
public int Threshold { get; private set; }
public string OutputXml { get; private set; }
public ResultXmlWriter(string inputCsv, int threshold, string outputXml)
{
InputCsv = inputCsv;
Threshold = threshold;
OutputXml = outputXml;
}
internal void WriteResultFile()
{
// CSVファイルを読み込んでレコードをMetricRecordのリストとして保持する
var records = UstdCsvReader.ReadMetricRecords(InputCsv);
// 読み込んだレコードをXMLの元になるJUnitStyleTestCaseに詰め込む
var result = records.Select(CreateTestCase).ToList();
// TODO: メソッドに切り分けるほうが良さそう
// XmlDocumentを構築
var xmlDocument = new XmlDocument();
var testSuite = xmlDocument.CreateElement("testsuite");
xmlDocument.AppendChild(testSuite);
foreach (var jUnitStyleTestCase in result)
{
var testCase = xmlDocument.CreateElement("testcase");
testCase.SetAttribute("classname", jUnitStyleTestCase.ClassName);
testCase.SetAttribute("name", jUnitStyleTestCase.Name);
testCase.SetAttribute("time", jUnitStyleTestCase.Time);
if (jUnitStyleTestCase.IsFailed)
{
var failure = xmlDocument.CreateElement("failure");
failure.SetAttribute("type", jUnitStyleTestCase.FailureElement.Type);
failure.SetAttribute("message", jUnitStyleTestCase.FailureElement.Message);
testCase.AppendChild(failure);
}
testSuite.AppendChild(testCase);
}
// 構築したXmlDocumentをファイルに書き出す
xmlDocument.Save(OutputXml);
}
private JUnitStyleTestCase CreateTestCase(MetricRecord metricRecord)
{
var testCase = new JUnitStyleTestCase()
{
ClassName = metricRecord.File.Replace('.', '_').Replace('\\', '.'),
Name = metricRecord.Name,
Time = "0.00"
};
// Failureを判定
if (metricRecord.Value > Threshold)
{
testCase.FailureElement = new JUnitStyleFailureElement(
"Over threshold.", //TODO: TypeにはKindを入れるほうがいいか?
"Value is " + (metricRecord.Value - Threshold) + " over."
);
testCase.IsFailed = true;
}
else
{
testCase.FailureElement = new JUnitStyleFailureElement();
}
return testCase;
}
}
}
|
mit
|
C#
|
812045328654177044e67eb93212efa3a7de20a8
|
Optimize SkipLast for read-only collections (#128)
|
fsateler/MoreLINQ,morelinq/MoreLINQ,fsateler/MoreLINQ,ddpruitt/morelinq,ddpruitt/morelinq,morelinq/MoreLINQ
|
MoreLinq/SkipLast.cs
|
MoreLinq/SkipLast.cs
|
#region License and Terms
// MoreLINQ - Extensions to LINQ to Objects
// Copyright (c) 2017 Leandro F. Vieira (leandromoh). 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
//
// 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
namespace MoreLinq
{
using System;
using System.Collections.Generic;
using System.Linq;
static partial class MoreEnumerable
{
/// <summary>
/// Bypasses a specified number of elements at the end of the sequence.
/// </summary>
/// <typeparam name="T">Type of the source sequence</typeparam>
/// <param name="source">The source sequence.</param>
/// <param name="count">The number of elements to bypass at the end of the source sequence.</param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> containing the source sequence elements except for the bypassed ones at the end.
/// </returns>
public static IEnumerable<T> SkipLast<T>(this IEnumerable<T> source, int count)
{
if (source == null) throw new ArgumentNullException(nameof(source));
if (count < 1)
return source;
return
source is ICollection<T> col ? col.Take(col.Count - count)
#if IREADONLY
: source is IReadOnlyCollection<T> readOnlyCol ? readOnlyCol.Take(readOnlyCol.Count - count)
#endif
: _(); IEnumerable<T> _()
{
var queue = new Queue<T>(count);
foreach (var item in source)
{
if (queue.Count < count)
{
queue.Enqueue(item);
continue;
}
yield return queue.Dequeue();
queue.Enqueue(item);
}
}
}
}
}
|
#region License and Terms
// MoreLINQ - Extensions to LINQ to Objects
// Copyright (c) 2017 Leandro F. Vieira (leandromoh). 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
//
// 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
namespace MoreLinq
{
using System;
using System.Collections.Generic;
using System.Linq;
static partial class MoreEnumerable
{
/// <summary>
/// Bypasses a specified number of elements at the end of the sequence.
/// </summary>
/// <typeparam name="T">Type of the source sequence</typeparam>
/// <param name="source">The source sequence.</param>
/// <param name="count">The number of elements to bypass at the end of the source sequence.</param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> containing the source sequence elements except for the bypassed ones at the end.
/// </returns>
public static IEnumerable<T> SkipLast<T>(this IEnumerable<T> source, int count)
{
if (source == null) throw new ArgumentNullException(nameof(source));
if (count < 1)
return source;
return
source is ICollection<T> col
? col.Take(col.Count - count)
: _(); IEnumerable<T> _()
{
var queue = new Queue<T>(count);
foreach (var item in source)
{
if (queue.Count < count)
{
queue.Enqueue(item);
continue;
}
yield return queue.Dequeue();
queue.Enqueue(item);
}
}
}
}
}
|
apache-2.0
|
C#
|
0e0d5a5aeb7d122ca53cefae1e92d0835d74aa31
|
fix comments
|
sebas77/Svelto.ECS,sebas77/Svelto-ECS
|
Svelto.ECS/IEntityViewStruct.cs
|
Svelto.ECS/IEntityViewStruct.cs
|
using System;
using System.Collections.Generic;
using System.Reflection;
using Svelto.DataStructures;
using Svelto.Utilities;
namespace Svelto.ECS
{
///<summary>EntityStruct MUST implement IEntiyStruct</summary>
public interface IEntityStruct
{
EGID ID { get; set; }
}
///<summary>EntityViewStructs MUST implement IEntityViewStruct</summary>
public interface IEntityViewStruct:IEntityStruct
{}
///<summary>EntityViews can inherit from the EntityView class</summary>
public class EntityView : IEntityViewStruct
{
public EGID ID
{
get { return _ID; }
set { _ID = value; }
}
EGID _ID;
}
public struct EntityInfoView : IEntityStruct
{
public EGID ID { get; set; }
public IEntityBuilder[] entityToBuild;
}
public static class EntityView<T> where T: IEntityStruct, new()
{
internal static readonly FasterList<KeyValuePair<Type, ActionCast<T>>> cachedFields;
static EntityView()
{
cachedFields = new FasterList<KeyValuePair<Type, ActionCast<T>>>();
var type = typeof(T);
var fields = type.GetFields(BindingFlags.Public |
BindingFlags.Instance);
for (int i = fields.Length - 1; i >= 0; --i)
{
var field = fields[i];
ActionCast<T> setter = FastInvoke<T>.MakeSetter(field);
cachedFields.Add(new KeyValuePair<Type, ActionCast<T>>(field.FieldType, setter));
}
}
internal static void InitCache()
{}
internal static void BuildEntityView(EGID ID, out T entityView)
{
entityView = new T { ID = ID };
}
}
}
|
using System;
using System.Collections.Generic;
using System.Reflection;
using Svelto.DataStructures;
using Svelto.Utilities;
namespace Svelto.ECS
{
///<summary>EntityStruct MUST implement IEntiyStruct</summary>
public interface IEntityStruct
{
EGID ID { get; set; }
}
///<summary>EntityViews and EntityViewStructs MUST implement IEntityView</summary>
public interface IEntityViewStruct:IEntityStruct
{}
public class EntityView : IEntityViewStruct
{
public EGID ID
{
get { return _ID; }
set { _ID = value; }
}
EGID _ID;
}
public struct EntityInfoView : IEntityStruct
{
public EGID ID { get; set; }
public IEntityBuilder[] entityToBuild;
}
public static class EntityView<T> where T: IEntityStruct, new()
{
internal static readonly FasterList<KeyValuePair<Type, ActionCast<T>>> cachedFields;
static EntityView()
{
cachedFields = new FasterList<KeyValuePair<Type, ActionCast<T>>>();
var type = typeof(T);
var fields = type.GetFields(BindingFlags.Public |
BindingFlags.Instance);
for (int i = fields.Length - 1; i >= 0; --i)
{
var field = fields[i];
ActionCast<T> setter = FastInvoke<T>.MakeSetter(field);
cachedFields.Add(new KeyValuePair<Type, ActionCast<T>>(field.FieldType, setter));
}
}
internal static void InitCache()
{}
internal static void BuildEntityView(EGID ID, out T entityView)
{
entityView = new T { ID = ID };
}
}
}
|
mit
|
C#
|
a830bc8addaeb9b60c70ee9a598725fd0da7b376
|
Update IOption.cs
|
siroky/FuncSharp
|
src/FuncSharp/DataTypes/Option/IOption.cs
|
src/FuncSharp/DataTypes/Option/IOption.cs
|
using System;
using System.Collections.Generic;
namespace FuncSharp
{
public interface IOption<out A> : ICoproduct2<A, Unit>
{
/// <summary>
/// Returns whether the option is empty (doesn't contain any value).
/// </summary>
bool IsEmpty { get; }
/// <summary>
/// Returns whether the option is not empty (contain a value).
/// </summary>
bool NonEmpty { get; }
/// <summary>
/// Returns value of the option if not empty.
/// </summary>
A Get(Func<Unit, Exception> otherwise = null);
/// <summary>
/// Returns value of the option if it's present. If not, returns default value of the <typeparamref name="A"/> type.
/// </summary>
A GetOrDefault();
/// <summary>
/// Maps value of the current option (if present) into a new value using the specified function and
/// returns a new option with that new value.
/// </summary>
IOption<B> Map<B>(Func<A, B> f);
/// <summary>
/// Maps value of the current option (if present) into a new value using the specified function and
/// returns a new option with that new value.
/// </summary>
IOption<B> Map<B>(Func<A, B?> f)
where B : struct;
/// <summary>
/// Maps value of the current option (if present) into a new option using the specified function and
/// returns that new option.
/// </summary>
IOption<B> FlatMap<B>(Func<A, IOption<B>> f);
/// <summary>
/// Retuns the current option only if its value matches the specified predicate. Otherwise returns an empty option.
/// </summary>
IOption<A> Where(Func<A, bool> predicate);
/// <summary>
/// Returns an enumerable with the option value. If the option is empty, returns empty enumerable.
/// </summary>
/// <returns></returns>
IEnumerable<A> ToEnumerable();
}
}
|
using System;
using System.Collections.Generic;
namespace FuncSharp
{
public interface IOption<out A> : ICoproduct2<A, Unit>
{
/// <summary>
/// Returns whether the option is empty (doesn't contain any value).
/// </summary>
bool IsEmpty { get; }
/// <summary>
/// Returns whether the option is not empty (contain a value).
/// </summary>
bool NonEmpty { get; }
/// <summary>
/// Returns value of the option if not empty.
/// </summary>
A Get(Func<Unit, Exception> otherwise = null);
/// <summary>
/// Returns value of the option if it's present. If not, returns default value of the <typeparamref name="A"/> type.
/// </summary>
A GetOrDefault();
/// <summary>
/// Maps value of the current option (if present) into a new value using the specified function and
/// returns a new option with that new value.
/// </summary>
IOption<B> Map<B>(Func<A, B> f);
/// <summary>
/// Maps value of the current option (if present) into a new value using the specified function and
/// returns a new option with that new value.
/// </summary>
IOption<B> Map<B>(Func<A, B?> f)
where B : struct;
/// <summary>
/// Maps value of the current option (if present) into a new option using the specified function and
/// returns that new option.
/// </summary>
IOption<B> FlatMap<B>(Func<A, IOption<B>> f);
/// <summary>
/// Retuns the current option only if its value matches the specified predicate. Otherwise returns an empty option.
/// </summary>
IOption<A> Where(Func<A, bool> predicate);
/// <summary>
/// Returns a nenumerable with the option value. If the option is empty, returns empty enumerable.
/// </summary>
/// <returns></returns>
IEnumerable<A> ToEnumerable();
}
}
|
mit
|
C#
|
c8ce0f33cafc10b0052351725c22af5664d7300c
|
Add new line after each question
|
TeamGameFifteen2AtTelerikAcademy/Game-Fifteen
|
src/GameFifteen.Logic/Common/Constants.cs
|
src/GameFifteen.Logic/Common/Constants.cs
|
namespace GameFifteen.Logic.Common
{
using System;
public static class Constants
{
// Validator
public const string ArgumentName = "Argument name";
public const string CannotBeNullFormat = "{0} cannot be null!";
// Matrix
public const string HorizontalBorder = " -------------";
public const string VerticalBorder = "|";
// Scoreboard
public const string Scoreboard = "Scoreboard:";
public const string ScoreboardIsEmpty = "Scoreboard is empty";
public const string ScoreboardFormat = "{0}. {1} --> {2} moves";
public const int ScoreboardMaxCount = 5;
// GameInitializator
public const string TileTypeQuestion = "What type of tiles would you like\n\rNumber or Letter: ";
public const string PatternTypeQuestion = "What type of pattern would you like\n\rClassic or Column: ";
public const string MoverTypesQuestion = "How would you like to move the tiles\n\rClassic or RowCol: ";
public const string RowsQuestion = "How many rows would you like: ";
public const string ColsQuestion = "How many cols would you like: ";
// User messages
public const string EnterCommandMessage = "Enter a number to move: ";
public const string InvalidCommandMessage = "Invalid command!";
public const string InvalidMoveMessage = "Invalid move!";
public const string CongratulationsMessageFormat = "Congratulations! You won the game in {0} moves.";
public const string EnterNameMessage = "Please, enter your name for the top scoreboard: ";
public const string GoodbyeMessage = "Good bye!";
public static readonly string WellcomeMessage =
"Welcome to the game “15”. Please try to arrange the numbers sequentially." + Environment.NewLine +
"Use 'Top' to view the top scoreboard, 'Restart' to start a new game and" + Environment.NewLine +
"'Exit' to quit the game.";
// Convertor
public const int EnglishAlphabetLettersCount = 26;
}
}
|
namespace GameFifteen.Logic.Common
{
using System;
public static class Constants
{
// Validator
public const string ArgumentName = "Argument name";
public const string CannotBeNullFormat = "{0} cannot be null!";
// Matrix
public const string HorizontalBorder = " -------------";
public const string VerticalBorder = "|";
// Scoreboard
public const string Scoreboard = "Scoreboard:";
public const string ScoreboardIsEmpty = "Scoreboard is empty";
public const string ScoreboardFormat = "{0}. {1} --> {2} moves";
public const int ScoreboardMaxCount = 5;
// GameInitializator
public const string TileTypeQuestion = "What type of tiles would you like: Number or Letter: ";
public const string PatternTypeQuestion = "What type of pattern would you like: Classic or Column: ";
public const string MoverTypesQuestion = "How would you like to move the tiles: Classic or RowCol: ";
public const string RowsQuestion = "How many rows would you like: ";
public const string ColsQuestion = "How many cols would you like: ";
// User messages
public const string EnterCommandMessage = "Enter a number to move: ";
public const string InvalidCommandMessage = "Invalid command!";
public const string InvalidMoveMessage = "Invalid move!";
public const string CongratulationsMessageFormat = "Congratulations! You won the game in {0} moves.";
public const string EnterNameMessage = "Please, enter your name for the top scoreboard: ";
public const string GoodbyeMessage = "Good bye!";
public static readonly string WellcomeMessage =
"Welcome to the game “15”. Please try to arrange the numbers sequentially." + Environment.NewLine +
"Use 'Top' to view the top scoreboard, 'Restart' to start a new game and" + Environment.NewLine +
"'Exit' to quit the game.";
// Convertor
public const int EnglishAlphabetLettersCount = 26;
}
}
|
mit
|
C#
|
ccd5362d29c61aa595761a3d9c9dbe45e4222efa
|
add application/xml to supported mime types
|
dcomartin/Nancy.Gzip
|
src/Nancy.Gzip/GzipCompressionSettings.cs
|
src/Nancy.Gzip/GzipCompressionSettings.cs
|
namespace Nancy.Gzip
{
using System.Collections.Generic;
public class GzipCompressionSettings
{
public int MinimumBytes { get; set; } = 4096;
public IList<string> MimeTypes { get; set; } = new List<string>
{
"text/plain",
"text/html",
"text/xml",
"text/css",
"application/json",
"application/x-javascript",
"application/atom+xml",
"application/xml"
};
}
}
|
namespace Nancy.Gzip
{
using System.Collections.Generic;
public class GzipCompressionSettings
{
public int MinimumBytes { get; set; } = 4096;
public IList<string> MimeTypes { get; set; } = new List<string>
{
"text/plain",
"text/html",
"text/xml",
"text/css",
"application/json",
"application/x-javascript",
"application/atom+xml",
};
}
}
|
mit
|
C#
|
0b763e4603a6f086a66128edbbd6b87d881fdf67
|
Add Equals override to support SQ
|
steven-r/Oberon0Compiler
|
oberon0/Expressions/Operations/Internal/ArithmeticOpKey.cs
|
oberon0/Expressions/Operations/Internal/ArithmeticOpKey.cs
|
#region copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ArithmeticOpKey.cs" company="Stephen Reindl">
// Copyright (c) Stephen Reindl. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
// </copyright>
// <summary>
// Part of oberon0 - Oberon0Compiler/ArithmeticOpKey.cs
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#endregion
namespace Oberon0.Compiler.Expressions.Operations.Internal
{
using System;
using Oberon0.Compiler.Types;
/// <summary>
/// Helper class to create a dictionary of operations and it's left and right parameters
/// </summary>
internal class ArithmeticOpKey : IArithmeticOpMetadata, IEquatable<ArithmeticOpKey>
{
public ArithmeticOpKey(
int operation,
BaseType leftHandType,
BaseType rightHandType,
BaseType targetType = BaseType.AnyType)
{
Operation = operation;
LeftHandType = leftHandType;
RightHandType = rightHandType;
ResultType = targetType;
}
public BaseType LeftHandType { get; }
public int Operation { get; }
public BaseType ResultType { get; }
public BaseType RightHandType { get; }
public override bool Equals(object obj)
{
if (obj == null) return false;
return Equals((ArithmeticOpKey)obj);
}
public bool Equals(ArithmeticOpKey other)
{
if (other == null) return false;
return Operation == other.Operation && LeftHandType == other.LeftHandType
&& RightHandType == other.RightHandType;
}
public override int GetHashCode()
{
// ignore Target type
return 17 ^ Operation.GetHashCode() ^ LeftHandType.GetHashCode() ^ RightHandType.GetHashCode();
}
}
}
|
#region copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ArithmeticOpKey.cs" company="Stephen Reindl">
// Copyright (c) Stephen Reindl. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
// </copyright>
// <summary>
// Part of oberon0 - Oberon0Compiler/ArithmeticOpKey.cs
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#endregion
namespace Oberon0.Compiler.Expressions.Operations.Internal
{
using System;
using Oberon0.Compiler.Types;
/// <summary>
/// Helper class to create a dictionary of operations and it's left and right parameters
/// </summary>
internal class ArithmeticOpKey : IArithmeticOpMetadata, IEquatable<ArithmeticOpKey>
{
public ArithmeticOpKey(
int operation,
BaseType leftHandType,
BaseType rightHandType,
BaseType targetType = BaseType.AnyType)
{
Operation = operation;
LeftHandType = leftHandType;
RightHandType = rightHandType;
ResultType = targetType;
}
public BaseType LeftHandType { get; }
public int Operation { get; }
public BaseType ResultType { get; }
public BaseType RightHandType { get; }
public bool Equals(ArithmeticOpKey other)
{
if (other == null) return false;
return Operation == other.Operation && LeftHandType == other.LeftHandType
&& RightHandType == other.RightHandType;
}
public override int GetHashCode()
{
// ignore Target type
return 17 ^ Operation.GetHashCode() ^ LeftHandType.GetHashCode() ^ RightHandType.GetHashCode();
}
}
}
|
mit
|
C#
|
4dcf56d256f266694bec2db06b94654140afd379
|
mark geopoint immutable
|
mm999/OrigoDB
|
src/OrigoDB.Core/Modeling/Geo/GeoPoint.cs
|
src/OrigoDB.Core/Modeling/Geo/GeoPoint.cs
|
using System;
namespace OrigoDB.Core.Modeling.Geo
{
/// <summary>
/// A point on the surface of the earth
/// </summary>
[Serializable, Immutable]
public class GeoPoint
{
public const double EarthRadiusKm = 6372.797560856;
/// <summary>
/// Degrees latitude in the range -90 to +90
/// </summary>
public double Latitude { get; private set; }
/// <summary>
/// Degrees Longitude in the range -180 to +180
/// </summary>
public double Longitude { get; private set; }
public GeoPoint(double latitude, double longitude)
{
Latitude = latitude;
Longitude = longitude;
}
public override string ToString()
{
return String.Format("(Lat:{0}, Lon:{1})", Latitude, Longitude);
}
private GeoPoint ToRadians()
{
const double r = Math.PI/180;
return new GeoPoint(Latitude*r, Longitude*r);
}
/// <summary>
/// Calculate the distance between 2 points along the surface of the earth using the haversine formula
/// </summary>
public static ArcDistance Distance(GeoPoint a, GeoPoint b)
{
a = a.ToRadians();
b = b.ToRadians();
double u = Math.Sin((b.Latitude - a.Latitude) / 2);
double v = Math.Sin((b.Longitude - a.Longitude) / 2);
var radians = 2.0 * Math.Asin(Math.Sqrt(u * u + Math.Cos(b.Latitude) * Math.Cos(a.Latitude) * v * v));
return new ArcDistance(radians);
}
/// <summary>
/// The distance to a point, see Distance
/// </summary>
/// <param name="other"></param>
public ArcDistance DistanceTo(GeoPoint other)
{
return Distance(this, other);
}
}
}
|
using System;
namespace OrigoDB.Core.Modeling.Geo
{
/// <summary>
/// A point on the surface of the earth
/// </summary>
[Serializable]
public class GeoPoint
{
public const double EarthRadiusKm = 6372.797560856;
/// <summary>
/// Degrees latitude in the range -90 to +90
/// </summary>
public double Latitude { get; private set; }
/// <summary>
/// Degrees Longitude in the range -180 to +180
/// </summary>
public double Longitude { get; private set; }
public GeoPoint(double latitude, double longitude)
{
Latitude = latitude;
Longitude = longitude;
}
public override string ToString()
{
return String.Format("(Lat:{0}, Lon:{1})", Latitude, Longitude);
}
private GeoPoint ToRadians()
{
const double r = Math.PI/180;
return new GeoPoint(Latitude*r, Longitude*r);
}
/// <summary>
/// Calculate the distance between 2 points along the surface of the earth using the haversine formula
/// </summary>
public static ArcDistance Distance(GeoPoint a, GeoPoint b)
{
a = a.ToRadians();
b = b.ToRadians();
double u = Math.Sin((b.Latitude - a.Latitude) / 2);
double v = Math.Sin((b.Longitude - a.Longitude) / 2);
var radians = 2.0 * Math.Asin(Math.Sqrt(u * u + Math.Cos(b.Latitude) * Math.Cos(a.Latitude) * v * v));
return new ArcDistance(radians);
}
/// <summary>
/// The distance to a point, see Distance
/// </summary>
/// <param name="other"></param>
public ArcDistance DistanceTo(GeoPoint other)
{
return Distance(this, other);
}
}
}
|
mit
|
C#
|
48cb5ff3f5bdea3c1ea3b091dfae546f694435fc
|
Update settings file
|
dncuug/dot-net.in.ua,dncuug/dot-net.in.ua,dncuug/dot-net.in.ua
|
src/Core/Settings.cs
|
src/Core/Settings.cs
|
using System;
using System.Net;
using Microsoft.Extensions.Configuration;
namespace Core
{
public class Settings
{
public string ConnectionString { get; private set; }
public string WebSiteTitle { get; private set; }
public string WebSiteUrl { get; private set; }
public string DefaultDescription { get; private set; }
public string DefaultKeywords { get; private set; }
public string FacebookImage => $"{WebSiteUrl}images/fb_logo.png";
public string RssFeedUrl => $"{WebSiteUrl}rss";
public string SupportEmail { get; set; }
public string TelegramToken { get; set; }
#region Current
public static Settings Current { get; private set; }
public static void Initialize(IConfiguration configuration)
{
Current = new Settings
{
ConnectionString = configuration.GetConnectionString("DefaultConnection"),
WebSiteUrl = configuration["WebSiteUrl"],
WebSiteTitle = configuration["WebSiteTitle"],
TelegramToken = configuration["TelegramToken"],
DefaultDescription = WebUtility.HtmlDecode(configuration["DefaultDescription"]),
DefaultKeywords = WebUtility.HtmlDecode(configuration["DefaultKeywords"]),
SupportEmail = "dncuug@agi.net.ua",
};
}
#endregion
}
}
|
using System;
using System.Net;
using Microsoft.Extensions.Configuration;
namespace Core
{
public class Settings
{
public string ConnectionString { get; private set; }
public string WebSiteTitle { get; private set; }
public string WebSiteUrl { get; private set; }
public string DefaultDescription { get; private set; }
public string DefaultKeywords { get; private set; }
public string FacebookImage => $"{WebSiteUrl}images/fb_logo.png";
public string RssFeedUrl => $"{WebSiteUrl}rss";
public string SupportEmail { get; set; }
#region Current
public static Settings Current { get; private set; }
public static void Initialize(IConfiguration configuration)
{
Current = new Settings
{
ConnectionString = configuration.GetConnectionString("DefaultConnection"),
WebSiteUrl = configuration["WebSiteUrl"],
WebSiteTitle = configuration["WebSiteTitle"],
DefaultDescription = WebUtility.HtmlDecode(configuration["DefaultDescription"]),
DefaultKeywords = WebUtility.HtmlDecode(configuration["DefaultKeywords"]),
SupportEmail = "dncuug@agi.net.ua"
};
}
#endregion
}
}
|
mit
|
C#
|
89389514bef196d433983f1f101dc307a661b0af
|
Refactor benchmarks to only demonstrate what's needed
|
peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework
|
osu.Framework.Benchmarks/BenchmarkBindableInstantiation.cs
|
osu.Framework.Benchmarks/BenchmarkBindableInstantiation.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 BenchmarkDotNet.Attributes;
using osu.Framework.Bindables;
namespace osu.Framework.Benchmarks
{
public class BenchmarkBindableInstantiation
{
[Benchmark(Baseline = true)]
public Bindable<int> GetBoundCopyOld() => new BindableOld<int>().GetBoundCopy();
[Benchmark]
public Bindable<int> GetBoundCopy() => new Bindable<int>().GetBoundCopy();
private class BindableOld<T> : Bindable<T>
{
public BindableOld(T defaultValue = default)
: base(defaultValue)
{
}
protected internal override Bindable<T> CreateInstance() => (BindableOld<T>)Activator.CreateInstance(GetType(), Value);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using BenchmarkDotNet.Attributes;
using osu.Framework.Bindables;
namespace osu.Framework.Benchmarks
{
public class BenchmarkBindableInstantiation
{
private Bindable<int> bindable;
[GlobalSetup]
public void GlobalSetup() => bindable = new Bindable<int>();
/// <summary>
/// Creates an instance of the bindable directly by construction.
/// </summary>
[Benchmark(Baseline = true)]
public Bindable<int> CreateInstanceViaConstruction() => new Bindable<int>();
/// <summary>
/// Creates an instance of the bindable via <see cref="Activator.CreateInstance(Type, object[])"/>.
/// This used to be how <see cref="Bindable{T}.GetBoundCopy"/> creates an instance before binding, which has turned out to be inefficient in performance.
/// </summary>
[Benchmark]
public Bindable<int> CreateInstanceViaActivatorWithParams() => (Bindable<int>)Activator.CreateInstance(typeof(Bindable<int>), 0);
/// <summary>
/// Creates an instance of the bindable via <see cref="Activator.CreateInstance(Type)"/>.
/// More performant than <see cref="CreateInstanceViaActivatorWithParams"/>, due to not passing parameters to <see cref="Activator"/> during instance creation.
/// </summary>
[Benchmark]
public Bindable<int> CreateInstanceViaActivatorWithoutParams() => (Bindable<int>)Activator.CreateInstance(typeof(Bindable<int>), true);
/// <summary>
/// Creates an instance of the bindable via <see cref="IBindable.CreateInstance"/>.
/// This is the current and most performant version used for <see cref="IBindable.GetBoundCopy"/>, as equally performant as <see cref="CreateInstanceViaConstruction"/>.
/// </summary>
[Benchmark]
public Bindable<int> CreateInstanceViaBindableCreateInstance() => bindable.CreateInstance();
}
}
|
mit
|
C#
|
d2e7938ca617b372d71f6181883eb4267728ddc3
|
Add missing using
|
MrRoundRobin/telegram.bot
|
src/Telegram.Bot/Types/ChatJoinRequest.cs
|
src/Telegram.Bot/Types/ChatJoinRequest.cs
|
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
namespace Telegram.Bot.Types
{
/// <summary>
/// Represents a join request sent to a chat.
/// </summary>
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public class ChatJoinRequest
{
/// <summary>
/// Chat to which the request was sent
/// </summary>
[JsonProperty(Required = Required.Always)]
public Chat Chat { get; set; } = default!;
/// <summary>
/// User that sent the join request
/// </summary>
[JsonProperty(Required = Required.Always)]
public User From { get; set; } = default!;
/// <summary>
/// Date the request was sent
/// </summary>
[JsonProperty(Required = Required.Always)]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime Date { get; set; }
/// <summary>
/// Optional. Bio of the user
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string? Bio { get; set; }
/// <summary>
/// Optional. Chat invite link that was used by the user to send the join request
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public ChatInviteLink? InviteLink { get; set; }
}
}
|
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Telegram.Bot.Types
{
/// <summary>
/// Represents a join request sent to a chat.
/// </summary>
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public class ChatJoinRequest
{
/// <summary>
/// Chat to which the request was sent
/// </summary>
[JsonProperty(Required = Required.Always)]
public Chat Chat { get; set; } = default!;
/// <summary>
/// User that sent the join request
/// </summary>
[JsonProperty(Required = Required.Always)]
public User From { get; set; } = default!;
/// <summary>
/// Date the request was sent
/// </summary>
[JsonProperty(Required = Required.Always)]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime Date { get; set; }
/// <summary>
/// Optional. Bio of the user
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string? Bio { get; set; }
/// <summary>
/// Optional. Chat invite link that was used by the user to send the join request
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public ChatInviteLink? InviteLink { get; set; }
}
}
|
mit
|
C#
|
5e60b874846d3ca280331fc08c62fb7d40849ab2
|
use sample config.json
|
jtroe/Centroid,ResourceDataInc/Centroid,ResourceDataInc/Centroid,ResourceDataInc/Centroid,jtroe/Centroid,jtroe/Centroid
|
dot-net/Demo/Program.cs
|
dot-net/Demo/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CentroidConfig;
namespace CentroidConfig.Demo
{
class Program
{
static void Main(string[] args)
{
var c = new Centroid("../../../../config.json");
foreach (string env in new [] { "Dev", "Test", "Prod" })
{
dynamic config = c.Environment(env);
var admin_user = config.Database.admin.user_name;
var admin_password = config.Database.admin.password;
var db = config.Database.Server;
Console.WriteLine(String.Format("{0} => Server={1};Username={2};Password={3}", env, db, admin_user, admin_password));
}
Console.Write("Press any key to exit...");
Console.ReadKey();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CentroidConfig;
namespace CentroidConfig.Demo
{
class Program
{
static void Main(string[] args)
{
var c = new Centroid();
foreach (string env in new [] { "Dev", "Test", "Prod" })
{
dynamic config = c.Environment(env);
var admin_user = config.Database.admin.user_name;
var admin_password = config.Database.admin.password;
var db = config.Database.Server;
Console.WriteLine(String.Format("{0} => Server={1};Username={2};Password={3}", env, db, admin_user, admin_password));
}
Console.Write("Press any key to exit...");
Console.ReadKey();
}
}
}
|
mit
|
C#
|
a77268691b2f9068947fab741ac223ed8dc5da25
|
Clean using
|
aloisdg/Doccou,saidmarouf/Doccou,aloisdg/CountPages
|
Counter/IDocument.cs
|
Counter/IDocument.cs
|
namespace Counter
{
internal interface IDocument
{
DocumentType Type { get; }
uint Count { get; }
}
}
|
using System;
using System.IO;
namespace Counter
{
internal interface IDocument
{
DocumentType Type { get; }
uint Count { get; }
}
}
|
mit
|
C#
|
f09ebe210414fc019f1376ee728b666cf4105744
|
add correct html title
|
Sage/sageone_api_csharp_sample,Sage/sageone_api_csharp_sample,Sage/sageone_api_csharp_sample
|
app/Views/Shared/_Layout.cshtml
|
app/Views/Shared/_Layout.cshtml
|
<!DOCTYPE html>
<html>
<head>
<title>Sage Accounting API Sample App - C#</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sage Accounting API Sample App - C#</title>
<link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap">
<link rel="stylesheet" href="../sample_app.css" />
</head>
<body>
@RenderBody()
<script src="~/sample_app.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<title>@ViewData["Title"] - aspMVC2</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sage Accounting API Sample App - C#</title>
<link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap">
<link rel="stylesheet" href="../sample_app.css" />
</head>
<body>
@RenderBody()
<script src="~/sample_app.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>
|
mit
|
C#
|
5f4b4edd0fa733a0b8c7a2d49f95f107594fef9e
|
Remove SpriteBatch Begin/End from ConsoleLrs
|
iridinite/shiftdrive
|
Client/ConsoleLrs.cs
|
Client/ConsoleLrs.cs
|
/*
** Project ShiftDrive
** (C) Mika Molenkamp, 2016-2017.
*/
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ShiftDrive {
/// <summary>
/// Implements a <seealso cref="Console"/> showing a map overview for debugging purposes.
/// </summary>
internal sealed class ConsoleLrs : Console {
protected override void OnDraw(SpriteBatch spriteBatch) {
int gridSize = MathHelper.Min(SDGame.Inst.GameWidth, SDGame.Inst.GameHeight) - 128;
Vector2 gridPos = new Vector2(SDGame.Inst.GameWidth / 2 - gridSize / 2, SDGame.Inst.GameHeight / 2 - gridSize / 2);
// draw map icons for all game objects
spriteBatch.Draw(Assets.GetTexture("ui/rect"), new Rectangle((int)gridPos.X, (int)gridPos.Y, gridSize, gridSize), Color.DarkOliveGreen);
foreach (GameObject obj in NetClient.World.Objects.Values) {
spriteBatch.Draw(Assets.GetTexture("ui/rect"), gridPos + new Vector2(gridSize * (obj.position.X / NetServer.MAPSIZE), gridSize * (obj.position.Y / NetServer.MAPSIZE)), null, Color.White, MathHelper.ToRadians(obj.facing), new Vector2(16, 16), 0.25f, SpriteEffects.None, 0f);
}
// draw info underneath mouse cursor
Vector2 playerPosition = NetClient.World.GetPlayerShip().position;
int mouseMapX = (int)((Input.MouseX - gridPos.X) / gridSize * NetServer.MAPSIZE);
int mouseMapY = (int)((Input.MouseY - gridPos.Y) / gridSize * NetServer.MAPSIZE);
spriteBatch.DrawString(Assets.fontDefault, "POS " + mouseMapX + ", " + mouseMapY, new Vector2(Input.MouseX, Input.MouseY + 25), Color.LightYellow);
spriteBatch.DrawString(Assets.fontDefault, "DIR " +
(int)Utils.CalculateBearing(new Vector2(playerPosition.X, playerPosition.Y),
new Vector2(mouseMapX, mouseMapY)),
new Vector2(Input.MouseX, Input.MouseY + 50),
Color.LightYellow);
}
protected override void OnUpdate(GameTime gameTime) {}
}
}
|
/*
** Project ShiftDrive
** (C) Mika Molenkamp, 2016-2017.
*/
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ShiftDrive {
/// <summary>
/// Implements a <seealso cref="Console"/> showing a map overview for debugging purposes.
/// </summary>
internal sealed class ConsoleLrs : Console {
protected override void OnDraw(SpriteBatch spriteBatch) {
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
int gridSize = MathHelper.Min(SDGame.Inst.GameWidth, SDGame.Inst.GameHeight) - 128;
Vector2 gridPos = new Vector2(SDGame.Inst.GameWidth / 2 - gridSize / 2, SDGame.Inst.GameHeight / 2 - gridSize / 2);
// draw map icons for all game objects
spriteBatch.Draw(Assets.GetTexture("ui/rect"), new Rectangle((int)gridPos.X, (int)gridPos.Y, gridSize, gridSize), Color.DarkOliveGreen);
foreach (GameObject obj in NetClient.World.Objects.Values) {
spriteBatch.Draw(Assets.GetTexture("ui/rect"), gridPos + new Vector2(gridSize * (obj.position.X / NetServer.MAPSIZE), gridSize * (obj.position.Y / NetServer.MAPSIZE)), null, Color.White, MathHelper.ToRadians(obj.facing), new Vector2(16, 16), 0.25f, SpriteEffects.None, 0f);
}
// draw info underneath mouse cursor
Vector2 playerPosition = NetClient.World.GetPlayerShip().position;
int mouseMapX = (int)((Input.MouseX - gridPos.X) / gridSize * NetServer.MAPSIZE);
int mouseMapY = (int)((Input.MouseY - gridPos.Y) / gridSize * NetServer.MAPSIZE);
spriteBatch.DrawString(Assets.fontDefault, "POS " + mouseMapX + ", " + mouseMapY, new Vector2(Input.MouseX, Input.MouseY + 25), Color.LightYellow);
spriteBatch.DrawString(Assets.fontDefault, "DIR " +
(int)Utils.CalculateBearing(new Vector2(playerPosition.X, playerPosition.Y),
new Vector2(mouseMapX, mouseMapY)),
new Vector2(Input.MouseX, Input.MouseY + 50),
Color.LightYellow);
spriteBatch.End();
}
protected override void OnUpdate(GameTime gameTime) {}
}
}
|
bsd-3-clause
|
C#
|
d35895b95b8e7f7c3c26179863a17b809bfa7352
|
add toString so it's easier to see in the debugger
|
Willster419/RelicModManager,Willster419/RelhaxModpack,Willster419/RelhaxModpack
|
RelhaxModpack/RelhaxModpack/Database/XmlDatabaseProperty.cs
|
RelhaxModpack/RelhaxModpack/Database/XmlDatabaseProperty.cs
|
using RelhaxModpack.Utilities.Enums;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RelhaxModpack.Database
{
public class XmlDatabaseProperty
{
public string XmlName { get; set; }
public XmlEntryType XmlEntryType { get; set; }
public string PropertyName { get; set; }
public override string ToString()
{
return string.Format("{0} = {1}, {2} = {3}, {4} = {5}", nameof(XmlName), XmlName, nameof(XmlEntryType), XmlEntryType.ToString(), nameof(PropertyName), PropertyName);
}
}
}
|
using RelhaxModpack.Utilities.Enums;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RelhaxModpack.Database
{
public class XmlDatabaseProperty
{
public string XmlName { get; set; }
public XmlEntryType XmlEntryType { get; set; }
public string PropertyName { get; set; }
}
}
|
apache-2.0
|
C#
|
755f3cfd52692397decc3413828851d1eb5ac492
|
Fix comment typo
|
george-jones/csm-exportelectricity
|
ExportElectricity.cs
|
ExportElectricity.cs
|
using ICities;
using ColossalFramework;
using ColossalFramework.Plugins;
using UnityEngine;
using System.IO;
namespace ExportElectricityMod
{
public class ExportElectricity : IUserMod {
public string Name
{
get { return "Export Electricity Mod"; }
}
public string Description
{
get { return "Earn money for unused electricity. Only a modest income for power sources other than the Fusion power plant."; }
}
}
public class EconomyExtension : EconomyExtensionBase
{
private bool updated = false;
private System.DateTime prevDate;
public override long OnUpdateMoneyAmount(long internalMoneyAmount)
{
DistrictManager[] dm_array = UnityEngine.Object.FindObjectsOfType<DistrictManager>();
District d;
double capacity = 0;
double consumption = 0;
double pay_per_mw = 500.0;
double sec_per_day = 75600.0; // for some reason
double sec_per_week = 7 * sec_per_day;
double week_proportion = 0.0;
int export_earnings = 0;
if (dm_array.Length <= 0) {
return internalMoneyAmount;
}
d = dm_array[0].m_districts.m_buffer[0];
capacity = ((double)d.GetElectricityCapacity ()) / 1000.0; // divide by 1000 to get megawatts
consumption = ((double) d.GetElectricityConsumption()) / 1000.0;
if (!updated) {
updated = true;
prevDate = this.managers.threading.simulationTime;
} else {
System.DateTime newDate = this.managers.threading.simulationTime;
System.TimeSpan timeDiff = newDate.Subtract (prevDate);
week_proportion = (((double) timeDiff.TotalSeconds) / sec_per_week);
if (capacity > consumption && week_proportion > 0.0) {
EconomyManager[] em_array = UnityEngine.Object.FindObjectsOfType<EconomyManager>();
export_earnings = (int)(week_proportion * (capacity - consumption) * pay_per_mw);
if (em_array.Length > 0) {
// add income
em_array[0].AddResource(EconomyManager.Resource.PublicIncome,
export_earnings,
ItemClass.Service.None,
ItemClass.SubService.None,
ItemClass.Level.None);
}
} else {
export_earnings = 0;
}
prevDate = newDate;
}
return internalMoneyAmount;
}
}
}
|
using ICities;
using ColossalFramework;
using ColossalFramework.Plugins;
using UnityEngine;
using System.IO;
namespace ExportElectricityMod
{
public class ExportElectricity : IUserMod {
public string Name
{
get { return "Export Electricity Mod"; }
}
public string Description
{
get { return "Earn money for unused electricity. Only a modest income for power sources other than the Fusion power plant."; }
}
}
public class EconomyExtension : EconomyExtensionBase
{
private bool updated = false;
private System.DateTime prevDate;
public override long OnUpdateMoneyAmount(long internalMoneyAmount)
{
DistrictManager[] dm_array = UnityEngine.Object.FindObjectsOfType<DistrictManager>();
District d;
double capacity = 0;
double consumption = 0;
double pay_per_mw = 500.0;
double sec_per_day = 75600.0; // for some reason
double sec_per_week = 7 * sec_per_day;
double week_proportion = 0.0;
int export_earnings = 0;
if (dm_array.Length <= 0) {
return internalMoneyAmount;
}
d = dm_array[0].m_districts.m_buffer[0];
capacity = ((double)d.GetElectricityCapacity ()) / 1000.0; // divide my 1000 to get megawatts
consumption = ((double) d.GetElectricityConsumption()) / 1000.0;
if (!updated) {
updated = true;
prevDate = this.managers.threading.simulationTime;
} else {
System.DateTime newDate = this.managers.threading.simulationTime;
System.TimeSpan timeDiff = newDate.Subtract (prevDate);
week_proportion = (((double) timeDiff.TotalSeconds) / sec_per_week);
if (capacity > consumption && week_proportion > 0.0) {
EconomyManager[] em_array = UnityEngine.Object.FindObjectsOfType<EconomyManager>();
export_earnings = (int)(week_proportion * (capacity - consumption) * pay_per_mw);
if (em_array.Length > 0) {
// add income
em_array[0].AddResource(EconomyManager.Resource.PublicIncome,
export_earnings,
ItemClass.Service.None,
ItemClass.SubService.None,
ItemClass.Level.None);
}
} else {
export_earnings = 0;
}
prevDate = newDate;
}
return internalMoneyAmount;
}
}
}
|
mit
|
C#
|
37977ca8e8928eae0cdbd6eef5e486fb4795423f
|
bump to version 1.2.1
|
Terradue/DotNetOpenSearchDataAnalyzer
|
Terradue.OpenSearch.DataAnalyzer/Properties/AssemblyInfo.cs
|
Terradue.OpenSearch.DataAnalyzer/Properties/AssemblyInfo.cs
|
/*!
\namespace Terradue.OpenSearch.DataAnalyzer
@{
Terradue.OpenSearch.DataAnalyzer provides with a data harvester to scan files using GDAL and to extract Geo, Time and other metadata to export them as profiled structured ATOM feed.
\xrefitem sw_version "Versions" "Software Package Version" 1.2.1
\xrefitem sw_link "Links" "Software Package List" [DotNetOpenSearchDataAnalyzer](https://github.com/Terradue/DotNetOpenSearchDataAnalyzer)
\xrefitem sw_license "License" "Software License" [AGPL](https://github.com/DotNetOpenSearch/Terradue.OpenSearch/blob/master/LICENSE)
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.GDAL.Native
\ingroup OpenSearch
@}
*/
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
using System.Reflection;
using System.Runtime.CompilerServices;
using NuGet4Mono.Extensions;
[assembly: AssemblyTitle ("Terradue.OpenSearch.DataAnalyzer")]
[assembly: AssemblyDescription ("Terradue .Net OpenSearch DataAnalyzer Module Library")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("Terradue")]
[assembly: AssemblyProduct ("Terradue.OpenSearch.DataAnalyzer")]
[assembly: AssemblyCopyright ("Terradue")]
[assembly: AssemblyAuthors("Enguerran Boissier")]
[assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetOpenSearchDataAnalyzer")]
[assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetOpenSearchDataAnalyzer/blob/master/LICENSE")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
[assembly: AssemblyVersion ("1.2.1.*")]
[assembly: AssemblyInformationalVersion ("1.2.1")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config",Watch = true)]
|
/*!
\namespace Terradue.OpenSearch.DataAnalyzer
@{
Terradue.OpenSearch.DataAnalyzer provides with a data harvester to scan files using GDAL and to extract Geo, Time and other metadata to export them as profiled structured ATOM feed.
\xrefitem sw_version "Versions" "Software Package Version" 1.1.5
\xrefitem sw_link "Links" "Software Package List" [DotNetOpenSearchDataAnalyzer](https://github.com/Terradue/DotNetOpenSearchDataAnalyzer)
\xrefitem sw_license "License" "Software License" [AGPL](https://github.com/DotNetOpenSearch/Terradue.OpenSearch/blob/master/LICENSE)
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.GDAL.Native
\ingroup OpenSearch
@}
*/
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
using System.Reflection;
using System.Runtime.CompilerServices;
using NuGet4Mono.Extensions;
[assembly: AssemblyTitle ("Terradue.OpenSearch.DataAnalyzer")]
[assembly: AssemblyDescription ("Terradue .Net OpenSearch DataAnalyzer Module Library")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("Terradue")]
[assembly: AssemblyProduct ("Terradue.OpenSearch.DataAnalyzer")]
[assembly: AssemblyCopyright ("Terradue")]
[assembly: AssemblyAuthors("Enguerran Boissier")]
[assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetOpenSearchDataAnalyzer")]
[assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetOpenSearchDataAnalyzer/blob/master/LICENSE")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
[assembly: AssemblyVersion ("1.1.5.*")]
[assembly: AssemblyInformationalVersion ("1.1.5")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config",Watch = true)]
|
agpl-3.0
|
C#
|
42bb416735467eb0543eab2be0681446ff1fe4e5
|
Remove unused constructor.
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi/Tor/Socks5/Models/Messages/TorSocks5Request.cs
|
WalletWasabi/Tor/Socks5/Models/Messages/TorSocks5Request.cs
|
using System;
using WalletWasabi.Helpers;
using WalletWasabi.Tor.Socks5.Models.Bases;
using WalletWasabi.Tor.Socks5.Models.Fields.ByteArrayFields;
using WalletWasabi.Tor.Socks5.Models.Fields.OctetFields;
namespace WalletWasabi.Tor.Socks5.Models.Messages
{
public class TorSocks5Request : ByteArraySerializableBase
{
public TorSocks5Request(CmdField cmd, AddrField dstAddr, PortField dstPort)
{
Cmd = Guard.NotNull(nameof(cmd), cmd);
DstAddr = Guard.NotNull(nameof(dstAddr), dstAddr);
DstPort = Guard.NotNull(nameof(dstPort), dstPort);
Ver = VerField.Socks5;
Rsv = RsvField.X00;
Atyp = dstAddr.Atyp;
}
#region PropertiesAndMembers
public VerField Ver { get; set; }
public CmdField Cmd { get; set; }
public RsvField Rsv { get; set; }
public AtypField Atyp { get; set; }
public AddrField DstAddr { get; set; }
public PortField DstPort { get; set; }
#endregion PropertiesAndMembers
#region Serialization
public override void FromBytes(byte[] bytes)
{
Guard.NotNullOrEmpty(nameof(bytes), bytes);
Guard.MinimumAndNotNull($"{nameof(bytes)}.{nameof(bytes.Length)}", bytes.Length, 6);
Ver = new VerField(bytes[0]);
Cmd = new CmdField();
Cmd.FromByte(bytes[1]);
Rsv = new RsvField();
Rsv.FromByte(bytes[2]);
Atyp = new AtypField();
Atyp.FromByte(bytes[3]);
DstAddr = new AddrField();
DstAddr.FromBytes(bytes[4..^2]);
DstPort = new PortField();
DstPort.FromBytes(bytes[^2..]);
}
public override byte[] ToBytes() => ByteHelpers.Combine(new byte[] { Ver.ToByte(), Cmd.ToByte(), Rsv.ToByte(), Atyp.ToByte() }, DstAddr.ToBytes(), DstPort.ToBytes());
#endregion Serialization
}
}
|
using System;
using WalletWasabi.Helpers;
using WalletWasabi.Tor.Socks5.Models.Bases;
using WalletWasabi.Tor.Socks5.Models.Fields.ByteArrayFields;
using WalletWasabi.Tor.Socks5.Models.Fields.OctetFields;
namespace WalletWasabi.Tor.Socks5.Models.Messages
{
public class TorSocks5Request : ByteArraySerializableBase
{
#region Constructors
public TorSocks5Request()
{
}
public TorSocks5Request(CmdField cmd, AddrField dstAddr, PortField dstPort)
{
Cmd = Guard.NotNull(nameof(cmd), cmd);
DstAddr = Guard.NotNull(nameof(dstAddr), dstAddr);
DstPort = Guard.NotNull(nameof(dstPort), dstPort);
Ver = VerField.Socks5;
Rsv = RsvField.X00;
Atyp = dstAddr.Atyp;
}
#endregion Constructors
#region PropertiesAndMembers
public VerField Ver { get; set; }
public CmdField Cmd { get; set; }
public RsvField Rsv { get; set; }
public AtypField Atyp { get; set; }
public AddrField DstAddr { get; set; }
public PortField DstPort { get; set; }
#endregion PropertiesAndMembers
#region Serialization
public override void FromBytes(byte[] bytes)
{
Guard.NotNullOrEmpty(nameof(bytes), bytes);
Guard.MinimumAndNotNull($"{nameof(bytes)}.{nameof(bytes.Length)}", bytes.Length, 6);
Ver = new VerField(bytes[0]);
Cmd = new CmdField();
Cmd.FromByte(bytes[1]);
Rsv = new RsvField();
Rsv.FromByte(bytes[2]);
Atyp = new AtypField();
Atyp.FromByte(bytes[3]);
DstAddr = new AddrField();
DstAddr.FromBytes(bytes[4..^2]);
DstPort = new PortField();
DstPort.FromBytes(bytes[^2..]);
}
public override byte[] ToBytes() => ByteHelpers.Combine(new byte[] { Ver.ToByte(), Cmd.ToByte(), Rsv.ToByte(), Atyp.ToByte() }, DstAddr.ToBytes(), DstPort.ToBytes());
#endregion Serialization
}
}
|
mit
|
C#
|
c02b6a63ef0d2b48ad7f4175d9a65f43f61efa07
|
Change Windows service account to LocalService because of some security issue with mounted drives
|
majorimi/DirSync
|
src/DirSyncService/Installer/DirSyncInstaller.cs
|
src/DirSyncService/Installer/DirSyncInstaller.cs
|
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Security.Permissions;
using System.ServiceProcess;
namespace DirSyncService.Installer
{
[RunInstaller(true)]
public partial class DirSyncInstaller : System.Configuration.Install.Installer
{
private const string ServiceName = "DirSync";
private const string DisplayName = "DirSync Backup Service by Major";
private ServiceInstaller serviceInstaller;
private ServiceProcessInstaller processInstaller;
public DirSyncInstaller()
{
// Instantiate installers for process and services.
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
// The services run under the system account.
processInstaller.Account = ServiceAccount.LocalService;
//processInstaller.Username = "";
//processInstaller.Password = "";
// The services are started Automatic.
serviceInstaller.StartType = ServiceStartMode.Automatic;
// ServiceName must equal those on ServiceBase derived classes.
serviceInstaller.ServiceName = ServiceName;
serviceInstaller.DisplayName = DisplayName;
serviceInstaller.Description = "Real time Directory Synchronization Service for data backup";
// Add installers to collection. Order is not important.
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
[SecurityPermission(SecurityAction.Demand)]
protected override void OnAfterInstall(IDictionary savedState)
{
try
{
base.OnAfterInstall(savedState);
//Interact with Desktop
WindwosServiceInstallerHelper.SetWindowsService(ServiceName, "DesktopInteract", true);
WindwosServiceInstallerHelper.StartWindowsService(ServiceName, false);
WindwosServiceInstallerHelper.CheckMsmqService();
}
catch (Exception ex)
{
EventLog.WriteEntry("DeploymentBoard IntegrationService - AfterInstall", ex.ToString(),
EventLogEntryType.Error);
}
}
}
}
|
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Security.Permissions;
using System.ServiceProcess;
namespace DirSyncService.Installer
{
[RunInstaller(true)]
public partial class DirSyncInstaller : System.Configuration.Install.Installer
{
private const string ServiceName = "DirSync";
private const string DisplayName = "DirSync Backup Service by Major";
private ServiceInstaller serviceInstaller;
private ServiceProcessInstaller processInstaller;
public DirSyncInstaller()
{
// Instantiate installers for process and services.
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
// The services run under the system account.
processInstaller.Account = ServiceAccount.LocalSystem;
// The services are started Automatic.
serviceInstaller.StartType = ServiceStartMode.Automatic;
// ServiceName must equal those on ServiceBase derived classes.
serviceInstaller.ServiceName = ServiceName;
serviceInstaller.DisplayName = DisplayName;
serviceInstaller.Description = "Real time Directory Synchronization Service for data backup";
// Add installers to collection. Order is not important.
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
[SecurityPermission(SecurityAction.Demand)]
protected override void OnAfterInstall(IDictionary savedState)
{
try
{
base.OnAfterInstall(savedState);
//Interact with Desktop
WindwosServiceInstallerHelper.SetWindowsService(ServiceName, "DesktopInteract", true);
WindwosServiceInstallerHelper.StartWindowsService(ServiceName, false);
WindwosServiceInstallerHelper.CheckMsmqService();
}
catch (Exception ex)
{
EventLog.WriteEntry("DeploymentBoard IntegrationService - AfterInstall", ex.ToString(),
EventLogEntryType.Error);
}
}
}
}
|
apache-2.0
|
C#
|
e7847894f4a40226e3b2af756e4ca26fd4400eba
|
Update StyleIdToStyleConverter.cs
|
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
|
src/Draw2D/Converters/StyleIdToStyleConverter.cs
|
src/Draw2D/Converters/StyleIdToStyleConverter.cs
|
// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
using Draw2D.ViewModels.Containers;
namespace Draw2D.Converters
{
public class StyleIdToStyleConverter : IMultiValueConverter
{
public object Convert(IList<object> values, Type targetType, object parameter, CultureInfo culture)
{
if (values?.Count == 2 && values[0] is string styleId && values[1] is IStyleLibrary styleLibrary)
{
return styleLibrary.Get(styleId);
}
return AvaloniaProperty.UnsetValue;
}
}
}
|
// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
using Draw2D.ViewModels;
using Draw2D.ViewModels.Containers;
using Draw2D.ViewModels.Style;
namespace Draw2D.Converters
{
public class StyleIdToStyleConverter : IMultiValueConverter
{
public object Convert(IList<object> values, Type targetType, object parameter, CultureInfo culture)
{
if (values?.Count == 2 && values[0] is string styleId && values[1] is IStyleLibrary styleLibrary)
{
return styleLibrary.Get(styleId);
}
return AvaloniaProperty.UnsetValue;
}
}
}
|
mit
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.