Пример #1
0
        public static void WritePropertyAndBinary(this ExportEntry export, Property prop, ObjectBinary binary)
        {
            var props = export.GetProperties();

            props.AddOrReplaceProp(prop);
            export.WritePropertiesAndBinary(props, binary);
        }
Пример #2
0
        public static void WriteProperty(this ExportEntry export, Property prop)
        {
            var props = export.GetProperties();

            props.AddOrReplaceProp(prop);
            export.WriteProperties(props);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public static T GetProperty <T>(this ExportEntry export, string name) where T : Property
 {
     return(export.GetProperties().GetProp <T>(name));
 }