Пример #1
0
 private CT_DocProtect SafeGetDocumentProtection()
 {
     CT_DocProtect documentProtection = ctSettings.documentProtection;
     if (documentProtection == null)
     {
         documentProtection = new CT_DocProtect();
         ctSettings.documentProtection = (documentProtection);
     }
     return ctSettings.documentProtection;
 }
Пример #2
0
 public static CT_DocProtect Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_DocProtect ctObj = new CT_DocProtect();
     if (node.Attributes["w:edit"] != null)
         ctObj.edit = (ST_DocProtect)Enum.Parse(typeof(ST_DocProtect), node.Attributes["w:edit"].Value);
     if (node.Attributes["w:formatting"] != null)
         ctObj.formatting = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:formatting"].Value);
     if (node.Attributes["w:enforcement"] != null)
         ctObj.enforcement = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:enforcement"].Value);
     if (node.Attributes["w:cryptProviderType"] != null)
         ctObj.cryptProviderType = (ST_CryptProv)Enum.Parse(typeof(ST_CryptProv), node.Attributes["w:cryptProviderType"].Value);
     if (node.Attributes["w:cryptAlgorithmClass"] != null)
         ctObj.cryptAlgorithmClass = (ST_AlgClass)Enum.Parse(typeof(ST_AlgClass), node.Attributes["w:cryptAlgorithmClass"].Value);
     if (node.Attributes["w:cryptAlgorithmType"] != null)
         ctObj.cryptAlgorithmType = (ST_AlgType)Enum.Parse(typeof(ST_AlgType), node.Attributes["w:cryptAlgorithmType"].Value);
     ctObj.cryptAlgorithmSid = XmlHelper.ReadString(node.Attributes["w:cryptAlgorithmSid"]);
     ctObj.cryptSpinCount = XmlHelper.ReadString(node.Attributes["w:cryptSpinCount"]);
     ctObj.cryptProvider = XmlHelper.ReadString(node.Attributes["w:cryptProvider"]);
     ctObj.algIdExt = XmlHelper.ReadBytes(node.Attributes["w:algIdExt"]);
     ctObj.algIdExtSource = XmlHelper.ReadString(node.Attributes["w:algIdExtSource"]);
     ctObj.cryptProviderTypeExt = XmlHelper.ReadBytes(node.Attributes["w:cryptProviderTypeExt"]);
     ctObj.cryptProviderTypeExtSource = XmlHelper.ReadString(node.Attributes["w:cryptProviderTypeExtSource"]);
     ctObj.hash = XmlHelper.ReadBytes(node.Attributes["w:hash"]);
     ctObj.salt = XmlHelper.ReadBytes(node.Attributes["w:salt"]);
     return ctObj;
 }