/// <summary> /// 通过主键查找连接元素。 /// </summary> /// <param name="key"></param> /// <returns></returns> public ConnectionElement FindConnection(IConnectionKey key) { //return this._connections.FirstOrDefault(el => el.From == key.From && el.To == key.To && el.Label == key.Label); return this.FindConnection(key.From, key.To, key.Label); }
bool IEquatable <IConnectionKey> .Equals(IConnectionKey other) => other == this || (other is INamedPipeKey otherClient &&
//private ModelingDesigner _designer; //public BlockRelationCollection(ModelingDesigner designer) //{ // _designer = designer; //} //public BlockRelation FindByKey(string from, string to, string label) //{ // return this.FirstOrDefault(r => r.FromBlock == from && r.ToBlock == to && r.Label == label); //} /// <summary> /// 通过连接键,查找指定的关系 /// </summary> /// <param name="key"></param> /// <returns></returns> public BlockRelation FindByKey(IConnectionKey key) { return(this.FirstOrDefault(r => r.FromBlock == key.From && r.ToBlock == key.To && r.Label == key.Label)); }
/// <summary> /// 通过主键查找连接元素。 /// </summary> /// <param name="key"></param> /// <returns></returns> public ConnectionElement FindConnection(IConnectionKey key) { //return this._connections.FirstOrDefault(el => el.From == key.From && el.To == key.To && el.Label == key.Label); return(this.FindConnection(key.From, key.To, key.Label)); }