CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of delegate
C#
//Calling Code for VM to pass message box delegate
Func<string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult> messageBox = (msg, caption, buttons, image) => MessageBox.Show(msg, caption, buttons, image);
 
//pass above variable to VM
 
//Usage of message box delegate variable inside VM
MessageBoxResult = messageBoxinVM("Test Message", "Test Caption for Message", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
by Vijay Sharma   January 13, 2011 @ 2:13am
345 Views
no comments
 
C#
// Create a handler for a click event
button1.Click += delegate(System.Object o, System.EventArgs e)
                   { System.Windows.Forms.MessageBox.Show("Click!"); };
 
// Create a delegate instance
delegate void Del(int x);
 
// Instantiate the delegate using an anonymous method
Del d = delegate(int k) { /* ... */ };
by bnaya   January 16, 2010 @ 2:50am
212 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    public class T3
    {
        public delegate void del1();
by afsharm   September 30, 2009 @ 3:36am
294 Views
no comments
 
C#
public void LogSnippetViewAsync(string snippetId, string ipAddress, string userAgent)
{
    Func<string, string, string, bool> del = this.LogSnippetView; 
    del.BeginInvoke(snippetId, ipAddress,userAgent,null,null);            
}
 
public bool LogSnippetView(string snippetId, string ipAddress, string userAgent)
{
    if (string.IsNullOrEmpty(userAgent))
        return false;
by Rick Strahl   September 24, 2009 @ 3:31pm
543 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate