Пример #1
0
        internal void GetHorizontalIDs(_Worksheet worksheet)
        {
            string currentColumn = idRowStart;
            string cellName      = currentColumn + idRow.ToString();
            Range  range         = null;
            byte   id;

            for (int i = 0; i < pointsCount; i++)
            {
                range = worksheet.get_Range(cellName, Missing.Value);

                if (range == null)
                {
                    Console.WriteLine("ERROR: range == null, Cell = {0}", cellName);
                }

                id = Convert.ToByte(range.Value2);

                TeleportPoint point = leftPoints[id].Clone();
                point.TableColumnPos = currentColumn;
                point.TableRowPos    = idRow;

                if (!topPoints.ContainsKey(id))
                {
                    topPoints.Add(id, point);
                }
                else
                {
                    topPoints[id] = point;
                }

                currentColumn = GetNextColumnName(currentColumn);
                cellName      = currentColumn + idRow.ToString();
            }
        }
        public TeleportPoint Clone()
        {
            TeleportPoint point = new TeleportPoint();

            point.costs          = new Dictionary <ushort, uint>(this.costs);
            point.id             = this.id;
            point.names          = new Dictionary <CultureInfo, string>(this.names);
            point.tableColumnPos = this.tableColumnPos;
            point.tableRowPos    = this.tableRowPos;
            point.x = this.x;
            point.y = this.y;

            return(point);
        }
Пример #3
0
        internal void GetIDs(_Worksheet worksheet)
        {
            uint   currentRow = idColumnStart;
            string cellName   = idColumn + currentRow.ToString();
            Range  range      = null;
            byte   id;
            int    x;
            int    y;

            for (int i = 0; i < pointsCount; i++)
            {
                range = worksheet.get_Range(cellName, Missing.Value);

                if (range == null)
                {
                    Console.WriteLine("ERROR: range == null, Cell = {0}", cellName);
                }

                id = Convert.ToByte(range.Value2);

                KeyValuePair <int, int> coords = GetCoords(worksheet, currentRow);
                x = coords.Key;
                y = coords.Value;
                string ruName   = GetRuName(worksheet, currentRow);
                string phName   = GetPhName(worksheet, currentRow);
                string intName  = GetIntName(worksheet, currentRow);
                string msMyName = GetMsMyName(worksheet, currentRow);

                if (!leftPoints.ContainsKey(id))
                {
                    TeleportPoint point = new TeleportPoint();
                    point.ID = id;
                    point.X  = x;
                    point.Y  = y;
                    point.SetName(new System.Globalization.CultureInfo("ru"), ruName);
                    point.SetName(new System.Globalization.CultureInfo("en-PH"), phName);
                    point.SetName(new System.Globalization.CultureInfo(""), intName);
                    point.SetName(new System.Globalization.CultureInfo("ms"), msMyName);
                    point.TableRowPos    = currentRow;
                    point.TableColumnPos = idColumn;
                    leftPoints.Add(id, point);
                }
                else
                {
                    TeleportPoint point = leftPoints[id];
                    point.ID = id;
                    point.X  = x;
                    point.Y  = y;
                    point.SetName(new System.Globalization.CultureInfo("ru"), ruName);
                    point.SetName(new System.Globalization.CultureInfo("en-PH"), phName);
                    point.SetName(new System.Globalization.CultureInfo(""), intName);
                    point.SetName(new System.Globalization.CultureInfo("ms"), msMyName);
                    point.TableRowPos    = currentRow;
                    point.TableColumnPos = idColumn;
                    leftPoints[id]       = point;
                }

                currentRow++;
                cellName = idColumn + currentRow.ToString();
            }
        }
        public TeleportPoint Clone()
        {
            TeleportPoint point = new TeleportPoint();
            point.costs = new Dictionary<ushort, uint>(this.costs);
            point.id = this.id;
            point.names = new Dictionary<CultureInfo, string>(this.names);
            point.tableColumnPos = this.tableColumnPos;
            point.tableRowPos = this.tableRowPos;
            point.x = this.x;
            point.y = this.y;

            return point;
        }
        internal void GetIDs(_Worksheet worksheet)
        {
            uint currentRow = idColumnStart;
            string cellName = idColumn + currentRow.ToString();
            Range range = null;
            byte id;
            int x;
            int y;

            for (int i = 0; i < pointsCount; i++)
            {
                range = worksheet.get_Range(cellName, Missing.Value);

                if (range == null)
                    Console.WriteLine("ERROR: range == null, Cell = {0}", cellName);

                id = Convert.ToByte(range.Value2);

                KeyValuePair<int, int> coords = GetCoords(worksheet, currentRow);
                x = coords.Key;
                y = coords.Value;
                string ruName = GetRuName(worksheet, currentRow);
                string phName = GetPhName(worksheet, currentRow);
                string intName = GetIntName(worksheet, currentRow);
                string msMyName = GetMsMyName(worksheet, currentRow);

                if (!leftPoints.ContainsKey(id))
                {
                    TeleportPoint point = new TeleportPoint();
                    point.ID = id;
                    point.X = x;
                    point.Y = y;
                    point.SetName(new System.Globalization.CultureInfo("ru"), ruName);
                    point.SetName(new System.Globalization.CultureInfo("en-PH"), phName);
                    point.SetName(new System.Globalization.CultureInfo(""), intName);
                    point.SetName(new System.Globalization.CultureInfo("ms"), msMyName);
                    point.TableRowPos = currentRow;
                    point.TableColumnPos = idColumn;
                    leftPoints.Add(id, point);
                }
                else
                {
                    TeleportPoint point = leftPoints[id];
                    point.ID = id;
                    point.X = x;
                    point.Y = y;
                    point.SetName(new System.Globalization.CultureInfo("ru"), ruName);
                    point.SetName(new System.Globalization.CultureInfo("en-PH"), phName);
                    point.SetName(new System.Globalization.CultureInfo(""), intName);
                    point.SetName(new System.Globalization.CultureInfo("ms"), msMyName);
                    point.TableRowPos = currentRow;
                    point.TableColumnPos = idColumn;
                    leftPoints[id] = point;
                }

                currentRow++;
                cellName = idColumn + currentRow.ToString();
            }
        }