public ConsoleString(ConsolePoint position, IEnumerable <ConsoleSegment> segments) { Position = position; Segments = segments.ToImmutableList(); _outputString = new CommandLineParsing.Output.ConsoleString(Segments.Select(Map)); }
public virtual int GetEstimatedSize() { return(Segments.Select(segment => segment.Starts.DataLength + segment.Lengths.DataLength + segment.SharedIndices.DataLength).Sum()); }
protected override IEnumerable <Command> OnCreate(IMetadata sourceMetadata, IMetadata targetMetadata, IComparerContext context) { if (IsUserCreatedIndex) { var command = new Command(); command .Append($"CREATE {(Unique ? "UNIQUE " : string.Empty)}{(Descending ? "DESCENDING" : "ASCENDING")} INDEX {IndexName.AsSqlIndentifier()}") .AppendLine() .Append($" ON {RelationName.AsSqlIndentifier()}"); if (ExpressionSource == null) { command.Append($"({string.Join(",", Segments.Select(s => s.FieldName.AsSqlIndentifier()))})"); } else { command.Append($" COMPUTED BY {ExpressionSource}"); } yield return(command); if (Inactive) { yield return(HandleIndexActiveInactive(context)); } } }
/// <summary> /// Output the path string. /// </summary> /// <returns>The string.</returns> public override string ToString() { if (PathTemplate != null) { return(PathTemplate); } return("/" + String.Join("/", Segments.Select(e => e.Kind))); }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["BaseCurve"] = BaseCurve.getJson(this, options); obj["Segments"] = new JArray(Segments.Select(x => x.getJson(this, options))); if (EndPoint != null) { obj["EndPoint"] = EndPoint.getJson(this, options); } }
/// <summary> /// Gets the URL part for this segment. Used in URLs construction. /// If any of the child parts is <c>null</c>, the result is also <c>null</c>. /// </summary> /// <param name="valueGetter">The route value getter delegate.</param> /// <returns> /// Returns the corresponding part of the URL or <c>null</c> when the value is missing. /// </returns> public override SegmentValue GetUrlPart(Func <string, SegmentValue> valueGetter) { var parts = Segments.Select(s => s.GetUrlPart(valueGetter)).ToList(); if (parts.Any(p => p == null)) { return(null); } return((SegmentValue)string.Concat(parts.Select(s => s.ToString()))); }
private void onPreferencesChanged(IDatabasePreferences preferences) { DurationFormat = preferences.DurationFormat; dateFormat = preferences.DateFormat; var segments = Segments.Select(segment => segment.WithDurationFormat(DurationFormat)); Segments.Clear(); Segments.AddRange(segments); updateCurrentDateRangeString(); }
public void VerifyIsStraight() { _IsStraight = true; if (Segments.Count > 2) { _IsStraight = CheckPointsAreStraight(Segments.Select(s => s.PointOnString)); } else if (Points.Count > 2) { //unused at the moment, was coded in case I needed to create fret lines directly from points _IsStraight = CheckPointsAreStraight(Points); } }
public void PrepareSegments() { Segments.ForEach(s => s.IsClipped = s.GetIsClipped(TopLeft, BottomRight) && !s.IsOutline); if (_clipping) { Segments.RemoveAll(s => s.IsClipped); } DoMergeCollinearSegments(); SplitSegmentsThatOverlap(); EndPoints.AddRange(Segments.Select(vs => vs.Start)); EndPoints.AddRange(Segments.Select(vs => vs.End)); DebugDrawSegments(); }
/// <summary> /// Gets the regex pattern for the current segment. /// </summary> /// <returns></returns> public override string GetRegexPattern() { var pattern = String.Concat(Segments.Select(s => s.GetRegexPattern())); if (String.IsNullOrEmpty(pattern)) { return(pattern); } if (Segments.Count > 1) { pattern = '(' + pattern + ')'; } return(pattern + "?"); }
/// <summary> /// Gets the URL part for this segment. Used in URLs construction. /// If any of the child parts is <c>null</c>, returns an empty string. /// </summary> /// <param name="valueGetter">The route value getter delegate.</param> /// <returns> /// Returns the corresponding part of the URL or <c>null</c> when the value is missing. /// </returns> public override SegmentValue GetUrlPart(Func <string, SegmentValue> valueGetter) { var parts = Segments.Select(s => s.GetUrlPart(valueGetter)).ToList(); if (parts.Any(p => p == null) || parts.Count == 0) { return(SegmentValue.Empty); } if (ShouldBeEmpty(parts)) { return(SegmentValue.Empty); } var result = string.Concat(parts.Select(s => s.ToString())); return(SegmentValue.Create(result)); }
public static string EncodeParagraph(params string[] Segments) { var encodedSegments = Segments.Select(s => EncodeString(s)); var r = ""; var rows = encodedSegments.Max(s => s.Length); for (int i = 0; i < rows; i += 5) { foreach (var s in encodedSegments) { if (s.Length <= i) { r += " "; } else { r += s.Substring(i, 5) + " "; } } r += "\n"; } return(r); }
public override void GenerateHash( ) { base.GenerateHash(); this.GeometryHash += GetMd5FromObject(Segments.Select(obj => obj.Hash).ToArray()); this.Hash = GetMd5FromObject(this.GeometryHash + GetMd5FromObject(this.Properties)); }
public string ToUrlFromParameters(IDictionary <string, object> parameters) { return("/" + Segments.Select(x => x.SegmentFromParameters(parameters)).Join("/")); }
public string RoutePatternString() { return("/" + Segments.Select(x => x.RoutePatternPath()).Join("/")); }
public IGS1Item GetSegment(string applicationIdentifier) { return(Segments.Select(item => item).SingleOrDefault(x => x.Id == applicationIdentifier)); }
public string ReadRouteDataFromMethodArguments(Expression expression) { var arguments = MethodCallParser.ToArguments(expression); return("/" + Segments.Select(x => x.ReadRouteDataFromMethodArguments(arguments)).Join("/")); }
public override string ToString() { return("/" + string.Join("/", Segments.Select(s => s.Value)) + (QueryString.IsDefined ? ("?" + QueryString.ToString()) : "")); }
public string ToXPath() { var parts = Segments.Select(s => "f:" + s.Name); return(string.Join("/", parts)); }
public Element SegmentsAsWorkshopData() => Element.CreateArray( Segments.Select(segment => segment.AsWorkshopData()).ToArray() );
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["Segments"] = new JArray(Segments.Select(x => x.getJson(this, options))); obj["RailHeadDistance"] = mRailHeadDistance.ToString(); }
public override string ToString() { return(string.Join(";", Segments.Select(s => s.ToString(_a)))); }
/// <summary> /// Gets the regex pattern for the current segment. /// </summary> /// <returns></returns> public override string GetRegexPattern() { var pattern = String.Concat(Segments.Select(s => s.GetRegexPattern())); return('^' + pattern + '$'); }
private string ToXPath() { var parts = Segments.Select(s => "f:" + s.Name); return("../" + string.Join("/", parts)); }
/// <summary> /// Output the path string. /// </summary> /// <returns>The string.</returns> public override string ToString() { return("/" + String.Join("/", Segments.Select(e => e.Kind))); }
public void GetDistinctTransportationCompany() { TransportationCompanies = Segments.Select(x => x.TransportationCompany).Distinct().ToList(); }