public void AdjustBracket(TKTProcDesc that) { //if (this.Bracket == null || that.Bracket == null) return; //that.Bracket = this.Bracket.Adjust(that.Bracket); for (int i = 0; i < this.Parts.Count; i++) { if ((this.Parts[i] is TKTProcBracket) && (this.Parts[i] is TKTProcBracket)) { TKTProcBracket bracket = this.Parts[i] as TKTProcBracket; var bracket2 = bracket.Adjust(that.Parts[i] as TKTProcBracket); this.Parts[i] = bracket2; } } procArgs.Clear(); for (int i = 0; i < this.Parts.Count; i++) { if (this.Parts[i] is TKTProcArg) { procArgs.Add(this.Parts[i] as TKTProcArg); } else if (this.Parts[i] is TKTProcBracket) { procArgs.AddRange((this.Parts[i] as TKTProcBracket).ListArgs); } } }
public bool Eq(TKTProcDesc another) { if (this == another) { return(true); } return(EqParts(another));//&& EqBrackets(another); }
bool EqParts(TKTProcDesc another) { if (this.Parts.Count != another.Parts.Count) { return(false); } for (int i = 0; i < this.Parts.Count; i++) { object thisPart = this.Parts[i]; object anotherPart = another.Parts[i]; if (thisPart is string) { if (!(anotherPart is string)) { return(false); } if (((thisPart as string) != anotherPart as string)) { return(false); } } else if (thisPart is TKTProcArg) { if (!(anotherPart is TKTProcArg)) { return(false); } if (!((thisPart as TKTProcArg).Eq(anotherPart as TKTProcArg))) { return(false); } } else if (thisPart is TKTProcBracket) { if (!(anotherPart is TKTProcBracket)) { return(false); } if (!((thisPart as TKTProcBracket).Eq(anotherPart as TKTProcBracket))) { return(false); } } } return(true); }
public TKTProcDesc CreateTail() { TKTProcDesc tailDesc = new TKTProcDesc(); List <object> list = this.Parts; for (int i = 1; i < list.Count; i++) { object item = list[i]; tailDesc.Add(item); } //if(this.Bracket!=null) //{ // tailDesc.Bracket = this.Bracket; //} return(tailDesc); }