コード例 #1
0
ファイル: AxisElement.cs プロジェクト: alex765022/IBN
        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
ファイル: SpanElement.cs プロジェクト: 0anion0/IBN
 internal SpanElement(GanttView view, string id, string type, string tag)
     : base(view, ElementName)
 {
     AddAttribute(IdName, id);
     AddAttribute(TypeName, type);
     AddAttribute(TagName, tag);
 }
コード例 #3
0
 internal SpanElement(GanttView view, string id, string type, string tag)
     : base(view, ElementName)
 {
     AddAttribute(IdName, id);
     AddAttribute(TypeName, type);
     AddAttribute(TagName, tag);
 }
コード例 #4
0
ファイル: AxisElement.cs プロジェクト: 0anion0/IBN
        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);
                }
            }
        }
コード例 #5
0
 internal DataElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     if (Attributes.ContainsKey(StartDateName))
     {
         _startDate = DateTime.Parse(Attributes[StartDateName].Value, CultureInfo.InvariantCulture);
     }
 }
コード例 #6
0
ファイル: DataElement.cs プロジェクト: 0anion0/IBN
 internal DataElement(GanttView view, DateTime? startDate)
     : base(view, ElementName)
 {
     if (startDate != null)
     {
         _startDate = startDate.Value;
         AddAttribute(StartDateName, startDate.Value.ToString(CultureInfo.InvariantCulture));
     }
 }
コード例 #7
0
ファイル: DayElement.cs プロジェクト: 0anion0/IBN
        internal DayElement(GanttView view, DayOfWeek dayOfWeek, bool isHoliday)
            : base(view, ElementName)
        {
            _dayOfWeek = dayOfWeek;
            _isHoliday = isHoliday;

            AddAttribute(DayOfWeekName, dayOfWeek.ToString());
            AddAttribute(HolidayName, isHoliday.ToString(CultureInfo.InvariantCulture));
        }
コード例 #8
0
        internal DayElement(GanttView view, DayOfWeek dayOfWeek, bool isHoliday)
            : base(view, ElementName)
        {
            _dayOfWeek = dayOfWeek;
            _isHoliday = isHoliday;

            AddAttribute(DayOfWeekName, dayOfWeek.ToString());
            AddAttribute(HolidayName, isHoliday.ToString(CultureInfo.InvariantCulture));
        }
コード例 #9
0
        internal DayElement(GanttView view, DateTime date, bool isHoliday)
            : base(view, ElementName)
        {
            _date      = date;
            _isHoliday = isHoliday;

            AddAttribute(DateName, date.ToString(CultureInfo.InvariantCulture));
            AddAttribute(HolidayName, isHoliday.ToString(CultureInfo.InvariantCulture));
        }
コード例 #10
0
ファイル: DayElement.cs プロジェクト: 0anion0/IBN
 internal DayElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     if (Attributes.ContainsKey(DayOfWeekName))
         _dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), Attributes[DayOfWeekName].Value);
     if (Attributes.ContainsKey(DateName))
         _date = DateTime.Parse(Attributes[DateName].Value, CultureInfo.InvariantCulture);
     _isHoliday = bool.Parse(Attributes[HolidayName].Value);
 }
コード例 #11
0
 internal DataElement(GanttView view, DateTime?startDate)
     : base(view, ElementName)
 {
     if (startDate != null)
     {
         _startDate = startDate.Value;
         AddAttribute(StartDateName, startDate.Value.ToString(CultureInfo.InvariantCulture));
     }
 }
コード例 #12
0
ファイル: DayElement.cs プロジェクト: 0anion0/IBN
        internal DayElement(GanttView view, DateTime date, bool isHoliday)
            : base(view, ElementName)
        {
            _date = date;
            _isHoliday = isHoliday;

            AddAttribute(DateName, date.ToString(CultureInfo.InvariantCulture));
            AddAttribute(HolidayName, isHoliday.ToString(CultureInfo.InvariantCulture));
        }
