/// <summary>
        /// Constructor
        /// </summary>
        public COBieLiteGeneratorDlg()
        {
            InitializeComponent();
            //set default role filters held in FillRolesFilterHolder property list
            DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
            ConfigFile = new FileInfo(Path.Combine(dir.FullName, "COBieAttributesCustom.config"));
            if (!ConfigFile.Exists)
            {
                AppendLog("Creating Config File");
                CreateDefaultAppConfig(ConfigFile);
                ConfigFile.Refresh();
            }
            if (_assetfilters.DefaultsNotSet)
            {
                _assetfilters.FillRolesFilterHolderFromDir(dir);
            }

            PropertyMaps = new COBiePropertyMapping(ConfigFile);
            MapRefModelsRoles = new Dictionary<FileInfo, RoleFilter>();
        }
Esempio n. 2
0
 public PropertyMapDlg(COBiePropertyMapping maps)
 {
     InitializeComponent();
     PropertyMaps = maps;
     SetMappings();
 }
Esempio n. 3
0
        /// <summary>
        /// Reset to defaults
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDefaults_Click(object sender, EventArgs e)
        {
            var filename = PropertyMaps.ConfigFile; //save config file name before we set temp file name
            FileInfo tempConfig = new FileInfo(Path.GetTempPath() + Guid.NewGuid().ToString() + ".tmp");
            ((COBieLiteGeneratorDlg)this.Owner).CreateDefaultAppConfig(tempConfig);

            if (tempConfig.Exists)
            {
                PropertyMaps = new COBiePropertyMapping(tempConfig);
                PropertyMaps.ConfigFile = filename; //set back to correct file
                foreach (TabPage item in tabControl.TabPages)
                {
                    var propMapTabCtr = item.Controls[0];
                    if (propMapTabCtr is PropertyMapTab)
                    {
                        ((PropertyMapTab)propMapTabCtr).ReSet(GetPaths(item.Name));
                    }
                }
                tempConfig.Delete();
            }
            
        }
 /// <summary>
 /// Show the Property Fields Map Dialog
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPropMaps_Click(object sender, EventArgs e)
 {
     PropertyMapDlg PropMapDlg = new PropertyMapDlg(PropertyMaps);
     var result = PropMapDlg.ShowDialog(this);
     if (result == DialogResult.OK)
     {
         PropertyMaps = PropMapDlg.PropertyMaps;
         PropertyMaps.Save();
     }
 }