本文整理汇总了C#中IBinder类的典型用法代码示例。如果您正苦于以下问题:C# IBinder类的具体用法?C# IBinder怎么用?C# IBinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBinder类属于命名空间,在下文中一共展示了IBinder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Formula
/// <summary>
/// Instantiates a new Formula predicate.
/// </summary>
/// <param name="resolutionType">The type of resolution for the formula.</param>
/// <param name="bob">The business object binder to use when evaluating the formula, or null.</param>
/// <param name="expression">The expression value, i.e. the C# code source that should be computable.</param>
/// <param name="evaluator">A precompiled evaluator, or null.</param>
private Formula(FormulaResolutionType resolutionType, IBinder bob, string expression, IDictionaryEvaluator evaluator):base(expression) {
this.resolutionType = resolutionType;
this.bob = bob;
this.expression = expression;
this.evaluator = evaluator;
this.functionSignature = null;
}
示例2: RecordTime_Manual
public static void RecordTime_Manual(
DateTime startTime,
IBinder binder,
TextWriter logger)
{
RecordTime(binder, logger);
}
示例3: OnBind
// This gets called once, the first time any client bind to the Service
// and returns an instance of the LocationServicethis._binder. All future clients will
// reuse the same instance of the this._binder
public override IBinder OnBind (Intent intent)
{
Log.Debug (this._LogTag, "Client now bound to service");
this._binder = new TaskBinder (this);
return this._binder;
}
示例4: RecordTime_Queue
public static void RecordTime_Queue(
[QueueTrigger("test")] object args,
IBinder binder,
TextWriter logger)
{
RecordTime(binder, logger);
}
示例5: RibNinjectModule
protected RibNinjectModule([NotNull] IBinderHelper binderHelper, [NotNull] IBinder binder)
{
if (binderHelper == null) throw new ArgumentNullException(nameof(binderHelper));
if (binder == null) throw new ArgumentNullException(nameof(binder));
_binderHelper = binderHelper;
_binder = binder;
}
示例6: OnServiceConnected
public void OnServiceConnected(ComponentName name, IBinder binder)
{
_binder = binder as AndroidSensusServiceBinder;
if (_binder != null && ServiceConnected != null)
ServiceConnected(this, new AndroidServiceConnectedEventArgs(_binder));
}
示例7: PerformProcess
public void PerformProcess(IBinder binder)
{
// generate dummy business objects
IDictionary businessObjects = DummyData.GetInstance().GetBusinessObjects(nbDecaCustomers);
// instantiate an inference engine, bind my data and process the rules
IInferenceEngine ie = new IEImpl(binder);
ie.LoadRuleBase(new RuleML09NafDatalogAdapter(ruleBaseFile, System.IO.FileAccess.Read));
ie.Process(businessObjects);
// processing is done, let's analyze the results
IList<IList<Fact>> qrs = ie.RunQuery("Fraudulent Customers");
Console.WriteLine("\nDetected {0} fraudulent customers.", qrs.Count);
if (qrs.Count != 2 * nbDecaCustomers)
Console.WriteLine("\nError! " + 2* nbDecaCustomers + " was expected.");
// check if the customer objects have been flagged correctly
int flaggedCount = 0;
foreach(Customer customer in (ArrayList)businessObjects["CUSTOMERS"])
if (customer.Fraudulent)
flaggedCount++;
if (flaggedCount != 2 * nbDecaCustomers)
throw new Exception("\nError! " + 2* nbDecaCustomers + " flagged Customer objects were expected.\n");
else
Console.WriteLine("\nCustomer objects were correctly flagged\n");
}
示例8: OnBind
// This gets called once, the first time any client bind to the Service
// and returns an instance of the LocationServiceBinder. All future clients will
// reuse the same instance of the binder
public override IBinder OnBind (Intent intent)
{
Log.Debug (logTag, "Client now bound to service");
binder = new LocationServiceBinder (this);
return binder;
}
示例9: OnServiceConnected
public void OnServiceConnected (ComponentName name, IBinder service)
{
Service = IAdditionServiceStub.AsInterface(service);
_activity.Service = (IAdditionService) Service;
_activity.IsBound = Service != null;
}
示例10: BindAsync
public override async Task BindAsync(IBinder binder, Stream stream, IReadOnlyDictionary<string, string> bindingData)
{
string boundQueueName = QueueName;
if (bindingData != null)
{
boundQueueName = _queueNameBindingTemplate.Bind(bindingData);
}
if (FileAccess == FileAccess.Write)
{
Stream queueStream = binder.Bind<Stream>(new QueueAttribute(boundQueueName));
await queueStream.CopyToAsync(stream);
}
else
{
IAsyncCollector<byte[]> collector = binder.Bind<IAsyncCollector<byte[]>>(new QueueAttribute(boundQueueName));
byte[] bytes;
using (MemoryStream ms = new MemoryStream())
{
stream.CopyTo(ms);
bytes = ms.ToArray();
}
await collector.AddAsync(bytes);
}
}
示例11: OnBind
public override IBinder OnBind(Intent intent)
{
// This method must always be implemented
Log.Debug(TAG, "OnBind");
this.Binder = new TimestampBinder(this);
return this.Binder;
}
示例12: OnBeforeAddBinding
/// <summary>
/// Handles the before add binding container event.
///
/// Used to ensure the binding value is a <see cref="UnityEngine.MonoBehaviour"/>.
/// </summary>
/// <param name="source">Source.</param>
/// <param name="binding">Binding.</param>
protected void OnBeforeAddBinding(IBinder source, ref BindingInfo binding)
{
if (binding.value is Type &&
TypeUtils.IsAssignable(typeof(MonoBehaviour), binding.value as Type)) {
throw new BindingException(CANNOT_RESOLVE_MONOBEHAVIOUR);
}
}
示例13: QueueToBlob
/// <summary>
/// Reads a message from the "orders" queue and writes a blob in the "orders" container
/// </summary>
public static void QueueToBlob(
[QueueTrigger("orders")] string orders,
IBinder binder)
{
TextWriter writer = binder.Bind<TextWriter>(new BlobAttribute("orders/" + orders));
writer.Write("Completed");
}
示例14: SetUp
public void SetUp()
{
testCommand = Substitute.For<CommandTest>();
testBinder = Substitute.For<IBinder>();
testSignal = new TestSignal();
testSignal.injector = testBinder;
}
示例15: OnServiceConnected
public void OnServiceConnected(ComponentName name, IBinder service)
{
var mediaPlayerServiceBinder = service as MediaPlayerServiceBinder;
if (mediaPlayerServiceBinder != null)
{
instance.OnServiceConnected(mediaPlayerServiceBinder);
}
}