当前位置: 首页>>代码示例>>C#>>正文


C# RecWrapper类代码示例

本文整理汇总了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);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:7,代码来源:CryptTechUnifiedRecorder.cs

示例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;
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:27,代码来源:WebsenseDlpUnifiedRecorder.cs

示例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;
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:8,代码来源:IisFtpUnifiedRecorder.cs

示例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;
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:8,代码来源:WamppServerErrorUnifiedRecorder.cs

示例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;
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:8,代码来源:LinuxGeneralPurposeRecorder.cs

示例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;
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:9,代码来源:EndianSyslogUnifiedRecorder.cs

示例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;
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:9,代码来源:Srx3600MobileFwRecorder.cs

示例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);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:11,代码来源:MappedDataHelperUnitTestFixture.cs

示例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;
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:11,代码来源:MerakMailUnifiedRecorder.cs

示例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];
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:11,代码来源:ApacheAccessUnifiedRecorder.cs

示例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
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:12,代码来源:RecorderBaseUnitTest.cs

示例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);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:14,代码来源:TextSizeConstraitUnitTestFixture.cs

示例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);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:14,代码来源:ConstraintCollectionUnitTestFixture.cs

示例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);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:14,代码来源:ConstraintCollectionUnitTestFixture.cs

示例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);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:17,代码来源:WebWasherAuditUnifiedRecorderUnitTest.cs


注:本文中的RecWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。