예제 #1
0
        private bool OpenConfigurationFile <T>(AppData <T> appData, ListView listViewToPopulate, string fullPath) where T : INamed, new()
        {
            var fileOpened = true;

            try
            {
                appData.Load(fullPath);
                PopulateListView(appData.Instances, listViewToPopulate);
                UpdateListOfLastOpenedFiles();
                UpdateConfigFileListHeader(appData);
            }
            catch (FileNotFoundException ex)
            {
                Trace.WriteLine(ex);
                CommonDialogs.TellUserFileCouldNotBeOpened(fullPath);
                fileOpened = false;
            }

            return(fileOpened);
        }