SuperMap.Web.iServerJava6R.Bridge.ToServerFeature C# (CSharp) Method

ToServerFeature() public static method

${iServerJava6R_Bridge_method_ToServerFeature}
public static ToServerFeature ( this feature ) : ServerFeature
feature this ${iServerJava6R_Bridge_method_ToServerFeature_param_feature}
return ServerFeature
        public static ServerFeature ToServerFeature(this Feature feature)
        {
            if (feature != null)
            {
                ServerFeature f = new ServerFeature();
                f.FieldNames = new List<string>();
                f.FieldValues = new List<string>();

                if (feature.Geometry != null)
                {
                    f.Geometry = feature.Geometry.ToServerGeometry();
                }
                if (feature.Attributes != null && feature.Attributes.Count > 0)
                {
                    foreach (KeyValuePair<string, object> kv in feature.Attributes)
                    {
                        f.FieldNames.Add(kv.Key);

                        f.FieldValues.Add(kv.Value != null ? kv.Value.ToString() : "null");
                    }
                }
                return f;
            }
            return null;
        }