Ejemplo n.º 1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="application"></param>
        /// <param name="applicationConfig"></param>
        private ApplicationContextImpl(Application application, IBuildAssemblyParameter applicationConfig)
        {
            this._Stopwatch = new Stopwatch();
            this._Stopwatch.Start();

            _ApplicationDirectoryPath = "";
            _Application = application;

            IBuildAssemblyParameter buildParam;

            if (applicationConfig != null)
            {
                buildParam = applicationConfig;
            }
            else
            {
                buildParam = new BuildAssemblyParameter();
            }

            string personalDirectoryPath = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);

            _ApplicationDirectoryPath = personalDirectoryPath + buildParam.Params["ApplicationDirectoryPath"];

            AppDomain.CurrentDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPrincipal);

            this.ApplicationFileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);

            CreateSettingSQLite();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// アプリケーションコンテキストクラスを新規作成します。
 /// このメソッドはアプリケーション内で1度だけ呼び出してください。
 /// </summary>
 /// <param name="application">WPFフレームワークのアプリケーションクラス</param>
 /// <returns></returns>
 public static IApplicationContext CreateInstance(Application application, IBuildAssemblyParameter applicationConfig = null)
 {
     if (ApplicationContextImpl.instance != null)
     {
         throw new ApplicationException("アプリケーションコンテキストはすでにインスタンス化しています");
     }
     ApplicationContextImpl.instance = new ApplicationContextImpl(application, applicationConfig);
     return(ApplicationContextImpl.instance);
 }
Ejemplo n.º 3
0
        public ApplicationContextImpl(IBuildAssemblyParameter parameter)
        {
            _ApplicationDirectoryPath = "";

            _AssemblyParameter = parameter;

            string personalDirectoryPath = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);

            if (parameter.Params.ContainsKey("TestMode") && parameter.Params["TestMode"] == "true")
            {
                personalDirectoryPath = Path.GetTempPath();
            }

            _ApplicationDirectoryPath = Path.Combine(personalDirectoryPath, _AssemblyParameter.Params["ApplicationDirectoryPath"]);

            this.ApplicationFileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
            Console.WriteLine("_ApplicationDirectoryPath = " + _ApplicationDirectoryPath);
        }
Ejemplo n.º 4
0
        public ApplicationContextImpl(IBuildAssemblyParameter parameter)
        {
            _ApplicationDirectoryPath = "";

            _AssemblyParameter = parameter;

            if (parameter.Params["AbsoluteApplicationDirectoryBase"] == "true")
            {
                _ApplicationDirectoryPath = _AssemblyParameter.Params["ApplicationDirectoryPath"];
            }
            else
            {
                _ApplicationDirectoryPath = Path.Combine(
                    System.Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
                    _AssemblyParameter.Params["ApplicationDirectoryPath"]);
            }

            this.ApplicationFileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
            _logger.Info("_ApplicationDirectoryPath = " + _ApplicationDirectoryPath);
        }