本文整理汇总了C#中Columns类的典型用法代码示例。如果您正苦于以下问题:C# Columns类的具体用法?C# Columns怎么用?C# Columns使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Columns类属于命名空间,在下文中一共展示了Columns类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetColumns
private Columns GetColumns(string connectionString, string sqlCmd)
{
Columns columns = new Columns(50);
MySqlDataReader dr = MySqlHelper.ExecuteReader(connectionString, sqlCmd);
while (dr.Read())
{
string id = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
string displayName = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
string name = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
string dataType = dr.IsDBNull(3) ? string.Empty : dr.GetString(3);
string key = dr.IsDBNull(4) ? string.Empty : dr.GetString(4);
string defaultValue = dr.IsDBNull(5) ? string.Empty : dr.GetString(5);
string isNullable = dr.IsDBNull(6) ? string.Empty : dr.GetString(6);
string length = dr.IsDBNull(7) ? string.Empty : dr.GetString(7);
string identity = dr.IsDBNull(8) ? string.Empty : dr.GetString(8);
string comment = dr.IsDBNull(9) ? string.Empty : dr.GetString(9);
Column column = new Column(id, displayName, name, dataType, comment);
column.Length = ConvertHelper.GetInt32(length);
column.IsAutoIncremented = identity.Equals("auto_increment");
column.IsNullable = isNullable.Equals("YES");
column.DefaultValue = defaultValue.ToEmpty();
column.DataType = dataType;
column.OriginalName = name;
columns.Add(id, column);
}
dr.Close();
return columns;
}
示例2: CalculateColumns
public Columns CalculateColumns()
{
Columns columns = new Columns();
Column lastColumn = null;
Offset lastOffset = Offset.Zero;
int count = _members.Count;
for (int i = 0; i < count; i++)
{
Offset thisOffset = this[i].TopOffset;
if (thisOffset.IsLessThanOrEqualTo(lastOffset))
{
if (lastColumn != null)
{
lastColumn.SetEnd(i);
}
Column col = new Column(this, i);
columns.Add(col);
lastColumn = col;
}
lastOffset = thisOffset;
}
lastColumn.SetEnd(count);
return columns;
}
示例3: GetColumns
private Columns GetColumns(string connectionString, string sqlCmd)
{
Columns columns = new Columns(50);
SqlDataReader dr = SqlHelper.ExecuteReader(connectionString, CommandType.Text, sqlCmd);
while (dr.Read())
{
string id = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
string displayName = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
string name = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
int length = dr.IsDBNull(3) ? 0 : dr.GetInt16(3);
bool identity = dr.IsDBNull(4) ? false : dr.GetBoolean(4);
bool isNullable = dr.IsDBNull(5) ? false : dr.GetBoolean(5);
bool isComputed = dr.IsDBNull(6) ? false : dr.GetBoolean(6);
string dataType = dr.IsDBNull(7) ? string.Empty : dr.GetString(7);
string comment = dr.IsDBNull(8) ? string.Empty : dr.GetString(8);
string defaultValue = dr.IsDBNull(9) ? string.Empty : dr.GetString(9);
Column column = new Column(id, displayName, name, dataType, comment);
column.Length = length;
column.IsAutoIncremented = identity;
column.IsNullable = isNullable;
column.DefaultValue = defaultValue;
column.DataType = dataType;
column.OriginalName = name;
column.IsComputed = isComputed;
columns.Add(id, column);
}
dr.Close();
return columns;
}
示例4: GetColumns
private Columns GetColumns(XmlNode tableOrViewNode)
{
XmlNode columnsNode = tableOrViewNode["c:Columns"];
if (columnsNode == null ||
columnsNode.ChildNodes.Count == 0) return null;
XmlNodeList columnNodes = columnsNode.ChildNodes;
Columns columns = new Columns(columnNodes.Count);
foreach (XmlNode columnNode in columnNodes)
{
string id = columnNode.Attributes["Id"].InnerText;
string displayName = columnNode["a:Name"].InnerText;
string name = columnNode["a:Code"].InnerText;
string comment = columnNode["a:Comment"] != null ? columnNode["a:Comment"].InnerText : string.Empty;
string dataType = columnNode["a:DataType"] != null ? columnNode["a:DataType"].InnerText : string.Empty;
string length = columnNode["a:Length"] != null ? columnNode["a:Length"].InnerText : "0";
string identity = columnNode["a:Identity"] != null ? columnNode["a:Identity"].InnerText : string.Empty;
string mandatory = columnNode["a:Mandatory"] != null ? columnNode["a:Mandatory"].InnerText : string.Empty;
string defaultValue = columnNode["a:DefaultValue"] != null ? columnNode["a:DefaultValue"].InnerText : string.Empty;
Column column = new Column(id, displayName, name, dataType, comment);
column.Length = Int32.Parse(length);
column.IsAutoIncremented = identity.Equals("1");
column.IsNullable = mandatory.Equals("1");
column.DefaultValue = defaultValue.ToEmpty();
column.DataType = Regex.Replace(column.DataType, "\\(.*?\\)", "");
column.OriginalName = name;
columns.Add(id, column);
}
return columns;
}
示例5: Move
public Move(Columns column, Rows row, Values value, int score = 0)
: this()
{
Row = row;
Column = column;
Value = value;
Score = score;
}
示例6: Remove_Column
public void Remove_Column()
{
var test = new Columns();
var column = new Column("testing", ColumnTypes.Bigint, true);
test.Add(column);
test.Remove(column);
Assert.False(test.Items.Any(item => item.Name == "testing"));
}
示例7: Exporter
public Exporter(string path, List<Measurement> measurements, Columns[] columns, string lineTerminator, string delimiter, bool header)
{
this.path = path;
this.measurements = measurements;
this.columns = columns;
this.lineTerminator = lineTerminator;
this.delimiter = delimiter;
this.header = header;
}
示例8: AddColumn
public ViewComponentResult AddColumn(Columns model)
{
Columns tempColumn = new Columns(model.Name, model.BoardID); // The model got passed the last column ID
m_context.Columns.Add(tempColumn);
m_context.SaveChanges();
tempColumn.TasksList = new List<Tasks>();
return ViewComponent("Panel_Lists", tempColumn);
}
示例9: AddGeneralColumn
public static GeneralColumn AddGeneralColumn(Columns Columns, TableField Field, bool IsEnabled, bool CanDisabled)
{
GeneralColumn Column = Columns.CreateGeneralColumn();
Column.Field = Field;
Column.IsEnabled = IsEnabled;
Column.CanDisable = CanDisabled;
Columns.Add(Column);
return Column;
}
示例10: GenerateDocument
public static Document GenerateDocument()
{
Document document1 = new Document() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
document1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
document1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
document1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
document1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
document1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
document1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
document1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
document1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
document1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
document1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
document1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
document1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
document1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
document1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
document1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
DocumentBackground documentBackground1 = new DocumentBackground() { Color = "FF0000" };
V.Background background1 = new V.Background() { Id = "_x0000_s1025", BlackWhiteMode = Ovml.BlackAndWhiteModeValues.GrayScale, TargetScreenSize = Ovml.ScreenSizeValues.Sz1024x768 };
V.Fill fill1 = new V.Fill() { Type = V.FillTypeValues.Frame, Title = "Wedding_EnclosureCards", Recolor = true, Color = "FF0000" };
background1.Append(fill1);
documentBackground1.Append(background1);
Body body1 = new Body();
Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "005F6C39", RsidRunAdditionDefault = "005F6C39" };
BookmarkStart bookmarkStart1 = new BookmarkStart() { Name = "_GoBack", Id = "0" };
BookmarkEnd bookmarkEnd1 = new BookmarkEnd() { Id = "0" };
paragraph1.Append(bookmarkStart1);
paragraph1.Append(bookmarkEnd1);
SectionProperties sectionProperties1 = new SectionProperties() { RsidR = "005F6C39" };
PageSize pageSize1 = new PageSize() { Width = (UInt32Value)12240U, Height = (UInt32Value)15840U };
PageMargin pageMargin1 = new PageMargin() { Top = 1440, Right = (UInt32Value)1440U, Bottom = 1440, Left = (UInt32Value)1440U, Header = (UInt32Value)720U, Footer = (UInt32Value)720U, Gutter = (UInt32Value)0U };
Columns columns1 = new Columns() { Space = "720" };
DocGrid docGrid1 = new DocGrid() { LinePitch = 360 };
sectionProperties1.Append(pageSize1);
sectionProperties1.Append(pageMargin1);
sectionProperties1.Append(columns1);
sectionProperties1.Append(docGrid1);
body1.Append(paragraph1);
body1.Append(sectionProperties1);
document1.Append(documentBackground1);
document1.Append(body1);
return document1;
}
示例11: Loader
public Loader(string file, string delimiter, Columns[] columns, ITimeDomain timeDomain, int skip)
{
// Populate fields.
this.CurrentLine = 1;
this.Name = new FileInfo(file).Name;
this.Data = new List<Measurement>();
this.columns = columns;
this.delimiter = "\t";
this.timeDomain = timeDomain;
this.skip = skip;
this.file = file;
}
示例12: AddColumns
private void AddColumns(SpreadsheetDocument doc, string sheetName)
{
var sheetData = doc.GetSheetDataByName(sheetName);
var headerRow = sheetData.Descendants<Row>().FirstOrDefault();
if (headerRow == null) return;
var colCount = headerRow.Descendants<Cell>().Count();
var columnRange = Enumerable.Range(0, colCount).Select(i => CreateColumn(doc, sheetData, i));
var columns = new Columns(columnRange);
var sheet = doc.GetWorksheetByName(sheetName);
sheet.InsertAt(columns, 0);
}
示例13: ZurbPanel
public ZurbPanel(HtmlHelper html, Columns columnWidth, string cssClass = null)
{
_html = html;
var panel = new TagBuilder("div");
panel.AddCssClass("panel");
panel.AddCssClass(String.Format("{0} columns", columnWidth.GetStringValue()));
if (cssClass != null)
panel.AddCssClass(cssClass);
_html.ViewContext.Writer.Write(panel.ToString(TagRenderMode.StartTag));
}
示例14: AddColumns
private Columns AddColumns(String prefix)
{
var columns = new Columns();
columns.TracerAmountsByAreaColumns = AddDataColumns(prefix, "Tracer % (area)");
columns.TracerAmountsBySlopeColumns = AddDataColumns(prefix, "Tracer % (slope)");
columns.PrecursorEnrichmentColumns = AddDataColumns(prefix, "Precursor Enrichment");
columns.TurnoverColumns = AddDataColumns(prefix, "Turnover");
columns.AreaUnderCurveColumns = AddDataColumns(prefix, "Area Under Curve");
dataGridView1.Columns.Add(columns.ReplicateCountColumn = new DataGridViewTextBoxColumn
{
HeaderText = prefix + "Count",
});
return columns;
}
示例15: Create
public void Create(string fileName)
{
FileName = fileName;
using (SpreadsheetDocument doc = SpreadsheetDocument.Create(FileName, DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook))
{
var workbookPart = doc.AddWorkbookPart();
var worksheetPart = workbookPart.AddNewPart<WorksheetPart>();
// Create Styles
var stylesPart = doc.WorkbookPart.AddNewPart<WorkbookStylesPart>();
Style = new CustomStylesheet();
LoadCustomFonts();
LoadCustomBorders();
LoadCustomStyles();
Style.Save(stylesPart);
string relId = workbookPart.GetIdOfPart(worksheetPart);
// create workbook and sheet
var workbook = new Workbook();
var worksheet = new Worksheet();
var fileVersion = new FileVersion { ApplicationName = "Microsoft Office Excel" };
// create columns
var columns = new Columns();
CreateColumns(columns);
worksheet.Append(columns);
// create Sheet
var sheets = new Sheets();
var sheet = new Sheet { Name = "My sheet", SheetId = 1, Id = relId };
sheets.Append(sheet);
workbook.Append(fileVersion);
workbook.Append(sheets);
var sheetData = new SheetData();
LoadData(sheetData);
worksheet.Append(sheetData);
worksheetPart.Worksheet = worksheet;
worksheetPart.Worksheet.Save();
doc.WorkbookPart.Workbook = workbook;
doc.WorkbookPart.Workbook.Save();
//doc.Close();
}
}