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
Esempio 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);
        }
Esempio 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));
        }
Esempio 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);
            }
        }
Esempio 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
            }
        }