示例#1
0
        internal AxisElement(GanttView view, XPathNavigator node)
            : base(view, node)
        {
            _scale    = (ScaleLevel)Enum.Parse(typeof(ScaleLevel), Attributes[ScaleName].Value);
            _interval = int.Parse(Attributes[IntervalName].Value, CultureInfo.InvariantCulture);
            _format   = Attributes[FormatName].Value;
            if (_scale == ScaleLevel.Week)
            {
                _firstDay = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), Attributes[FirstDayName].Value);
            }

            if (Attributes.ContainsKey(TitleTypeName))
            {
                string titleTypeValue = Attributes[TitleTypeName].Value;
                if (!string.IsNullOrEmpty(titleTypeValue))
                {
                    _titleType = (TitleType)Enum.Parse(typeof(TitleType), titleTypeValue);
                }
            }

            if (Attributes.ContainsKey(WidthName))
            {
                string widthValue = Attributes[WidthName].Value;
                if (!string.IsNullOrEmpty(widthValue))
                {
                    this.Width = int.Parse(widthValue, NumberStyles.Integer, CultureInfo.InvariantCulture);
                }
            }
        }
示例#2
0
        internal AxisElement(GanttView view, XPathNavigator node)
            : base(view, node)
        {
            _scale = (ScaleLevel)Enum.Parse(typeof(ScaleLevel), Attributes[ScaleName].Value);
            _interval = int.Parse(Attributes[IntervalName].Value, CultureInfo.InvariantCulture);
            _format = Attributes[FormatName].Value;
            if(_scale == ScaleLevel.Week)
                _firstDay = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), Attributes[FirstDayName].Value);

            if (Attributes.ContainsKey(TitleTypeName))
            {
                string titleTypeValue = Attributes[TitleTypeName].Value;
                if (!string.IsNullOrEmpty(titleTypeValue))
                {
                    _titleType = (TitleType)Enum.Parse(typeof(TitleType), titleTypeValue);
                }
            }

            if (Attributes.ContainsKey(WidthName))
            {
                string widthValue = Attributes[WidthName].Value;
                if (!string.IsNullOrEmpty(widthValue))
                {
                    this.Width = int.Parse(widthValue, NumberStyles.Integer, CultureInfo.InvariantCulture);
                }
            }
        }
示例#3
0
文件: GanttView.cs 项目: 0anion0/IBN
 public AxisElement CreateAxisElement(ScaleLevel scale, int interval, string format, DayOfWeek? firstDay)
 {
     AxisElement element = new AxisElement(this, scale, interval, format, firstDay);
     element.ViewStartDate = _startDate;
     _axes.Add(element);
     AddElement(element, _head);
     return element;
 }
示例#4
0
        public AxisElement CreateAxisElement(ScaleLevel scale, int interval, string format, DayOfWeek?firstDay)
        {
            AxisElement element = new AxisElement(this, scale, interval, format, firstDay);

            element.ViewStartDate = _startDate;
            _axes.Add(element);
            AddElement(element, _head);
            return(element);
        }
示例#5
0
        internal AxisElement(GanttView view, ScaleLevel scale, int interval, string format, DayOfWeek? firstDay)
            : base(view, ElementName)
        {
            _scale = scale;
            _interval = interval;
            _format = format;
            if (firstDay != null)
                _firstDay = firstDay.Value;

            AddAttribute(ScaleName, scale.ToString());
            AddAttribute(IntervalName, interval.ToString(CultureInfo.InvariantCulture));
            AddAttribute(FormatName, format);
            if (firstDay != null)
                AddAttribute(FirstDayName, firstDay.Value.ToString());
        }
示例#6
0
        internal AxisElement(GanttView view, ScaleLevel scale, int interval, string format, DayOfWeek?firstDay)
            : base(view, ElementName)
        {
            _scale    = scale;
            _interval = interval;
            _format   = format;
            if (firstDay != null)
            {
                _firstDay = firstDay.Value;
            }

            AddAttribute(ScaleName, scale.ToString());
            AddAttribute(IntervalName, interval.ToString(CultureInfo.InvariantCulture));
            AddAttribute(FormatName, format);
            if (firstDay != null)
            {
                AddAttribute(FirstDayName, firstDay.Value.ToString());
            }
        }
示例#7
0
 public ScaleListItem(ScaleLevel scaleLevel)
 {
     Value       = scaleLevel.Value;
     Description = scaleLevel.ValueDescription;
     ScaleLevel  = scaleLevel;
 }