A unit graph edge links two units in terms of converting from one unit to another
コード例 #1
0
ファイル: UnitGraphNode.cs プロジェクト: flq/NMeasure
 public UnitGraphEdge AddConversion(UnitGraphNode to, Func<Measure, Measure> edgeToTarget)
 {
     UnitGraphEdge unitGraphEdge;
     var success = targets.TryGetValue(to, out unitGraphEdge);
     if (!success)
         targets.Add(to, unitGraphEdge = new UnitGraphEdge(unit, edgeToTarget, to.Unit));
     return unitGraphEdge;
 }
コード例 #2
0
ファイル: UnitGraphNode.cs プロジェクト: lidanger/NMeasure
        public UnitGraphEdge AddConversion(UnitGraphNode to, Func <Measure, Measure> edgeToTarget)
        {
            UnitGraphEdge unitGraphEdge;
            var           success = targets.TryGetValue(to, out unitGraphEdge);

            if (!success)
            {
                targets.Add(to, unitGraphEdge = new UnitGraphEdge(unit, edgeToTarget, to.Unit));
            }
            return(unitGraphEdge);
        }
コード例 #3
0
 public bool Equals(UnitGraphEdge other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.to, to) && Equals(other.from, from));
 }
コード例 #4
0
ファイル: UnitGraphEdge.cs プロジェクト: flq/NMeasure
 public bool Equals(UnitGraphEdge other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.to, to) && Equals(other.from, from);
 }