public ColumnPart AddColumn(string columnName) { var part = new ColumnPart(columnName, this); _queryParts.Add(part); return(part); }
private static void ProcessSettingNotNullable(IComponentMapping componentMapping) { foreach (var propertyMapping in componentMapping.Properties) { var member = propertyMapping.Member; if (!member.IsDbNullable()) { var column = propertyMapping.Columns.Single(); var columnPart = new ColumnPart(column); columnPart.Not.Nullable(); // column.NotNull = true; } } foreach (var manyToOneMapping in componentMapping.References) { var member = manyToOneMapping.Member; if (!member.IsDbNullable()) { foreach (var column in manyToOneMapping.Columns) { var columnPart = new ColumnPart(column); columnPart.Not.Nullable(); // column.NotNull = true; } } } foreach (var childComponentMapping in componentMapping.Components) { ProcessSettingNotNullable(childComponentMapping); } }
/// <summary> /// Sets the Index. /// </summary> /// <param name="manyToOneMapping">The many to one mapping.</param> /// <param name="indexName">Name of the index.</param> public static void Index(this ManyToOneMapping manyToOneMapping, string indexName) { if (manyToOneMapping.Columns.First().IsSpecified("Index")) { return; } foreach (var column in manyToOneMapping.Columns) { var columnPart = new ColumnPart(column); columnPart.Index(indexName); //column.Index =indexName; } }
/// <summary> /// Sets the column. /// </summary> /// <param name="manyToOneMapping">The many to one mapping.</param> /// <param name="columnName">Name of the column.</param> public static void Column(this ManyToOneMapping manyToOneMapping, string columnName) { if (manyToOneMapping.Columns.Any()) { return; } var originalColumn = manyToOneMapping.Columns.FirstOrDefault(); var column = originalColumn == null ? new ColumnMapping() : originalColumn.Clone(); var columnPart = new ColumnPart(column); columnPart.Name(columnName); manyToOneMapping.MakeColumnsEmpty(Layer.Defaults); manyToOneMapping.AddColumn(Layer.Defaults, column); // manyToOneMapping.AddColumn ( column ); }
/// <summary> /// Generates the datas. /// </summary> override public void GenerateDatas() { ColumnPoints.Clear(); if (this.Points != null && this.SeriesContainer != null) { if (!IsPointsGenerated) { Parts.Clear(); } StartEndPoints = new PointCollection(); Rects = new List <Rect>(); CalculateMinAndMax(); ChartPoint oldPoint = new ChartPoint() { XValue = double.MinValue, YValue = double.MinValue }; IntializePoints(); Point startAndEndPoint = CalculateColumnSeriesInfo(); foreach (ChartPoint point in this.Points) { if (CheckValuePoint(oldPoint, point)) { Point linePoint = NormalizePoint(new Point(point.XValue, point.YValue)); Point startPoint = NormalizePoint(new Point(point.XValue + startAndEndPoint.X, point.YValue)); Point endPoint = NormalizePoint(new Point(point.XValue + startAndEndPoint.Y, YMin)); StartEndPoints.Add(startPoint); StartEndPoints.Add(endPoint); ColumnPoints.Add(linePoint); Rects.Add(new Rect(startPoint, endPoint)); oldPoint = point; } } if (this.RenderingMode == RenderingMode.Default) { //if (!UseSinglePart) //{ if (!IsPointsGenerated) { for (int i = 0; i <= this.StartEndPoints.Count - 2; i += 2) { if (CheckValue(StartEndPoints[i].X) && CheckValue(StartEndPoints[i].Y) && CheckValue(StartEndPoints[i + 1].X) && CheckValue(StartEndPoints[i + 1].Y)) { ColumnPart columnPart = new ColumnPart(StartEndPoints[i].X, StartEndPoints[i].Y, StartEndPoints[i + 1].X, StartEndPoints[i + 1].Y); SetBindingForStrokeandStrokeThickness(columnPart); this.Parts.Add(columnPart); } //} //else //{ // LineSinglePart singlePart = new LineSinglePart(this.ColumnPoints); // SetBindingForStrokeandStrokeThickness(singlePart); // this.Parts.Add(singlePart); //} } IsPointsGenerated = true; } else { int i = 0; foreach (ColumnPart part in this.Parts) { if (CheckValue(StartEndPoints[i].X) && CheckValue(StartEndPoints[i].Y) && CheckValue(StartEndPoints[i + 1].X) && CheckValue(StartEndPoints[i + 1].Y)) { part.X1 = StartEndPoints[i].X; part.Y1 = StartEndPoints[i].Y; part.X2 = StartEndPoints[i + 1].X; part.Y2 = StartEndPoints[i + 1].Y; part.Refresh(); } i += 2; } } } } else { Parts.Clear(); } if (this.SeriesContainer != null) { this.SeriesContainer.Invalidate(); } IsRefreshed = false; }
public void SetUp() { this.mapping = new ColumnMapping(); this.columnPart = new ColumnPart(mapping); }