# HG changeset patch # User Steven Hollidge # Date 1333564911 -3600 # Node ID 274fd2386d55863282abccf6765067a80ff91863 # Parent 0d4aff4f699d88d5f6527046ecf7dc51b02be0b2# Parent 382813d76ddeb970679a30c8da62e27453b5d05e Merge with Test diff -r 0d4aff4f699d -r 274fd2386d55 .hgignore --- a/.hgignore Tue Apr 03 23:32:40 2012 +0100 +++ b/.hgignore Wed Apr 04 19:41:51 2012 +0100 @@ -5,4 +5,6 @@ *.csproj.user */obj/* */_ReSharper* -Stocks/packages/* +*.DotSettings.user +*/packages/* +*.stats diff -r 0d4aff4f699d -r 274fd2386d55 Library/.nuget/NuGet.Config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/.nuget/NuGet.Config Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 Library/.nuget/NuGet.exe Binary file Library/.nuget/NuGet.exe has changed diff -r 0d4aff4f699d -r 274fd2386d55 Library/.nuget/NuGet.targets --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/.nuget/NuGet.targets Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,71 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + $(NuGetToolsPath)\nuget.exe + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + + "" + + + false + + + false + + + $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/Core/BookTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/LibrarySystem.Tests/Core/BookTests.cs Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,42 @@ +using System; +using LibrarySystem.Core; +using LibrarySystem.Interfaces; +using NUnit.Framework; + +namespace LibrarySystem.Tests.Core +{ + [TestFixture] + class BookTests + { + [Test] + public void Create_WithNullIdAndNullPublication_ShouldThrowArgumentNullException() + { + Assert.Throws(() => Book.Create(null, null)); + } + + [Test] + public void Create_WithNullIdAndValidPublication_ShouldThrowArgumentNullException() + { + var publisher = Publisher.Create("dummy"); + var publication = Publication.Create("dummy", "dummy", publisher, "dummy"); + Assert.Throws(() => Book.Create(null, publication)); + } + + [Test] + public void Create_WithNullPublication_ShouldThrowArgumentNullException() + { + var validId = "1"; + Assert.Throws(() => Book.Create(validId, null)); + } + + [Test] + public void Create_WithValidParametersPublication_ShouldReturnBook() + { + var publisher = Publisher.Create("dummy"); + var publication = Publication.Create("dummy","dummy", publisher, "dummy"); + var validId = "1"; + IBook book = Book.Create(validId, publication); + Assert.NotNull(book); + } + } +} \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/Core/LibraryTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/LibrarySystem.Tests/Core/LibraryTests.cs Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,374 @@ +using System; +using System.Collections.Generic; +using LibrarySystem.Core; +using LibrarySystem.Interfaces; +using NUnit.Framework; + +namespace LibrarySystem.Tests.Core +{ + [TestFixture] + public class LibraryTests + { + #region Factory methods to setup fixed scenario for testing + + // Factory that creates: + // A library object with 10 books (2 x Lord of the Flies, 3 x 1984, 5 x Brave New World) + private ILibrary CreateLibraryScenario() + { + #region Publisher + + IPublisher penguin = Publisher.Create("Penguin"); + + #endregion + + #region Publications + + IPublication lordOfTheFlies = Publication.Create("William Golding", "0140283331", penguin, "Lord of the Flies"); + + IPublication nineteenEightyFour = Publication.Create("George Orwell", "0452284236", penguin, "Nineteen Eighty-Four"); + + IPublication braveNewWorld = Publication.Create("Aldous Huxley", "0060850523", penguin, "Brave New World"); + + #endregion + + #region Books + + // Lord of the flies + IBook book1 = Book.Create("0000001", lordOfTheFlies); + IBook book2 = Book.Create("0000002", lordOfTheFlies); + IBook book3 = Book.Create("0000003", lordOfTheFlies); + + // 1984 + IBook book4 = Book.Create("0000004", nineteenEightyFour); + IBook book5 = Book.Create("0000005", nineteenEightyFour); + + // Brave new world + IBook book6 = Book.Create("0000006", braveNewWorld); + IBook book7 = Book.Create("0000007", braveNewWorld); + IBook book8 = Book.Create("0000008", braveNewWorld); + IBook book9 = Book.Create("0000009", braveNewWorld); + IBook book10 = Book.Create("0000010", braveNewWorld); + + #endregion + + #region Library + + ILibrary library = Library.Create("Leicester Square"); + library.AddStock(book1, book2, book3, book4, book5, book6, book7, book8, book9, book10); + + #endregion + + return library; + } + + public IBook CreateBook(string bookId = "dummy") + { + IPublisher publisher = Publisher.Create("dummy"); + IPublication publication = Publication.Create("dummy", "dummy", publisher, "dummy"); + IBook book = Book.Create(bookId, publication); + return book; + } + + #endregion + + #region Create + + [Test] + public void Create_WithNullLocation_ThrowsArgumentNullException() + { + Assert.Throws(() => Library.Create(null)); + } + + #endregion + + #region AddStock + + [Test] + public void AddStock_WithNullBook_ShouldThrowArgumentNullException() + { + var library = CreateLibraryScenario(); + Assert.Throws(() => library.AddStock(null)); + } + + [Test] + public void AddStock_WithOneValidBookAndOneNullBook_ShouldThrowArgumentNullException() + { + var library = CreateLibraryScenario(); + var validBook = CreateBook(); + Assert.Throws(() => library.AddStock(validBook, null)); + } + + [Test] + public void AddStock_WithValidBook_ShouldIncreaseStockListCountByOne() + { + //arrange + var library = CreateLibraryScenario(); + var expected = library.StockList.Count + 1; + var dummyBook = CreateBook(); + + //act + library.AddStock(dummyBook); + var actual = library.StockList.Count; + + //assert + Assert.AreEqual(expected, actual); + } + + [Test] + public void AddStock_WithBookIdAlreadyInStock_ShouldThrowException() + { + //arrange + var library = CreateLibraryScenario(); + var idThatIsAlreadyInStock = "0000001"; + var dummyBook = CreateBook(idThatIsAlreadyInStock); + + //act + Assert.Throws( + () => library.AddStock(dummyBook), + string.Format("Book with {0} is already in stock", idThatIsAlreadyInStock)); + } + + [Test] + public void AddStock_WithValidBook_ShouldMakeBookAvailable() + { + //arrange + var library = CreateLibraryScenario(); + var id = "0000001"; + var dummyBook = CreateBook(); + + //act + library.AddStock(dummyBook); + var lookupBook = ((List) library.StockList).Find(s => s.Book.Id == id); + var actual = lookupBook.IsAvailable; + + //assert + Assert.IsTrue(actual); + } + + #endregion + + #region IsBookAvailableByISBN + + [Test] + public void IsBookAvailableByISBN_WithNullISBN_ShouldThrowArgumentNullExpection() + { + var library = CreateLibraryScenario(); + Assert.Throws(() => library.IsBookAvailableByISBN(null)); + } + + [Test] + public void IsBookAvailableByISBN_WithValidISBN_ShouldReturnTrue() + { + var library = CreateLibraryScenario(); + + // Lord of the flies + var validISBN = "0140283331"; + + var actual = library.IsBookAvailableByISBN(validISBN); + + Assert.IsTrue(actual); + } + + [Test] + public void IsBookAvailableByISBN_WithUnknownISBN_ShouldReturnFalse() + { + var library = CreateLibraryScenario(); + + // rubbish data + var unknownISBN = "X"; + + var actual = library.IsBookAvailableByISBN(unknownISBN); + + Assert.IsFalse(actual); + } + + #endregion + + #region FindBooks + + [Test] + public void FindBooks_WhenNullSearchString_ShouldThrowArgumentNullExpection() + { + var library = CreateLibraryScenario(); + Assert.Throws(() => library.FindBooks(null)); + } + + + [Test] + public void FindBooks_WithValidSearchTitleString_ShouldReturnCorrectNumberOfBooks() + { + var library = CreateLibraryScenario(); + + // good search string + var searchString = "Flies"; + + // number of Lord of the Flies books expected + var expected = 3; + var actual = library.FindBooks(searchString).Count; + + Assert.AreEqual(expected, actual); + } + + [Test] + public void FindBooks_WithValidSearchTitleStringLowerCase_ShouldReturnCorrectNumberOfBooks() + { + var library = CreateLibraryScenario(); + + // good search string + var searchString = "flies"; + + // number of Lord of the Flies books expected + var expected = 3; + var actual = library.FindBooks(searchString).Count; + + Assert.AreEqual(expected, actual); + } + + [Test] + public void FindBooks_WithValidSearchStringMultiplePublications_ShouldReturnCorrectNumberOfBooks() + { + var library = CreateLibraryScenario(); + + // good search string + var searchString = "e"; + + // number of Lord of the Flies books expected + var expected = 10; + var actual = library.FindBooks(searchString).Count; + + Assert.AreEqual(expected, actual); + } + + [Test] + public void FindBooks_WithValidSearchAuthorString_ShouldReturnCorrectNumberOfBooks() + { + var library = CreateLibraryScenario(); + + // number of Brave New World books expected + var expected = 5; + var searchString = "ldous"; + + var actual = library.FindBooks(searchString).Count; + + Assert.AreEqual(expected, actual); + } + + [Test] + public void FindBooks_WithInvalidSearchString_ShouldBeEmpty() + { + var library = CreateLibraryScenario(); + + // rubbish data + var searchString = "XYZ"; + + var actual = library.FindBooks(searchString); + + Assert.IsEmpty(actual); + } + + #endregion + + #region GetBookById + + [Test] + public void GetBookById_WhenNullId_ShouldThrowArgumentNullExpection() + { + var library = CreateLibraryScenario(); + Assert.Throws(() => library.GetBookById(null)); + } + + [Test] + public void GetBookById_WhenValidId_ShouldReturnBook() + { + var library = CreateLibraryScenario(); + var validBookId = "0000001"; + var book = library.GetBookById(validBookId); + Assert.IsNotNull(book); + } + + [Test] + public void GetBookById_WhenValidId_ShouldReturnNull() + { + var library = CreateLibraryScenario(); + var invalidBookId = "X"; + var book = library.GetBookById(invalidBookId); + Assert.IsNull(book); + } + + #endregion + + #region LendBook + + [Test] + public void LendBook_ShouldMakeBookInLibraryStockListUnavailable() + { + //arrange + var library = CreateLibraryScenario(); + var person = CreatePerson(); + var bookId = "0000001"; + + // act + library.LendBook(person, bookId); + var lookupBook = ((List) library.StockList).Find(s => s.Book.Id == bookId); + var actual = lookupBook.IsAvailable; + + // assert + Assert.IsFalse(actual); + } + + private IPerson CreatePerson() + { + var person = Person.Create("dummy", "dummy"); + return person; + } + + [Test] + public void LendBook_WithNullPerson_ShouldThrowArgumentNullException() + { + //arrange + var library = CreateLibraryScenario(); + var id = "dummy"; + + // act & assert + Assert.Throws(() => library.LendBook(null, id)); + } + + [Test] + public void LendBook_WithNullBook_ShouldThrowArgumentNullException() + { + //arrange + var library = CreateLibraryScenario(); + var person = CreatePerson(); + + // act & assert + Assert.Throws(() => library.LendBook(person, null)); + } + + [Test] + public void LendBook_WithNullBookAndNullPerson_ShouldThrowArgumentNullException() + { + //arrange + var library = CreateLibraryScenario(); + + // act & assert + Assert.Throws(() => library.LendBook(null, null)); + } + + [Test] + public void LendBook_WithUnknownBook_ShouldThrowArgumentException() + { + //arrange + var library = CreateLibraryScenario(); + var person = CreatePerson(); + var id = "dummy"; + + // act & assert + Assert.Throws( + () => library.LendBook(person, id), + string.Format("Book id {0} is not in stock", id)); + } + + #endregion + + } +} diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/Core/PersonTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/LibrarySystem.Tests/Core/PersonTests.cs Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,35 @@ +using System; +using LibrarySystem.Core; +using NUnit.Framework; + +namespace LibrarySystem.Tests.Core +{ + [TestFixture] + class PersonTests + { + [Test] + public void Create_WithValidParams_ShouldReturnPerson() + { + var person = Person.Create("dummy", "dummy"); + Assert.IsNotNull(person); + } + + [Test] + public void Create_WithNullAddress_ShouldThrowAgrumentNullException() + { + Assert.Throws(() => Person.Create(null, "dummy")); + } + + [Test] + public void Create_WithNullName_ShouldThrowAgrumentNullException() + { + Assert.Throws(() => Person.Create("dummy", null)); + } + + [Test] + public void Create_WithNullAddressAndName_ShouldThrowAgrumentNullException() + { + Assert.Throws(() => Person.Create(null, null)); + } + } +} diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/Core/PublicationTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/LibrarySystem.Tests/Core/PublicationTests.cs Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,45 @@ +using System; +using LibrarySystem.Core; +using NUnit.Framework; + +namespace LibrarySystem.Tests.Core +{ + [TestFixture] + class PublicationTests + { + [Test] + public void Create_WithValidParams_ShouldReturnPublication() + { + var publisher = Publisher.Create("dummy"); + var publication = Publication.Create("dummy","dummy", publisher, "dummy"); + Assert.IsNotNull(publication); + } + + [Test] + public void Create_WithNullAuthor_ShouldThrowAgrumentNullException() + { + var publisher = Publisher.Create("dummy"); + Assert.Throws(() => Publication.Create(null, "dummy", publisher, "dummy")); + } + + [Test] + public void Create_WithNullISBN_ShouldThrowAgrumentNullException() + { + var publisher = Publisher.Create("dummy"); + Assert.Throws(() => Publication.Create("dummy", null, publisher, "dummy")); + } + + [Test] + public void Create_WithNullPublisher_ShouldThrowAgrumentNullException() + { + Assert.Throws(() => Publication.Create("dummy","dummy", null, "dummy")); + } + + [Test] + public void Create_WithNullTitle_ShouldThrowAgrumentNullException() + { + var publisher = Publisher.Create("dummy"); + Assert.Throws(() => Publication.Create("dummy", "dummy", publisher, null)); + } + } +} diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/Core/PublisherTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/LibrarySystem.Tests/Core/PublisherTests.cs Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,23 @@ +using System; +using LibrarySystem.Core; +using NUnit.Framework; + +namespace LibrarySystem.Tests.Core +{ + [TestFixture] + class PublisherTests + { + [Test] + public void Create_WithValidName_ShouldReturnPublisher() + { + var publisher = Publisher.Create("dummy"); + Assert.IsNotNull(publisher); + } + + [Test] + public void Create_WithNullName_ShouldThrowAgrumentNullException() + { + Assert.Throws(() => Publisher.Create(null)); + } + } +} diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/Core/StockTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Library/LibrarySystem.Tests/Core/StockTests.cs Wed Apr 04 19:41:51 2012 +0100 @@ -0,0 +1,26 @@ +using System; +using LibrarySystem.Core; +using NUnit.Framework; + +namespace LibrarySystem.Tests.Core +{ + [TestFixture] + class StockTests + { + [Test] + public void Create_WithValidName_ShouldReturnPublisher() + { + var publisher = Publisher.Create("dummy"); + var publication = Publication.Create("dummy","dummy", publisher, "dummy"); + var book = Book.Create("dummy", publication); + var stock = Stock.Create(book, true); + Assert.IsNotNull(stock); + } + + [Test] + public void Create_WithNullBook_ShouldThrowAgrumentNullException() + { + Assert.Throws(() => Stock.Create(null, true)); + } + } +} diff -r 0d4aff4f699d -r 274fd2386d55 Library/LibrarySystem.Tests/LibrarySystem.Tests.csproj --- a/Library/LibrarySystem.Tests/LibrarySystem.Tests.csproj Tue Apr 03 23:32:40 2012 +0100 +++ b/Library/LibrarySystem.Tests/LibrarySystem.Tests.csproj Wed Apr 04 19:41:51 2012 +0100 @@ -12,6 +12,8 @@ LibrarySystem.Tests v4.0 512 + ..\..\Library\ + true true @@ -38,8 +40,13 @@ - + + + + + + @@ -51,6 +58,7 @@ + - \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/Properties/AssemblyInfo.cs --- a/PdfViewAndPrint/PdfViewAndPrint/Properties/AssemblyInfo.cs Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PdfViewAndPrint")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PdfViewAndPrint")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/Properties/Resources.Designer.cs --- a/PdfViewAndPrint/PdfViewAndPrint/Properties/Resources.Designer.cs Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.17379 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PdfViewAndPrint.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PdfViewAndPrint.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/Properties/Resources.resx --- a/PdfViewAndPrint/PdfViewAndPrint/Properties/Resources.resx Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/Properties/Settings.Designer.cs --- a/PdfViewAndPrint/PdfViewAndPrint/Properties/Settings.Designer.cs Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.17379 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PdfViewAndPrint.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/Properties/Settings.settings --- a/PdfViewAndPrint/PdfViewAndPrint/Properties/Settings.settings Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/WinFormsUserControl.Designer.cs --- a/PdfViewAndPrint/PdfViewAndPrint/WinFormsUserControl.Designer.cs Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -namespace PdfViewAndPrint -{ - partial class WinFormsUserControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinFormsUserControl)); - this.axAcroPDF1 = new AxAcroPDFLib.AxAcroPDF(); - ((System.ComponentModel.ISupportInitialize)(this.axAcroPDF1)).BeginInit(); - this.SuspendLayout(); - // - // axAcroPDF1 - // - this.axAcroPDF1.Dock = System.Windows.Forms.DockStyle.Fill; - this.axAcroPDF1.Enabled = true; - this.axAcroPDF1.Location = new System.Drawing.Point(0, 0); - this.axAcroPDF1.Name = "axAcroPDF1"; - this.axAcroPDF1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axAcroPDF1.OcxState"))); - this.axAcroPDF1.Size = new System.Drawing.Size(150, 150); - this.axAcroPDF1.TabIndex = 0; - // - // WinFormsUserControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.axAcroPDF1); - this.Name = "WinFormsUserControl"; - this.Load += new System.EventHandler(this.WinFormsUserControl_Load); - ((System.ComponentModel.ISupportInitialize)(this.axAcroPDF1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private AxAcroPDFLib.AxAcroPDF axAcroPDF1; - } -} diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/WinFormsUserControl.cs --- a/PdfViewAndPrint/PdfViewAndPrint/WinFormsUserControl.cs Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PdfViewAndPrint -{ - public partial class WinFormsUserControl : UserControl - { - public WinFormsUserControl() - { - InitializeComponent(); - } - - private void WinFormsUserControl_Load(object sender, EventArgs e) - { - - } - - public void LoadPdf(string pdfFilePath) - { - try - { - this.axAcroPDF1.LoadFile(pdfFilePath); - } - catch (Exception e) - { - OnNotify(e.Message); - } - } - - - #region Event code to pass messages back to WPF - - public delegate void NotifyEventHandler(object sender, NotifyEventArgs e); - public event NotifyEventHandler Notification; - protected void OnNotify(string message) - { - if (Notification != null) - Notification(this, new NotifyEventArgs() {Message = message}); - } - - #endregion - - } - - public class NotifyEventArgs : EventArgs - { - public string Message { get; set; } - } -} diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/PdfViewAndPrint/WinFormsUserControl.resx --- a/PdfViewAndPrint/PdfViewAndPrint/WinFormsUserControl.resx Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAIQAAAAIB - AAAAAQAAAAAAAAAAAAAAAAwAAAAACQAA2BMAANgTAAAL - - - \ No newline at end of file diff -r 0d4aff4f699d -r 274fd2386d55 PdfViewAndPrint/clean.bat --- a/PdfViewAndPrint/clean.bat Tue Apr 03 23:32:40 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -del /s /ah /f *.suo -del /s /f *.user -del /s /f *.cache -del /s /f *.keep -del /s /ah StyleCop.Cache - -rd /s /q bin obj ClientBin _Resharper.* _Upgrade* TestResults - -del dirs.txt -dir /s /b /ad bin > dirs.txt -dir /s /b /ad obj >> dirs.txt -dir /s /b /ad ClientBin >> dirs.txt -dir /s /b /ad _Resharper.* >> dirs.txt -dir /s /b /ad _Upgrade* >> dirs.txt -dir /s /b /ad TestResults >> dirs.txt - -for /f "delims=;" %%i in (dirs.txt) DO rd /s /q "%%i" -del dirs.txt