コード例 #13
0
ファイル: PointElement.cs プロジェクト: 0anion0/IBN
        internal PointElement(GanttView view, DateTime value, string id, string type, string tag)
            : base(view, ElementName)
        {
            _value = value;

            AddAttribute(IdName, id);
            AddAttribute(TypeName, type);
            AddAttribute(TagName, tag);

            AddAttribute(ValueName, value.ToString(CultureInfo.InvariantCulture));
        }
コード例 #14
0
ファイル: PointElement.cs プロジェクト: alex765022/IBN
        internal PointElement(GanttView view, DateTime value, string id, string type, string tag)
            : base(view, ElementName)
        {
            _value = value;

            AddAttribute(IdName, id);
            AddAttribute(TypeName, type);
            AddAttribute(TagName, tag);

            AddAttribute(ValueName, value.ToString(CultureInfo.InvariantCulture));
        }
コード例 #15
0
ファイル: RelationElement.cs プロジェクト: 0anion0/IBN
        internal RelationElement(GanttView view, string id, string type, string tag, string originId, string targetId)
            : base(view, ElementName)
        {
            _originId = originId;
            _targetId = targetId;

            AddAttribute(IdName, id);
            AddAttribute(TypeName, type);
            AddAttribute(TagName, tag);
            AddAttribute(OriginIdName, originId);
            AddAttribute(TargetIdName, targetId);
        }
コード例 #16
0
        internal RelationElement(GanttView view, string id, string type, string tag, string originId, string targetId)
            : base(view, ElementName)
        {
            _originId = originId;
            _targetId = targetId;

            AddAttribute(IdName, id);
            AddAttribute(TypeName, type);
            AddAttribute(TagName, tag);
            AddAttribute(OriginIdName, originId);
            AddAttribute(TargetIdName, targetId);
        }
コード例 #17
0
 internal DayElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     if (Attributes.ContainsKey(DayOfWeekName))
     {
         _dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), Attributes[DayOfWeekName].Value);
     }
     if (Attributes.ContainsKey(DateName))
     {
         _date = DateTime.Parse(Attributes[DateName].Value, CultureInfo.InvariantCulture);
     }
     _isHoliday = bool.Parse(Attributes[HolidayName].Value);
 }
コード例 #18
0
ファイル: IntervalElement.cs プロジェクト: 0anion0/IBN
        internal IntervalElement(GanttView view, DateTime start, DateTime finish, string id, string type, string tag)
            : base(view, ElementName)
        {
            _start = start;
            _finish = finish;

            AddAttribute(IdName, id);
            AddAttribute(TypeName, type);
            AddAttribute(TagName, tag);

            AddAttribute(StartName, start.ToString(CultureInfo.InvariantCulture));
            AddAttribute(FinishName, finish.ToString(CultureInfo.InvariantCulture));
        }
コード例 #19
0
        internal IntervalElement(GanttView view, DateTime start, DateTime finish, string id, string type, string tag)
            : base(view, ElementName)
        {
            _start  = start;
            _finish = finish;

            AddAttribute(IdName, id);
            AddAttribute(TypeName, type);
            AddAttribute(TagName, tag);

            AddAttribute(StartName, start.ToString(CultureInfo.InvariantCulture));
            AddAttribute(FinishName, finish.ToString(CultureInfo.InvariantCulture));
        }
コード例 #20
0
ファイル: AxisElement.cs プロジェクト: 0anion0/IBN
        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());
        }
コード例 #21
0
ファイル: AxisElement.cs プロジェクト: alex765022/IBN
        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());
            }
        }
コード例 #22
0
ファイル: SpanElement.cs プロジェクト: 0anion0/IBN
 internal SpanElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
 }
コード例 #23
0
ファイル: DataElement.cs プロジェクト: 0anion0/IBN
 internal DataElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     if (Attributes.ContainsKey(StartDateName))
         _startDate = DateTime.Parse(Attributes[StartDateName].Value, CultureInfo.InvariantCulture);
 }
コード例 #24
0
ファイル: BodyElement.cs プロジェクト: 0anion0/IBN
 internal BodyElement(GanttView view)
     : base(view, ElementName)
 {
 }
コード例 #25
0
ファイル: HeadElement.cs プロジェクト: alex765022/IBN
 internal HeadElement(GanttView view)
     : base(view, ElementName)
 {
 }
コード例 #26
0
ファイル: GanttManager.cs プロジェクト: 0anion0/IBN
 private static Element AddInterval(DataRow dr, GanttView gantt, Element parent, string startName, string finishName, string id, string type, string tag)
 {
     return AddInterval2(gantt, parent, GetDate(dr, startName), GetDate(dr, finishName), id, type, tag);
 }
コード例 #27
0
ファイル: GanttManager.cs プロジェクト: 0anion0/IBN
        private static void AddMilestone(GanttView gantt, Element parent, DateTime date, DateTime? basePlanDate, string id, string tag)
        {
            string type = "Milestone";

            gantt.CreatePointElement(parent, date, id, type, tag);

            if (basePlanDate != null && basePlanDate.Value != date)
            {
                string direction = basePlanDate.Value > date ? "Right" : "Left";

                PointElement small = gantt.CreatePointElement(parent, date, null, type, "BasePlanSmall");
                small.AddAttribute("direction", direction);

                PointElement large = gantt.CreatePointElement(parent, basePlanDate.Value, null, type, "BasePlanLarge");
                large.AddAttribute("direction", direction);
            }
        }
コード例 #28
0
ファイル: CalendarElement.cs プロジェクト: 0anion0/IBN
 internal CalendarElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
 }
コード例 #29
0
ファイル: RelationElement.cs プロジェクト: 0anion0/IBN
 internal RelationElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     _originId = Attributes[OriginIdName].Value;
     _targetId = Attributes[TargetIdName].Value;
 }
コード例 #30
0
ファイル: PointElement.cs プロジェクト: alex765022/IBN
 internal PointElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     _value = DateTime.Parse(Attributes[ValueName].Value, CultureInfo.InvariantCulture);
 }
コード例 #31
0
ファイル: PointElement.cs プロジェクト: 0anion0/IBN
 internal PointElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     _value = DateTime.Parse(Attributes[ValueName].Value, CultureInfo.InvariantCulture);
 }
コード例 #32
0
ファイル: HeadElement.cs プロジェクト: 0anion0/IBN
 internal HeadElement(GanttView view)
     : base(view, ElementName)
 {
 }
コード例 #33
0
ファイル: CalendarElement.cs プロジェクト: 0anion0/IBN
 internal CalendarElement(GanttView view)
     : base(view, ElementName)
 {
 }
コード例 #34
0
 internal GanttElement(GanttView view, string name)
     : base(name)
 {
     _view = view;
 }
コード例 #35
0
ファイル: IntervalElement.cs プロジェクト: 0anion0/IBN
 internal IntervalElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     _start = DateTime.Parse(Attributes[StartName].Value, CultureInfo.InvariantCulture);
     _finish = DateTime.Parse(Attributes[FinishName].Value, CultureInfo.InvariantCulture);
 }
コード例 #36
0
 internal IntervalElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     _start  = DateTime.Parse(Attributes[StartName].Value, CultureInfo.InvariantCulture);
     _finish = DateTime.Parse(Attributes[FinishName].Value, CultureInfo.InvariantCulture);
 }
コード例 #37
0
ファイル: BodyElement.cs プロジェクト: alex765022/IBN
 internal BodyElement(GanttView view)
     : base(view, ElementName)
 {
 }
コード例 #38
0
ファイル: GanttElement.cs プロジェクト: 0anion0/IBN
 internal GanttElement(GanttView view, string name)
     : base(name)
 {
     _view = view;
 }
コード例 #39
0
ファイル: GanttManager.cs プロジェクト: 0anion0/IBN
        internal static byte[] Render(GanttView ganttView, bool generateDataXml, string styleFilePath, int portionX, int portionY, int portionWidth, int portionHeight, int itemsPerPage, int pageNumber)
        {
            using (MemoryStream stream = new MemoryStream())
            {
                if (generateDataXml)
                {
                    ganttView.GenerateDataXml(Encoding.UTF8, stream);
                }
                else
                {
                    ganttView.LoadStyleSheetFromFile(styleFilePath);
                    ganttView.ApplyStyleSheet();

                    if (portionY < 0)
                        portionHeight = Convert.ToInt32(ganttView.CalculateHeadHeight());

                    if (portionHeight > 0 && portionWidth > 0)
                        ganttView.RenderPortion(new Point(portionX, portionY), new Size(portionWidth, portionHeight), itemsPerPage, pageNumber, ImageFormat.Png, stream);
                }
                return stream.ToArray();
            }
        }
コード例 #40
0
ファイル: GanttElement.cs プロジェクト: 0anion0/IBN
 internal GanttElement(GanttView view, XPathNavigator node)
     : base(node)
 {
     _view = view;
 }
コード例 #41
0
ファイル: GanttManager.cs プロジェクト: 0anion0/IBN
        private static Element AddInterval2(GanttView gantt, Element parent, DateTime? start, DateTime? finish, string id, string type, string tag)
        {
            Element child = null;

            if (start != null && finish != null)
            {
                child = gantt.CreateIntervalElement(parent, start.Value, finish.Value, id, type, tag);
                if (type == "Summary")
                {
                    gantt.CreatePointElement(child, start.Value, null, type + "Start", tag);
                    gantt.CreatePointElement(child, finish.Value, null, type + "Finish", tag);
                }
            }
            else
            {
                if (start != null)
                {
                    child = gantt.CreatePointElement(parent, start.Value, id, type + "Start", tag);
                }
                if (finish != null)
                {
                    child = gantt.CreatePointElement(parent, finish.Value, id, type + "Finish", tag);
                }
            }

            return child;
        }
コード例 #42
0
ファイル: CalendarElement.cs プロジェクト: alex765022/IBN
 internal CalendarElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
 }
コード例 #43
0
ファイル: GanttManager.cs プロジェクト: 0anion0/IBN
        private static GanttView CreateGanttView(DateTime startDate, DayOfWeek firstDayOfWeek, float headerItemHeight, float itemHeight)
        {
            GanttView gantt = new GanttView(headerItemHeight, itemHeight);

            gantt.CreateDataElement(startDate);
            gantt.CreateAxisElement(ScaleLevel.Week, 1, "dd MMMM yyyy", firstDayOfWeek);
            gantt.CreateAxisElement(ScaleLevel.Day, 1, "dd", null);

            return gantt;
        }
コード例 #44
0
ファイル: CalendarElement.cs プロジェクト: alex765022/IBN
 internal CalendarElement(GanttView view)
     : base(view, ElementName)
 {
 }
コード例 #45
0
 internal SpanElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
 }
コード例 #46
0
 internal GanttElement(GanttView view, XPathNavigator node)
     : base(node)
 {
     _view = view;
 }
コード例 #47
0
 internal RelationElement(GanttView view, XPathNavigator node)
     : base(view, node)
 {
     _originId = Attributes[OriginIdName].Value;
     _targetId = Attributes[TargetIdName].Value;
 }
コード例 #48
0
ファイル: ResourceChart.cs プロジェクト: 0anion0/IBN
        private static GanttView CreateGanttView(DateTime startDate, bool vastScale, DayOfWeek firstDayOfWeek, float headerItemHeight, float itemHeight)
        {
            GanttView gantt = new GanttView(headerItemHeight, itemHeight);

            gantt.CreateDataElement(startDate);

            AxisElement topAxis = gantt.CreateAxisElement(ScaleLevel.Week, 1, string.Empty, firstDayOfWeek);
            AxisElement bottomAxis = gantt.CreateAxisElement(ScaleLevel.Day, 1, string.Empty, null);

            if (vastScale)
            {
                topAxis.TitleType = TitleType.StartEnd;
                topAxis.Format = "d MMMM yyyy";

                bottomAxis.TitleType = TitleType.Start;
                bottomAxis.Format = "ddd, d MMM";
                bottomAxis.Width = 72;
            }
            else
            {
                topAxis.TitleType = TitleType.Start;
                topAxis.Format = "d MMMM yyyy";

                bottomAxis.TitleType = TitleType.Start;
                bottomAxis.Format = "dd";
                bottomAxis.Width = 24;
            }

            return gantt;
        }