示例#1
0
        public void Register(IDictionary<string, object> settings)
        {
            var service = new SettingService();

            dynamic preferences = settings["Preferences"];
            dynamic assembly =  settings["Assembly"];
            var args = (string[])settings["Args"];

            bool readOnly;
            try
            {
                readOnly = Convert.ToBoolean(args[2]);
            }
            catch
            {
                readOnly = true;
            }

            var settingData = new SettingData
            {
                ConnectionString = preferences.ConnectionString,
                SavePath = preferences.SavePath,
                OrderId = Convert.ToInt32(args[0]),
                Folder = args[1],
                ReadOnly = readOnly,
                Version =  assembly.Version,
                ProgramName =  assembly.Name
            };

            service.SettingData = settingData;

        }
示例#2
0
 public ISettingData GetSettingData()
 {
     var service = new SettingService();
     return service.SettingData;
 }