using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GeoSigma.SigmaDrawerStyle.Converter { public class ColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { PointInfoProperty pointProperty = (PointInfoProperty)context.Instance; string[] columnItems = new string[1]; if (pointProperty.ColumnLength != null) { columnItems = new string[int.Parse(pointProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(pointProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class ScatterColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { ScatterPointInfoProperty scatterProperty = (ScatterPointInfoProperty)context.Instance; string[] columnItems = new string[1]; if (scatterProperty.ColumnLength != null) { columnItems = new string[int.Parse(scatterProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(scatterProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class CrossPointColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { CrossPointProperty crossPointProperty = (CrossPointProperty)context.Instance; string[] columnItems = new string[1]; if (crossPointProperty.ColumnLength != null) { columnItems = new string[int.Parse(crossPointProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(crossPointProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class FractionPointColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { FractionPointProperty fractionProperty = (FractionPointProperty)context.Instance; string[] columnItems = new string[1]; if (fractionProperty.ColumnLength != null) { columnItems = new string[int.Parse(fractionProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(fractionProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class LineClassColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { LineClassInfoProperty lineClassProperty = (LineClassInfoProperty)context.Instance; string[] columnItems = new string[1]; if (lineClassProperty.ColumnLength != null) { columnItems = new string[int.Parse(lineClassProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(lineClassProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class LineClass123ColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { LineClassInfoProperty123 lineClass123Property = (LineClassInfoProperty123)context.Instance; string[] columnItems = new string[1]; if (lineClass123Property.ColumnLength != null) { columnItems = new string[int.Parse(lineClass123Property.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(lineClass123Property.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class AverageMethodFirstColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { AverageMethodFirstProperty averageFirstProperty = (AverageMethodFirstProperty)context.Instance; string[] columnItems = new string[1]; if (averageFirstProperty.ColumnLength != null) { columnItems = new string[int.Parse(averageFirstProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(averageFirstProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class AverageMethodSecondColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { AverageMethodSecondProperty averageSecondProperty = (AverageMethodSecondProperty)context.Instance; string[] columnItems = new string[1]; if (averageSecondProperty.ColumnLength != null) { columnItems = new string[int.Parse(averageSecondProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(averageSecondProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class ConditionDeletionConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { string[] columnItems = new string[5]; columnItems[0] = "<门限值"; columnItems[1] = "<=门限值"; columnItems[2] = "=门限值"; columnItems[3] = ">=门限值"; columnItems[4] = ">门限值"; return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class OffsetMethodColumnCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { OffsetMethodProperty offsetProperty = (OffsetMethodProperty)context.Instance; string[] columnItems = new string[1]; if (offsetProperty.ColumnLength != null) { columnItems = new string[int.Parse(offsetProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(offsetProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } public class WellPositionPropertyCorrespondConvert : StringConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { WellPositionProperty wellPositionProperty = (WellPositionProperty)context.Instance; string[] columnItems = new string[1]; if (wellPositionProperty.ColumnLength != null) { columnItems = new string[int.Parse(wellPositionProperty.ColumnLength) + 1]; for (int i = 0; i < columnItems.Length; i++) { columnItems[i] = (i + 1).ToString(); } columnItems[int.Parse(wellPositionProperty.ColumnLength)] = "无"; } return new StandardValuesCollection(columnItems); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } }