本文整理汇总了C#中IProcessingContext类的典型用法代码示例。如果您正苦于以下问题:C# IProcessingContext类的具体用法?C# IProcessingContext怎么用?C# IProcessingContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProcessingContext类属于命名空间,在下文中一共展示了IProcessingContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BeforeProcessAsync
/// <summary>
/// Interception called before invoking the handler to process the request.
/// </summary>
/// <param name="context">The processing context.</param>
/// <param name="token">The cancellation token.</param>
/// <returns>
/// A task.
/// </returns>
public Task BeforeProcessAsync(IProcessingContext context, CancellationToken token)
{
Contract.Requires(context != null);
Contract.Ensures(Contract.Result<Task>() != null);
return Contract.Result<Task>();
}
开发者ID:movileanubeniamin,项目名称:kephas,代码行数:15,代码来源:IRequestProcessingFilter.cs
示例2: ProcessAsync
/// <summary>
/// Processes the provided request asynchronously and returns a response promise.
/// </summary>
/// <param name="request">The request to be handled.</param>
/// <param name="context">The processing context.</param>
/// <param name="token">The cancellation token.</param>
/// <returns>
/// The response promise.
/// </returns>
public Task<IResponse> ProcessAsync(IRequest request, IProcessingContext context, CancellationToken token)
{
Contract.Requires(request != null);
Contract.Requires(context != null);
Contract.Ensures(Contract.Result<Task<IResponse>>() != null);
return Contract.Result<Task<IResponse>>();
}
开发者ID:movileanubeniamin,项目名称:kephas,代码行数:17,代码来源:IRequestHandler.cs
示例3: EnrichConstructor
public void EnrichConstructor(IProcessingContext context, ConstructorInfo ctor)
{
XmlDocReader reader = this.GetDocReader(ctor.DeclaringType.Assembly);
if (reader != null)
{
XElement element = reader.GetDocComments(ctor);
if (element != null)
this.RewriteXml(context, ctor.ReflectedType.Assembly, element, "param", "typeparam");
}
}
开发者ID:ppittle,项目名称:LBi.LostDoc,代码行数:10,代码来源:XmlDocEnricher.cs
示例4: EnrichType
public void EnrichType(IProcessingContext context, Type type)
{
XmlDocReader reader = this.GetDocReader(type.Assembly);
if (reader != null)
{
XElement element = reader.GetDocComments(type);
if (element != null)
this.RewriteXml(context, type.Assembly, element, "typeparam");
}
}
开发者ID:ppittle,项目名称:LBi.LostDoc,代码行数:10,代码来源:XmlDocEnricher.cs
示例5: EnrichParameter
public void EnrichParameter(IProcessingContext context, ParameterInfo parameter)
{
XmlDocReader reader = this.GetDocReader(context, parameter.Member.ReflectedType.Assembly);
if (reader != null)
{
XElement element = reader.GetDocComments(parameter);
if (element != null)
this.RewriteXmlContent(context, parameter.Member.ReflectedType.Assembly, "summary", element);
}
}
开发者ID:LBiNetherlands,项目名称:LBi.LostDoc,代码行数:10,代码来源:XmlDocEnricher.cs
示例6: EnrichParameter
public void EnrichParameter(IProcessingContext context, ParameterInfo parameter)
{
XmlDocReader reader = this.GetDocReader(parameter.Member.DeclaringType.Assembly);
if (reader != null)
{
XNamespace ns = "urn:doc";
XElement element = reader.GetDocComments(parameter);
if (element != null)
this.RewriteXmlContent(context, "summary", element);
}
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:11,代码来源:XmlDocEnricher.cs
示例7: InstallSecurity
public new void InstallSecurity(string path, IProcessingContext context)
{
Assert.ArgumentNotNullOrEmpty(path, "path");
Assert.ArgumentNotNull((object)context, "context");
Log.Info("Installing security from package: " + path, (object)this);
PackageReader packageReader = new PackageReader(path);
AccountInstaller accountInstaller = new AccountInstaller();
accountInstaller.Initialize(context);
packageReader.Populate((ISink<PackageEntry>)accountInstaller);
accountInstaller.Flush();
accountInstaller.Finish();
}
开发者ID:ASOS,项目名称:Sitecore.Ship,代码行数:12,代码来源:ShipInstaller.cs
示例8: GenerateEventElement
private XElement GenerateEventElement(IProcessingContext context, AssetIdentifier assetId)
{
EventInfo eventInfo = (EventInfo)context.AssetResolver.Resolve(assetId);
XElement ret = new XElement("event",
new XAttribute("name", eventInfo.Name),
new XAttribute("assetId", assetId),
new XAttribute("phase", context.Phase));
GenerateTypeRef(context.Clone(ret), eventInfo.EventHandlerType);
MethodInfo addMethod = eventInfo.GetAddMethod(true);
MethodInfo removeMethod = eventInfo.GetRemoveMethod(true);
if (addMethod != null)
{
var addElem = new XElement("add");
if (addMethod.IsPublic)
addElem.Add(new XAttribute("isPublic", XmlConvert.ToString(addMethod.IsPublic)));
if (addMethod.IsPrivate)
addElem.Add(new XAttribute("isPrivate", XmlConvert.ToString(addMethod.IsPrivate)));
if (addMethod.IsFamily)
addElem.Add(new XAttribute("isProtected", XmlConvert.ToString(addMethod.IsFamily)));
ret.Add(addElem);
}
if (removeMethod != null)
{
var removeElem = new XElement("remove");
if (removeMethod.IsPublic)
removeElem.Add(new XAttribute("isPublic", XmlConvert.ToString(removeMethod.IsPublic)));
if (removeMethod.IsPrivate)
removeElem.Add(new XAttribute("isPrivate", XmlConvert.ToString(removeMethod.IsPrivate)));
if (removeMethod.IsFamily)
removeElem.Add(new XAttribute("isProtected", XmlConvert.ToString(removeMethod.IsFamily)));
ret.Add(removeElem);
}
context.Element.Add(ret);
this.GenerateImplementsElement(context.Clone(ret), eventInfo);
foreach (IEnricher item in this.Enrichers)
item.EnrichEvent(context.Clone(ret), eventInfo);
return ret;
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:52,代码来源:DocGenerator.cs
示例9: GenerateConstructorElement
private XElement GenerateConstructorElement(IProcessingContext context, AssetIdentifier assetId)
{
ConstructorInfo constructorInfo = (ConstructorInfo)context.AssetResolver.Resolve(assetId);
XElement ret = new XElement("constructor",
new XAttribute("assetId", assetId),
new XAttribute("phase", context.Phase));
if (constructorInfo.IsStatic)
ret.Add(new XAttribute("isStatic", XmlConvert.ToString(constructorInfo.IsStatic)));
if (constructorInfo.IsPublic)
ret.Add(new XAttribute("isPublic", XmlConvert.ToString(constructorInfo.IsPublic)));
if (constructorInfo.IsPrivate)
ret.Add(new XAttribute("isPrivate", XmlConvert.ToString(constructorInfo.IsPrivate)));
if (constructorInfo.IsFamily)
ret.Add(new XAttribute("isProtected", XmlConvert.ToString(constructorInfo.IsFamily)));
context.Element.Add(ret);
foreach (IEnricher item in this.Enrichers)
item.EnrichConstructor(context.Clone(ret), constructorInfo);
ParameterInfo[] methodParams = constructorInfo.GetParameters();
this.GenerateParameterElements(context.Clone(ret), methodParams);
return ret;
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:30,代码来源:DocGenerator.cs
示例10: GenerateImplementsElement
private void GenerateImplementsElement(IProcessingContext context, MemberInfo mInfo)
{
Type declaringType = mInfo.DeclaringType;
if (declaringType.IsGenericType && !declaringType.IsGenericTypeDefinition)
declaringType = declaringType.GetGenericTypeDefinition();
if (!declaringType.IsInterface)
{
Type[] interfaces = declaringType.GetInterfaces();
foreach (Type ifType in interfaces)
{
if (context.IsFiltered(AssetIdentifier.FromMemberInfo(ifType)))
continue;
InterfaceMapping ifMap = declaringType.GetInterfaceMap(ifType);
if (ifMap.TargetType != declaringType)
continue;
var targetMethod =
ifMap.TargetMethods.SingleOrDefault(mi => mi.MetadataToken == mInfo.MetadataToken &&
mi.Module == mInfo.Module);
if (targetMethod != null)
{
int mIx = Array.IndexOf(ifMap.TargetMethods, targetMethod);
AssetIdentifier miAid;
if (ifMap.InterfaceMethods[mIx].DeclaringType.IsGenericType)
{
Type declType = ifMap.InterfaceMethods[mIx].DeclaringType.GetGenericTypeDefinition();
MethodInfo[] allMethods =
declType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance |
BindingFlags.Static);
miAid =
AssetIdentifier.FromMemberInfo(allMethods.Single(mi =>
mi.MetadataToken == ifMap.InterfaceMethods[mIx].MetadataToken &&
mi.Module == ifMap.InterfaceMethods[mIx].Module));
}
else
{
miAid = AssetIdentifier.FromMemberInfo(ifMap.InterfaceMethods[mIx]);
}
context.Element.Add(new XElement("implements", new XAttribute("member", miAid)));
context.AddReference(miAid);
}
}
}
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:51,代码来源:DocGenerator.cs
示例11: GenerateTypeParamElement
private void GenerateTypeParamElement(IProcessingContext context, MemberInfo mInfo, Type tp)
{
// AssetIdentifier assetId = AssetIdentifier.FromType(mInfo, tp);
var tpElem = new XElement("typeparam",
new XAttribute("name", tp.Name));
context.Element.Add(tpElem);
foreach (Type constraint in tp.GetGenericParameterConstraints())
{
var ctElement = new XElement("constraint");
tpElem.Add(ctElement);
GenerateTypeRef(context.Clone(ctElement), constraint);
}
// enrich typeparam
foreach (IEnricher enricher in this.Enrichers)
enricher.EnrichTypeParameter(context.Clone(tpElem), tp);
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:19,代码来源:DocGenerator.cs
示例12: GenerateNamespaceElement
private XElement GenerateNamespaceElement(IProcessingContext context, AssetIdentifier assetId)
{
string ns = (string)context.AssetResolver.Resolve(assetId);
var ret = new XElement("namespace",
new XAttribute("name", ns),
new XAttribute("assetId", assetId),
new XAttribute("phase", context.Phase));
context.Element.Add(ret);
foreach (IEnricher enricher in this._enrichers)
enricher.EnrichNamespace(context.Clone(ret), ns);
return ret;
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:15,代码来源:DocGenerator.cs
示例13: GenerateTypeRef
public static void GenerateTypeRef(IProcessingContext context, Type pType, string attrName = null)
{
if (pType.IsArray)
{
var arrayElem = new XElement("arrayOf", new XAttribute("rank", pType.GetArrayRank()));
context.Element.Add(arrayElem);
GenerateTypeRef(context.Clone(arrayElem), pType.GetElementType());
}
else
{
if (pType.IsGenericParameter)
context.Element.Add(new XAttribute("param", pType.Name));
else if (pType.IsGenericType)
{
AssetIdentifier aid = AssetIdentifier.FromType(pType.GetGenericTypeDefinition());
context.AddReference(aid);
context.Element.Add(new XAttribute(attrName ?? "type", aid));
foreach (Type genArg in pType.GetGenericArguments())
{
XElement argElem = new XElement("with");
GenerateTypeRef(context.Clone(argElem), genArg);
context.Element.Add(argElem);
}
}
else
{
AssetIdentifier aid = AssetIdentifier.FromMemberInfo(pType);
context.AddReference(aid);
context.Element.Add(new XAttribute(attrName ?? "type", aid));
}
}
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:34,代码来源:DocGenerator.cs
示例14: EnrichMethod
public void EnrichMethod(IProcessingContext context, MethodInfo mInfo)
{
GenerateAttributeElements(context, mInfo.GetCustomAttributesData());
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:4,代码来源:AttributeDataEnricher.cs
示例15: RegisterNamespace
public void RegisterNamespace(IProcessingContext context)
{
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:3,代码来源:AttributeDataEnricher.cs
示例16: GenerateAttributeElements
private static void GenerateAttributeElements(IProcessingContext context,
IEnumerable<CustomAttributeData> attrData)
{
foreach (CustomAttributeData custAttr in attrData)
{
context.AddReference(AssetIdentifier.FromMemberInfo(custAttr.Constructor));
var attrElem = new XElement("attribute",
new XAttribute("type",
AssetIdentifier.FromMemberInfo(
custAttr.Constructor.
ReflectedType ??
custAttr.Constructor.
DeclaringType)),
new XAttribute("constructor",
AssetIdentifier.FromMemberInfo(custAttr.Constructor)));
foreach (CustomAttributeTypedArgument cta in custAttr.ConstructorArguments)
{
if (cta.Value is ReadOnlyCollection<CustomAttributeTypedArgument>)
{
AssetIdentifier elementAssetId =
AssetIdentifier.FromMemberInfo(cta.ArgumentType.GetElementType());
context.AddReference(elementAssetId);
attrElem.Add(new XElement("argument",
new XElement("array",
new XAttribute("type", elementAssetId),
((IEnumerable<CustomAttributeTypedArgument>)cta.Value).
Select(
ata =>
new XElement("element",
GenerateAttributeArgument(
context,
ata))))));
}
else
{
attrElem.Add(new XElement("argument",
GenerateAttributeArgument(context, cta)));
}
}
foreach (CustomAttributeNamedArgument cta in custAttr.NamedArguments)
{
AssetIdentifier namedMember = AssetIdentifier.FromMemberInfo(cta.MemberInfo);
context.AddReference(namedMember);
if (cta.TypedValue.Value is ReadOnlyCollection<CustomAttributeTypedArgument>)
{
context.AddReference(namedMember);
AssetIdentifier elementAssetId =
AssetIdentifier.FromMemberInfo(cta.TypedValue.ArgumentType.GetElementType());
context.AddReference(elementAssetId);
attrElem.Add(new XElement("argument",
new XAttribute("member", namedMember),
new XElement("array",
new XAttribute("type", elementAssetId),
((IEnumerable<CustomAttributeTypedArgument>)
cta.TypedValue.Value).Select(
ata =>
new XElement("element",
GenerateAttributeArgument
(context,
ata))))));
}
else
{
attrElem.Add(new XElement("argument",
new XAttribute("member", namedMember),
GenerateAttributeArgument(context, cta.TypedValue)));
}
}
context.Element.Add(attrElem);
}
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:77,代码来源:AttributeDataEnricher.cs
示例17: BuildProjectFile
// -------------------------------------------------------------------
// Public
// -------------------------------------------------------------------
public void BuildProjectFile(IList<CarbonFileResult> sources, CarbonFile target, IProcessingContext context)
{
Diagnostic.Info("Building {0} Sources into {2}", sources.Count, target);
}
开发者ID:Craiel,项目名称:CarbonProjects,代码行数:7,代码来源:BuildLogic.cs
示例18: EnrichField
public void EnrichField(IProcessingContext context, FieldInfo fieldInfo)
{
GenerateAttributeElements(context, fieldInfo.GetCustomAttributesData());
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:4,代码来源:AttributeDataEnricher.cs
示例19: GenerateAssemblyElement
private XElement GenerateAssemblyElement(IProcessingContext context, AssetIdentifier assetId)
{
Assembly asm = (Assembly)context.AssetResolver.Resolve(assetId);
var ret = new XElement("assembly",
new XAttribute("name", asm.GetName().Name),
new XAttribute("filename", asm.ManifestModule.Name),
new XAttribute("assetId", assetId),
new XAttribute("phase", context.Phase),
asm.GetReferencedAssemblies().Select(
an =>
new XElement("references",
new XAttribute("assembly",
AssetIdentifier.
FromAssembly(
Assembly
.
ReflectionOnlyLoad
(an
.
FullName))))));
context.Element.Add(ret);
foreach (IEnricher enricher in this._enrichers)
enricher.EnrichAssembly(context.Clone(ret), asm);
return ret;
}
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:31,代码来源:DocGenerator.cs
示例20: EnrichProperty
public void EnrichProperty(IProcessingContext context, PropertyInfo propertyInfo)
{
GenerateAttributeElements(context, propertyInfo.GetCustomAttributesData());
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:4,代码来源:AttributeDataEnricher.cs
注:本文中的IProcessingContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论