static void RunProgram(string[] commandLine) { StartupMessageWindow messager = new StartupMessageWindow(); IServiceFactory <LexiconRaw> fact = new LexiconServiceFactory <LexiconRaw>(); var lexService = fact.CreatService(); try { forms = new List <IView>(); forms.Add(CreateForm(typeof(WordListGrid), lexService)); forms.Add(CreateForm(typeof(LexiconEntryScreen), lexService)); Application.Run(forms[STARTING_FORM] as Form); } catch (Exception ex) { log.Error($"Exception: {ex.Message}"); if (lexService != null) { lexService.Dispose(); lexService = null; } messager.Message(ERR_GENERAL_CAPTION, ERR_GENERAL, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); messager.Dispose(); } }
static IList <T> Test_2 <T>() where T : class, new() { LexiconServiceFactory <T> factory = new LexiconServiceFactory <T>(); IService <T> service = factory.CreatService(); var dataset = service.FindAll() as IList <T>;//.Distinct().ToList() as IList<T>; return(dataset); }