Format:
Recent snippets matching tags of delegate
//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);
345 Views
no comments
// 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) { /* ... */ };
212 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { public class T3 { public delegate void del1();
294 Views
no comments
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;
543 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
