• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MethodType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MethodType类属于命名空间,在下文中一共展示了MethodType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Name

 public Name(string methodName, string className, MethodType type, bool interesting)
 {
     MethodName = methodName;
     ClassName = className;
     Type = type;
     Interesting = interesting;
 }
开发者ID:chrisforbes,项目名称:profiler,代码行数:7,代码来源:Name.cs


示例2: getOperationMethodName

 public static string getOperationMethodName(this DbSetInfo dbSetInfo, MethodType methodType)
 {
     switch (methodType)
     {
         case MethodType.Refresh:
             if (string.IsNullOrWhiteSpace(dbSetInfo.refreshDataMethod))
                 return null;
             return GenerateMethodName(dbSetInfo.refreshDataMethod, dbSetInfo.dbSetName);
         case MethodType.Insert:
             if (string.IsNullOrWhiteSpace(dbSetInfo.insertDataMethod))
                 return null;
             return GenerateMethodName(dbSetInfo.insertDataMethod, dbSetInfo.dbSetName);
         case MethodType.Update:
             if (string.IsNullOrWhiteSpace(dbSetInfo.updateDataMethod))
                 return null;
             return GenerateMethodName(dbSetInfo.updateDataMethod, dbSetInfo.dbSetName);
         case MethodType.Delete:
             if (string.IsNullOrWhiteSpace(dbSetInfo.deleteDataMethod))
                 return null;
             return GenerateMethodName(dbSetInfo.deleteDataMethod, dbSetInfo.dbSetName);
         case MethodType.Validate:
             if (string.IsNullOrWhiteSpace(dbSetInfo.validateDataMethod))
                 return null;
             return GenerateMethodName(dbSetInfo.validateDataMethod, dbSetInfo.dbSetName);
         default:
             throw new DomainServiceException(string.Format("Invalid Method Type {0}", methodType));
     }
 }
开发者ID:cbsistem,项目名称:JRIAppTS,代码行数:28,代码来源:DbSetInfoEx.cs


示例3: CreateDatabase

 private static Database CreateDatabase(MethodType type)
 {
     switch (type)
     {
         case MethodType.One:
             {
                 // Should only exist one DatabaseProviderFactory object in your application,
                 // since all the Database objects are cached in the factory
                 var factory = new DatabaseProviderFactory();
                 return factory.CreateDefault();
             }
         case MethodType.Two:
             {
                 var factory = new DatabaseProviderFactory();
                 DatabaseFactory.SetDatabaseProviderFactory(factory);
                 return DatabaseFactory.CreateDatabase();
             }
         case MethodType.Three:
             {
                 var factory = new DatabaseProviderFactory();
                 DatabaseFactory.SetDatabaseProviderFactory(factory);
                 return DatabaseFactory.CreateDatabase("LocalDb");
             }
         case MethodType.Four:
             {
                 return new SqlDatabase(ConfigurationManager.ConnectionStrings["LocalDb"].ConnectionString);
             }
         default:
             throw new NotSupportedException();
     }
 }
开发者ID:JackBao,项目名称:MyLab,代码行数:31,代码来源:SimpleDemo.cs


示例4: ProxyMethodInfo

 public ProxyMethodInfo(string methodName, string typeName, Type fakeType, MethodInfo fakeMethod, MethodType fakeMethodType)
     : this(methodName, typeName)
 {
     FakeMethodType = fakeMethodType;
     FakeMethod = fakeMethod;
     FakeType = fakeType;
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:ProxyMethodInfo.cs


示例5: Request

    public static void Request(MethodType method, string uri, string body, CallBack<string> callBack)
    {
        try
        {
            Init("8aa5b8b5-f769-11e3-954e-06a6fa0000b9", "6ef2e5c0-3ef1-11e4-ae91-06a6fa0000b9");

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(APIEndpoint + uri);

            request.Method = method.ToString();
            request.ContentType = "applications/json";

            if (PlayerPrefs.HasKey("access_token"))
            request.Headers["Authorization"] = "Bearer " + PlayerPrefs.GetString("access_token");

            if(request.Method == "POST" || request.Method == "PUT")
            {
                StreamWriter writer = new StreamWriter(request.GetRequestStream());
                writer.Write(body);
                writer.Close();
            }

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);

            string responseFromServer = reader.ReadToEnd();

            callBack(responseFromServer);
        }
        catch(Exception e)
        {
            Debug.Log(e.Message);
        }
    }
开发者ID:ylyking,项目名称:AssetBundleCreator-1,代码行数:34,代码来源:BaasIOBinding.cs


