internal string GetCacheKey() { if (this._cacheKey == null && this._spanList.Count > 0) { if (this._spanList.Count == 1 && this._spanList[0].Navigations.Count == 1) { this._cacheKey = this._spanList[0].Navigations[0]; } else { StringBuilder stringBuilder = new StringBuilder(); for (int index1 = 0; index1 < this._spanList.Count; ++index1) { if (index1 > 0) { stringBuilder.Append(";"); } Span.SpanPath span = this._spanList[index1]; stringBuilder.Append(span.Navigations[0]); for (int index2 = 1; index2 < span.Navigations.Count; ++index2) { stringBuilder.Append("."); stringBuilder.Append(span.Navigations[index2]); } } this._cacheKey = stringBuilder.ToString(); } } return(this._cacheKey); }
internal void AddSpanPath(Span.SpanPath spanPath) { if (!this.ValidateSpanPath(spanPath)) { return; } this.RemoveExistingSubPaths(spanPath); this._spanList.Add(spanPath); }
private bool ValidateSpanPath(Span.SpanPath spanPath) { for (int index = 0; index < this._spanList.Count; ++index) { if (spanPath.IsSubPath(this._spanList[index])) { return(false); } } return(true); }
public bool IsSubPath(Span.SpanPath rhs) { if (this.Navigations.Count > rhs.Navigations.Count) { return(false); } for (int index = 0; index < this.Navigations.Count; ++index) { if (!this.Navigations[index].Equals(rhs.Navigations[index], StringComparison.OrdinalIgnoreCase)) { return(false); } } return(true); }
private void RemoveExistingSubPaths(Span.SpanPath spanPath) { List <Span.SpanPath> spanPathList = new List <Span.SpanPath>(); for (int index = 0; index < this._spanList.Count; ++index) { if (this._spanList[index].IsSubPath(spanPath)) { spanPathList.Add(this._spanList[index]); } } foreach (Span.SpanPath spanPath1 in spanPathList) { this._spanList.Remove(spanPath1); } }