Inheritance: nHydrate.Generator.Common.GeneratorFramework.BaseModelObjectController
        public override void Refresh()
        {
            try
            {
                if ((this.TreeView != null) && (this.TreeView.InvokeRequired))
                {
                    this.TreeView.Invoke(new EmptyDelegate(this.Refresh));
                    return;
                }

                this.Text               = "Composites";
                this.Name               = "Composites";
                this.ImageIndex         = ImageHelper.GetImageIndex(TreeIconConstants.FolderClose);
                this.SelectedImageIndex = this.ImageIndex;

                var tableCompositeCollection = (TableCompositeCollection)this.Object;

                //Add new nodes
                foreach (TableComposite composite in tableCompositeCollection)
                {
                    if (this.Nodes.Find(composite.Key, false).Length == 0)
                    {
                        var tc = new TableCompositeController(composite);
                        tc.Node.Name = composite.Key;
                        tc.Node.Text = composite.Name;
                        this.Nodes.Add(tc.Node);
                    }
                }

                //Rename nodes if name change
                foreach (TreeNode node in this.Nodes)
                {
                    var item = tableCompositeCollection.FirstOrDefault(x => x.Key == node.Name);
                    if ((item != null) && (node.Text != item.Name))
                    {
                        node.Text = item.Name;
                    }
                }

                //Remove non-existing nodes
                for (var ii = this.Nodes.Count - 1; ii >= 0; ii--)
                {
                    var node = (TableCompositeNode)this.Nodes[ii];
                    if (tableCompositeCollection.GetByKey(node.Name) == null)
                    {
                        this.Nodes.RemoveAt(ii);
                    }
                }

                this.Sort();

                this.Controller.UIControl.Refresh();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
		public override void Refresh()
		{
			try
			{
				if ((this.TreeView != null) && (this.TreeView.InvokeRequired))
				{
					this.TreeView.Invoke(new EmptyDelegate(this.Refresh));
					return;
				}

				this.Text = "Composites";
				this.Name = "Composites";
				this.ImageIndex = ImageHelper.GetImageIndex(TreeIconConstants.FolderClose);
				this.SelectedImageIndex = this.ImageIndex;

				var tableCompositeCollection = (TableCompositeCollection)this.Object;

				//Add new nodes      
				foreach (TableComposite composite in tableCompositeCollection)
				{
					if (this.Nodes.Find(composite.Key, false).Length == 0)
					{
						var tc = new TableCompositeController(composite);
						tc.Node.Name = composite.Key;
						tc.Node.Text = composite.Name;
						this.Nodes.Add(tc.Node);
					}
				}

				//Rename nodes if name change
				foreach (TreeNode node in this.Nodes)
				{
					var item = tableCompositeCollection.FirstOrDefault(x => x.Key == node.Name);
					if ((item != null) && (node.Text != item.Name)) node.Text = item.Name;
				}

				//Remove non-existing nodes
				for (var ii = this.Nodes.Count - 1; ii >= 0; ii--)
				{
					var node = (TableCompositeNode)this.Nodes[ii];
					if (tableCompositeCollection.GetByKey(node.Name) == null)
					{
						this.Nodes.RemoveAt(ii);
					}
				}

				this.Sort();

				this.Controller.UIControl.Refresh();

			}
			catch (Exception ex)
			{
				throw;
			}

		}
Esempio n. 3
0
 public TableCompositeNode(TableCompositeController controller)
     : base(controller)
 {
 }
Esempio n. 4
0
		public TableCompositeNode(TableCompositeController controller)
			: base(controller)
		{
		}