+ All Categories
Home > Education > Aplikační nastavení v .NET

Aplikační nastavení v .NET

Date post: 22-Jan-2018
Category:
Upload: jan-hridel
View: 100 times
Download: 1 times
Share this document with a friend
26
č č
Transcript

čč

č

č žš č ž žň

ř ř ě řž ř

ě č ůč ě ě

č č ě č č

ž ž ž č ě

č ř

ě ž žApplication.LocalUserAppDataPath

ž č

ž č

čapp.exe.config č user.config

ř ž ř ž ž ě

č ř <configuration> ř

<configSections> č <applicationSettings> <userSettings> ž

ž ž

ř

ř SettingsBase - ň č ž - č System.Configuration

ř ž řApplicationSettingsBase ř SettingsBase

č ž šš ě ž ž ř ř ř ě ž

ř ApplicationSettingsBase ř

override object Item[string propertyName] { get; set; } ř ř ApplicationSettingsBase

ř

č

ř ě ž ř řč č

System.Configuration.ConfigurationErrorsException

ř ůž DefaultSettingValuestring

ž ř č č

ř čDefaultSettingValue null č

ř řApplicationSettingsBase ž ř

č č č č

ř ž žSave:

override void Save()

č čň

ů ř čSettingsSerializeAs ř

ž ůstring ž

ř

ř ř ž č ž

č ž ě ř řř ě MainFormCfg SizeCfg ř

FormSizeCfg ň řř

Location Point čž ž new Point(100,

100). DefaultSettingValueě null ř Point

NullReferenceException ř MainFormCfgIsLocationNull true

Location null

https://goo.gl/VqeqCy

ř ApplicationSettingsBase čč ř

ř SettingsProvider řApplicationSettingsBaseSettingsProvider ž ž řLocalFileSettingsProvider

PropertyChanged ě ě

ě ě SettingChanging ř ě

ě ě SettingsLoaded č č SettingsSaving ř ž č

Reload č č Reset Upgrade č č ř

č ř ž

ř

ž ň IBindableComponent

ě ěů ů

žř ě ě

INotifyPropertyChangedPropertyChanged ž ž

ě ě

ň č ě

IBindableComponent DataBindingsů ControlBindingsCollection

ř Add řControlBindingsCollection

Binding Add(string propertyName, object dataSource, string dataMember, bool formattingEnabled, DataSourceUpdateMode updateMode)

ř propertyNamedataMember ř dataSource ř

Binding řformattingEnabled dataMember

true řFormat ř Binding ř č

Parse ř updateMode ů

ž žě WriteValue ř Binding

ř ControlBindingsCollectionř Binding int

ř ř ř ř ž Location

ř MainFormCfgOnSettingsLoaded ž čSizeCfg č ř ě MainForm SettingsLoaded

č SizeCfg čUpgrade č ř

Upgrade SettingsLoadedř šť Upgrade

ě ž volanoUpgrade

https://goo.gl/bkFrAF

ď ř ěř ž

ůApplication User

Userž č č

č ř SettingsProperties ř

ř řDefault ř Settings

ř Settings

ž řServerJmeno string ž ěserverJmeno řstring serverJmeno = Properties.Settings.Default.ServerJmeno;

ř Settings ř ApplicationSettingsBase

ě ř Settings Properties ř šž ř Settings

čř

ř ěžř č ž

čě ě

žě


Recommended