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 |
---|---|---|---|---|---|---|---|---|
4132c183f5ac5860c5d0f19c436b04e24a66d92e | set default namespaces | campersau/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer | Core/Utility/DiagnosticsClient.cs | Core/Utility/DiagnosticsClient.cs | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bugsnag;
namespace NuGetPe
{
public static class DiagnosticsClient
{
static bool _initialized;
static Client _client;
#if STORE
const string Channel = "store";
#elif NIGHTLY
const string Channel = "nightly";
#elif CHOCO
const string Channel = "chocolatey";
#else
const string Channel = "zip";
#endif
public static void Initialize(string apiKey)
{
_initialized = true;
var config = new Configuration(apiKey)
{
AutoCaptureSessions = true,
AutoNotify = true,
NotifyReleaseStages = new[] { "development", "store", "nightly", "chocolatey", "zip" },
ProjectNamespaces = new [] {"NuGetPe", "PackageExplorer", "PackageExplorerViewModel", "NuGetPackageExplorer.Types" },
ReleaseStage = Channel,
AppVersion = ThisAssembly.AssemblyInformationalVersion
};
// Always default to development if we're in the debugger
if (Debugger.IsAttached)
{
config.ReleaseStage = "development";
}
_client = new Client(config);
}
public static void Notify(Exception exception)
{
if (!_initialized) return;
_client.Notify(exception);
}
public static void Notify(Exception exception, Middleware callback)
{
if (!_initialized) return;
_client.Notify(exception, callback);
}
public static void Breadcrumb(string message)
{
if (!_initialized) return;
_client.Breadcrumbs.Leave(message);
}
public static void Breadcrumb(string message, BreadcrumbType type, IDictionary<string, string> metadata = null)
{
if (!_initialized) return;
_client.Breadcrumbs.Leave(message, type, metadata);
}
}
}
| using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bugsnag;
namespace NuGetPe
{
public static class DiagnosticsClient
{
static bool _initialized;
static Client _client;
#if STORE
const string Channel = "store";
#elif NIGHTLY
const string Channel = "nightly";
#elif CHOCO
const string Channel = "chocolatey";
#else
const string Channel = "zip";
#endif
public static void Initialize(string apiKey)
{
_initialized = true;
var config = new Configuration(apiKey)
{
AutoCaptureSessions = true,
AutoNotify = true,
NotifyReleaseStages = new[] { "development", "store", "nightly", "chocolatey", "zip" },
ReleaseStage = Channel
};
// Always default to development if we're in the debugger
if (Debugger.IsAttached)
{
config.ReleaseStage = "development";
}
_client = new Client(config);
}
public static void Notify(Exception exception)
{
if (!_initialized) return;
_client.Notify(exception);
}
public static void Notify(Exception exception, Middleware callback)
{
if (!_initialized) return;
_client.Notify(exception, callback);
}
public static void Breadcrumb(string message)
{
if (!_initialized) return;
_client.Breadcrumbs.Leave(message);
}
public static void Breadcrumb(string message, BreadcrumbType type, IDictionary<string, string> metadata = null)
{
if (!_initialized) return;
_client.Breadcrumbs.Leave(message, type, metadata);
}
}
}
| mit | C# |
6b0a8a66e94609e8e81dcc2d38db2b368bd17130 | fix type heirarchy on facade | mbrit/MetroLog,onovotny/MetroLog,mbrit/MetroLog,mbrit/MetroLog,onovotny/MetroLog,onovotny/MetroLog | MetroLog/StreamingFileTarget.cs | MetroLog/StreamingFileTarget.cs | using MetroLog.Layouts;
using MetroLog.Targets;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace MetroLog.Targets
{
/// <summary>
/// Defines a target that will append messages to a single file.
/// </summary>
public class StreamingFileTarget : FileTarget
{
public StreamingFileTarget()
: this(new SingleLineLayout())
{
}
public StreamingFileTarget(Layout layout)
: base(layout)
{
}
protected override Task WriteTextToFileCore(StreamWriter streamWriter, string contents)
{
throw new NotImplementedException();
}
}
public abstract class FileTarget : FileTargetBase
{
protected FileTarget(Layout layout) : base(layout)
{
}
protected override Task EnsureInitialized()
{
throw new NotImplementedException();
}
protected sealed override Task DoCleanup(Regex pattern, DateTime threshold)
{
throw new NotImplementedException();
}
protected override Task<Stream> GetCompressedLogsInternal()
{
throw new NotImplementedException();
}
protected sealed override Task<LogWriteOperation> DoWriteAsync(StreamWriter streamWriter, string contents, LogEventInfo entry)
{
throw new NotImplementedException();
}
protected abstract Task WriteTextToFileCore(StreamWriter file, string contents);
protected override Task<Stream> GetWritableStreamForFile(string fileName)
{
throw new NotImplementedException();
}
}
}
| using MetroLog.Layouts;
using MetroLog.Targets;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace MetroLog.Targets
{
/// <summary>
/// Defines a target that will append messages to a single file.
/// </summary>
public class StreamingFileTarget : FileTarget
{
public StreamingFileTarget()
: this(new SingleLineLayout())
{
}
public StreamingFileTarget(Layout layout)
: base(layout)
{
}
protected override Task EnsureInitialized()
{
throw new NotImplementedException();
}
protected override Task DoCleanup(Regex pattern, DateTime threshold)
{
throw new NotImplementedException();
}
protected override Task<Stream> GetCompressedLogsInternal()
{
throw new NotImplementedException();
}
protected override Task<LogWriteOperation> DoWriteAsync(StreamWriter streamWriter, string contents, LogEventInfo entry)
{
throw new NotImplementedException();
}
protected override Task<Stream> GetWritableStreamForFile(string fileName)
{
throw new NotImplementedException();
}
}
public abstract class FileTarget : FileTargetBase
{
protected FileTarget(Layout layout) : base(layout)
{
}
}
}
| mit | C# |
9d479cee936fd12ced850fe3aa9a5ed355a02997 | remove comments from test file | jtlibing/azure-powershell,krkhan/azure-powershell,rohmano/azure-powershell,arcadiahlyy/azure-powershell,AzureRT/azure-powershell,akurmi/azure-powershell,akurmi/azure-powershell,pankajsn/azure-powershell,jtlibing/azure-powershell,ankurchoubeymsft/azure-powershell,yantang-msft/azure-powershell,nemanja88/azure-powershell,juvchan/azure-powershell,yantang-msft/azure-powershell,Matt-Westphal/azure-powershell,hovsepm/azure-powershell,CamSoper/azure-powershell,yantang-msft/azure-powershell,alfantp/azure-powershell,rohmano/azure-powershell,alfantp/azure-powershell,atpham256/azure-powershell,devigned/azure-powershell,zhencui/azure-powershell,zhencui/azure-powershell,yantang-msft/azure-powershell,hovsepm/azure-powershell,jtlibing/azure-powershell,hovsepm/azure-powershell,dulems/azure-powershell,atpham256/azure-powershell,juvchan/azure-powershell,naveedaz/azure-powershell,Matt-Westphal/azure-powershell,arcadiahlyy/azure-powershell,atpham256/azure-powershell,hungmai-msft/azure-powershell,AzureAutomationTeam/azure-powershell,naveedaz/azure-powershell,naveedaz/azure-powershell,haocs/azure-powershell,krkhan/azure-powershell,CamSoper/azure-powershell,zhencui/azure-powershell,ClogenyTechnologies/azure-powershell,ankurchoubeymsft/azure-powershell,pankajsn/azure-powershell,seanbamsft/azure-powershell,atpham256/azure-powershell,haocs/azure-powershell,zhencui/azure-powershell,TaraMeyer/azure-powershell,AzureAutomationTeam/azure-powershell,AzureAutomationTeam/azure-powershell,hungmai-msft/azure-powershell,arcadiahlyy/azure-powershell,AzureAutomationTeam/azure-powershell,nemanja88/azure-powershell,devigned/azure-powershell,ankurchoubeymsft/azure-powershell,krkhan/azure-powershell,AzureRT/azure-powershell,ankurchoubeymsft/azure-powershell,ClogenyTechnologies/azure-powershell,hungmai-msft/azure-powershell,pankajsn/azure-powershell,Matt-Westphal/azure-powershell,rohmano/azure-powershell,akurmi/azure-powershell,rohmano/azure-powershell,devigned/azure-powershell,atpham256/azure-powershell,hovsepm/azure-powershell,AzureAutomationTeam/azure-powershell,ClogenyTechnologies/azure-powershell,pankajsn/azure-powershell,yantang-msft/azure-powershell,pankajsn/azure-powershell,krkhan/azure-powershell,devigned/azure-powershell,atpham256/azure-powershell,AzureRT/azure-powershell,juvchan/azure-powershell,CamSoper/azure-powershell,seanbamsft/azure-powershell,nemanja88/azure-powershell,jtlibing/azure-powershell,seanbamsft/azure-powershell,hovsepm/azure-powershell,arcadiahlyy/azure-powershell,TaraMeyer/azure-powershell,hungmai-msft/azure-powershell,devigned/azure-powershell,AzureRT/azure-powershell,yoavrubin/azure-powershell,shuagarw/azure-powershell,naveedaz/azure-powershell,CamSoper/azure-powershell,TaraMeyer/azure-powershell,krkhan/azure-powershell,seanbamsft/azure-powershell,zhencui/azure-powershell,seanbamsft/azure-powershell,CamSoper/azure-powershell,yoavrubin/azure-powershell,yoavrubin/azure-powershell,dulems/azure-powershell,yoavrubin/azure-powershell,shuagarw/azure-powershell,dulems/azure-powershell,alfantp/azure-powershell,yantang-msft/azure-powershell,haocs/azure-powershell,Matt-Westphal/azure-powershell,naveedaz/azure-powershell,ClogenyTechnologies/azure-powershell,krkhan/azure-powershell,haocs/azure-powershell,naveedaz/azure-powershell,seanbamsft/azure-powershell,AzureRT/azure-powershell,shuagarw/azure-powershell,AzureRT/azure-powershell,alfantp/azure-powershell,rohmano/azure-powershell,shuagarw/azure-powershell,jtlibing/azure-powershell,hungmai-msft/azure-powershell,rohmano/azure-powershell,ankurchoubeymsft/azure-powershell,akurmi/azure-powershell,dulems/azure-powershell,zhencui/azure-powershell,devigned/azure-powershell,akurmi/azure-powershell,ClogenyTechnologies/azure-powershell,alfantp/azure-powershell,Matt-Westphal/azure-powershell,yoavrubin/azure-powershell,TaraMeyer/azure-powershell,juvchan/azure-powershell,haocs/azure-powershell,pankajsn/azure-powershell,hungmai-msft/azure-powershell,dulems/azure-powershell,TaraMeyer/azure-powershell,arcadiahlyy/azure-powershell,nemanja88/azure-powershell,juvchan/azure-powershell,nemanja88/azure-powershell,shuagarw/azure-powershell,AzureAutomationTeam/azure-powershell | src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerCommunicationLinkCrudTests.cs | src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerCommunicationLinkCrudTests.cs | // ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
{
public class ServerCommunicationLinkCrudTests : SqlTestsBase
{
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkCreate()
{
RunPowerShellTest("Test-CreateServerCommunicationLink");
}
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkGet()
{
RunPowerShellTest("Test-GetServerCommunicationLink");
}
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkRemove()
{
RunPowerShellTest("Test-RemoveServerCommunicationLink");
}
}
}
| // ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
{
public class ServerCommunicationLinkCrudTests : SqlTestsBase
{
// TODO: adumitr: re-enable the tests when feature is fully enabled in the region the tests use
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkCreate()
{
RunPowerShellTest("Test-CreateServerCommunicationLink");
}
// TODO: adumitr: re-enable the tests when feature is fully enabled in the region the tests use
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkGet()
{
RunPowerShellTest("Test-GetServerCommunicationLink");
}
// TODO: adumitr: re-enable the tests when feature is fully enabled in the region the tests use
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkRemove()
{
RunPowerShellTest("Test-RemoveServerCommunicationLink");
}
}
}
| apache-2.0 | C# |
4274cc401f9522bea1aa88190718981b03381a19 | Remove machine name from method calls since it is no longer needed after refactoring implementation | Paymentsense/Dapper.SimpleSave | PS.Mothership.Core/PS.Mothership.Core.Common/SignalRConnectionHandling/IClientsCollection.cs | PS.Mothership.Core/PS.Mothership.Core.Common/SignalRConnectionHandling/IClientsCollection.cs | namespace PS.Mothership.Core.Common.SignalRConnectionHandling
{
public interface IClientsCollection
{
ISignalRUser Get(string username);
ISignalRUser GetOrAdd(string username);
void AddOrReplace(ISignalRUser inputUser);
}
}
| namespace PS.Mothership.Core.Common.SignalRConnectionHandling
{
public interface IClientsCollection
{
ISignalRUser Get(string machineName, string username);
ISignalRUser GetOrAdd(string machineName, string username);
void AddOrReplace(ISignalRUser inputUser);
}
}
| mit | C# |
131a42b89317e8a38246c8bb8ee56c1cfd9f2ec9 | Fix Sequence contains no matching element | mikescandy/BottomNavigationBarXF,thrive-now/BottomNavigationBarXF,r2d2rigo/BottomNavigationBarXF,ice-j/BottomNavigationBarXF | BottomBar.Droid/Utils/ReflectedProxy.cs | BottomBar.Droid/Utils/ReflectedProxy.cs | /*
* BottomNavigationBar for Xamarin Forms
* Copyright (c) 2016 Thrive GmbH and others (http://github.com/thrive-now).
*
* 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.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace BottomBar.Droid
{
public class ReflectedProxy<T> where T : class
{
private object _target;
private readonly Dictionary<string, PropertyInfo> _cachedPropertyInfo;
private readonly Dictionary<string, MethodInfo> _cachedMethodInfo;
private readonly IEnumerable<PropertyInfo> _targetPropertyInfoList;
private readonly IEnumerable<MethodInfo> _targetMethodInfoList;
public ReflectedProxy(T target)
{
_target = target;
_cachedPropertyInfo = new Dictionary<string, PropertyInfo>();
_cachedMethodInfo = new Dictionary<string, MethodInfo>();
TypeInfo typeInfo = typeof(T).GetTypeInfo();
_targetPropertyInfoList = typeInfo.GetRuntimeProperties();
_targetMethodInfoList = typeInfo.GetRuntimeMethods();
}
public void SetPropertyValue(object value, [CallerMemberName] string propertyName = "")
{
GetPropertyInfo(propertyName).SetValue(_target, value);
}
public TPropertyValue GetPropertyValue<TPropertyValue>([CallerMemberName] string propertyName = "")
{
return (TPropertyValue)GetPropertyInfo(propertyName).GetValue(_target);
}
public object Call([CallerMemberName] string methodName = "", object[] parameters = null)
{
if (!_cachedMethodInfo.ContainsKey(methodName))
{
_cachedMethodInfo[methodName] = _targetMethodInfoList.Single(mi => mi.Name == methodName || mi.Name.Contains("." + methodName));
}
return _cachedMethodInfo[methodName].Invoke(_target, parameters);
}
PropertyInfo GetPropertyInfo(string propertyName)
{
if (!_cachedPropertyInfo.ContainsKey(propertyName))
{
_cachedPropertyInfo[propertyName] = _targetPropertyInfoList.Single(pi => pi.Name == propertyName || pi.Name.Contains("." + propertyName));
}
return _cachedPropertyInfo[propertyName];
}
}
}
| /*
* BottomNavigationBar for Xamarin Forms
* Copyright (c) 2016 Thrive GmbH and others (http://github.com/thrive-now).
*
* 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.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace BottomBar.Droid
{
public class ReflectedProxy<T> where T : class
{
private object _target;
private readonly Dictionary<string, PropertyInfo> _cachedPropertyInfo;
private readonly Dictionary<string, MethodInfo> _cachedMethodInfo;
private readonly IEnumerable<PropertyInfo> _targetPropertyInfoList;
private readonly IEnumerable<MethodInfo> _targetMethodInfoList;
public ReflectedProxy (T target)
{
_target = target;
_cachedPropertyInfo = new Dictionary<string, PropertyInfo> ();
_cachedMethodInfo = new Dictionary<string, MethodInfo> ();
TypeInfo typeInfo = typeof (T).GetTypeInfo ();
_targetPropertyInfoList = typeInfo.GetRuntimeProperties ();
_targetMethodInfoList = typeInfo.GetRuntimeMethods ();
}
public void SetPropertyValue (object value, [CallerMemberName] string propertyName = "")
{
GetPropertyInfo (propertyName).SetValue (_target, value);
}
public TPropertyValue GetPropertyValue<TPropertyValue> ([CallerMemberName] string propertyName = "")
{
return (TPropertyValue)GetPropertyInfo (propertyName).GetValue (_target);
}
public object Call ([CallerMemberName] string methodName = "", object[] parameters = null)
{
if (!_cachedMethodInfo.ContainsKey (methodName)) {
_cachedMethodInfo [methodName] = _targetMethodInfoList.Single (mi => mi.Name == methodName);
}
return _cachedMethodInfo [methodName].Invoke (_target, parameters);
}
PropertyInfo GetPropertyInfo (string propertyName)
{
if (!_cachedPropertyInfo.ContainsKey (propertyName)) {
_cachedPropertyInfo [propertyName] = _targetPropertyInfoList.Single (pi => pi.Name == propertyName);
}
return _cachedPropertyInfo [propertyName];
}
}
}
| mit | C# |
b0494fcf8fd618577af205d7285adbb41118c0bf | Remove debug code | NateShoffner/Strike.NET | Strike.NET/V2/Converters/FileInfoConverter.cs | Strike.NET/V2/Converters/FileInfoConverter.cs | #region
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
#endregion
namespace StrikeNET.V2.Converters
{
internal class FileInfoConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
var files = new List<TorrentFileInfo>();
var fileInfo = JObject.Load(reader);
var fileNamesArray = fileInfo.SelectToken("file_names") as JArray;
var fileLengthsArray = fileInfo.SelectToken("file_lengths") as JArray;
if (fileNamesArray != null && fileLengthsArray != null)
{
var fileNames = new List<string>(fileNamesArray.Values<string>());
var fileLengths = new List<long>(fileLengthsArray.Values<long>());
//increment using lengths since 'file_names'
//includes directories as well
var total = fileLengths.Count;
for (var i = 0; i < total; i++)
{
var fi = new TorrentFileInfo(fileNames[i].Trim(), fileLengths[i]);
files.Add(fi);
}
}
return files;
}
public override bool CanConvert(Type objectType)
{
return objectType == typeof(List<TorrentFileInfo>);
}
}
} | #region
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
#endregion
namespace StrikeNET.V2.Converters
{
internal class FileInfoConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
var files = new List<TorrentFileInfo>();
Console.WriteLine("loading");
var fileInfo = JObject.Load(reader);
var fileNamesArray = fileInfo.SelectToken("file_names") as JArray;
var fileLengthsArray = fileInfo.SelectToken("file_lengths") as JArray;
if (fileNamesArray != null && fileLengthsArray != null)
{
var fileNames = new List<string>(fileNamesArray.Values<string>());
var fileLengths = new List<long>(fileLengthsArray.Values<long>());
//increment using lengths since 'file_names'
//includes directories as well
var total = fileLengths.Count;
for (var i = 0; i < total; i++)
{
var fi = new TorrentFileInfo(fileNames[i].Trim(), fileLengths[i]);
files.Add(fi);
}
}
return files;
}
public override bool CanConvert(Type objectType)
{
return objectType == typeof(List<TorrentFileInfo>);
}
}
} | mit | C# |
1d9898ac3ce5d85a539eab10a1c97ee3b4d760dc | Update CommonTests.cs | coman3/Google.Music | GoogleMusicApi.UWP.Tests/CommonTests.cs | GoogleMusicApi.UWP.Tests/CommonTests.cs | using System;
using System.IO;
using System.Threading.Tasks;
using GoogleMusicApi.UWP.Common;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
namespace GoogleMusicApi.UWP.Tests
{
[TestClass]
public class CommonTests
{
public static Tuple<string, string> GetAccount()
{
//if (!File.Exists(_accountPath))
//{
// Assert.Fail("account.txt file not found: " + _accountPath);
//}
//var file = File.ReadAllLines(_accountPath);
return new Tuple<string, string>();
}
[TestMethod]
public void FindFile()
{
//if (!File.Exists(_accountPath))
//{
// Assert.Fail("account.txt file not found: " + _accountPath);
//}
}
[TestMethod]
public async Task Login()
{
var account = CommonTests.GetAccount();
var mc = new MobileClient();
Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
}
}
}
| using System;
using System.IO;
using System.Threading.Tasks;
using GoogleMusicApi.UWP.Common;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
namespace GoogleMusicApi.UWP.Tests
{
[TestClass]
public class CommonTests
{
public static Tuple<string, string> GetAccount()
{
//if (!File.Exists(_accountPath))
//{
// Assert.Fail("account.txt file not found: " + _accountPath);
//}
//var file = File.ReadAllLines(_accountPath);
return new Tuple<string, string>("dev.lvelden", "qwertasd123");
}
[TestMethod]
public void FindFile()
{
//if (!File.Exists(_accountPath))
//{
// Assert.Fail("account.txt file not found: " + _accountPath);
//}
}
[TestMethod]
public async Task Login()
{
var account = CommonTests.GetAccount();
var mc = new MobileClient();
Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
}
}
} | cc0-1.0 | C# |
1c63c1d5b051e9b946f29dbe14085d0c892a48d0 | Add overload for By. | ExRam/ExRam.Gremlinq | ExRam.Gremlinq.Core/Extensions/ProjectBuilderExtensions.cs | ExRam.Gremlinq.Core/Extensions/ProjectBuilderExtensions.cs | using System;
using System.Linq.Expressions;
namespace ExRam.Gremlinq.Core
{
public static class ProjectBuilderExtensions
{
public static IProjectDynamicBuilder<TSourceQuery, TElement> By<TSourceQuery, TElement>(this IProjectDynamicBuilder<TSourceQuery, TElement> projectBuilder, Expression<Func<TElement, object>> projection)
where TSourceQuery : IElementGremlinQuery<TElement>
{
if (projection.Body.StripConvert() is MemberExpression memberExpression)
return projectBuilder.By(memberExpression.Member.Name, projection);
throw new ExpressionNotSupportedException(projection);
}
public static IProjectDynamicBuilder<TSourceQuery, TElement> By<TSourceQuery, TElement>(this IProjectDynamicBuilder<TSourceQuery, TElement> projectBuilder, string name, Expression<Func<TElement, object>> projection)
where TSourceQuery : IElementGremlinQuery<TElement>
{
return projectBuilder.By(name, _ => _.Values(projection));
}
}
}
| using System;
using System.Linq.Expressions;
namespace ExRam.Gremlinq.Core
{
public static class ProjectBuilderExtensions
{
public static IProjectDynamicBuilder<TSourceQuery, TElement> By<TSourceQuery, TElement>(this IProjectDynamicBuilder<TSourceQuery, TElement> projectBuilder, Expression<Func<TElement, object>> projection)
where TSourceQuery : IElementGremlinQuery<TElement>
{
if (projection.Body.StripConvert() is MemberExpression memberExpression)
return projectBuilder.By(memberExpression.Member.Name, _ => _.Values(projection));
throw new ExpressionNotSupportedException(projection);
}
}
}
| mit | C# |
c95f0b88fd7b48a8692bda924b8fa8a259ca85be | Undo the temporary hack I added and use message.UniqueKey() instead of Id as the equality check | Intelliflo/JustSaying,eric-davis/JustSaying,Intelliflo/JustSaying | JustSaying.Messaging/MessageHandling/ExactlyOnceHandler.cs | JustSaying.Messaging/MessageHandling/ExactlyOnceHandler.cs | using System;
using JustSaying.Models;
namespace JustSaying.Messaging.MessageHandling
{
public class ExactlyOnceHandler<T> : IHandler<T> where T : Message
{
private readonly IHandler<T> _inner;
private readonly IMessageLock _messageLock;
private const int TEMPORARY_LOCK_SECONDS = 15;
public ExactlyOnceHandler(IHandler<T> inner, IMessageLock messageLock)
{
_inner = inner;
_messageLock = messageLock;
}
public bool Handle(T message)
{
var lockKey = message.UniqueKey();
bool canLock = _messageLock.TryAquire(lockKey, TimeSpan.FromSeconds(TEMPORARY_LOCK_SECONDS));
if (!canLock)
return true;
try
{
var successfullyHandled = _inner.Handle(message);
if (successfullyHandled)
{
_messageLock.TryAquire(lockKey);
}
return successfullyHandled;
}
catch
{
_messageLock.Release(lockKey);
throw;
}
}
}
}
| using System;
using JustSaying.Models;
namespace JustSaying.Messaging.MessageHandling
{
public class ExactlyOnceHandler<T> : IHandler<T> where T : Message
{
private readonly IHandler<T> _inner;
private readonly IMessageLock _messageLock;
private const int TEMPORARY_LOCK_SECONDS = 15;
public ExactlyOnceHandler(IHandler<T> inner, IMessageLock messageLock)
{
_inner = inner;
_messageLock = messageLock;
}
public bool Handle(T message)
{
var lockKey = message.Id.ToString();
bool canLock = _messageLock.TryAquire(lockKey, TimeSpan.FromSeconds(TEMPORARY_LOCK_SECONDS));
if (!canLock)
return true;
try
{
var successfullyHandled = _inner.Handle(message);
if (successfullyHandled)
{
_messageLock.TryAquire(lockKey);
}
return successfullyHandled;
}
catch
{
_messageLock.Release(lockKey);
throw;
}
}
}
}
| apache-2.0 | C# |
1b3e06e0846087caef5e7407238f568bab4428db | Fix appveyor build. | MonkAlex/MangaReader | MangaReader/ViewModel/Setting/ProxySettingSelectorModel.cs | MangaReader/ViewModel/Setting/ProxySettingSelectorModel.cs | using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using MangaReader.Core.Account;
using MangaReader.Core.NHibernate;
using MangaReader.Core.Services;
using MangaReader.ViewModel.Primitive;
namespace MangaReader.ViewModel.Setting
{
public class ProxySettingSelectorModel : BaseViewModel
{
public ProxySettingModel SelectedProxySettingModel
{
get => selectedProxySettingModel;
set
{
if (!Equals(selectedProxySettingModel, value))
{
if (value != null && value.Id == default(int))
{
lastValidProxySettingModel = selectedProxySettingModel;
CreateNew().LogException();
}
selectedProxySettingModel = value;
OnPropertyChanged();
}
}
}
private ProxySettingModel selectedProxySettingModel;
private ProxySettingModel lastValidProxySettingModel;
public ObservableCollection<ProxySettingModel> ProxySettingModels { get; private set; }
public async Task CreateNew()
{
using (var context = Repository.GetEntityContext())
{
var setting = new ProxySetting(ProxySettingType.Manual);
await context.Save(setting).ConfigureAwait(true);
var model = new ProxySettingModel(setting);
model.Show();
if (model.IsSaved)
{
this.ProxySettingModels.Insert(ProxySettingModels.Count - 1, model);
this.SelectedProxySettingModel = model;
}
else
{
await context.Delete(setting).ConfigureAwait(true);
SelectedProxySettingModel = lastValidProxySettingModel;
}
}
}
public void EditModel()
{
SelectedProxySettingModel.Show();
}
public ProxySettingSelectorModel(ProxySetting proxySetting, ObservableCollection<ProxySettingModel> sharedProxySettingModels)
{
this.ProxySettingModels = sharedProxySettingModels;
this.SelectedProxySettingModel = ProxySettingModels.FirstOrDefault(m => m.Id == proxySetting.Id);
}
}
}
| using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using MangaReader.Core.Account;
using MangaReader.Core.NHibernate;
using MangaReader.Core.Services;
using MangaReader.ViewModel.Primitive;
namespace MangaReader.ViewModel.Setting
{
public class ProxySettingSelectorModel : BaseViewModel
{
public ProxySettingModel SelectedProxySettingModel
{
get => selectedProxySettingModel;
set
{
if (!Equals(selectedProxySettingModel, value))
{
if (value != null && value.Id == default)
{
lastValidProxySettingModel = selectedProxySettingModel;
CreateNew().LogException();
}
selectedProxySettingModel = value;
OnPropertyChanged();
}
}
}
private ProxySettingModel selectedProxySettingModel;
private ProxySettingModel lastValidProxySettingModel;
public ObservableCollection<ProxySettingModel> ProxySettingModels { get; private set; }
public async Task CreateNew()
{
using (var context = Repository.GetEntityContext())
{
var setting = new ProxySetting(ProxySettingType.Manual);
await context.Save(setting).ConfigureAwait(true);
var model = new ProxySettingModel(setting);
model.Show();
if (model.IsSaved)
{
this.ProxySettingModels.Insert(ProxySettingModels.Count - 1, model);
this.SelectedProxySettingModel = model;
}
else
{
await context.Delete(setting).ConfigureAwait(true);
SelectedProxySettingModel = lastValidProxySettingModel;
}
}
}
public void EditModel()
{
SelectedProxySettingModel.Show();
}
public ProxySettingSelectorModel(ProxySetting proxySetting, ObservableCollection<ProxySettingModel> sharedProxySettingModels)
{
this.ProxySettingModels = sharedProxySettingModels;
this.SelectedProxySettingModel = ProxySettingModels.FirstOrDefault(m => m.Id == proxySetting.Id);
}
}
}
| mit | C# |
527f2e29cfc751be3b7c81d8892dbf65345d11d9 | Remove unnecessary try-catch blocks | Fluzzarn/LiveSplit,glasnonck/LiveSplit,Jiiks/LiveSplit,kugelrund/LiveSplit,kugelrund/LiveSplit,LiveSplit/LiveSplit,PackSciences/LiveSplit,Fluzzarn/LiveSplit,stoye/LiveSplit,CryZe/LiveSplit,CryZe/LiveSplit,Seldszar/LiveSplit,ROMaster2/LiveSplit,stoye/LiveSplit,glasnonck/LiveSplit,stoye/LiveSplit,PackSciences/LiveSplit,zoton2/LiveSplit,Jiiks/LiveSplit,drtchops/LiveSplit,Dalet/LiveSplit,Dalet/LiveSplit,Glurmo/LiveSplit,Fluzzarn/LiveSplit,Seldszar/LiveSplit,drtchops/LiveSplit,chloe747/LiveSplit,drtchops/LiveSplit,chloe747/LiveSplit,Dalet/LiveSplit,glasnonck/LiveSplit,ROMaster2/LiveSplit,Jiiks/LiveSplit,zoton2/LiveSplit,madzinah/LiveSplit,Glurmo/LiveSplit,Glurmo/LiveSplit,CryZe/LiveSplit,PackSciences/LiveSplit,chloe747/LiveSplit,kugelrund/LiveSplit,Seldszar/LiveSplit,madzinah/LiveSplit,ROMaster2/LiveSplit,zoton2/LiveSplit,madzinah/LiveSplit | LiveSplit/LiveSplit.Core/Options/Log.cs | LiveSplit/LiveSplit.Core/Options/Log.cs | using System;
using System.Diagnostics;
namespace LiveSplit.Options
{
public static class Log
{
static Log()
{
try
{
if (!EventLog.SourceExists("LiveSplit"))
EventLog.CreateEventSource("LiveSplit", "Application");
}
catch { }
Trace.Listeners.Add(new EventLogTraceListener("LiveSplit"));
}
public static void Error(Exception ex)
{
if (ex == null)
return;
Trace.TraceError("{0}\n\n{1}", ex.Message, ex.StackTrace);
}
public static void Error(String message)
{
Trace.TraceError(message);
}
public static void Info(String message)
{
Trace.TraceInformation(message);
}
public static void Warning(String message)
{
Trace.TraceWarning(message);
}
}
}
| using System;
using System.Diagnostics;
namespace LiveSplit.Options
{
public static class Log
{
static Log()
{
try
{
if (!EventLog.SourceExists("LiveSplit"))
EventLog.CreateEventSource("LiveSplit", "Application");
}
catch { }
try
{
Trace.Listeners.Add(new EventLogTraceListener("LiveSplit"));
}
catch { }
}
public static void Error(Exception ex)
{
try
{
Trace.TraceError("{0}\n\n{1}", ex.Message, ex.StackTrace);
}
catch { }
}
public static void Error(String message)
{
try
{
Trace.TraceError(message);
}
catch { }
}
public static void Info(String message)
{
try
{
Trace.TraceInformation(message);
}
catch { }
}
public static void Warning(String message)
{
try
{
Trace.TraceWarning(message);
}
catch { }
}
}
}
| mit | C# |
483115cd9c4a9bd8b8c9d36ce8bceb2ec7b36cb0 | 修复发送模板消息结果中 msgid 错为 int(实应为 long)的问题 | lishewen/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,mc7246/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,wanddy/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,mc7246/WeiXinMPSDK,down4u/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,lishewen/WeiXinMPSDK,mc7246/WeiXinMPSDK,wanddy/WeiXinMPSDK,down4u/WeiXinMPSDK,JeffreySu/WxOpen,lishewen/WeiXinMPSDK,JeffreySu/WxOpen,JeffreySu/WeiXinMPSDK,wanddy/WeiXinMPSDK,down4u/WeiXinMPSDK | Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/TemplateMessage/TemplateMessageJson/SendTemplateMessageResult.cs | Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/TemplateMessage/TemplateMessageJson/SendTemplateMessageResult.cs | /*----------------------------------------------------------------
Copyright (C) 2016 Senparc
文件名:SendTemplateMessageResult.cs
文件功能描述:发送模板消息结果
创建标识:Senparc - 20150211
修改标识:Senparc - 20150303
修改描述:整理接口
----------------------------------------------------------------*/
using Senparc.Weixin.Entities;
namespace Senparc.Weixin.MP.AdvancedAPIs.TemplateMessage
{
/// <summary>
/// 发送模板消息结果
/// </summary>
public class SendTemplateMessageResult : WxJsonResult
{
/// <summary>
/// msgid
/// </summary>
public long msgid { get; set; }
}
}
| /*----------------------------------------------------------------
Copyright (C) 2016 Senparc
文件名:SendTemplateMessageResult.cs
文件功能描述:发送模板消息结果
创建标识:Senparc - 20150211
修改标识:Senparc - 20150303
修改描述:整理接口
----------------------------------------------------------------*/
using Senparc.Weixin.Entities;
namespace Senparc.Weixin.MP.AdvancedAPIs.TemplateMessage
{
/// <summary>
/// 发送模板消息结果
/// </summary>
public class SendTemplateMessageResult : WxJsonResult
{
/// <summary>
/// msgid
/// </summary>
public int msgid { get; set; }
}
}
| apache-2.0 | C# |
9f3c7b70a08b6c88d34390c0febf7f0a25a4f710 | Change title to New2 | seldongo/docker-ci,seldongo/docker-ci,seldongo/docker-ci | api/Startup.cs | api/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.AspNetCore.Rewrite;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Swashbuckle.AspNetCore.Swagger;
namespace api
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc()
.AddXmlSerializerFormatters();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "NEW2 Generate Random Data API", Version = "v1" });
});
}
// 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)
{
app.UseMvc();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Generate Random Data API V1");
});
var redirectRootToSwagger = new RewriteOptions()
.AddRedirect("^$", "swagger");
app.UseRewriter(redirectRootToSwagger);
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Rewrite;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Swashbuckle.AspNetCore.Swagger;
namespace api
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc()
.AddXmlSerializerFormatters();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "Generate Random Data API", Version = "v1" });
});
}
// 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)
{
app.UseMvc();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Generate Random Data API V1");
});
var redirectRootToSwagger = new RewriteOptions()
.AddRedirect("^$", "swagger");
app.UseRewriter(redirectRootToSwagger);
}
}
}
| mit | C# |
62ef830aad81d69d97b487b3049d5140a61f0452 | Remove using | AmadeusW/roslyn,panopticoncentral/roslyn,panopticoncentral/roslyn,tmat/roslyn,physhi/roslyn,aelij/roslyn,shyamnamboodiripad/roslyn,shyamnamboodiripad/roslyn,mavasani/roslyn,gafter/roslyn,ErikSchierboom/roslyn,weltkante/roslyn,davkean/roslyn,KevinRansom/roslyn,sharwell/roslyn,tannergooding/roslyn,jmarolf/roslyn,panopticoncentral/roslyn,AlekseyTs/roslyn,jasonmalinowski/roslyn,heejaechang/roslyn,aelij/roslyn,sharwell/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,stephentoub/roslyn,dotnet/roslyn,wvdd007/roslyn,jmarolf/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,AmadeusW/roslyn,physhi/roslyn,weltkante/roslyn,davkean/roslyn,stephentoub/roslyn,KevinRansom/roslyn,eriawan/roslyn,gafter/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,eriawan/roslyn,tannergooding/roslyn,davkean/roslyn,heejaechang/roslyn,eriawan/roslyn,ErikSchierboom/roslyn,diryboy/roslyn,shyamnamboodiripad/roslyn,aelij/roslyn,heejaechang/roslyn,diryboy/roslyn,AmadeusW/roslyn,bartdesmet/roslyn,wvdd007/roslyn,genlu/roslyn,mgoertz-msft/roslyn,ErikSchierboom/roslyn,AlekseyTs/roslyn,wvdd007/roslyn,mavasani/roslyn,sharwell/roslyn,AlekseyTs/roslyn,genlu/roslyn,stephentoub/roslyn,dotnet/roslyn,weltkante/roslyn,KirillOsenkov/roslyn,jmarolf/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,mavasani/roslyn,mgoertz-msft/roslyn,mgoertz-msft/roslyn,genlu/roslyn,bartdesmet/roslyn,tmat/roslyn,tannergooding/roslyn,brettfo/roslyn,physhi/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,diryboy/roslyn | src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/Precedence/CSharpPatternPrecedenceService.cs | src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/Precedence/CSharpPatternPrecedenceService.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Microsoft.CodeAnalysis.CSharp.Precedence
{
internal class CSharpPatternPrecedenceService : AbstractCSharpPrecedenceService<PatternSyntax>
{
public static readonly CSharpPatternPrecedenceService Instance = new CSharpPatternPrecedenceService();
private CSharpPatternPrecedenceService()
{
}
public override OperatorPrecedence GetOperatorPrecedence(PatternSyntax pattern)
=> pattern.GetOperatorPrecedence();
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Precedence;
namespace Microsoft.CodeAnalysis.CSharp.Precedence
{
internal class CSharpPatternPrecedenceService : AbstractCSharpPrecedenceService<PatternSyntax>
{
public static readonly CSharpPatternPrecedenceService Instance = new CSharpPatternPrecedenceService();
private CSharpPatternPrecedenceService()
{
}
public override OperatorPrecedence GetOperatorPrecedence(PatternSyntax pattern)
=> pattern.GetOperatorPrecedence();
}
}
| mit | C# |
d9317f21e360309400c6631dad987f87b5b394bc | build version: 3.9.71.10 | wiesel78/Canwell.OrmLite.MSAccess2003 | Source/GlobalAssemblyInfo.cs | Source/GlobalAssemblyInfo.cs | //------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Cake.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
[assembly: AssemblyCompany("canwell - IT Solutions")]
[assembly: AssemblyVersion("3.9.71.10")]
[assembly: AssemblyFileVersion("3.9.71.10")]
[assembly: AssemblyInformationalVersion("3.9.71.10")]
[assembly: AssemblyCopyright("Copyright © 2016")]
| //------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Cake.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
[assembly: AssemblyCompany("canwell - IT Solutions")]
[assembly: AssemblyVersion("3.9.71.9")]
[assembly: AssemblyFileVersion("3.9.71.9")]
[assembly: AssemblyInformationalVersion("3.9.71.9")]
[assembly: AssemblyCopyright("Copyright © 2016")]
| bsd-3-clause | C# |
373b4d6a8ecc320eb14d09c476e1a6161b0641f1 | Expand delayed calls in console interpreter | ajlopez/AjErl,ajlopez/ErlSharp | Src/AjErl.Console/Program.cs | Src/AjErl.Console/Program.cs | namespace AjErl.Console
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AjErl.Compiler;
using AjErl.Expressions;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("AjErl alfa 0.0.1");
Lexer lexer = new Lexer(Console.In);
Parser parser = new Parser(lexer);
Machine machine = new Machine();
while (true)
try
{
ProcessExpression(parser, machine.RootContext);
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
Console.Error.WriteLine(ex.StackTrace);
}
}
private static void ProcessExpression(Parser parser, Context context)
{
IExpression expression = parser.ParseExpression();
object result = Machine.ExpandDelayedCall(expression.Evaluate(context));
if (result == null)
return;
Console.Write("> ");
Console.WriteLine(result);
}
}
}
| namespace AjErl.Console
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AjErl.Compiler;
using AjErl.Expressions;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("AjErl alfa 0.0.1");
Lexer lexer = new Lexer(Console.In);
Parser parser = new Parser(lexer);
Machine machine = new Machine();
while (true)
try
{
ProcessExpression(parser, machine.RootContext);
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
Console.Error.WriteLine(ex.StackTrace);
}
}
private static void ProcessExpression(Parser parser, Context context)
{
IExpression expression = parser.ParseExpression();
object result = expression.Evaluate(context);
if (result == null)
return;
Console.Write("> ");
Console.WriteLine(result);
}
}
}
| mit | C# |
0cea0185767d71d7a94538c9127d2fb49ef158d4 | Use a more suiting (?) icon for import dialog | NeoAdonis/osu,smoogipooo/osu,smoogipoo/osu,ZLima12/osu,smoogipoo/osu,ppy/osu,Frontear/osuKyzer,peppy/osu-new,johnneijzen/osu,johnneijzen/osu,peppy/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,2yangk23/osu,EVAST9919/osu,EVAST9919/osu,ppy/osu,ZLima12/osu,2yangk23/osu,UselessToucan/osu,naoey/osu,peppy/osu,naoey/osu,DrabWeb/osu,smoogipoo/osu,UselessToucan/osu,DrabWeb/osu,UselessToucan/osu,naoey/osu,Nabile-Rahmani/osu,DrabWeb/osu,peppy/osu | osu.Game/Screens/Select/ImportFromStablePopup.cs | osu.Game/Screens/Select/ImportFromStablePopup.cs | // Copyright (c) 2007-2017 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Graphics;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Screens.Select
{
public class ImportFromStablePopup : PopupDialog
{
public ImportFromStablePopup(Action importFromStable)
{
HeaderText = @"You have no beatmaps!";
BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps?";
Icon = FontAwesome.fa_plane;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Yes please!",
Action = importFromStable
},
new PopupDialogCancelButton
{
Text = @"No, I'd like to start from scratch",
},
};
}
}
}
| // Copyright (c) 2007-2017 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Graphics;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Screens.Select
{
public class ImportFromStablePopup : PopupDialog
{
public ImportFromStablePopup(Action importFromStable)
{
HeaderText = @"You have no beatmaps!";
BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps?";
Icon = FontAwesome.fa_trash_o;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Yes please!",
Action = importFromStable
},
new PopupDialogCancelButton
{
Text = @"No, I'd like to start from scratch",
},
};
}
}
}
| mit | C# |
0bc54524b81b383f8a66fa2e2a322e0fbb5d893e | Add tables to DataDomain. | SilkStack/Silk.Data.SQL.ORM | Silk.Data.SQL.ORM/DataDomain.cs | Silk.Data.SQL.ORM/DataDomain.cs | using Silk.Data.Modelling;
using Silk.Data.Modelling.Conventions;
using Silk.Data.SQL.ORM.Modelling;
using Silk.Data.SQL.ORM.Modelling.Conventions;
using System.Collections.Generic;
using System.Linq;
namespace Silk.Data.SQL.ORM
{
/// <summary>
/// Describes the types, models and resource loaders of a data domain.
/// </summary>
public class DataDomain
{
private static ViewConvention[] _defaultViewConventions = new ViewConvention[]
{
new CopySupportedSQLTypesConvention(),
new IdIsPrimaryKeyConvention()
};
private readonly List<DataModel> _dataModels = new List<DataModel>();
private readonly List<TableSchema> _tables = new List<TableSchema>();
public ViewConvention[] ViewConventions { get; }
public IReadOnlyCollection<DataModel> DataModels => _dataModels;
public IReadOnlyCollection<TableSchema> Tables => _tables;
public DataDomain() :
this(_defaultViewConventions)
{
}
public DataDomain(ViewConvention[] viewConventions)
{
ViewConventions = viewConventions;
}
private void AddTables(DataModel model)
{
foreach (var table in model.Tables)
{
if (!_tables.Contains(table))
{
_tables.Add(table);
}
}
}
/// <summary>
/// Creates a data model using knowledge from the data domain.
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <returns></returns>
public DataModel<TSource> CreateDataModel<TSource>()
where TSource : new()
{
var model = TypeModeller.GetModelOf<TSource>();
var dataModel = model.CreateView(viewDefinition =>
{
viewDefinition.UserData.Add(this);
return new DataModel<TSource>(
viewDefinition.Name, model,
DataField.FromDefinitions(viewDefinition.UserData.OfType<TableDefinition>(), viewDefinition.FieldDefinitions).ToArray(),
viewDefinition.ResourceLoaders.ToArray(), this);
}, ViewConventions);
_dataModels.Add(dataModel);
AddTables(dataModel);
return dataModel;
}
/// <summary>
/// Creates a data model using knowledge from the data domain.
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <returns></returns>
public DataModel<TSource, TView> CreateDataModel<TSource, TView>()
where TSource : new()
where TView : new()
{
var model = TypeModeller.GetModelOf<TSource>();
var dataModel = model.CreateView(viewDefinition =>
{
viewDefinition.UserData.Add(this);
return new DataModel<TSource, TView>(
viewDefinition.Name, model,
DataField.FromDefinitions(viewDefinition.UserData.OfType<TableDefinition>(), viewDefinition.FieldDefinitions).ToArray(),
viewDefinition.ResourceLoaders.ToArray(), this);
}, typeof(TView), ViewConventions);
_dataModels.Add(dataModel);
AddTables(dataModel);
return dataModel;
}
}
}
| using Silk.Data.Modelling;
using Silk.Data.Modelling.Conventions;
using Silk.Data.SQL.ORM.Modelling;
using Silk.Data.SQL.ORM.Modelling.Conventions;
using System.Collections.Generic;
using System.Linq;
namespace Silk.Data.SQL.ORM
{
/// <summary>
/// Describes the types, models and resource loaders of a data domain.
/// </summary>
public class DataDomain
{
private static ViewConvention[] _defaultViewConventions = new ViewConvention[]
{
new CopySupportedSQLTypesConvention(),
new IdIsPrimaryKeyConvention()
};
private readonly List<DataModel> _dataModels = new List<DataModel>();
public ViewConvention[] ViewConventions { get; }
public IReadOnlyCollection<DataModel> DataModels => _dataModels;
public DataDomain() :
this(_defaultViewConventions)
{
}
public DataDomain(ViewConvention[] viewConventions)
{
ViewConventions = viewConventions;
}
/// <summary>
/// Creates a data model using knowledge from the data domain.
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <returns></returns>
public DataModel<TSource> CreateDataModel<TSource>()
where TSource : new()
{
var model = TypeModeller.GetModelOf<TSource>();
var dataModel = model.CreateView(viewDefinition =>
{
viewDefinition.UserData.Add(this);
return new DataModel<TSource>(
viewDefinition.Name, model,
DataField.FromDefinitions(viewDefinition.UserData.OfType<TableDefinition>(), viewDefinition.FieldDefinitions).ToArray(),
viewDefinition.ResourceLoaders.ToArray(), this);
}, ViewConventions);
_dataModels.Add(dataModel);
return dataModel;
}
/// <summary>
/// Creates a data model using knowledge from the data domain.
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <returns></returns>
public DataModel<TSource, TView> CreateDataModel<TSource, TView>()
where TSource : new()
where TView : new()
{
var model = TypeModeller.GetModelOf<TSource>();
var dataModel = model.CreateView(viewDefinition =>
{
viewDefinition.UserData.Add(this);
return new DataModel<TSource, TView>(
viewDefinition.Name, model,
DataField.FromDefinitions(viewDefinition.UserData.OfType<TableDefinition>(), viewDefinition.FieldDefinitions).ToArray(),
viewDefinition.ResourceLoaders.ToArray(), this);
}, typeof(TView), ViewConventions);
_dataModels.Add(dataModel);
return dataModel;
}
}
}
| mit | C# |
ab2c490d266ca56d04e96e687317f74b728b5c85 | Fix typo | cake-build-bot/website,cake-build-bot/website,cake-build/website,devlead/website,cake-build/website,devlead/website,devlead/website,cake-build/website | input/docs/index.cshtml | input/docs/index.cshtml | Title: Documentation
---
<p>This user guide, like Cake itself, is under very active development. Some parts of Cake aren't
documented as completely as they need to be, but we gladly accept your contributions.</p>
<p>We need your help to improve the documentation for Cake, so if there is something that you
would like to add then you can edit the content directly on GitHub.</p>
@Html.Partial("_ChildPages") | Title: Documentation
---
<p>This user guide, like Cake itself, is under very active development. Some parts of Cake aren't
documented as completely as they need to be, but we glady accept your contributions.</p>
<p>We need your help to improve the documentation for Cake, so if there is something that you
would like to add then you can edit the content directly on GitHub.</p>
@Html.Partial("_ChildPages") | mit | C# |
24a0051c49257a5929776bf040bb4604a351d5b1 | remove testmethod testing saving to database | AccountGo/accountgo,AccountGo/accountgo,AccountGo/accountgo,AccountGo/accountgo | Test/UnitTests/DbContextTest.cs | Test/UnitTests/DbContextTest.cs | using Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
namespace UnitTests
{
[TestClass]
public class DbContextTest
{
//string connectionString = "data source=localhost;initial catalog=apphbDB;integrated security=sspi;multipleactiveresultsets=true;Pooling=false";
[TestMethod]
public void TestMethod1()
{
//using (var context = new ApplicationContext(connectionString))
//{
// var sysAdmins = context.SecurityRoles.ToList();
//}
}
}
}
| using Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
namespace UnitTests
{
[TestClass]
public class DbContextTest
{
string connectionString = "data source=localhost;initial catalog=apphbDB;integrated security=sspi;multipleactiveresultsets=true;Pooling=false";
[TestMethod]
public void TestMethod1()
{
using (var context = new ApplicationContext(connectionString))
{
var sysAdmins = context.SecurityRoles.ToList();
}
}
}
}
| mit | C# |
fbdf07dc201c87140c00be1121d227d003c3dd1e | Correct speed of spun out | peppy/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu,peppy/osu,peppy/osu,smoogipoo/osu,smoogipooo/osu,UselessToucan/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,EVAST9919/osu,peppy/osu-new,smoogipoo/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu | osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs | osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs | // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModSpunOut : Mod, IApplicableToDrawableHitObjects, IUpdatableByPlayfield
{
public override string Name => "Spun Out";
public override string Acronym => "SO";
public override IconUsage Icon => OsuIcon.ModSpunout;
public override ModType Type => ModType.DifficultyReduction;
public override string Description => @"Spinners will be automatically completed.";
public override double ScoreMultiplier => 0.9;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) };
private double lastFrameTime;
private double frameDelay;
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
foreach (var hitObject in drawables)
{
if (hitObject is DrawableSpinner spinner)
{
spinner.Disc.Trackable = false;
spinner.Disc.OnUpdate += d =>
{
if (d is SpinnerDisc s)
{
if (s.Valid)
s.Rotate(180 / MathF.PI * ((float)frameDelay) / 40);
}
};
}
}
}
public void Update(Playfield playfield)
{
frameDelay = playfield.Time.Current - lastFrameTime;
lastFrameTime = playfield.Time.Current;
}
}
}
| // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModSpunOut : Mod, IApplicableToDrawableHitObjects, IUpdatableByPlayfield
{
public override string Name => "Spun Out";
public override string Acronym => "SO";
public override IconUsage Icon => OsuIcon.ModSpunout;
public override ModType Type => ModType.DifficultyReduction;
public override string Description => @"Spinners will be automatically completed.";
public override double ScoreMultiplier => 0.9;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) };
private double lastFrameTime;
private double frameDelay;
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
foreach (var hitObject in drawables)
{
if (hitObject is DrawableSpinner spinner)
{
spinner.Disc.Trackable = false;
spinner.Disc.OnUpdate += d =>
{
if (d is SpinnerDisc s)
{
if (s.Valid)
s.Rotate((float)frameDelay);
}
};
}
}
}
public void Update(Playfield playfield)
{
frameDelay = playfield.Time.Current - lastFrameTime;
lastFrameTime = playfield.Time.Current;
}
}
}
| mit | C# |
5654d5e80ba5004b971b830390c40840bbd1d342 | set location from data | watson-developer-cloud/unity-sdk,watson-developer-cloud/unity-sdk,scottdangelo/unity-sdk,kimberlysiva/unity-sdk,kimberlysiva/unity-sdk,scottdangelo/unity-sdk,watson-developer-cloud/unity-sdk | Assets/Plugins/Watson/Parse/Location.cs | Assets/Plugins/Watson/Parse/Location.cs | using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Location : QuestionComponentBase {
[SerializeField]
private Text m_LocationText;
private string _m_Location;
public string m_Location
{
get { return _m_Location; }
set
{
_m_Location = value;
UpdateLocation();
}
}
new void Start ()
{
base.Start ();
}
new public void Init()
{
base.Init ();
m_Location = qWidget.Avatar.ITM.Location;
}
private void UpdateLocation()
{
m_LocationText.text = m_Location;
}
}
| using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Location : QuestionComponentBase {
[SerializeField]
private Text m_LocationText;
private string _m_Location;
public string m_Location
{
get { return _m_Location; }
set
{
_m_Location = value;
UpdateLocation();
}
}
new void Start ()
{
base.Start ();
}
new public void Init()
{
base.Init ();
// TODO Location from data
//m_Location = qWidget.Questions.questions[0].question.;
}
private void UpdateLocation()
{
m_LocationText.text = m_Location;
}
}
| apache-2.0 | C# |
1aad6f929b9cd66986808ffe11075b504db72f90 | Edit AdvancingText to use processed text length | NitorInc/NitoriWare,Barleytree/NitoriWare,Barleytree/NitoriWare,NitorInc/NitoriWare | Assets/Scripts/UI/AdvancingText.cs | Assets/Scripts/UI/AdvancingText.cs | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using TMPro;
public class AdvancingText : MonoBehaviour
{
[SerializeField]
private float advanceSpeed;
[SerializeField]
private UnityEvent onComplete;
private bool isComplete;
public bool IsComplete => isComplete;
private TMP_Text textMeshProComponent;
private float progress;
void Awake()
{
textMeshProComponent = GetComponent<TMP_Text>();
}
void Start ()
{
resetAdvance();
}
public void resetAdvance()
{
isComplete = false;
progress = 0f;
setVisibleChars(0);
}
void Update ()
{
if (progress < getTotalVisibleChars(false))
updateText();
}
void updateText()
{
var totalVisibleChars = getTotalVisibleChars(false);
progress = Mathf.MoveTowards(progress, totalVisibleChars, Time.deltaTime * advanceSpeed);
setVisibleChars((int)Mathf.Floor(progress));
if (progress >= totalVisibleChars)
{
isComplete = true;
onComplete.Invoke();
}
}
public float getAdvanceSpeed()
{
return advanceSpeed;
}
public void setAdvanceSpeed(float speed)
{
advanceSpeed = speed;
}
void setVisibleChars(int amount)
{
textMeshProComponent.maxVisibleCharacters = amount;
}
public float Progress => progress;
public int getVisibleChars()
{
return textMeshProComponent.maxVisibleCharacters;
}
public int getTotalVisibleChars(bool forceMeshUpdate = true)
{
if (forceMeshUpdate)
textMeshProComponent.ForceMeshUpdate();
return textMeshProComponent.GetParsedText().Length;
}
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using TMPro;
public class AdvancingText : MonoBehaviour
{
[SerializeField]
private float advanceSpeed;
[SerializeField]
private UnityEvent onComplete;
private TMP_Text textMeshProComponent;
private float progress;
void Awake()
{
textMeshProComponent = GetComponent<TMP_Text>();
}
void Start ()
{
resetAdvance();
}
public void resetAdvance()
{
progress = 0f;
setVisibleChars(0);
}
void Update ()
{
if (progress < getTotalVisibleChars())
updateText();
}
void updateText()
{
progress = Mathf.MoveTowards(progress, getTotalVisibleChars(), Time.deltaTime * advanceSpeed);
setVisibleChars((int)Mathf.Floor(progress));
if (progress >= getTotalVisibleChars())
onComplete.Invoke();
}
public float getAdvanceSpeed()
{
return advanceSpeed;
}
public void setAdvanceSpeed(float speed)
{
advanceSpeed = speed;
}
void setVisibleChars(int amount)
{
textMeshProComponent.maxVisibleCharacters = amount;
}
public int getVisibleChars()
{
return textMeshProComponent.maxVisibleCharacters;
}
public int getTotalVisibleChars()
{
return textMeshProComponent.text.Length;
}
}
| mit | C# |
9b28409221e161e7c4429e738eb82b76eafae984 | Remove blocking. | nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet | WalletWasabi.Gui/CrashReport/CrashReporter.cs | WalletWasabi.Gui/CrashReport/CrashReporter.cs | using System;
using System.Diagnostics;
using WalletWasabi.Logging;
using WalletWasabi.Microservices;
using WalletWasabi.Models;
namespace WalletWasabi.Gui.CrashReport
{
public class CrashReporter
{
private const int MaxRecursiveCalls = 5;
public int Attempts { get; private set; }
public string Base64ExceptionString { get; private set; } = null;
public bool IsReport { get; private set; }
public bool HadException { get; private set; }
public bool IsInvokeRequired => !IsReport && HadException;
public SerializableException SerializedException { get; private set; }
public void TryInvokeCrashReport()
{
try
{
if (Attempts >= MaxRecursiveCalls)
{
throw new InvalidOperationException($"The crash report has been called {MaxRecursiveCalls} times. Will not continue to avoid recursion errors.");
}
if (string.IsNullOrEmpty(Base64ExceptionString))
{
throw new InvalidOperationException($"The crash report exception message is empty.");
}
var args = $"crashreport -attempt=\"{Attempts + 1}\" -exception=\"{Base64ExceptionString}\"";
ProcessStartInfo startInfo = ProcessStartInfoFactory.Make(Process.GetCurrentProcess().MainModule.FileName, args);
using Process p = Process.Start(startInfo);
}
catch (Exception ex)
{
Logger.LogWarning($"There was a problem while invoking crash report:{ex.ToUserFriendlyString()}.");
}
}
public void SetShowCrashReport(string base64ExceptionString, int attempts)
{
Attempts = attempts;
Base64ExceptionString = base64ExceptionString;
SerializedException = SerializableException.FromBase64String(Base64ExceptionString);
IsReport = true;
}
/// <summary>
/// Sets the exception when it occurs the first time and should be reported to the user.
/// </summary>
public void SetException(Exception ex)
{
SerializedException = ex.ToSerializableException();
Base64ExceptionString = SerializableException.ToBase64String(SerializedException);
HadException = true;
}
}
}
| using System;
using System.Diagnostics;
using WalletWasabi.Logging;
using WalletWasabi.Microservices;
using WalletWasabi.Models;
namespace WalletWasabi.Gui.CrashReport
{
public class CrashReporter
{
private const int MaxRecursiveCalls = 5;
public int Attempts { get; private set; }
public string Base64ExceptionString { get; private set; } = null;
public bool IsReport { get; private set; }
public bool HadException { get; private set; }
public bool IsInvokeRequired => !IsReport && HadException;
public SerializableException SerializedException { get; private set; }
public void TryInvokeCrashReport()
{
try
{
if (Attempts >= MaxRecursiveCalls)
{
throw new InvalidOperationException($"The crash report has been called {MaxRecursiveCalls} times. Will not continue to avoid recursion errors.");
}
if (string.IsNullOrEmpty(Base64ExceptionString))
{
throw new InvalidOperationException($"The crash report exception message is empty.");
}
var args = $"crashreport -attempt=\"{Attempts + 1}\" -exception=\"{Base64ExceptionString}\"";
ProcessStartInfo startInfo = ProcessStartInfoFactory.Make(Process.GetCurrentProcess().MainModule.FileName, args);
using Process p = Process.Start(startInfo);
p.Start();
p.WaitForExit();
}
catch (Exception ex)
{
Logger.LogWarning($"There was a problem while invoking crash report:{ex.ToUserFriendlyString()}.");
}
}
public void SetShowCrashReport(string base64ExceptionString, int attempts)
{
Attempts = attempts;
Base64ExceptionString = base64ExceptionString;
SerializedException = SerializableException.FromBase64String(Base64ExceptionString);
IsReport = true;
}
/// <summary>
/// Sets the exception when it occurs the first time and should be reported to the user.
/// </summary>
public void SetException(Exception ex)
{
SerializedException = ex.ToSerializableException();
Base64ExceptionString = SerializableException.ToBase64String(SerializedException);
HadException = true;
}
}
}
| mit | C# |
05ee79a0b44cbce3bd7113a4906c9d362569faa6 | Update AssemblyInfo.cs | faniereynders/WebApiProxy,lust4life/WebApiProxy | WebApiProxy.Server/Properties/AssemblyInfo.cs | WebApiProxy.Server/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("WebApi Proxy Provider")]
[assembly: AssemblyDescription("Provides an endpoint for ASP.NET Web Api services to serve a JavaScript proxy and metadata")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("WebApiProxy")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bc78cf80-1cf9-46e7-abdd-88e9c49d656c")]
// 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: AssemblyInformationalVersion("1.2.2.*")]
[assembly: AssemblyVersion("1.2.2.*")]
| 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("WebApi Proxy Provider")]
[assembly: AssemblyDescription("Provides an endpoint for ASP.NET Web Api services to serve a JavaScript proxy and metadata")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("WebApiProxy")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bc78cf80-1cf9-46e7-abdd-88e9c49d656c")]
// 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: AssemblyInformationalVersion("1.2.0.*")]
[assembly: AssemblyVersion("1.2.1.*")]
| mit | C# |
1f5551e1de4d38cfe3fa78042a8304545df10a0b | Use correct quote characters | DotNetAnalyzers/StyleCopAnalyzers | StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/SA1122UseStringEmptyForEmptyStrings.cs | StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/SA1122UseStringEmptyForEmptyStrings.cs | namespace StyleCop.Analyzers.ReadabilityRules
{
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
/// <summary>
/// The C# code includes an empty string, written as <c>""</c>.
/// </summary>
/// <remarks>
/// <para>A violation of this rule occurs when the code contains an empty string. For example:</para>
///
/// <code language="csharp">
/// string s = "";
/// </code>
///
/// <para>This will cause the compiler to embed an empty string into the compiled code. Rather than including a
/// hard-coded empty string, use the static <see cref="string.Empty"/> field:</para>
///
/// <code language="csharp">
/// string s = string.Empty;
/// </code>
/// </remarks>
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class SA1122UseStringEmptyForEmptyStrings : DiagnosticAnalyzer
{
public const string DiagnosticId = "SA1122";
internal const string Title = "Use string.Empty for empty strings";
internal const string MessageFormat = "TODO: Message format";
internal const string Category = "StyleCop.CSharp.ReadabilityRules";
internal const string Description = "The C# code includes an empty string, written as \"\".";
internal const string HelpLink = "http://www.stylecop.com/docs/SA1122.html";
public static readonly DiagnosticDescriptor Descriptor =
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, AnalyzerConstants.DisabledNoTests, Description, HelpLink);
private static readonly ImmutableArray<DiagnosticDescriptor> _supportedDiagnostics =
ImmutableArray.Create(Descriptor);
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
{
get
{
return _supportedDiagnostics;
}
}
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
{
// TODO: Implement analysis
}
}
}
| namespace StyleCop.Analyzers.ReadabilityRules
{
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
/// <summary>
/// The C# code includes an empty string, written as <c>""</c>.
/// </summary>
/// <remarks>
/// <para>A violation of this rule occurs when the code contains an empty string. For example:</para>
///
/// <code language="csharp">
/// string s = "";
/// </code>
///
/// <para>This will cause the compiler to embed an empty string into the compiled code. Rather than including a
/// hard-coded empty string, use the static <see cref="string.Empty"/> field:</para>
///
/// <code language="csharp">
/// string s = string.Empty;
/// </code>
/// </remarks>
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class SA1122UseStringEmptyForEmptyStrings : DiagnosticAnalyzer
{
public const string DiagnosticId = "SA1122";
internal const string Title = "Use string.Empty for empty strings";
internal const string MessageFormat = "TODO: Message format";
internal const string Category = "StyleCop.CSharp.ReadabilityRules";
internal const string Description = "The C# code includes an empty string, written as “”.";
internal const string HelpLink = "http://www.stylecop.com/docs/SA1122.html";
public static readonly DiagnosticDescriptor Descriptor =
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, AnalyzerConstants.DisabledNoTests, Description, HelpLink);
private static readonly ImmutableArray<DiagnosticDescriptor> _supportedDiagnostics =
ImmutableArray.Create(Descriptor);
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
{
get
{
return _supportedDiagnostics;
}
}
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
{
// TODO: Implement analysis
}
}
}
| mit | C# |
4107093aca518ee5bbfd7c3d194c8c8b629a93ae | update program.cs, changed tree structure | NeedlesInPenis/DSandA,NeedlesInPenis/Data-structures-in-csharp | Program.cs | Program.cs | using System;
namespace adt
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Testing different data structures");
BinarySearchTree b = new BinarySearchTree();
b.insert(5);
b.insert(3);
b.insert(20);
b.insert(2);
b.insert(4);
b.insert(10);
b.insert(22);
b.insert(1);
b.insert(9);
b.insert(11);
b.insert(21);
b.insert(23);
b.insert(12);
}
/*
5
/ \
/ \
3 20
/ \ / \
2 4 10 22
/ / \ / \
1 9 11 21 23
\
12
*/
}
}
| using System;
namespace adt
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Testing different data structures");
BinarySearchTree b = new BinarySearchTree();
b.insert(5);
b.insert(3);
b.insert(20);
b.insert(2);
b.insert(4);
b.insert(10);
b.insert(22);
b.insert(1);
b.insert(9);
b.insert(11);
b.insert(21);
b.insert(23);
b.insert(12);
}
/**
1 2 3 4 5 6 7 8 9 10
5
3 20
2 4 10 22
1 9 11 21 23
12
*/
}
}
| mit | C# |
fd4bc059a2b35f1b1d05eea263599f10b5a0d6f9 | Fix typo in assembly description | QuantConnect/Lean,jameschch/Lean,AlexCatarino/Lean,StefanoRaggi/Lean,QuantConnect/Lean,jameschch/Lean,StefanoRaggi/Lean,JKarathiya/Lean,JKarathiya/Lean,StefanoRaggi/Lean,StefanoRaggi/Lean,jameschch/Lean,jameschch/Lean,JKarathiya/Lean,AlexCatarino/Lean,StefanoRaggi/Lean,jameschch/Lean,QuantConnect/Lean,JKarathiya/Lean,AlexCatarino/Lean,AlexCatarino/Lean,QuantConnect/Lean | Common/Properties/SharedAssemblyInfo.cs | Common/Properties/SharedAssemblyInfo.cs | using System.Reflection;
// common assembly attributes
[assembly: AssemblyDescription("Lean Engine is an open-source, platform agnostic C# and Python algorithmic trading engine. " +
"Allows strategy research, backtesting and live trading with Equities, FX, CFD, Crypto, Options and Futures Markets.")]
[assembly: AssemblyCopyright("QuantConnect™ 2018. All Rights Reserved")]
[assembly: AssemblyCompany("QuantConnect Corporation")]
[assembly: AssemblyVersion("2.4")]
// Configuration used to build the assembly is by defaulting 'Debug'.
// To create a package using a Release configuration, -properties Configuration=Release on the command line must be use.
// source: https://docs.microsoft.com/en-us/nuget/reference/nuspec#replacement-tokens | using System.Reflection;
// common assembly attributes
[assembly: AssemblyDescription("Lean Engine is an open-source, plataform agnostic C# and Python algorithmic trading engine. " +
"Allows strategy research, backtesting and live trading with Equities, FX, CFD, Crypto, Options and Futures Markets.")]
[assembly: AssemblyCopyright("QuantConnect™ 2018. All Rights Reserved")]
[assembly: AssemblyCompany("QuantConnect Corporation")]
[assembly: AssemblyVersion("2.4")]
// Configuration used to build the assembly is by defaulting 'Debug'.
// To create a package using a Release configuration, -properties Configuration=Release on the command line must be use.
// source: https://docs.microsoft.com/en-us/nuget/reference/nuspec#replacement-tokens | apache-2.0 | C# |
24d5678e31a91145852cc867d8792266153d1bf5 | Update IShapeRendererState.cs | wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D | src/Core2D/Model/Renderer/IShapeRendererState.cs | src/Core2D/Model/Renderer/IShapeRendererState.cs | using Core2D.Shapes;
using Core2D.Style;
namespace Core2D.Renderer
{
/// <summary>
/// Defines shape renderer state contract.
/// </summary>
public interface IShapeRendererState : IObservableObject, ISelection
{
/// <summary>
/// The X coordinate of current pan position.
/// </summary>
double PanX { get; set; }
/// <summary>
/// The Y coordinate of current pan position.
/// </summary>
double PanY { get; set; }
/// <summary>
/// The X component of current zoom value.
/// </summary>
double ZoomX { get; set; }
/// <summary>
/// The Y component of current zoom value.
/// </summary>
double ZoomY { get; set; }
/// <summary>
/// Flag indicating shape state to enable its drawing.
/// </summary>
IShapeState DrawShapeState { get; set; }
/// <summary>
/// Image cache repository.
/// </summary>
IImageCache ImageCache { get; set; }
/// <summary>
/// Gets or sets value indicating whether to draw decorators.
/// </summary>
bool DrawDecorators { get; set; }
/// <summary>
/// Gets or sets value indicating whether to draw points.
/// </summary>
bool DrawPoints { get; set; }
/// <summary>
/// Gets or sets style used to draw points.
/// </summary>
IShapeStyle PointStyle { get; set; }
/// <summary>
/// Gets or sets size used to draw points.
/// </summary>
double PointSize { get; set; }
/// <summary>
/// Gets or sets selection rectangle style.
/// </summary>
IShapeStyle SelectionStyle { get; set; }
/// <summary>
/// Gets or sets editor helper shapes style.
/// </summary>
IShapeStyle HelperStyle { get; set; }
}
}
| using Core2D.Shapes;
using Core2D.Style;
namespace Core2D.Renderer
{
/// <summary>
/// Defines shape renderer state contract.
/// </summary>
public interface IShapeRendererState : IObservableObject, ISelection
{
/// <summary>
/// The X coordinate of current pan position.
/// </summary>
double PanX { get; set; }
/// <summary>
/// The Y coordinate of current pan position.
/// </summary>
double PanY { get; set; }
/// <summary>
/// The X component of current zoom value.
/// </summary>
double ZoomX { get; set; }
/// <summary>
/// The Y component of current zoom value.
/// </summary>
double ZoomY { get; set; }
/// <summary>
/// Flag indicating shape state to enable its drawing.
/// </summary>
IShapeState DrawShapeState { get; set; }
/// <summary>
/// Image cache repository.
/// </summary>
IImageCache ImageCache { get; set; }
/// <summary>
/// Gets or sets style used to draw points.
/// </summary>
IShapeStyle PointStyle { get; set; }
/// <summary>
/// Gets or sets size used to draw points.
/// </summary>
double PointSize { get; set; }
/// <summary>
/// Gets or sets selection rectangle style.
/// </summary>
IShapeStyle SelectionStyle { get; set; }
/// <summary>
/// Gets or sets editor helper shapes style.
/// </summary>
IShapeStyle HelperStyle { get; set; }
}
}
| mit | C# |
0b012eb9f0ec226615efd2581d93e8fec8b3270b | add todo to manifest file reader service. | pburls/dewey | Dewey.File/ManifestFileReaderService.cs | Dewey.File/ManifestFileReaderService.cs | using System;
namespace Dewey.File
{
public class ManifestFileReaderService : IManifestFileReaderService
{
public IManifestFileReader ReadComponentManifestFile(params string[] paths)
{
return new ComponentManifestFileReader(paths);
}
public IManifestFileReader ReadRepositoriesManifestFile()
{
return new RepositoriesManifestFileReader();
}
public IManifestFileReader ReadRepositoryManifestFile(params string[] paths)
{
return new RepositoryManifestFileReader(paths);
}
public IManifestFileReader ReadRuntimeResourcesManifestFile(params string[] paths)
{
return new RuntimeResourcesManifestFileReader(paths);
}
public IManifestFileReader FindManifestFileInCurrentDirectory()
{
//Todo: Change to strategy pattern.
if (System.IO.File.Exists(RepositoriesManifestFileReader.DEFAULT_REPOSITORIES_FILE_NAME))
{
return new RepositoriesManifestFileReader();
}
if (System.IO.File.Exists(RepositoryManifestFileReader.DEFAULT_REPOSITORY_FILE_NAME))
{
return new RepositoryManifestFileReader();
}
if (System.IO.File.Exists(ComponentManifestFileReader.DEFAULT_COMPONENT_FILE_NAME))
{
return new ComponentManifestFileReader();
}
return null;
}
}
}
| using System;
namespace Dewey.File
{
public class ManifestFileReaderService : IManifestFileReaderService
{
public IManifestFileReader ReadComponentManifestFile(params string[] paths)
{
return new ComponentManifestFileReader(paths);
}
public IManifestFileReader ReadRepositoriesManifestFile()
{
return new RepositoriesManifestFileReader();
}
public IManifestFileReader ReadRepositoryManifestFile(params string[] paths)
{
return new RepositoryManifestFileReader(paths);
}
public IManifestFileReader ReadRuntimeResourcesManifestFile(params string[] paths)
{
return new RuntimeResourcesManifestFileReader(paths);
}
public IManifestFileReader FindManifestFileInCurrentDirectory()
{
if (System.IO.File.Exists(RepositoriesManifestFileReader.DEFAULT_REPOSITORIES_FILE_NAME))
{
return new RepositoriesManifestFileReader();
}
if (System.IO.File.Exists(RepositoryManifestFileReader.DEFAULT_REPOSITORY_FILE_NAME))
{
return new RepositoryManifestFileReader();
}
if (System.IO.File.Exists(ComponentManifestFileReader.DEFAULT_COMPONENT_FILE_NAME))
{
return new ComponentManifestFileReader();
}
return null;
}
}
}
| mit | C# |
593793d16e51f0f8063765f0699fc4a09c5df3ad | Update CommentsDisqus.cshtml | Shazwazza/Articulate,readingdancer/Articulate,Shazwazza/Articulate,readingdancer/Articulate,readingdancer/Articulate,Shazwazza/Articulate | src/Articulate.Web/App_Plugins/Articulate/Themes/Phantom/Views/Partials/CommentsDisqus.cshtml | src/Articulate.Web/App_Plugins/Articulate/Themes/Phantom/Views/Partials/CommentsDisqus.cshtml | @model Articulate.Models.PostModel
@if (Model.DisqusShortName.IsNullOrWhiteSpace())
{
<p>
<em>
To enable comments sign up for a <a href="http://disqus.com" target="_blank">Disqus</a> account and
enter your Disqus shortname in the Articulate node settings.
</em>
</p>
}
else
{
<div id="disqus_thread">
<script type="text/javascript">
/** ENTER DISQUS SHORTNAME HERE **/
var disqus_shortname = '@Model.DisqusShortName';
/** DO NOT MODIFY BELOW THIS LINE **/
var disqus_identifier = '@Model.GetKey()';
var disqus_url = '@Model.UrlWithDomain()';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
<a href="http://disqus.com" class="dsq-brlink">
comments powered by <span class="logo-disqus">Disqus</span>
</a>
</div>
}
| @model Articulate.Models.PostModel
@if (Model.DisqusShortName.IsNullOrWhiteSpace())
{
<p>
<em>
To enable comments sign up for a <a href="http://disqus.com" target="_blank">Disqus</a> account and
enter your Disqus shortname in the Articulate node settings.
</em>
</p>
}
else
{
<div id="disqus_thread">
<script type="text/javascript">
/** ENTER DISQUS SHORTNAME HERE **/
var disqus_shortname = '@Model.DisqusShortName';
/** DO NOT MODIFY BELOW THIS LINE **/
var disqus_identifier = '@Model.Id';
var disqus_url = '@Model.UrlWithDomain()';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
<a href="http://disqus.com" class="dsq-brlink">
comments powered by <span class="logo-disqus">Disqus</span>
</a>
</div>
} | mit | C# |
8dc73ac1123e7d2aaf4764d1e7c2dbda7144c5b4 | Make FOV image reflect agent color as well | futurechris/zombai | Assets/Scripts/AgentRenderer.cs | Assets/Scripts/AgentRenderer.cs | using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class AgentRenderer : MonoBehaviour {
//////////////////////////////////////////////////////////////////
#region Parameters & properties
public Agent agent;
public SpriteRenderer agentSprite;
public Image fovImage;
private static float fovMultiplier = 16.0f;
#endregion Parameters & properties
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#region MonoBehaviour methods & helpers
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
#endregion MonoBehaviour methods & helpers
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#region Getters & Setters
public void setAgent(Agent newAgent)
{
agent = newAgent;
agent.setRenderer(this);
fullUpdate();
}
public void updateColor()
{
agentSprite.color = agent.getAgentColor();
}
public void updateLocation()
{
this.transform.localPosition = agent.getLocation();
}
public void updateFOVScale()
{
float multiplier = agent.getSightRange() / fovMultiplier;
fovImage.rectTransform.localScale = new Vector3(multiplier, multiplier, 1.0f);
fovImage.SetAllDirty();
}
public void fullUpdate()
{
updateLocation();
updateColor();
updateFOVScale();
recalculateFOVImage();
}
#endregion Getters & Setters
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#region Helpers
public void recalculateFOVImage()
{
// For now, just immediately setting this. Later would be nice to smooth the transition.
// That goes for the actual vision cone as well - instant turning is a little strange.
// The prefab for agents sets the 'fill origin' as being to the right. Fill is clockwise.
// % to fill is easy, just the percentage of a circle represented by fieldOfView.
fovImage.fillAmount = agent.getFieldOfView() / 360.0f;
// angle then is direction-half that?
fovImage.rectTransform.rotation = Quaternion.identity; // reset rotation
fovImage.rectTransform.Rotate(0.0f, 0.0f, (agent.getDirection() + (agent.getFieldOfView()/2.0f)));
fovImage.color = agent.getAgentColor();
fovImage.SetAllDirty();
}
#endregion Helpers
//////////////////////////////////////////////////////////////////
}
| using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class AgentRenderer : MonoBehaviour {
//////////////////////////////////////////////////////////////////
#region Parameters & properties
public Agent agent;
public SpriteRenderer agentSprite;
public Image fovImage;
private static float fovMultiplier = 16.0f;
#endregion Parameters & properties
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#region MonoBehaviour methods & helpers
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
#endregion MonoBehaviour methods & helpers
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#region Getters & Setters
public void setAgent(Agent newAgent)
{
agent = newAgent;
agent.setRenderer(this);
fullUpdate();
}
public void updateColor()
{
agentSprite.color = agent.getAgentColor();
}
public void updateLocation()
{
this.transform.localPosition = agent.getLocation();
}
public void updateFOVScale()
{
float multiplier = agent.getSightRange() / fovMultiplier;
fovImage.rectTransform.localScale = new Vector3(multiplier, multiplier, 1.0f);
fovImage.SetAllDirty();
}
public void fullUpdate()
{
updateLocation();
updateColor();
updateFOVScale();
recalculateFOVImage();
}
#endregion Getters & Setters
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#region Helpers
public void recalculateFOVImage()
{
// For now, just immediately setting this. Later would be nice to smooth the transition.
// That goes for the actual vision cone as well - instant turning is a little strange.
// The prefab for agents sets the 'fill origin' as being to the right. Fill is clockwise.
// % to fill is easy, just the percentage of a circle represented by fieldOfView.
fovImage.fillAmount = agent.getFieldOfView() / 360.0f;
// angle then is direction-half that?
fovImage.rectTransform.rotation = Quaternion.identity; // reset rotation
fovImage.rectTransform.Rotate(0.0f, 0.0f, (agent.getDirection() + (agent.getFieldOfView()/2.0f)));
fovImage.SetAllDirty();
}
#endregion Helpers
//////////////////////////////////////////////////////////////////
}
| mit | C# |
f181f62a6ac56049e5d3e6930571ddaf6b2f81b3 | Clean up +1 | alvivar/Hasten | Core/Whitescreen/Whitescreen.cs | Core/Whitescreen/Whitescreen.cs |
// Semi-automatic effect layer for a 2D orthographic camera.
// @matnesis
// 2016/03/14 07:38 PM
using UnityEngine;
using matnesis.TeaTime;
public class Whitescreen : MonoBehaviour
{
public int zOnCam = 1;
public bool autoOrthoAdjust = false; // Whitescreen will change his scale to the width and height of the scene
[Header("Automatic references")]
public Renderer render;
public Material material;
public Camera cam;
void Awake()
{
// Self
render = GetComponent<Renderer>();
material = render.material;
// The main camera is default
if (cam == null)
cam = Camera.main;
// Parenting & layers
transform.SetParent(cam.transform);
transform.localPosition = new Vector3(0, 0, zOnCam);
// Auto enable
if (!gameObject.activeSelf)
gameObject.SetActive(true);
if (!render.enabled)
render.enabled = true;
// Auto scale
if (autoOrthoAdjust)
{
this.tt().Add(() =>
{
// Scale
float height = Camera.main.orthographicSize * 2.0f;
float width = height * Screen.width / Screen.height;
transform.localScale = new Vector3(width, height, 1) * 1.1f;
render.sortingOrder = Mathf.Abs(Mathf.FloorToInt(zOnCam));
})
.Add(1).Repeat();
}
}
}
|
// Semi-automatic effect layer for a 2D orthographic camera.
// @matnesis
// 2016/03/14 07:38 PM
using UnityEngine;
using matnesis.TeaTime;
public class Whitescreen : MonoBehaviour
{
public int zOnCam = 1;
[Header("Automatic references")]
public Renderer render;
public Material material;
public Camera cam;
void Awake()
{
// Self
render = GetComponent<Renderer>();
material = render.material;
// The main camera is default
if (cam == null)
cam = Camera.main;
// Parenting & layers
transform.SetParent(cam.transform);
transform.localPosition = new Vector3(0, 0, zOnCam);
// Auto enable
if (gameObject.activeSelf == false)
gameObject.SetActive(true);
// Auto scale
this.tt("@fillTheScreen").Add(() =>
{
// Scale
float height = Camera.main.orthographicSize * 2.0f;
float width = height * Screen.width / Screen.height;
transform.localScale = new Vector3(width, height, 1) * 1.1f;
render.sortingOrder = Mathf.Abs(Mathf.FloorToInt(zOnCam));
})
.Add(1).Repeat();
}
}
| mit | C# |
da6af71f49cde1f3fafd6313cabe7ed769420298 | Bump assembly info for 1.3.1 release | NellyHaglund/SurveyMonkeyApi,bcemmett/SurveyMonkeyApi | SurveyMonkey/Properties/AssemblyInfo.cs | SurveyMonkey/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("SurveyMonkeyApi")]
[assembly: AssemblyDescription("Library for accessing v2 of the Survey Monkey Api")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SurveyMonkeyApi")]
[assembly: AssemblyCopyright("Copyright © Ben Emmett")]
[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("da9e0373-83cd-4deb-87a5-62b313be61ec")]
// 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.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.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("SurveyMonkeyApi")]
[assembly: AssemblyDescription("Library for accessing v2 of the Survey Monkey Api")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SurveyMonkeyApi")]
[assembly: AssemblyCopyright("Copyright © Ben Emmett")]
[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("da9e0373-83cd-4deb-87a5-62b313be61ec")]
// 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.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
| mit | C# |
418e2c221b78dc4029ff5f20feb15238421767cc | bump to version 1.3.2 | Terradue/DotNetTep,Terradue/DotNetTep | Terradue.Tep/Properties/AssemblyInfo.cs | Terradue.Tep/Properties/AssemblyInfo.cs | /*!
\namespace Terradue.Tep
@{
Terradue.Tep Software Package provides with all the functionalities specific to the TEP.
\xrefitem sw_version "Versions" "Software Package Version" 1.3.2
\xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep)
\xrefitem sw_license "License" "Software License" [AGPL](https://git.terradue.com/sugar/Terradue.Tep/LICENSE)
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
\xrefitem sw_req "Require" "Software Dependencies" \ref ServiceStack
\xrefitem sw_req "Require" "Software Dependencies" \ref log4net
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Portal
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Authentication.Umsso
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Cloud
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Github
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Metadata.EarthObservation
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.News
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenNebula
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.GeoJson
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.RdfEO
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Tumblr
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Twitter
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Ogc.OwsContext
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.WebService.Model
\ingroup Tep
@}
*/
/*!
\defgroup Tep Tep Modules
@{
This is a super component that encloses all Thematic Exploitation Platform related functional components.
Their main functionnalities are targeted to enhance the basic \ref Core functionalities for the thematic usage of the plaform.
@}
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using NuGet4Mono.Extensions;
[assembly: AssemblyTitle("Terradue.Tep")]
[assembly: AssemblyDescription("Terradue Tep .Net library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Terradue")]
[assembly: AssemblyProduct("Terradue.Tep")]
[assembly: AssemblyCopyright("Terradue")]
[assembly: AssemblyAuthors("Enguerran Boissier")]
[assembly: AssemblyProjectUrl("https://git.terradue.com/sugar/Terradue.Tep")]
[assembly: AssemblyLicenseUrl("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.3.2")]
[assembly: AssemblyInformationalVersion("1.3.2")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] | /*!
\namespace Terradue.Tep
@{
Terradue.Tep Software Package provides with all the functionalities specific to the TEP.
\xrefitem sw_version "Versions" "Software Package Version" 1.3.1
\xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep)
\xrefitem sw_license "License" "Software License" [AGPL](https://git.terradue.com/sugar/Terradue.Tep/LICENSE)
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch
\xrefitem sw_req "Require" "Software Dependencies" \ref ServiceStack
\xrefitem sw_req "Require" "Software Dependencies" \ref log4net
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Portal
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Authentication.Umsso
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Cloud
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Github
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Metadata.EarthObservation
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.News
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenNebula
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.GeoJson
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.RdfEO
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Tumblr
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Twitter
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Ogc.OwsContext
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication
\xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.WebService.Model
\ingroup Tep
@}
*/
/*!
\defgroup Tep Tep Modules
@{
This is a super component that encloses all Thematic Exploitation Platform related functional components.
Their main functionnalities are targeted to enhance the basic \ref Core functionalities for the thematic usage of the plaform.
@}
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using NuGet4Mono.Extensions;
[assembly: AssemblyTitle("Terradue.Tep")]
[assembly: AssemblyDescription("Terradue Tep .Net library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Terradue")]
[assembly: AssemblyProduct("Terradue.Tep")]
[assembly: AssemblyCopyright("Terradue")]
[assembly: AssemblyAuthors("Enguerran Boissier")]
[assembly: AssemblyProjectUrl("https://git.terradue.com/sugar/Terradue.Tep")]
[assembly: AssemblyLicenseUrl("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.3.1")]
[assembly: AssemblyInformationalVersion("1.3.1")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] | agpl-3.0 | C# |
26f501f86401d1ad54b196e020a4430561569e95 | Update Roslyn version number for assembly loading | DustinCampbell/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn | src/OmniSharp.Abstractions/Configuration.cs | src/OmniSharp.Abstractions/Configuration.cs | namespace OmniSharp
{
internal static class Configuration
{
public static bool ZeroBasedIndices = false;
public const string RoslynVersion = "2.3.0.0";
public const string RoslynPublicKeyToken = "31bf3856ad364e35";
public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features");
public readonly static string RoslynCSharpFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.CSharp.Features");
public readonly static string RoslynWorkspaces = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Workspaces");
private static string GetRoslynAssemblyFullName(string name)
{
return $"{name}, Version={RoslynVersion}, Culture=neutral, PublicKeyToken={RoslynPublicKeyToken}";
}
}
}
| namespace OmniSharp
{
internal static class Configuration
{
public static bool ZeroBasedIndices = false;
public const string RoslynVersion = "2.1.0.0";
public const string RoslynPublicKeyToken = "31bf3856ad364e35";
public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features");
public readonly static string RoslynCSharpFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.CSharp.Features");
public readonly static string RoslynWorkspaces = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Workspaces");
private static string GetRoslynAssemblyFullName(string name)
{
return $"{name}, Version={RoslynVersion}, Culture=neutral, PublicKeyToken={RoslynPublicKeyToken}";
}
}
}
| mit | C# |
d33907f7e01f267a965b1628b951d964db2292d7 | update payment_method.fraud_score type | conekta/conekta-.net | src/conekta/conekta/Models/PaymentMethod.cs | src/conekta/conekta/Models/PaymentMethod.cs | using System;
namespace conekta
{
public class PaymentMethod
{
public Int64 expires_at { get; set; }
public String type { get; set; }
public String _object { get; set; }
/*Oxxo Payment*/
public String barcode { get; set; }
public String barcode_url { get; set; }
public String store_name { get; set; }
/*Spei Payment*/
public String clabe { get; set; }
public String bank { get; set; }
public String issuing_account_holder { get; set; }
public String issuing_account_tax_id { get; set; }
public String issuing_account_bank { get; set; }
public String issuing_account_number { get; set; }
public String receiving_account_holder { get; set; }
public String receiving_account_tax_id { get; set; }
public String receiving_account_number { get; set; }
public String receiving_account_bank { get; set; }
public String reference_number { get; set; }
public String description { get; set; }
public String tracking_code { get; set; }
/*Credit Card Payment*/
public String name { get; set; }
public String exp_month { get; set; }
public String exp_year { get; set; }
public String auth_code { get; set; }
public String normalized_device_fingerprint { get; set; }
public String last4 { get; set; }
public String brand { get; set; }
public String issuer { get; set; }
public String account_type { get; set; }
public String country { get; set; }
public float fraud_score { get; set; }
/*Banorte payment*/
public String service_name { get; set; }
public String service_number { get; set; }
public String reference { get; set; }
}
}
| using System;
namespace conekta
{
public class PaymentMethod
{
public Int64 expires_at { get; set; }
public String type { get; set; }
public String _object { get; set; }
/*Oxxo Payment*/
public String barcode { get; set; }
public String barcode_url { get; set; }
public String store_name { get; set; }
/*Spei Payment*/
public String clabe { get; set; }
public String bank { get; set; }
public String issuing_account_holder { get; set; }
public String issuing_account_tax_id { get; set; }
public String issuing_account_bank { get; set; }
public String issuing_account_number { get; set; }
public String receiving_account_holder { get; set; }
public String receiving_account_tax_id { get; set; }
public String receiving_account_number { get; set; }
public String receiving_account_bank { get; set; }
public String reference_number { get; set; }
public String description { get; set; }
public String tracking_code { get; set; }
/*Credit Card Payment*/
public String name { get; set; }
public String exp_month { get; set; }
public String exp_year { get; set; }
public String auth_code { get; set; }
public String normalized_device_fingerprint { get; set; }
public String last4 { get; set; }
public String brand { get; set; }
public String issuer { get; set; }
public String account_type { get; set; }
public String country { get; set; }
public Int32 fraud_score { get; set; }
/*Banorte payment*/
public String service_name { get; set; }
public String service_number { get; set; }
public String reference { get; set; }
}
}
| mit | C# |
95fbacccdd47046335789a55f33ee5d11c621afd | Check if method exist before pre-test in TestCaseExecuter | Hammerstad/Moya | Moya.Runner/TestCaseExecuter.cs | Moya.Runner/TestCaseExecuter.cs | namespace Moya.Runner
{
using System.Collections.Generic;
using System.Reflection;
using Attributes;
using Exceptions;
using Extensions;
using Factories;
using Models;
using Runners;
using Utility;
public class TestCaseExecuter : ITestCaseExecuter
{
private readonly ITestRunnerFactory testRunnerFactory = new TestRunnerFactory();
private readonly ICollection<ITestResult> testResults = new List<ITestResult>();
public ICollection<ITestResult> RunTest(TestCase testCase)
{
MethodInfo methodInfo = ConvertTestCaseToMethodInfo(testCase);
if (methodInfo == null)
{
throw new MoyaException(
"Unable to find method from assembly.Assembly file path: {0}\nClass name: {1}\nMethod name: {2}"
.FormatWith(testCase.FilePath, testCase.ClassName, testCase.MethodName)
);
}
RunPreTestAttributes(methodInfo);
RunTestAttributes(methodInfo);
RunPostTestAttributes(methodInfo);
return testResults;
}
private void RunPreTestAttributes(MethodInfo methodInfo)
{
ITestRunner testRunner = testRunnerFactory.GetTestRunnerForAttribute(typeof(WarmupAttribute));
testResults.Add(testRunner.Execute(methodInfo));
}
private void RunTestAttributes(MethodInfo methodInfo)
{
ITestRunner testRunner = testRunnerFactory.GetTestRunnerForAttribute(typeof(StressAttribute));
testResults.Add(testRunner.Execute(methodInfo));
}
private void RunPostTestAttributes(MethodInfo methodInfo)
{
}
private static MethodInfo ConvertTestCaseToMethodInfo(TestCase testCase)
{
var assemblyHelper = new AssemblyHelper(testCase.FilePath);
return assemblyHelper.GetMethodFromAssembly(testCase.ClassName, testCase.MethodName);
}
}
} | namespace Moya.Runner
{
using System.Collections.Generic;
using System.Reflection;
using Attributes;
using Exceptions;
using Extensions;
using Factories;
using Models;
using Runners;
using Utility;
public class TestCaseExecuter : ITestCaseExecuter
{
private readonly ITestRunnerFactory testRunnerFactory = new TestRunnerFactory();
private readonly ICollection<ITestResult> testResults = new List<ITestResult>();
public ICollection<ITestResult> RunTest(TestCase testCase)
{
RunPreTestAttributes(testCase);
RunTestAttributes(testCase);
RunPostTestAttributes(testCase);
return testResults;
}
private void RunPreTestAttributes(TestCase testCase)
{
}
private void RunTestAttributes(TestCase testCase)
{
MethodInfo methodInfo = ConvertTestCaseToMethodInfo(testCase);
if (methodInfo == null)
{
throw new MoyaException(
"Unable to find method from assembly.Assembly file path: {0}\nClass name: {1}\nMethod name: {2}"
.FormatWith(testCase.FilePath, testCase.ClassName, testCase.MethodName)
);
}
ITestRunner loadTestRunner = testRunnerFactory.GetTestRunnerForAttribute(typeof(StressAttribute));
testResults.Add(loadTestRunner.Execute(methodInfo));
}
private void RunPostTestAttributes(TestCase testCase)
{
}
private static MethodInfo ConvertTestCaseToMethodInfo(TestCase testCase)
{
var assemblyHelper = new AssemblyHelper(testCase.FilePath);
return assemblyHelper.GetMethodFromAssembly(testCase.ClassName, testCase.MethodName);
}
}
} | mit | C# |
9bc303d2937ab2f62e146f7fdde6444ed8cb50c9 | Add MainServer.GetHttpServer(port) method for using multiple listener ports in region modules | allquixotic/opensim-autobackup,intari/OpenSimMirror,TechplexEngineer/Aurora-Sim,intari/OpenSimMirror,cdbean/CySim,intari/OpenSimMirror,TomDataworks/opensim,N3X15/VoxelSim,AlphaStaxLLC/taiga,ft-/arribasim-dev-extras,BogusCurry/arribasim-dev,AlphaStaxLLC/taiga,bravelittlescientist/opensim-performance,ft-/opensim-optimizations-wip-tests,N3X15/VoxelSim,RavenB/opensim,ft-/arribasim-dev-tests,ft-/opensim-optimizations-wip,Michelle-Argus/ArribasimExtract,ft-/opensim-optimizations-wip-extras,AlexRa/opensim-mods-Alex,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,Michelle-Argus/ArribasimExtract,AlphaStaxLLC/taiga,justinccdev/opensim,BogusCurry/arribasim-dev,OpenSimian/opensimulator,cdbean/CySim,justinccdev/opensim,ft-/opensim-optimizations-wip,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,QuillLittlefeather/opensim-1,intari/OpenSimMirror,M-O-S-E-S/opensim,M-O-S-E-S/opensim,cdbean/CySim,allquixotic/opensim-autobackup,ft-/opensim-optimizations-wip-tests,N3X15/VoxelSim,N3X15/VoxelSim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,AlphaStaxLLC/taiga,M-O-S-E-S/opensim,QuillLittlefeather/opensim-1,Michelle-Argus/ArribasimExtract,TechplexEngineer/Aurora-Sim,BogusCurry/arribasim-dev,AlexRa/opensim-mods-Alex,TomDataworks/opensim,QuillLittlefeather/opensim-1,RavenB/opensim,rryk/omp-server,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,bravelittlescientist/opensim-performance,cdbean/CySim,cdbean/CySim,M-O-S-E-S/opensim,TechplexEngineer/Aurora-Sim,RavenB/opensim,N3X15/VoxelSim,ft-/arribasim-dev-extras,OpenSimian/opensimulator,ft-/arribasim-dev-extras,AlphaStaxLLC/taiga,AlexRa/opensim-mods-Alex,TomDataworks/opensim,rryk/omp-server,RavenB/opensim,rryk/omp-server,intari/OpenSimMirror,ft-/arribasim-dev-tests,bravelittlescientist/opensim-performance,Michelle-Argus/ArribasimExtract,QuillLittlefeather/opensim-1,OpenSimian/opensimulator,QuillLittlefeather/opensim-1,rryk/omp-server,justinccdev/opensim,Michelle-Argus/ArribasimExtract,AlphaStaxLLC/taiga,ft-/arribasim-dev-tests,ft-/opensim-optimizations-wip-tests,M-O-S-E-S/opensim,allquixotic/opensim-autobackup,BogusCurry/arribasim-dev,justinccdev/opensim,justinccdev/opensim,M-O-S-E-S/opensim,ft-/opensim-optimizations-wip,ft-/arribasim-dev-tests,AlexRa/opensim-mods-Alex,ft-/opensim-optimizations-wip-extras,ft-/arribasim-dev-extras,ft-/arribasim-dev-tests,OpenSimian/opensimulator,AlexRa/opensim-mods-Alex,bravelittlescientist/opensim-performance,ft-/opensim-optimizations-wip-extras,TomDataworks/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,justinccdev/opensim,BogusCurry/arribasim-dev,allquixotic/opensim-autobackup,OpenSimian/opensimulator,TomDataworks/opensim,rryk/omp-server,N3X15/VoxelSim,allquixotic/opensim-autobackup,AlexRa/opensim-mods-Alex,OpenSimian/opensimulator,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,Michelle-Argus/ArribasimExtract,ft-/opensim-optimizations-wip-extras,TomDataworks/opensim,RavenB/opensim,bravelittlescientist/opensim-performance,BogusCurry/arribasim-dev,M-O-S-E-S/opensim,ft-/opensim-optimizations-wip-tests,N3X15/VoxelSim,intari/OpenSimMirror,RavenB/opensim,ft-/arribasim-dev-tests,QuillLittlefeather/opensim-1,TomDataworks/opensim,QuillLittlefeather/opensim-1,cdbean/CySim,AlphaStaxLLC/taiga,ft-/opensim-optimizations-wip-tests,bravelittlescientist/opensim-performance,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,TechplexEngineer/Aurora-Sim,N3X15/VoxelSim,ft-/arribasim-dev-extras,RavenB/opensim,ft-/opensim-optimizations-wip-extras,ft-/opensim-optimizations-wip,OpenSimian/opensimulator,AlphaStaxLLC/taiga,rryk/omp-server,ft-/arribasim-dev-extras,allquixotic/opensim-autobackup | OpenSim/Framework/MainServer.cs | OpenSim/Framework/MainServer.cs | /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenSim.Framework.Servers.HttpServer;
using System.Collections.Generic;
namespace OpenSim.Framework
{
public class MainServer
{
private static BaseHttpServer instance;
private static Dictionary<uint, BaseHttpServer> m_Servers =
new Dictionary<uint, BaseHttpServer>();
public static BaseHttpServer Instance
{
get { return instance; }
set { instance = value; }
}
public IHttpServer GetHttpServer(uint port)
{
if (port == Instance.Port)
return Instance;
if (m_Servers.ContainsKey(port))
return m_Servers[port];
m_Servers[port] = new BaseHttpServer(port);
m_Servers[port].Start();
return m_Servers[port];
}
}
}
| /*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenSim.Framework.Servers.HttpServer;
namespace OpenSim.Framework
{
public class MainServer
{
private static BaseHttpServer instance;
public static BaseHttpServer Instance
{
get { return instance; }
set { instance = value; }
}
}
}
| bsd-3-clause | C# |
c1e3fd17c7802b790379dab07191ca0d75217bd5 | fix style issue. A property should not follow a method | IntertechInc/saule,bjornharrtell/saule,sergey-litvinov-work/saule,joukevandermaas/saule,goo32/saule,laurence79/saule | Saule/Serialization/ApiError.cs | Saule/Serialization/ApiError.cs | using System;
using System.Collections.Generic;
using System.Web.Http;
namespace Saule.Serialization
{
internal class ApiError
{
public ApiError(Exception ex)
{
Title = ex.Message;
Detail = ex.ToString();
Code = ex.GetType().FullName;
Links = new Dictionary<string, string> { ["about"] = ex.HelpLink };
}
internal ApiError(HttpError ex)
{
Title = GetRecursiveExceptionMessage(ex);
Detail = ex.StackTrace;
Code = ex.ExceptionType;
}
public string Title { get; }
public string Detail { get; }
public string Code { get; }
public Dictionary<string, string> Links { get; }
private static string GetRecursiveExceptionMessage(HttpError ex)
{
var msg = !string.IsNullOrEmpty(ex.ExceptionMessage) ? ex.ExceptionMessage : ex.Message;
if (ex.InnerException != null)
{
msg += ' ' + GetRecursiveExceptionMessage(ex.InnerException);
}
return msg;
}
}
} | using System;
using System.Collections.Generic;
using System.Web.Http;
namespace Saule.Serialization
{
internal class ApiError
{
public ApiError(Exception ex)
{
Title = ex.Message;
Detail = ex.ToString();
Code = ex.GetType().FullName;
Links = new Dictionary<string, string> { ["about"] = ex.HelpLink };
}
internal ApiError(HttpError ex)
{
Title = GetRecursiveExceptionMessage(ex);
Detail = ex.StackTrace;
Code = ex.ExceptionType;
}
private static string GetRecursiveExceptionMessage(HttpError ex)
{
var msg = !string.IsNullOrEmpty(ex.ExceptionMessage) ? ex.ExceptionMessage : ex.Message;
if (ex.InnerException != null)
{
msg += ' ' + GetRecursiveExceptionMessage(ex.InnerException);
}
return msg;
}
public string Title { get; }
public string Detail { get; }
public string Code { get; }
public Dictionary<string, string> Links { get; }
}
}
| mit | C# |
f6dec186e9bb20707c477ac79ce27a5ec225380f | Use async method in main program | brian-dot-net/writeasync,brian-dot-net/writeasync,brian-dot-net/writeasync | projects/ProcessSample/source/ProcessSample.App/Program.cs | projects/ProcessSample/source/ProcessSample.App/Program.cs | //-----------------------------------------------------------------------
// <copyright file="Program.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace ProcessSample
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
internal sealed class Program
{
private static void Main(string[] args)
{
using (CancellationTokenSource cts = new CancellationTokenSource())
{
Task task = StartAndWaitForProcessAsync(cts.Token);
Console.WriteLine("Press ENTER to quit.");
Console.ReadLine();
cts.Cancel();
try
{
task.Wait();
}
catch (AggregateException ae)
{
ae.Handle(e => e is OperationCanceledException);
Console.WriteLine("(Canceled.)");
}
}
}
private static async Task StartAndWaitForProcessAsync(CancellationToken token)
{
int exitCode;
DateTime exitTime;
using (Process process = await Task.Factory.StartNew(() => Process.Start("notepad.exe")))
using (ProcessExitWatcher watcher = new ProcessExitWatcher(new ProcessExit(process)))
{
Console.WriteLine("Waiting for Notepad to exit...");
await watcher.WaitForExitAsync(token);
exitCode = watcher.Status.ExitCode;
exitTime = watcher.Status.ExitTime;
}
Console.WriteLine("Done, exited with code {0} at {1}.", exitCode, exitTime);
}
}
}
| //-----------------------------------------------------------------------
// <copyright file="Program.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace ProcessSample
{
using System;
using System.Diagnostics;
using System.Threading;
internal sealed class Program
{
private static void Main(string[] args)
{
int exitCode;
DateTime exitTime;
using (Process process = Process.Start("notepad.exe"))
using (ProcessExitWatcher watcher = new ProcessExitWatcher(new ProcessExit(process)))
{
Console.WriteLine("Waiting for Notepad to exit...");
watcher.WaitForExitAsync(CancellationToken.None).Wait();
exitCode = watcher.Status.ExitCode;
exitTime = watcher.Status.ExitTime;
}
Console.WriteLine("Done, exited with code {0} at {1}.", exitCode, exitTime);
}
}
}
| unlicense | C# |
e4c454dd2bf996b7f0e355a3619a1d6e91841eda | use string builder in to string method | ivayloivanof/C-Sharp-Chat-Programm | Client/ChatClient/ChatClient/ServerInfo.cs | Client/ChatClient/ChatClient/ServerInfo.cs | namespace ChatClient
{
using System;
using System.Collections.Generic;
using System.Text;
public struct ServerInfo
{
public string IP;
public string Port;
public string ServerName;
public string Username;
public string Pwd;
public string SrvPwd;
public UInt16 MaxUserAmount;
public UInt16 CurrUserAmount;
public bool isOnline;
public override string ToString()
{
var stringBuilder = new StringBuilder();
stringBuilder.Append(this.IP);
stringBuilder.Append(";");
stringBuilder.Append(this.Port);
stringBuilder.Append(";");
stringBuilder.Append(this.ServerName);
stringBuilder.Append(";");
stringBuilder.Append(this.Username);
stringBuilder.Append(";");
stringBuilder.Append(this.Pwd);
stringBuilder.Append(";");
stringBuilder.Append(this.SrvPwd);
stringBuilder.Append(";");
stringBuilder.Append(this.MaxUserAmount);
stringBuilder.Append(";");
stringBuilder.Append(this.CurrUserAmount);
return stringBuilder.ToString();
}
public void parseSrvInfo(List<string> _info)
{
ServerName = _info[0];
MaxUserAmount = Convert.ToUInt16(_info[1]);
CurrUserAmount = Convert.ToUInt16(_info[2]);
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ChatClient
{
public struct ServerInfo
{
public string IP;
public string Port;
public string ServerName;
public string Username;
public string Pwd;
public string SrvPwd;
public UInt16 MaxUserAmount;
public UInt16 CurrUserAmount;
public bool isOnline;
public override string ToString()
{
return IP + ";" + Port + ";" + ServerName + ";" + Username + ";" + Pwd + ";" + SrvPwd + ";" + MaxUserAmount + ";" + CurrUserAmount;
}
public void parseSrvInfo(List<string> _info)
{
ServerName = _info[0];
MaxUserAmount = Convert.ToUInt16(_info[1]);
CurrUserAmount = Convert.ToUInt16(_info[2]);
}
}
}
| unlicense | C# |
551452d8c0260da4c98c799dedcd177684c2f5d6 | Convert Console#Index view to pure html | appharbor/ConsolR,appharbor/ConsolR | CodeConsole.Web/Views/Console/Index.cshtml | CodeConsole.Web/Views/Console/Index.cshtml | <div id="ide">
<form action="/console" method="post">
<div id="commands">
<a class="js-run" href="#">run</a>
</div>
<div id="editors">
<div id="define">
<div class="editor">
<textarea cols="20" id="Classes" name="Classes" rows="2" style="display: none;">
class Person
{
public Person(string name)
{
Name = name;
}
public string Name { get; private set; }
public string Greet()
{
if (Name == null)
return "Hello, stranger!";
return string.Format("Hello, {0}!", Name);
}
}
</textarea>
</div>
</div>
<div id="execute">
<div class="editor">
<textarea cols="20" id="Content" name="Content" rows="2" style="display: none;">
var person = new Person(name: null);
return person.Greet();
</textarea>
</div>
</div>
</div>
<div id="footer">
<div class="results">
<pre></pre>
</div>
<div class="status">
<div class="loading-indicator">
<span></span>
</div>
<ul class="messages">
</ul>
</div>
</div>
</form>
</div>
| @model Compilify.Web.Models.PostViewModel
<div id="ide">
@using (Html.BeginForm())
{
<div id="commands">
<a class="js-run" href="#">run</a>
</div>
<div id="editors">
<div id="define">
<div class="editor">
@Html.TextAreaFor(x => x.Classes)
</div>
</div>
<div id="execute">
<div class="editor">
@Html.TextAreaFor(x => x.Content)
</div>
</div>
</div>
<div id="footer">
<div class="results">
<pre></pre>
</div>
@{ var hasErrors = Model.Errors != null && Model.Errors.Any(); }
<div class="status @(hasErrors ? "status-error" : "status-success")">
<div class="loading-indicator">
<span></span>
</div>
@*
This should remain partially hidden most of the time. When the user hovers over it, it should appear to
rise from below the browser window to display any messages it might contain.
An indicator could also be displayed here when loading content or waiting for the result of an execution.
The color of the status bar should change based on the status of the user's code:
* Red - there are errors in the user's code
* Green - there are no errors in the user's code
Other future possibilities include:
* Yellow - there are warnings in the user's code
*@
<ul class="messages">
@if (!hasErrors)
{
<li>No errors!</li>
}
else
{
foreach (var error in Model.Errors)
{
<li>@error.Message</li>
}
}
</ul>
</div>
</div>
}
</div> | mit | C# |
b774238be2e017213d1e8e6d42d39e046dc19859 | undo franz stuff | dbaeck/ai-playground,dbaeck/ai-playground,dbaeck/ai-playground,dbaeck/ai-playground | AIPlayground/AIPlayground/Class1.cs | AIPlayground/AIPlayground/Class1.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AIPlayground
{
public class Class1
{
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AIPlayground
{
public class Class1
{
//haaa gay!
}
}
| mit | C# |
904352c1c4f7b3a370e86bff706212463f24d145 | refactor mouse press into an optional function | momo-the-monster/workshop-trails | Assets/MMM/Trails/Scripts/MoveXY.cs | Assets/MMM/Trails/Scripts/MoveXY.cs | using UnityEngine;
using System.Collections;
/**
* Move the Transform of this object in X and Y
* Via Keyboard Commands
*/
namespace mmm
{
public class MoveXY : MonoBehaviour
{
public float speed = 100;
public Vector3 velocity = Vector3.zero;
public bool moveOnPress = false;
// Input Keys - easy to switch via Inspector
public KeyCode KeyUp = KeyCode.W;
public KeyCode KeyDown = KeyCode.S;
public KeyCode KeyLeft = KeyCode.A;
public KeyCode KeyRight = KeyCode.D;
void Update()
{
// Key Down Handlers - Add Velocities
if (Input.GetKeyDown(KeyUp))
velocity.y = speed;
else if (Input.GetKeyDown(KeyDown))
velocity.y = -speed;
else if (Input.GetKeyDown(KeyLeft))
velocity.x = -speed;
else if (Input.GetKeyDown(KeyRight))
velocity.x = speed;
// Key Up Handlers - Zero Velocities
if ((Input.GetKeyUp(KeyUp)) || Input.GetKeyUp(KeyDown))
velocity.y = 0;
if ((Input.GetKeyUp(KeyLeft)) || Input.GetKeyUp(KeyRight))
velocity.x = 0;
// Do Random direction if we've opted in to it
if(moveOnPress)
{
DoRandomDirection();
}
// Move Transform with velocity
transform.position += (velocity * Time.deltaTime);
}
void DoRandomDirection()
{
// Mouse Handler - Set / Zero Velocities
if (Input.GetMouseButtonUp(0))
velocity = Vector3.zero;
if (Input.GetMouseButtonDown(0))
{
// set random velocity
velocity.x = Random.value > 0.5 ? speed : -speed;
velocity.y = Random.value > 0.5 ? speed : -speed;
}
}
}
} | using UnityEngine;
using System.Collections;
/**
* Move the Transform of this object in X and Y
* Via Keyboard Commands
*/
namespace mmm
{
public class MoveXY : MonoBehaviour
{
public float speed = 100;
public Vector3 velocity = Vector3.zero;
// Input Keys - easy to switch via Inspector
public KeyCode KeyUp = KeyCode.W;
public KeyCode KeyDown = KeyCode.S;
public KeyCode KeyLeft = KeyCode.A;
public KeyCode KeyRight = KeyCode.D;
void Update()
{
// Key Down Handlers - Add Velocities
if (Input.GetKeyDown(KeyUp))
velocity.y = speed;
else if (Input.GetKeyDown(KeyDown))
velocity.y = -speed;
else if (Input.GetKeyDown(KeyLeft))
velocity.x = -speed;
else if (Input.GetKeyDown(KeyRight))
velocity.x = speed;
// Key Up Handlers - Zero Velocities
if ((Input.GetKeyUp(KeyUp)) || Input.GetKeyUp(KeyDown))
velocity.y = 0;
if ((Input.GetKeyUp(KeyLeft)) || Input.GetKeyUp(KeyRight))
velocity.x = 0;
// Mouse Handler - Set / Zero Velocities
if (Input.GetMouseButtonUp(0))
velocity = Vector3.zero;
if (Input.GetMouseButtonDown(0))
{
// set random velocity
velocity.x = Random.value > 0.5 ? speed : -speed;
velocity.y = Random.value > 0.5 ? speed : -speed;
}
// Move Transform with velocity
transform.position += (velocity * Time.deltaTime);
}
}
} | mit | C# |
abefa14c78148ebeff65b2c6d0484e9ec96445e8 | Hide test command. | mcneel/RhinoCycles | Commands/TestDeviceEqualityCrash.cs | Commands/TestDeviceEqualityCrash.cs | /**
Copyright 2014-2015 Robert McNeel and Associates
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.Runtime.InteropServices;
using ccl;
using Rhino;
using Rhino.Commands;
namespace RhinoCycles.Commands
{
[Guid("701e9844-10c5-4891-ade0-a18bceea550d")]
[CommandStyle(Style.Hidden)]
public class TestDeviceEqualityCrash : Command
{
static TestDeviceEqualityCrash _instance;
public TestDeviceEqualityCrash()
{
_instance = this;
}
///<summary>The only instance of the TestDeviceEqualityCrash command.</summary>
public static TestDeviceEqualityCrash Instance => _instance;
public override string EnglishName => "TestDeviceEqualityCrash";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
Device a = null;
try
{
if (a == null) RhinoApp.WriteLine("Device null equals null. RH-43880 is fixed.");
} catch (System.NullReferenceException nre)
{
RhinoApp.WriteLine($"Device::operator==() not fixed properly. RH-43880 not fixed. Report to [email protected]: {nre}");
}
return Result.Success;
}
}
}
| /**
Copyright 2014-2015 Robert McNeel and Associates
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.Runtime.InteropServices;
using ccl;
using Rhino;
using Rhino.Commands;
namespace RhinoCycles.Commands
{
[Guid("701e9844-10c5-4891-ade0-a18bceea550d")]
public class TestDeviceEqualityCrash : Command
{
static TestDeviceEqualityCrash _instance;
public TestDeviceEqualityCrash()
{
_instance = this;
}
///<summary>The only instance of the TestDeviceEqualityCrash command.</summary>
public static TestDeviceEqualityCrash Instance => _instance;
public override string EnglishName => "TestDeviceEqualityCrash";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
Device a = null;
try
{
if (a == null) RhinoApp.WriteLine("Device null equals null. RH-43880 is fixed.");
} catch (System.NullReferenceException nre)
{
RhinoApp.WriteLine($"Device::operator==() not fixed properly. RH-43880 not fixed. Report to [email protected]: {nre}");
}
return Result.Success;
}
}
}
| apache-2.0 | C# |
6bfb6bebf7bba23f852ff67828da7796ce096ffa | Reset version for intermediate release | OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,phillipharding/PnP-Sites-Core,phillipharding/PnP-Sites-Core | Core/OfficeDevPnP.Core/Properties/AssemblyInfo.cs | Core/OfficeDevPnP.Core/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Resources;
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("OfficeDevPnP.Core")]
#if SP2013
[assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2013")]
#elif SP2016
[assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2016")]
#else
[assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint Online")]
#endif
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OfficeDevPnP.Core")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
// 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("065331b6-0540-44e1-84d5-d38f09f17f9e")]
// 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:
// Convention:
// Major version = current version 2
// Minor version = Sequence...version 0 was with January release...so 1=Feb 2=Mar, 3=Apr, 4=May, 5=Jun, 6=Aug, 7=Sept,...
// Third part = version indenpendant showing the release month in YYMM
// Fourth part = 0 normally or a sequence number when we do an emergency release
[assembly: AssemblyVersion("2.8.1610.1")]
[assembly: AssemblyFileVersion("2.8.1610.1")]
[assembly: InternalsVisibleTo("OfficeDevPnP.Core.Tests")] | using System.Reflection;
using System.Resources;
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("OfficeDevPnP.Core")]
#if SP2013
[assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2013")]
#elif SP2016
[assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint 2016")]
#else
[assembly: AssemblyDescription("Office Dev PnP Core library for SharePoint Online")]
#endif
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OfficeDevPnP.Core")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
// 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("065331b6-0540-44e1-84d5-d38f09f17f9e")]
// 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:
// Convention:
// Major version = current version 2
// Minor version = Sequence...version 0 was with January release...so 1=Feb 2=Mar, 3=Apr, 4=May, 5=Jun, 6=Aug, 7=Sept,...
// Third part = version indenpendant showing the release month in YYMM
// Fourth part = 0 normally or a sequence number when we do an emergency release
[assembly: AssemblyVersion("2.9.1611.0")]
[assembly: AssemblyFileVersion("2.9.1611.0")]
[assembly: InternalsVisibleTo("OfficeDevPnP.Core.Tests")] | mit | C# |
6abe6b6fd79e340a691c9830fbe0b574346cfe58 | Add AssemblyNativeVersion attribute to class library template (#434) | nanoframework/nf-Visual-Studio-extension | source/CSharp.ClassLibrary/AssemblyInfo.cs | source/CSharp.ClassLibrary/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("CSharp.BlankApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CSharp.BlankApplication")]
[assembly: AssemblyCopyright("Copyright © ")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
/////////////////////////////////////////////////////////////////
// This attribute is mandatory when building Interop libraries //
// update this whenever the native assembly signature changes //
[assembly: AssemblyNativeVersion("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("CSharp.BlankApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CSharp.BlankApplication")]
[assembly: AssemblyCopyright("Copyright © ")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| mit | C# |
be607e7926cf3cfe536c34342df04272dfed1793 | Use POL.OpenPOLUtilsConfigKey() where applicable. | Zastai/POLUtils | PlayOnline.Utils.FFXIDataBrowser/IItemExporter.cs | PlayOnline.Utils.FFXIDataBrowser/IItemExporter.cs | using System;
using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;
using PlayOnline.Core;
using PlayOnline.FFXI;
namespace PlayOnline.Utils.FFXIDataBrowser {
internal abstract class IItemExporter {
public abstract void DoExport(FFXIItem[] Items);
private static FolderBrowserDialog dlgBrowseFolder = null;
private static void PrepareFolderBrowser() {
if (IItemExporter.dlgBrowseFolder == null) {
IItemExporter.dlgBrowseFolder = new FolderBrowserDialog();
IItemExporter.dlgBrowseFolder.Description = I18N.GetText("Export:DirDialogDesc");
string DefaultLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), Path.Combine("POLUtils", "Exported Item Data"));
string InitialLocation = null;
using (RegistryKey RK = POL.OpenPOLUtilsConfigKey()) {
if (RK != null)
InitialLocation = RK.GetValue(@"Data Browser\Export Location", null) as string;
}
if (InitialLocation == null || InitialLocation == String.Empty)
InitialLocation = DefaultLocation;
if (!Directory.Exists(InitialLocation))
Directory.CreateDirectory(InitialLocation);
IItemExporter.dlgBrowseFolder.SelectedPath = InitialLocation;
}
}
public static string OutputPath {
get {
IItemExporter.PrepareFolderBrowser();
return IItemExporter.dlgBrowseFolder.SelectedPath;
}
}
public static void BrowseForOutputPath() {
IItemExporter.PrepareFolderBrowser();
if (IItemExporter.dlgBrowseFolder.ShowDialog() == DialogResult.OK) {
using (RegistryKey RK = POL.OpenPOLUtilsConfigKey()) {
if (RK != null)
RK.SetValue(@"Data Browser\Export Location", IItemExporter.dlgBrowseFolder.SelectedPath);
}
}
}
}
}
| using System;
using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;
using PlayOnline.Core;
using PlayOnline.FFXI;
namespace PlayOnline.Utils.FFXIDataBrowser {
internal abstract class IItemExporter {
public abstract void DoExport(FFXIItem[] Items);
private static FolderBrowserDialog dlgBrowseFolder = null;
private static void PrepareFolderBrowser() {
if (IItemExporter.dlgBrowseFolder == null) {
IItemExporter.dlgBrowseFolder = new FolderBrowserDialog();
IItemExporter.dlgBrowseFolder.Description = I18N.GetText("Export:DirDialogDesc");
string DefaultLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), Path.Combine("POLUtils", "Exported Item Data"));
string InitialLocation = null;
try {
RegistryKey RK = Registry.CurrentUser.CreateSubKey(@"Software\Pebbles\POLUtils");
InitialLocation = RK.GetValue("Export Location", null) as string;
RK.Close();
} catch { }
if (InitialLocation == null || InitialLocation == String.Empty)
InitialLocation = DefaultLocation;
if (!Directory.Exists(InitialLocation))
Directory.CreateDirectory(InitialLocation);
IItemExporter.dlgBrowseFolder.SelectedPath = InitialLocation;
}
}
public static string OutputPath {
get {
IItemExporter.PrepareFolderBrowser();
return IItemExporter.dlgBrowseFolder.SelectedPath;
}
}
public static void BrowseForOutputPath() {
IItemExporter.PrepareFolderBrowser();
if (IItemExporter.dlgBrowseFolder.ShowDialog() == DialogResult.OK) {
try {
RegistryKey RK = Registry.CurrentUser.CreateSubKey(@"Software\Pebbles\POLUtils");
RK.SetValue("Export Location", IItemExporter.dlgBrowseFolder.SelectedPath);
RK.Close();
} catch { }
}
}
}
}
| apache-2.0 | C# |
4afd7048829532740eeae344e0d29108619a4dfc | Remove unused method. | jherby2k/AudioWorks | AudioWorks/Extensions/AudioWorks.Extensions.Mp4/TextAtom.cs | AudioWorks/Extensions/AudioWorks.Extensions.Mp4/TextAtom.cs | using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JetBrains.Annotations;
namespace AudioWorks.Extensions.Mp4
{
sealed class TextAtom : WritableAtom
{
[NotNull] readonly string _fourCc;
[NotNull]
internal string Value { get; }
internal TextAtom([NotNull] IReadOnlyCollection<byte> data)
{
_fourCc = new string(CodePagesEncodingProvider.Instance.GetEncoding(1252).GetChars(data.Take(4).ToArray()));
Value = new string(Encoding.UTF8.GetChars(data.Skip(24).Take(data.Count - 24).ToArray()));
}
internal TextAtom([NotNull] string fourCc, [NotNull] string value)
{
_fourCc = fourCc;
Value = value;
}
internal override byte[] GetBytes()
{
var contents = Encoding.UTF8.GetBytes(Value);
Span<byte> result = stackalloc byte[contents.Length + 24];
// Write the atom header
BinaryPrimitives.WriteUInt32BigEndian(result, (uint) result.Length);
CodePagesEncodingProvider.Instance.GetEncoding(1252).GetBytes(_fourCc).CopyTo(result.Slice(4));
// Write the data atom header
BinaryPrimitives.WriteUInt32BigEndian(result.Slice(8), (uint) result.Length - 8);
BinaryPrimitives.WriteInt32BigEndian(result.Slice(12), 0x64617461); // 'data'
// Set the type flag
result[19] = 1;
// Set the atom contents
contents.CopyTo(result.Slice(24));
return result.ToArray();
}
}
} | using System;
using System.Buffers.Binary;
using System.Buffers.Text;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JetBrains.Annotations;
namespace AudioWorks.Extensions.Mp4
{
sealed class TextAtom : WritableAtom
{
[NotNull] readonly string _fourCc;
[NotNull]
internal string Value { get; }
internal TextAtom([NotNull] IReadOnlyCollection<byte> data)
{
_fourCc = new string(CodePagesEncodingProvider.Instance.GetEncoding(1252).GetChars(data.Take(4).ToArray()));
Value = new string(Encoding.UTF8.GetChars(data.Skip(24).Take(data.Count - 24).ToArray()));
}
internal TextAtom([NotNull] string fourCc, [NotNull] string value)
{
_fourCc = fourCc;
Value = value;
}
internal override byte[] GetBytes()
{
var contents = Encoding.UTF8.GetBytes(Value);
Span<byte> result = stackalloc byte[contents.Length + 24];
// Write the atom header
BinaryPrimitives.WriteUInt32BigEndian(result, (uint) result.Length);
CodePagesEncodingProvider.Instance.GetEncoding(1252).GetBytes(_fourCc).CopyTo(result.Slice(4));
// Write the data atom header
BinaryPrimitives.WriteUInt32BigEndian(result.Slice(8), (uint) result.Length - 8);
BinaryPrimitives.WriteInt32BigEndian(result.Slice(12), 0x64617461); // 'data'
// Set the type flag
result[19] = 1;
// Set the atom contents
contents.CopyTo(result.Slice(24));
return result.ToArray();
}
[Pure, NotNull]
static byte[] ConvertToBigEndianBytes(uint value)
{
var result = BitConverter.GetBytes(value);
Array.Reverse(result);
return result;
}
}
} | agpl-3.0 | C# |
2a78a314c8d2ec15208d7622319a197f5f7957d4 | Fix #39: HttpFactory.Delete does not respect headers | hanssens/extensions | src/Hanssens.Net/Http/HttpFactory.Async.cs | src/Hanssens.Net/Http/HttpFactory.Async.cs | using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
namespace Hanssens.Net.Http
{
public partial class HttpFactory
{
public async Task<HttpResponseMessage> DeleteAsync(string requestUri, Dictionary<string, string> headers = null)
{
// TODO: investigate the proper use of a 'body' in a DELETE operation
// see also: http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request
return await Execute(HttpMethod.Delete, requestUri, body: string.Empty, headers: headers);
}
public async Task<HttpResponseMessage> GetAsync(string requestUri, Dictionary<string, string> headers = null)
{
return await Execute(HttpMethod.Get, requestUri, body: string.Empty, headers: headers);
}
public async Task<HttpResponseMessage> PatchAsync<T>(string requestUri, T body, Dictionary<string, string> headers = null)
{
return await Execute(new HttpMethod("PATCH"), requestUri, body, headers);
}
public async Task<HttpResponseMessage> PostAsync<T>(string requestUri, T body, Dictionary<string, string> headers = null)
{
return await Execute(HttpMethod.Post, requestUri, body, headers);
}
public async Task<HttpResponseMessage> PutAsync<T>(string requestUri, T body, Dictionary<string, string> headers = null)
{
return await Execute(HttpMethod.Put, requestUri, body, headers);
}
}
}
| using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
namespace Hanssens.Net.Http
{
public partial class HttpFactory
{
public async Task<HttpResponseMessage> DeleteAsync(string requestUri, Dictionary<string, string> headers = null)
{
// TODO: investigate the proper use of a 'body' in a DELETE operation
// see also: http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request
return await Execute(HttpMethod.Delete, requestUri, body: string.Empty, headers: null);
}
public async Task<HttpResponseMessage> GetAsync(string requestUri, Dictionary<string, string> headers = null)
{
return await Execute(HttpMethod.Get, requestUri, body: string.Empty, headers: headers);
}
public async Task<HttpResponseMessage> PatchAsync<T>(string requestUri, T body, Dictionary<string, string> headers = null)
{
return await Execute(new HttpMethod("PATCH"), requestUri, body, headers);
}
public async Task<HttpResponseMessage> PostAsync<T>(string requestUri, T body, Dictionary<string, string> headers = null)
{
return await Execute(HttpMethod.Post, requestUri, body, headers);
}
public async Task<HttpResponseMessage> PutAsync<T>(string requestUri, T body, Dictionary<string, string> headers = null)
{
return await Execute(HttpMethod.Put, requestUri, body, headers);
}
}
}
| mit | C# |
8e3b5f1e45fbd01805aeb67cfe0917b0d6c1eaff | add tracking to match cTradeBrokerRejectSuggest | neowutran/OpcodeSearcher | DamageMeter.Core/Heuristic/S_TRADE_BROKER_DEAL_SUGGESTED.cs | DamageMeter.Core/Heuristic/S_TRADE_BROKER_DEAL_SUGGESTED.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tera.Game.Messages;
namespace DamageMeter.Heuristic
{
class S_TRADE_BROKER_DEAL_SUGGESTED : AbstractPacketHeuristic
{
public static uint LatestListing;
public static uint LatestBuyerId;
public new void Process(ParsedMessage message)
{
base.Process(message);
if (IsKnown || OpcodeFinder.Instance.IsKnown(message.OpCode))
{
if (OpcodeFinder.Instance.GetOpcode(OPCODE) == message.OpCode) { Parse(); }
return;
}
if (message.Payload.Count < 2 + 4 + 4 + 4 + 8 + 8 + 8 + 4) return;
//could also check on specific item/player/amount/money
var nameOffset = Reader.ReadUInt16();
if(nameOffset != 0x2A) return;
var playerId = Reader.ReadUInt32();
var listing = Reader.ReadUInt32();
var item = Reader.ReadUInt32();
var amount = Reader.ReadUInt64();
var sellerPrice = Reader.ReadUInt64();
var offeredPrice = Reader.ReadUInt64();
try
{
//Reader.BaseStream.Position = nameOffset - 4;
var name = Reader.ReadTeraString();
if (name.Length * 2 + 2 + 4 + 4 + 4 + 8 + 8 + 8 + 2 != message.Payload.Count) return;
}
catch (Exception e){return;}
OpcodeFinder.Instance.SetOpcode(message.OpCode, OPCODE);
LatestListing = listing;
LatestBuyerId = playerId;
}
private void Parse()
{
var nameOffset = Reader.ReadUInt16();
LatestBuyerId = Reader.ReadUInt32();
LatestListing = Reader.ReadUInt32();
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tera.Game.Messages;
namespace DamageMeter.Heuristic
{
class S_TRADE_BROKER_DEAL_SUGGESTED : AbstractPacketHeuristic
{
public new void Process(ParsedMessage message)
{
base.Process(message);
if (IsKnown || OpcodeFinder.Instance.IsKnown(message.OpCode)) return;
if (message.Payload.Count < 2 + 4 + 4 + 4 + 8 + 8 + 8 + 4) return;
//could also check on specific item/player/amount/money
var nameOffset = Reader.ReadUInt16();
if(nameOffset != 0x2A) return;
var playerId = Reader.ReadUInt32();
var listing = Reader.ReadUInt32();
var item = Reader.ReadUInt32();
var amount = Reader.ReadUInt64();
var sellerPrice = Reader.ReadUInt64();
var offeredPrice = Reader.ReadUInt64();
try
{
//Reader.BaseStream.Position = nameOffset - 4;
var name = Reader.ReadTeraString();
if (name.Length * 2 + 2 + 4 + 4 + 4 + 8 + 8 + 8 + 2 != message.Payload.Count) return;
}
catch (Exception e){return;}
OpcodeFinder.Instance.SetOpcode(message.OpCode, OPCODE);
}
}
}
| mit | C# |
3e87306d8e8b909aaa26582fa11cb30e52e9431e | Undo accidental 2.0 -> 2.1 renames (dotnet/corert#5981) | poizan42/coreclr,mmitche/coreclr,cshung/coreclr,poizan42/coreclr,krk/coreclr,poizan42/coreclr,mmitche/coreclr,poizan42/coreclr,krk/coreclr,mmitche/coreclr,cshung/coreclr,wtgodbe/coreclr,cshung/coreclr,wtgodbe/coreclr,mmitche/coreclr,poizan42/coreclr,krk/coreclr,poizan42/coreclr,cshung/coreclr,krk/coreclr,mmitche/coreclr,wtgodbe/coreclr,cshung/coreclr,wtgodbe/coreclr,mmitche/coreclr,krk/coreclr,wtgodbe/coreclr,cshung/coreclr,krk/coreclr,wtgodbe/coreclr | src/System.Private.CoreLib/shared/System/Collections/Generic/NonRandomizedStringEqualityComparer.cs | src/System.Private.CoreLib/shared/System/Collections/Generic/NonRandomizedStringEqualityComparer.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Runtime.Serialization;
namespace System.Collections.Generic
{
// NonRandomizedStringEqualityComparer is the comparer used by default with the Dictionary<string,...>
// We use NonRandomizedStringEqualityComparer as default comparer as it doesnt use the randomized string hashing which
// keeps the performance not affected till we hit collision threshold and then we switch to the comparer which is using
// randomized string hashing.
[Serializable] // Required for compatibility with .NET Core 2.0 as we exposed the NonRandomizedStringEqualityComparer inside the serialization blob
// Needs to be public to support binary serialization compatibility
public sealed class NonRandomizedStringEqualityComparer : EqualityComparer<string>, ISerializable
{
internal static new IEqualityComparer<string> Default { get; } = new NonRandomizedStringEqualityComparer();
private NonRandomizedStringEqualityComparer() { }
// This is used by the serialization engine.
private NonRandomizedStringEqualityComparer(SerializationInfo information, StreamingContext context) { }
public sealed override bool Equals(string x, string y) => string.Equals(x, y);
public sealed override int GetHashCode(string obj) => obj?.GetLegacyNonRandomizedHashCode() ?? 0;
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
// We are doing this to stay compatible with .NET Framework.
info.SetType(typeof(GenericEqualityComparer<string>));
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Runtime.Serialization;
namespace System.Collections.Generic
{
// NonRandomizedStringEqualityComparer is the comparer used by default with the Dictionary<string,...>
// We use NonRandomizedStringEqualityComparer as default comparer as it doesnt use the randomized string hashing which
// keeps the performance not affected till we hit collision threshold and then we switch to the comparer which is using
// randomized string hashing.
[Serializable] // Required for compatibility with .NET Core 2.1 as we exposed the NonRandomizedStringEqualityComparer inside the serialization blob
// Needs to be public to support binary serialization compatibility
public sealed class NonRandomizedStringEqualityComparer : EqualityComparer<string>, ISerializable
{
internal static new IEqualityComparer<string> Default { get; } = new NonRandomizedStringEqualityComparer();
private NonRandomizedStringEqualityComparer() { }
// This is used by the serialization engine.
private NonRandomizedStringEqualityComparer(SerializationInfo information, StreamingContext context) { }
public sealed override bool Equals(string x, string y) => string.Equals(x, y);
public sealed override int GetHashCode(string obj) => obj?.GetLegacyNonRandomizedHashCode() ?? 0;
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
// We are doing this to stay compatible with .NET Framework.
info.SetType(typeof(GenericEqualityComparer<string>));
}
}
}
| mit | C# |
c131ed72c7ff88f05c9f49c12eb2d967e779172c | update entity op | tbstudee/IntacctClient | Operations/UpdateEntityOperation.cs | Operations/UpdateEntityOperation.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Intacct.Entities;
using Intacct.Infrastructure;
namespace Intacct.Operations
{
public class UpdateEntityOperation<TEntity> : IntacctAuthenticatedOperationBase<TEntity> where TEntity : IntacctObject
{
private readonly string _entityName;
private readonly string _entityId;
private readonly bool _isExternalKey;
public UpdateEntityOperation(IIntacctSession session, string entityId, string responseElementName, bool isExternalKey = false) : base(session, "update", responseElementName, mayHaveEmptyResult: true)
{
if (entityId == null) throw new ArgumentNullException(nameof(entityId));
if (string.IsNullOrWhiteSpace(entityId)) throw new ArgumentException($"Argument {nameof(entityId)} may not be empty.", nameof(entityId));
_entityName = GetObjectName<TEntity>();
_entityId = entityId;
_isExternalKey = isExternalKey;
}
protected override XObject[] CreateFunctionContents()
{
throw new NotImplementedException();
}
protected override IntacctOperationResult<TEntity> ProcessResponseData(XElement responseData)
{
var entityElement = responseData.Element(_entityName);
var entity = (TEntity) Activator.CreateInstance(typeof (TEntity), entityElement);
return new IntacctOperationResult<TEntity>(entity);
}
private string GetObjectName<T>()
{
var attribute = typeof(T).GetTypeInfo().GetCustomAttribute<IntacctNameAttribute>();
if (attribute == null)
{
throw new Exception($"Unable to create \"update\" request for entity of type {typeof(T).Name} because it is missing the {nameof(IntacctNameAttribute)} attribute.");
}
return attribute.Name;
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Intacct.Entities;
namespace Intacct.Operations
{
public class UpdateEntityOperation<TEntity> : IntacctAuthenticatedOperationBase<TEntity> where TEntity : IntacctObject
{
public UpdateEntityOperation(IIntacctSession session, string functionName, string responseElementName, bool mayHaveEmptyResult = false) : base(session, functionName, responseElementName, mayHaveEmptyResult)
{
}
protected override XObject[] CreateFunctionContents()
{
throw new NotImplementedException();
}
protected override IntacctOperationResult<TEntity> ProcessResponseData(XElement responseData)
{
throw new NotImplementedException();
}
}
}
| mit | C# |
ecc6384bbdc222645e6a85aa13f4cd2edb062cac | add kill arg | abanu-desktop/abanu | src/panel/Program.cs | src/panel/Program.cs | using System;
using Gtk;
using System.Diagnostics;
using abanu.core;
namespace abanu.panel
{
class MainClass
{
public static void Main(string[] args)
{
Application.Init();
//var dwin = new DesktopWindow();
//dwin.Show();
/*GLib.ExceptionManager.UnhandledException += (e) => {
e.ExitApplication = false;
CoreLib.Log(e.ExceptionObject.ToString());
};*/
try {
Environment.CurrentDirectory = new System.IO.DirectoryInfo(System.IO.Path.GetDirectoryName(new Uri(typeof(MainClass).Assembly.CodeBase).LocalPath)).Parent.FullName;
if (args.Length > 0) {
if (args[0] == "--kill" || args[0] == "--replace") {
var currProcess = Process.GetCurrentProcess();
foreach (var process in System.Diagnostics.Process.GetProcessesByName("abanu.panel"))
if (process.Id != currProcess.Id)
process.Kill();
if (args[0] == "--kill")
return;
}
}
var logwin = new LogWindow();
logwin.Show();
CoreLib.Log("log started");
AppConfig.Load("config/config.xml");
//Gtk.Settings.Default.ThemeName = "Dorian-3.16";
var shellMan = ShellManager.Create();
shellMan.UpdateWindows();
var idx = new TLauncherIndex();
idx.AddLocations();
idx.Rebuild();
foreach (var panConfig in AppConfig.Panels) {
var pwin = new TPanel(panConfig);
pwin.Setup();
pwin.Show();
}
} catch (Exception ex) {
CoreLib.MessageBox(ex.ToString());
}
Application.Run();
}
}
}
| using System;
using Gtk;
using System.Diagnostics;
using abanu.core;
namespace abanu.panel
{
class MainClass
{
public static void Main(string[] args)
{
Application.Init();
//var dwin = new DesktopWindow();
//dwin.Show();
/*GLib.ExceptionManager.UnhandledException += (e) => {
e.ExitApplication = false;
CoreLib.Log(e.ExceptionObject.ToString());
};*/
try {
Environment.CurrentDirectory = new System.IO.DirectoryInfo(System.IO.Path.GetDirectoryName(new Uri(typeof(MainClass).Assembly.CodeBase).LocalPath)).Parent.FullName;
if (args.Length > 0) {
if (args[0] == "--kill" || args[0] == "--replace") {
var currProcess = Process.GetCurrentProcess();
foreach (var process in System.Diagnostics.Process.GetProcessesByName("abanu.panel.exe"))
if (process.Id != currProcess.Id)
process.Kill();
if (args[0] == "--kill")
return;
}
}
var logwin = new LogWindow();
logwin.Show();
CoreLib.Log("log started");
AppConfig.Load("config/config.xml");
//Gtk.Settings.Default.ThemeName = "Dorian-3.16";
var shellMan = ShellManager.Create();
shellMan.UpdateWindows();
var idx = new TLauncherIndex();
idx.AddLocations();
idx.Rebuild();
foreach (var panConfig in AppConfig.Panels) {
var pwin = new TPanel(panConfig);
pwin.Setup();
pwin.Show();
}
} catch (Exception ex) {
CoreLib.MessageBox(ex.ToString());
}
Application.Run();
}
}
}
| mit | C# |
6e7fc188de9f731fef171b4437dc97365b6d0261 | Update LinkedListDictionary.cs | efruchter/UnityUtilities | MiscDataStructures/LinkedListDictionary.cs | MiscDataStructures/LinkedListDictionary.cs | using System.Collections;
using System.Collections.Generic;
namespace Collections.Hybrid.Generic
{
/// <summary>
/// LinkedList/Dictionary combo for constant time add/remove/contains. Memory usage is higher as expected.
/// -kazoo
/// </summary>
/// <typeparam name="TK">key value type. It is recomended that this be "int", for speed purposes.</typeparam>
/// <typeparam name="TV">The value type. Can be anything you like.</typeparam>
public class LinkedListDictionary<TK, TV>
{
private readonly Dictionary<TK, LLEntry> dictionary = new Dictionary<TK, LLEntry>();
private readonly LinkedList<TV> list = new LinkedList<TV>();
/// <summary>
/// Get The count.
/// </summary>
/// <returns></returns>
public int Count
{
get { return list.Count; }
}
/// <summary>
/// Is the key in the dictionary?
/// </summary>
/// <param name="k">key</param>
/// <returns>true if key is present, false otherwise.</returns>
public bool ContainsKey(TK k)
{
return dictionary.ContainsKey(k);
}
/// <summary>
/// Remove a key/value from the dictionary if present.
/// </summary>
/// <param name="k">key</param>
/// <returns>True if removal worked. False if removal is not possible.</returns>
public bool Remove(TK k)
{
if (!ContainsKey(k))
{
return false;
}
LLEntry entry = dictionary[k];
list.Remove(entry.vNode);
return dictionary.Remove(k);
}
/// <summary>
/// Add an item. Replacement is allowed.
/// </summary>
/// <param name="k">key</param>
/// <param name="v">value</param>
public void Add(TK k, TV v)
{
Remove(k);
dictionary[k] = new LLEntry(v, list.AddLast(v));
}
/// <summary>
/// Retrieve an element by key.
/// </summary>
/// <param name="k">key</param>
/// <returns>Value. If element is not present, default(V) will be returned.</returns>
public TV GetValue(TK k)
{
if (ContainsKey(k))
{
return dictionary[k].v;
}
return default(TV);
}
public TV this[TK k]
{
get { return GetValue(k); }
set { Add(k, value); }
}
/// <summary>
/// Raw list of Values for garbage-free iteration. Do not modify.
/// </summary>
/// <value>The values</value>
public LinkedList<TV> Values
{
get
{
return list;
}
}
public void Clear()
{
dictionary.Clear();
list.Clear();
}
private struct LLEntry
{
public readonly TV v;
public readonly LinkedListNode<TV> vNode;
public LLEntry(TV v, LinkedListNode<TV> vNode)
{
this.v = v;
this.vNode = vNode;
}
}
}
}
| using System.Collections;
using System.Collections.Generic;
/// <summary>
/// LinkedList/Dictionary combo for constant time add/remove/contains. Memory usage is higher as expected.
/// -kazoo
/// </summary>
/// <typeparam name="TK">key value type. It is recomended that this be "int", for speed purposes.</typeparam>
/// <typeparam name="TV">The value type. Can be anything you like.</typeparam>
public class LinkedListDictionary<TK, TV>
{
private readonly Dictionary<TK, LLEntry> dictionary = new Dictionary<TK, LLEntry>();
private readonly LinkedList<TV> list = new LinkedList<TV>();
/// <summary>
/// Get The count.
/// </summary>
/// <returns></returns>
public int Count
{
get { return list.Count; }
}
/// <summary>
/// Is the key in the dictionary?
/// </summary>
/// <param name="k">key</param>
/// <returns>true if key is present, false otherwise.</returns>
public bool ContainsKey(TK k)
{
return dictionary.ContainsKey(k);
}
/// <summary>
/// Remove a key/value from the dictionary if present.
/// </summary>
/// <param name="k">key</param>
/// <returns>True if removal worked. False if removal is not possible.</returns>
public bool Remove(TK k)
{
if (!ContainsKey(k))
{
return false;
}
LLEntry entry = dictionary[k];
list.Remove(entry.vNode);
return dictionary.Remove(k);
}
/// <summary>
/// Add an item. Replacement is allowed.
/// </summary>
/// <param name="k">key</param>
/// <param name="v">value</param>
public void Add(TK k, TV v)
{
Remove(k);
dictionary[k] = new LLEntry(v, list.AddLast(v));
}
/// <summary>
/// Retrieve an element by key.
/// </summary>
/// <param name="k">key</param>
/// <returns>Value. If element is not present, default(V) will be returned.</returns>
public TV GetValue(TK k)
{
if (ContainsKey(k))
{
return dictionary[k].v;
}
return default(TV);
}
public TV this[TK k]
{
get { return GetValue(k); }
set { Add(k, value); }
}
/// <summary>
/// Raw list of Values for garbage-free iteration. Do not modify.
/// </summary>
/// <value>The values</value>
public LinkedList<TV> Values
{
get
{
return list;
}
}
private struct LLEntry
{
public readonly TV v;
public readonly LinkedListNode<TV> vNode;
public LLEntry(TV v, LinkedListNode<TV> vNode)
{
this.v = v;
this.vNode = vNode;
}
}
}
| mit | C# |
2f1c36867ab46fc635cfbe6516246b1be51dcf29 | Fix encoding | InfinniPlatform/InfinniPlatform,InfinniPlatform/InfinniPlatform,InfinniPlatform/InfinniPlatform | InfinniPlatform.Agent/Tasks/InfinniNode/UninstallAppTask.cs | InfinniPlatform.Agent/Tasks/InfinniNode/UninstallAppTask.cs | using System.Net.Http;
using System.Threading.Tasks;
using InfinniPlatform.Agent.Helpers;
using InfinniPlatform.Sdk.Http.Services;
namespace InfinniPlatform.Agent.Tasks.InfinniNode
{
public class UninstallAppTask : IAppTask
{
private const int ProcessTimeout = 10 * 60 * 1000;
public UninstallAppTask(InfinniNodeAdapter infinniNodeAdapter)
{
_infinniNodeAdapter = infinniNodeAdapter;
}
private readonly InfinniNodeAdapter _infinniNodeAdapter;
public HttpMethod HttpMethod => HttpMethod.Post;
public string CommandName => "uninstall";
public async Task<object> Run(IHttpRequest request)
{
var command = CommandName.AppendArg("i", (string)request.Form.AppName)
.AppendArg("v", (string)request.Form.Version)
.AppendArg("n", (string)request.Form.Instance);
return await _infinniNodeAdapter.ExecuteCommand(command, ProcessTimeout);
}
}
} | using System.Net.Http;
using System.Threading.Tasks;
using InfinniPlatform.Agent.Helpers;
using InfinniPlatform.Sdk.Http.Services;
namespace InfinniPlatform.Agent.Tasks.InfinniNode
{
public class UninstallAppTask : IAppTask
{
private const int ProcessTimeout = 10 * 60 * 1000;
public UninstallAppTask(InfinniNodeAdapter infinniNodeAdapter)
{
_infinniNodeAdapter = infinniNodeAdapter;
}
private readonly InfinniNodeAdapter _infinniNodeAdapter;
public HttpMethod HttpMethod => HttpMethod.Post;
public string CommandName => "uninstall";
public async Task<object> Run(IHttpRequest request)
{
var command = CommandName.AppendArg("i", (string)request.Form.AppName)
.AppendArg("v", (string)request.Form.Version)
.AppendArg("n", (string)request.Form.Instance);
return await _infinniNodeAdapter.ExecuteCommand(command, ProcessTimeout);
}
}
} | agpl-3.0 | C# |
412d09e8fd4ca0201071fbb1cbb9bcf60fe85e09 | Allow the assemblies to be passed in on the cmd line | modernist/APIComparer,modernist/APIComparer,ParticularLabs/APIComparer,ParticularLabs/APIComparer | APIComparer/Program.cs | APIComparer/Program.cs | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using APIComparer;
using NuGet;
class Program
{
static void Main(string[] args)
{
//var nugetCacheDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NuGet", "Cache");
//var repo = new AggregateRepository(new[]
//{
// PackageRepositoryFactory.Default.CreateRepository(nugetCacheDirectory),
// PackageRepositoryFactory.Default.CreateRepository("https://www.nuget.org/api/v2"),
// PackageRepositoryFactory.Default.CreateRepository("https://www.myget.org/F/particular/"),
//});
//var packageManager = new PackageManager(repo, "packages");
//var newVersion = "5.0.0";
//packageManager.InstallPackage("NServiceBus", SemanticVersion.Parse(newVersion));
//packageManager.InstallPackage("NServiceBus.Host", SemanticVersion.Parse(newVersion));
//packageManager.InstallPackage("NServiceBus.Interfaces", SemanticVersion.Parse("4.6.7"));
//packageManager.InstallPackage("NServiceBus", SemanticVersion.Parse("4.6.7"));
//packageManager.InstallPackage("NServiceBus.Host", SemanticVersion.Parse("4.6.7"));
var sourceIndex = Array.FindIndex(args, arg => arg == "--source");
if (sourceIndex < 0)
{
throw new Exception("No target assemblies specified, please use --source {asm1};{asm2}...");
}
var leftAssemblyGroup = args[sourceIndex + 1].Split(';').Select(Path.GetFullPath).ToList();
var targetIndex = Array.FindIndex(args,arg => arg == "--target");
if (targetIndex < 0)
{
throw new Exception("No target assemblies specified, please use --target {asm1};{asm2}...");
}
var rightAssemblyGroup = args[targetIndex + 1].Split(';').Select(Path.GetFullPath).ToList();
var engine = new ComparerEngine();
var diff = engine.CreateDiff(leftAssemblyGroup, rightAssemblyGroup);
var stringBuilder = new StringBuilder();
var formatter = new APIUpgradeToMarkdownFormatter(stringBuilder, "https://github.com/Particular/NServiceBus/blob/5.2.0/", "https://github.com/Particular/NServiceBus/blob/extending_pipeline_to_transport/");
formatter.WriteOut(diff);
File.WriteAllText("Result.md", stringBuilder.ToString());
}
} | using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using APIComparer;
using NuGet;
class Program
{
static void Main()
{
var nugetCacheDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NuGet", "Cache");
var repo = new AggregateRepository(new[]
{
PackageRepositoryFactory.Default.CreateRepository(nugetCacheDirectory),
PackageRepositoryFactory.Default.CreateRepository("https://www.nuget.org/api/v2"),
PackageRepositoryFactory.Default.CreateRepository("https://www.myget.org/F/particular/"),
});
var packageManager = new PackageManager(repo, "packages");
var newVersion = "5.0.0";
packageManager.InstallPackage("NServiceBus", SemanticVersion.Parse(newVersion));
packageManager.InstallPackage("NServiceBus.Host", SemanticVersion.Parse(newVersion));
packageManager.InstallPackage("NServiceBus.Interfaces", SemanticVersion.Parse("4.6.7"));
packageManager.InstallPackage("NServiceBus", SemanticVersion.Parse("4.6.7"));
packageManager.InstallPackage("NServiceBus.Host", SemanticVersion.Parse("4.6.7"));
var leftAssemblyGroup = new List<string>
{
Path.Combine("packages", "NServiceBus.4.6.7", "lib", "net40", "NServiceBus.Core.dll"),
Path.Combine("packages", "NServiceBus.Interfaces.4.6.7", "lib", "net40", "NServiceBus.dll"),
Path.Combine("packages", "NServiceBus.Host.4.6.7", "lib", "net40", "NServiceBus.Host.exe")
};
var rightAssemblyGroup = new List<string>
{
Path.Combine("packages", "NServiceBus." + newVersion, "lib", "net45", "NServiceBus.Core.dll"),
Path.Combine("packages", "NServiceBus.Host." + newVersion, "lib", "net45", "NServiceBus.Host.exe"),
};
var engine = new ComparerEngine();
var diff = engine.CreateDiff(leftAssemblyGroup, rightAssemblyGroup);
var stringBuilder = new StringBuilder();
var formatter = new APIUpgradeToMarkdownFormatter(stringBuilder, "https://github.com/Particular/NServiceBus/blob/4.6.7/", "https://github.com/Particular/NServiceBus/blob/master/");
formatter.WriteOut(diff);
File.WriteAllText("Result.md", stringBuilder.ToString());
}
} | mit | C# |
ec7fbe6d581536bd5f844ff99bf0b9f4bbd438a0 | Fix the microwave not turning off | Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,krille90/unitystation,fomalsd/unitystation,krille90/unitystation,fomalsd/unitystation,Necromunger/unitystation,Necromunger/unitystation,Necromunger/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,Necromunger/unitystation | UnityProject/Assets/Scripts/Machines/Microwave.cs | UnityProject/Assets/Scripts/Machines/Microwave.cs | using UnityEngine;
using Mirror;
/// <summary>
/// A machine into which players can insert certain food items.
/// After some time the food is cooked and gets ejected from the microwave.
/// </summary>
public class Microwave : NetworkBehaviour
{
/// <summary>
/// Time it takes for the microwave to cook a meal (in seconds).
/// </summary>
[Range(0, 60)]
public float COOK_TIME = 10;
/// <summary>
/// Time left until the meal has finished cooking (in seconds).
/// I don't see the need to make it a SyncVar. It will economize network packets.
/// </summary>
[HideInInspector]
public float MicrowaveTimer = 0;
/// <summary>
/// Meal currently being cooked.
/// </summary>
[HideInInspector]
public string meal;
// Sprites for when the microwave is on or off.
public Sprite SPRITE_ON;
private Sprite SPRITE_OFF;
private SpriteRenderer spriteRenderer;
/// <summary>
/// AudioSource for playing the celebratory "ding" when cooking is finished.
/// </summary>
private AudioSource audioSourceDing;
/// <summary>
/// Amount of time the "ding" audio source will start playing before the microwave has finished cooking (in seconds).
/// </summary>
private static float dingPlayTime = 1.54f;
/// <summary>
/// True if the microwave has already played the "ding" sound for the current meal.
/// </summary>
private bool dingHasPlayed = false;
/// <summary>
/// Set up the microwave sprite and the AudioSource.
/// </summary>
private void Start()
{
spriteRenderer = GetComponentInChildren<SpriteRenderer>();
audioSourceDing = GetComponent<AudioSource>();
SPRITE_OFF = spriteRenderer.sprite;
}
/// <summary>
/// Count remaining time to microwave previously inserted food.
/// </summary>
private void Update()
{
if (MicrowaveTimer > 0)
{
MicrowaveTimer = Mathf.Max(0, MicrowaveTimer - Time.deltaTime);
if (!dingHasPlayed && MicrowaveTimer <= dingPlayTime)
{
audioSourceDing.Play();
dingHasPlayed = true;
}
if (MicrowaveTimer <= 0)
{
FinishCooking();
}
}
}
public void ServerSetOutputMeal(string mealName)
{
meal = mealName;
}
/// <summary>
/// Starts the microwave, cooking the food for {MicrowaveTimer} seconds.
/// </summary>
[ClientRpc]
public void RpcStartCooking()
{
MicrowaveTimer = COOK_TIME;
spriteRenderer.sprite = SPRITE_ON;
dingHasPlayed = false;
}
/// <summary>
/// Finish cooking the microwaved meal.
/// </summary>
private void FinishCooking()
{
spriteRenderer.sprite = SPRITE_OFF;
if (isServer)
{
GameObject mealPrefab = CraftingManager.Meals.FindOutputMeal(meal);
Spawn.ServerPrefab(mealPrefab, GetComponent<RegisterTile>().WorldPosition, transform.parent);
}
meal = null;
}
} | using UnityEngine;
using Mirror;
/// <summary>
/// A machine into which players can insert certain food items.
/// After some time the food is cooked and gets ejected from the microwave.
/// </summary>
public class Microwave : NetworkBehaviour
{
/// <summary>
/// Time it takes for the microwave to cook a meal (in seconds).
/// </summary>
[Range(0, 60)]
public float COOK_TIME = 10;
/// <summary>
/// Time left until the meal has finished cooking (in seconds).
/// I don't see the need to make it a SyncVar. It will economize network packets.
/// </summary>
[HideInInspector]
public float MicrowaveTimer = 0;
/// <summary>
/// Meal currently being cooked.
/// </summary>
[HideInInspector]
public string meal;
// Sprites for when the microwave is on or off.
public Sprite SPRITE_ON;
private Sprite SPRITE_OFF;
private SpriteRenderer spriteRenderer;
/// <summary>
/// AudioSource for playing the celebratory "ding" when cooking is finished.
/// </summary>
private AudioSource audioSourceDing;
/// <summary>
/// Amount of time the "ding" audio source will start playing before the microwave has finished cooking (in seconds).
/// </summary>
private static float dingPlayTime = 1.54f;
/// <summary>
/// True if the microwave has already played the "ding" sound for the current meal.
/// </summary>
private bool dingHasPlayed = false;
/// <summary>
/// Set up the microwave sprite and the AudioSource.
/// </summary>
private void Start()
{
spriteRenderer = GetComponentInChildren<SpriteRenderer>();
audioSourceDing = GetComponent<AudioSource>();
SPRITE_OFF = spriteRenderer.sprite;
}
/// <summary>
/// Count remaining time to microwave previously inserted food.
/// </summary>
private void Update()
{
if (MicrowaveTimer > 0)
{
MicrowaveTimer = Mathf.Max(0, MicrowaveTimer - Time.deltaTime);
if (!dingHasPlayed && MicrowaveTimer <= dingPlayTime)
{
audioSourceDing.Play();
dingHasPlayed = true;
}
if (MicrowaveTimer <= 0)
{
FinishCooking();
}
}
}
public void ServerSetOutputMeal(string mealName)
{
meal = mealName;
}
/// <summary>
/// Starts the microwave, cooking the food for {MicrowaveTimer} seconds.
/// </summary>
[ClientRpc]
public void RpcStartCooking()
{
spriteRenderer.sprite = SPRITE_ON;
dingHasPlayed = false;
}
/// <summary>
/// Finish cooking the microwaved meal.
/// </summary>
private void FinishCooking()
{
spriteRenderer.sprite = SPRITE_OFF;
if (isServer)
{
GameObject mealPrefab = CraftingManager.Meals.FindOutputMeal(meal);
Spawn.ServerPrefab(mealPrefab, GetComponent<RegisterTile>().WorldPosition, transform.parent);
}
meal = null;
}
} | agpl-3.0 | C# |
7f31bb8a848278523fe95bd1d0422365647e01f8 | Add notification to registry | SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice | src/SFA.DAS.EmployerApprenticeshipsService.Web.AcceptanceTests/DependencyResolution/DefaultRegistry.cs | src/SFA.DAS.EmployerApprenticeshipsService.Web.AcceptanceTests/DependencyResolution/DefaultRegistry.cs | using MediatR;
using Moq;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Data;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Interfaces;
using SFA.DAS.EmployerApprenticeshipsService.Infrastructure.Data;
using SFA.DAS.EmployerApprenticeshipsService.Web.Authentication;
using StructureMap;
using StructureMap.Graph;
namespace SFA.DAS.EmployerApprenticeshipsService.Web.AcceptanceTests.DependencyResolution
{
public class DefaultRegistry : Registry
{
public DefaultRegistry(Mock<IOwinWrapper> owinWrapperMock, Mock<ICookieService> cookieServiceMock)
{
Scan(scan =>
{
scan.AssembliesFromApplicationBaseDirectory(a => a.GetName().Name.StartsWith("SFA.DAS"));
scan.RegisterConcreteTypesAgainstTheFirstInterface();
});
For<IUserRepository>().Use<UserRepository>();
For<IOwinWrapper>().Use(() => owinWrapperMock.Object);
For<ICookieService>().Use(() => cookieServiceMock.Object);
For<IConfiguration>().Use<EmployerApprenticeshipsServiceConfiguration>();
AddMediatrRegistrations();
}
private void AddMediatrRegistrations()
{
For<SingleInstanceFactory>().Use<SingleInstanceFactory>(ctx => t => ctx.GetInstance(t));
For<MultiInstanceFactory>().Use<MultiInstanceFactory>(ctx => t => ctx.GetAllInstances(t));
For<IMediator>().Use<Mediator>();
}
}
}
| using MediatR;
using Moq;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Data;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Interfaces;
using SFA.DAS.EmployerApprenticeshipsService.Infrastructure.Data;
using SFA.DAS.EmployerApprenticeshipsService.Web.Authentication;
using StructureMap;
using StructureMap.Graph;
namespace SFA.DAS.EmployerApprenticeshipsService.Web.AcceptanceTests.DependencyResolution
{
public class DefaultRegistry : Registry
{
public DefaultRegistry(Mock<IOwinWrapper> owinWrapperMock, Mock<ICookieService> cookieServiceMock)
{
Scan(scan =>
{
scan.AssembliesFromApplicationBaseDirectory(a => a.GetName().Name.StartsWith("SFA.DAS.EmployerApprenticeshipsService"));
scan.RegisterConcreteTypesAgainstTheFirstInterface();
});
For<IUserRepository>().Use<UserRepository>();
For<IOwinWrapper>().Use(() => owinWrapperMock.Object);
For<ICookieService>().Use(() => cookieServiceMock.Object);
For<IConfiguration>().Use<EmployerApprenticeshipsServiceConfiguration>();
AddMediatrRegistrations();
}
private void AddMediatrRegistrations()
{
For<SingleInstanceFactory>().Use<SingleInstanceFactory>(ctx => t => ctx.GetInstance(t));
For<MultiInstanceFactory>().Use<MultiInstanceFactory>(ctx => t => ctx.GetAllInstances(t));
For<IMediator>().Use<Mediator>();
}
}
}
| mit | C# |
b591d355d44d4e42220d67b52c82018a0f942297 | remove unhelpful comments in Move | ad510/plausible-deniability | Assets/Scripts/Move.cs | Assets/Scripts/Move.cs | // Copyright (c) 2013-2014 Andrew Downing
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using ProtoBuf;
/// <summary>
/// represents a single movement that starts at a specified location,
/// moves at constant velocity to a specified end location, then stops
/// </summary>
[ProtoContract]
public class Move {
[ProtoMember(1)] public long timeStart;
[ProtoMember(2)] public long timeEnd;
[ProtoMember(3)] public FP.Vector vecStart; // if rotation is later implemented, can store it in z value
[ProtoMember(4)] public FP.Vector vecEnd;
private Move() { } // for protobuf-net use only
public Move(long timeStartVal, long timeEndVal, FP.Vector vecStartVal, FP.Vector vecEndVal) {
timeStart = timeStartVal;
timeEnd = timeEndVal;
vecStart = vecStartVal;
vecEnd = vecEndVal;
}
public Move(long timeVal, FP.Vector vecVal)
: this(timeVal, timeVal + 1, vecVal, vecVal) {
}
/// <summary>
/// alternate method to create Move object that asks for speed (in position units per millisecond) instead of end time
/// </summary>
public static Move fromSpeed(long timeStartVal, long speed, FP.Vector vecStartVal, FP.Vector vecEndVal) {
return new Move(timeStartVal, timeStartVal + (vecEndVal - vecStartVal).length() / speed, vecStartVal, vecEndVal);
}
public FP.Vector posWhen(long time) {
if (time >= timeEnd) return vecEnd;
return vecStart + (vecEnd - vecStart) * FP.div(time - timeStart, timeEnd - timeStart);
}
/// <summary>
/// returns time when position is at specified x value (inaccurate when x isn't between vecStart.x and vecEnd.x)
/// </summary>
public long timeAtX(long x) {
return FP.lineCalcX(new FP.Vector(timeStart, vecStart.x), new FP.Vector(timeEnd, vecEnd.x), x);
}
/// <summary>
/// returns time when position is at specified y value (inaccurate when y isn't between vecStart.y and vecEnd.y)
/// </summary>
public long timeAtY(long y) {
return FP.lineCalcX(new FP.Vector(timeStart, vecStart.y), new FP.Vector(timeEnd, vecEnd.y), y);
}
}
| // Copyright (c) 2013-2014 Andrew Downing
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using ProtoBuf;
/// <summary>
/// represents a single movement that starts at a specified location,
/// moves at constant velocity to a specified end location, then stops
/// </summary>
[ProtoContract]
public class Move {
[ProtoMember(1)] public long timeStart; // time when starts moving
[ProtoMember(2)] public long timeEnd; // time when finishes moving
[ProtoMember(3)] public FP.Vector vecStart; // location at timeStart (if rotation is implemented, can store it in z value)
[ProtoMember(4)] public FP.Vector vecEnd; // location at timeEnd
private Move() { } // for protobuf-net use only
public Move(long timeStartVal, long timeEndVal, FP.Vector vecStartVal, FP.Vector vecEndVal) {
timeStart = timeStartVal;
timeEnd = timeEndVal;
vecStart = vecStartVal;
vecEnd = vecEndVal;
}
public Move(long timeVal, FP.Vector vecVal)
: this(timeVal, timeVal + 1, vecVal, vecVal) {
}
/// <summary>
/// alternate method to create Move object that asks for speed (in position units per millisecond) instead of end time
/// </summary>
public static Move fromSpeed(long timeStartVal, long speed, FP.Vector vecStartVal, FP.Vector vecEndVal) {
return new Move(timeStartVal, timeStartVal + (vecEndVal - vecStartVal).length() / speed, vecStartVal, vecEndVal);
}
public FP.Vector posWhen(long time) {
if (time >= timeEnd) return vecEnd;
return vecStart + (vecEnd - vecStart) * FP.div(time - timeStart, timeEnd - timeStart);
}
/// <summary>
/// returns time when position is at specified x value (inaccurate when x isn't between vecStart.x and vecEnd.x)
/// </summary>
public long timeAtX(long x) {
return FP.lineCalcX(new FP.Vector(timeStart, vecStart.x), new FP.Vector(timeEnd, vecEnd.x), x);
}
/// <summary>
/// returns time when position is at specified y value (inaccurate when y isn't between vecStart.y and vecEnd.y)
/// </summary>
public long timeAtY(long y) {
return FP.lineCalcX(new FP.Vector(timeStart, vecStart.y), new FP.Vector(timeEnd, vecEnd.y), y);
}
}
| mit | C# |
805f5111de2640d917467d3ff2ded4809a5b3030 | Remove DisplayName from Connection as it exists on ConnectionBase (#577) | auth0/auth0.net,auth0/auth0.net | src/Auth0.ManagementApi/Models/Connection.cs | src/Auth0.ManagementApi/Models/Connection.cs | using Newtonsoft.Json;
namespace Auth0.ManagementApi.Models
{
/// <summary>
/// Connection object as returned from API calls.
/// </summary>
public class Connection : ConnectionBase
{
/// <summary>
/// The connection's identifier.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// Whether the connection is domain level (true), or not (false).
/// </summary>
[JsonProperty("is_domain_connection")]
public bool IsDomainConnection { get; set; }
/// <summary>
/// The identity provider identifier for the connection.
/// </summary>
[JsonProperty("strategy")]
public string Strategy { get; set; }
/// <summary>
/// The provisioning ticket URL for AD / LDAP connections
/// </summary>
[JsonProperty("provisioning_ticket_url")]
public string ProvisioningTicketUrl { get; set; }
}
}
| using Newtonsoft.Json;
namespace Auth0.ManagementApi.Models
{
/// <summary>
/// Connection object as returned from API calls.
/// </summary>
public class Connection : ConnectionBase
{
/// <summary>
/// The connection's identifier.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// Connection name used in login screen for Enterprise Connections.
/// </summary>
[JsonProperty("display_name")]
public string DisplayName { get; set; }
/// <summary>
/// Whether the connection is domain level (true), or not (false).
/// </summary>
[JsonProperty("is_domain_connection")]
public bool IsDomainConnection { get; set; }
/// <summary>
/// The identity provider identifier for the connection.
/// </summary>
[JsonProperty("strategy")]
public string Strategy { get; set; }
/// <summary>
/// The provisioning ticket URL for AD / LDAP connections
/// </summary>
[JsonProperty("provisioning_ticket_url")]
public string ProvisioningTicketUrl { get; set; }
}
} | mit | C# |
970fbc17274f25bbfb88fa32bcec73b91ce637ca | Add method to convert byte array to hex string | Figglewatts/LSDStay | LSDStay/Memory.cs | LSDStay/Memory.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace LSDStay
{
public static class Memory
{
[Flags]
public static enum ProcessAccessFlags : uint
{
All = 0x001F0FFF,
Terminate = 0x00000001,
CreateThread = 0x00000002,
VMOperation = 0x00000008,
VMRead = 0x00000010,
VMWrite = 0x00000020,
DupHandle = 0x00000040,
SetInformation = 0x00000200,
QueryInformation = 0x00000400,
Synchronize = 0x00100000
}
public static readonly int PSXGameOffset = 0x171A5C;
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle,
int dwProcessId);
[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress,
byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress,
byte[] lpBuffer, uint dwSize, out int lpNumberOfBytesWritten);
[DllImport("kernel32.dll")]
public static extern Int32 CloseHandle(IntPtr hProcess);
public static bool WriteMemory(Process p, IntPtr address, long v)
{
var hProc = OpenProcess((uint)ProcessAccessFlags.All, false, (int)p.Id);
var val = new byte[] { (byte)v };
int wtf = 0;
bool returnVal = WriteProcessMemory(hProc, address, val, (UInt32)val.LongLength, out wtf);
CloseHandle(hProc);
return returnVal;
}
public static string FormatToHexString(byte[] data)
{
string toReturn = "";
for (int i = 0; i < data.Length; i++)
{
toReturn += string.Format("{0:x2}", data[i]);
}
return toReturn;
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace LSDStay
{
public static class Memory
{
[Flags]
public static enum ProcessAccessFlags : uint
{
All = 0x001F0FFF,
Terminate = 0x00000001,
CreateThread = 0x00000002,
VMOperation = 0x00000008,
VMRead = 0x00000010,
VMWrite = 0x00000020,
DupHandle = 0x00000040,
SetInformation = 0x00000200,
QueryInformation = 0x00000400,
Synchronize = 0x00100000
}
public static readonly int PSXGameOffset = 0x171A5C;
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle,
int dwProcessId);
[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress,
byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress,
byte[] lpBuffer, uint dwSize, out int lpNumberOfBytesWritten);
[DllImport("kernel32.dll")]
public static extern Int32 CloseHandle(IntPtr hProcess);
public static bool WriteMemory(Process p, IntPtr address, long v)
{
var hProc = OpenProcess((uint)ProcessAccessFlags.All, false, (int)p.Id);
var val = new byte[] { (byte)v };
int wtf = 0;
bool returnVal = WriteProcessMemory(hProc, address, val, (UInt32)val.LongLength, out wtf);
CloseHandle(hProc);
return returnVal;
}
}
}
| mit | C# |
74706f72e6450befc842511bdc0077b100180ac9 | Add 12-hour display setting (TODO add toggle) | NeoAdonis/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu,peppy/osu,ppy/osu | osu.Game/Overlays/Toolbar/DigitalClockDisplay.cs | osu.Game/Overlays/Toolbar/DigitalClockDisplay.cs | // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Toolbar
{
public class DigitalClockDisplay : ClockDisplay
{
private OsuSpriteText realTime;
private OsuSpriteText gameTime;
private bool showRuntime = true;
public bool ShowRuntime
{
get => showRuntime;
set
{
if (showRuntime == value)
return;
showRuntime = value;
updateMetrics();
}
}
private bool format12H = true;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AutoSizeAxes = Axes.Y;
InternalChildren = new Drawable[]
{
realTime = new OsuSpriteText(),
gameTime = new OsuSpriteText
{
Y = 14,
Colour = colours.PinkLight,
Font = OsuFont.Default.With(size: 10, weight: FontWeight.SemiBold),
}
};
updateMetrics();
}
protected override void UpdateDisplay(DateTimeOffset now)
{
realTime.Text = format12H ? $"{now:hh:mm:ss tt}" : $"{now:HH:mm:ss}";
gameTime.Text = $"running {new TimeSpan(TimeSpan.TicksPerSecond * (int)(Clock.CurrentTime / 1000)):c}";
}
private void updateMetrics()
{
if (format12H)
Width = 74;
else
Width = showRuntime ? 66 : 45; // Allows for space for game time up to 99 days (in the padding area since this is quite rare).
gameTime.FadeTo(showRuntime ? 1 : 0);
}
}
}
| // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Toolbar
{
public class DigitalClockDisplay : ClockDisplay
{
private OsuSpriteText realTime;
private OsuSpriteText gameTime;
private bool showRuntime = true;
public bool ShowRuntime
{
get => showRuntime;
set
{
if (showRuntime == value)
return;
showRuntime = value;
updateMetrics();
}
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AutoSizeAxes = Axes.Y;
InternalChildren = new Drawable[]
{
realTime = new OsuSpriteText(),
gameTime = new OsuSpriteText
{
Y = 14,
Colour = colours.PinkLight,
Font = OsuFont.Default.With(size: 10, weight: FontWeight.SemiBold),
}
};
updateMetrics();
}
protected override void UpdateDisplay(DateTimeOffset now)
{
realTime.Text = $"{now:HH:mm:ss}";
gameTime.Text = $"running {new TimeSpan(TimeSpan.TicksPerSecond * (int)(Clock.CurrentTime / 1000)):c}";
}
private void updateMetrics()
{
Width = showRuntime ? 66 : 45; // Allows for space for game time up to 99 days (in the padding area since this is quite rare).
gameTime.FadeTo(showRuntime ? 1 : 0);
}
}
}
| mit | C# |
d6f23d357bacb84d659371e9df0b9edeb8e11c3e | check hook | andyasne/JenkinsTester_App | JenkinsTesterApp/JenkinsTesterApp/Program.cs | JenkinsTesterApp/JenkinsTesterApp/Program.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JenkinsTesterApp
{
class Program
{
static void Main(string[] args)
{
System.Console.Out.Write("This is a test app.Development Branch:Hook checking!");
var intest = System.Console.In.ReadLine();
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JenkinsTesterApp
{
class Program
{
static void Main(string[] args)
{
System.Console.Out.Write("This is a test app.Development Branch:Hook checking");
var intest = System.Console.In.ReadLine();
}
}
}
| unlicense | C# |
3fac12ea16cc54df748f9d8a8b7e236ae834a17c | Return BackgroundColor from item | KryptPad/KryptPadWebsite,KryptPad/KryptPadWebsite,KryptPad/KryptPadWebsite | KryptPadWebApp/Models/Results/ItemsResult.cs | KryptPadWebApp/Models/Results/ItemsResult.cs | using KryptPadWebApp.Cryptography;
using KryptPadWebApp.Models.ApiEntities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KryptPadWebApp.Models.Results
{
public class ItemsResult
{
public ApiItem[] Items { get; protected set; }
public ItemsResult() { }
public ItemsResult(Item[] items, string passphrase) {
Items = (from i in items
select new ApiItem()
{
Id = i.Id,
CategoryId = i.Category.Id,
BackgroundColor = i.BackgroundColor,
Name = Encryption.DecryptFromString(i.Name, passphrase),
Notes = Encryption.DecryptFromString(i.Notes, passphrase),
Fields = (from f in i.Fields
select new ApiField() {
Id = f.Id,
FieldType=f.FieldType,
Name = Encryption.DecryptFromString(f.Name, passphrase),
Value = Encryption.DecryptFromString(f.Value, passphrase)
}).ToArray()
}).ToArray();
}
}
} | using KryptPadWebApp.Cryptography;
using KryptPadWebApp.Models.ApiEntities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KryptPadWebApp.Models.Results
{
public class ItemsResult
{
public ApiItem[] Items { get; protected set; }
public ItemsResult() { }
public ItemsResult(Item[] items, string passphrase) {
Items = (from i in items
select new ApiItem()
{
Id = i.Id,
CategoryId = i.Category.Id,
Name = Encryption.DecryptFromString(i.Name, passphrase),
Notes = Encryption.DecryptFromString(i.Notes, passphrase),
Fields = (from f in i.Fields
select new ApiField() {
Id = f.Id,
FieldType=f.FieldType,
Name = Encryption.DecryptFromString(f.Name, passphrase),
Value = Encryption.DecryptFromString(f.Value, passphrase)
}).ToArray()
}).ToArray();
}
}
} | mit | C# |
a625804e252eb400154bd207b133279838ef7753 | Package Update #CHANGE: Pushed AdamsLair.WinForms 1.0.5 | AdamsLair/winforms,windygu/winforms | WinForms/Properties/AssemblyInfo.cs | WinForms/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("AdamsLair.WinForms")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdamsLair.WinForms")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("735ee5dc-8c18-4a06-8e64-2f172ddd01cc")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5")]
| using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("AdamsLair.WinForms")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdamsLair.WinForms")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("735ee5dc-8c18-4a06-8e64-2f172ddd01cc")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4")]
| mit | C# |
595ec4de1916f102cba1f65f0c5956548a3660e5 | Package Update #CHANGE: Pushed AdamsLair.WinForms 1.1.10 | AdamsLair/winforms | WinForms/Properties/AssemblyInfo.cs | WinForms/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("AdamsLair.WinForms")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdamsLair.WinForms")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("735ee5dc-8c18-4a06-8e64-2f172ddd01cc")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.10")]
| using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("AdamsLair.WinForms")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdamsLair.WinForms")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("735ee5dc-8c18-4a06-8e64-2f172ddd01cc")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.9")]
| mit | C# |
69c1dd61d2143bc4697c7da94b6b98ffd948427e | Use updated TagHelper on home page | peterblazejewicz/asp5-mvc6-examples,peterblazejewicz/asp5-mvc6-examples,peterblazejewicz/asp5-mvc6-examples,peterblazejewicz/asp5-mvc6-examples | ProgressBarComponent/Views/Home/Index.cshtml | ProgressBarComponent/Views/Home/Index.cshtml | @{
ViewData["Title"] = "Home Page";
}
<div class="row">
<div class="col-xs-6 col-md-4">
<div href="#" class="thumbnail">
<h3>Progress Bar Default</h3>
<p>
<code>progress-bar</code>
</p>
<div bs-progress-min="1"
bs-progress-max="100"
bs-progress-value="45">
</div>
<pre class="pre-scrollable">
<div bs-progress-min="1"
bs-progress-max="100"
bs-progress-value="45">
</div></pre>
</div>
</div>
<div class="col-xs-6 col-md-4">
<div href="#" class="thumbnail">
<h3>Progress Bar Animated</h3>
<p>
<code>progress-bar progress-bar-success progress-bar-striped active</code>
</p>
<div bs-progress-style="success"
bs-progress-min="1"
bs-progress-max="5"
bs-progress-value="4"
bs-progress-active="true">
</div>
<pre class="pre-scrollable">
<div bs-progress-style="success"
bs-progress-min="1"
bs-progress-max="5"
bs-progress-value="4"
bs-progress-active="true">
</div></pre>
</div>
</div>
<div class="col-xs-6 col-md-4">
<div href="#" class="thumbnail">
<h3>Progress Bar Striped</h3>
<p>
<code>progress-bar progress-bar-danger progress-bar-striped</code>
</p>
<div bs-progress-min="1"
bs-progress-max="100"
bs-progress-value="80"
bs-progress-style="danger"
bs-progress-striped="true"
bs-progress-label-visible="false">
</div>
<pre class="pre-scrollable">
<div bs-progress-min="1"
bs-progress-max="100"
bs-progress-value="80"
bs-progress-style="danger"
bs-progress-striped="true"
bs-progress-label-visible="false">
</div></pre>
</div>
</div>
</div>
| @{
ViewData["Title"] = "Home Page";
}
.<div class="row">
<div class="col-xs-12">
<div bs-progress-min="1"
bs-progress-max="5"
bs-progress-value="4">
</div>
</div>
</div>
| mit | C# |
14b58386e58559a8add1686840d5e80be44a5f14 | fix tour backdropOpacity | lars-erik/Umbraco-CMS,mattbrailsford/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,arknu/Umbraco-CMS,WebCentrum/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,hfloyd/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,bjarnef/Umbraco-CMS,hfloyd/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,aaronpowell/Umbraco-CMS,bjarnef/Umbraco-CMS,madsoulswe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,WebCentrum/Umbraco-CMS,umbraco/Umbraco-CMS,tcmorris/Umbraco-CMS,arknu/Umbraco-CMS,rasmuseeg/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,aaronpowell/Umbraco-CMS,NikRimington/Umbraco-CMS,lars-erik/Umbraco-CMS,abryukhov/Umbraco-CMS,mattbrailsford/Umbraco-CMS,NikRimington/Umbraco-CMS,rasmuseeg/Umbraco-CMS,leekelleher/Umbraco-CMS,robertjf/Umbraco-CMS,lars-erik/Umbraco-CMS,leekelleher/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,tompipe/Umbraco-CMS,bjarnef/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,WebCentrum/Umbraco-CMS,aadfPT/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,base33/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,madsoulswe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,tompipe/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,umbraco/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,base33/Umbraco-CMS,umbraco/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,base33/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,tompipe/Umbraco-CMS,tcmorris/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,arknu/Umbraco-CMS,aadfPT/Umbraco-CMS,marcemarc/Umbraco-CMS,hfloyd/Umbraco-CMS,marcemarc/Umbraco-CMS,aadfPT/Umbraco-CMS,tcmorris/Umbraco-CMS,aaronpowell/Umbraco-CMS,lars-erik/Umbraco-CMS,abryukhov/Umbraco-CMS,rasmuseeg/Umbraco-CMS,KevinJump/Umbraco-CMS,lars-erik/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS | src/Umbraco.Web/Models/BackOfficeTourStep.cs | src/Umbraco.Web/Models/BackOfficeTourStep.cs | using System.Runtime.Serialization;
namespace Umbraco.Web.Models
{
/// <summary>
/// A model representing a step in a tour.
/// </summary>
[DataContract(Name = "step", Namespace = "")]
public class BackOfficeTourStep
{
[DataMember(Name = "title")]
public string Title { get; set; }
[DataMember(Name = "content")]
public string Content { get; set; }
[DataMember(Name = "type")]
public string Type { get; set; }
[DataMember(Name = "element")]
public string Element { get; set; }
[DataMember(Name = "elementPreventClick")]
public bool ElementPreventClick { get; set; }
[DataMember(Name = "backdropOpacity")]
public float? BackdropOpacity { get; set; }
[DataMember(Name = "event")]
public string Event { get; set; }
}
} | using System.Runtime.Serialization;
namespace Umbraco.Web.Models
{
/// <summary>
/// A model representing a step in a tour.
/// </summary>
[DataContract(Name = "step", Namespace = "")]
public class BackOfficeTourStep
{
[DataMember(Name = "title")]
public string Title { get; set; }
[DataMember(Name = "content")]
public string Content { get; set; }
[DataMember(Name = "type")]
public string Type { get; set; }
[DataMember(Name = "element")]
public string Element { get; set; }
[DataMember(Name = "elementPreventClick")]
public bool ElementPreventClick { get; set; }
[DataMember(Name = "backdropOpacity")]
public float BackdropOpacity { get; set; }
[DataMember(Name = "event")]
public string Event { get; set; }
}
} | mit | C# |
faea1dc1e4dce61070f4543735d9c4877712d995 | Add comment. | diryboy/roslyn,jasonmalinowski/roslyn,tannergooding/roslyn,jasonmalinowski/roslyn,AlekseyTs/roslyn,tannergooding/roslyn,stephentoub/roslyn,sharwell/roslyn,brettfo/roslyn,heejaechang/roslyn,AlekseyTs/roslyn,weltkante/roslyn,reaction1989/roslyn,nguerrera/roslyn,gafter/roslyn,KevinRansom/roslyn,genlu/roslyn,AlekseyTs/roslyn,stephentoub/roslyn,davkean/roslyn,jmarolf/roslyn,wvdd007/roslyn,eriawan/roslyn,shyamnamboodiripad/roslyn,davkean/roslyn,genlu/roslyn,aelij/roslyn,AmadeusW/roslyn,agocke/roslyn,AmadeusW/roslyn,sharwell/roslyn,agocke/roslyn,davkean/roslyn,eriawan/roslyn,AmadeusW/roslyn,physhi/roslyn,KirillOsenkov/roslyn,abock/roslyn,KirillOsenkov/roslyn,mgoertz-msft/roslyn,dotnet/roslyn,mavasani/roslyn,dotnet/roslyn,KirillOsenkov/roslyn,CyrusNajmabadi/roslyn,physhi/roslyn,dotnet/roslyn,panopticoncentral/roslyn,bartdesmet/roslyn,bartdesmet/roslyn,mavasani/roslyn,shyamnamboodiripad/roslyn,mavasani/roslyn,panopticoncentral/roslyn,tannergooding/roslyn,wvdd007/roslyn,diryboy/roslyn,KevinRansom/roslyn,weltkante/roslyn,ErikSchierboom/roslyn,shyamnamboodiripad/roslyn,jmarolf/roslyn,brettfo/roslyn,tmat/roslyn,diryboy/roslyn,eriawan/roslyn,heejaechang/roslyn,heejaechang/roslyn,abock/roslyn,genlu/roslyn,physhi/roslyn,mgoertz-msft/roslyn,gafter/roslyn,reaction1989/roslyn,sharwell/roslyn,nguerrera/roslyn,aelij/roslyn,mgoertz-msft/roslyn,jasonmalinowski/roslyn,weltkante/roslyn,abock/roslyn,wvdd007/roslyn,nguerrera/roslyn,ErikSchierboom/roslyn,tmat/roslyn,panopticoncentral/roslyn,ErikSchierboom/roslyn,aelij/roslyn,KevinRansom/roslyn,tmat/roslyn,reaction1989/roslyn,bartdesmet/roslyn,CyrusNajmabadi/roslyn,jmarolf/roslyn,brettfo/roslyn,agocke/roslyn,stephentoub/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn | src/Features/CSharp/Portable/CodeRefactorings/PullMemberUp/CSharpPullMemberUpCodeRefactoringProvider.cs | src/Features/CSharp/Portable/CodeRefactorings/PullMemberUp/CSharpPullMemberUpCodeRefactoringProvider.cs | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CodeRefactorings.PullMemberUp;
using Microsoft.CodeAnalysis.CodeRefactorings.PullMemberUp.Dialog;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.CodeRefactorings.PullMemberUp
{
[ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = nameof(PredefinedCodeRefactoringProviderNames.PullMemberUp)), Shared]
internal class CSharpPullMemberUpCodeRefactoringProvider : AbstractPullMemberUpRefactoringProvider
{
/// <summary>
/// Test purpose only.
/// </summary>
public CSharpPullMemberUpCodeRefactoringProvider(IPullMemberUpOptionsService service) : base(service)
{
}
[ImportingConstructor]
public CSharpPullMemberUpCodeRefactoringProvider() : base(null)
{
}
protected override async Task<SyntaxNode> GetSelectedNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken)
{
var refactoringHelperService = document.GetLanguageService<IRefactoringHelpersService>();
// Consider MemberDeclaration (types, methods, events, delegates, ...) and VariableDeclarator (pure variables)
var memberDecl = await refactoringHelperService.TryGetSelectedNodeAsync<MemberDeclarationSyntax>(document, span, cancellationToken).ConfigureAwait(false);
if (memberDecl != default)
{
return memberDecl;
}
var varDecl = await refactoringHelperService.TryGetSelectedNodeAsync<VariableDeclaratorSyntax>(document, span, cancellationToken).ConfigureAwait(false);
return varDecl;
}
}
}
| // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CodeRefactorings.PullMemberUp;
using Microsoft.CodeAnalysis.CodeRefactorings.PullMemberUp.Dialog;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.CodeRefactorings.PullMemberUp
{
[ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = nameof(PredefinedCodeRefactoringProviderNames.PullMemberUp)), Shared]
internal class CSharpPullMemberUpCodeRefactoringProvider : AbstractPullMemberUpRefactoringProvider
{
/// <summary>
/// Test purpose only.
/// </summary>
public CSharpPullMemberUpCodeRefactoringProvider(IPullMemberUpOptionsService service) : base(service)
{
}
[ImportingConstructor]
public CSharpPullMemberUpCodeRefactoringProvider() : base(null)
{
}
protected override async Task<SyntaxNode> GetSelectedNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken)
{
var refactoringHelperService = document.GetLanguageService<IRefactoringHelpersService>();
var memberDecl = await refactoringHelperService.TryGetSelectedNodeAsync<MemberDeclarationSyntax>(document, span, cancellationToken).ConfigureAwait(false);
if (memberDecl != default)
{
return memberDecl;
}
var varDecl = await refactoringHelperService.TryGetSelectedNodeAsync<VariableDeclaratorSyntax>(document, span, cancellationToken).ConfigureAwait(false);
return varDecl;
}
}
}
| mit | C# |
77f0b9b78c19a5eaf2dd63218b3f56272106b3b4 | Update status message for last guess | 12joan/hangman | game.cs | game.cs | using System;
using System.Collections.Generic;
using System.Text;
namespace Hangman {
public class Game {
public string Word;
private List<char> GuessedLetters;
private string StatusMessage;
public Game(string word) {
Word = word;
GuessedLetters = new List<char>();
StatusMessage = "Press any letter to guess!";
}
public string ShownWord() {
var obscuredWord = new StringBuilder();
foreach (char letter in Word) {
obscuredWord.Append(ShownLetterFor(letter));
}
return obscuredWord.ToString();
}
public string Status() {
return StatusMessage;
}
public bool GuessLetter(char letter) {
GuessedLetters.Add(letter);
bool correct = LetterIsCorrect(letter);
if (correct) {
StatusMessage = "Correct! Guess again!";
} else {
StatusMessage = "Incorrect! Try again!";
}
// CheckGameOver();
return correct;
}
private char ShownLetterFor(char originalLetter) {
if (LetterWasGuessed(originalLetter) || originalLetter == ' ') {
return originalLetter;
} else {
return '_';
}
}
private bool LetterWasGuessed(char letter) {
return GuessedLetters.Contains(letter);
}
private bool LetterIsCorrect(char letter) {
return Word.Contains(letter.ToString());
}
}
}
| using System;
using System.Collections.Generic;
using System.Text;
namespace Hangman {
public class Game {
public string Word;
private List<char> GuessedLetters;
private string StatusMessage;
public Game(string word) {
Word = word;
GuessedLetters = new List<char>();
StatusMessage = "Press any letter to guess!";
}
public string ShownWord() {
var obscuredWord = new StringBuilder();
foreach (char letter in Word) {
obscuredWord.Append(ShownLetterFor(letter));
}
return obscuredWord.ToString();
}
public string Status() {
return StatusMessage;
}
public bool GuessLetter(char letter) {
GuessedLetters.Add(letter);
return LetterIsCorrect(letter);
}
private char ShownLetterFor(char originalLetter) {
if (LetterWasGuessed(originalLetter) || originalLetter == ' ') {
return originalLetter;
} else {
return '_';
}
}
private bool LetterWasGuessed(char letter) {
return GuessedLetters.Contains(letter);
}
private bool LetterIsCorrect(char letter) {
return Word.Contains(letter.ToString());
}
}
}
| unlicense | C# |
5b44b6efce0556b0c58742696ba0e7bd3e541c3c | Add test for authorization requirement in TraktUserCustomListAddRequest | henrikfroehling/TraktApiSharp | Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserCustomListAddRequestTests.cs | Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserCustomListAddRequestTests.cs | namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Base.Post;
using TraktApiSharp.Experimental.Requests.Users.OAuth;
using TraktApiSharp.Objects.Get.Users.Lists;
using TraktApiSharp.Objects.Post.Users;
using TraktApiSharp.Requests;
[TestClass]
public class TraktUserCustomListAddRequestTests
{
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestIsNotAbstract()
{
typeof(TraktUserCustomListAddRequest).IsAbstract.Should().BeFalse();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestIsSealed()
{
typeof(TraktUserCustomListAddRequest).IsSealed.Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestIsSubclassOfATraktSingleItemPostRequest()
{
typeof(TraktUserCustomListAddRequest).IsSubclassOf(typeof(ATraktSingleItemPostRequest<TraktList, TraktUserCustomListPost>)).Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestHasAuthorizationRequired()
{
var request = new TraktUserCustomListAddRequest(null);
request.AuthorizationRequirement.Should().Be(TraktAuthorizationRequirement.Required);
}
}
}
| namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Base.Post;
using TraktApiSharp.Experimental.Requests.Users.OAuth;
using TraktApiSharp.Objects.Get.Users.Lists;
using TraktApiSharp.Objects.Post.Users;
[TestClass]
public class TraktUserCustomListAddRequestTests
{
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestIsNotAbstract()
{
typeof(TraktUserCustomListAddRequest).IsAbstract.Should().BeFalse();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestIsSealed()
{
typeof(TraktUserCustomListAddRequest).IsSealed.Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserCustomListAddRequestIsSubclassOfATraktSingleItemPostRequest()
{
typeof(TraktUserCustomListAddRequest).IsSubclassOf(typeof(ATraktSingleItemPostRequest<TraktList, TraktUserCustomListPost>)).Should().BeTrue();
}
}
}
| mit | C# |
da864d09dc60a7a4d934015888c23be624ec25d7 | Add support for `Result` and `ResultReason` in `ChargePaymentMethodDetailsCardThreeDSecure` | stripe/stripe-dotnet | src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardThreeDSecure.cs | src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardThreeDSecure.cs | namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity<ChargePaymentMethodDetailsCardThreeDSecure>
{
/// <summary>
/// Whether or not authentication was performed. 3D Secure will succeed without
/// authentication when the card is not enrolled.
/// </summary>
[JsonProperty("authenticated")]
public bool Authenticated { get; set; }
/// <summary>
/// Indicates the outcome of 3D Secure authentication.
/// </summary>
[JsonProperty("result")]
public string Result { get; set; }
/// <summary>
/// Additional information about why 3D Secure succeeded or failed.
/// </summary>
[JsonProperty("result_reason")]
public string ResultReason { get; set; }
/// <summary>
/// Whether or not 3D Secure succeeded.
/// </summary>
[JsonProperty("succeeded")]
public bool Succeeded { get; set; }
/// <summary>
/// The version of 3D Secure that was used for this payment.
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
}
}
| namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity<ChargePaymentMethodDetailsCardThreeDSecure>
{
/// <summary>
/// Whether or not authentication was performed. 3D Secure will succeed without
/// authentication when the card is not enrolled.
/// </summary>
[JsonProperty("authenticated")]
public bool Authenticated { get; set; }
/// <summary>
/// Whether or not 3D Secure succeeded.
/// </summary>
[JsonProperty("succeeded")]
public bool Succeeded { get; set; }
/// <summary>
/// The version of 3D Secure that was used for this payment.
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
}
}
| apache-2.0 | C# |
bff391d7bb3a0b1e95503a31185664d4be7dfafd | Rename CCReusedObject | TukekeSoft/CocosSharp,TukekeSoft/CocosSharp,mono/CocosSharp,netonjm/CocosSharp,mono/CocosSharp,MSylvia/CocosSharp,haithemaraissia/CocosSharp,haithemaraissia/CocosSharp,netonjm/CocosSharp,MSylvia/CocosSharp,mono/cocos2d-xna,hig-ag/CocosSharp,hig-ag/CocosSharp,zmaruo/CocosSharp,mono/cocos2d-xna,zmaruo/CocosSharp | cocos2d/platform/CCReusedObject.cs | cocos2d/platform/CCReusedObject.cs | using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Cocos2D
{
public abstract class CCReusedObject<T> where T : CCReusedObject<T>, new()
{
private bool used;
private static readonly List<CCReusedObject<T>> _unused = new List<CCReusedObject<T>>();
protected CCReusedObject()
{
used = true;
}
public static T Create()
{
var count = _unused.Count;
if (count > 0)
{
var result = _unused[count - 1];
result.used = true;
_unused.RemoveAt(count - 1);
return (T)result;
}
return new T();
}
protected abstract void PrepareForReuse();
public void Free()
{
Debug.Assert(!used, "Already free");
used = false;
PrepareForReuse();
_unused.Add(this);
}
}
}
| using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Cocos2D
{
public abstract class ReusedObject<T> where T : ReusedObject<T>, new()
{
private bool used;
private static readonly List<ReusedObject<T>> _unused = new List<ReusedObject<T>>();
protected ReusedObject()
{
used = true;
}
public static T Create()
{
var count = _unused.Count;
if (count > 0)
{
var result = _unused[count - 1];
result.used = true;
_unused.RemoveAt(count - 1);
return (T)result;
}
return new T();
}
protected abstract void PrepareForReuse();
public void Free()
{
Debug.Assert(!used, "Already free");
used = false;
PrepareForReuse();
_unused.Add(this);
}
}
}
| mit | C# |
757361eaa2630a1daee4217e4d9df85791ae82ef | remove unused code. | nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet | WalletWasabi.Gui/ViewModels/ViewModelBase.cs | WalletWasabi.Gui/ViewModels/ViewModelBase.cs | using ReactiveUI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using WalletWasabi.Gui.Validation;
using WalletWasabi.Models;
namespace WalletWasabi.Gui.ViewModels
{
public class ViewModelBase : ReactiveObject, INotifyDataErrorInfo, IRegisterValidationMethod
{
private Dictionary<string, ErrorDescriptors> _errorsByPropertyName;
private Dictionary<string, ValidateMethod> _validationMethods;
public ViewModelBase()
{
_errorsByPropertyName = new Dictionary<string, ErrorDescriptors>();
_validationMethods = new Dictionary<string, ValidateMethod>();
PropertyChanged += ViewModelBase_PropertyChanged;
}
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;
public bool HasErrors => _errorsByPropertyName.Where(x => x.Value.HasErrors).Any();
void IRegisterValidationMethod.RegisterValidationMethod(string propertyName, ValidateMethod validateMethod)
{
if (string.IsNullOrWhiteSpace(propertyName))
{
throw new ArgumentException("PropertyName must be valid.", nameof(propertyName));
}
_validationMethods[propertyName] = validateMethod;
_errorsByPropertyName[propertyName] = ErrorDescriptors.Create();
}
protected void Validate()
{
foreach (var propertyName in _validationMethods.Keys)
{
DoValidateProperty(propertyName);
}
}
private void ViewModelBase_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (string.IsNullOrWhiteSpace(e.PropertyName))
{
Validate();
}
else
{
DoValidateProperty(e.PropertyName);
}
}
private void DoValidateProperty(string propertyName)
{
if (_validationMethods.ContainsKey(propertyName))
{
ClearErrors(propertyName);
var del = _validationMethods[propertyName];
var method = del as ValidateMethod;
method(_errorsByPropertyName[propertyName]);
OnErrorsChanged(propertyName);
this.RaisePropertyChanged(nameof(HasErrors));
}
}
public IEnumerable GetErrors(string propertyName)
{
return _errorsByPropertyName.ContainsKey(propertyName) && _errorsByPropertyName[propertyName].HasErrors
? _errorsByPropertyName[propertyName]
: ErrorDescriptors.Empty;
}
private void ClearErrors(string propertyName)
{
if (_errorsByPropertyName.ContainsKey(propertyName))
{
_errorsByPropertyName[propertyName].Clear();
OnErrorsChanged(propertyName);
this.RaisePropertyChanged(nameof(HasErrors));
}
}
private void OnErrorsChanged(string propertyName)
{
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
}
}
}
| using ReactiveUI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using WalletWasabi.Gui.Validation;
using WalletWasabi.Models;
namespace WalletWasabi.Gui.ViewModels
{
public class ViewModelBase : ReactiveObject, INotifyDataErrorInfo, IRegisterValidationMethod
{
private Dictionary<string, ErrorDescriptors> _errorsByPropertyName;
private Dictionary<string, ValidateMethod> _validationMethods;
public ViewModelBase()
{
_errorsByPropertyName = new Dictionary<string, ErrorDescriptors>();
_validationMethods = new Dictionary<string, ValidateMethod>();
PropertyChanged += ViewModelBase_PropertyChanged;
}
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;
public bool HasErrors => _errorsByPropertyName.Where(x => x.Value.HasErrors).Any();
private static IEnumerable<MethodInfo> GetValidateMethods(Type type)
{
if (type.BaseType != null)
{
foreach (var method in GetValidateMethods(type.BaseType))
{
yield return method;
}
}
foreach (var method in type.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)
.Where(x => x.Name.StartsWith("Validate")))
{
yield return method;
}
}
void IRegisterValidationMethod.RegisterValidationMethod(string propertyName, ValidateMethod validateMethod)
{
if (string.IsNullOrWhiteSpace(propertyName))
{
throw new ArgumentException("PropertyName must be valid.", nameof(propertyName));
}
_validationMethods[propertyName] = validateMethod;
_errorsByPropertyName[propertyName] = ErrorDescriptors.Create();
}
protected void Validate()
{
foreach (var propertyName in _validationMethods.Keys)
{
DoValidateProperty(propertyName);
}
}
private void ViewModelBase_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (string.IsNullOrWhiteSpace(e.PropertyName))
{
Validate();
}
else
{
DoValidateProperty(e.PropertyName);
}
}
private void DoValidateProperty(string propertyName)
{
if (_validationMethods.ContainsKey(propertyName))
{
ClearErrors(propertyName);
var del = _validationMethods[propertyName];
var method = del as ValidateMethod;
method(_errorsByPropertyName[propertyName]);
OnErrorsChanged(propertyName);
this.RaisePropertyChanged(nameof(HasErrors));
}
}
public IEnumerable GetErrors(string propertyName)
{
return _errorsByPropertyName.ContainsKey(propertyName) && _errorsByPropertyName[propertyName].HasErrors
? _errorsByPropertyName[propertyName]
: ErrorDescriptors.Empty;
}
private void ClearErrors(string propertyName)
{
if (_errorsByPropertyName.ContainsKey(propertyName))
{
_errorsByPropertyName[propertyName].Clear();
OnErrorsChanged(propertyName);
this.RaisePropertyChanged(nameof(HasErrors));
}
}
private void OnErrorsChanged(string propertyName)
{
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
}
}
}
| mit | C# |
f4568659afe75d1b9a05951ee8031634683b4d12 | Bump version to 0.0.6 | Morphan1/Voxalia,Morphan1/Voxalia,Morphan1/Voxalia | Voxalia/MainProgram.cs | Voxalia/MainProgram.cs | using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Voxalia.Shared;
using Voxalia.ServerGame.ServerMainSystem;
using Voxalia.ClientGame.ClientMainSystem;
using System.IO;
using System.Threading;
using System.Globalization;
using Voxalia.Shared.Files;
namespace Voxalia
{
/// <summary>
/// Central program entry point.
/// </summary>
class ManProgram
{
/// <summary>
/// A handle for the console window.
/// </summary>
public static IntPtr ConsoleHandle;
/// <summary>
/// Central program entry point.
/// Decides whether to lauch the server or the client.
/// </summary>
/// <param name="args">The command line arguments.</param>
static void Main(string[] args)
{
Program.GameName = "Voxalia";
Program.GameVersion = "0.0.6";
ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
SysConsole.Init();
StringBuilder arger = new StringBuilder();
for (int i = 0; i < args.Length; i++)
{
arger.Append(args[i]).Append(' ');
}
try
{
Program.Files = new FileHandler();
Program.Files.Init();
Program.Init();
if (args.Length > 0 && args[0] == "server")
{
Server.Init(arger.ToString().Substring("server".Length).Trim());
}
else
{
Client.Init(arger.ToString());
}
}
catch (Exception ex)
{
SysConsole.Output(ex);
File.WriteAllText("GLOBALERR_" + DateTime.Now.ToFileTimeUtc().ToString() + ".txt", ex.ToString() + "\n\n" + Environment.StackTrace);
}
SysConsole.ShutDown();
Console.WriteLine("Final shutdown - terminating process.");
Environment.Exit(0);
}
}
}
| using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Voxalia.Shared;
using Voxalia.ServerGame.ServerMainSystem;
using Voxalia.ClientGame.ClientMainSystem;
using System.IO;
using System.Threading;
using System.Globalization;
using Voxalia.Shared.Files;
namespace Voxalia
{
/// <summary>
/// Central program entry point.
/// </summary>
class ManProgram
{
/// <summary>
/// A handle for the console window.
/// </summary>
public static IntPtr ConsoleHandle;
/// <summary>
/// Central program entry point.
/// Decides whether to lauch the server or the client.
/// </summary>
/// <param name="args">The command line arguments.</param>
static void Main(string[] args)
{
Program.GameName = "Voxalia";
Program.GameVersion = "0.0.5";
ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
SysConsole.Init();
StringBuilder arger = new StringBuilder();
for (int i = 0; i < args.Length; i++)
{
arger.Append(args[i]).Append(' ');
}
try
{
Program.Files = new FileHandler();
Program.Files.Init();
Program.Init();
if (args.Length > 0 && args[0] == "server")
{
Server.Init(arger.ToString().Substring("server".Length).Trim());
}
else
{
Client.Init(arger.ToString());
}
}
catch (Exception ex)
{
SysConsole.Output(ex);
File.WriteAllText("GLOBALERR_" + DateTime.Now.ToFileTimeUtc().ToString() + ".txt", ex.ToString() + "\n\n" + Environment.StackTrace);
}
SysConsole.ShutDown();
Console.WriteLine("Final shutdown - terminating process.");
Environment.Exit(0);
}
}
}
| mit | C# |
531620bf12c96bc5f58acb688f627954a7f54880 | Tidy up BySettings code style | NFig/NFig | NFig/BySetting.cs | NFig/BySetting.cs | using System.Collections;
using System.Collections.Generic;
namespace NFig
{
/// <summary>
/// An immutable dictionary where they keys are a setting name, and the values are <typeparamref name="TValue"/>.
/// </summary>
public class BySetting<TValue> : BySettingBase<TValue>, IReadOnlyDictionary<string, TValue>
where TValue : IBySettingDictionaryItem
{
/// <summary>
/// Enumerates the setting names (keys) in alphabetical order.
/// </summary>
public KeyCollection Keys => new KeyCollection(this);
/// <summary>
/// Enumerates the values in alphabetical order by setting name (key).
/// </summary>
public ValueCollection Values => new ValueCollection(this);
IEnumerable<string> IReadOnlyDictionary<string, TValue>.Keys => Keys;
IEnumerable<TValue> IReadOnlyDictionary<string, TValue>.Values => Values;
/// <summary>
/// Gets a <typeparamref name="TValue"/> by setting name, or throws an exception if not found.
/// </summary>
public TValue this[string settingName]
{
get
{
if (TryGetValue(settingName, out var value))
return value;
throw new KeyNotFoundException($"Setting name \"{settingName}\" was not found in the dictionary.");
}
}
/// <summary>
/// Initializes a new BySetting dictionary with <typeparamref name="TValue"/> as values.
/// </summary>
public BySetting(IReadOnlyCollection<TValue> values) : base(values, false)
{
}
/// <summary>
/// Gets a key/value enumerator for <see cref="BySetting{TValue}"/>.
/// </summary>
public KeyValueEnumerator GetEnumerator() => new KeyValueEnumerator(this);
IEnumerator<KeyValuePair<string, TValue>> IEnumerable<KeyValuePair<string, TValue>>.GetEnumerator() => GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
/// <summary>
/// Trys to get a <typeparamref name="TValue"/> by setting name from the dictionary. Returns false if no list was found.
/// </summary>
public bool TryGetValue(string settingName, out TValue value) => TryGetValueInternal(settingName, out value);
}
} | using System;
using System.Collections;
using System.Collections.Generic;
namespace NFig
{
/// <summary>
/// An immutable dictionary where they keys are a setting name, and the values are <typeparamref name="TValue"/>.
/// </summary>
public class BySetting<TValue> : BySettingBase<TValue>, IReadOnlyDictionary<string, TValue>
where TValue : IBySettingDictionaryItem
{
IEnumerable<string> IReadOnlyDictionary<string, TValue>.Keys => Keys;
IEnumerable<TValue> IReadOnlyDictionary<string, TValue>.Values => Values;
/// <summary>
/// Enumerates the setting names (keys) in alphabetical order.
/// </summary>
public KeyCollection Keys => new KeyCollection(this);
/// <summary>
/// Enumerates the values in alphabetical order by setting name (key).
/// </summary>
public ValueCollection Values => new ValueCollection(this);
/// <summary>
/// Gets a <typeparamref name="TValue"/> by setting name, or throws an exception if not found.
/// </summary>
public TValue this[string settingName]
{
get
{
if (TryGetValue(settingName, out var value))
return value;
throw new KeyNotFoundException($"Setting name \"{settingName}\" was not found in the dictionary.");
}
}
/// <summary>
/// Initializes a new BySetting dictionary with <typeparamref name="TValue"/> as values.
/// </summary>
public BySetting(IReadOnlyCollection<TValue> values) : base(values, false)
{
}
/// <summary>
/// Gets a key/value enumerator for <see cref="BySetting{TValue}"/>.
/// </summary>
public KeyValueEnumerator GetEnumerator() => new KeyValueEnumerator(this);
IEnumerator<KeyValuePair<string, TValue>> IEnumerable<KeyValuePair<String, TValue>>.GetEnumerator() => GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
/// <summary>
/// Trys to get a <typeparamref name="TValue"/> by setting name from the dictionary. Returns false if no list was found.
/// </summary>
public bool TryGetValue(string settingName, out TValue value) => TryGetValueInternal(settingName, out value);
}
} | mit | C# |
d03f345490de88654a0b07cb0396e9651590466c | Update version number. | Damnae/storybrew | editor/Properties/AssemblyInfo.cs | editor/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.66.*")]
| using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.65.*")]
| mit | C# |
21240e61a39431e5e23e1657562490314866d69e | Revert "Revert "cosmetic"" | stormsw/ladm.rrr | Example1/Program.cs | Example1/Program.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ladm.DataModel;
namespace Example1
{
class Program
{
static void Main(string[] args)
{
using (var context = new Ladm.DataModel.LadmDbContext())
{
Transaction transaction = new Transaction() { TransactionNumber = "TRN-0001", TransactionType = new TransactionMetaData() { Code="TRN" } };
context.Transactions.Add(transaction);
context.SaveChanges();
}
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ladm.DataModel;
namespace Example1
{
class Program
{
static void Main(string[] args)
{
using (var ctx = new Ladm.DataModel.LadmDbContext())
{
Transaction transaction = new Transaction() { TransactionNumber = "TRN-0001", TransactionType = new TransactionMetaData() { Code="TRN" } };
ctx.Transactions.Add(transaction);
ctx.SaveChanges();
}
}
}
}
| mit | C# |
ab8481215c11df4c2f76a46ec193b8cb69e3ae41 | Fix to dodgy cast in test | eric-davis/JustSaying,Intelliflo/JustSaying,Intelliflo/JustSaying | JustSaying.IntegrationTests/WhenRegisteringHandlersViaResolver/WhenRegisteringABlockingHandlerViaContainer.cs | JustSaying.IntegrationTests/WhenRegisteringHandlersViaResolver/WhenRegisteringABlockingHandlerViaContainer.cs | using System.Linq;
using JustSaying.Messaging.MessageHandling;
using NUnit.Framework;
using Shouldly;
using StructureMap;
namespace JustSaying.IntegrationTests.WhenRegisteringHandlersViaResolver
{
public class WhenRegisteringABlockingHandlerViaContainer : GivenAPublisher
{
private BlockingOrderProcessor _resolvedHandler;
protected override void Given()
{
var container = new Container(x => x.AddRegistry(new BlockingHandlerRegistry()));
var handlerResolver = new StructureMapHandlerResolver(container);
var handlers = handlerResolver.ResolveHandlers<OrderPlaced>().ToList();
Assert.That(handlers.Count, Is.EqualTo(1));
var blockingHandler = (BlockingHandler<OrderPlaced>)handlers[0];
_resolvedHandler = (BlockingOrderProcessor)blockingHandler.Inner;
DoneSignal = _resolvedHandler.DoneSignal.Task;
var subscriber = CreateMeABus.InRegion("eu-west-1")
.WithSqsTopicSubscriber()
.IntoQueue("container-test")
.WithMessageHandler<OrderPlaced>(handlerResolver);
subscriber.StartListening();
}
[Test]
public void ThenHandlerWillReceiveTheMessage()
{
_resolvedHandler.ReceivedMessageCount.ShouldBeGreaterThan(0);
}
}
} | using System.Linq;
using NUnit.Framework;
using Shouldly;
using StructureMap;
namespace JustSaying.IntegrationTests.WhenRegisteringHandlersViaResolver
{
public class WhenRegisteringABlockingHandlerViaContainer : GivenAPublisher
{
private BlockingOrderProcessor _resolvedHandler;
protected override void Given()
{
var container = new Container(x => x.AddRegistry(new BlockingHandlerRegistry()));
var handlerResolver = new StructureMapHandlerResolver(container);
var handlers = handlerResolver.ResolveHandlers<OrderPlaced>().ToList();
Assert.That(handlers.Count, Is.EqualTo(1));
_resolvedHandler = (BlockingOrderProcessor)handlers[0];
DoneSignal = _resolvedHandler.DoneSignal.Task;
var subscriber = CreateMeABus.InRegion("eu-west-1")
.WithSqsTopicSubscriber()
.IntoQueue("container-test")
.WithMessageHandler<OrderPlaced>(handlerResolver);
subscriber.StartListening();
}
[Test]
public void ThenHandlerWillReceiveTheMessage()
{
_resolvedHandler.ReceivedMessageCount.ShouldBeGreaterThan(0);
}
}
} | apache-2.0 | C# |
72a58731bb7ddfaf35c14cb4362b49451d4dfdbf | Create new instance of KeyHandler on every call to Read method | tsolarin/readline,tsolarin/readline | src/ReadLine/ReadLine.cs | src/ReadLine/ReadLine.cs | using System;
namespace ReadLine
{
public static class ReadLine
{
private static KeyHandler _keyHandler;
public static string Read()
{
_keyHandler = new KeyHandler();
ConsoleKeyInfo keyInfo = Console.ReadKey(true);
while (keyInfo.Key != ConsoleKey.Enter)
{
_keyHandler.Handle(keyInfo);
keyInfo = Console.ReadKey(true);
}
return _keyHandler.Text;
}
}
}
| using System;
namespace ReadLine
{
public static class ReadLine
{
private static KeyHandler _keyHandler;
static ReadLine()
{
_keyHandler = new KeyHandler();
}
public static string Read()
{
ConsoleKeyInfo keyInfo = Console.ReadKey(true);
while (keyInfo.Key != ConsoleKey.Enter)
{
_keyHandler.Handle(keyInfo);
keyInfo = Console.ReadKey(true);
}
return _keyHandler.Text;
}
}
}
| mit | C# |
da8ffd88d7b89eddc58a7458ed3b873f47c2f799 | refactor to use a propertyDescriptor | Pondidum/Stronk,Pondidum/Stronk | src/Stronk/Extensions.cs | src/Stronk/Extensions.cs | using System;
using System.Configuration;
using System.Linq;
using System.Reflection;
using Stronk.ValueConversion;
namespace Stronk
{
public static class Extensions
{
public static void FromAppConfig(this object target)
{
var converters = new IValueConverter[]
{
new LambdaValueConverter<Uri>(val => new Uri(val)),
new EnumValueConverter(),
new FallbackValueConverter()
};
var properties = target
.GetType()
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
.Select(prop => new PropertyDescriptor
{
Name = prop.Name,
Type = prop.PropertyType,
Assign = value => prop.GetSetMethod(true).Invoke(target, new []{ value })
});
var appSettings = ConfigurationManager.AppSettings;
foreach (var property in properties)
{
var hasSetting = appSettings.AllKeys.Contains(property.Name);
if (hasSetting)
{
var converted = converters
.First(c => c.CanMap(property.Type))
.Map(property.Type, appSettings[property.Name]);
property.Assign(converted);
}
}
}
}
public class PropertyDescriptor
{
public string Name { get; set; }
public Type Type { get; set; }
public Action<object> Assign { get; set; }
}
}
| using System;
using System.Configuration;
using System.Linq;
using System.Reflection;
using Stronk.ValueConversion;
namespace Stronk
{
public static class Extensions
{
public static void FromAppConfig(this object target)
{
var converters = new IValueConverter[]
{
new LambdaValueConverter<Uri>(val => new Uri(val)),
new EnumValueConverter(),
new FallbackValueConverter()
};
var properties = target
.GetType()
.GetProperties(BindingFlags.Public | BindingFlags.Instance);
var appSettings = ConfigurationManager.AppSettings;
foreach (var property in properties)
{
var hasSetting = appSettings.AllKeys.Contains(property.Name);
if (hasSetting)
{
var converted = converters
.First(c => c.CanMap(property.PropertyType))
.Map(property.PropertyType, appSettings[property.Name]);
property.GetSetMethod(true).Invoke(target, new[] { converted });
}
}
}
}
}
| lgpl-2.1 | C# |
a6d5d26dbf8b4429177887ada02256c2903036ac | check creds | diman84/Welthperk,diman84/Welthperk,diman84/Welthperk | src/Wealthperk.Web/Controllers/HomeController.cs | src/Wealthperk.Web/Controllers/HomeController.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace WelthPeck.Controllers
{
public class HomeController : Controller
{
Amazon.DynamoDBv2.IAmazonDynamoDB _dynamoDb;
Amazon.Extensions.NETCore.Setup.AWSOptions _ops;
public HomeController(Amazon.DynamoDBv2.IAmazonDynamoDB dynamoDb, Amazon.Extensions.NETCore.Setup.AWSOptions ops)
{
_dynamoDb = dynamoDb;
_ops = ops;
}
public IActionResult Index()
{
return View();
}
public async Task<IActionResult> About()
{
var tables = await _dynamoDb.ListTablesAsync();
ViewData["Message"] = string.Join(", ", tables.TableNames);
return View();
}
public IActionResult Contact()
{
Amazon.Runtime.AWSCredentials creds = null;
if (_ops != null)
{
if(_ops.Credentials != null)
{
creds = _ops.Credentials;
}
else
if(!string.IsNullOrEmpty(_ops.Profile) && !string.IsNullOrEmpty(_ops.ProfilesLocation))
{
Amazon.Runtime.CredentialManagement.CredentialProfile basicProfile;
var sharedFile = new Amazon.Runtime.CredentialManagement.SharedCredentialsFile(_ops.ProfilesLocation);
if (sharedFile.TryGetProfile(_ops.Profile, out basicProfile))
{
creds = Amazon.Runtime.CredentialManagement.AWSCredentialsFactory.GetAWSCredentials(basicProfile, sharedFile);
}
}
}
creds = creds ?? Amazon.Runtime.FallbackCredentialsFactory.GetCredentials();
ViewData["Message"] = creds?.GetCredentials().AccessKey;
return View();
}
public IActionResult Error()
{
return View();
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace WelthPeck.Controllers
{
public class HomeController : Controller
{
Amazon.DynamoDBv2.IAmazonDynamoDB _dynamoDb;
public HomeController(Amazon.DynamoDBv2.IAmazonDynamoDB dynamoDb)
{
_dynamoDb = dynamoDb;
}
public IActionResult Index()
{
return View();
}
public async Task<IActionResult> About()
{
var tables = await _dynamoDb.ListTablesAsync();
ViewData["Message"] = string.Join(", ", tables.TableNames);
return View();
}
public IActionResult Contact()
{
ViewData["Message"] = "Your contact page.";
return View();
}
public IActionResult Error()
{
return View();
}
}
}
| mit | C# |
ff4f9861369a0669c99f00aa41c29c785f6e6ced | Use tabs instead of spaces. | yallie/unzip | UsageExample.cs | UsageExample.cs | // Unzip class usage example
// Written by Alexey Yakovlev <[email protected]>
// https://github.com/yallie/unzip
using System;
using System.Linq;
namespace Internals
{
internal struct Program
{
private static void Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Syntax: unzip Archive.zip TargetDirectory");
return;
}
var archiveName = args.First();
var outputDirectory = args.Last();
using (var unzip = new Unzip(archiveName))
{
ListFiles(unzip);
unzip.ExtractToDirectory(outputDirectory);
}
}
private static void ListFiles(Unzip unzip)
{
var tab = unzip.Entries.Any(e => e.IsDirectory) ? "\t" : string.Empty;
foreach (var entry in unzip.Entries.OrderBy(e => e.Name))
{
if (entry.IsFile)
{
Console.WriteLine(tab + "{0}: {1} -> {2}", entry.Name, entry.CompressedSize, entry.OriginalSize);
}
else if (entry.IsDirectory)
{
Console.WriteLine(entry.Name);
}
}
}
}
}
| // Unzip class usage example
// Written by Alexey Yakovlev <[email protected]>
// https://github.com/yallie/unzip
using System;
using System.Linq;
namespace Internals
{
internal struct Program
{
private static void Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Syntax: unzip Archive.zip TargetDirectory");
return;
}
var archiveName = args.First();
var outputDirectory = args.Last();
using (var unzip = new Unzip(archiveName))
{
ListFiles(unzip);
unzip.ExtractToDirectory(outputDirectory);
}
}
private static void ListFiles(Unzip unzip)
{
var tab = unzip.Entries.Any(e => e.IsDirectory) ? "\t" : string.Empty;
foreach (var entry in unzip.Entries.OrderBy(e => e.Name))
{
if (entry.IsFile)
{
Console.WriteLine(tab + "{0}: {1} -> {2}", entry.Name, entry.CompressedSize, entry.OriginalSize);
}
else if (entry.IsDirectory)
{
Console.WriteLine(entry.Name);
}
}
}
}
}
| mit | C# |
91b682d431fa7597881b9618095d0ab5a4585952 | fix build - again | IdentityServer/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4,IdentityServer/IdentityServer4,MienDev/IdentityServer4,MienDev/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4 | build.cake | build.cake | var target = Argument("target", "Default");
var configuration = Argument<string>("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
///////////////////////////////////////////////////////////////////////////////
var packPath = Directory("./src");
var buildArtifacts = Directory("./artifacts/packages");
var isAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isWindows = IsRunningOnWindows();
///////////////////////////////////////////////////////////////////////////////
// Clean
///////////////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories(new DirectoryPath[] { buildArtifacts });
});
///////////////////////////////////////////////////////////////////////////////
// Build
///////////////////////////////////////////////////////////////////////////////
Task("Build")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = configuration
};
var projects = GetFiles("./src/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreBuild(project.GetDirectory().FullPath, settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Test
///////////////////////////////////////////////////////////////////////////////
Task("Test")
.IsDependentOn("Clean")
.IsDependentOn("Build")
.Does(() =>
{
var settings = new DotNetCoreTestSettings
{
Configuration = configuration
};
if (!isWindows)
{
Information("Not running on Windows - skipping tests for .NET Framework");
settings.Framework = "netcoreapp2.1";
}
var projects = GetFiles("./test/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTest(project.FullPath, settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Pack
///////////////////////////////////////////////////////////////////////////////
Task("Pack")
.IsDependentOn("Clean")
.IsDependentOn("Build")
.Does(() =>
{
var settings = new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = buildArtifacts,
NoBuild = true
};
// add build suffix for CI builds
if(isAppVeyor)
{
settings.VersionSuffix = "build" + AppVeyor.Environment.Build.Number.ToString().PadLeft(5,'0');
}
DotNetCorePack(packPath, settings);
});
Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack");
RunTarget(target); | var target = Argument("target", "Default");
var configuration = Argument<string>("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
///////////////////////////////////////////////////////////////////////////////
var packPath = Directory("./src");
var buildArtifacts = Directory("./artifacts/packages");
var isAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isWindows = IsRunningOnWindows();
///////////////////////////////////////////////////////////////////////////////
// Clean
///////////////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories(new DirectoryPath[] { buildArtifacts });
});
///////////////////////////////////////////////////////////////////////////////
// Build
///////////////////////////////////////////////////////////////////////////////
Task("Build")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = configuration
};
var projects = GetFiles("./src/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreBuild(project.GetDirectory().FullPath, settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Test
///////////////////////////////////////////////////////////////////////////////
Task("Test")
.IsDependentOn("Clean")
.IsDependentOn("Build")
.Does(() =>
{
var settings = new DotNetCoreTestSettings
{
Configuration = configuration,
NoBuild = true
};
if (!isWindows)
{
Information("Not running on Windows - skipping tests for .NET Framework");
settings.Framework = "netcoreapp2.1";
}
var projects = GetFiles("./test/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTest(project.FullPath, settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Pack
///////////////////////////////////////////////////////////////////////////////
Task("Pack")
.IsDependentOn("Clean")
.IsDependentOn("Build")
.Does(() =>
{
var settings = new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = buildArtifacts,
NoBuild = true
};
// add build suffix for CI builds
if(isAppVeyor)
{
settings.VersionSuffix = "build" + AppVeyor.Environment.Build.Number.ToString().PadLeft(5,'0');
}
DotNetCorePack(packPath, settings);
});
Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack");
RunTarget(target); | apache-2.0 | C# |
f74df7cf2c6550e155c8c5ce3b513667e1d6c98a | Make class CredentialStore public because it's used by nuget v3 now. | indsoft/NuGet2,indsoft/NuGet2,chocolatey/nuget-chocolatey,indsoft/NuGet2,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,indsoft/NuGet2,indsoft/NuGet2,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,indsoft/NuGet2 | src/Core/Http/CredentialStore.cs | src/Core/Http/CredentialStore.cs | using System;
using System.Collections.Concurrent;
using System.Net;
namespace NuGet
{
public class CredentialStore : ICredentialCache
{
private readonly ConcurrentDictionary<Uri, ICredentials> _credentialCache = new ConcurrentDictionary<Uri, ICredentials>();
private static readonly CredentialStore _instance = new CredentialStore();
public static CredentialStore Instance
{
get
{
return _instance;
}
}
public ICredentials GetCredentials(Uri uri)
{
Uri rootUri = GetRootUri(uri);
ICredentials credentials;
if (_credentialCache.TryGetValue(uri, out credentials) ||
_credentialCache.TryGetValue(rootUri, out credentials))
{
return credentials;
}
return null;
}
public void Add(Uri uri, ICredentials credentials)
{
Uri rootUri = GetRootUri(uri);
_credentialCache.TryAdd(uri, credentials);
_credentialCache.AddOrUpdate(rootUri, credentials, (u, c) => credentials);
}
internal static Uri GetRootUri(Uri uri)
{
return new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
}
}
} | using System;
using System.Collections.Concurrent;
using System.Net;
namespace NuGet
{
internal class CredentialStore : ICredentialCache
{
private readonly ConcurrentDictionary<Uri, ICredentials> _credentialCache = new ConcurrentDictionary<Uri, ICredentials>();
private static readonly CredentialStore _instance = new CredentialStore();
public static CredentialStore Instance
{
get
{
return _instance;
}
}
public ICredentials GetCredentials(Uri uri)
{
Uri rootUri = GetRootUri(uri);
ICredentials credentials;
if (_credentialCache.TryGetValue(uri, out credentials) ||
_credentialCache.TryGetValue(rootUri, out credentials))
{
return credentials;
}
return null;
}
public void Add(Uri uri, ICredentials credentials)
{
Uri rootUri = GetRootUri(uri);
_credentialCache.TryAdd(uri, credentials);
_credentialCache.AddOrUpdate(rootUri, credentials, (u, c) => credentials);
}
internal static Uri GetRootUri(Uri uri)
{
return new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
}
}
}
| apache-2.0 | C# |
19eaeb804a0860e7fd53da0ab106485d23a0e85b | Update Assets/MixedRealityToolkit-Examples/Demos/CustomServices/Inspectors/DemoCustomExtensionServiceProfileInspector.cs | StephenHodgson/MixedRealityToolkit-Unity | Assets/MixedRealityToolkit-Examples/Demos/CustomServices/Inspectors/DemoCustomExtensionServiceProfileInspector.cs | Assets/MixedRealityToolkit-Examples/Demos/CustomServices/Inspectors/DemoCustomExtensionServiceProfileInspector.cs | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Core.Inspectors.Profiles;
using Microsoft.MixedReality.Toolkit.Core.Inspectors.Utilities;
using UnityEditor;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos.CustomExtensionServices.Inspectors
{
/// <summary>
/// The custom inspector for your <see cref="DemoCustomExtensionServiceProfile"/>.
/// This is where you can create your own inspector for what you see in the profile.
/// </summary>
[CustomEditor(typeof(DemoCustomExtensionServiceProfile))]
public class DemoCustomExtensionServiceProfileInspector : BaseMixedRealityProfileInspector
{
private SerializedProperty myCustomStringData;
protected override void OnEnable()
{
// Call base on enable so we can get proper
// copy/paste functionality of the profile
base.OnEnable();
// We check to make sure the MRTK is configured here.
// Pass false so we don't get an error for showing the help box.
if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured(false))
{
return;
}
myCustomStringData = serializedObject.FindProperty("myCustomStringData");
}
public override void OnInspectorGUI()
{
// We check to make sure the MRTK is configured here.
// This will show an error help box if it's not.
if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
{
return;
}
serializedObject.Update();
EditorGUILayout.PropertyField(myCustomStringData);
serializedObject.ApplyModifiedProperties();
}
}
}
| // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Core.Inspectors.Profiles;
using Microsoft.MixedReality.Toolkit.Core.Inspectors.Utilities;
using UnityEditor;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos.CustomExtensionServices.Inspectors
{
/// <summary>
/// The custom inspector for your <see cref="DemoCustomExtensionServiceProfile"/>.
/// This is where you can create your own inspector for what you see in the profile.
/// </summary>
[CustomEditor(typeof(DemoCustomExtensionServiceProfile))]
public class DemoCustomExtensionServiceProfileInspector : BaseMixedRealityProfileInspector
{
private SerializedProperty myCustomStringData;
protected override void OnEnable()
{
// Call base on enable so we can get proper
// copy/paste functionality of the profile
base.OnEnable();
// We check to make sure the MRTK is configured here.
// Pass false so we don't get en error for showing the help box.
if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured(false))
{
return;
}
myCustomStringData = serializedObject.FindProperty("myCustomStringData");
}
public override void OnInspectorGUI()
{
// We check to make sure the MRTK is configured here.
// This will show an error help box if it's not.
if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
{
return;
}
serializedObject.Update();
EditorGUILayout.PropertyField(myCustomStringData);
serializedObject.ApplyModifiedProperties();
}
}
} | mit | C# |
9b08d69c9048e7076b65238c752bf56a57952895 | move to version 1.4 | ChrisMissal/Formo,Moulde/Formo,noelbundick/Formo,madhon/Formo | src/Formo/Properties/AssemblyInfo.cs | src/Formo/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("Formo")]
[assembly: AssemblyDescription("Formo lets you use your configuration file as a dynamic object.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Formo")]
[assembly: AssemblyCopyright("Copyright © Chris Missal 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e132cc76-3768-45f7-84c6-75d907225721")]
// 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.4.0.*")]
[assembly: AssemblyFileVersion("1.4.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("Formo")]
[assembly: AssemblyDescription("Formo lets you use your configuration file as a dynamic object.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Formo")]
[assembly: AssemblyCopyright("Copyright © Chris Missal 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e132cc76-3768-45f7-84c6-75d907225721")]
// 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.3.0.*")]
[assembly: AssemblyFileVersion("1.3.0.*")]
| mit | C# |
d615f137ffadb9b737d8304130fb26e8448a25d6 | Document PageNT | ianmartinez/Language-Pad | src/LangPadData/NotebookNT/PageNT.cs | src/LangPadData/NotebookNT/PageNT.cs | namespace LangPadData.NotebookNT
{
/// <summary>
/// A page in the NT 1.x-2.x file format (*.nt).
/// </summary>
public class PageNT
{
/// <summary>
/// The page's title.
/// </summary>
public string Title { get; set; } = "";
/// <summary>
/// The Rich Text Format data of the page.
/// </summary>
public string Rtf { get; set; } = "";
}
}
| namespace LangPadData.NotebookNT
{
public class PageNT
{
public string Title { get; set; } = "";
public string Rtf { get; set; } = "";
}
}
| mit | C# |
7e5999ea9d78fe1f446163a86dffe0fede58b966 | Bump version to 1.3.6 to fix builtInTypeReplacements bug. | ananthonline/Postal | SolutionInfo.cs | SolutionInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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.3.6.0")]
[assembly: AssemblyFileVersion("1.3.6.0")] | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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.3.5.0")]
[assembly: AssemblyFileVersion("1.3.5.0")] | mit | C# |
7486f2660e7a231c53b95ddb2fa6f268fb12a1b7 | Improve clipboard code | Baggykiin/pass-winmenu | pass-winmenu/src/WinApi/Clipboard.cs | pass-winmenu/src/WinApi/Clipboard.cs | using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using PassWinmenu.Utilities;
namespace PassWinmenu.WinApi
{
public class ClipboardHelper
{
/// <summary>
/// Copies a string to the clipboard. If it still exists on the clipboard after the amount of time
/// specified in <paramref name="timeout"/>, it will be removed again.
/// </summary>
/// <param name="text">The text to add to the clipboard.</param>
/// <param name="timeout">The amount of time, in seconds, the text should remain on the clipboard.</param>
public void Place(string text, TimeSpan timeout)
{
Helpers.AssertOnUiThread();
var clipboardBackup = new Dictionary<string, object>();
var dataObject = Clipboard.GetDataObject();
if (dataObject != null)
{
Log.Send("Saving previous clipboard contents before storing the password");
Log.Send($" - Formats: {string.Join(", ", dataObject.GetFormats(false))}");
foreach (var format in dataObject.GetFormats(false))
{
clipboardBackup[format] = dataObject.GetData(format, false);
}
}
Clipboard.SetText(text, TextDataFormat.UnicodeText);
Task.Delay(timeout).ContinueWith(_ =>
{
Application.Current.Dispatcher.Invoke(() =>
{
try
{
// Only reset the clipboard to its previous contents if it still contains the text we copied to it.
if (Clipboard.ContainsText() && Clipboard.GetText() == text)
{
// First clear the clipboard, to ensure our text is gone,
// even if restoring the previous content fails.
Clipboard.Clear();
// Now try to restore the previous content.
Log.Send($"Restoring previous clipboard contents:");
foreach (var pair in clipboardBackup)
{
Log.Send($" - {pair.Key}");
Clipboard.SetData(pair.Key, pair.Value);
}
}
}
catch (Exception e)
{
Log.Send($"Failed to restore previous clipboard contents: An exception occurred ({e.GetType().Name}: {e.Message})", LogLevel.Error);
}
});
});
}
public string GetText()
{
return Clipboard.ContainsText() ? Clipboard.GetText() : null;
}
}
}
| using System;
using System.Threading.Tasks;
using System.Windows;
namespace PassWinmenu.WinApi
{
public class ClipboardHelper
{
/// <summary>
/// Copies a string to the clipboard. If it still exists on the clipboard after the amount of time
/// specified in <paramref name="timeout"/>, it will be removed again.
/// </summary>
/// <param name="text">The text to add to the clipboard.</param>
/// <param name="timeout">The amount of time, in seconds, the text should remain on the clipboard.</param>
public void Place(string text, TimeSpan timeout)
{
//Clipboard.Flush();
var previousData = Clipboard.GetDataObject();
Log.Send("Saving previous clipboard contents before storing the password");
Log.Send($" - Formats: {string.Join(", ", previousData.GetFormats())}");
Clipboard.Clear();
Clipboard.SetDataObject(text);
Task.Delay(timeout).ContinueWith(_ =>
{
Application.Current.Dispatcher.Invoke(() =>
{
try
{
// Only reset the clipboard to its previous contents if it still contains the text we copied to it.
// If the clipboard did not previously contain any text, it is simply cleared.
if (Clipboard.ContainsText() && Clipboard.GetText() == text)
{
Log.Send("Restoring previous clipboard contents");
Clipboard.SetDataObject(previousData);
}
}
catch (Exception e)
{
Log.Send($"Failed to restore previous clipboard contents: An exception occurred ({e.GetType().Name}: {e.Message})", LogLevel.Error);
}
});
});
}
public string GetText()
{
return Clipboard.ContainsText() ? Clipboard.GetText() : null;
}
}
}
| mit | C# |
610dd0b6fc8c3e0b3bb725a734fd8b4057e953fd | Modify `Performance_test_for_resolving_of_nested_anonymous_types` test to measure performance of `TypeResolver.EqualityComparer.Equals` Issue #15 | 6bee/aqua-core | test/Aqua.Tests/TypeSystem/TypeResolver/PerformanceTests.cs | test/Aqua.Tests/TypeSystem/TypeResolver/PerformanceTests.cs | // Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information.
namespace Aqua.Tests.TypeSystem.TypeResolver
{
using System;
using Aqua.TypeSystem;
using System.Diagnostics;
using Xunit;
public class PerformanceTests
{
[Fact]
public void Performance_test_for_resolving_of_nested_anonymous_types()
{
Type GenerateAnonymousType<T>(uint nestingCount, T value)
{
if (nestingCount == 0)
return null;
var newValue = new { Prop = value };
return GenerateAnonymousType(nestingCount - 1, newValue) ?? newValue.GetType();
}
for (uint i = 15; i <= 20; ++i)
{
var type = GenerateAnonymousType(i, "hello");
var typeInfo1 = new TypeInfo(type);
var typeInfo2 = new TypeInfo(type);
var typeResolver = new TypeResolver();
var watch = Stopwatch.StartNew();
typeResolver.ResolveType(typeInfo1);
typeResolver.ResolveType(typeInfo2);
watch.Stop();
Debug.WriteLine($"{i} | {watch.ElapsedMilliseconds}");
}
}
}
}
| // Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information.
namespace Aqua.Tests.TypeSystem.TypeResolver
{
using Aqua.TypeSystem;
using System.Diagnostics;
using Xunit;
public class PerformanceTests
{
[Fact]
public void Performance_test_for_resolving_of_nested_anonymous_types()
{
TypeInfo GenerateAnonymousType<T>(uint nestingCount, T value)
{
if (nestingCount == 0)
return null;
var newValue = new { Prop = value };
return GenerateAnonymousType(nestingCount - 1, newValue) ?? new TypeInfo(newValue.GetType());
}
for (uint i = 15; i <= 30; ++i)
{
TypeInfo type = GenerateAnonymousType(i, "hello");
var typeResolver = new TypeResolver();
var watch = Stopwatch.StartNew();
typeResolver.ResolveType(type);
watch.Stop();
Debug.WriteLine($"{i} | {watch.ElapsedMilliseconds}");
}
}
}
}
| mit | C# |
e2d21abaa30cb981b1cc43d53ed6895126571da0 | duplicate where clause | jefking/King.Data.Sql.Reflection | King.Data.Sql.Reflection/Statement.cs | King.Data.Sql.Reflection/Statement.cs | namespace King.Data.Sql.Reflection
{
/// <summary>
/// SQL Statements
/// </summary>
public struct Statement
{
#region Members
/// <summary>
/// SQL Stored Procedures Statement
/// </summary>
public const string StoredProcedures = @"SELECT parm.name AS [Parameter]
, typ.name AS [DataType]
, SPECIFIC_SCHEMA AS [Schema]
, SPECIFIC_NAME AS [StoredProcedure]
, CASE parm.max_length WHEN -1 THEN 2147483647 ELSE parm.max_length END AS [MaxLength]
FROM sys.procedures sp WITH(NOLOCK) LEFT OUTER JOIN sys.parameters parm WITH(NOLOCK) ON sp.object_id = parm.object_id
INNER JOIN [information_schema].[routines] WITH(NOLOCK) ON routine_type = 'PROCEDURE'
AND ROUTINE_NAME not like 'sp_%diagram%'
AND sp.name = SPECIFIC_NAME
LEFT OUTER JOIN sys.types typ WITH(NOLOCK) ON parm.system_type_id = typ.system_type_id
AND typ.name <> 'sysname'
AND typ.is_user_defined = 0
ORDER BY SPECIFIC_NAME, SPECIFIC_SCHEMA";
#endregion
}
} | namespace King.Data.Sql.Reflection
{
/// <summary>
/// SQL Statements
/// </summary>
public struct Statement
{
#region Members
/// <summary>
/// SQL Stored Procedures Statement
/// </summary>
public const string StoredProcedures = @"SELECT parm.name AS [Parameter]
, typ.name AS [DataType]
, SPECIFIC_SCHEMA AS [Schema]
, SPECIFIC_NAME AS [StoredProcedure]
, CASE parm.max_length WHEN -1 THEN 2147483647 ELSE parm.max_length END AS [MaxLength]
FROM sys.procedures sp WITH(NOLOCK) LEFT OUTER JOIN sys.parameters parm WITH(NOLOCK) ON sp.object_id = parm.object_id
INNER JOIN [information_schema].[routines] WITH(NOLOCK) ON routine_type = 'PROCEDURE' AND ROUTINE_NAME not like 'sp_%diagram%'
AND ROUTINE_NAME not like 'sp_%diagram%'
AND sp.name = SPECIFIC_NAME
LEFT OUTER JOIN sys.types typ WITH(NOLOCK) ON parm.system_type_id = typ.system_type_id
AND typ.name <> 'sysname'
AND typ.is_user_defined = 0
ORDER BY SPECIFIC_NAME, SPECIFIC_SCHEMA";
#endregion
}
} | mit | C# |
c457ecf07a29718acca8c18098af9f504df48949 | Add missing constructor for derived tracking events | bwatts/Totem,bwatts/Totem | Source/Totem/Tracking/TrackedEvent.cs | Source/Totem/Tracking/TrackedEvent.cs | using System;
namespace Totem.Tracking
{
/// <summary>
/// A timeline event tracked by an index
/// </summary>
public class TrackedEvent
{
protected TrackedEvent()
{}
public TrackedEvent(string eventType, long eventPosition, Id userId, DateTime eventWhen, string keyType, string keyValue)
{
EventType = eventType;
EventPosition = eventPosition;
UserId = userId;
EventWhen = eventWhen;
KeyType = keyType;
KeyValue = keyValue;
}
public string EventType;
public long EventPosition;
public Id UserId;
public DateTime EventWhen;
public string KeyType;
public string KeyValue;
}
} | using System;
namespace Totem.Tracking
{
/// <summary>
/// A timeline event tracked by an index
/// </summary>
public class TrackedEvent
{
public TrackedEvent(string eventType, long eventPosition, Id userId, DateTime eventWhen, string keyType, string keyValue)
{
EventType = eventType;
EventPosition = eventPosition;
UserId = userId;
EventWhen = eventWhen;
KeyType = keyType;
KeyValue = keyValue;
}
public string EventType;
public long EventPosition;
public Id UserId;
public DateTime EventWhen;
public string KeyType;
public string KeyValue;
}
} | mit | C# |
80212c91d0cffbe59d7d056e030beefe998bd7c5 | Move constants to top of interface | ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework | osu.Framework/Graphics/Rendering/IRenderer.cs | osu.Framework/Graphics/Rendering/IRenderer.cs | // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using System;
using osu.Framework.Graphics.OpenGL.Vertices;
namespace osu.Framework.Graphics.Rendering
{
/// <summary>
/// Draws to the screen.
/// </summary>
public interface IRenderer
{
public const int VERTICES_PER_QUAD = 4;
public const int VERTICES_PER_TRIANGLE = 4;
internal IShaderPart CreateShaderPart(ShaderManager manager, string name, byte[]? rawData, ShaderPartType partType);
internal IShader CreateShader(string name, params IShaderPart[] parts);
/// <summary>
/// Creates a new <see cref="IFrameBuffer"/>.
/// </summary>
/// <param name="renderBufferFormats">Any render buffer formats.</param>
/// <param name="filteringMode">The texture filtering mode.</param>
/// <returns>The <see cref="IFrameBuffer"/>.</returns>
IFrameBuffer CreateFrameBuffer(RenderBufferFormat[]? renderBufferFormats = null, TextureFilteringMode filteringMode = TextureFilteringMode.Linear);
/// <summary>
/// Creates a new linear vertex batch, accepting vertices and drawing as a given primitive type.
/// </summary>
/// <param name="size">Number of quads.</param>
/// <param name="maxBuffers">Maximum number of vertex buffers.</param>
/// <param name="topology">The type of primitive the vertices are drawn as.</param>
IVertexBatch<TVertex> CreateLinearBatch<TVertex>(int size, int maxBuffers, PrimitiveTopology topology) where TVertex : unmanaged, IEquatable<TVertex>, IVertex;
/// <summary>
/// Creates a new quad vertex batch, accepting vertices and drawing as quads.
/// </summary>
/// <param name="size">Number of quads.</param>
/// <param name="maxBuffers">Maximum number of vertex buffers.</param>
IVertexBatch<TVertex> CreateQuadBatch<TVertex>(int size, int maxBuffers) where TVertex : unmanaged, IEquatable<TVertex>, IVertex;
}
}
| // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using System;
using osu.Framework.Graphics.OpenGL.Vertices;
namespace osu.Framework.Graphics.Rendering
{
/// <summary>
/// Draws to the screen.
/// </summary>
public interface IRenderer
{
internal IShaderPart CreateShaderPart(ShaderManager manager, string name, byte[]? rawData, ShaderPartType partType);
internal IShader CreateShader(string name, params IShaderPart[] parts);
/// <summary>
/// Creates a new <see cref="IFrameBuffer"/>.
/// </summary>
/// <param name="renderBufferFormats">Any render buffer formats.</param>
/// <param name="filteringMode">The texture filtering mode.</param>
/// <returns>The <see cref="IFrameBuffer"/>.</returns>
IFrameBuffer CreateFrameBuffer(RenderBufferFormat[]? renderBufferFormats = null, TextureFilteringMode filteringMode = TextureFilteringMode.Linear);
public const int VERTICES_PER_QUAD = 4;
public const int VERTICES_PER_TRIANGLE = 4;
/// <summary>
/// Creates a new linear vertex batch, accepting vertices and drawing as a given primitive type.
/// </summary>
/// <param name="size">Number of quads.</param>
/// <param name="maxBuffers">Maximum number of vertex buffers.</param>
/// <param name="topology">The type of primitive the vertices are drawn as.</param>
IVertexBatch<TVertex> CreateLinearBatch<TVertex>(int size, int maxBuffers, PrimitiveTopology topology) where TVertex : unmanaged, IEquatable<TVertex>, IVertex;
/// <summary>
/// Creates a new quad vertex batch, accepting vertices and drawing as quads.
/// </summary>
/// <param name="size">Number of quads.</param>
/// <param name="maxBuffers">Maximum number of vertex buffers.</param>
IVertexBatch<TVertex> CreateQuadBatch<TVertex>(int size, int maxBuffers) where TVertex : unmanaged, IEquatable<TVertex>, IVertex;
}
}
| mit | C# |
017fa4fce6a060f5ec94535c7a097184102e6683 | Initialize InfoAppCommand with a TextWriter | appharbor/appharbor-cli | src/AppHarbor/Commands/InfoAppCommand.cs | src/AppHarbor/Commands/InfoAppCommand.cs | using System;
using System.IO;
namespace AppHarbor.Commands
{
[CommandHelp("Get application details")]
public class InfoAppCommand : ICommand
{
private readonly IAppHarborClient _client;
private readonly IApplicationConfiguration _applicationConfiguration;
private readonly TextWriter _writer;
public InfoAppCommand(IAppHarborClient client, IApplicationConfiguration applicationConfiguration, TextWriter writer)
{
_client = client;
_applicationConfiguration = applicationConfiguration;
_writer = writer;
}
public void Execute(string[] arguments)
{
throw new NotImplementedException();
}
}
}
| using System;
namespace AppHarbor.Commands
{
[CommandHelp("Get application details")]
public class InfoAppCommand : ICommand
{
private readonly IAppHarborClient _client;
private readonly IApplicationConfiguration _applicationConfiguration;
public InfoAppCommand(IAppHarborClient client, IApplicationConfiguration applicationConfiguration)
{
_client = client;
_applicationConfiguration = applicationConfiguration;
}
public void Execute(string[] arguments)
{
throw new NotImplementedException();
}
}
}
| mit | C# |
e71ec5043d3ea5f09bf80ad729b79caa16d7cab6 | Update ClaudioSilva.cs | planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell | src/Firehose.Web/Authors/ClaudioSilva.cs | src/Firehose.Web/Authors/ClaudioSilva.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class ClaudioSilva : IAmAMicrosoftMVP
{
public string FirstName => "Cláudio";
public string LastName => "Silva";
public string ShortBioOrTagLine => "SQL Server DBA and PowerShell MVP who loves to automate any process that needs to be done more than a couple of times.";
public string StateOrRegion => "Sintra, Portugal";
public string EmailAddress => string.Empty;
public string TwitterHandle => "claudioessilva";
public string GravatarHash => "c01100dc9b797cc424e48ca9c5ecb76f";
public string GitHubHandle => "claudioessilva";
public GeoPosition Position => new GeoPosition(38.754074938, -9.2808723);
public Uri WebSite => new Uri("https://claudioessilva.eu");
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://claudioessilva.eu/feed.xml"); }
}
public string FeedLanguageCode => "en";
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class ClaudioSilva : IAmAMicrosoftMVP
{
public string FirstName => "Cláudio";
public string LastName => "Silva";
public string ShortBioOrTagLine => "SQL Server DBA and PowerShell MVP who loves to automate any process that needs to be done more than a couple of times.";
public string StateOrRegion => "Sintra, Portugal";
public string EmailAddress => string.Empty;
public string TwitterHandle => "claudioessilva";
public string GravatarHash => "c01100dc9b797cc424e48ca9c5ecb76f";
public string GitHubHandle => "claudioessilva";
public GeoPosition Position => new GeoPosition(38.754074938, -9.2808723);
public Uri WebSite => new Uri("https://claudioessilva.eu");
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://claudioessilva.eu/category/powershell/feed/"); }
}
public string FeedLanguageCode => "en";
}
}
| mit | C# |
cd027aec31d3e9d22dcb439c2acf960cb8db007b | Update MikeFRobbins.cs | planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell | src/Firehose.Web/Authors/MikeFRobbins.cs | src/Firehose.Web/Authors/MikeFRobbins.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class MikeFRobbins : IAmAMicrosoftMVP
{
public string FirstName => "Mike";
public string LastName => "Robbins";
public string ShortBioOrTagLine => "is the leader and co-founder of the Mississippi PowerShell User Group.";
public string StateOrRegion => "Mississippi, USA";
public string EmailAddress => "";
public string TwitterHandle => "mikefrobbins";
public string GitHubHandle => "mikefrobbins";
public string GravatarHash => "e809f9f3d1f46f219c3a28b2fd7dbf83";
public GeoPosition Position => new GeoPosition(32.3643100, -88.7036560);
public Uri WebSite => new Uri("https://mikefrobbins.com/");
public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://mikefrobbins.com/index.xml"); } }
public string FeedLanguageCode => "en";
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class MikeFRobbins : IAmAMicrosoftMVP, IFilterMyBlogPosts
{
public string FirstName => "Mike";
public string LastName => "Robbins";
public string ShortBioOrTagLine => "is the leader and co-founder of the Mississippi PowerShell User Group.";
public string StateOrRegion => "Mississippi, USA";
public string EmailAddress => "";
public string TwitterHandle => "mikefrobbins";
public string GitHubHandle => "mikefrobbins";
public string GravatarHash => "e809f9f3d1f46f219c3a28b2fd7dbf83";
public GeoPosition Position => new GeoPosition(32.3643100, -88.7036560);
public Uri WebSite => new Uri("https://mikefrobbins.com/");
public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://mikefrobbins.com/feed/"); } }
public bool Filter(SyndicationItem item)
{
return item.Categories?.Any(c => c.Name.ToLowerInvariant().Contains("powershell")) ?? false;
}
public string FeedLanguageCode => "en";
}
} | mit | C# |
591c1e4ea2b2af0d1bbc3b5c21fb164b1e1d4b41 | Update AssemblyInfo | OkraFramework/Okra.Data | src/Okra.Data/Properties/AssemblyInfo.cs | src/Okra.Data/Properties/AssemblyInfo.cs | using System.Resources;
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("Okra App Framework (Data Framework)")]
[assembly: AssemblyDescription("The Okra App Framework is designed to support the development of .Net Windows 8 applications, in particular those following the MVVM pattern. This package contains the data assembly.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Andrew Wilkinson")]
[assembly: AssemblyProduct("Okra.Data")]
[assembly: AssemblyCopyright("Copyright © Andrew Wilkinson 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.6.0")]
[assembly: AssemblyFileVersion("0.9.6.0")]
[assembly: AssemblyInformationalVersion("0.9.6")]
| using System.Resources;
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("Okra.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Okra.Data")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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")]
| apache-2.0 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.