public static void WriteProperty(this ExportEntry export, Property prop) { var props = export.GetProperties(); props.AddOrReplaceProp(prop); export.WriteProperties(props); }
public static bool RemoveProperty(this ExportEntry export, string propname) { var props = export.GetProperties(); Property propToRemove = null; foreach (Property prop in props) { if (prop.Name == propname) { propToRemove = prop; break; } } //outside for concurrent collection modification if (propToRemove != null) { props.Remove(propToRemove); export.WriteProperties(props); return(true); } return(false); }