本文整理汇总了C#中RecWrapper类的典型用法代码示例。如果您正苦于以下问题:C# RecWrapper类的具体用法?C# RecWrapper怎么用?C# RecWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecWrapper类属于命名空间,在下文中一共展示了RecWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Convert2Date
protected object Convert2Date(RecWrapper rec, string field, string[] fieldvalues, object data)
{
DateTime dt;
return !DateTime.TryParseExact(fieldvalues[0], "dd/MMM/yyyy:HH:mm:ss zzzzz", CultureInfo.InvariantCulture,
DateTimeStyles.None, out dt) ? string.Empty : dt.ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
}
示例2: Convert2Byte
protected object Convert2Byte(RecWrapper rec, string field, string[] fieldvalues, object data)
{
var rawValue = string.Empty;
if (fieldvalues.Length >= 1)
rawValue = fieldvalues[0];
var fileSizeRegex = new Regex(@"([\w\S]*)\s*([\w]*)", RegexOptions.Compiled);
var valueMatch = fileSizeRegex.Match(rawValue);
if (valueMatch.Success)
{
var value = valueMatch.Groups[1].Value;
var unit = valueMatch.Groups[2].Value;
double result = double.Parse(value);
switch (unit)
{
case "KB" :
return (int) result*1024;
case "MB" :
return (int) result*1048576;
case "GB" :
return (int) result*1073741824;
}
}
return 0;
}
示例3: Convert2Date
protected object Convert2Date(RecWrapper rec, string field, string[] fieldvalues, object data)
{
DateTime dt;
var dtStr = fieldvalues[0] + " " + fieldvalues[1];
if (DateTime.TryParseExact(dtStr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
return dt.ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
return string.Empty;
}
示例4: Convert2Date
protected static object Convert2Date(RecWrapper rec, string field, string[] values, object data)
{
DateTime dt;
var recorder = data as WamppServerErrorUnifiedRecorder;
return DateTime.TryParseExact(values[0], "ddd MMM dd HH:mm:ss yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None,out dt) ? dt.AddSeconds(recorder == null ? 0 : recorder.Zone).ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture) : string.Empty;
}
示例5: Convert2Date
protected object Convert2Date(RecWrapper rec, string field, string[] values, object data)
{
DateTime dt;
if (DateTime.TryParseExact(values[0], DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
return dt.ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
return string.Empty;
}
示例6: Convert2Date
protected static object Convert2Date(RecWrapper rec, string field, string[] values, object data)
{
DateTime dt;
var recorder = data as EndianSyslogUnifiedRecorder;
var dtStr = values[0];
if (DateTime.TryParseExact(dtStr, "MMM dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
return dt.AddSeconds(recorder == null ? 0 : recorder.zone).ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
return string.Empty;
}
示例7: Convert2Date
protected static object Convert2Date(RecWrapper rec, string field, string[] values, object data)
{
DateTime dt;
var recorder = data as Srx3600MobileFwRecorder;
if (DateTime.TryParseExact(values[0], "yyyy MMM d H:m:s", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
return dt.AddSeconds(recorder == null ? 0 : recorder.Zone).ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
return string.Empty;
}
示例8: ClearRecord_SetValueInRecWrapper_ClearSettedValue
public void ClearRecord_SetValueInRecWrapper_ClearSettedValue()
{
//Arrange
var rec = new RecWrapper {ComputerName = "lorem Ipsum"};
//Act
MappedDataHelper.ClearRecord(rec);
//Assert
Assert.IsNull(rec.ComputerName);
}
示例9: Convert2Date
protected static object Convert2Date(RecWrapper rec, string field, string[] values, object data)
{
DateTime dt;
var recorder = data as MerakMailUnifiedRecorder;
if (DateTime.TryParseExact(values[0], "ddd, dd MMM yyyy HH:mm:ss zzz", CultureInfo.InvariantCulture,
DateTimeStyles.None, out dt))
return dt.AddSeconds(recorder == null ? 0 : recorder.zone)
.ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
return string.Empty;
}
示例10: Convert2IpAddressesSplit
protected static object Convert2IpAddressesSplit(RecWrapper rec, string field, string[] values, object data)
{
if (!string.IsNullOrEmpty(values[0]))
{
var vals = values[0].Split(new[] { ',' }, 2);
if (vals.Length > 1)
rec.CustomStr9 = vals[1];
return vals[0];
}
return values[0];
}
示例11: ClearRecord_IfRecIsNotNull_NotReturn
public void ClearRecord_IfRecIsNotNull_NotReturn()
{
//Arrange
var rec = new RecWrapper();
//Act
// ReSharper disable ExpressionIsAlwaysNull
MethodTestHelper.RunInstanceMethod<RecorderBase>("ClearRecord", _recorderBase, new object[] { rec });
// ReSharper restore ExpressionIsAlwaysNull
//Assert
}
示例12: Apply_IfTargetAndContextIsNotNull_ReturnNextInstructionDo
public void Apply_IfTargetAndContextIsNotNull_ReturnNextInstructionDo()
{
//Arrange
var target = new RecWrapper();
object context = "lorem ipsum";
var pro = new TextProperty();
//Act
// ReSharper disable ExpressionIsAlwaysNull
var actual = st.Apply(target, context);
// ReSharper restore ExpressionIsAlwaysNull
//Assert
Assert.AreEqual(actual, NextInstruction.Do);
}
示例13: Apply_IfConstraintsIsNull_ReturnNextInstructionDo
public void Apply_IfConstraintsIsNull_ReturnNextInstructionDo()
{
//Arrange
FieldTestHelper.SetInstanceFieldValue("Constraints", _constraintCollection, null);
var recWrapper = new RecWrapper();
object context = null;
//Act
// ReSharper disable ExpressionIsAlwaysNull
var actual = _constraintCollection.Apply(recWrapper, context);
// ReSharper restore ExpressionIsAlwaysNull
//Assert
Assert.AreEqual(NextInstruction.Do, actual);
}
示例14: Apply_IfConstraintsAreEmpty_ReturnNextInstructionDo
public void Apply_IfConstraintsAreEmpty_ReturnNextInstructionDo()
{
//Arrange
var target = new RecWrapper();
object context = null;
//Act
// ReSharper disable ExpressionIsAlwaysNull
var actual = _constraintCollection.Apply(target, context);
// ReSharper restore ExpressionIsAlwaysNull
//Assert
Assert.AreEqual(NextInstruction.Do, actual);
}
示例15: Convert2Date_IfDataIsEmpty_ReturnStringEmpty
public void Convert2Date_IfDataIsEmpty_ReturnStringEmpty()
{
//Arrange
var rec = new RecWrapper();
string field = null;
string[] values = {String.Empty};
object data = null;
//Act
// ReSharper disable ExpressionIsAlwaysNull
var actual = MethodTestHelper.RunInstanceMethod<WebwasherAuditUnifiedRecorder, object >("Convert2Date", _webWasherAuditUnifiedRecorder, new[] { rec, field, values, data });
// ReSharper restore ExpressionIsAlwaysNull
//Assert
Assert.AreEqual(actual, String.Empty);
}