예제 #1
0
파일: GanttView.cs 프로젝트: alex765022/IBN
        public SpanElement CreateSpanElement(string id, string type, string tag)
        {
            SpanElement element = new SpanElement(this, id, type, tag);

            AddElement(element, _body);
            return(element);
        }
예제 #2
0
파일: GanttView.cs 프로젝트: alex765022/IBN
        private Element LoadElement(XPathNavigator node)
        {
            Element element = null;

            switch (node.Name)
            {
            case DataElement.ElementName:
                _data = new DataElement(this, node);
                if (_data.StartDate != null)
                {
                    _startDate = _data.StartDate.Value;
                }
                element = _data;
                break;

            case HeadElement.ElementName:
                _head   = new HeadElement(this, node);
                element = _head;
                break;

            case BodyElement.ElementName:
                _body   = new BodyElement(this, node);
                element = _body;
                break;

            case CalendarElement.ElementName:
                _calendar = new CalendarElement(this, node);
                element   = _calendar;
                break;

            case DayElement.ElementName:
                element = new DayElement(this, node);
                break;

            case AxisElement.ElementName:
                AxisElement axis = new AxisElement(this, node);
                axis.ViewStartDate = _startDate;
                _axes.Add(axis);
                element = axis;
                break;

            case SpanElement.ElementName:
                element = new SpanElement(this, node);
                break;

            case IntervalElement.ElementName:
                element = new IntervalElement(this, node);
                break;

            case PointElement.ElementName:
                element = new PointElement(this, node);
                break;

            case RelationElement.ElementName:
                RelationElement relation = new RelationElement(this, node);
                relation.Origin = _map[relation.OriginId];
                relation.Target = _map[relation.TargetId];
                element         = relation;
                break;

            default:
                element = new GanttElement(this, node);
                break;
            }

            if (element != null)
            {
                AddElementToMap(element);

                if (node.HasChildren)
                {
                    foreach (XPathNavigator childNode in node.SelectChildren(XPathNodeType.Element))
                    {
                        Element childElement = LoadElement(childNode);
                        if (childElement != null)
                        {
                            element.AddChild(childElement);
                        }
                    }
                }
            }

            return(element);
        }