delegates

Proxies / delegates in Scala

I've seen several Scala questions recently (e.g. here, here, and here) that called for the use of proxies, and it's come up more than once in my own work. The Scala library has a number of proxy traits (14, if I counted correctly). Proxy classes/traits usually contain lots of boilerplate: class FooProxy(val self: Foo) extends Foo { ...

UITableView as Picker

I want to use a tableview as a picker. For example, when selecting a ringtone for a contact a tableview of ring tones appears. What is the ideal way to accomplish this? It seems like this would be very common. Thanks for your time. ...

Delegate Function .net

Having problem understanding Delegate error. Error says expression expected, How do I fix? Thanks for any help. Here is the offending line (#259).... mylist.ForEach(Delegate Function(P As linkItem) As System.Char[] ) Here is the entire code. <script language="VB" runat="server"> Function sectionTitle(ByRef f As String) ...

Invoke a delegate on a specific thread C#

Is there any way to get a delegate to run on a specific thread? Say I have: CustomDelegate del = someObject.someFunction; Thread dedicatedThread = ThreadList[x]; Can I have a consistent background long running thread and invoke my own delegates on it whenever I need it. It has to be the same thread each time. [Edit] The reason why...

Setting delegate in subclass when theres two possible delegates in parent classes.

Hi I'm getting a warning when I set the delegate for UIImagePickerController. It's because UIImagePickerController and its parent UINavigationController both have delegates that can be used. The code works fine but just wondering how to handle delegates and inheritance properly and lose the warning. So basically I've created my own MyI...

problem with generics delegate

Hi All, I am new to c#. I am trying to declare a delegate function which takes 2 generics inputs. I am having problems compile it. can anyone tell me what is the problem here. delegate int ippcFuncPtr<in T1, in T2>(T1 param, T2 returnval); static int ippcServerRegisterProcedure(int handle, string procedureName, ippcFuncPtr<in T1,...

Using non-modalview delegation for iPhone

Okay, I understand how to work delegation in a modal view to send a message to the parentviewcontroller but what if I wanted to do that with 2 views that dont have that parent-child relationship? I have a navigation controller that flips over a modal view and then that modal view pushes a new view controller. How do I let that pushed vi...

jQuery delegate problem

This is my first question on SO, so if it seems beyond dumb, please take it easy on me. I have a page with a list of pictures with links for deletion underneath them and with possibility to add more pictures. After each one of this events (that does a #user_gallery load like below, I have to click twice the delete link for it to work. W...

Deserializing legacy (binary) file after refactoring.

I'm attempting to re-organize my application's namespace hierarchy, so I'm using a System.Runtime.Serialization.SerializationBinder sub-class to attempt to handle the renaming. (Most of my renamed classes are correctly deserialized into their new namespaces without problems.) The problem I have is that one of my serialized classes (whi...

Handling events from Word using dynamic com interop from C#

From Silverlight 4, it's pretty easy to start Word and let the user do something: dynamic word = System.Runtime.InteropServices.Automation.CreateObject("Word.Application"); word.Visible = true; word.Documents.Open("test.doc"); MS Word exposes a Quit event[1]. I'd like to handle this event, but for the life of me I can't figure out how...

What is actually happening with IQueryable.Where()?

This is is returning a boolean based on whether or not there are some matching IDs. from t in getAll select new Result { ... bool DetailsAvailable = (db.SaveTrackings.Where(s => s.BundleID == t.bundleID && s.UserID == t.userID) .Count() > 0) ? true : f...

"Method is not supported" error when trying to invoke a delegate

I have a function Run(string, string[]) which I want to run on a separate thread, so I am using a delegate and BeginInvoke: private Func<string, string[], Stack<StackItem>> runner; public MainPage() { runner = Run; } private void btnStep_Click(object sender, RoutedEventArgs e) { // snip runner.BeginInvoke(tbCode.Text, GetA...

Disable Resharper with comment

Edit: Problem is solved by updating. Resharper is really annoying me and marking code that is 100% correct as wrong, it keeps wanting me to change an Action to an Action<T1,T2...Tn> when this obviously incorrect. It flashes everytime I type something so is really distracting. Is there a way to disable resharper totally inbetween two c...

Another Delegate for ASIHTTPRequest Asynchronous?

How can I create a new file containing just it's own delegate so that I can make an ASIHTTPRequest with its own asynchronous ending, and something easy enough where I just need to set [request setDelegate:self]; to something like [request setDelegate:AlternateDelegate]; and just add an include at the begining of the document to reference...

What is +=symbol called in Adding multiple delegates to a delegate object?

public delegate void ExecuteCallback(); class Executioner { private ExecuteCallback _doExecute; public void AddMultiple() { // Add a delegate to MethodA // This will work even if _doExecute is currently null _doExecute += new Execute( MethodA ); // Add a delegate to MethodB also _doExecute += new Execute( Meth...

UITableView delegate action when tableView is scrolled?

Hey! Is there a UITableView delegate-action that runs when the tableView is being scrolled? This is probably really easy, but I can't find it. Thank you :) ...

How to convert this C# code to Visual basic

Im not sure how to convert C# code with delegate into Visual basic code, can you help me? List<XmlUser> matchingUsers = this.Store.Users.FindAll(delegate(XmlUser user) { return user.Email.Equals(emailToMatch, StringComparison.OrdinalIgnoreCase); } ); ...

Delegate functions not being called

Hi all, Long time lurker, first time poster. I'm making a ServerConnection module to make it a whole lot modular and easier but am having trouble getting the delegate called. I've seen a few more questions like this but none of the answers fixed my problem. ServerConnection is set up as a protocol. So a ServerConnection object is cre...

Assignment with TResult Func<in T, out TResult>

I wonder if I can do assignment using TResult<in T, out TResult> I can retrieve the value of the property of a class instance with that delegate as below: class Program { class MyClass { public int MyProperty { get; set; } } static void Main(string[] args) { Func<MyClass, int> orderKeySelector = o =>...

Getting a series of methods completed before UITableView delegate methods are called

Hi. I have a bunch of connection related methods that I need to execute before the table is actually being populated (before any of the delegate methods for a UITableView are called). The connection methods will add objects in a NSMutableArray that will later be used to populate the table view. Is there a way to tell the iPhone to wait...