public UserList(Channel channel) { Channel = channel; Size = new Size(150, 100); tree = new TreeView(); tree.Style = "userList"; tree.Activated += HandleActivated; items = new TreeItemCollection(); items.Add(owners = new TreeItem { Text = "Room Owners", Expanded = true }); items.Add(online = new TreeItem { Text = "Online", Expanded = true }); items.Add(away = new TreeItem { Text = "Away", Expanded = true }); if (Generator.IsMac) { foreach (var item in items.OfType <TreeItem>()) { item.Text = item.Text.ToUpperInvariant(); } } tree.DataStore = items; Content = tree; }
public PackageInspector() { XamlReader.Load(this); TreeItemCollection treeItems = new TreeItemCollection(); treeItems.Add(this.treeBundleEntries = new TreeItem { Text = "File Entries" }); treeItems.Add(this.treeReferenceEntries = new TreeItem { Text = "Footer Entries" }); this.treeEntries.DataStore = treeItems; }
public void Modify(object sender, EventArgs args) { data.Modify(); tdata.Add(new TreeItem() { Text = "HI" }); testTree.RefreshData(); }
void HandleServerAdded(object sender, ServerEventArgs e) { Application.Instance.Invoke(delegate { servers.Add(e.Server); Register(e.Server); Update(true); channelList.SelectedItem = e.Server; OnChannelChanged(EventArgs.Empty); }); }
public UserList (Channel channel) { this.Channel = channel; tree = new TreeView (); tree.Style = "userList"; tree.Activated += HandleActivated; items = new TreeItemCollection (); items.Add (owners = new TreeItem { Text = "Room Owners", Expanded = true }); items.Add (online = new TreeItem { Text = "Online", Expanded = true }); items.Add (away = new TreeItem { Text = "Away", Expanded = true }); if (Generator.ID == Generators.Mac) { foreach (var item in items.OfType<TreeItem>()) { item.Text = item.Text.ToUpperInvariant(); } } tree.DataStore = items; this.AddDockedControl (tree); }
private void resyncDatabases() { try { ignoreSelectionChanged = true; //SuspendLayout(); if (openedDatabases == null) { return; } //remove closed databases foreach (var child in tree.OfType <OpenedDatabaseTreeItem>() .Where(child => !openedDatabases.Contains(child.Database)) .ToArray()) { tree.Remove(child); } //add newly opened databases var children = tree.OfType <OpenedDatabaseTreeItem>().ToArray(); foreach (var item in openedDatabases .Where(db => children.All(child => child.Database != db)) .Select(db => new OpenedDatabaseTreeItem(parentViewModel, this, db) { Expanded = true })) { tree.Add(item); RefreshItem(item); } var selectedItem = parentViewModel.SelectedDatabase; SelectedItem = tree .OfType <OpenedDatabaseTreeItem>() .FirstOrDefault(item => string.Equals(item.Database.FilePath, selectedItem?.FilePath)); } catch (Exception error) { parentViewModel.Log.Error(error); MessageBox.Show(error.Message, "Opened Database Resync Error", MessageBoxButtons.OK, MessageBoxType.Error); } finally { ignoreSelectionChanged = false; //ResumeLayout(); } }
public UserList(Channel channel) { Channel = channel; Size = new Size(150, 100); tree = new TreeView(); tree.Style = "userList"; tree.Activated += HandleActivated; items = new TreeItemCollection(); items.Add(owners = new TreeItem { Text = "Room Owners", Expanded = true }); items.Add(online = new TreeItem { Text = "Online", Expanded = true }); items.Add(away = new TreeItem { Text = "Away", Expanded = true }); if (Generator.IsMac) { foreach (var item in items.OfType<TreeItem>()) { item.Text = item.Text.ToUpperInvariant(); } } tree.DataStore = items; Content = tree; }
void Init() { EntityBlobPair ebpair = (EntityBlobPair)DataContext; List <TreeHierarchyDB> childBlobs = ebpair.Blob.ChildrenDBs; TreeItemCollection treeItemCollection = new TreeItemCollection(); TreeItem treeitemroot = new TreeItem(); treeitemroot.Text = ebpair.Entity.GetDataBlob <NameDB>().DefaultName; NewTreeItem(treeitemroot, ebpair); treeItemCollection.Add(treeitemroot); TreeViewcontrol.DataStore = treeItemCollection; }
private void SetupTreeItems() { this.AssetsTree = new TreeItem() { Text = "assets", Image = Definitions.FolderIcon["open"], Tag = this.Browser.Root }; //AssetsTree.Expanded = true; this.AssetsTree.Expanded = true; this.Browser.Root.AddToTree(this.AssetsTree, this._focused_package); TreeItemCollection treeItemColl = new TreeItemCollection(); treeItemColl.Add(this.AssetsTree); this.treeMain.DataStore = treeItemColl; }
protected virtual void OnDeviceAdded(object sender, DeviceRepositoryEventArgs args) { devices.Add(args.Device); args.Device.ApplicationsChanged += (_sender, e) => OnDeviceApplicationsChanged(_sender as Device); treeView.RefreshData(); }