I have a page with a form in a user control. When the button is clicked the validation methods are called correctly client side and server side, but the delegate method is not processed.
ASPX Page
<%@ Control Language="C#" AutoEventWireup="false"...
...
<asp:Button runat="server" ID="btnSubmit" />
...
Codebehind
protected override ...
This is a terminology question. In C#, I can do this:
delegate Stream StreamOpenerDelegate(String name);
void WorkMethod(StreamOpenerDelegate d)
{
// ...
}
void Exec1()
{
WorkMethod((x) =>
{
return File.OpenRead(x);
});
}
void Exec2()
{
StreamOpenerDelegate opener = (x) =>
{
...
Is it possible to translate the following C# code into VB.NET, using VB 9.0?
delegate Stream StreamOpenerDelegate(String name);
void Exec1()
{
WorkMethod( x => File.OpenRead(x));
}
void Exec2()
{
StreamOpenerDelegate opener = x => return File.OpenRead(x) ;
WorkMethod(opener);
}
Can I do something like this?:
Private Del...
Hi,
I've got a very simple app where the user selects a UIImageView and presses a button to take a photo with the camera. The image is then returned and displayed in the UIImageView.
However, since the UIImageViews are sharing the same delegate, when there's already an image in one of the UIImageViews, and I go to take a photo to be pl...
I have read and understand the answer given in this question:
http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c
However, I wish to set a delegate to my main application window and was wondering where in my application I can do that - in my AppDelegate class, or somewhere else?
...
How do you connect the "delegate" outlet of a UITextView to a class that implements UITextViewDelegate protocol?
I can't seem to find an example in the docs
The weird thing is the UITextView's "delegate" outlet has that drag 'n drop interface thingy, like you can wire it up to another widget but of course, I don't want to wire it up to...
Guys anyone please let me know difference between Delegate & Delegate Methods and its differences and its usages ???
...
So, I'm sure this has been answered somewhere out there before, but I couldn't find it anywhere. Hoping some generics guru can help.
public interface IAnimal{}
public class Orangutan:IAnimal{}
public void ValidateUsing<T>(Action<T> action) where T : IAnimal
{
Orangutan orangutan = new Orangutan();
action...
Hey, I'm looking for useful resources about Delegates. I understand that the delegate sits in the background and receives messages when certain things happen - e.g. a table cell is selected, or data from a connection over the web is retrieved.
What I'd like to know in particular is how to use delegates with multiple objects. As far as ...
when i am trying to combine flipsideview and navigation view i am getting following error
"request for member 'delegate' is something not in a structure or union" on the line controller.delegate = self;
...
Hi all ,
I want to use custom delegate in my search tab.
I have never used my own custom delegate in any application ( this is the just second one ).
The scenario is as below :
In the search utility ,If I am pressing select category , a modal view controller will be presented in that I am passing a category controller as a parameter...
In order to understand the Monitor I have implemented the following code.But I am not sure whether the code is Thread Safe.
namespace MonitorExample
{
public delegate void WaterLevelInformer(object sender,WaterLevelArgs e);
class WaterLevelListener
{
//listener will print information
// when WaterTank is rea...
Hello,
I have a problem that has been plaguing me for awhile now, I have come up with a solution which I will detail below, and although it seems to be working well I'm not super enthusiastic about it from a design point of view and I'm curious if anyone would have any recommendations about a better way to do this.
Basically, I have a s...
1) I heard that when we won't call EndInvoke() it may lead to memory leak? can you demonstrate it how could this lead to memory leak?
2) When i suppose to call EndInvoke() shall i use the code like following ?
namespace BlockMechanism
{
public delegate int MyDelegate(List<int> someInts);
class MainClass
{
static v...
Hello
There is a set of methods like:
Foo(int, float, params objects[])
Goo(int, params objects[])
Too()
each taking different number of & type of parameters (so are return values).
I read an integer (an index) from a database. The integer corresponds to one of the above mehtod (1 for Foo, 2 for Goo and 3 for Too).
How do I st...
I am adding range of integers (101,105) using Func<> delegate.I suppose to get 101,102,..105 as output while executing the following.But I am getting 204,204,.....
What went wrong?
class MainClass
{
static List<Func<int>> somevalues = new List<Func<int>>();
static void Main()
{
foreach (int r in E...
Is there any best practice with respect to coding style with respect to explicit use of the delegate keyword instead of using a lambda?
e.g.
new Thread(() =>
{
// work item 1
// work item 2
}).Start();
new Thread(delegate()
{
// work item 1
// work item 2
}).Start();
I think the lambda looks better. If the lambda is better style...
How to implement case insensitive comparison?
List<Person> persons = new List<Person>();
persons.Add(new Person("P005", "Janson"));
persons.Add(new Person("P002", "Arnold"));
persons.Add(new Person("P007", "Kazhal"));
persons.Sort((p1, p2) => p1.Name.CompareTo(p2.Name));
...
I'm attempting to get the TwainDotNet solution I found here (http://stackoverflow.com/questions/476084/c-twain-interaction) to compile, and I'm at my wits end.
This solution was obviously developed in VS 2008, and I'm working in 2005 (no choice at the moment). I've spent probably WAY to much time getting this all to compile in 2005, an...
Hi,
I have a thread running in the background that periodically tries to update a ListView component, but every time it attempts to I get a "Cross-thread operation not valid: Control 'dlList' accessed from a thread other than the thread it was created on." error. I have used a delegate to try and solve this but it isn't fixing the probl...