⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class1.cs

📁 应用框架的设计与实现的源代码(SAF) 《应用框架的设计与实现》随书源码
💻 CS
字号:
using System;
using System.Configuration;
using Application.Configuration;
using SAF.Configuration;

namespace TestConsole
{
	/// <summary>
	/// The demo shows how to use SAF.Configuration service inside a program and
	/// how to use the custom configuration object defined for the business application
	/// </summary>
	class Class1
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			//get the configuraiton manager of Application.Configuration 
			AppConfigurationManager cm1 = (AppConfigurationManager)ConfigurationSettings.GetConfig("MyApplication");
			//retrieve the configuraiton data by calling the properties and methods of configuration manager.
			string connection = cm1.DatabaseConfig.GetDatabaseConnection();
			//these two calls involve the agents which retrieve the configuraiton data via web service
			//at http://localhost/ConfigurationData/ConfigurationService.asmx
			string customerQueueLocation = cm1.MessageQueueConfig.GetCustomerQueueLocation();
			string accountQueueLocation = cm1.MessageQueueConfig.GetAccountQueueLocation();
			
			//get the configuration manager of SAF.Configuration
			ConfigurationManager  cm2 = (ConfigurationManager)ConfigurationSettings.GetConfig("Framework");
			string eventServerUrl = cm2.EventNotificationConfig.GetEventServerUrl();

		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -