summaryrefslogtreecommitdiffstats
path: root/DHTMLX.Export.PDF/SchedulerMonth.cs
diff options
context:
space:
mode:
authorAlexKlimenkov <shurick.klimenkov@gmail.com>2017-02-17 13:45:02 +0300
committerAlexKlimenkov <shurick.klimenkov@gmail.com>2017-02-17 13:45:02 +0300
commite495105f25efd2b401c79a1be1b2abd0264b4226 (patch)
treeb4386cefc590345e669dddee95c326feab17084c /DHTMLX.Export.PDF/SchedulerMonth.cs
downloadscheduler-export-net-master.zip
scheduler-export-net-master.tar.gz
scheduler-export-net-master.tar.bz2
Diffstat (limited to 'DHTMLX.Export.PDF/SchedulerMonth.cs')
-rw-r--r--DHTMLX.Export.PDF/SchedulerMonth.cs60
1 files changed, 60 insertions, 0 deletions
diff --git a/DHTMLX.Export.PDF/SchedulerMonth.cs b/DHTMLX.Export.PDF/SchedulerMonth.cs
new file mode 100644
index 0000000..e23bc88
--- /dev/null
+++ b/DHTMLX.Export.PDF/SchedulerMonth.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Xml;
+
+namespace DHTMLX.Export.PDF.Scheduler
+{
+ public class SchedulerMonth
+ {
+ private string _monthName;
+ private string[,] _rows;
+
+ public void Parse(XmlNode parent)
+ {
+ _monthName = parent.Attributes["label"].Value;
+ var parsRows = XMLParser.GetElementsByTagName(parent, "row");
+ var cols = XMLParser.GetElementsByTagName(parent, "column");
+
+ if ((parsRows.Count != 0) && (cols.Count != 0))
+ {
+ _rows = new string[parsRows.Count + 1, 7];
+ for (var i = 0; i < cols.Count; i++)
+ {
+ _rows[0, i] = cols[i].FirstChild.Value;
+ }
+ for (var i = 1; i <= parsRows.Count; i++)
+ {
+ var values = parsRows[i - 1].FirstChild.Value.Split(new[] { "|" }, StringSplitOptions.None);
+ for (var j = 0; j < values.Length; j++)
+ {
+ _rows[i, j] = values[j];
+ }
+ }
+ }
+ }
+
+ public string GetLabel()
+ {
+ return _monthName;
+ }
+
+ public string[,] GetRows()
+ {
+ return _rows;
+ }
+
+ public string[,] GetOnlyDays()
+ {
+ var days = new string[_rows.GetLength(0) - 1, 7];
+
+
+ for (var i = 1; i < _rows.GetLength(0); i++)
+ {
+ for (var j = 0; j < 7; j++)
+ {
+ days[i - 1, j] = _rows[i, j];
+ }
+ }
+ return days;
+ }
+ }
+} \ No newline at end of file