Exemple #1
0
        public static void Initialize()
        {
            string imageDir = ActiveQLibrary.Global.GetImagePath(Assembly.GetExecutingAssembly().Location);

            if (imageDir.Trim() != "")
            {
                _libraryCommonFile = Path.Combine(Path.GetDirectoryName(imageDir), _libraryCommonFile);
                _libraryMailFile   = Path.Combine(Path.GetDirectoryName(imageDir), _libraryMailFile);
                _librarySmtpFile   = Path.Combine(Path.GetDirectoryName(imageDir), _librarySmtpFile);
            }

            try
            {
                _activeMail   = Assembly.LoadFrom(_libraryMailFile);
                _activeCommon = Assembly.LoadFrom(_libraryCommonFile);
                _activeSmtp   = Assembly.LoadFrom(_librarySmtpFile);

                Activator.CreateInstance(_activeCommon.GetType("ActiveUp.Net.Mail.Message", true));

                _stateActiveMail = StateLibraryActiveMail.ok;
            }

            catch (FileNotFoundException)
            {
                _stateActiveMail = StateLibraryActiveMail.notfound;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error loading ActiveUp.Net.Mail.dll", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
		public static void Initialize()
		{
			string imageDir = ActiveQLibrary.Global.GetImagePath(Assembly.GetExecutingAssembly().Location);

            if (imageDir.Trim() != "")
            {
                _libraryCommonFile = Path.Combine(Path.GetDirectoryName(imageDir), _libraryCommonFile);
                _libraryMailFile = Path.Combine(Path.GetDirectoryName(imageDir), _libraryMailFile);
                _librarySmtpFile = Path.Combine(Path.GetDirectoryName(imageDir), _librarySmtpFile);
            }

			try
			{
				_activeMail = Assembly.LoadFrom(_libraryMailFile);
                _activeCommon = Assembly.LoadFrom(_libraryCommonFile);
                _activeSmtp = Assembly.LoadFrom(_librarySmtpFile);
				
				object message = Activator.CreateInstance(_activeCommon.GetType("ActiveUp.Net.Mail.Message",true));
				message = null;

				_stateActiveMail = StateLibraryActiveMail.ok;

			}

			catch (FileNotFoundException)
			{
				_stateActiveMail = StateLibraryActiveMail.notfound;
			}

			catch (Exception ex)
			{
				/*Type trialExpired = _activeMail.GetType("ActiveUp.Mail.Common.TrialExpiredException",true);
				if (ex.InnerException.GetType() == trialExpired)
				{
					_stateActiveMail = StateLibraryActiveMail.expired;
					_activeMail = null;
				}

				else
				{
					MessageBox.Show(ex.Message,"Error loading ActiveUp.Net.Mail.dll",MessageBoxButtons.OK,MessageBoxIcon.Error);
				}*/
                MessageBox.Show(ex.Message, "Error loading ActiveUp.Net.Mail.dll", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
		}