示例6: GenerateSignature

 /// <summary>
 /// Generates the signature.
 /// </summary>
 /// <param name="t">The tokens.</param>
 /// <param name="httpMethod">The HTTP method.</param>
 /// <param name="url">The URL.</param>
 /// <param name="prm">The parameters.</param>
 /// <returns>The signature.</returns>
 internal static string GenerateSignature(Tokens t, MethodType httpMethod, Uri url, IEnumerable<KeyValuePair<string, string>> prm)
 {
     var key = Encoding.UTF8.GetBytes(
         string.Format("{0}&{1}", UrlEncode(t.ConsumerSecret),
                       UrlEncode(t.AccessTokenSecret)));
     var prmstr = prm.Select(x => new KeyValuePair<string, string>(UrlEncode(x.Key), UrlEncode(x.Value)))
         .Concat(
             url.Query.TrimStart('?').Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries)
                 .Select(x =>
                 {
                     var s = x.Split('=');
                     return new KeyValuePair<string, string>(s[0], s[1]);
                 })
         )
         .OrderBy(x => x.Key).ThenBy(x => x.Value)
         .Select(x => x.Key + "=" + x.Value)
         .JoinToString("&");
     var msg = Encoding.UTF8.GetBytes(
         string.Format("{0}&{1}&{2}",
             httpMethod.ToString().ToUpperInvariant(),
             UrlEncode(url.GetComponents(UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port | UriComponents.Path, UriFormat.UriEscaped)),
             UrlEncode(prmstr)
         ));
     return Convert.ToBase64String(SecurityUtils.HmacSha1(key, msg));
 }
开发者ID:CoreTweet,项目名称:CoreTweet,代码行数:33,代码来源:Request.cs


示例7: CommonParameters

        public CommonParameters(MethodType method, bool verifyOriginator = false)
        {
            
            Id = RandomNumberGenerator.Instance.Next();

            MethodType = method;
            VerifyOriginator = verifyOriginator;
        }
开发者ID:gsteinbacher,项目名称:RandomOrgSharp,代码行数:8,代码来源:CommonParameters.cs


示例8: Method

        /// <summary>
        /// Initializes a new <see cref="Method"/> instance with the given parameters.
        /// </summary>
        /// <param name="moduleId">The ID of the module the symbol resides in.</param>
        /// <param name="type">The type of the method.</param>
        /// <param name="address">The start address of the method.</param>
        /// <param name="length">The length of the method, in bytes.</param>
        public Method( uint moduleId, MethodType type, uint address, uint length )
            : base(moduleId, address, length)
        {
            this.Type = type;

            //Debug.Assert( address % 4 == 0 );
            Debug.Assert( length % 4 == 0 );
        }
开发者ID:BradFuller,项目名称:pspplayer,代码行数:15,代码来源:Method.cs


示例9: CreateMethodParamList

        public static List<string> CreateMethodParamList(MethodType Methodtype, string Tablename, List<string> Colnames, string Namespace)
        {
            List<string> lines = new List<string>();
            List<string> propertyInfos = new List<string>();

            var typeMap = Assembly.GetExecutingAssembly().GetTypes()
                          .Where(t => t.Namespace == Namespace)
                          .ToDictionary(t => t.Name, t => t,
                                        StringComparer.OrdinalIgnoreCase);

            Type type;
            if (typeMap.TryGetValue(Tablename.Trim(), out type))
            {
                try
                {
                    var cls = Activator.CreateInstance(type);
                    foreach (var prop in cls.GetType().GetProperties())
                    {
                        propertyInfos.Add(prop.Name);
                    }
                }
                catch(Exception ex)
                {
                    Console.WriteLine(string.Format("Error:{0}", ex));
                }
            }
            else
            {
                Console.WriteLine("Type not found");
            }

            var i = 0;
            foreach (var s in Colnames)
            {
                switch (Methodtype)
                {
                    case MethodType.Insert:
                        lines.Add(string.Format("fbCom.Parameters.AddWithValue(\"@{0}\", {1}.{2});", s, Tablename, propertyInfos[i]));
                        break;
                    case MethodType.Select:
                        lines.Add(string.Format("fbCom.Parameters.AddWithValue(\"@{0}\", {1});", s, propertyInfos[i].ToUpper()));
                        return lines;
                    //case MethodType.Update:
                    //    lines.Add(string.Format("fbCom.Parameters.AddWithValue(\"{0}\", {1}.{2});", s, Tablename, propertyInfos[i]));
                    //    break;
                    case MethodType.Delete:
                        lines.Add(string.Format("fbCom.Parameters.AddWithValue(\"@{0}\", {1});", s, propertyInfos[i].ToUpper()));
                        return lines;
                    case MethodType.None:
                        break;
                    default:
                        break;
                }
                
                i++;
            }
            return lines;
        }
