Esempio n. 1
0
        public bool IsEnforcedWith(ST_DocProtect editValue)
        {
            CT_DocProtect documentProtection = this.ctSettings.documentProtection;

            if (documentProtection == null || !documentProtection.enforcement.Equals((object)ST_OnOff.Value1))
            {
                return(false);
            }
            return(documentProtection.edit.Equals((object)editValue));
        }
Esempio n. 2
0
        private CT_DocProtect safeGetDocumentProtection()
        {
            CT_DocProtect documentProtection = ctSettings.documentProtection;

            if (documentProtection == null)
            {
                documentProtection            = new CT_DocProtect();
                ctSettings.documentProtection = (documentProtection);
            }
            return(ctSettings.documentProtection);
        }
Esempio n. 3
0
        /**
         * Verifies the documentProtection tag inside Settings.xml file <br/>
         * if the protection is enforced (w:enforcement="1") <br/>
         * and if the kind of protection Equals to passed (STDocProtect.Enum editValue) <br/>
         *
         * <br/>
         * sample snippet from Settings.xml
         * <pre>
         *     &lt;w:settings  ... &gt;
         *         &lt;w:documentProtection w:edit=&quot;readOnly&quot; w:enforcement=&quot;1&quot;/&gt;
         * </pre>
         *
         * @return true if documentProtection is enforced with option ReadOnly
         */
        public bool IsEnforcedWith(ST_DocProtect editValue)
        {
            CT_DocProtect ctDocProtect = ctSettings.documentProtection;

            if (ctDocProtect == null)
            {
                return(false);
            }

            return(ctDocProtect.enforcement.Equals(ST_OnOff.Value1) && ctDocProtect.edit.Equals(editValue));
        }
Esempio n. 4
0
        /**
         * Verifies the documentProtection tag inside settings.xml file <br/>
         * if the protection is enforced (w:enforcement="1") <br/>
         *  <p/>
         * <br/>
         * sample snippet from settings.xml
         * <pre>
         *     &lt;w:settings  ... &gt;
         *         &lt;w:documentProtection w:edit=&quot;readOnly&quot; w:enforcement=&quot;1&quot;/&gt;
         * </pre>
         *
         * @return true if documentProtection is enforced with option any
         */
        public bool IsEnforcedWith()
        {
            CT_DocProtect ctDocProtect = ctSettings.documentProtection;

            if (ctDocProtect == null)
            {
                return(false);
            }

            return(ctDocProtect.enforcement.Equals(ST_OnOff.on));
        }
Esempio n. 5
0
        internal bool IsEnforcedWith()
        {
            CT_DocProtect ctDocProtect = ctSettings.documentProtection;

            if (ctDocProtect == null)
            {
                return(false);
            }

            return(ctDocProtect.enforcement.Equals(ST_OnOff.on) &&
                   (ctDocProtect.edit == ST_DocProtect.comments ||
                    ctDocProtect.edit == ST_DocProtect.forms ||
                    ctDocProtect.edit == ST_DocProtect.readOnly ||
                    ctDocProtect.edit == ST_DocProtect.trackedChanges));
        }