예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseApplication"/> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <exception cref="System.InvalidOperationException">You can only have one instance of Application at any given time.</exception>
        protected BaseApplication(BaseApplicationSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            lock (OneApplicationCheckLock)
            {
                if (Current != null)
                {
                    throw new InvalidOperationException("You can only have one instance of Application at any given time.");
                }

                Current = this;
            }

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            LogsDirectoryPath = PathUtility.WorkingDirectory + "/" + LogsDirectory;
            EnsureLogsDirectory();

            InitializeLog4Net();

            CacheDirectoryPath = PathUtility.WorkingDirectory + "/" + CacheDirectory;
            EnsureCacheDirectory();

            ThreadId = Thread.CurrentThread.ManagedThreadId;

            SyncProperties = SyncPropertyAttribute.GetProperties <BaseApplication>();
        }
예제 #2
0
 public ProcessHandler()
     : base()
 {
     SyncProperties = SyncPropertyAttribute.GetProperties <Application>();
 }