AssertStructName() public static method

Asserts that a struct name is set.
Struct name is null or empty
public static AssertStructName ( string structName ) : void
structName string a struct name
return void
Ejemplo n.º 1
0
        /// <seealso cref= XMPMeta#setStructField(String, String, String, String, String,
        ///      PropertyOptions) </seealso>
        public virtual void SetStructField(string schemaNs, string structName, string fieldNs, string fieldName,
                                           string fieldValue, PropertyOptions options)
        {
            ParameterAsserts.AssertSchemaNs(schemaNs);
            ParameterAsserts.AssertStructName(structName);

            string fieldPath = structName + XmpPathFactory.ComposeStructFieldPath(fieldNs, fieldName);

            SetProperty(schemaNs, fieldPath, fieldValue, options);
        }
Ejemplo n.º 2
0
        /// <seealso cref= XMPMeta#getStructField(String, String, String, String) </seealso>
        public virtual IXmpProperty GetStructField(string schemaNs, string structName, string fieldNs, string fieldName)
        {
            // fieldNs and fieldName are checked inside composeStructFieldPath
            ParameterAsserts.AssertSchemaNs(schemaNs);
            ParameterAsserts.AssertStructName(structName);

            string fieldPath = structName + XmpPathFactory.ComposeStructFieldPath(fieldNs, fieldName);

            return(GetProperty(schemaNs, fieldPath));
        }
Ejemplo n.º 3
0
        /// <seealso cref= XMPMeta#doesStructFieldExist(String, String, String, String) </seealso>
        public virtual bool DoesStructFieldExist(string schemaNs, string structName, string fieldNs, string fieldName)
        {
            try {
                // fieldNs and fieldName are checked inside composeStructFieldPath()
                ParameterAsserts.AssertSchemaNs(schemaNs);
                ParameterAsserts.AssertStructName(structName);

                string path = XmpPathFactory.ComposeStructFieldPath(fieldNs, fieldName);
                return(DoesPropertyExist(schemaNs, structName + path));
            }
            catch (XmpException) {
                return(false);
            }
        }
Ejemplo n.º 4
0
        /// <seealso cref= XMPMeta#deleteStructField(String, String, String, String) </seealso>
        public virtual void DeleteStructField(string schemaNs, string structName, string fieldNs, string fieldName)
        {
            try {
                // fieldNs and fieldName are checked inside composeStructFieldPath
                ParameterAsserts.AssertSchemaNs(schemaNs);
                ParameterAsserts.AssertStructName(structName);

                string fieldPath = structName + XmpPathFactory.ComposeStructFieldPath(fieldNs, fieldName);
                DeleteProperty(schemaNs, fieldPath);
            }
            catch (XmpException) {
                // EMPTY, exceptions within delete are ignored
            }
        }