mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-14 13:16:38 +08:00
整理一下项目文件
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class ConectorValueConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (values == null || values.Length < 1)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
if (values[0] is double && values[1] is ValueTypePoint)
|
||||
{
|
||||
double connectorValue = (double)values[0];
|
||||
ValueTypePoint valueTypePoint = (ValueTypePoint)values[1];
|
||||
|
||||
if (valueTypePoint == ValueTypePoint.Bool)
|
||||
{
|
||||
return (connectorValue == 0) ? "F" : "T";
|
||||
}
|
||||
else if (valueTypePoint == ValueTypePoint.Int)
|
||||
{
|
||||
return connectorValue.ToString("0");
|
||||
}
|
||||
else
|
||||
{
|
||||
return connectorValue.ToString("f3");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user