private SqlDataReader LerColunas(SqlCommand cmdObj) { SqlDataReader rdObj = null; try { cmdObj.CommandText = "SELECT SC.column_id, SC.name, SC.max_length, SC.precision, " + Environment.NewLine + " CAST(SC.scale as smallint) as scale, " + Environment.NewLine + " RTRIM(TP.name) AS Tipo, SC.is_nullable, " + Environment.NewLine + " CAST(IC.key_ordinal as smallint) as key_ordinal " + Environment.NewLine + " FROM sys.columns SC " + Environment.NewLine + " JOIN sys.types TP " + Environment.NewLine + " ON TP.system_type_id = SC.system_type_id " + Environment.NewLine + " AND TP.user_type_id = SC.user_type_id " + Environment.NewLine + " LEFT JOIN sys.index_columns IC " + Environment.NewLine + " on IC.object_id = SC.object_id " + Environment.NewLine + " and IC.index_id = " + IdPKey.GetValueOrDefault().ToString() + Environment.NewLine + " and IC.column_id = SC.column_id " + Environment.NewLine + " where SC.object_id =" + IdObjeto.ToString() + Environment.NewLine + " order by SC.column_id "; rdObj = cmdObj.ExecuteReader(); while (rdObj.Read()) { ColDef Col = new ColDef(); Col.IdColuna = rdObj.GetInt32(0); Col.NomeCampo = rdObj.GetString(1); Col.Tamanho = rdObj.GetInt16(2); Col.Digitos = rdObj.GetInt16(4); Col.TipoCampo = rdObj.GetString(5); Col.PermNull = rdObj.GetBoolean(6); Col.IsOutParam = false; Col.PKey = null; if (!rdObj.IsDBNull(7)) { Col.PKey = rdObj.GetInt16(7); // key_ordinal começa em 1 } Col.Index = Cols.Count; Cols.Add(Col); // Guarda a coluna do PK if (Col.PKey.HasValue) { if (ColPKey == null) { ColPKey = Col; } PKCols++; } } } finally { rdObj.Close(); } return(rdObj); }
private void OnSvcStatusUpdate(string msgIn) {/* * Service: Socket closed Normally: Cancelled * Service: Starting Svc TestStream * Service: Svc Stream response received: Name=TestStream IsAccepted=True * Service: Stream is open. * Service: Stream is open. Waiting for msg to send. * Service: Sending msg. * Service: Sent msg. * Service: Svc Received stream data: MSG OUT * Service: Closing Svc Socket * Service: Socket closed Normally: */ Task.Run(async() => { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { tbSvcStat.Text = msgIn; if (msgIn.ToLower().Contains("Starting Svc".ToLower())) { SvcState = deviceStates.listening; SvcIsRunningLED.Fill = Cols[0]; } else if (msgIn.ToLower().Contains("Svc Stream response received".ToLower())) { //DeviceState = deviceStates.listening; SvcIsRunningLED.Fill = Cols[1]; } else if (msgIn.ToLower().Contains("Stream is open".ToLower())) { //DeviceState = deviceStates.listening; DeviceIsRunningLED.Fill = Cols[2]; } else if (msgIn.ToLower().Contains("Sending msg".ToLower())) { //DeviceState = deviceStates.listening; SvcIsRunningLED.Fill = Cols[3]; } else if (msgIn.ToLower().Contains("Sent msg".ToLower())) { //DeviceState = deviceStates.listening; SvcIsRunningLED.Fill = Cols[4]; } else if (msgIn.ToLower().Contains("Svc Received stream data".ToLower())) { //DeviceState = deviceStates.listening; SvcIsRunningLED.Fill = Cols[5]; } else if (msgIn.ToLower().Contains("Closing Svc Socket".ToLower())) { //DeviceState = deviceStates.listening; SvcIsRunningLED.Fill = Cols[6]; } else if (msgIn.ToLower().Contains("Socket closed Normally".ToLower())) { DeviceState = deviceStates.stopped; SvcIsRunningLED.Fill = Cols[Cols.Count() - 1]; } }); }); }
protected override Size ArrangeOverride(Size finalSize) { Cols cols = _owner.Cols; // 行头 Grid header = (Grid)Children[cols.Count]; double headerWidth = header.Width; header.Arrange(new Rect(_owner.Scroll.HorizontalOffset, 0, headerWidth, finalSize.Height)); // 行单元格 for (int i = 0; i < cols.Count; i++) { Col col = cols[i]; _cells[col.ID].Arrange(new Rect(col.Left + headerWidth, 0, col.Width, finalSize.Height)); } // 选择背景 if (_owner.SelectionMode != SelectionMode.None) { ((UIElement)Children[cols.Count + 1]).Arrange(new Rect(headerWidth, 0, cols.TotalWidth, finalSize.Height)); } // 交互背景 _rcPointer.Arrange(new Rect(0, 0, headerWidth + cols.TotalWidth, finalSize.Height)); return(finalSize); }
void OnPointerReleased(object sender, PointerRoutedEventArgs e) { if (e.IsTouch()) { // 触摸模式只支持列排序 if (_pointerID == e.Pointer.PointerId) { ReleasePointerCapture(e.Pointer); _pointerID = null; ChangedSortState(); } return; } if (_isDragging) { if (_dragTgtCol != null) { // 拖拽结束 _owner.FinishedDrag(); Cols cols = _owner.Lv.Cols; int index = cols.IndexOf(_dragTgtCol); cols.Remove(Col); cols.Insert(index, Col); cols.Invalidate(); } else { // 列排序 ChangedSortState(); } } ResetMouseState(); }
/// <summary> /// Execute the insert statement, and return the assigned primary key /// </summary> /// <param name="databaseAssignsKey">if true, returns newly assigned key</param> /// <returns>null or a newly assigned key</returns> public Task <object> Execute(IDbConnection db, string tableName, string pkColName, bool databaseAssignsKey) { string nonKeyColNames = string.Join(",", Cols.Select(c => c.Name)); string valuesList = string.Join(",", Cols.Select(c => c.LiteralExpression)); using (var cmd = db.CreateCommand()) { foreach (var c in Cols) { cmd.Parameters.Add(c.AsParameter(cmd)); } string coreCommand = $"insert into {tableName} ({nonKeyColNames}) values ({valuesList})"; if (databaseAssignsKey) { cmd.CommandText = coreCommand + SqlFlavor.BuildGetIdentityClause(pkColName); cmd.CommandText = SqlCustomizer(cmd.CommandText); return(Task.FromResult(cmd.ExecuteScalar())); } else { cmd.CommandText = SqlCustomizer(coreCommand); cmd.ExecuteNonQuery(); return(Task.FromResult <object>(null)); } } }
void Clear() { Rows.Clear(); Cols.Clear(); Vals.Clear(); Rows.Add(0); }
/// <summary> /// Creates the cols and caches the 2da's colhead data. /// </summary> /// <param name="rewidthOnly"><c>true</c> to only re-width cols - ie. /// Font changed</param> /// <seealso cref="CreateCol()"><c>CreateCol()</c></seealso> internal void CreateCols(bool rewidthOnly = false) { int c = 0; if (!rewidthOnly) { ColCount = Fields.Length + 1; // 'Fields' does not include rowhead or id-col for (; c != ColCount; ++c) { Cols.Add(new Col()); } Cols[0].text = gs.Id; // NOTE: Is not measured - the cells below it determine col-width. } int widthtext; c = 0; foreach (string head in Fields) // set initial col-widths based on colheads only -> { ++c; // start at col 1 - skip id col if (!rewidthOnly) { Cols[c].text = head; } widthtext = YataGraphics.MeasureWidth(head, _f.FontAccent); Cols[c]._widthtext = widthtext; Cols[c].width(widthtext + _padHori * 2 + _padHoriSort, rewidthOnly); } }
public void GeraRecFuncs(StringBuilder Out, String New) { String T = "r" + NomeClass; Out.ApLine(); Out.ApLine(" // Copia os Campos do Cursor para o registro"); Out.Append(" public void CursorToRec(") .Append(T) .ApLine(" reg)"); Out.ApLine(" {"); foreach (ColDef Coluna in Cols) { Coluna.GravaAtribVar(Out); } Out.ApLine(" }"); List <ColDef> ColsSemTS = Cols.FindAll(N => N.TipoCampo != "timestamp"); Out.ApLine(); Out.ApLine(" // Copia os Campos do registro para o Cursor"); Out.Append(" public void RecToCursor(") .Append(T) .ApLine(" reg)"); Out.ApLine(" {"); foreach (ColDef Coluna in ColsSemTS) // Sem Timestamp !! { Coluna.GravaAtribFld(Out); } Out.ApLine(" }"); }
public void InsertReprojErrBlock(int obsIdx, int camIdx, int ptIdx, double[] J) { int n_new_cols = BA_NCAMPARAMS + 3 + 1; Rows.Add(Rows.Last() + n_new_cols); Rows.Add(Rows.Last() + n_new_cols); for (int i_row = 0; i_row < 2; i_row++) { for (int i = 0; i < BA_NCAMPARAMS; i++) { Cols.Add(BA_NCAMPARAMS * camIdx + i); Vals.Add(J[2 * i + i_row]); } int col_offset = BA_NCAMPARAMS * N; int val_offset = BA_NCAMPARAMS * 2; for (int i = 0; i < 3; i++) { Cols.Add(col_offset + 3 * ptIdx + i); Vals.Add(J[val_offset + 2 * i + i_row]); } col_offset += 3 * M; val_offset += 3 * 2; Cols.Add(col_offset + obsIdx); Vals.Add(J[val_offset + i_row]); } }
public virtual IRepositoryConfig TryAddCol(string name, DataType Type) { if (!Cols.ContainsKey(name)) { AddCol(name, Type); } return(this); }
/// <inheritdoc /> protected override void AddAttributesToRender(HtmlTextWriter writer) { if (!IsCondensed) { if (string.IsNullOrEmpty(ActionText)) { throw new MissingRequiredAttribute("ActionText", ActionText); } else { writer.AddAttribute("actiontext", ActionText); } if (ShowBorder) { writer.AddAttribute("showborder", FbmlConstants.TRUE); } if (EmailInvite) { writer.AddAttribute("email_invite", FbmlConstants.TRUE); } if (Rows > 0) { writer.AddAttribute("rows", Rows.ToString()); } if (Cols > 0) { writer.AddAttribute("cols", Cols.ToString()); } if (Bypass != Bypass.Skip) { writer.AddAttribute("bypass", Bypass.ToString().ToLowerInvariant()); } } else { writer.AddAttribute("condensed", FbmlConstants.TRUE); if (UnselectedRows > 0) { writer.AddAttribute("unselected_rows", UnselectedRows.ToString()); } if (SelectedRows > 0) { writer.AddAttribute("selected_rows", SelectedRows.ToString()); } } if (Max > 0) { writer.AddAttribute("max", Max.ToString()); } if (!string.IsNullOrEmpty(ExcludeIds)) { writer.AddAttribute("exclude_ids", ExcludeIds); } base.AddAttributesToRender(writer); }
private void NewMapDialog_Load(object sender, EventArgs e) { //Init textboxes textBoxRows.Text = Rows.ToString(); textBoxColumns.Text = Cols.ToString(); textBoxTileWidth.Text = TileWidth.ToString(); textBoxTileHeight.Text = TileHeight.ToString(); UpdateLblMapSize(); }
protected override string GenerateInsertScript() { var sql = $@" INSERT INTO {TableName} ({string.Join(", ", Cols.Select(c => c.Key))}) VALUES(@{string.Join(", @", Cols.Select(c => c.Key))}); "; return(sql); }
/// <inheritdoc /> protected override void AddAttributesToRender(HtmlTextWriter writer) { if (Cols > 0) { writer.AddAttribute("cols", Cols.ToString()); } base.AddAttributesToRender(writer); }
public void onResourceStart() { try { NAPI.TextLabel.CreateTextLabel("~g~Benson Pain", new Vector3(-2347.958, 3268.936, 33.81076), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[0], 1, 2, 0)); Cols[0].SetData("INTERACT", 34); Cols[0].OnEntityEnterColShape += onEntityEnterColshape; Cols[0].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Нажмите E, что-бы открыть gun меню."), new Vector3(ArmyCheckpoints[0].X, ArmyCheckpoints[0].Y, ArmyCheckpoints[0].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(1, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[1], 1, 2, 0)); Cols[1].SetData("INTERACT", 35); Cols[1].OnEntityEnterColShape += onEntityEnterColshape; Cols[1].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Нажмите E, что-бы переодеться."), new Vector3(ArmyCheckpoints[1].X, ArmyCheckpoints[1].Y, ArmyCheckpoints[1].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(2, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[2], 5, 6, 0)); Cols[2].SetData("INTERACT", 36); Cols[2].OnEntityEnterColShape += onEntityEnterColshape; Cols[2].OnEntityExitColShape += onEntityExitArmyMats; Cols.Add(3, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[3], 1, 2, 0)); Cols[3].SetData("INTERACT", 25); Cols[3].OnEntityEnterColShape += onEntityEnterColshape; Cols[3].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Лифт на вышку."), new Vector3(ArmyCheckpoints[3].X, ArmyCheckpoints[3].Y, ArmyCheckpoints[3].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(4, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[4], 1, 2, 0)); Cols[4].SetData("INTERACT", 25); Cols[4].OnEntityEnterColShape += onEntityEnterColshape; Cols[4].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Лифт на 1 этаж."), new Vector3(ArmyCheckpoints[4].X, ArmyCheckpoints[4].Y, ArmyCheckpoints[4].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(5, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[5], 1, 2, 0)); Cols[5].SetData("INTERACT", 60); Cols[5].OnEntityEnterColShape += onEntityEnterColshape; Cols[5].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Открыть склад Оружий."), new Vector3(ArmyCheckpoints[5].X, ArmyCheckpoints[5].Y, ArmyCheckpoints[5].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[1] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[2], new Vector3(), new Vector3(), 5f, new Color(155, 0, 0)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[3] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[4] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[5] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); Cols.Add(6, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[6], 1, 2, 0)); Cols[6].SetData("INTERACT", 34); Cols[6].OnEntityEnterColShape += onEntityEnterColshape; Cols[6].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~,Вход в кадетский корпус."), new Vector3(ArmyCheckpoints[6].X, ArmyCheckpoints[6].Y, ArmyCheckpoints[6].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
internal void PopulateColChoicesLookup() { if (Cols != null) { ColChoicesLookup = Cols .Where(answerItem => answerItem.Choices != null) .SelectMany(a => a.Choices) .ToDictionary(item => item.Id.Value, item => item.Text); } }
protected override string GenerateTableScript() { var sql = $@" CREATE TABLE IF NOT EXISTS {TableName} ( Id INTEGER PRIMARY KEY AUTOINCREMENT, {string.Join(",", Cols.Select(c => $"{c.Key} {c.Value.ToString().Replace("_", " ")}"))} ) ; "; return(sql); }
public ColHeader(Lv p_owner) { Lv = p_owner; Cols cols = p_owner.Cols; cols.Update += (s, e) => InvalidateMeasure(); foreach (var col in cols) { Children.Add(new ColHeaderCell(col, this)); } }
public Cols ReadCols() { Cols cols = this.ReadColsMetadata(); if (cols != null) { this.ReadColis(cols); this.ReadHghts(cols); } return(cols); }
/// <summary> /// Deletes a col. /// </summary> /// <param name="selc"></param> internal void DeleteCol(int selc) { --selc; // the Field-count is 1 less than the col-count int fieldsLength = Fields.Length - 1; // create a new Fields array -> var fields = new string[fieldsLength]; for (int i = 0; i != fieldsLength; ++i) { if (i < selc) { fields[i] = Fields[i]; } else { fields[i] = Fields[i + 1]; } } Fields = fields; ++selc; // revert to col-id for (int r = 0; r != RowCount; ++r) { var cells = new Cell[ColCount - 1]; // create a new Cells array in each row -> for (int c = 0; c != ColCount - 1; ++c) { if (c < selc) { cells[c] = this[r, c]; } else { cells[c] = this[r, c + 1]; cells[c].x -= 1; } } Rows[r]._cells = cells; Rows[r].Length -= 1; } Cols.RemoveAt(selc); --ColCount; InitScroll(); _f.EnableCelleditOperations(); if (!Changed) { Changed = true; } }
protected override Size MeasureOverride(Size availableSize) { // 行最小高度41 double height = Res.RowOuterHeight; // 行单元格 Cols cols = _owner.Cols; if (double.IsNaN(_owner.ItemHeight)) { // 自动行高 for (int i = 0; i < cols.Count; i++) { Col col = cols[i]; var elem = _cells[col.ID]; elem.Measure(new Size(cols[i].Width, availableSize.Height)); if (elem.DesiredSize.Height > height) { height = elem.DesiredSize.Height; } } } else { if (_owner.ItemHeight > 0) { height = _owner.ItemHeight; } for (int i = 0; i < cols.Count; i++) { Col col = cols[i]; _cells[col.ID].Measure(new Size(cols[i].Width, height)); } } // 行头 Grid header = (Grid)Children[cols.Count]; header.Measure(new Size(header.Width, height)); // 选择背景 if (_owner.SelectionMode != SelectionMode.None) { ((UIElement)Children[cols.Count + 1]).Measure(new Size(cols.TotalWidth, height)); } // 交互背景 Size size = new Size(cols.TotalWidth + header.Width, height); _rcPointer.Measure(size); return(size); }
public string ToEscapedDelimitedString(string delimiter, string escapePrefix, string escapeSuffix, string lineSeperator) { StringBuilder builder = new StringBuilder(); Func <string, string> escape = name => name.Contains(delimiter) ? String.Format("{0}{1}{2}", escapePrefix, name, escapeSuffix) : name; builder.Append(String.Join(delimiter, Cols.Select(escape))); builder.Append(lineSeperator); builder.Append(String.Join(lineSeperator, _rows.Select(row => String.Join(delimiter, row.Select(escape))))); return(builder.ToString()); }
public void ReorderAllColumns(List <string> keys) { if (!Cols.All(keys.Contains)) { string message = String.Format("ReorderAllColumns: keys({0}) to reorder are not the same as CSVData ({1})", String.Join(",", keys), String.Join(",", Cols)); throw new ArgumentOutOfRangeException(nameof(keys), message); } else { ReorderColumns(keys); } }
/// <summary> /// Function to call when serializing this object to XML /// </summary> /// <param name="writer">The xml writer</param> public virtual void WriteXml(System.Xml.XmlWriter writer) { writer.WriteAttributeString("Rows", Rows.ToString()); writer.WriteAttributeString("Cols", Cols.ToString()); writer.WriteAttributeString("NumberOfChannels", NumberOfChannels.ToString()); writer.WriteAttributeString("CompressionRatio", SerializationCompressionRatio.ToString()); writer.WriteStartElement("Bytes"); Byte[] bytes = Bytes; writer.WriteBase64(bytes, 0, bytes.Length); writer.WriteEndElement(); }
public CustomColumns(Cols cols) { string[] localNames = this.GetType().GetMembers().Where(m => m.MemberType.ToString() == "Property").Select(m => m.Name).ToArray(); string[] ctorNames = cols.GetType().GetMembers().Where(m => m.MemberType.ToString() == "Property").Select(m => m.Name).ToArray(); string[] names = localNames.Intersect(ctorNames).ToArray(); foreach (string s in names) { PropertyInfo propSet = this.GetType().GetProperty(s); PropertyInfo propGet = typeof(Cols).GetProperty(s); propSet.SetValue(this, propGet.GetValue(cols, null)); } }
internal Col GetDragTargetCol(Col p_col, double p_pos) { int index = -1; Col col; Cols cols = Lv.Cols; for (int i = 0; i < cols.Count; i++) { col = cols[i]; if (p_pos >= col.Left && p_pos <= col.Left + col.Width) { index = i; break; } } // 未找到或还在原来列 if (index == -1 || (col = cols[index]) == p_col) { if (_lastDrag > -1) { _lastDrag = -1; Children.Remove(_tbDrag); _tbDrag = null; } return(null); } int toIndex = index > cols.IndexOf(p_col) ? index + 1 : index; if (toIndex != _lastDrag) { _lastDrag = toIndex; if (_tbDrag == null) { _tbDrag = new TextBlock { Text = "\uE018", FontFamily = Res.IconFont, FontSize = 20, Foreground = Res.RedBrush, VerticalAlignment = VerticalAlignment.Center, }; Children.Add(_tbDrag); } else { InvalidateArrange(); } } return(cols[index]); }
void Start() { if (asset == null) { throw new Exception("No asset provided."); } Quaternion rotation = new Quaternion(1, 1, 1, 1); float q = 0.0f; Color color = new Color(q, q, 1.0f); Cols cols = null; Stream s = new MemoryStream(asset.bytes); using (ColsReader r = new ColsReader(s)) { try { cols = r.ReadCols(); } catch (Exception e) { Debug.Log("F**k"); Debug.LogException(e); } } if (cols == null || cols.Colis == null || cols.Colis.Count == 0) { Debug.Log("No collision found!"); return; } // Plot the colis for (int coliIdx = 0; coliIdx < cols.Colis.Count; coliIdx++) { var coli = cols.Colis[coliIdx]; var coliGameObj = new GameObject(); coliGameObj.transform.SetParent(gameObject.transform); coliGameObj.name = $"COLI {coliIdx}"; for (int coliObjIdx = 0; coliObjIdx < coli.ColiDatas.Count; coliObjIdx++) { ColiPlotter.PlotColiObj(coli.ColiDatas[coliObjIdx], coliGameObj, $"COLI {coliIdx}"); } } // Plot the hghts for (int hghtIdx = 0; hghtIdx < cols.Hghts.Count; hghtIdx++) { var hght = cols.Hghts[hghtIdx]; var hghtGameObj = new GameObject(); hghtGameObj.name = $"HGHT {hghtIdx}"; hghtGameObj.transform.SetParent(gameObject.transform); for (int hghtObjIdx = 0; hghtObjIdx < hght.HghtDatas.Count; hghtObjIdx++) { ColiPlotter.PlotHghtObj(hght.HghtDatas[hghtObjIdx], hghtGameObj, $"HGHT {hghtIdx}"); } } }
/// <summary> /// 使用DataTable来填充 /// </summary> /// <param name="dt"></param> public void FillBy(DataTable dt) { Cols.Clear(); Rows.Clear(); var regCardNum = new Regex(msRegCardNum, RegexOptions.IgnoreCase); var bInitCols = true; foreach (DataRow dataRow in dt.Rows) { var row = new RowType(); foreach (DataColumn dataColumn in dt.Columns) { var sCol = dataColumn.ColumnName; if (!CheckValid(sCol)) { continue; } var sCell = dataRow[sCol].ToString(); if (regCardNum.IsMatch(sCol)) { //chage to base64 string var sTemp = MyCrypt.Encode(sCell, 0x21); //简单加一加密码 byte[] bytes = Encoding.ASCII.GetBytes(sTemp ?? string.Empty); string sBase64 = Convert.ToBase64String(bytes); sCell = sBase64; } if (bInitCols) { Cols.Add(sCol); } row.Add(sCell); } bInitCols = false; Rows.Add(row); } //没有记录集的话,也要输出列名 if (0 == dt.Rows.Count) { foreach (DataColumn dataColumn in dt.Columns) { var sCol = dataColumn.ColumnName; if (!CheckValid(sCol)) { continue; } Cols.Add(sCol); } } }
public Coli ReadColis(Cols cols) { this.BaseStream.Seek(cols.HeaderOffset, SeekOrigin.Begin); Coli coli = this.ReadColiMetadata(); while ((this.BaseStream.Position < (cols.ContentOffset + cols.Size)) && coli != null) { this.BaseStream.Seek(coli.ContentOffset, SeekOrigin.Begin); this.ReadColiObjects(coli); cols.Colis.Add(coli); coli = this.ReadColiMetadata(); } return(coli); }
public Hght ReadHghts(Cols cols) { this.BaseStream.Seek(cols.HeaderOffset, SeekOrigin.Begin); Hght hght = this.ReadHghtMetadata(); while ((this.BaseStream.Position < (cols.ContentOffset + cols.Size)) && hght != null) { this.BaseStream.Seek(hght.ContentOffset, SeekOrigin.Begin); this.ReadHghtObjects(hght); cols.Hghts.Add(hght); hght = this.ReadHghtMetadata(); } return(hght); }