Beispiel #1
0
        /// <summary>
        /// Writes the elements to the destination.
        /// </summary>
        /// <param name="elements">
        /// The elements.
        /// </param>
        /// <param name="clientFolderName">
        /// The name of the file to write to.
        /// </param>
        /// <param name="skipIfExisting">
        /// The flag whether to skip the item if it exist - in this case it's simply ignored, because the target will be overwritten.
        /// </param>
        protected override void WriteFullList(List <StdElement> elements, string clientFolderName, bool skipIfExisting)
        {
            if (File.Exists(clientFolderName))
            {
                File.Delete(clientFolderName);
            }

            File.WriteAllText(clientFolderName, ExcelXml.ExportToWorksheetXml(elements.ToStdContacts()), Encoding.UTF8);
        }
Beispiel #2
0
 /// <summary>
 /// Reads all elements from the excel file
 /// </summary>
 /// <param name="clientFolderName">
 /// The path to the excel file.
 /// </param>
 /// <returns>
 /// the list of contacts
 /// </returns>
 public override List <StdElement> GetAll(string clientFolderName)
 {
     return(ExcelXml.ImportFromWorksheetXml <StdContact>(File.ReadAllText(clientFolderName)).ToStdElements());
 }