public static string ConvertSectionTypeToStr(enumPipeSectionType type) { if (type == enumPipeSectionType.WidthAndHeight) { return("宽*高"); } return("高*宽"); }
public void ReadFromXml(XmlNode node) { if (node.Attributes != null) { _name = node.Attributes["Name"] == null ? "" : node.Attributes["Name"].Value; _aliasName = node.Attributes["AliasName"] == null ? "" : node.Attributes["AliasName"].Value; _visible = node.Attributes["Visible"] == null ? true : (node.Attributes["Visible"].Value.ToUpper().StartsWith("T") ? true : false); _dataType = node.Attributes["DataType"] == null ? enumPipelineDataType.Point : EnumHelper.ConvertDataTypeFromString(node.Attributes["DataType"].Value); _heightType = node.Attributes["HeightType"] == null ? enumPipelineHeightType.Top : EnumHelper.ConvertHeightTypeFromStr(node.Attributes["HeightType"].Value); _depthType = node.Attributes["DepthType"] == null ? enumPipelineDepthType.Relative : EnumHelper.ConvertDepthTypeFromStr(node.Attributes["DepthType"].Value); _sectionType = node.Attributes["SectionType"] == null ? enumPipeSectionType.WidthAndHeight : EnumHelper.ConvertSectionTypeFromStr(node.Attributes["SectionType"].Value); _validateKeys = node.Attributes["ValidateKeys"] == null ? "" : node.Attributes["ValidateKeys"].Value; _templateName = node.Attributes["TemplateName"] == null ? "" : node.Attributes["TemplateName"].Value; _autoNames = node.Attributes["AutoNames"].Value; } XmlNodeList fieldNodes = node.SelectNodes("Fields/Field"); foreach (XmlNode fieldNode in fieldNodes) { IYTField field = new YTField(fieldNode); //需要检查已有的字段定义中有没有重名的 IYTField findField = _fields.FirstOrDefault(c => c.Name == field.Name); if (findField != null) { _fields.Remove(findField); } _fields.Add(field); } }
public BasicLayerInfo(IBasicLayerInfo info, bool keepClass) { _name = info.Name; _autoNames = info.AutoNames; _aliasName = info.AliasName; _visible = info.Visible; _dataType = info.DataType; _heightType = info.HeightType; _validateKeys = info.ValidateKeys; _templateName = info.TemplateName; _depthType = info.DepthType; _sectionType = info.SectionType; _fields = new List <IYTField>(); foreach (IYTField infoField in info.Fields) { _fields.Add(infoField.Clone(keepClass)); } if (keepClass) { _featureClass = info.FeatureClass; _esriClassName = info.EsriClassName; } }