Exemplo 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));
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
0
 /**
  * Enforces the protection with the option specified by passed editValue.<br/>
  * <br/>
  * In the documentProtection tag inside Settings.xml file <br/>
  * it Sets the value of enforcement to "1" (w:enforcement="1") <br/>
  * and the value of edit to the passed editValue (w:edit="[passed editValue]")<br/>
  * <br/>
  * sample snippet from Settings.xml
  * <pre>
  *     &lt;w:settings  ... &gt;
  *         &lt;w:documentProtection w:edit=&quot;[passed editValue]&quot; w:enforcement=&quot;1&quot;/&gt;
  * </pre>
  */
 public void SetEnforcementEditValue(ST_DocProtect editValue)
 {
     safeGetDocumentProtection().enforcement = (ST_OnOff.Value1);
     safeGetDocumentProtection().edit        = (editValue);
 }
Exemplo n.º 4
0
 /**
  * Enforces the protection with the option specified by passed editValue.<br/>
  * <br/>
  * In the documentProtection tag inside Settings.xml file <br/>
  * it Sets the value of enforcement to "1" (w:enforcement="1") <br/>
  * and the value of edit to the passed editValue (w:edit="[passed editValue]")<br/>
  * <br/>
  * sample snippet from Settings.xml
  * <pre>
  *     &lt;w:settings  ... &gt;
  *         &lt;w:documentProtection w:edit=&quot;[passed editValue]&quot; w:enforcement=&quot;1&quot;/&gt;
  * </pre>
  */
 public void SetEnforcementEditValue(ST_DocProtect editValue)
 {
     SafeGetDocumentProtection().enforcement = (ST_OnOff.on);
     SafeGetDocumentProtection().edit = (editValue);
 }
Exemplo n.º 5
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.on) && ctDocProtect.edit.Equals(editValue);
        }
Exemplo n.º 6
0
 public void SetEnforcementEditValue(ST_DocProtect editValue)
 {
     this.SafeGetDocumentProtection().enforcement = ST_OnOff.Value1;
     this.SafeGetDocumentProtection().edit        = editValue;
 }