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; }
public UnitGraphNode AddUnit(Unit unit) { UnitGraphNode unitGraphNode; var success = nodes.TryGetValue(unit, out unitGraphNode); if (!success) nodes.Add(unit, unitGraphNode = new UnitGraphNode(unit)); return unitGraphNode; }
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); }
public UnitGraphNode AddUnit(Unit unit) { UnitGraphNode unitGraphNode; var success = nodes.TryGetValue(unit, out unitGraphNode); if (!success) { nodes.Add(unit, unitGraphNode = new UnitGraphNode(unit)); } return(unitGraphNode); }
public void AddMeasurementConversion(UnitGraphNode from, UnitGraphNode to, Func <Measure, Measure> toTo, Func <Measure, Measure> toFrom) { from.AddConversion(to, toTo); to.AddConversion(from, toFrom); }
public void AddConversion(UnitGraphNode from, UnitGraphNode to, Func <decimal, decimal> toTo, Func <decimal, decimal> toFrom) { from.AddConversion(to, toTo); to.AddConversion(from, toFrom); }
public void AddMeasurementConversion(UnitGraphNode from, UnitGraphNode to, Func<Measure, Measure> toTo, Func<Measure, Measure> toFrom) { from.AddConversion(to, toTo); to.AddConversion(from, toFrom); }
public void AddConversion(UnitGraphNode from, UnitGraphNode to, Func<decimal, decimal> toTo, Func<decimal, decimal> toFrom) { from.AddConversion(to, toTo); to.AddConversion(from, toFrom); }