My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 29, 2008 by simpledotnet
Labels: Phase-Implementation
UserSetting  
Save user settings in a SAE plugin

Save user settings in a SAE plugin

Steps:

1. Register properties which need to be saved in plugin's constructor

Sample:

        public const string PropertyOutputDir = "ILMergeOutputDir";
        public const string PropertyStrongKeyFile = "ILMergeStrongKeyFile";

        public Plugin(IHost host)
        {
            host.AddProperty(PropertyOutputDir, String.Empty, typeof(String));
            host.AddProperty(PropertyStrongKeyFile, String.Empty, typeof(String));
        }

2. Use properties

Sample:

        private IHost _host;

        public string OutputDir
        {
            get { return _host.GetPropertyValue(Plugin.PropertyOutputDir) as string; }
            set { _host.SetPropertyValue(Plugin.PropertyOutputDir, value); }
        }

        public string StrongKeyFile
        {
            get { return _host.GetPropertyValue(Plugin.PropertyStrongKeyFile) as string; }
            set { _host.SetPropertyValue(Plugin.PropertyStrongKeyFile, value); }
        }

Sign in to add a comment
Hosted by Google Code