Here are the examples of the csharp api long.ToString() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2951 Examples
19
Source : FileLoader.cs
with MIT License
from allenwp
with MIT License
from allenwp
public static void SaveTextFile(string relativePath, string contents, bool backupExisting = false)
{
string fullPath = FullPath(relativePath);
Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
if (backupExisting && File.Exists(fullPath))
{
string backupFolder = FullPath(Path.Combine("Backup", relativePath));
Directory.CreateDirectory(backupFolder);
string backupFilePath = Path.Combine(backupFolder, DateTime.UtcNow.ToFileTimeUtc().ToString());
File.Copy(fullPath, backupFilePath);
string[] files = Directory.GetFiles(backupFolder);
Array.Sort(files);
int maxToDelete = files.Length - 10;
for (int i = 0; i < maxToDelete; i++)
{
File.Delete(Path.Combine(backupFolder, files[i]));
}
}
File.WriteAllText(fullPath, contents);
textFileCache[relativePath.ToLower()] = contents;
}
19
Source : SharedKeyAuthHandler.cs
with Apache License 2.0
from aloneguid
with Apache License 2.0
from aloneguid
private static string GetAuthSignature(HttpRequestMessage request,
string accountName, string accountKey,
string ifMatch = "",
string md5 = "")
{
long? contentLength = request.Content?.Headers.ContentLength;
string scl = (contentLength == null || contentLength == 0) ? string.Empty : contentLength.Value.ToString();
//todo: sign content-type
// This is the raw representation of the message signature.
string messageSignature = request.Method + "\n" +
"\n" + // Content-Encoding
"\n" + // Content-Language
scl + "\n" + // Content-Length
md5 + "\n" + // Content-MD5
request.Content?.Headers.ContentType + "\n" + // Content-Type
"\n" + // Date
"\n" + // If-Modified-Since
ifMatch + "\n" + // If-Match
"\n" + // If-None-Match
"\n" + // If-Unmodified-Since
"\n" + // Range
GetCanonicalizedHeaders(request) + // already includes newline at the end
GetCanonicalizedResource(request.RequestUri, accountName);
// Now turn it into a byte array.
byte[] SignatureBytes = Encoding.UTF8.GetBytes(messageSignature);
// Create the HMACSHA256 version of the storage key.
HMACSHA256 SHA256 = new HMACSHA256(Convert.FromBase64String(accountKey));
// Compute the hash of the SignatureBytes and convert it to a base64 string.
return Convert.ToBase64String(SHA256.ComputeHash(SignatureBytes));
}
19
Source : RoleAppService.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
public async Task<AppSrvResult> DeleteAsync(long id)
{
if (id == 1600000000010)
return Problem(HttpStatusCode.Forbidden, "禁止删除初始角色");
if (await _userRepository.AnyAsync(x => x.RoleIds == id.ToString()))
return Problem(HttpStatusCode.Forbidden, "有用户使用该角色,禁止删除");
await _roleRepository.DeleteAsync(id);
return AppSrvResult();
}
19
Source : RedisCahceTests.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
[Fact]
public void TestString()
{
var key = nameof(TestString).ToLower();
var value = DateTime.Now.Ticks;
var result = _redisProvider.StringSet(key, value.ToString(), TimeSpan.FromSeconds(10));
replacedert.True(result);
var actual = _redisProvider.StringGet(key);
replacedert.Equal(value.ToString(), actual);
}
19
Source : DataTimeExtension.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
public static string GetTimeDelay(this in DateTime dtStar, DateTime dtEnd)
{
long lTicks = (dtEnd.Ticks - dtStar.Ticks) / 10000000;
string sTemp = (lTicks / 3600).ToString().PadLeft(2, '0') + ":";
sTemp += (lTicks % 3600 / 60).ToString().PadLeft(2, '0') + ":";
sTemp += (lTicks % 3600 % 60).ToString().PadLeft(2, '0');
return sTemp;
}
19
Source : CacheService.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
internal async Task<UserValidateDto> GetUserValidateInfoFromCacheAsync(long Id)
{
var cacheKey = ConcatCacheKey(CachingConsts.UserValidateInfoKeyPrefix, Id.ToString());
var cacheValue = await _cache.Value.GetAsync(cacheKey, async () =>
{
return await _userRepository.Value.FetchAsync(x => new UserValidateDto()
{
Id = x.Id,
Account = x.Account,
Status = x.Status,
Name = x.Name,
RoleIds = x.RoleIds,
ValidationVersion = HashHelper.GetHashedString(HashType.MD5, x.Account + x.Preplacedword)
}, x => x.Id == Id);
}, TimeSpan.FromSeconds(_jwtConfig.Value.Value.Expire * 60 + _jwtConfig.Value.Value.ClockSkew));
return cacheValue.Value;
}
19
Source : SharedServicesRegistration.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
public virtual void AddEventBusSubscribers<TSubscriber>()
where TSubscriber : clreplaced, ICapSubscribe
{
var tableNamePrefix = "Cap";
var groupName = $"cap.{_serviceInfo.ShortName}.{_environment.EnvironmentName.ToLower()}";
//add skyamp
_services.AddSkyApmExtensions().AddCap();
_services.AddSingleton<TSubscriber>();
var rabbitMqConfig = _configuration.GetRabbitMqSection().Get<RabbitMqConfig>();
_services.AddCap(x =>
{
//如果你使用的 EF 进行数据操作,你需要添加如下配置:
//可选项,你不需要再次配置 x.UseSqlServer 了
x.UseEnreplacedyFramework<AdncDbContext>(option =>
{
option.TableNamePrefix = tableNamePrefix;
});
//CAP支持 RabbitMQ、Kafka、AzureServiceBus 等作为MQ,根据使用选择配置:
x.UseRabbitMQ(option =>
{
option.HostName = rabbitMqConfig.HostName;
option.VirtualHost = rabbitMqConfig.VirtualHost;
option.Port = rabbitMqConfig.Port;
option.UserName = rabbitMqConfig.UserName;
option.Preplacedword = rabbitMqConfig.Preplacedword;
});
x.Version = _serviceInfo.Version;
//默认值:cap.queue.{程序集名称},在 RabbitMQ 中映射到 Queue Names。
x.DefaultGroupName = groupName;
//默认值:60 秒,重试 & 间隔
//在默认情况下,重试将在发送和消费消息失败的 4分钟后 开始,这是为了避免设置消息状态延迟导致可能出现的问题。
//发送和消费消息的过程中失败会立即重试 3 次,在 3 次以后将进入重试轮询,此时 FailedRetryInterval 配置才会生效。
x.FailedRetryInterval = 60;
//默认值:50,重试的最大次数。当达到此设置值时,将不会再继续重试,通过改变此参数来设置重试的最大次数。
x.FailedRetryCount = 50;
//默认值:NULL,重试阈值的失败回调。当重试达到 FailedRetryCount 设置的值的时候,将调用此 Action 回调
//,你可以通过指定此回调来接收失败达到最大的通知,以做出人工介入。例如发送邮件或者短信。
x.FailedThresholdCallback = (failed) =>
{
//todo
};
//默认值:24*3600 秒(1天后),成功消息的过期时间(秒)。
//当消息发送或者消费成功时候,在时间达到 SucceedMessageExpiredAfter 秒时候将会从 Persistent 中删除,你可以通过指定此值来设置过期的时间。
x.SucceedMessageExpiredAfter = 24 * 3600;
//默认值:1,消费者线程并行处理消息的线程数,当这个值大于1时,将不能保证消息执行的顺序。
x.ConsumerThreadCount = 1;
x.UseDashboard(x =>
{
x.PathMatch = $"/{_serviceInfo.ShortName}/cap";
x.Authorization = new IDashboardAuthorizationFilter[] {
new LocalRequestsOnlyAuthorizationFilter()
,
new CapDashboardAuthorizationFilter()
};
});
//必须是生产环境才注册cap服务到consul
if ((_environment.IsProduction() || _environment.IsStaging()))
{
x.UseDiscovery(discoverOptions =>
{
var consulConfig = _configuration.GetConsulSection().Get<ConsulConfig>();
var consulAdderss = new Uri(consulConfig.ConsulUrl);
var hostIps = NetworkInterface
.GetAllNetworkInterfaces()
.Where(network => network.OperationalStatus == OperationalStatus.Up)
.Select(network => network.GetIPProperties())
.OrderByDescending(properties => properties.GatewayAddresses.Count)
.SelectMany(properties => properties.UnicastAddresses)
.Where(address => !IPAddress.IsLoopback(address.Address) && address.Address.AddressFamily == AddressFamily.InterNetwork)
.ToArray();
var currenServerAddress = hostIps.First().Address.MapToIPv4().ToString();
discoverOptions.DiscoveryServerHostName = consulAdderss.Host;
discoverOptions.DiscoveryServerPort = consulAdderss.Port;
discoverOptions.CurrentNodeHostName = currenServerAddress;
discoverOptions.CurrentNodePort = 80;
discoverOptions.NodeId = DateTime.Now.Ticks.ToString();
discoverOptions.NodeName = _serviceInfo.FullName.Replace("webapi", "cap");
discoverOptions.MatchPath = $"/{_serviceInfo.ShortName}/cap";
});
}
});
}
19
Source : IdGeneraterTests.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
[Fact]
public void TestSpeed()
{
System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
Parallel.For(1, 1000000, index =>
{
IdGenerater.GetNextId();
});
stopwatch.Stop();
//持续时间: 517 毫秒
_output.WriteLine(stopwatch.ElapsedMilliseconds.ToString());
stopwatch.Reset();
}
19
Source : IdGeneraterTests.cs
with MIT License
from AlphaYu
with MIT License
from AlphaYu
[Fact]
public void TestIdLessThanjJsMaxNumber()
{
long id = IdGenerater.GetNextId();
_output.WriteLine(id.ToString());
replacedert.True(9007199254740992 > id);
}
19
Source : JoplinExportService.cs
with GNU General Public License v3.0
from alxnbl
with GNU General Public License v3.0
from alxnbl
private string AddJoplinAttachmentMetadata(Attachements attach)
{
var sb = new StringBuilder();
sb.Append($"{attach.ExportFileName}\n");
var data = new Dictionary<string, string>();
data["id"] = attach.Id;
data["mime"] = MimeTypes.GetMimeType(attach.ExportFilePath);
data["filename"] = attach.FriendlyFileName;
data["updated_time"] = attach.Parent.LastModificationDate.ToString("s");
data["user_updated_time"] = attach.Parent.LastModificationDate.ToString("s");
data["created_time"] = attach.Parent.CreationDate.ToString("s");
data["user_created_time"] = attach.Parent.CreationDate.ToString("s");
data["file_extension"] = Path.GetExtension(attach.ExportFilePath).Replace(".", "");
data["encryption_cipher_text"] = "";
data["encryption_applied"] = "0";
data["encryption_blob_encrypted"] = "0";
data["size"] = new FileInfo(attach.ExportFilePath).Length.ToString();
data["is_shared"] = "0";
data["type_"] = "4";
foreach (var metadata in data)
{
sb.Append($"\n{metadata.Key}: {metadata.Value}");
}
return sb.ToString();
}
19
Source : MergeResultsDialog.cs
with Apache License 2.0
from AmpScm
with Apache License 2.0
from AmpScm
private void PopulateUI()
{
Dictionary<string, List<string>> model = new Dictionary<string, List<string>>();
foreach (SvnNotifyEventArgs snea in MergeActions)
{
string contentAction = "";
string propertyAction = "";
switch (snea.Action)
{
case SvnNotifyAction.Exists:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Existed)))
{
fileExisted++;
contentAction = MergeStrings.Existed;
}
break;
case SvnNotifyAction.Skip:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Skipped)))
{
if (snea.NodeKind == SvnNodeKind.Directory)
fileSkippedDirs++;
else if (snea.NodeKind == SvnNodeKind.File)
fileSkippedFiles++;
contentAction = MergeStrings.Skipped;
}
break;
case SvnNotifyAction.UpdateAdd:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Added)))
{
fileAdded++;
contentAction = MergeStrings.Added;
}
break;
case SvnNotifyAction.UpdateDelete:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Deleted)))
{
fileDeleted++;
contentAction = MergeStrings.Deleted;
}
break;
case SvnNotifyAction.UpdateReplace:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Replaced)))
{
fileAdded++;
contentAction = MergeStrings.Replaced;
}
break;
case SvnNotifyAction.UpdateUpdate:
if (snea.ContentState != SvnNotifyState.None &&
snea.ContentState != SvnNotifyState.Unchanged &&
snea.ContentState != SvnNotifyState.Unknown)
{
switch (snea.ContentState)
{
case SvnNotifyState.Changed:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Modified)))
{
fileUpdated++;
contentAction = MergeStrings.Modified;
}
break;
case SvnNotifyState.Conflicted:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Conflicted)))
{
fileConflicted++;
contentAction = MergeStrings.Conflicted;
}
break;
case SvnNotifyState.Merged:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Text-" + MergeStrings.Merged)))
{
fileMerged++;
contentAction = MergeStrings.Merged;
}
break;
default:
// Do nothing.
break;
}
}
if (snea.PropertyState != SvnNotifyState.None &&
snea.PropertyState != SvnNotifyState.Unchanged &&
snea.PropertyState != SvnNotifyState.Unknown)
{
switch (snea.PropertyState)
{
case SvnNotifyState.Changed:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Prop-" + MergeStrings.Modified)))
{
propertyUpdated++;
propertyAction = MergeStrings.Modified;
}
break;
case SvnNotifyState.Conflicted:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Prop-" + MergeStrings.Conflicted)))
{
propertyConflicted++;
propertyAction = MergeStrings.Conflicted;
}
break;
case SvnNotifyState.Merged:
if (!model.ContainsKey(snea.FullPath) ||
(model.ContainsKey(snea.FullPath) && !model[snea.FullPath].Contains("Prop-" + MergeStrings.Merged)))
{
propertyMerged++;
propertyAction = MergeStrings.Merged;
}
break;
default:
// Do nothing.
break;
}
}
break;
default:
// Do nothing
break;
}
if (model.ContainsKey(snea.FullPath))
{
if (contentAction.Length > 0)
{
if (!model[snea.FullPath].Contains("Text-" + contentAction))
model[snea.FullPath].Add("Text-" + contentAction);
}
if (propertyAction.Length > 0)
{
if (!model[snea.FullPath].Contains("Prop-" + propertyAction))
model[snea.FullPath].Add("Prop-" + propertyAction);
}
}
else
{
if (contentAction.Length > 0 || propertyAction.Length > 0)
{
List<string> l = new List<string>();
if (contentAction.Length > 0)
l.Add("Text-" + contentAction);
if (propertyAction.Length > 0)
l.Add("Prop-" + propertyAction);
model.Add(snea.FullPath, l);
}
}
}
// Calculate Resolved
foreach (KeyValuePair<string, List<SvnConflictType>> resolution in ResolvedMergeConflicts)
{
if (resolution.Value.Contains(SvnConflictType.Content))
fileResolved++;
else if (resolution.Value.Contains(SvnConflictType.Property))
propertyResolved++;
}
// Update File Labels
fileUpdatedValueLabel.Text = fileUpdated.ToString();
fileAddedValueLabel.Text = fileAdded.ToString();
fileExistedValueLabel.Text = fileExisted.ToString();
fileDeletedValueLabel.Text = fileDeleted.ToString();
fileMergedValueLabel.Text = fileMerged.ToString();
fileConflictedValueLabel.Text = fileConflicted.ToString();
fileResolvedValueLabel.Text = fileResolved.ToString();
fileSkippedDirectoriesValueLabel.Text = fileSkippedDirs.ToString();
fileSkippedFilesValueLabel.Text = fileSkippedFiles.ToString();
// Update Property Labels
propertyUpdatedValueLabel.Text = propertyUpdated.ToString();
propertyMergedValueLabel.Text = propertyMerged.ToString();
propertyConflictedValueLabel.Text = propertyConflicted.ToString();
propertyResolvedValueLabel.Text = propertyResolved.ToString();
// Populate the Modified Paths ListView
foreach (KeyValuePair<string, List<string>> item in model)
{
ListViewItem lvi;
string[] row = new string[3];
string contents = "";
string properties = "";
row[0] = item.Key;
foreach (string action in item.Value)
{
if (action.StartsWith("Text"))
{
if (contents.Length == 0)
contents = action.Split('-')[1];
else
contents += (", " + action.Split('-')[1]);
}
else if (action.StartsWith("Prop"))
{
if (properties.Length == 0)
properties = action.Split('-')[1];
else
properties += (", " + action.Split('-')[1]);
}
}
if (contents.Length == 0)
row[1] = MergeStrings.Unchanged;
else
row[1] = contents;
if (properties.Length == 0)
row[2] = MergeStrings.Unchanged;
else
row[2] = properties;
lvi = new ListViewItem(row);
modifiedPathsListView.Items.Add(lvi);
}
}
19
Source : MergeSourceTwoDifferentTreesPage.cs
with Apache License 2.0
from AmpScm
with Apache License 2.0
from AmpScm
private void DisplayLogViewerAndRetrieveRevisions(object sender)
{
string target;
if (sender == fromRevisionSelectButton || (sender == toRevisionSelectButton && useFromURLCheckBox.Checked))
{
target = fromURLTextBox.Text;
}
else if (sender == toRevisionSelectButton)
{
target = toURLTextBox.Text;
}
else
{
return;
}
using (LogViewerDialog dialog = new LogViewerDialog(new SvnOrigin(Context, new Uri(target), null)))
{
dialog.LogControl.StopOnCopy = true;
if (dialog.ShowDialog(Context) == DialogResult.OK)
{
IEnumerable<ISvnLogItem> selected = dialog.SelectedItems;
long low = -1;
long high = -1;
foreach (ISvnLogItem item in selected)
{
// Should happen on first iteration
if (low == -1 && high == -1)
{
low = item.Revision;
high = item.Revision;
continue;
}
if (item.Revision < low)
low = item.Revision;
else if (item.Revision > high)
high = item.Revision;
}
fromRevisionTextBox.Text = low.ToString();
if (useFromURLCheckBox.Checked && high != -1 && high != low)
toRevisionTextBox.Text = high.ToString();
}
}
}
19
Source : UnixTimeConverter.cs
with MIT License
from Analogy-LogViewer
with MIT License
from Analogy-LogViewer
private void dateEdit1_EditValueChanged(object sender, EventArgs e)
{
textEdit1.Text = new DateTimeOffset(dateEdit1.DateTime).ToUnixTimeMilliseconds().ToString();
}
19
Source : UnixTimeConverter.cs
with MIT License
from Analogy-LogViewer
with MIT License
from Analogy-LogViewer
private void sbtnToUnix_Click(object sender, EventArgs e)
{
textEdit1.Text = new DateTimeOffset(dateEdit1.DateTime).ToUnixTimeMilliseconds().ToString();
}
19
Source : IResultExtensions.cs
with Apache License 2.0
from AndcultureCode
with Apache License 2.0
from AndcultureCode
public static void AddErrorAndLog<T>(this IResult<T> result, ILogger logger, string errorKey, string errorMessage, long? resourceIdentifier = null)
{
var methodName = new StackTrace().GetFrame(1).GetMethod().Name;
var logMessage = errorMessage;
result.AddErrorsAndLog<T>(logger, errorKey, errorMessage, logMessage, resourceIdentifier?.ToString(), null, methodName);
}
19
Source : IResultExtensions.cs
with Apache License 2.0
from AndcultureCode
with Apache License 2.0
from AndcultureCode
public static void AddErrorsAndLog<T>(this IResult<T> result, ILogger logger, string errorKey, string errorMessage, long resourceIdentifier, IEnumerable<IError> errors = null)
{
var methodName = new StackTrace().GetFrame(1).GetMethod().Name;
var logMessage = errorMessage;
result.AddErrorsAndLog<T>(logger, errorKey, errorMessage, logMessage, resourceIdentifier.ToString(), errors, methodName);
}
19
Source : IResultExtensions.cs
with Apache License 2.0
from AndcultureCode
with Apache License 2.0
from AndcultureCode
public static void AddErrorAndLog<T>(this IResult<T> result, ILogger logger, IStringLocalizer localizer, string errorKey, long resourceIdentifier, params object[] arguments)
{
var errorMessage = localizer[errorKey, arguments];
var logMessage = localizer.Default(errorKey, arguments);
var methodName = new StackTrace().GetFrame(1).GetMethod().Name;
result.AddErrorsAndLog<T>(logger, errorKey, errorMessage, logMessage, resourceIdentifier.ToString(), null, methodName);
}
19
Source : IResultExtensions.cs
with Apache License 2.0
from AndcultureCode
with Apache License 2.0
from AndcultureCode
public static void AddErrorsAndLog<T>(this IResult<T> result, ILogger logger, IStringLocalizer localizer, string errorKey, long resourceIdentifier, IEnumerable<IError> errors = null, params object[] arguments)
{
var errorMessage = localizer[errorKey, arguments];
var logMessage = localizer.Default(errorKey, arguments);
var methodName = new StackTrace().GetFrame(1).GetMethod().Name;
result.AddErrorsAndLog<T>(logger, errorKey, errorMessage, logMessage, resourceIdentifier.ToString(), errors, methodName);
}
19
Source : SyncObject.cs
with MIT License
from anderm
with MIT License
from anderm
protected virtual void OnDoubleElementChanged(long elementID, double newValue)
{
if (primitiveMap.ContainsKey(elementID))
{
SyncPrimitive primitive = primitiveMap[elementID];
primitive.UpdateFromRemote(newValue);
NotifyPrimitiveChanged(primitive);
}
else
{
LogUnknownElement(elementID.ToString(), newValue.ToString(CultureInfo.InvariantCulture), typeof(double));
}
}
19
Source : SyncObject.cs
with MIT License
from anderm
with MIT License
from anderm
protected virtual void OnBoolElementChanged(long elementID, bool newValue)
{
if (primitiveMap.ContainsKey(elementID))
{
SyncPrimitive primitive = primitiveMap[elementID];
primitive.UpdateFromRemote(newValue);
NotifyPrimitiveChanged(primitive);
}
else
{
LogUnknownElement(elementID.ToString(), newValue.ToString(), typeof(bool));
}
}
19
Source : SyncObject.cs
with MIT License
from anderm
with MIT License
from anderm
protected virtual void OnIntElementChanged(long elementID, int newValue)
{
if (primitiveMap.ContainsKey(elementID))
{
SyncPrimitive primitive = primitiveMap[elementID];
primitive.UpdateFromRemote(newValue);
NotifyPrimitiveChanged(primitive);
}
else
{
LogUnknownElement(elementID.ToString(), newValue.ToString(), typeof(int));
}
}
19
Source : SyncObject.cs
with MIT License
from anderm
with MIT License
from anderm
protected virtual void OnLongElementChanged(long elementID, long newValue)
{
if (primitiveMap.ContainsKey(elementID))
{
SyncPrimitive primitive = primitiveMap[elementID];
primitive.UpdateFromRemote(newValue);
NotifyPrimitiveChanged(primitive);
}
else
{
LogUnknownElement(elementID.ToString(), newValue.ToString(), typeof(long));
}
}
19
Source : SyncObject.cs
with MIT License
from anderm
with MIT License
from anderm
protected virtual void OnFloatElementChanged(long elementID, float newValue)
{
if (primitiveMap.ContainsKey(elementID))
{
SyncPrimitive primitive = primitiveMap[elementID];
primitive.UpdateFromRemote(newValue);
NotifyPrimitiveChanged(primitive);
}
else
{
LogUnknownElement(elementID.ToString(), newValue.ToString(CultureInfo.InvariantCulture), typeof(float));
}
}
19
Source : SyncObject.cs
with MIT License
from anderm
with MIT License
from anderm
protected virtual void OnStringElementChanged(long elementID, XString newValue)
{
if (primitiveMap.ContainsKey(elementID))
{
SyncPrimitive primitive = primitiveMap[elementID];
primitive.UpdateFromRemote(newValue);
NotifyPrimitiveChanged(primitive);
}
else
{
LogUnknownElement(elementID.ToString(), newValue.GetString(), typeof(string));
}
}
19
Source : DecimalValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreEquals(decimal val, long comparer, string key) =>
AreEquals(val, (decimal)comparer, key, FluntErrorMessages.AreEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : DecimalValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreNotEquals(decimal val, long comparer, string key) =>
AreNotEquals(val, (decimal)comparer, key, FluntErrorMessages.AreNotEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : DoubleValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterThan(double val, long comparer, string key) =>
IsGreaterThan(val, comparer, key, FluntErrorMessages.IsGreaterThanErrorMessage(key, comparer.ToString()));
19
Source : DoubleValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterOrEqualsThan(double val, long comparer, string key) =>
IsGreaterOrEqualsThan(val, (double)comparer, key, FluntErrorMessages.IsGreaterOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : DoubleValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerThan(double val, long comparer, string key) =>
IsLowerThan(val, comparer, key, FluntErrorMessages.IsLowerThanErrorMessage(key, comparer.ToString()));
19
Source : DoubleValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerOrEqualsThan(double val, long comparer, string key) =>
IsLowerOrEqualsThan(val, (double)comparer, key, FluntErrorMessages.IsLowerOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : DoubleValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreEquals(double val, long comparer, string key) =>
AreEquals(val, (double)comparer, key, FluntErrorMessages.AreEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : DoubleValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreNotEquals(double val, long comparer, string key) =>
AreNotEquals(val, (double)comparer, key, FluntErrorMessages.AreNotEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : FloatValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterThan(float val, long comparer, string key) =>
IsGreaterThan(val, comparer, key, FluntErrorMessages.IsGreaterThanErrorMessage(key, comparer.ToString()));
19
Source : FloatValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterOrEqualsThan(float val, long comparer, string key) =>
IsGreaterOrEqualsThan(val, (float)comparer, key, FluntErrorMessages.IsGreaterOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : FloatValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerThan(float val, long comparer, string key) =>
IsLowerThan(val, comparer, key, FluntErrorMessages.IsLowerThanErrorMessage(key, comparer.ToString()));
19
Source : FloatValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerOrEqualsThan(float val, long comparer, string key) =>
IsLowerOrEqualsThan(val, (float)comparer, key, FluntErrorMessages.IsLowerOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : FloatValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreEquals(float val, long comparer, string key) =>
AreEquals(val, (float)comparer, key, FluntErrorMessages.AreEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : FloatValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreNotEquals(float val, long comparer, string key) =>
AreNotEquals(val, (float)comparer, key, FluntErrorMessages.AreNotEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : IntValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterThan(int val, long comparer, string key) =>
IsGreaterThan(val, comparer, key, FluntErrorMessages.IsGreaterThanErrorMessage(key, comparer.ToString()));
19
Source : IntValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterOrEqualsThan(int val, long comparer, string key) =>
IsGreaterOrEqualsThan(val, (int)comparer, key, FluntErrorMessages.IsGreaterOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : IntValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerThan(int val, long comparer, string key) =>
IsLowerThan(val, comparer, key, FluntErrorMessages.IsLowerThanErrorMessage(key, comparer.ToString()));
19
Source : IntValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerOrEqualsThan(int val, long comparer, string key) =>
IsLowerOrEqualsThan(val, (int)comparer, key, FluntErrorMessages.IsLowerOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : DecimalValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterThan(decimal val, long comparer, string key) =>
IsGreaterThan(val, comparer, key, FluntErrorMessages.IsGreaterThanErrorMessage(key, comparer.ToString()));
19
Source : DecimalValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterOrEqualsThan(decimal val, long comparer, string key) =>
IsGreaterOrEqualsThan(val, (decimal)comparer, key, FluntErrorMessages.IsGreaterOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : DecimalValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerThan(decimal val, long comparer, string key) =>
IsLowerThan(val, comparer, key, FluntErrorMessages.IsLowerThanErrorMessage(key, comparer.ToString()));
19
Source : DecimalValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsLowerOrEqualsThan(decimal val, long comparer, string key) =>
IsLowerOrEqualsThan(val, (decimal)comparer, key, FluntErrorMessages.IsLowerOrEqualsThanErrorMessage(key, comparer.ToString()));
19
Source : IntValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreEquals(int val, long comparer, string key) =>
AreEquals(val, (int)comparer, key, FluntErrorMessages.AreEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : IntValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> AreNotEquals(int val, long comparer, string key) =>
AreNotEquals(val, (int)comparer, key, FluntErrorMessages.AreNotEqualsErrorMessage(val.ToString(), comparer.ToString()));
19
Source : LongValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterThan(long val, long comparer, string key) =>
IsGreaterThan(val, comparer, key, FluntErrorMessages.IsGreaterThanErrorMessage(key, comparer.ToString()));
19
Source : LongValidationContract.cs
with MIT License
from andrebaltieri
with MIT License
from andrebaltieri
public Contract<T> IsGreaterOrEqualsThan(long val, long comparer, string key) =>
IsGreaterOrEqualsThan(val, comparer, key, FluntErrorMessages.IsGreaterOrEqualsThanErrorMessage(key, comparer.ToString()));
See More Examples