예제 #1
0
 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
파일: UnitGraph.cs 프로젝트: flq/NMeasure
 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;
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public void AddMeasurementConversion(UnitGraphNode from, UnitGraphNode to, Func <Measure, Measure> toTo, Func <Measure, Measure> toFrom)
 {
     from.AddConversion(to, toTo);
     to.AddConversion(from, toFrom);
 }
예제 #6
0
 public void AddConversion(UnitGraphNode from, UnitGraphNode to, Func <decimal, decimal> toTo, Func <decimal, decimal> toFrom)
 {
     from.AddConversion(to, toTo);
     to.AddConversion(from, toFrom);
 }
예제 #7
0
파일: UnitGraph.cs 프로젝트: flq/NMeasure
 public void AddMeasurementConversion(UnitGraphNode from, UnitGraphNode to, Func<Measure, Measure> toTo, Func<Measure, Measure> toFrom)
 {
     from.AddConversion(to, toTo);
     to.AddConversion(from, toFrom);
 }
예제 #8
0
파일: UnitGraph.cs 프로젝트: flq/NMeasure
 public void AddConversion(UnitGraphNode from, UnitGraphNode to, Func<decimal, decimal> toTo, Func<decimal, decimal> toFrom)
 {
     from.AddConversion(to, toTo);
     to.AddConversion(from, toFrom);
 }