开发者ID:Chrontech,项目名称:CRUDClassGeneration,代码行数:58,代码来源:StatementGenerator.cs


示例10: PipelineException

 public PipelineException(PipelineErrorType errorType, string serviceName, string route, Uri requestUri, MethodType methodType, Exception innerException)
     : base(PipelineException.DefaultMessage, innerException)
 {
     this.errorType = errorType;
     this.serviceName = serviceName;
     this.route = route;
     this.requestUri = requestUri;
     this.methodType = methodType;
 }
开发者ID:ChadBurggraf,项目名称:small-fry,代码行数:9,代码来源:PipelineException.cs


示例11: CreateMethod

 /// <summary>
 /// Creates a service object method with the given name, description and Methodtype
 /// </summary>
 /// <param name="name"></param>
 /// <param name="description"></param>
 /// <param name="methodType"></param>
 /// <returns></returns>
 public static Method CreateMethod(string name, string description, MethodType methodType)
 {
     Method m = new Method();
     m.Name = name;
     m.Type = methodType;
     m.MetaData.DisplayName = AddSpaceBeforeCaptialLetter(name);
     m.MetaData.Description = description;
     return m;
 }
开发者ID:nagorsky,项目名称:K2NEServiceBroker,代码行数:16,代码来源:Helper.cs


示例12: NativeInvokerBytecodeGenerator

    private NativeInvokerBytecodeGenerator(LambdaForm lambdaForm, MethodType invokerType)
    {
        if (invokerType != invokerType.basicType())
        {
            throw new BailoutException(Bailout.NotBasicType, invokerType);
        }
        this.lambdaForm = lambdaForm;
        this.invokerType = invokerType;
        this.delegateType = MethodHandleUtil.GetMemberWrapperDelegateType(invokerType);
        MethodInfo mi = MethodHandleUtil.GetDelegateInvokeMethod(delegateType);
        Type[] paramTypes = MethodHandleUtil.GetParameterTypes(typeof(object[]), mi);
        // HACK the code we generate is not verifiable (known issue: locals aren't typed correctly), so we stick the DynamicMethod into mscorlib (a security critical assembly)
        this.dm = new DynamicMethod(lambdaForm.debugName, mi.ReturnType, paramTypes, typeof(object).Module, true);
        this.ilgen = CodeEmitter.Create(this.dm);
        if (invokerType.parameterCount() > MethodHandleUtil.MaxArity)
        {
            this.packedArgType = paramTypes[paramTypes.Length - 1];
            this.packedArgPos = paramTypes.Length - 1;
        }
        else
        {
            this.packedArgPos = Int32.MaxValue;
        }

        locals = new CodeEmitterLocal[lambdaForm.names.Length];
        for (int i = lambdaForm._arity(); i < lambdaForm.names.Length; i++)
        {
            Name name = lambdaForm.names[i];
            if (name.index() != i)
            {
                throw new BailoutException(Bailout.PreconditionViolated, "name.index() != i");
            }
            switch (name.typeChar())
            {
                case 'L':
                    locals[i] = ilgen.DeclareLocal(Types.Object);
                    break;
                case 'I':
                    locals[i] = ilgen.DeclareLocal(Types.Int32);
                    break;
                case 'J':
                    locals[i] = ilgen.DeclareLocal(Types.Int64);
                    break;
                case 'F':
                    locals[i] = ilgen.DeclareLocal(Types.Single);
                    break;
                case 'D':
                    locals[i] = ilgen.DeclareLocal(Types.Double);
                    break;
                case 'V':
                    break;
                default:
                    throw new BailoutException(Bailout.PreconditionViolated, "Unsupported typeChar(): " + name.typeChar());
            }
        }
    }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:56,代码来源:NativeInvokerBytecodeGenerator.cs


示例13: CreateMethod

 /// <summary>
 /// Creates a service object method with the given name, description and Methodtype
 /// </summary>
 /// <param name="name"></param>
 /// <param name="description"></param>
 /// <param name="methodType"></param>
 /// <returns></returns>
 public static Method CreateMethod(string name, string description, MethodType methodType)
 {
     Method m = new Method
     {
         Name = name,
         Type = methodType,
         MetaData = new MetaData(AddSpaceBeforeCaptialLetter(name), description)
     };
     return m;
 }
