GroupDocsGists
10/24/2017 - 1:17 PM

common.cs

 // For complete examples and data files, please go to https://github.com/groupdocs-text/GroupDocs.Text-for-.NET
public class Common
    {
        //ExStart:commonutilities
        public const string sourcePath = "../../../../Data/Storage/";
        public const string licensePath = "../../../../Data/Storage/GroupDocs.Total.lic";
        //ExEnd:commonutilities

        /// <summary>
        /// Apply license
        /// </summary>
        public static void ApplyLicense()
        {
            //ExStart:applylicense
            try
            {
                License lic = new License();
                lic.SetLicense(licensePath);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            //ExEnd:applylicense
        }

        /// <summary>
        /// Get source file path
        /// </summary>
        /// <param name="emailMessage"></param>
        /// <returns></returns>
        public static String getFilePath(string fileName)
        {
            //ExStart:getfilepath
            String fileLocation = sourcePath + fileName;
            return fileLocation;
            //ExEnd:getfilepath
        } 
    }