public void TestGetValues() { Lazy <object> lazy1 = new Lazy <object>(); Lazy <object> lazy2 = new Lazy <object>(); Lazy <object>[] test = new Lazy <object>[] { lazy1, lazy2 }; // test static method Utilities.TestSequenceEqual(Lazies.GetValues(test), lazy1.Value, lazy2.Value); // test extension method Utilities.TestSequenceEqual(test.GetValues(), lazy1.Value, lazy2.Value); }
private void listView_MouseUp(object sender, MouseEventArgs e) { Control control = sender as Control; object target = null; // TODO if (e.Button == MouseButtons.Right) { IEnumerable <object> commands = ContextMenuCommandProvider.GetCommands( Lazies.GetValues(m_contextMenuCommandProviders), m_eventSequenceContext, target); Point screenPoint = control.PointToScreen(new Point(e.X, e.Y)); m_commandService.RunContextMenu(commands, screenPoint); } }
private void resourcesListView_MouseUp(object sender, MouseEventArgs e) { // in case of right click if (e.Button == MouseButtons.Right) { Control control = sender as Control; object target = null; IEnumerable <object> commands = ContextMenuCommandProvider.GetCommands( Lazies.GetValues(m_contextMenuCommandProviders), m_resourcesListViewAdapter, target); Point screenPoint = control.PointToScreen(new Point(e.X, e.Y)); m_commandService.RunContextMenu(commands, screenPoint); } }