예제 #1
0
		public static Rectangle GetNodeRectangle(eNodeRectanglePart part, Node node, Point offset)
		{
			Rectangle r=Rectangle.Empty;
			if(part==eNodeRectanglePart.CellsBounds)
			{
				r=node.CellsBoundsRelative;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}
            else if (part == eNodeRectanglePart.ExpandHitTestBounds)
            {
                Rectangle nodeBounds = GetNodeRectangle(eNodeRectanglePart.NodeBounds, node, offset);

                r = node.ExpandPartRectangleRelative;
                if (!r.IsEmpty)
                {
                    r.Offset(offset);
                    r.Offset(node.BoundsRelative.Location);
                }
                r.Y = nodeBounds.Y;
                r.Height = nodeBounds.Height;
                r.Inflate(1, 0);
            }
			else if(part==eNodeRectanglePart.ExpandBounds)
			{
				r=node.ExpandPartRectangleRelative;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}
			else if(part==eNodeRectanglePart.CommandBounds)
			{
				r=node.CommandBoundsRelative;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}	
			else if(part==eNodeRectanglePart.NodeContentBounds)
			{
				r=node.ContentBounds;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}
			else if(part==eNodeRectanglePart.NodeBounds)
			{
				r=node.BoundsRelative;
				if(!r.IsEmpty)
					r.Offset(offset);
			}
            else if (part == eNodeRectanglePart.ChildNodeBounds)
            {
                r = node.ChildNodesBounds;
                if (!r.IsEmpty)
                {
                    //r.Offset(node.Bounds.Location);
                    r.Offset(offset);
                }
            }
            else if (part == eNodeRectanglePart.ColumnsBounds && HasColumnsVisible(node))
            {
                r = node.NodesColumns.Bounds;
                if(!r.IsEmpty)
                    r.Offset(offset);
            }
			return r;
		}
예제 #2
0
		internal static Rectangle GetNodeRectangle(eNodeRectanglePart part, Node node, Point offset)
		{
			Rectangle r=Rectangle.Empty;
			if(part==eNodeRectanglePart.CellsBounds)
			{
				r=node.CellsBoundsRelative;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}
			else if(part==eNodeRectanglePart.ExpandBounds)
			{
				r=node.ExpandPartRectangleRelative;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}
			else if(part==eNodeRectanglePart.CommandBounds)
			{
				r=node.CommandBoundsRelative;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}	
			else if(part==eNodeRectanglePart.NodeContentBounds)
			{
				r=node.ContentBounds;
				if(!r.IsEmpty)
				{
					r.Offset(offset);
					r.Offset(node.BoundsRelative.Location);
				}
			}
			else if(part==eNodeRectanglePart.NodeBounds)
			{
				r=node.BoundsRelative;
				if(!r.IsEmpty)
					r.Offset(offset);
			}
			else if(part==eNodeRectanglePart.ChildNodeBounds)
			{
				r=node.ChildNodesBounds;
				if(!r.IsEmpty)
				{
					//r.Offset(node.Bounds.Location);
					r.Offset(offset);
				}
			}
			return r;
		}