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


C# Method类代码示例

本文整理汇总了C#中Method的典型用法代码示例。如果您正苦于以下问题:C# Method类的具体用法?C# Method怎么用?C# Method使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Method类属于命名空间,在下文中一共展示了Method类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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