Example #1
0
 private void butnOk_Click(object sender, EventArgs e)
 {
     renewTypeDict.Add("MOMENT", tbMoment.Text.ToUpper());
     renewTypeDict.Add("CANTILEVER", tbCantilever.Text.ToUpper());
     XmlProcessor.xmlWriter(PublicBlocks.settingFileName, renewTypeDict);
     this.DialogResult = DialogResult.OK;
 }
Example #2
0
        public FormUserSetting(Dictionary <int, string> connTypeDict)
        {
            InitializeComponent();

            Dictionary <string, string> xmlDict = new Dictionary <string, string>();

            try
            {
                XmlProcessor.xmlReader(PublicBlocks.settingFileName, out xmlDict);
                if (xmlDict.Count() != 0)
                {
                    tbMoment.Text     = xmlDict.Where(a => a.Key.Contains("MOMENT")).Select(a => a.Value).FirstOrDefault();
                    tbCantilever.Text = xmlDict.Where(a => a.Key.Contains("CANTILEVER")).Select(a => a.Value).FirstOrDefault();
                }
            }
            catch
            {
                Dictionary <string, string> backUpTypeDict = new Dictionary <string, string>();
                backUpTypeDict.Add("MOMENT", "MOMENT CONNECTION");
                backUpTypeDict.Add("CANTILEVER", "CANTILEVER CONNECTION");
                XmlProcessor.xmlWriter(PublicBlocks.settingFileName, backUpTypeDict);
            }

            //this will past to connection type selection list.
            foreach (var v in connTypeDict)
            {
                revitConnTypeList.Add(v.Value);
            }
        }