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


C# CallType类代码示例

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


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

示例1: switch

	// Perform a late bound call.
	public static Object CallByName
				(Object ObjectRef, String ProcName,
				 CallType UseCallType, Object[] Args)
			{
				switch(UseCallType)
				{
					case CallType.Method:
					{
						return LateBinding.LateCallWithResult
							(ObjectRef, null, ProcName, Args, null, null);
					}
					// Not reached.

					case CallType.Get:
					{
						return LateBinding.LateGet
							(ObjectRef, null, ProcName, Args, null, null);
					}
					// Not reached.

					case CallType.Set:
					case CallType.Let:
					{
						LateBinding.LateSet
							(ObjectRef, null, ProcName, Args, null);
						return null;
					}
					// Not reached.
				}
				throw new ArgumentException(S._("VB_InvalidCallType"));
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:32,代码来源:Interaction.cs

示例2: InitMessage

		internal void InitMessage (MonoMethod method, object [] out_args)
		{
			this.method = method;
			ParameterInfo[] paramInfo = method.GetParametersInternal ();
			int param_count = paramInfo.Length;
			args = new object[param_count];
			arg_types = new byte[param_count];
			asyncResult = null;
			call_type = CallType.Sync;
			names = new string[param_count];
			for (int i = 0; i < param_count; i++) {
				names[i] = paramInfo[i].Name;
			}
			bool hasOutArgs = out_args != null;
			int j = 0;
			for (int i = 0; i < param_count; i++) {
				byte arg_type;
				bool isOut = paramInfo[i].IsOut;
				if (paramInfo[i].ParameterType.IsByRef) {
					if (hasOutArgs)
						args[i] = out_args[j++];
					arg_type = 2; // OUT
					if (!isOut)
						arg_type |= 1; // INOUT
				} else {
					arg_type = 1; // IN
					if (isOut)
						arg_type |= 4; // IN, COPY OUT
				}
				arg_types[i] = arg_type;
			}
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:32,代码来源:MonoMethodMessage.cs

示例3: Call

 public override ICallControl Call(string phoneNumber, CallType type)
 {
     if (CallType.Voice.Equals (type)) {
         using (var pool = new NSAutoreleasePool ()) {
             StringBuilder filteredPhoneNumber = new StringBuilder();
             if (phoneNumber!=null && phoneNumber.Length>0) {
                 foreach (char c in phoneNumber) {
                     if (Char.IsNumber(c) || c == '+' || c == '-' || c == '.') {
                         filteredPhoneNumber.Append(c);
                     }
                 }
             }
             String textURI = "tel:" + filteredPhoneNumber.ToString();
             var thread = new Thread (InitiateCall);
             thread.Start (textURI);
         }
         ;
     } else {
         INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance ().GetService ("notify");
         if (notificationService != null) {
             notificationService.StartNotifyAlert ("Phone Alert", "The requested call type is not enabled or supported on this device.", "OK");
         }
     }
     return null;
 }
开发者ID:jioe,项目名称:appverse-mobile,代码行数:25,代码来源:IPhoneTelephony.cs

示例4: AddCallCodes2

 public static void AddCallCodes2(
     OpModule codes, NodeBase[] args, CallType type, Action delg)
 {
     for (int i = args.Length - 1; i >= 0; i--)
         args[i].AddCodesV(codes, "push", null);
     delg();
     if (type == CallType.CDecl && args.Length > 0)
     {
         int p = 4;
         bool pop = false;
         for (int i = 0; i < args.Length; i++)
         {
             var arg = args[i];
             if (OpModule.NeedsDtor(arg))
             {
                 if (!pop)
                 {
                     codes.Add(I386.Push(Reg32.EAX));
                     pop = true;
                 }
                 arg.Type.AddDestructorA(codes, Addr32.NewRO(Reg32.ESP, p));
             }
             p += 4;
         }
         if (pop) codes.Add(I386.Pop(Reg32.EAX));
         codes.Add(I386.AddR(Reg32.ESP, Val32.New((byte)(args.Length * 4))));
     }
 }
开发者ID:7shi,项目名称:LLPML,代码行数:28,代码来源:Call.cs

示例5: Call

 public Call(DateTime startCall, DateTime endCall, string phoneNumber, CallType callType = CallType.Dailed)
 {
     this.startCallDateTime = startCall;
     this.endCallDateTime = endCall;
     this.phoneNumber = phoneNumber;
     this.PhoneCallType = callType;
 }
开发者ID:kizisoft,项目名称:TelerikAcademy,代码行数:7,代码来源:Call.cs

示例6: CallByName

        public static object CallByName(object Instance, string MethodName, CallType UseCallType, params object[] Arguments)
        {
            switch (UseCallType)
            {
                case CallType.Method:
                    return NewLateBinding.LateCall(Instance, null, MethodName, Arguments, null, null, null, false);

                case CallType.Get:
                    return NewLateBinding.LateGet(Instance, null, MethodName, Arguments, null, null, null);

                case CallType.Let:
                case CallType.Set:
                {
                    IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);
                    if (instance == null)
                    {
                        NewLateBinding.LateSet(Instance, null, MethodName, Arguments, null, null, false, false, UseCallType);
                        break;
                    }
                    IDOBinder.IDOSet(instance, MethodName, null, Arguments);
                    break;
                }
                default:
                    throw new ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", new string[] { "CallType" }));
            }
            return null;
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:Versioned.cs

示例7: MakeHttpRequest

        void MakeHttpRequest(string remoteUrl, CallType callType, NameValueCollection headers, byte[] buffer)
        {
            headers[HeaderMapper.NServiceBus + HeaderMapper.CallType] = Enum.GetName(typeof(CallType), callType);
            headers[HttpHeaders.ContentMd5Key] = Hasher.Hash(buffer);
            headers["NServiceBus.Gateway"] = "true";

            headers[HttpHeaders.FromKey] = ListenUrl;

            var request = WebRequest.Create(remoteUrl);
            request.Method = "POST";

            request.ContentType = "application/x-www-form-urlencoded";
            request.Headers = Encode(headers);

            request.ContentLength = buffer.Length;

            var stream = request.GetRequestStream();
            stream.Write(buffer, 0, buffer.Length);

            Logger.DebugFormat("Sending message - {0} to: {1}", callType, remoteUrl);
            int statusCode;

            using (var response = request.GetResponse() as HttpWebResponse)
                statusCode = (int)response.StatusCode;

            Logger.Debug("Got HTTP response with status code " + statusCode);

            if (statusCode != 200)
            {
                Logger.Warn("Message not transferred successfully. Trying again...");
                throw new Exception("Retrying");
            }
        }
开发者ID:kblooie,项目名称:NServiceBus,代码行数:33,代码来源:HttpChannelSender.cs

示例8: CallByName

		/// <summary>
		/// Allows late bound invocation of
		/// properties and methods.
		/// </summary>
		/// <param name="target">Object implementing the property or method.</param>
		/// <param name="methodName">Name of the property or method.</param>
		/// <param name="callType">Specifies how to invoke the property or method.</param>
		/// <param name="args">List of arguments to pass to the method.</param>
		/// <returns>The result of the property or method invocation.</returns>
		public static object CallByName(
		  object target, string methodName, CallType callType,
		  params object[] args)
		{
			switch (callType)
			{
				case CallType.Get:
					{
						PropertyInfo p = target.GetType().GetProperty(methodName);
						return p.GetValue(target, args);
					}
				case CallType.Let:
				case CallType.Set:
					{
						PropertyInfo p = target.GetType().GetProperty(methodName);
						object[] index = null;
						if (args.Length > 1)
						{
							index = new object[args.Length - 1];
							args.CopyTo(index, 1);
						}
						p.SetValue(target, args[0], index);
						return null;
					}
				case CallType.Method:
					{
						MethodInfo m = target.GetType().GetMethod(methodName);
						return m.Invoke(target, args);
					}
			}
			return null;
		}
开发者ID:gbahns,项目名称:Tennis,代码行数:41,代码来源:Utilities.cs

示例9: AbstractCall

 public AbstractValue AbstractCall(CallType callType, IList<AbstractValue> args) {
     TargetSet ts = this.GetTargetSet(args.Count);
     if (ts != null) {
         return ts.AbstractCall(callType, args);
     } else {
         return AbstractValue.TypeError(BadArgumentCount(callType, args.Count).Message);
     }
 } 
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:8,代码来源:MethodBinder.cs

示例10: ReportRecord

 public ReportRecord(CallType callType, int number, DateTime date, DateTime time, int cost)
 {
     CallType = callType;
     Number = number;
     Date = date;
     Time = time;
     Cost = cost;
 }
开发者ID:ZalesskyMaxim,项目名称:Task3,代码行数:8,代码来源:ReportRecord.cs

示例11: New

 public static TypeDelegate New(
     BlockBase parent, CallType callType, TypeBase retType, VarDeclare[] args)
 {
     var ret = new TypeDelegate();
     ret.init(callType, retType, args);
     ret.Parent = parent;
     return ret;
 }
开发者ID:7shi,项目名称:LLPML,代码行数:8,代码来源:TypeFunction.cs

示例12: MakeBindingTarget

 public MethodCandidate MakeBindingTarget(CallType callType, Type[] types, out Type[] argumentTests) {
     TargetSet ts = GetTargetSet(types.Length);
     if (ts != null) {
         return ts.MakeBindingTarget(callType, types, _kwArgs, out argumentTests);
     }
     argumentTests = null;
     return null;
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:8,代码来源:MethodBinder.cs

示例13: Transmit

        void Transmit(IChannelSender channelSender, Site targetSite, CallType callType, IDictionary<string,string> headers, Stream data)
        {
            headers[HeaderMapper.NServiceBus + HeaderMapper.CallType] = Enum.GetName(typeof(CallType), callType);
            headers[HttpHeaders.ContentMd5Key] = Hasher.Hash(data);

            Logger.DebugFormat("Sending message - {0} to: {1}", callType, targetSite.Address);

            channelSender.Send(targetSite.Address, headers, data);
        }
开发者ID:Jpattom,项目名称:NServiceBus,代码行数:9,代码来源:IdempotentSender.cs

示例14: Call

 public override async Task Call(string number, CallType type)
 {
     if (String.IsNullOrWhiteSpace(number) || type != CallType.Voice) return;
     if (
         !number.All(
             character => char.IsDigit(character) || character == '+' || character == '*' || character == '#' || character == ' '))
         return;
     if (AppverseBridge.Instance.RuntimeHandler.Webview.Dispatcher.HasThreadAccess) PhoneCallManager.ShowPhoneCallUI(number, String.Empty);
     else await AppverseBridge.Instance.RuntimeHandler.Webview.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => PhoneCallManager.ShowPhoneCallUI(number, String.Empty));
 }
开发者ID:Appverse,项目名称:appverse-mobile,代码行数:10,代码来源:WindowsPhoneTelephony.cs

示例15: Transmit

        void Transmit(IChannelSender channelSender, Site targetSite, CallType callType,
            IDictionary<string, string> headers, Stream data)
        {
            headers[GatewayHeaders.IsGatewayMessage] = Boolean.TrueString;
            headers["NServiceBus.CallType"] = Enum.GetName(typeof(CallType), callType);
            headers[HttpHeaders.ContentMD5] = Hasher.Hash(data);

            Logger.DebugFormat("Sending message - {0} to: {1}", callType, targetSite.Channel.Address);

            channelSender.Send(targetSite.Channel.Address, headers, data);
        }
开发者ID:ramonsmits,项目名称:NServiceBus.Gateway,代码行数:11,代码来源:SingleCallChannelForwarder.cs


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