本文整理汇总了C#中RecorderContext类的典型用法代码示例。如果您正苦于以下问题:C# RecorderContext类的具体用法?C# RecorderContext怎么用?C# RecorderContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecorderContext类属于命名空间,在下文中一共展示了RecorderContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnFieldMatch
protected override NextInstruction OnFieldMatch(RecorderContext context, string source, ref Match match)
{
var ins=baseRecorder.OnFieldMatchPublic(context, source, ref match);
if (ins == NextInstruction.Return)
context.FieldBuffer[context.SourceHeaderInfo["__full_text"]] = source;
return ins;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:7,代码来源:PaloAltoUnifiedSyslogRecorder.cs
示例2: OnBeforeProcessRecordInput
protected override NextInstruction OnBeforeProcessRecordInput(RecorderContext context)
{
if (context.HeaderInfo != null) return base.OnBeforeProcessRecordInput(context);
Exception error = null;
var ins = GetHeaderInfo(context, ref error);
return (ins & NextInstruction.Continue) != NextInstruction.Continue ? ins : base.OnBeforeProcessRecordInput(context);
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:7,代码来源:PaloAltoUnifiedSyslogRecorder.cs
示例3: InputTextType
public override RecordInputType InputTextType(RecorderContext context, ref Exception error)
{
var rec = context.InputRecord as TextRecord;
if (rec == null || rec.RecordText == null)
return RecordInputType.Unknown;
return RecordInputType.Record;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:8,代码来源:VeriBranchUnifiedRecorder.cs
示例4: TerminalRemoteFileSystemInfo
public TerminalRemoteFileSystemInfo(RecorderContext context, string fullName, string name)
{
Context = context;
this.fullName = fullName;
this.name = name;
exists = new ObjectValue<int>(-1);
directory = new ObjectValue<RecorderFileSystemInfo>();
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:8,代码来源:TerminalRemoteFileSystemInfo.cs
示例5: GetHeaderInfo
public override NextInstruction GetHeaderInfo(RecorderContext context, ref Exception error)
{
var ins = base.GetHeaderInfo(context, ref error);
if ((ins & NextInstruction.Do) == NextInstruction.Do)
{
context.FieldMappingIndexLookup = CreateFieldMappingIndexLookup(context.HeaderInfo, context, GetFieldMappingsFields());
}
return ins;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:11,代码来源:CiscoDevSyslogUnifiedRecorder.cs
示例6: GetHeaderInfo
public override NextInstruction GetHeaderInfo(RecorderContext context, ref Exception error)
{
if (MappingInfos == null) return NextInstruction.Do;
foreach (var mappingInfo in MappingInfos)
{
context.SourceHeaderInfo = MimicMappingInfo(mappingInfo.Mappings);
context.HeaderInfo = RecordFields2Info(MappingInfos, context.SourceHeaderInfo);
break;
}
return NextInstruction.Do;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:11,代码来源:NetscalerTapuUnifiedRecorder.cs
示例7: OnFieldMatch
protected override NextInstruction OnFieldMatch(RecorderContext context, string source, ref Match match)
{
if (!match.Success) return NextInstruction.Skip;
var groupCollection = match.Groups;
foreach (var key in RegSplitForValue.GetGroupNames())
{
int tmp;
if (int.TryParse(key, out tmp)) continue;
if (context.SourceHeaderInfo.ContainsKey(key))
context.FieldBuffer[context.SourceHeaderInfo[key]] = groupCollection[key].Value;
}
return NextInstruction.Return;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:14,代码来源:XferUnifiedRecorder.cs
示例8: InputTextType
public override RecordInputType InputTextType(RecorderContext context, ref Exception error)
{
var ctx = context as TerminalRecorderContext;
if (ctx == null)
{
error = new Exception("Context is not TerminalRecorderContext or null");
return RecordInputType.Error;
}
var line = context.InputRecord.ToString();
if (line == ctx.Keyword)
{
if (ctx.WaitBegin)
{
ctx.Keyword = "END" + ctx.Keyword.Substring(5);
ctx.WaitBegin = false;
return RecordInputType.Comment;
}
return RecordInputType.EndOfStream;
}
if (ctx.WaitBegin)
return RecordInputType.Comment;
if (line.StartsWith("0;"))
{
var index = line.IndexOf(';', 2);
if (++index < line.Length)
{
context.InputRecord.SetValue(line.Substring(index));
return RecordInputType.Record;
}
error = new Exception("Unexpected record line. No Record order after 0;");
}
else
{
var regErr = new Regex("^[0-9]+;[0-9]+;.", RegexOptions.Compiled);
var sb = new StringBuilder();
do
{
var m = regErr.Match(line);
sb.Append(m.Success ? line.Substring(m.Length) : line);
if (context.ReadRecord(ref error) <= 0)
break;
line = context.InputRecord.ToString();
if (line == ctx.Keyword)
break;
} while (true);
context.InputRecord.SetValue(sb.ToString());
}
return RecordInputType.Error;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:49,代码来源:TerminalRecorder.cs
示例9: InputTextType
public override RecordInputType InputTextType(RecorderContext context, ref Exception error)
{
var rec = context.InputRecord as TextRecord;
if (rec == null || rec.RecordText == null)
return RecordInputType.Unknown;
if (rec.RecordText.Length == 0)
return RecordInputType.Comment;
if (context.InputRecord.ToString().StartsWith("#"))
{
if (context.InputRecord.ToString().StartsWith("#Fields: "))
return RecordInputType.Header;
return RecordInputType.Comment;
}
return RecordInputType.Record;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:15,代码来源:IisUnifiedRecorder.cs
示例10: OnFieldMatch
protected override NextInstruction OnFieldMatch(RecorderContext context, string source, ref Match match)
{
if (!match.Success) return NextInstruction.Skip;
var groupCollection = match.Groups;
foreach (var key in RegSplitForAll.GetGroupNames())
{
try
{
int tmp;
if (int.TryParse(key, out tmp)) continue;
int fieldBufferKey;
if (context.SourceHeaderInfo.TryGetValue(key, out fieldBufferKey))
context.FieldBuffer[context.SourceHeaderInfo[key]] = groupCollection[key].Value;
}
catch (Exception exception)
{
Console.Out.WriteLine(exception.Message);
}
}
return NextInstruction.Return;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:22,代码来源:WebwasherUnifiedRecorder.cs
示例11: CreateFileSystemInfo
protected override RecorderFileSystemInfo CreateFileSystemInfo(RecorderContext context, string fullName)
{
return new TerminalRemoteFileSystemInfo(context, fullName, FileSystemHelper.FileNameOf(fullName, context.DirectorySeparatorChar));
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:4,代码来源:TerminalRecorder.cs
示例12: OnFieldMatch
protected override NextInstruction OnFieldMatch(RecorderContext context, string source, ref Match match)
{
while (match.Success)
{
if (context.SourceHeaderInfo.ContainsKey(match.Groups[1].Value))
context.FieldBuffer[context.SourceHeaderInfo[match.Groups[1].Value]] = match.Groups[2].Value;
match = match.NextMatch();
}
return NextInstruction.Return;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:10,代码来源:FortigateUnifiedRecorder.cs
示例13: OnFieldMatch
protected override NextInstruction OnFieldMatch(RecorderContext context, string source, ref Match match)
{
if (!match.Success) return NextInstruction.Skip;
var groupCollection = match.Groups;
foreach (var key in RegSplitForAll.GetGroupNames())
{
int tmp;
if (int.TryParse(key, out tmp)) continue;
if (!context.SourceHeaderInfo.ContainsKey(key)) continue;
if (groupCollection[key].Value.Length > 0)
context.FieldBuffer[context.SourceHeaderInfo[key]] = groupCollection[key].Value;
}
match = match.NextMatch();
while (match.Success)
{
if (context.SourceHeaderInfo.ContainsKey(match.Groups["x"].Value))
context.FieldBuffer[context.SourceHeaderInfo[match.Groups["x"].Value]] = match.Groups["y"].Value;
match = match.NextMatch();
}
context.FieldBuffer[context.SourceHeaderInfo["Description"]] = source;
return NextInstruction.Return;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:26,代码来源:NetscalerTapuUnifiedRecorder.cs
示例14: GetHeaderText
protected override string GetHeaderText(RecorderContext context)
{
return string.Empty;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:4,代码来源:NetscalerUnifiedRecorder.cs
示例15: GetHeaderText
protected override string GetHeaderText(RecorderContext context)
{
return baseRecorder.GetHeaderTextPublic(context);
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:4,代码来源:PaloAltoUnifiedSyslogRecorder.cs
示例16: OnFieldMatch
protected override NextInstruction OnFieldMatch(RecorderContext context, string source, ref Match match)
{
try
{
if (!match.Success) return NextInstruction.Skip;
var datetime = false;
while (match.Success)
{
if (!datetime) context.FieldBuffer[context.SourceHeaderInfo["Datetime"]] = match.Groups["Datetime"].Value;
datetime = true;
if (context.SourceHeaderInfo.ContainsKey(match.Groups[1].Value))
context.FieldBuffer[context.SourceHeaderInfo[match.Groups[1].Value]] = match.Groups[2].Value;
match = match.NextMatch();
}
context.FieldBuffer[context.SourceHeaderInfo["Description"]] = source;
return NextInstruction.Return;
}
catch (Exception e)
{
Console.WriteLine("Error while processing veribranch record: " + e);
return NextInstruction.Abort;
}
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:23,代码来源:RadiusUnifiedRecorder.cs
示例17: CreateDirectoryInfo
protected override RecorderFileSystemInfo CreateDirectoryInfo(RecorderContext context, string absoluteName)
{
return new TerminalRemoteFileSystemInfo(context, absoluteName, FileSystemHelper.FileNameOf(absoluteName, context.DirectorySeparatorChar)) { Context = context as TerminalRecorderContext };
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:4,代码来源:TerminalRecorder.cs
示例18: OnBeforeSetData
protected override NextInstruction OnBeforeSetData(RecorderContext context)
{
var ins = base.OnBeforeSetData(context);
if (ins != NextInstruction.Do)
return ins;
if (string.IsNullOrEmpty(context.Record.ComputerName))
context.Record.ComputerName = remoteHost;
if (string.IsNullOrEmpty(context.Record.CustomStr10))
context.Record.CustomStr10 = IisType;
return NextInstruction.Do;
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:11,代码来源:IisUnifiedRecorder.cs
示例19: OnBeforeSetData
protected override NextInstruction OnBeforeSetData(RecorderContext context)
{
context.Record.Description = context.InputRecord.ToString();
return base.OnBeforeSetData(context);
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:5,代码来源:LabrisNetworkSyslogUnifiedRecorder.cs
示例20: GetHeaderText
protected override string GetHeaderText(RecorderContext context)
{
return context.InputRecord.ToString().Substring(8);
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:4,代码来源:IisUnifiedRecorder.cs
注:本文中的RecorderContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论