开发者ID:dudelis,项目名称:K2NEServiceBroker,代码行数:17,代码来源:Helper.cs


示例14: Method

        public Method(MethodType methodType, Endpoint endpoint, Action<IRequestMessage, IResponseMessage> action)
        {
            if (action == null)
            {
                throw new ArgumentNullException("action", "action cannot be null.");
            }

            this.Initialize(methodType, endpoint);
            this.requestResponseAction = action;
        }
开发者ID:ChadBurggraf,项目名称:small-fry,代码行数:10,代码来源:Method.cs


示例15: FeedbackType

        public FeedbackType(string name, int id, MethodInfo callback, MethodType methodType, List<FeedbackField> fields)
        {
            this.name = name;
            this.id = id;
            this.method = callback;
            this.fields = fields;

            methodHasTimestamp = (methodType & MethodType.Timestamp) != MethodType.None;
            methodHasMsgType = (methodType & MethodType.MessageType) != MethodType.None;
            methodIsObjectArray = (methodType & MethodType.ObjectArray) != MethodType.None;
        }
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:11,代码来源:FeedbackType.cs


示例16: MethodCommand

        /// <summary>
        ///     Initialisiert eine neue Instanz der <see cref="MethodCommand" /> Klasse.
        /// </summary>
        /// <param name="method">
        ///     The method.
        /// </param>
        /// <param name="context">
        ///     The context.
        /// </param>
        public MethodCommand([NotNull] MethodInfo method, [NotNull] WeakReference context)
        {
            Contract.Requires<ArgumentNullException>(method != null, "method");

            _method = method;
            _context = context;

            _methodType = (MethodType) method.GetParameters().Length;
            if (_methodType != MethodType.One) return;
            if (_method.GetParameters()[0].ParameterType != typeof (EventData)) _methodType = MethodType.EventArgs;
        }
开发者ID:Tauron1990,项目名称:Tauron-Application-Common,代码行数:20,代码来源:MethodCommand.cs


示例17: RequestMessage

 public RequestMessage(MethodType intMethod, string strURL)
 {
     // Asigna las propiedades
         Method = intMethod;
         URL = strURL;
     // Asigna los valores básicos
         ContentType = "text/xml";
     // Define los objetos
         UrlParameters = new ParameterDataCollection();
         QueryParameters = new ParameterDataCollection();
         Attachments = new AttachmentsCollection();
 }
开发者ID:gitter-badger,项目名称:BauTwitter,代码行数:12,代码来源:RequestMessage.cs


示例18: AddMethod

 public void AddMethod(string name, string displayName, string description, MethodType k2Type, List<string> inputProps, List<string> requiredProps, List<string> returnProps)
 {
     SchemaMethod meth = new SchemaMethod();
     meth.Name = name;
     meth.DisplayName = displayName;
     meth.K2Type = k2Type;
     meth.Description = description;
     meth.InputProperties = inputProps;
     meth.RequiredProperties = requiredProps;
     meth.ReturnProperties = returnProps;
     SchemaMethods.Add(meth);
 }
开发者ID:jonnoking,项目名称:K2-Dynamics-CRM-Extensions,代码行数:12,代码来源:SchemaObject.cs


示例19: WindowedSincUpsampler

        public WindowedSincUpsampler(int factor, int windowLength, MethodType method)
            : base(FilterType.WindowedSincUpsampler)
        {
            if (factor <= 1 || !IsPowerOfTwo(factor)) {
                throw new ArgumentException("factor must be power of two integer and larger than 1");
            }
            Factor = factor;

            WindowLength = windowLength;

            Method = method;
            mFirst = true;
        }
开发者ID:kekyo,项目名称:PlayPcmWin,代码行数:13,代码来源:WindowedSincUpsampler.cs


示例20: AddMethod

        public void AddMethod(int id, SimpleMethodInfo method, MethodType type)
        {
            IMonitorServiceCallback channel = GetCallbackChannel();

            if (!_clientIDs.ContainsKey(channel))
            {
                AddStatusText(string.Format("New Client (#{0})", _nextClientID));
                _clientIDs.Add(channel, _nextClientID++);
            }

            AddStatusText(string.Format("New Method (#{0}, {1})", _clientIDs[channel], id));
            _methods.Add(new ClientMethodInfo() { Callback = channel, ID = id, MethodInfo = method, ClientID = _clientIDs[channel], Type = type });
        }
开发者ID:ChristophGr,项目名称:loom-csharp,代码行数:13,代码来源:MainWindow.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Metric类代码示例发布时间:2022-05-24
下一篇:
C# MethodReturnEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap