示例#1
0
 public List <SignatureFileDescriptionEntity> LoadTextSignatures(string xmlFolder)
 {
     try
     {
         string   xmlPath  = CurrentPath + xmlFolder;
         string[] xmlFiles = Directory.GetFiles(xmlPath);
         // get all files from the directory
         List <SignatureFileDescriptionEntity> fileList = new List <SignatureFileDescriptionEntity>();
         foreach (string xmlFile in xmlFiles)
         {
             SignatureFileDescriptionEntity fileDescription = new SignatureFileDescriptionEntity
             {
                 guid = xmlFile,
                 name = Path.GetFileName(xmlFile)
             };
             // get stream of the xml file
             StreamReader xmlStream = new StreamReader(xmlFile);
             // initiate serializer
             XmlSerializer serializer = new XmlSerializer(typeof(TextXmlEntity));
             // deserialize XML into the object
             TextXmlEntity xmlData = (TextXmlEntity)serializer.Deserialize(xmlStream);
             fileDescription.text      = xmlData.text;
             fileDescription.fontColor = xmlData.fontColor;
             xmlStream.Close();
             xmlStream.Dispose();
             // add object to array list
             fileList.Add(fileDescription);
         }
         return(fileList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="textData">TextXmlEntity</param>
 /// <param name="signatureData">SignatureDataEntity</param>
 public TextSigner(TextXmlEntity textData, SignatureDataEntity signatureData)
     : base(signatureData)
 {
     TextData = textData;
 }