本文整理汇总了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"));
}
示例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;
}
}
示例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;
}
示例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))));
}
}
示例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;
}
示例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;
}
示例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");
}
}
示例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;
}
示例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);
}
}
示例10: ReportRecord
public ReportRecord(CallType callType, int number, DateTime date, DateTime time, int cost)
{
CallType = callType;
Number = number;
Date = date;
Time = time;
Cost = cost;
}
示例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;
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}