本文整理汇总了C#中Method类的典型用法代码示例。如果您正苦于以下问题:C# Method类的具体用法?C# Method怎么用?C# Method使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Method类属于命名空间,在下文中一共展示了Method类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Link
public static void Link(Core.Action action, Method method)
{
action.Method = method;
action.MethodID = method.MethodID;
method.Actions.Add(action);
}
开发者ID:kgarsuta,项目名称:Hatfield.EnviroData.DataAcquisition,代码行数:7,代码来源:ODM2EntityLinker.cs
示例2: CardsRequest
public CardsRequest(ICardId card, string resource = "", Method method = Method.GET)
: base("cards/{cardId}/" + resource, method)
{
Guard.NotNull(card, "card");
AddParameter("cardId", card.GetCardId(), ParameterType.UrlSegment);
this.AddCommonCardParameters();
}
开发者ID:KennyBu,项目名称:Trello.NET,代码行数:7,代码来源:CardsRequest.cs
示例3: GetRequest
private static RestRequest GetRequest(Method method, string resource)
{
var request = new RestRequest(method);
request.Resource = resource;
request.JsonSerializer = new RestSharpJsonNetSerializer();
return request;
}
开发者ID:Nexudus,项目名称:Kisi.NET,代码行数:7,代码来源:KisiClient.cs
示例4: BuildRequest
private RestRequest BuildRequest(string endpoint, Method method,
Dictionary<string, string> urlParams = null,
Dictionary<string, string> inputParams = null,
Dictionary<string, string> headerParams = null)
{
var request = new RestRequest(endpoint, method);
if (urlParams == null) {
urlParams = new Dictionary<string, string>();
}
urlParams.Add("locale", _configService.Locale());
foreach (var entry in urlParams) {
request.AddUrlSegment(entry.Key, entry.Value);
}
if (inputParams != null) {
foreach (var entry in inputParams) {
request.AddParameter(entry.Key, entry.Value);
}
}
if (headerParams != null) {
foreach (var entry in headerParams) {
request.AddHeader(entry.Key, entry.Value);
}
}
return request;
}
开发者ID:andCulture,项目名称:xamarin-architecture,代码行数:28,代码来源:WebRequestService.cs
示例5: PreVerbExecutionContext
internal PreVerbExecutionContext(
Method method,
object target,
ParameterAndValue[] parameters)
: base(method, target, parameters, new Dictionary<object, object>())
{
}
开发者ID:serra,项目名称:CLAP,代码行数:7,代码来源:PreVerbExecutionContext.cs
示例6: VisitCall
/// <summary>
/// Visits the call.
/// </summary>
/// <param name="destination">The destination.</param>
/// <param name="receiver">The receiver.</param>
/// <param name="callee">The callee.</param>
/// <param name="arguments">The arguments.</param>
/// <param name="isVirtualCall">if set to <c>true</c> [is virtual call].</param>
/// <param name="programContext">The program context.</param>
/// <param name="stateBeforeInstruction">The state before instruction.</param>
/// <param name="stateAfterInstruction">The state after instruction.</param>
public override void VisitCall(
Variable destination,
Variable receiver,
Method callee,
ExpressionList arguments,
bool isVirtualCall,
Microsoft.Fugue.IProgramContext programContext,
Microsoft.Fugue.IExecutionState stateBeforeInstruction,
Microsoft.Fugue.IExecutionState stateAfterInstruction)
{
if ((callee.DeclaringType.GetRuntimeType() == typeof(X509ServiceCertificateAuthentication) ||
callee.DeclaringType.GetRuntimeType() == typeof(X509ClientCertificateAuthentication)) &&
(callee.Name.Name.Equals("set_CertificateValidationMode", StringComparison.InvariantCultureIgnoreCase)))
{
IAbstractValue value = stateBeforeInstruction.Lookup((Variable)arguments[0]);
IIntValue intValue = value.IntValue(stateBeforeInstruction);
if (intValue != null)
{
X509CertificateValidationMode mode = (X509CertificateValidationMode)intValue.Value;
if (mode != X509CertificateValidationMode.ChainTrust)
{
Resolution resolution = base.GetResolution(mode.ToString(),
X509CertificateValidationMode.ChainTrust.ToString());
Problem problem = new Problem(resolution, programContext);
base.Problems.Add(problem);
}
}
}
base.VisitCall(destination, receiver, callee, arguments, isVirtualCall, programContext, stateBeforeInstruction, stateAfterInstruction);
}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:43,代码来源:CertificateValidationMode.cs
示例7: CreateRequest
public static IRestRequest CreateRequest(this IRequestFactory factory, Endpoint endpoint, Method method)
{
var request = factory.CreateRequest();
request.Resource = endpoint.Resource;
request.Method = method;
return request;
}
开发者ID:vasistbhargav,项目名称:OAuth2,代码行数:7,代码来源:RequestFactoryExtensions.cs
示例8: RestRequest
public RestRequest(string resource, Method method)
{
ContentCollectionMode = ContentCollectionMode.MultiPartForFileParameters;
Method = method;
Resource = resource;
Serializer = new Serializers.JsonSerializer();
}
开发者ID:yuleyule66,项目名称:restsharp.portable,代码行数:7,代码来源:RestRequest.cs
示例9: GetInstance
/// <summary>
/// This is used to acquire a <c>MethodPart</c> for the method
/// provided. This will synthesize an XML annotation to be used for
/// the method. If the method provided is not a setter or a getter
/// then this will return null, otherwise it will return a part with
/// a synthetic XML annotation. In order to be considered a valid
/// method the Java Bean conventions must be followed by the method.
/// </summary>
/// <param name="method">
/// this is the method to acquire the part for
/// </param>
/// <returns>
/// this is the method part object for the method
/// </returns>
public MethodPart GetInstance(Method method) {
Annotation label = GetAnnotation(method);
if(label != null) {
return GetInstance(method, label);
}
return null;
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:21,代码来源:MethodPartFactory.cs
示例10: NewRequest
protected RestRequest NewRequest(string path, Method method)
{
var request = new RestRequest(path, method);
request.AddParameter("no-cache", DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture), ParameterType.GetOrPost);
return request;
}
开发者ID:jbouwens,项目名称:Put.io.Wp,代码行数:7,代码来源:RestBase.cs
示例11: ExecuteGraphApiAsync
internal void ExecuteGraphApiAsync(Method httpMethod, string graphPath, IDictionary<string, string> parameters, bool addAccessToken, Action<FacebookAsyncResult> callback)
{
var request = new RestRequest(graphPath, httpMethod);
if (parameters != null)
{
foreach (var keyValuePair in parameters)
request.AddParameter(keyValuePair.Key, keyValuePair.Value);
}
ExecuteGraphApiAsync(
request,
addAccessToken,
Settings.UserAgent,
response =>
{
Exception exception;
if (response.ResponseStatus == ResponseStatus.Completed)
exception = (FacebookException)response.Content;
else
exception = new FacebookRequestException(response);
if (callback != null)
callback(new FacebookAsyncResult(response.Content, exception));
});
}
开发者ID:prabirshrestha,项目名称:FacebookSharp,代码行数:27,代码来源:Facebook.Async.cs
示例12: IsMixingMessageContractParams
private bool IsMixingMessageContractParams(Method method)
{
bool hasMessageContract = false;
bool hasOtherType = false;
foreach (Parameter parameter in method.Parameters)
{
if (HasMessageContractAttribute(parameter.Type.Attributes))
{
hasMessageContract = true;
}
else
{
hasOtherType = true;
}
if (hasMessageContract && hasOtherType)
{
return true;
}
}
// check for return type
if (HasMessageContractAttribute(method.ReturnType.Attributes))
{
hasMessageContract = true;
}
else
{
hasOtherType = true;
}
return hasOtherType && hasMessageContract;
}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:32,代码来源:MixingMessageContractAttributes.cs
示例13: CallInfo
public CallInfo(Module vmModule, Method method, int instructionPointer)
{
Module = vmModule;
Class = null;
Method = method;
InstructionPointer = instructionPointer;
}
开发者ID:DatZach,项目名称:Xi,代码行数:7,代码来源:CallInfo.cs
示例14: Path
public override string Path(Method method = Method.GET)
{
string path = (_parent != null) ? _parent.Path(method) + "/" : "/";
if (_id != null)
path += _id;
return path;
}
开发者ID:populr,项目名称:populr_api_dotnet,代码行数:7,代码来源:RestfulModel.cs
示例15: WebServiceRequest
public WebServiceRequest (string resource, Method method)
: base (resource, method)
{
AddHeader("Authorization", "Bearer jh8nCJo5vGRYRji7eT2DzGSn4wkljIJjey8OI9F5iMos0tFezFvwdrcJZtBc3B4EZOPCz" +
"7kcWzWUhqEvYSzY7br7hvXHFxVUnUE6OwdHPUjZojy5MLtWu9UDn1G9QrS6vuIRWtOH3J8mLAtswesmhWD8tHMiVoER9gd8UByg" +
"1wojqpzi3YNa53uPzkwDZkLxjTjgkfKJBAXYtQxNvg7NbLiMf1lCe7LWlQjCNk7VnBYgt4kYlrCLsgVMsRswJP6R");
}
开发者ID:puncsky,项目名称:DrunkAudible,代码行数:7,代码来源:WebServiceRequest.cs
示例16: CreateRequest
public IRestRequest CreateRequest(string resource, Method method = Method.GET, params Parameter[] parameters)
{
return CreateRequest(
() =>
{
IRestRequest request = new RestRequest
{
Resource = resource,
Method = method
};
if (parameters.Length == 0) return request;
foreach (var parameter in parameters)
{
request.AddParameter(parameter);
}
if (_headerProvider != null)
_headerProvider.PopulateHeaders(ref request);
return request;
}
);
}
开发者ID:HaKDMoDz,项目名称:csharp-github-api,代码行数:25,代码来源:RestRequestFactory.cs
示例17: Call
public object Call(Method m)
{
if(m.ID != -1)
{
ProgramCounter = MethodTable[m.ID];
return null;
}
List<string> path = m.Name.Split(':').First().Split('.').ToList();
string lib = path.Last();
path.Remove(path.Last());
string BasePath = path.First();
path.Remove(path.First());
Package package;
if (path.Count > 0)
package = Package.getBasePackage(BasePath).getPackageAt(path);
else package = Package.getBasePackage(BasePath);
List<object> args = new List<object>();
for (int i = 0; i < m.Perms.Count; i++)
{
args.Add(ResolveRawValue(m.Perms[i]));
}
var s2 = m.Name.Split(':').Last();
Library Lib = package.getLibrary(lib);
var d = Lib.Functions.Get(s2);
return d.DynamicInvoke(args.ToArray());
}
开发者ID:Myvar,项目名称:PashOS,代码行数:28,代码来源:Engine.cs
示例18: GetResponseString
public static string GetResponseString(this HttpWebRequest request, Method rt, string requestParams = null, Encoding encoding = null)
{
string responseData = string.Empty;
request.Method = rt.ToString().Trim();
HttpWebResponse RawResponse = null;
if (rt == Method.POST && requestParams != null)
{
encoding = encoding ?? Encoding.Default;
byte[] bytes = encoding.GetBytes(requestParams.Trim());
request.ContentLength = bytes.Length;
using (Stream outputStream = request.GetRequestStream())
outputStream.Write(bytes, 0, bytes.Length);
}
RawResponse = (HttpWebResponse)request.GetResponse();
encoding = Encoding.UTF8;// encoding ?? (String.IsNullOrWhiteSpace(RawResponse.CharacterSet) ? Encoding.Default : Encoding.GetEncoding(RawResponse.CharacterSet));
if (RawResponse.ContentEncoding == @"gzip")
using (GZipStream _stream = new GZipStream(RawResponse.GetResponseStream(), CompressionMode.Decompress))
{
using (StreamReader _sr = new StreamReader(_stream, encoding))
responseData = _sr.ReadToEnd();
}
else
using (StreamReader _sr = new StreamReader(RawResponse.GetResponseStream()))
{
responseData = _sr.ReadToEnd();
}
return responseData;
}
开发者ID:Montigomo,项目名称:UtExorcist,代码行数:34,代码来源:HttpExtensions.cs
示例19: Call
public IRestResponse Call(string resource, Method method)
{
var client = GetClient();
var request = GetRequest(method, resource);
return client.Execute(request);
}
开发者ID:jsiesquen,项目名称:desk-csharp-sdk,代码行数:7,代码来源:DeskApi.cs
示例20: PrepareRequest
protected override RestRequest PrepareRequest(string path, Method method, Dictionary<string, string> queryParams, object postBody, Dictionary<string, string> headerParams,
Dictionary<string, string> formParams, Dictionary<string, FileParameter> fileParams, Dictionary<string, string> pathParams, string contentType)
{
var request = base.PrepareRequest(path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, contentType);
var workContext = _workContextFactory();
var currentUser = workContext.CurrentCustomer;
//Add special header with user name to each API request for future audit and logging
if (currentUser != null && currentUser.IsRegisteredUser)
{
var userName = currentUser.OperatorUserName;
if (string.IsNullOrEmpty(userName))
{
userName = currentUser.UserName;
}
if (!string.IsNullOrEmpty(userName))
{
request.AddHeader("VirtoCommerce-User-Name", userName);
}
}
return request;
}
开发者ID:sameerkattel,项目名称:vc-community,代码行数:26,代码来源:StorefrontHmacApiClient.cs
注:本文中的Method类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论