private void AddImage(object sender, RoutedEventArgs e) { OpenFileDialog op = new OpenFileDialog(); op.Title = "Select a picture"; op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" + "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" + "Portable Network Graphic (*.png)|*.png"; if (op.ShowDialog() == true) { Image image = new Image(); image.Source = new BitmapImage(new Uri(op.FileName)); images++; TreeViewImage treeViewImage = new TreeViewImage($"New Images {images}", image); treeViewImage.ContextMenu = (ContextMenu)filesTreeView.Resources["fileContextMenu"]; treeViewImage.DataContext = treeViewImage; TreeViewNode node = (TreeViewNode)(sender as MenuItem).DataContext; if (node is null) { filesTreeView.Items.Add(treeViewImage); } else { node.Items.Add(treeViewImage); } } else { MessageBox.Show("Image not selected."); } }
private static void EnsureSchemaAndLeafNode( TreeNode rootNode, EntityStoreSchemaFilterEntry entry, TreeViewImage leafNodeImage) { Debug.Assert(rootNode != null, "rootNode must be non-null"); Debug.Assert(entry != null, "entry must be non-null"); var dbObj = DatabaseObject.CreateFromEntityStoreSchemaFilterEntry(entry, null); EnsureSchemaAndLeafNode(rootNode, dbObj, leafNodeImage, entry); }
protected DeclarationTreeNode(Declaration declaration, TreeViewImage imageKind, Visibility visibility) : base(imageKind, GetImageModifier(visibility), declaration) { switch (visibility) { case Visibility.Assembly: case Visibility.FamilyAndAssembly: case Visibility.Private: this.ForeColor = SystemColors.GrayText; break; } }
public static TreeNode CreateRootNodeAndDescendents( ICollection <EntityStoreSchemaFilterEntry> entries, string label, TreeViewImage rootImage, TreeViewImage leafNodeImage) { var rootNode = CreateTreeNode(label, false, null, label, rootImage, null); if (entries != null) { foreach (var entry in entries) { EnsureSchemaAndLeafNode(rootNode, entry, leafNodeImage); } } return(rootNode); }
public static TreeNode CreateTreeNode( string treeNodeText, bool treeNodeIsChecked, object treeNodeTag, string treeNodeName, TreeViewImage treeNodeImage, string treeNodeToolTip) { Debug.Assert(treeNodeName != null, "treeNodeName cannot be null"); Debug.Assert(treeNodeText != null, "treeNodeText cannot be null"); return(new TreeNode(treeNodeText, (int)treeNodeImage, (int)treeNodeImage) { Checked = treeNodeIsChecked, Name = treeNodeName, ToolTipText = treeNodeToolTip ?? String.Empty, Tag = treeNodeTag }); }
private static TreeNode FindOrCreateTreeSchemaNode( TreeNode parentNode, string schemaName, TreeViewImage schemaNodeImage) { var schemaNodes = parentNode.Nodes.Find(schemaName, false); Debug.Assert( schemaNodes.Length <= 1, "was expecting 0 or 1 nodes with name " + schemaName + ", found " + schemaNodes.Length); if (schemaNodes.Length != 0) { return(schemaNodes[0]); } // no previous node - so create one var schemaNode = CreateTreeNode(schemaName, false, null, schemaName, schemaNodeImage, null); parentNode.Nodes.Add(schemaNode); return(schemaNode); }
public static void EnsureSchemaAndLeafNode( TreeNode rootNode, DatabaseObject dbObj, TreeViewImage leafNodeImage, EntityStoreSchemaFilterEntry leafNodeTagObject) { Debug.Assert(rootNode != null, "rootNode must be non-null"); if (rootNode == null) { return; } // find or create schema node var schemaName = (dbObj.Schema ?? Resources.SelectTablesPage_NullSchemaDisplayName); var schemaNode = FindOrCreateTreeSchemaNode(rootNode, schemaName, TreeViewImage.DbDatabaseSchemaImage); Debug.Assert(schemaNode != null, "null schemaNode for rootNode with label " + rootNode.Name + ", schemaName " + schemaName); if (schemaNode != null) { // now add child node to schema node var detailNode = CreateTreeNode(dbObj.Name, false, leafNodeTagObject, dbObj.Name, leafNodeImage, null); schemaNode.Nodes.Add(detailNode); } }
public ImageDisplayingPanel(TreeViewImage image) { InitializeComponent(); TreeViewImage = image; }
private static TreeNode FindOrCreateTreeSchemaNode( TreeNode parentNode, string schemaName, TreeViewImage schemaNodeImage) { var schemaNodes = parentNode.Nodes.Find(schemaName, false); Debug.Assert( schemaNodes.Length <= 1, "was expecting 0 or 1 nodes with name " + schemaName + ", found " + schemaNodes.Length); if (schemaNodes.Length != 0) { return schemaNodes[0]; } // no previous node - so create one var schemaNode = CreateTreeNode(schemaName, false, null, schemaName, schemaNodeImage, null); parentNode.Nodes.Add(schemaNode); return schemaNode; }
public static TreeNode CreateTreeNode( string treeNodeText, bool treeNodeIsChecked, object treeNodeTag, string treeNodeName, TreeViewImage treeNodeImage, string treeNodeToolTip) { Debug.Assert(treeNodeName != null, "treeNodeName cannot be null"); Debug.Assert(treeNodeText != null, "treeNodeText cannot be null"); return new TreeNode(treeNodeText, (int)treeNodeImage, (int)treeNodeImage) { Checked = treeNodeIsChecked, Name = treeNodeName, ToolTipText = treeNodeToolTip ?? String.Empty, Tag = treeNodeTag }; }
private static void EnsureSchemaAndLeafNode( TreeNode rootNode, EntityStoreSchemaFilterEntry entry, TreeViewImage leafNodeImage) { Debug.Assert(rootNode != null, "rootNode must be non-null"); Debug.Assert(entry != null, "entry must be non-null"); var dbObj = DatabaseObject.CreateFromEntityStoreSchemaFilterEntry(entry, null); EnsureSchemaAndLeafNode(rootNode, dbObj, leafNodeImage, entry); }
public static void EnsureSchemaAndLeafNode( TreeNode rootNode, DatabaseObject dbObj, TreeViewImage leafNodeImage, EntityStoreSchemaFilterEntry leafNodeTagObject) { Debug.Assert(rootNode != null, "rootNode must be non-null"); if (rootNode == null) { return; } // find or create schema node var schemaName = (dbObj.Schema ?? Resources.SelectTablesPage_NullSchemaDisplayName); var schemaNode = FindOrCreateTreeSchemaNode(rootNode, schemaName, TreeViewImage.DbDatabaseSchemaImage); Debug.Assert(schemaNode != null, "null schemaNode for rootNode with label " + rootNode.Name + ", schemaName " + schemaName); if (schemaNode != null) { // now add child node to schema node var detailNode = CreateTreeNode(dbObj.Name, false, leafNodeTagObject, dbObj.Name, leafNodeImage, null); schemaNode.Nodes.Add(detailNode); } }
public static TreeNode CreateRootNodeAndDescendents( ICollection<EntityStoreSchemaFilterEntry> entries, string label, TreeViewImage rootImage, TreeViewImage leafNodeImage) { var rootNode = CreateTreeNode(label, false, null, label, rootImage, null); if (entries != null) { foreach (var entry in entries) { EnsureSchemaAndLeafNode(rootNode, entry, leafNodeImage); } } return rootNode; }
protected BaseTreeNode(TreeViewImage image, object tag) : this((int)image - 1, tag) { }
protected BaseTreeNode(TreeViewImage imageKind, TreeViewImage imageModifier, object tag) : this((int)imageKind - 1 + (int)imageModifier, tag) { }
protected DeclarationTreeNode(Declaration declaration, TreeViewImage image) : base(image, declaration) { }
protected DeclarationTreeNode(Declaration declaration, TreeViewImage imageKind, TreeViewImage imageModifier) : base(imageKind, imageModifier, declaration) { }