예제 #1
0
        public string Get_FTP_fileContent_inStr()
        {
            Sheet sheet = new Sheet();

            Line l1 = new Line();

            l1.Add(" ");
            if (this.ftpServerTP == FTPserverType.Production)
            {
                l1.Add('P');
            }
            else if (this.ftpServerTP == FTPserverType.Testing)
            {
                l1.Add('T');
            }
            l1.Add("PASSWD");
            l1.Add("01");
            l1.Add("02");
            l1.Add(new string(' ', 6));
            l1.Add(new string(' ', 8));
            l1.Add(this.ftp_UID.Substring(0, 5), 5);
            l1.Add('-');
            l1.Add(this.ftp_UID.Substring(5), 3);
            l1.Add(this.data_pwd, 8, leftJustified: true);
            l1.Add(this.DTCfunc, 6);
            l1.Add(++DTC_request_file.transNum % 10000, 4);
            Cell recordLen_cell = l1.Add(120, 5);//need change in the future

            Line l2 = new Line();

            l2.Add("TD");//request type
            l2.Add(this.DTCfunc, 6);
            l2.Add("01");
            l2.Add(this.headerTP, 3);
            if (this.GU_selCir == GroupUserSelCirteria.ALL)
            {
                l2.Add("All", 3);
            }
            else if (this.GU_selCir == GroupUserSelCirteria.Single)
            {
                l2.Add("001", 3);
                l2.Add(this.GroupUserParticipantNum, 5);
            }

            sheet.Add(l1);
            sheet.Add(l2);

            recordLen_cell.SetOriVal(sheet.Length);

            return(sheet.GetContent());
        }
예제 #2
0
        public void DropElement(SymbolBaseViewModel symbolBaseViewModel)
        {
            if (symbolBaseViewModel is BlockViewModel)
            {
                var blockViewModel = (BlockViewModel)symbolBaseViewModel;
                var blockSymbol    = _sheet.CreateBlockSymbol();
                blockSymbol.PositionX = blockViewModel.X;
                blockSymbol.PositionY = blockViewModel.Y;

                SymbolVms.Remove(_ghost);
                _ghost = null;

                _sheet.Add(blockSymbol, _client);
            }
            else if (symbolBaseViewModel is ConnectorViewModel)
            {
                var connectorViewModel = (ConnectorViewModel)symbolBaseViewModel;
                var connector          = _sheet.CreateConnector();
                connector.PositionX = connectorViewModel.X;
                connector.PositionY = connectorViewModel.Y;

                SymbolVms.Remove(_ghost);
                _ghost = null;

                _sheet.AddConnector(connector, _client);
            }
        }
예제 #3
0
        /// <summary>
        /// Import the data from the Spreadsheet
        /// </summary>
        /// <returns>Returns a list of JObjects</returns>
        public virtual List <ExcelCell> Import(bool ignoreRowWithEmptyCells = false)
        {
            if (Workbook == null)
            {
                throw new MissingMemberException("Missing Workbook");
            }

            var sheet = Workbook.Worksheets.FirstOrDefault();

            if (sheet == null)
            {
                throw new MissingMemberException("No sheet found");
            }

            for (int i = sheet.Dimension.Start.Row; i <= sheet.Dimension.End.Row; i++)
            {
                for (int j = sheet.Dimension.Start.Column; j <= sheet.Dimension.End.Column; j++)
                {
                    ExcelCell cell = null;
                    if (ignoreRowWithEmptyCells)
                    {
                        if (sheet.Cells[i, j].Value != null && !string.IsNullOrEmpty(sheet.Cells[i, j].Value.ToString()))
                        {
                            continue;
                        }
                        else
                        {
                            cell = new ExcelCell {
                                CellName = sheet.Cells[i, j].Address, CellValue = sheet.Cells[i, j].Value
                            };
                        }
                    }
                    else
                    {
                        cell = new ExcelCell {
                            CellName = sheet.Cells[i, j].Address, CellValue = sheet.Cells[i, j].Value
                        };
                    }

                    try
                    {
                        Sheet.Add(cell);
                    }
                    catch (Exception ex)
                    {
                        ErrorList.AddError(new ValidationErrorItem
                        {
                            Location  = sheet.Cells[i, j].Address,
                            Row       = i,
                            Exception = ex
                        });
                    }
                }
                rowCount++;
            }

            return(Sheet);
        }
예제 #4
0
        private void AddDay(object sender, EventArgs e)
        {
            Sheet s = this.BindingContext as Sheet;
            Day   d = new Day();

            d.Muscle       = "Muscle";
            d.DayFrequency = 1;
            s.Add(d);
        }
예제 #5
0
 /// <summary>
 /// Creates an empty GBA.TileSheet with the given dimensions
 /// </summary>
 public TileSheet(int width, int height) : base(width * height)
 {
     Width  = width;
     Height = height;
     for (int i = 0; i < width * height; i++)
     {
         Sheet.Add(null);
     }
 }
예제 #6
0
        public static Sheet Load(Texture2D texture, string data)
        {
            Sheet sheet = new Sheet(texture);

            using (StringReader reader = new StringReader(data))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    if (line.StartsWith("#", true, CultureInfo.InvariantCulture) || string.IsNullOrEmpty(line.Trim()))
                    {
                        continue;
                    }
                    string[]  s         = line.Split(';');
                    string    name      = s[0];
                    Rectangle source    = new Rectangle(int.Parse(s[2], CultureInfo.InvariantCulture), int.Parse(s[3], CultureInfo.InvariantCulture), int.Parse(s[4], CultureInfo.InvariantCulture), int.Parse(s[5], CultureInfo.InvariantCulture));
                    Origin    origin    = new Origin(float.Parse(s[8], CultureInfo.InvariantCulture), float.Parse(s[9], CultureInfo.InvariantCulture));
                    bool      isRotated = (int.Parse(s[1], CultureInfo.InvariantCulture) == 1);
                    sheet.Add(name, new Sprite(sheet, source, origin, isRotated));
                }
            }
            return(sheet);
        }