static void InitApplication() { Repository repository = new Repository(new MSSQLRepositoryFactory()); if (repository.BookRepository.GetItems().Count() == 0) { InitData(repository); } library = new LibraryClass(repository); userSession = new ConsoleUserSession(library); }
static void Main(string[] args) { SetupListeners(); // Testing //------------------------------------------------------------------------- // This still shows up in the output window in VS... Trace.WriteLine("This is a trace from the application, we want to see this."); // ...but the library function that calls trace no longer shows up. LibraryClass.MethodThatCallsTrace(); // Now check the output window, the trace calls from that library will not be present. }
public LibraryClassTest() { repository = new Repository(new ObjectRepositoryFactory()); reader = new Reader("Иван Иванов", "Брест"); repository.ReaderRepository.Save(reader); department = new LibraryDepartment("Абонемент", true); repository.LibraryDepartmentRepository.Save(department); librarian = new Librarian("Мария Иванова", department); repository.LibrarianRepository.Save(librarian); book = new Book("Михаил Фленов", "Библия C#", 2002, department); repository.BookRepository.Save(book); library = new LibraryClass(repository); }
public List <ListBook> LoadBooks(LibraryClass library) { List <ListBook> result = new List <ListBook>(); foreach (Book book in library.GetBooks()) { result.Add(new ListBook() { ID = book.GetId(), Title = book.GetTitle(), Author = book.GetAuthor() }); } return(result); }
public List <ListClient> LoadClients(LibraryClass library) { List <ListClient> res = new List <ListClient>(); foreach (Client client in library.GetClients()) { res.Add(new ListClient() { ID = client.GetId(), FirstName = client.GetFirstName(), LastName = client.GetLastName(), Books = string.Join(",", client.GetAllBooks().Select(x => x.GetTitle())) }); } return(res); }
public LibraryClassTest() { repository = new Repository(new MSSQLRepositoryFactory()); reader = new Reader("First Reader", "Brest"); repository.ReaderRepository.Save(reader); department = new LibraryDepartment("Abonement", true); repository.LibraryDepartmentRepository.Save(department); librarian = new Librarian("First Librarian ", department); repository.LibrarianRepository.Save(librarian); book = new Book("First Author", "Title", 2002, department); repository.BookRepository.Save(book); book2 = new Book("Second Author", "Title", 2000, department); repository.BookRepository.Save(book2); library = new LibraryClass(repository); }
public List <ListEvent> LoadEvents(LibraryClass library) { List <ListEvent> res = new List <ListEvent>(); foreach (Event e in library.GetEvents()) { res.Add(new ListEvent() { Type = e.Type, CreatedAt = e.CreatedAt, ClientFirstName = e.Client.GetFirstName(), ClientLastName = e.Client.GetLastName(), Title = e.Book == null ? "n/a" : e.Book.GetTitle(), Author = e.Book == null ? "n/a" : e.Book.GetAuthor() }); } return(res); }
public MainWindow() { SimpleBookDao bookDao = new SimpleBookDao(); bookDao.AddBook(new Book("Book 1", "Author 1", 0)); bookDao.AddBook(new Book("Book 2", "Author 2", 1)); bookDao.AddBook(new Book("Book 3", "Author 3", 2)); bookDao.AddBook(new Book("Book 4", "Author 4", 3)); bookDao.AddBook(new Book("Book 5", "Author 5", 4)); library = new LibraryClass(bookDao); library.AddClient("Cli", "Ent"); library.AddClient("Tne", "Ilc"); library.BorrowBook(1, 1); //todo debug - KILL ME PLEASE InitializeComponent(); BooksLw.ItemsSource = LoadBooks(library); ClientsLw.ItemsSource = LoadClients(library); EventsLw.ItemsSource = LoadEvents(library); }
public static void MenuSetUpFixture() { // display warning messages Console.WriteLine("\nThis test MUST be run as an administrator."); Console.WriteLine("Otherwise the WinLdtpService will not work."); Console.WriteLine("And an \"Unable to connect...\" exception will be thrown."); Console.WriteLine("Do NOT use the mouse while this test is running.\n"); // create ldtp // failure does not throw a catchable object // it will fail at ldtp.LaunchApp() in LaunchAStyleWxLdtp() Console.WriteLine("Creating ldtp object"); ldtp = new Ldtp.Ldtp("*AStyleWx"); // compile astylewx Console.WriteLine("Compiling astylewx"); LibraryClass.CompileWindowsAStyleWxExe("DLL Debug"); }
public void ShowMessage(string text) { try { LibraryClass cls = new LibraryClass(); //cls.ShowMessage(text); //cls.OpenView(AndroidGlobal.glCtx, text); //cls.OpenView(text); //ShowView view = new ShowView(); //view.Show var x = AndroidGlobal.glCtx; var t = cls.ReturnMessage(text); //cls.OpenGallery(x); //cls.OpenView(x, "Testing"); //cls.OpenView(x); } catch (Exception ex) { } }
public static void Main(string[] args) { var x = new LibraryClass(); x.LibraryMethod(); var config = new ConfigurationBuilder() .AddCommandLine(args) .AddEnvironmentVariables(prefix: "ASPNETCORE_") .Build(); var host = new WebHostBuilder() .UseConfiguration(config) .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup <Startup>() .Build(); host.Run(); }
public void LoadLibraries(string directory) { return; //Loop through each file in the given directory foreach (FileInfo fi in new DirectoryInfo(directory).GetFiles()) { //Initialize our reflection assembly Assembly asm; //Attempt to load the file. try { asm = Assembly.LoadFile(fi.FullName); } catch { continue; } //Get our types in our assembly foreach (Type t in asm.GetTypes()) { //If theres the type of AlterationLibrary... if (t.BaseType == typeof(AlterationLibrary)) { //Initialize our LibraryClass LibraryClass Library_Class = new LibraryClass(); //Set our library instance Library_Class.Library = (AlterationLibrary)Activator.CreateInstance(t); //Set our FileName instance Library_Class.FileName = fi.FullName; //Add it to the list Libraries.Add(Library_Class); } } } //Loop through the directories foreach (DirectoryInfo di in new DirectoryInfo(directory).GetDirectories()) { //Load any libraries recursively LoadLibraries(di.FullName); } }
static void Main(string[] args) { #region databank vullen //databank vullen met de csv. // DatabankInitialiseer db = new DatabankInitialiseer(); // db.InitialiseerDatabank(); #endregion //Spelers gemaakt van de gegeven .csv bestand, heeft id's 9 tot 16 (8 spelers dus) //Bestaande stamnummers : 3, 7, 35 LibraryClass voetbalLib = new LibraryClass(); //nu zijn er 9 spelers #region spelerToevoegen test // Speler spelerNieuw = new Speler("Luc Vervoort", 99, 4000000, 7); // voetbalLib.VoegSpelerToe(spelerNieuw); // Speler spelerNieuwGeselecteerd = voetbalLib.SelecteerSpeler(17); #endregion #region teamToevoegen Test //Team nieuweTeam = new Team(16, "LeerkrachtenClub", "Tom VDW"); // voetbalLib.VoegTeamToe(nieuweTeam); #endregion #region TransferToevoegen // Transfer trans = new Transfer(17, 50000000, 16); // voetbalLib.VoegTransferToe(trans); Transfer ToonTransfer = voetbalLib.SelecteerTransfer(1); #endregion Console.ReadLine(); }
public static void Main(string[] args) { LibraryClass test = new LibraryClass(); }
public static void LibraryClassTest1() { Assert.AreEqual(LibraryClass.Sum(0, 1), 1); Assert.AreEqual(LibraryClass.Sum(0, 2), 2); }
/// <summary> /// Uses a DLL. /// </summary> public static void Main(string[] args) { Console.WriteLine(LibraryClass.square(15)); Console.ReadLine(); }
public void MenuTearDown() { LibraryClass.CloseAStyleWxLdtp(ldtp); }
public ConsoleUserSession(LibraryClass library) { this.library = library; }
public void ComplexOperation() { LibraryClass l = new LibraryClass(); l.PerformSimpleOperation(); }
public void MenuSetUp() { ldtp = LibraryClass.GetLdtpObject(); LibraryClass.LaunchAStyleWxLdtp(); }
public static void LibraryClassTest1() { Assert.AreEqual(LibraryClass.Sum(0, 3), 3); Assert.AreEqual(LibraryClass.Sum(0, 4), 4); }
static void Main(string[] args) { var lib = new LibraryClass(); System.Console.WriteLine(lib.Hello()); }