private void objectTree_AfterSelect(object sender, TreeViewEventArgs e) { TreeNode node = e.Node; IElementProperties elementProperties = (IElementProperties)node.Tag; propertiesListview.FillListviewWithProperties(elementProperties); }
private void lvObjects_SelectedIndexChanged(object sender, EventArgs e) { // Acquire SelectedItems reference. var selectedItems = this.lapListViewObjects.SelectedItems; if (selectedItems.Count > 0) { // Display text of first item selected. ElementProperties elementProperties = (ElementProperties)selectedItems[0].Tag; propertiesListview.FillListviewWithProperties(elementProperties); MemoryStream stream = SnapshotHelper.SnapshotFromBitmap(elementProperties.AutomationElement, _bmpDeskTop); if (stream == null) { return; } pictureBox1.Image = Image.FromStream(stream); } this.lapListViewObjects.Invalidate(true); }