本文整理汇总了C#中System.Web.Services.Protocols.LogicalMethodInfo类的典型用法代码示例。如果您正苦于以下问题:C# LogicalMethodInfo类的具体用法?C# LogicalMethodInfo怎么用?C# LogicalMethodInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogicalMethodInfo类属于System.Web.Services.Protocols命名空间,在下文中一共展示了LogicalMethodInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetInitializers
internal static object[] GetInitializers(LogicalMethodInfo[] methodInfos)
{
if (methodInfos.Length == 0)
{
return new object[0];
}
WebServiceAttribute attribute = WebServiceReflector.GetAttribute(methodInfos);
bool serviceDefaultIsEncoded = SoapReflector.ServiceDefaultIsEncoded(WebServiceReflector.GetMostDerivedType(methodInfos));
XmlReflectionImporter importer = SoapReflector.CreateXmlImporter(attribute.Namespace, serviceDefaultIsEncoded);
WebMethodReflector.IncludeTypes(methodInfos, importer);
ArrayList list = new ArrayList();
bool[] flagArray = new bool[methodInfos.Length];
for (int i = 0; i < methodInfos.Length; i++)
{
LogicalMethodInfo methodInfo = methodInfos[i];
Type returnType = methodInfo.ReturnType;
if (IsSupported(returnType) && HttpServerProtocol.AreUrlParametersSupported(methodInfo))
{
XmlAttributes attributes = new XmlAttributes(methodInfo.ReturnTypeCustomAttributeProvider);
XmlTypeMapping mapping = importer.ImportTypeMapping(returnType, attributes.XmlRoot);
mapping.SetKey(methodInfo.GetKey() + ":Return");
list.Add(mapping);
flagArray[i] = true;
}
}
if (list.Count == 0)
{
return new object[0];
}
XmlMapping[] mappings = (XmlMapping[]) list.ToArray(typeof(XmlMapping));
Evidence evidenceForType = GetEvidenceForType(methodInfos[0].DeclaringType);
TraceMethod caller = Tracing.On ? new TraceMethod(typeof(XmlReturn), "GetInitializers", methodInfos) : null;
if (Tracing.On)
{
Tracing.Enter(Tracing.TraceId("TraceCreateSerializer"), caller, new TraceMethod(typeof(XmlSerializer), "FromMappings", new object[] { mappings, evidenceForType }));
}
XmlSerializer[] serializerArray = null;
if (AppDomain.CurrentDomain.IsHomogenous)
{
serializerArray = XmlSerializer.FromMappings(mappings);
}
else
{
serializerArray = XmlSerializer.FromMappings(mappings, evidenceForType);
}
if (Tracing.On)
{
Tracing.Exit(Tracing.TraceId("TraceCreateSerializer"), caller);
}
object[] objArray = new object[methodInfos.Length];
int num2 = 0;
for (int j = 0; j < objArray.Length; j++)
{
if (flagArray[j])
{
objArray[j] = serializerArray[num2++];
}
}
return objArray;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:60,代码来源:XmlReturn.cs
示例2: SoapServerMethod
public SoapServerMethod(Type serverType, LogicalMethodInfo methodInfo) {
this.methodInfo = methodInfo;
//
// Set up the XmlImporter, the SoapImporter, and acquire
// the ServiceAttribute on the serverType for use in
// creating a SoapReflectedMethod.
//
WebServiceAttribute serviceAttribute = WebServiceReflector.GetAttribute(serverType);
string serviceNamespace = serviceAttribute.Namespace;
bool serviceDefaultIsEncoded = SoapReflector.ServiceDefaultIsEncoded(serverType);
SoapReflectionImporter soapImporter = SoapReflector.CreateSoapImporter(serviceNamespace, serviceDefaultIsEncoded);
XmlReflectionImporter xmlImporter = SoapReflector.CreateXmlImporter(serviceNamespace, serviceDefaultIsEncoded);
//
// Add some types relating to the methodInfo into the two importers
//
SoapReflector.IncludeTypes(methodInfo, soapImporter);
WebMethodReflector.IncludeTypes(methodInfo, xmlImporter);
//
// Create a SoapReflectedMethod by reflecting on the
// LogicalMethodInfo passed to us.
//
SoapReflectedMethod soapMethod = SoapReflector.ReflectMethod(methodInfo, false, xmlImporter, soapImporter, serviceNamespace);
//
// Most of the fields in this class are ----ed in from the reflected information
//
ImportReflectedMethod(soapMethod);
ImportSerializers(soapMethod, GetServerTypeEvidence(serverType));
ImportHeaderSerializers(soapMethod);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:34,代码来源:SoapServerMethod.cs
示例3: SoapServerMethod
public SoapServerMethod (Type serverType, LogicalMethodInfo methodInfo)
{
TypeStubInfo type = TypeStubManager.GetTypeStub (serverType, "Soap");
info = type.GetMethod (methodInfo.Name) as SoapMethodStubInfo;
if (info == null)
throw new InvalidOperationException ("Argument methodInfo does not seem to be a member of the server type.");
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:SoapServerMethod.cs
示例4: GetInitializer
/// <summary>
/// When the SOAP extension is accessed for the first time, the XML Web
/// service method it is applied to is accessed to store the file
/// name passed in, using the corresponding SoapExtensionAttribute.
/// </summary>
/// <param name="methodInfo">The method being called.</param>
/// <param name="attribute">Decorating attribute for the method.</param>
/// <returns>An initializer object.</returns>
/// <exception cref="ArgumentNullException">Thrown if
/// <paramref name="methodInfo"/> is null.</exception>
public override object GetInitializer(LogicalMethodInfo methodInfo,
SoapExtensionAttribute attribute) {
if (methodInfo == null) {
throw new ArgumentNullException("methodInfo");
}
return methodInfo.DeclaringType;
}
开发者ID:markgmarkg,项目名称:googleads-dotnet-lib,代码行数:17,代码来源:SoapListenerExtension.cs
示例5: GetSoapMethodBinding
internal static string GetSoapMethodBinding(LogicalMethodInfo method)
{
string binding;
object[] customAttributes = method.GetCustomAttributes(typeof(SoapDocumentMethodAttribute));
if (customAttributes.Length == 0)
{
customAttributes = method.GetCustomAttributes(typeof(SoapRpcMethodAttribute));
if (customAttributes.Length == 0)
{
binding = string.Empty;
}
else
{
binding = ((SoapRpcMethodAttribute) customAttributes[0]).Binding;
}
}
else
{
binding = ((SoapDocumentMethodAttribute) customAttributes[0]).Binding;
}
if (method.Binding == null)
{
return binding;
}
if ((binding.Length > 0) && (binding != method.Binding.Name))
{
throw new InvalidOperationException(System.Web.Services.Res.GetString("WebInvalidBindingName", new object[] { binding, method.Binding.Name }));
}
return method.Binding.Name;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:SoapReflector.cs
示例6: GetInitializer
public override object GetInitializer (LogicalMethodInfo methodInfo)
{
LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
object[] ats = methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null;
return new XmlSerializer (methodInfo.ReturnType, null, null, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:XmlReturnReader.cs
示例7: GetAttribute
internal static WebServiceBindingAttribute GetAttribute(LogicalMethodInfo methodInfo, string binding)
{
if (methodInfo.Binding != null)
{
if ((binding.Length > 0) && (methodInfo.Binding.Name != binding))
{
throw new InvalidOperationException(Res.GetString("WebInvalidBindingName", new object[] { binding, methodInfo.Binding.Name }));
}
return methodInfo.Binding;
}
Type declaringType = methodInfo.DeclaringType;
object[] customAttributes = declaringType.GetCustomAttributes(typeof(WebServiceBindingAttribute), false);
WebServiceBindingAttribute attribute = null;
foreach (WebServiceBindingAttribute attribute2 in customAttributes)
{
if (attribute2.Name == binding)
{
if (attribute != null)
{
throw new ArgumentException(Res.GetString("MultipleBindingsWithSameName2", new object[] { declaringType.FullName, binding, "methodInfo" }));
}
attribute = attribute2;
}
}
if (((attribute == null) && (binding != null)) && (binding.Length > 0))
{
throw new ArgumentException(Res.GetString("TypeIsMissingWebServiceBindingAttributeThat2", new object[] { declaringType.FullName, binding }), "methodInfo");
}
return attribute;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:WebServiceBindingReflector.cs
示例8: GetInitializer
public override object GetInitializer(LogicalMethodInfo methodInfo)
{
if (!ValueCollectionParameterReader.IsSupported(methodInfo))
{
return null;
}
return methodInfo.InParameters;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:UrlEncodedParameterWriter.cs
示例9: GetInitializers
public virtual object[] GetInitializers (LogicalMethodInfo[] methodInfos)
{
object[] initializers = new object [methodInfos.Length];
for (int n=0; n<methodInfos.Length; n++)
initializers [n] = GetInitializer (methodInfos[n]);
return initializers;
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:MimeFormatter.cs
示例10: GetAttribute
internal static WebServiceAttribute GetAttribute(LogicalMethodInfo[] methodInfos)
{
if (methodInfos.Length == 0)
{
return new WebServiceAttribute();
}
return GetAttribute(GetMostDerivedType(methodInfos));
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:WebServiceReflector.cs
示例11: GetInitializer
public override object GetInitializer(LogicalMethodInfo methodInfo)
{
if (!IsSupported(methodInfo))
{
return null;
}
return methodInfo.InParameters;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ValueCollectionParameterReader.cs
示例12: GetInitializer
public override object GetInitializer(LogicalMethodInfo methodInfo)
{
if (methodInfo.IsVoid)
{
return null;
}
return this;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:AnyReturnReader.cs
示例13: GetInitializers
internal static object[] GetInitializers(LogicalMethodInfo methodInfo, SoapReflectedExtension[] extensions)
{
object[] objArray = new object[extensions.Length];
for (int i = 0; i < objArray.Length; i++)
{
objArray[i] = extensions[i].GetInitializer(methodInfo);
}
return objArray;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:SoapReflectedExtension.cs
示例14: GetInitializers
public virtual object[] GetInitializers(LogicalMethodInfo[] methodInfos)
{
object[] objArray = new object[methodInfos.Length];
for (int i = 0; i < objArray.Length; i++)
{
objArray[i] = this.GetInitializer(methodInfos[i]);
}
return objArray;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:MimeFormatter.cs
示例15: IsSupported
/// <include file='doc\ValueCollectionParameterReader.uex' path='docs/doc[@for="ValueCollectionParameterReader.IsSupported"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
static public bool IsSupported(LogicalMethodInfo methodInfo) {
if (methodInfo.OutParameters.Length > 0)
return false;
ParameterInfo[] paramInfos = methodInfo.InParameters;
for (int i = 0; i < paramInfos.Length; i++)
if (!IsSupported(paramInfos[i]))
return false;
return true;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:13,代码来源:ValueCollectionParameterReader.cs
示例16: HttpClientType
internal HttpClientType(Type type)
{
LogicalMethodInfo[] infoArray = LogicalMethodInfo.Create(type.GetMethods(), LogicalMethodTypes.Sync);
Hashtable formatterTypes = new Hashtable();
for (int i = 0; i < infoArray.Length; i++)
{
LogicalMethodInfo info = infoArray[i];
try
{
object[] customAttributes = info.GetCustomAttributes(typeof(HttpMethodAttribute));
if (customAttributes.Length != 0)
{
HttpMethodAttribute attribute = (HttpMethodAttribute) customAttributes[0];
HttpClientMethod method = new HttpClientMethod {
readerType = attribute.ReturnFormatter,
writerType = attribute.ParameterFormatter,
methodInfo = info
};
AddFormatter(formatterTypes, method.readerType, method);
AddFormatter(formatterTypes, method.writerType, method);
this.methods.Add(info.Name, method);
}
}
catch (Exception exception)
{
if (((exception is ThreadAbortException) || (exception is StackOverflowException)) || (exception is OutOfMemoryException))
{
throw;
}
throw new InvalidOperationException(Res.GetString("WebReflectionError", new object[] { info.DeclaringType.FullName, info.Name }), exception);
}
}
foreach (Type type2 in formatterTypes.Keys)
{
ArrayList list = (ArrayList) formatterTypes[type2];
LogicalMethodInfo[] methodInfos = new LogicalMethodInfo[list.Count];
for (int j = 0; j < list.Count; j++)
{
methodInfos[j] = ((HttpClientMethod) list[j]).methodInfo;
}
object[] initializers = MimeFormatter.GetInitializers(type2, methodInfos);
bool flag = typeof(MimeParameterWriter).IsAssignableFrom(type2);
for (int k = 0; k < list.Count; k++)
{
if (flag)
{
((HttpClientMethod) list[k]).writerInitializer = initializers[k];
}
else
{
((HttpClientMethod) list[k]).readerInitializer = initializers[k];
}
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:55,代码来源:HttpClientType.cs
示例17: DocumentationServerType
internal DocumentationServerType(Type type, string uri) : base(typeof(DocumentationServerProtocol))
{
uri = new Uri(uri, true).GetLeftPart(UriPartial.Path);
this.methodInfo = new LogicalMethodInfo(typeof(DocumentationServerProtocol).GetMethod("Documentation", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance));
ServiceDescriptionReflector reflector = new ServiceDescriptionReflector();
reflector.Reflect(type, uri);
this.schemas = reflector.Schemas;
this.serviceDescriptions = reflector.ServiceDescriptions;
this.schemasWithPost = reflector.SchemasWithPost;
this.serviceDescriptionsWithPost = reflector.ServiceDescriptionsWithPost;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:DocumentationServerType.cs
示例18: GetInitializer
public override object GetInitializer (LogicalMethodInfo methodInfo)
{
LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
object[] ats = methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null;
XmlReflectionImporter importer = new XmlReflectionImporter ();
importer.IncludeTypes (methodInfo.CustomAttributeProvider);
XmlTypeMapping map = importer.ImportTypeMapping (methodInfo.ReturnType, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
return new XmlSerializer (map);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:11,代码来源:XmlReturnWriter.cs
示例19: GetDefaultAction
private static string GetDefaultAction(string defaultNs, LogicalMethodInfo methodInfo)
{
string messageName = methodInfo.MethodAttribute.MessageName;
if (messageName.Length == 0)
{
messageName = methodInfo.Name;
}
if (defaultNs.EndsWith("/", StringComparison.Ordinal))
{
return (defaultNs + messageName);
}
return (defaultNs + "/" + messageName);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:SoapReflector.cs
示例20: GetInitializers
internal static object[] GetInitializers(LogicalMethodInfo[] methodInfos) {
if (methodInfos.Length == 0) return new object[0];
WebServiceAttribute serviceAttribute = WebServiceReflector.GetAttribute(methodInfos);
bool serviceDefaultIsEncoded = SoapReflector.ServiceDefaultIsEncoded(WebServiceReflector.GetMostDerivedType(methodInfos));
XmlReflectionImporter importer = SoapReflector.CreateXmlImporter(serviceAttribute.Namespace, serviceDefaultIsEncoded);
WebMethodReflector.IncludeTypes(methodInfos, importer);
ArrayList mappings = new ArrayList();
bool[] supported = new bool[methodInfos.Length];
for (int i = 0; i < methodInfos.Length; i++) {
LogicalMethodInfo methodInfo = methodInfos[i];
Type type = methodInfo.ReturnType;
if (IsSupported(type) && HttpServerProtocol.AreUrlParametersSupported(methodInfo)) {
XmlAttributes a = new XmlAttributes(methodInfo.ReturnTypeCustomAttributeProvider);
XmlTypeMapping mapping = importer.ImportTypeMapping(type, a.XmlRoot);
mapping.SetKey(methodInfo.GetKey() + ":Return");
mappings.Add(mapping);
supported[i] = true;
}
}
if (mappings.Count == 0)
return new object[0];
XmlMapping[] xmlMappings = (XmlMapping[])mappings.ToArray(typeof(XmlMapping));
Evidence evidence = GetEvidenceForType(methodInfos[0].DeclaringType);
TraceMethod caller = Tracing.On ? new TraceMethod(typeof(XmlReturn), "GetInitializers", methodInfos) : null;
if (Tracing.On) Tracing.Enter(Tracing.TraceId(Res.TraceCreateSerializer), caller, new TraceMethod(typeof(XmlSerializer), "FromMappings", xmlMappings, evidence));
XmlSerializer[] serializers = null;
if (AppDomain.CurrentDomain.IsHomogenous)
{
serializers = XmlSerializer.FromMappings(xmlMappings);
}
else
{
#pragma warning disable 618 // If we're in a non-homogenous domain, legacy CAS mode is enabled, so passing through evidence will not fail
serializers = XmlSerializer.FromMappings(xmlMappings, evidence);
#pragma warning restore 618
}
if (Tracing.On) Tracing.Exit(Tracing.TraceId(Res.TraceCreateSerializer), caller);
object[] initializers = new object[methodInfos.Length];
int count = 0;
for (int i = 0; i < initializers.Length; i++) {
if (supported[i]) {
initializers[i] = serializers[count++];
}
}
return initializers;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:50,代码来源:XmlReturnReader.cs
注:本文中的System.Web.Services.Protocols.LogicalMethodInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论