namespace PerpetuumSoft.Widgets.Licensing
{
    using System;
    using System.IO;

    internal class WidgetsLicenseHolder : LicenseHolder
    {
        private string GetLicenseText()
        {
            string str = string.Empty;
            try
            {
                using (Stream stream = base.GetType().Assembly.GetManifestResourceStream("PerpetuumSoft.Widgets.Licensing.License.rtf"))
                {
                    using (StreamReader reader = new StreamReader(stream))
                    {
                        return reader.ReadToEnd();
                    }
                }
            }
            catch
            {
                str = @"{\rtf License text not found}";
            }
            return str;
        }

        public override string LicenseAgreement
        {
            get
            {
                return this.GetLicenseText();
            }
        }
    }
}
