I know that it's possible to implicitly provide asynchronous interaction using:
Asynchronous Delegates
Asynchronous Callbacks
I was just wondering what other methods .Net supports for asynchronous interaction?
Help greatly appreciated.
Regards
EDIT:
Maybe I didn't explain myself correctly....
I UNDERSTAND THREADING AND CONCURRENC...
Hello there,
I am thinking to create a Custom Control button that would do a CRUD tasks for me. Let me elaborate:
I wanted something that save time to writeup code on every UI for CRUD tasks. I am here becuause I want to make sure the approach I am taking should be verified before I am putting hours and taking strain.
A Custom (could ...
I want to create a class that initializes a timer which will be used as a central core for other class members to register themselves for the timer elapsed event. My problem is that I don't really know how to expose the timer elapsed event to other classes. One solution, that I think might work is that I simply expose the timer as a publ...
Let's say I have an interface IMyInterface<T> that simply describes one function:
public interface IMyInterface<T>
{
T MyFunction(T item);
}
I could just about replace this with Func<T, T>, but I want the interface for semantic reasons. Can I define an implicit conversion between that interface and Func<T,T> such that I could pas...
Hi all,
I'm surfing through the wonderful blog maintained by Scott Stevenson, and I'm trying to understand a fundamental Objective-C concept of assigning delegates the 'assign' property vs 'retain'. Note, the both are the same in a garbage collected environment. I'm mostly concerned with a non-GC based environment (eg: iPhone).
Directl...
I'm using a SDK for a usb camera. The SDK specifies that for each frame grabbed, a callback function will be called. The callback function is defined inside the SDK, it gets a data pointer to the image and a structure used to interpret the data.
All of that works correctly.
To make a useful application out of that, I need to access a f...
The docs for both DynamicInvoke and DynamicInvokeImpl say:
Dynamically invokes (late-bound) the
method represented by the current
delegate.
I notice that DynamicInvoke and DynamicInvokeImpl take an array of objects instead of a specific list of arguments (which is the late-bound part I'm guessing). But is that the only differe...
Duplicate of: How to ensure an event is only subscribed to once
and Has an event handler already been added?
I have a singleton that provides some service and my classes hook into some events on it, sometimes a class is hooking twice to the event and then gets called twice.
I'm looking for a classical way to prevent this from happening....
I have what I think is a simple "problem" to which I have found a couple of solutions but I am not sure which way to go andn the best practice in C#.
I have a master object (say a singleton) instanciated once during the lifespan of the application. This "MasterClass" creates a bunch of new type of objects, say "SlaveClass" every time Ma...
Hi,
Sorry for the poor explaination of the problem
Totally rewriting question
I have the following method:
public TReturn FindCached<TSearch, TReturn>(Func<TSearch, TReturn> searchMethod)
where TSearch : ISearchSpecification
where TReturn : class
{
SearchSpecification spec = new GetConcre...
Hello,
I want to emit a method that returns a Func<>. Inside this method I have to create a delegate or a lambda expression which exactly serves the return type.
Altogether it should look like this:
// I have a resolve method that will be called inside my missing method
// This is it's signature:
object Resolve( params object[] args);...
I have a drop down list that is populated by inspecting a classes methods and including those that match a specific signature. The problem is in taken the selected item from the list and getting the delegate to call that method in the class. The first method works, but I cannot figure out part of the second.
For example,
public...
I have a button in a grid that I created programmatically. The button edits some data in a table using data in a hidden column of the grid that the button is in. Normally I send a hidden field the row data using javascript onclientclick of the button then make the changes to the database using that hidden field. But there must be a way t...
Delegates, would those apply here? If so, how? Code examples, as I am new to this area.
Logic separation is what I am intending to implement and I think my task below would be a perfect candidate. I have read that objects should be fairly independent and not hard wired to one another.
ASPX (Page)
<uc1:Attachment ID="Attachment1" runat...
Looking at the signatures for the Func and Converter delegates,
public delegate TResult Func<T, TResult>(T arg);
public delegate TOutput Converter<TInput, TOutput>(TInput input);
I'm struggling to see the difference between the two. Surely, if we rename the generic type arguments, they essentially amount to the same thing?
Can anyon...
I have the functions in my class with this signatures,
public static TResult Execute<TResult>(Func<T, TResult> remoteCall);
public static void Execute(Action<T> remoteCall)
How can I pass the same delegate in the second method to the first one? Creating method with Delegate argument is not a way, because I am loosing some exception i...
I've noticed that the Delegate class has a Target property, that (presumably) returns the instance the delegate method will execute on. I want to do something like this:
void PossiblyExecuteDelegate(Action<int> method)
{
if (method.Target == null)
{
// delegate instance target is null
// do something
}
...
What are useful definitions for the common methods of passing a method or function as data, such as:
Delegates
Closures
Function pointers
Invocation by dynamic proxy and
First class methods?
...
I'm writing a class for managing my threading. How do I pass my method that needs threading into my helper class?
All that I'll be doing is creating a new thread and passing the method I've passed through into a new ThreadStart().
Thanks in advance.
...
I have been using a class to play sounds using AVAudioPlayer. Since I want to release these sounds right after they are played, I added a delegate. That causes a "_NSAutoreleaseNoPool(): Object 0x55e060 of class NSCFString autoreleased with no pool in place - just leaking" error right after the sound completes playing, but before my -a...