private ExportWithUnits(IEnumerable <PortModel> inPorts, IEnumerable <PortModel> outPorts) : base(inPorts, outPorts) { SelectedExportedUnit = ConversionUnit.Feet; SelectedExportedUnitsSource = Conversions.ConversionMetricLookup[ConversionMetricUnit.Length]; ShouldDisplayPreviewCore = true; }
private ExportWithUnits(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPorts): base(inPorts, outPorts) { SelectedExportedUnit = ConversionUnit.Feet; SelectedExportedUnitsSource = Conversions.ConversionMetricLookup[ConversionMetricUnit.Length]; ShouldDisplayPreviewCore = true; }
protected override void DeserializeCore(XmlElement element, SaveContext context) { base.DeserializeCore(element, context); //Base implementation must be called. var helper = new XmlElementHelper(element); var exportedUnit = helper.ReadString("exportedUnit"); SelectedExportedUnit = Enum.Parse(typeof(ConversionUnit), exportedUnit) is ConversionUnit ? (ConversionUnit)Enum.Parse(typeof(ConversionUnit), exportedUnit) : ConversionUnit.Feet; }
// parameter is the data context // value is the selection public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is ConversionUnit) { ConversionUnit st = (ConversionUnit)value; string localizedEnum = Resources.ResourceManager.GetString("Unit" + st, culture); return(localizedEnum ?? string.Empty); } return(string.Empty); }
public ExportWithUnits() { SelectedExportedUnit = ConversionUnit.Feet; SelectedExportedUnitsSource = Conversions.ConversionMetricLookup[ConversionMetricUnit.Length]; InPortData.Add(new PortData("geometry", Resources.ExportToSatGeometryInputDescription)); InPortData.Add(new PortData("filePath", Resources.ExportToSatFilePathDescription, new StringNode())); OutPortData.Add(new PortData("string", Resources.ExportToSatFilePathOutputDescription)); ShouldDisplayPreviewCore = true; RegisterAllPorts(); }
public ExportWithUnits() { SelectedExportedUnit = ConversionUnit.Feet; SelectedExportedUnitsSource = Conversions.ConversionMetricLookup[ConversionMetricUnit.Length]; InPortData.Add(new PortData("geometry", Resources.ExportToSatGeometryInputDescription)); InPortData.Add(new PortData("filePath", Resources.ExportToSatFilePathDescription, new StringNode())); OutPortData.Add(new PortData("string", Resources.ExportToSatFilePathOutputDescription)); ShouldDisplayPreviewCore = true; RegisterAllPorts(); }
internal string ConvertPhoneme(string phoneme, bool isSapi) { ConversionUnit conversionUnit = (!isSapi) ? ((ConversionUnit)prefixUpsTable[phoneme]) : ((ConversionUnit)prefixSapiTable[phoneme]); if (conversionUnit == null) { return(null); } if (!isSapi) { return(conversionUnit.sapi); } return(conversionUnit.ups); }
internal PhoneMapData(Stream input) { using (BinaryReader binaryReader = new BinaryReader(input, Encoding.Unicode)) { int num = binaryReader.ReadInt32(); convertTable = new ConversionUnit[num]; for (int i = 0; i < num; i++) { convertTable[i] = new ConversionUnit(); convertTable[i].sapi = ReadPhoneString(binaryReader); convertTable[i].ups = ReadPhoneString(binaryReader); convertTable[i].isDefault = ((binaryReader.ReadInt32() != 0) ? true : false); } prefixSapiTable = InitializePrefix(true); prefixUpsTable = InitializePrefix(false); } }
internal PhoneMapData(Stream input) { using (BinaryReader reader = new(input, System.Text.Encoding.Unicode)) { int size = reader.ReadInt32(); _convertTable = new ConversionUnit[size]; int i; for (i = 0; i < size; i++) { _convertTable[i] = new ConversionUnit { sapi = ReadPhoneString(reader), ups = ReadPhoneString(reader), isDefault = reader.ReadInt32() != 0 ? true : false }; } _prefixSapiTable = InitializePrefix(true); _prefixUpsTable = InitializePrefix(false); } }
protected override void DeserializeCore(XmlElement element, SaveContext context) { base.DeserializeCore(element, context); //Base implementation must be called. var helper = new XmlElementHelper(element); var exportedUnit = helper.ReadString("exportedUnit"); SelectedExportedUnit = Enum.Parse(typeof(ConversionUnit), exportedUnit) is ConversionUnit ? (ConversionUnit)Enum.Parse(typeof(ConversionUnit), exportedUnit) : ConversionUnit.Feet; }