Пример #1
0
        private void CreateKey(IMethodInvocation input, PropertyInfo p)
        {
            var    value   = p.GetValue(input.Target) ?? "";
            string section = bindStrategy.GetSection(input, p);
            string key     = bindStrategy.GetKey(input, p);

            config.WriteIniData(section, key, value.ToString());
        }
Пример #2
0
        private void CreateIniFile(IMethodInvocation input)
        {
            var property = BindStrategy.GetCalledProperty(input);
            var fullName = bindStrategy.GetFilePath(input, property);
            var stream   = File.CreateText(fullName);

            stream.Close();

            config = new IniFileOperator(fullName);

            shouldProcess = false;
            foreach (var p in bindStrategy.GetIniProperties(input))
            {
                var value    = p.GetValue(input.Target);
                var valueStr = value != null?value.ToString() : "";

                string section = bindStrategy.GetSection(input, p);
                string key     = bindStrategy.GetKey(input, p);
                config.WriteIniData(section, key, valueStr);
            }
            shouldProcess = true;
        }