diff --git a/releases/1.1/Data/Book.cs b/releases/1.1/Data/Book.cs
deleted file mode 100644
index 3fe6b92..0000000
--- a/releases/1.1/Data/Book.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module defines the Book class
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Collections.Generic;
-using System.Drawing;
-
-namespace TinyOPDS.Data
-{
- ///
- /// Supported book types
- ///
- public enum BookType
- {
- FB2,
- EPUB,
- }
-
- ///
- /// Base data class
- ///
- public class Book
- {
- public Book(string fileName = "")
- {
- Version = 1;
- FileName = fileName;
- if (!string.IsNullOrEmpty(FileName) && FileName.IndexOf(Library.LibraryPath)==0)
- {
- FileName = FileName.Substring(Library.LibraryPath.Length+1);
- }
- Title = Sequence = Annotation = Language = string.Empty;
- HasCover = false;
- BookDate = DocumentDate = DateTime.MinValue;
- NumberInSequence = 0;
- Authors = new List();
- Translators = new List();
- Genres = new List();
- }
- private string _id = string.Empty;
- public string ID
- {
- get { return _id; }
- set
- {
- // Book ID always must be in GUID form
- Guid guid;
- if (!string.IsNullOrEmpty(value) && Guid.TryParse(value, out guid)) _id = value; else _id = Utils.CreateGuid(Utils.IsoOidNamespace, FileName).ToString();
- }
- }
- public float Version { get; set; }
- public string FileName { get; private set; }
- public string FilePath { get { return Path.Combine(Library.LibraryPath, FileName); } }
- public string Title { get; set; }
- public string Language { get; set; }
- public bool HasCover { get; set; }
- public DateTime BookDate { get; set; }
- public DateTime DocumentDate { get; set; }
- public string Sequence { get; set; }
- public UInt32 NumberInSequence { get; set; }
- public string Annotation { get; set; }
- public UInt32 DocumentSize { get; set; }
- public List Authors { get; set; }
- public List Translators { get; set; }
- public List Genres { get; set; }
- public BookType BookType { get { return Path.GetExtension(FilePath).ToLower().Contains("epub") ? BookType.EPUB : Data.BookType.FB2; } }
- public bool IsValid { get { return (!string.IsNullOrEmpty(Title) && Title.IsValidUTF() && Authors.Count > 0 && Genres.Count > 0); } }
- public DateTime AddedDate { get; set; }
- }
-}
diff --git a/releases/1.1/Data/CoverImage.cs b/releases/1.1/Data/CoverImage.cs
deleted file mode 100644
index e147c83..0000000
--- a/releases/1.1/Data/CoverImage.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module defines the CoverImage class and Image extensions
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Drawing.Drawing2D;
-
-using Ionic.Zip;
-using TinyOPDS.Parsers;
-
-namespace TinyOPDS.Data
-{
- ///
- ///
- ///
- public class CoverImage
- {
- public static Size CoverSize = new Size(480, 800);
- public static Size ThumbnailSize = new Size(48, 80);
-
- private Image _cover;
- private Image _thumbnail { get { return (_cover != null) ? _cover.Resize(ThumbnailSize) : null; } }
- public Stream CoverImageStream { get { return _cover.ToStream(ImageFormat.Jpeg); } }
- public Stream ThumbnailImageStream { get { return _thumbnail.ToStream(ImageFormat.Jpeg); } }
- public bool HasImages { get { return _cover != null; } }
- public string ID { get; set; }
-
- public CoverImage(Book book)
- {
- _cover = null;
- ID = book.ID;
- try
- {
- using (MemoryStream memStream = new MemoryStream())
- {
- if (book.FilePath.ToLower().Contains(".zip@"))
- {
- string[] pathParts = book.FilePath.Split('@');
- using (ZipFile zipFile = new ZipFile(pathParts[0]))
- {
- ZipEntry entry = zipFile.Entries.First(e => e.FileName.Contains(pathParts[1]));
- if (entry != null) entry.Extract(memStream);
- }
- }
- else
- {
- using (FileStream stream = new FileStream(book.FilePath, FileMode.Open, FileAccess.Read, FileShare.Read))
- stream.CopyTo(memStream);
- }
-
- _cover = (book.BookType == BookType.EPUB) ? new ePubParser().GetCoverImage(memStream, book.FilePath)
- : new FB2Parser().GetCoverImage(memStream, book.FilePath);
- }
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, "file {0}, exception {1}", book.FilePath, e.Message);
- }
- }
- }
-
- public static class ImageExtensions
- {
- public static Stream ToStream(this Image image, ImageFormat format)
- {
- MemoryStream stream = null;
- try
- {
- stream = new MemoryStream();
- if (image != null)
- {
- image.Save(stream, format);
- stream.Position = 0;
- }
- }
- catch
- {
- if (stream != null) stream.Dispose();
- }
- return stream;
- }
-
- public static Image Resize(this Image image, Size size, bool preserveAspectRatio = true)
- {
- if (image == null) return null;
- int newWidth, newHeight;
- if (preserveAspectRatio)
- {
- int originalWidth = image.Width;
- int originalHeight = image.Height;
- float percentWidth = (float)size.Width / (float)originalWidth;
- float percentHeight = (float)size.Height / (float)originalHeight;
- float percent = percentHeight < percentWidth ? percentHeight : percentWidth;
- newWidth = (int)(originalWidth * percent);
- newHeight = (int)(originalHeight * percent);
- }
- else
- {
- newWidth = size.Width;
- newHeight = size.Height;
- }
- Image newImage = null;
- try
- {
- newImage = new Bitmap(newWidth, newHeight);
- using (Graphics graphicsHandle = Graphics.FromImage(newImage))
- {
- graphicsHandle.InterpolationMode = InterpolationMode.HighQualityBicubic;
- graphicsHandle.DrawImage(image, 0, 0, newWidth, newHeight);
- }
- }
- catch
- {
- if (newImage != null) newImage.Dispose();
- }
- return newImage;
- }
- }
-}
diff --git a/releases/1.1/Data/Genre.cs b/releases/1.1/Data/Genre.cs
deleted file mode 100644
index 5e4c1fa..0000000
--- a/releases/1.1/Data/Genre.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module defines the Genre class (book genre)
- *
- ************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace TinyOPDS.Data
-{
- public class Genre
- {
- public string Tag { get; set; }
- public string Name { get; set; }
- public string Translation { get; set; }
- public List Subgenres = new List();
- }
-}
diff --git a/releases/1.1/Data/ImagesCache.cs b/releases/1.1/Data/ImagesCache.cs
deleted file mode 100644
index 51739b7..0000000
--- a/releases/1.1/Data/ImagesCache.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * Simple image caching class
- *
- * TODO: add disk caching
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
-using System.ComponentModel;
-using System.Threading;
-using System.Drawing;
-
-namespace TinyOPDS.Data
-{
- public static class ImagesCache
- {
- private static Dictionary _cache;
-
- static ImagesCache()
- {
- _cache = new Dictionary();
- }
-
- public static void Add(CoverImage image)
- {
- if (!_cache.ContainsKey(image.ID))
- {
- if (_cache.Count >= 1000) _cache.Remove(_cache.First().Key);
- _cache[image.ID] = image;
- }
- }
-
- public static bool HasImage(string id) { return _cache.ContainsKey(id); }
-
- public static CoverImage GetImage(string id) { return _cache[id]; }
- }
-}
diff --git a/releases/1.1/Data/Library.cs b/releases/1.1/Data/Library.cs
deleted file mode 100644
index fe415f6..0000000
--- a/releases/1.1/Data/Library.cs
+++ /dev/null
@@ -1,593 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * One of the base project classes, the Library class
- * We are using static dictionaries instead of database
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Xml.Linq;
-using System.Reflection;
-
-namespace TinyOPDS.Data
-{
- public static class Library
- {
- public static event EventHandler LibraryLoaded;
- private static Dictionary _paths = new Dictionary();
- private static Dictionary _books = new Dictionary();
- private static string _databaseFullPath;
- private static List _genres;
- private static Dictionary _soundexedGenres;
- private static bool _converted = false;
-
- ///
- /// Default constructor
- /// Opens library"books.db" from the executable file location
- ///
- static Library()
- {
- LoadAsync();
-
- // Load and parse genres
- try
- {
- var doc = XDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("TinyOPDS.genres.xml"));
- _genres = doc.Root.Descendants("genre").Select(g =>
- new Genre()
- {
- Name = g.Attribute("name").Value,
- Translation = g.Attribute("ru").Value,
- Subgenres = g.Descendants("subgenre").Select(sg =>
- new Genre()
- {
- Name = sg.Value,
- Tag = sg.Attribute("tag").Value,
- Translation = sg.Attribute("ru").Value,
- }).ToList()
- }).ToList();
-
- _soundexedGenres = new Dictionary();
- foreach (Genre genre in _genres)
- foreach (Genre subgenre in genre.Subgenres)
- {
- _soundexedGenres[subgenre.Name.SoundexByWord()] = subgenre.Tag;
- string reversed = string.Join(" ", subgenre.Name.Split(' ', ',').Reverse()).Trim();
- _soundexedGenres[reversed.SoundexByWord()] = subgenre.Tag;
- }
-
- }
- catch { }
- }
-
- ///
- /// Load library database in background
- ///
- public static void LoadAsync()
- {
- // Clear library and free memory
- FB2Count = EPUBCount = 0;
- _books.Clear();
- _paths.Clear();
- GC.Collect();
-
- // Create unique database name, based on library path
- LibraryPath = Properties.Settings.Default.LibraryPath;
- string databaseFileName = Utils.CreateGuid(Utils.IsoOidNamespace, LibraryPath).ToString() + ".db";
- _databaseFullPath = Path.Combine(Utils.ServiceFilesLocation, databaseFileName);
-
- // Load database in the background thread
- BackgroundWorker worker = new BackgroundWorker();
- worker.DoWork += (_, __) =>
- {
- _converted = false;
- Load();
- if (LibraryLoaded != null) LibraryLoaded(null, null);
- if (_converted)
- {
- Save();
- Log.WriteLine(LogLevel.Info, "Database successfully converted to the format 1.1");
- }
- worker.Dispose();
- };
- worker.RunWorkerAsync();
- }
-
- ///
- /// Full path to the library folder
- ///
- public static string LibraryPath { get; set; }
-
- ///
- /// Library changed flag (we should save!)
- ///
- public static bool IsChanged { get; set; }
-
- ///
- ///
- ///
- ///
- ///
- public static bool Contains(string bookPath)
- {
- lock (_paths)
- {
- return _paths.ContainsKey(bookPath);
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- public static Book GetBook(string id)
- {
- lock (_books)
- {
- Book book = null;
- if (_books.ContainsKey(id))
- {
- book = _books[id];
- }
- return book;
- }
- }
-
- ///
- /// Add unique book descriptor to the library and saves the library
- ///
- ///
- public static bool Add(Book book)
- {
- lock (_books)
- {
- // Prevent incorrect duplicates detection (same ID but different titles)
- if (_books.ContainsKey(book.ID) && !book.Title.Equals(_books[book.ID].Title))
- {
- book.ID = Utils.CreateGuid(Utils.IsoOidNamespace, book.FileName).ToString();
- }
-
- // Check for duplicates
- if (!_books.ContainsKey(book.ID) || (_books.ContainsKey(book.ID) && _books[book.ID].Version < book.Version))
- {
- // Remember duplicate flag
- bool isDuplicate = _books.ContainsKey(book.ID);
- book.AddedDate = DateTime.Now;
- // Make relative path
- _books[book.ID] = book;
- lock (_paths) _paths[book.FileName] = book.ID;
- if (!isDuplicate)
- {
- IsChanged = true;
- if (book.BookType == BookType.FB2) FB2Count++; else EPUBCount++;
- }
- else
- {
- Log.WriteLine(LogLevel.Warning, "Replaced duplicate. File name {0}, book version {1}", book.FileName, book.Version);
- }
- return !isDuplicate;
- }
- Log.WriteLine(LogLevel.Warning, "Found duplicate. File name {0}, book version {1}", book.FileName, book.Version);
- return false;
- }
- }
-
- ///
- /// Delete all books with specific file path from the library
- ///
- ///
- public static bool Delete(string fileName)
- {
- bool result = false;
- lock (_books)
- {
- if (!string.IsNullOrEmpty(fileName) && fileName.Length > Library.LibraryPath.Length + 1)
- {
- // Extract relative file name
- fileName = fileName.Substring(Library.LibraryPath.Length + 1);
- string ext = Path.GetExtension(fileName.ToLower());
-
- // Assume it's a single file
- if (ext.Equals(".epub") || ext.Equals(".fb2") || (ext.Equals(".zip") && fileName.ToLower().Contains(".fb2.zip")))
- {
- if (Contains(fileName))
- {
- Book book = _books[_paths[fileName]];
- if (book != null)
- {
- _books.Remove(book.ID);
- _paths.Remove(book.FileName);
- if (book.BookType == BookType.FB2) FB2Count--; else EPUBCount--;
- result = IsChanged = true;
- }
- }
- }
- // removed object should be archive or directory: let's remove all books with that path or zip
- else
- {
- List booksForRemove = _books.Where(b => b.Value.FileName.Contains(fileName)).Select(b => b.Value).ToList();
- foreach (Book book in booksForRemove)
- {
- _books.Remove(book.ID);
- _paths.Remove(book.FileName);
- if (book.BookType == BookType.FB2) FB2Count--; else EPUBCount--;
- }
- if (booksForRemove.Count > 0)
- {
- result = IsChanged = true;
- }
- }
- }
- }
- return result;
- }
-
-
- ///
- /// Total number of books in library
- ///
- public static int Count
- {
- get
- {
- lock (_books) return _books.Count;
- }
- }
-
- ///
- /// Returns FB2 books count
- ///
- public static int FB2Count { get; private set; }
-
- ///
- /// Returns EPUB books count
- ///
- public static int EPUBCount { get; private set; }
-
- ///
- /// Returns list of the books titles sorted in alphabetical order
- ///
- public static List Titles
- {
- get
- {
- lock (_books)
- {
- return _books.Values.Select(b => b.Title).Distinct().OrderBy(a => a, new OPDSComparer(Localizer.Language.Equals("ru"))).ToList();
- }
- }
- }
-
- ///
- /// Returns list of the authors sorted in alphabetical order
- ///
- public static List Authors
- {
- get
- {
- lock (_books)
- {
- return ((_books.Values.SelectMany(b => b.Authors)).ToList()).Distinct().OrderBy(a => a, new OPDSComparer(Localizer.Language.Equals("ru"))).Where(с => с.Length > 1).ToList();
- }
- }
- }
-
- ///
- /// Returns list of the library books series sorted in alphabetical order
- ///
- public static List Sequences
- {
- get
- {
- lock (_books)
- {
- return ((_books.Values.Select(b => b.Sequence)).ToList()).Distinct().OrderBy(a => a, new OPDSComparer(Localizer.Language.Equals("ru"))).Where(с => с.Length > 1).ToList();
- }
- }
- }
-
- ///
- /// All genres supported by fb2 format
- ///
- public static List FB2Genres
- {
- get
- {
- return _genres;
- }
- }
-
- public static Dictionary SoundexedGenres
- {
- get
- {
- return _soundexedGenres;
- }
- }
-
- ///
- /// Returns sorted in alphabetical order list of library books genres
- ///
- public static List Genres
- {
- get
- {
- lock (_books)
- {
- var libGenres = _books.Values.SelectMany(b => b.Genres).ToList().Distinct().OrderBy(a => a, new OPDSComparer(Localizer.Language.Equals("ru"))).Where(с => с.Length > 1).Select(g => g.ToLower().Trim()).ToList();
- return _genres.SelectMany(g => g.Subgenres).Where(sg => libGenres.Contains(sg.Tag) || libGenres.Contains(sg.Name.ToLower()) || libGenres.Contains(sg.Translation.ToLower())).ToList();
- }
- }
- }
-
- ///
- /// Search authors by name
- ///
- ///
- ///
- public static List GetAuthorsByName(string name, bool isOpenSearch)
- {
- List authors = new List();
- lock (_books)
- {
- if (isOpenSearch) authors = Authors.Where(a => a.IndexOf(name, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
- else authors = Authors.Where(a => a.StartsWith(name, StringComparison.OrdinalIgnoreCase)).ToList();
- if (isOpenSearch && authors.Count == 0)
- {
- string reversedName = name.Reverse();
- authors = Authors.Where(a => a.IndexOf(reversedName, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
- }
- return authors;
- }
- }
-
- ///
- /// Return books by title
- ///
- ///
- ///
- public static List GetBooksByTitle(string title)
- {
- lock (_books) return _books.Values.Where(b => b.Title.IndexOf(title, StringComparison.OrdinalIgnoreCase) >= 0 || b.Sequence.IndexOf(title, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
- }
-
- ///
- /// Return books by selected author(s)
- ///
- ///
- ///
- public static List GetBooksByAuthor(string author)
- {
- lock (_books) return _books.Values.Where(b => b.Authors.Contains(author)).ToList();
- }
-
- ///
- /// Return books by selected sequence
- ///
- ///
- ///
- public static List GetBooksBySequence(string sequence)
- {
- lock (_books) return _books.Values.Where(b => b.Sequence.Contains(sequence)).ToList();
- }
-
- ///
- /// Return books by selected genre
- ///
- ///
- ///
- public static List GetBooksByGenre(string genre)
- {
- lock (_books) return _books.Values.Where(b => b.Genres.Contains(genre)).ToList();
- }
-
- #region Serialization and deserialization
-
- ///
- /// Load library
- ///
- public static void Load()
- {
- int numRecords = 0;
- DateTime start = DateTime.Now;
-
- // MemoryStream can save us about 1 second on 106 Mb database load time
- MemoryStream memStream = null;
- if (File.Exists(_databaseFullPath))
- {
- _books.Clear();
- memStream = new MemoryStream();
-
- try
- {
- using (Stream fileStream = new FileStream(_databaseFullPath, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- fileStream.CopyTo(memStream);
- }
- memStream.Position = 0;
- using (BinaryReader reader = new BinaryReader(memStream))
- {
- bool newFormat = reader.ReadString().Equals("VER1.1");
- if (!newFormat)
- {
- reader.BaseStream.Position = 0;
- _converted = true;
- }
-
- DateTime now = DateTime.Now;
-
- while (reader.BaseStream.Position < reader.BaseStream.Length)
- {
- try
- {
- string fileName = reader.ReadString();
- Book book = new Book(Path.Combine(LibraryPath,fileName));
- book.ID = reader.ReadString();
- book.Version = reader.ReadSingle();
- book.Title = reader.ReadString();
- book.Language = reader.ReadString();
- book.HasCover = reader.ReadBoolean();
- book.BookDate = DateTime.FromBinary(reader.ReadInt64());
- book.DocumentDate = DateTime.FromBinary(reader.ReadInt64());
- book.Sequence = reader.ReadString();
- book.NumberInSequence = reader.ReadUInt32();
- book.Annotation = reader.ReadString();
- book.DocumentSize = reader.ReadUInt32();
- int count = reader.ReadInt32();
- for (int i = 0; i < count; i++) book.Authors.Add(reader.ReadString());
- count = reader.ReadInt32();
- for (int i = 0; i < count; i++) book.Translators.Add(reader.ReadString());
- count = reader.ReadInt32();
- for (int i = 0; i < count; i++) book.Genres.Add(reader.ReadString());
- lock (_books) _books[book.ID] = book;
- lock (_paths) _paths[book.FileName] = book.ID;
- book.AddedDate = newFormat ? DateTime.FromBinary(reader.ReadInt64()) : now;
-
- numRecords++;
- }
- catch (EndOfStreamException)
- {
- break;
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, e.Message);
- break;
- }
- }
- }
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, "Load books exception {0}", e.Message);
- }
- finally
- {
- if (memStream != null)
- {
- memStream.Dispose();
- memStream = null;
- }
- // Call garbage collector now
- GC.Collect();
-
- FB2Count = _books.Count(b => b.Value.BookType == BookType.FB2);
- EPUBCount = _books.Count(b => b.Value.BookType == BookType.EPUB);
-
- IsChanged = false;
- }
- }
-
- Log.WriteLine(LogLevel.Info, "Database load time = {0}, {1} book records loaded", DateTime.Now.Subtract(start), numRecords);
- }
-
- ///
- /// Save whole library
- ///
- /// Remark: new database format is used!
- public static void Save()
- {
- // Do nothing if we have no records
- if (_books.Count == 0) return;
-
- int numRecords = 0;
- DateTime start = DateTime.Now;
-
- Stream fileStream = null;
- try
- {
- fileStream = new FileStream(_databaseFullPath, FileMode.Create, FileAccess.Write, FileShare.Write);
- using (BinaryWriter writer = new BinaryWriter(fileStream))
- {
- fileStream = null;
- writer.Write("VER1.1");
-
- // Create shallow copy (to prevent exception on dictionary modifications during foreach loop)
- Dictionary shallowCopy = null;
- lock (_books) shallowCopy = new Dictionary(_books);
- foreach (Book book in shallowCopy.Values)
- {
- writeBook(book, writer);
- numRecords++;
- }
- }
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, "Save books exception {0}", e.Message);
- }
- finally
- {
- if (fileStream != null) fileStream.Dispose();
- IsChanged = false;
- Log.WriteLine(LogLevel.Info, "Database save time = {0}, {1} book records written to disk", DateTime.Now.Subtract(start), numRecords);
- }
- }
-
- ///
- /// Append one book descriptor to the library file
- ///
- ///
- public static void Append(Book book)
- {
- Stream fileStream = null;
- try
- {
- fileStream = new FileStream(_databaseFullPath, FileMode.Append, FileAccess.Write, FileShare.Write);
- using (BinaryWriter writer = new BinaryWriter(fileStream))
- {
- fileStream = null;
- writeBook(book, writer);
- }
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, "Can't append book {0}, exception {1}", book.FilePath, e.Message);
- }
- finally
- {
- if (fileStream != null)
- {
- fileStream.Dispose();
- }
- IsChanged = false;
- }
- }
-
- private static void writeBook(Book book, BinaryWriter writer)
- {
- writer.Write(book.FileName);
- writer.Write(book.ID);
- writer.Write(book.Version);
- writer.Write(book.Title);
- writer.Write(book.Language);
- writer.Write(book.HasCover);
- writer.Write(book.BookDate.ToBinary());
- writer.Write(book.DocumentDate.ToBinary());
- writer.Write(book.Sequence);
- writer.Write(book.NumberInSequence);
- writer.Write(book.Annotation);
- writer.Write(book.DocumentSize);
- writer.Write((Int32)book.Authors.Count);
- foreach (string author in book.Authors) writer.Write(author);
- writer.Write((Int32)book.Translators.Count);
- foreach (string translator in book.Translators) writer.Write(translator);
- writer.Write((Int32)book.Genres.Count);
- foreach (string genre in book.Genres) writer.Write(genre);
- writer.Write(book.AddedDate.ToBinary());
- }
-
- #endregion
- }
-}
diff --git a/releases/1.1/Icons/..svnbridge/Thumbs.db b/releases/1.1/Icons/..svnbridge/Thumbs.db
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/Thumbs.db
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/TinyOPDS.ico b/releases/1.1/Icons/..svnbridge/TinyOPDS.ico
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/TinyOPDS.ico
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/authors.ico b/releases/1.1/Icons/..svnbridge/authors.ico
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/authors.ico
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/authors.png b/releases/1.1/Icons/..svnbridge/authors.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/authors.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/book.png b/releases/1.1/Icons/..svnbridge/book.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/book.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/book2.png b/releases/1.1/Icons/..svnbridge/book2.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/book2.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/book3.png b/releases/1.1/Icons/..svnbridge/book3.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/book3.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/books.ico b/releases/1.1/Icons/..svnbridge/books.ico
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/books.ico
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/books.png b/releases/1.1/Icons/..svnbridge/books.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/books.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/favicon.ico b/releases/1.1/Icons/..svnbridge/favicon.ico
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/favicon.ico
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/folder.png b/releases/1.1/Icons/..svnbridge/folder.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/folder.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/genres.ico b/releases/1.1/Icons/..svnbridge/genres.ico
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/genres.ico
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/genres.png b/releases/1.1/Icons/..svnbridge/genres.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/genres.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/genres2.png b/releases/1.1/Icons/..svnbridge/genres2.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/genres2.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/..svnbridge/lib.png b/releases/1.1/Icons/..svnbridge/lib.png
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Icons/..svnbridge/lib.png
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Icons/Thumbs.db b/releases/1.1/Icons/Thumbs.db
deleted file mode 100644
index 5c4c23d..0000000
Binary files a/releases/1.1/Icons/Thumbs.db and /dev/null differ
diff --git a/releases/1.1/Icons/TinyOPDS.ico b/releases/1.1/Icons/TinyOPDS.ico
deleted file mode 100644
index 901fcc4..0000000
Binary files a/releases/1.1/Icons/TinyOPDS.ico and /dev/null differ
diff --git a/releases/1.1/Icons/authors.ico b/releases/1.1/Icons/authors.ico
deleted file mode 100644
index 1a835e2..0000000
Binary files a/releases/1.1/Icons/authors.ico and /dev/null differ
diff --git a/releases/1.1/Icons/authors.png b/releases/1.1/Icons/authors.png
deleted file mode 100644
index cfc64cd..0000000
Binary files a/releases/1.1/Icons/authors.png and /dev/null differ
diff --git a/releases/1.1/Icons/book.png b/releases/1.1/Icons/book.png
deleted file mode 100644
index e46995b..0000000
Binary files a/releases/1.1/Icons/book.png and /dev/null differ
diff --git a/releases/1.1/Icons/book2.png b/releases/1.1/Icons/book2.png
deleted file mode 100644
index 116ec38..0000000
Binary files a/releases/1.1/Icons/book2.png and /dev/null differ
diff --git a/releases/1.1/Icons/book3.png b/releases/1.1/Icons/book3.png
deleted file mode 100644
index eff3d43..0000000
Binary files a/releases/1.1/Icons/book3.png and /dev/null differ
diff --git a/releases/1.1/Icons/books.ico b/releases/1.1/Icons/books.ico
deleted file mode 100644
index 57d6e9f..0000000
Binary files a/releases/1.1/Icons/books.ico and /dev/null differ
diff --git a/releases/1.1/Icons/books.png b/releases/1.1/Icons/books.png
deleted file mode 100644
index 4593e0b..0000000
Binary files a/releases/1.1/Icons/books.png and /dev/null differ
diff --git a/releases/1.1/Icons/favicon.ico b/releases/1.1/Icons/favicon.ico
deleted file mode 100644
index d8f35aa..0000000
Binary files a/releases/1.1/Icons/favicon.ico and /dev/null differ
diff --git a/releases/1.1/Icons/folder.png b/releases/1.1/Icons/folder.png
deleted file mode 100644
index 3241bb3..0000000
Binary files a/releases/1.1/Icons/folder.png and /dev/null differ
diff --git a/releases/1.1/Icons/genres.ico b/releases/1.1/Icons/genres.ico
deleted file mode 100644
index 45c3d60..0000000
Binary files a/releases/1.1/Icons/genres.ico and /dev/null differ
diff --git a/releases/1.1/Icons/genres.png b/releases/1.1/Icons/genres.png
deleted file mode 100644
index b698c8f..0000000
Binary files a/releases/1.1/Icons/genres.png and /dev/null differ
diff --git a/releases/1.1/Icons/genres2.png b/releases/1.1/Icons/genres2.png
deleted file mode 100644
index 9fa31ef..0000000
Binary files a/releases/1.1/Icons/genres2.png and /dev/null differ
diff --git a/releases/1.1/Icons/lib.png b/releases/1.1/Icons/lib.png
deleted file mode 100644
index 040ac5c..0000000
Binary files a/releases/1.1/Icons/lib.png and /dev/null differ
diff --git a/releases/1.1/Libs/..svnbridge/FB2Library.dll b/releases/1.1/Libs/..svnbridge/FB2Library.dll
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/FB2Library.dll
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/..svnbridge/FB2Library.dll.gz b/releases/1.1/Libs/..svnbridge/FB2Library.dll.gz
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/FB2Library.dll.gz
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/..svnbridge/Ionic.Zip.Reduced.dll b/releases/1.1/Libs/..svnbridge/Ionic.Zip.Reduced.dll
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/Ionic.Zip.Reduced.dll
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/..svnbridge/Ionic.Zip.Reduced.dll.gz b/releases/1.1/Libs/..svnbridge/Ionic.Zip.Reduced.dll.gz
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/Ionic.Zip.Reduced.dll.gz
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/..svnbridge/eBdb.EpubReader.dll b/releases/1.1/Libs/..svnbridge/eBdb.EpubReader.dll
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/eBdb.EpubReader.dll
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/..svnbridge/eBdb.EpubReader.dll.gz b/releases/1.1/Libs/..svnbridge/eBdb.EpubReader.dll.gz
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/eBdb.EpubReader.dll.gz
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/..svnbridge/gzip.exe b/releases/1.1/Libs/..svnbridge/gzip.exe
deleted file mode 100644
index 81efb3c..0000000
--- a/releases/1.1/Libs/..svnbridge/gzip.exe
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/releases/1.1/Libs/FB2Library.dll b/releases/1.1/Libs/FB2Library.dll
deleted file mode 100644
index 88553b9..0000000
Binary files a/releases/1.1/Libs/FB2Library.dll and /dev/null differ
diff --git a/releases/1.1/Libs/FB2Library.dll.gz b/releases/1.1/Libs/FB2Library.dll.gz
deleted file mode 100644
index 8b309d0..0000000
Binary files a/releases/1.1/Libs/FB2Library.dll.gz and /dev/null differ
diff --git a/releases/1.1/Libs/Ionic.Zip.Reduced.dll b/releases/1.1/Libs/Ionic.Zip.Reduced.dll
deleted file mode 100644
index 606c333..0000000
Binary files a/releases/1.1/Libs/Ionic.Zip.Reduced.dll and /dev/null differ
diff --git a/releases/1.1/Libs/Ionic.Zip.Reduced.dll.gz b/releases/1.1/Libs/Ionic.Zip.Reduced.dll.gz
deleted file mode 100644
index b2ae064..0000000
Binary files a/releases/1.1/Libs/Ionic.Zip.Reduced.dll.gz and /dev/null differ
diff --git a/releases/1.1/Libs/eBdb.EpubReader.dll b/releases/1.1/Libs/eBdb.EpubReader.dll
deleted file mode 100644
index f6a1dd3..0000000
Binary files a/releases/1.1/Libs/eBdb.EpubReader.dll and /dev/null differ
diff --git a/releases/1.1/Libs/eBdb.EpubReader.dll.gz b/releases/1.1/Libs/eBdb.EpubReader.dll.gz
deleted file mode 100644
index ef0fc64..0000000
Binary files a/releases/1.1/Libs/eBdb.EpubReader.dll.gz and /dev/null differ
diff --git a/releases/1.1/Libs/gzip.cs b/releases/1.1/Libs/gzip.cs
deleted file mode 100644
index 9e99965..0000000
--- a/releases/1.1/Libs/gzip.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.IO;
-using System.IO.Compression;
-
-namespace zip
-{
- public class Program
- {
- public static void Main(string[] args)
- {
- if (args.Length < 1)
- {
- Console.WriteLine("Usage: gzip [-d] file");
- }
- else if (args[0] != "-d") Compress(new FileInfo(args[0])); else Decompress(new FileInfo(args[1]));
- }
-
- public static void Compress(FileInfo fi)
- {
- // Get the stream of the source file.
- using (FileStream inFile = fi.OpenRead())
- {
- // Prevent compressing hidden and
- // already compressed files.
- if ((File.GetAttributes(fi.FullName) & FileAttributes.Hidden) != FileAttributes.Hidden & fi.Extension != ".gz")
- {
- // Create the compressed file
- using (FileStream outFile = File.Create(fi.FullName + ".gz"))
- {
- using (GZipStream Compress = new GZipStream(outFile, CompressionMode.Compress))
- {
- // Copy the source file into the compression stream.
- inFile.CopyTo(Compress);
- Console.WriteLine("Compressed {0} from {1} to {2} bytes.",
- fi.Name, fi.Length.ToString(), outFile.Length.ToString());
- }
- }
- }
- }
- }
-
- public static void Decompress(FileInfo fi)
- {
- // Get the stream of the source file.
- using (FileStream inFile = fi.OpenRead())
- {
- // Get original file extension
- string curFile = fi.FullName;
- string origName = curFile.Remove(curFile.Length - fi.Extension.Length);
-
- //Create the decompressed file.
- using (FileStream outFile = File.Create(origName))
- {
- using (GZipStream Decompress = new GZipStream(inFile, CompressionMode.Decompress))
- {
- // Copy the decompression stream into the output file.
- Decompress.CopyTo(outFile);
- Console.WriteLine("Decompressed: {0}", fi.Name);
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/releases/1.1/Libs/gzip.exe b/releases/1.1/Libs/gzip.exe
deleted file mode 100644
index c4d28a9..0000000
Binary files a/releases/1.1/Libs/gzip.exe and /dev/null differ
diff --git a/releases/1.1/License.txt b/releases/1.1/License.txt
deleted file mode 100644
index 73d6051..0000000
--- a/releases/1.1/License.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Public License (Ms-PL)
-
-This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
-
-1. Definitions
-
-The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
-
-A "contribution" is the original software, or any additions or changes to the software.
-
-A "contributor" is any person that distributes its contribution under this license.
-
-"Licensed patents" are a contributor's patent claims that read directly on its contribution.
-
-2. Grant of Rights
-
-(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
-
-(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
-
-3. Conditions and Limitations
-
-(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
-
-(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
-
-(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
-
-(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
diff --git a/releases/1.1/MainForm.Designer.cs b/releases/1.1/MainForm.Designer.cs
deleted file mode 100644
index de0ac40..0000000
--- a/releases/1.1/MainForm.Designer.cs
+++ /dev/null
@@ -1,1418 +0,0 @@
-namespace TinyOPDS
-{
- partial class MainForm
- {
- ///
- /// 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();
- if (_watcher != null) _watcher.Dispose();
- if (_upnpController != null) _upnpController.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.tabPage1 = new System.Windows.Forms.TabPage();
- this.databaseFileName = new System.Windows.Forms.TextBox();
- this.label21 = new System.Windows.Forms.Label();
- this.useWatcher = new System.Windows.Forms.CheckBox();
- this.duplicates = new System.Windows.Forms.Label();
- this.label16 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.status = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.rate = new System.Windows.Forms.Label();
- this.label12 = new System.Windows.Forms.Label();
- this.elapsedTime = new System.Windows.Forms.Label();
- this.label10 = new System.Windows.Forms.Label();
- this.startTime = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.booksProcessed = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.invalidBooks = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.skippedBooks = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.booksFound = new System.Windows.Forms.Label();
- this.booksInDB = new System.Windows.Forms.Label();
- this.folderButton = new System.Windows.Forms.Button();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.scannerButton = new System.Windows.Forms.Button();
- this.libraryPath = new System.Windows.Forms.TextBox();
- this.tabPage2 = new System.Windows.Forms.TabPage();
- this.useAbsoluteUri = new System.Windows.Forms.CheckBox();
- this.interfaceCombo = new System.Windows.Forms.ComboBox();
- this.label29 = new System.Windows.Forms.Label();
- this.statUniqueClients = new System.Windows.Forms.Label();
- this.label26 = new System.Windows.Forms.Label();
- this.statImages = new System.Windows.Forms.Label();
- this.label27 = new System.Windows.Forms.Label();
- this.statBooks = new System.Windows.Forms.Label();
- this.label25 = new System.Windows.Forms.Label();
- this.statRequests = new System.Windows.Forms.Label();
- this.label23 = new System.Windows.Forms.Label();
- this.extLink = new System.Windows.Forms.LinkLabel();
- this.intLink = new System.Windows.Forms.LinkLabel();
- this.label13 = new System.Windows.Forms.Label();
- this.extIPlabel = new System.Windows.Forms.Label();
- this.intIPlabel = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.serverButton = new System.Windows.Forms.Button();
- this.openPort = new System.Windows.Forms.CheckBox();
- this.serverPort = new System.Windows.Forms.TextBox();
- this.useUPnP = new System.Windows.Forms.CheckBox();
- this.rootPrefix = new System.Windows.Forms.TextBox();
- this.serverName = new System.Windows.Forms.TextBox();
- this.tabPage5 = new System.Windows.Forms.TabPage();
- this.statBannedClients = new System.Windows.Forms.Label();
- this.label31 = new System.Windows.Forms.Label();
- this.label24 = new System.Windows.Forms.Label();
- this.statWrongLogins = new System.Windows.Forms.Label();
- this.label30 = new System.Windows.Forms.Label();
- this.statGoodLogins = new System.Windows.Forms.Label();
- this.label28 = new System.Windows.Forms.Label();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.wrongAttemptsCount = new System.Windows.Forms.NumericUpDown();
- this.banClients = new System.Windows.Forms.CheckBox();
- this.rememberClients = new System.Windows.Forms.CheckBox();
- this.useHTTPAuth = new System.Windows.Forms.CheckBox();
- this.tabPage3 = new System.Windows.Forms.TabPage();
- this.label32 = new System.Windows.Forms.Label();
- this.updateCombo = new System.Windows.Forms.ComboBox();
- this.label22 = new System.Windows.Forms.Label();
- this.logVerbosity = new System.Windows.Forms.ComboBox();
- this.converterLinkLabel = new System.Windows.Forms.LinkLabel();
- this.label11 = new System.Windows.Forms.Label();
- this.langCombo = new System.Windows.Forms.ComboBox();
- this.label8 = new System.Windows.Forms.Label();
- this.convertorFolder = new System.Windows.Forms.Button();
- this.convertorPath = new System.Windows.Forms.TextBox();
- this.saveLog = new System.Windows.Forms.CheckBox();
- this.closeToTray = new System.Windows.Forms.CheckBox();
- this.startMinimized = new System.Windows.Forms.CheckBox();
- this.startWithWindows = new System.Windows.Forms.CheckBox();
- this.tabPage4 = new System.Windows.Forms.TabPage();
- this.linkLabel5 = new System.Windows.Forms.LinkLabel();
- this.linkLabel4 = new System.Windows.Forms.LinkLabel();
- this.linkLabel3 = new System.Windows.Forms.LinkLabel();
- this.label20 = new System.Windows.Forms.Label();
- this.label19 = new System.Windows.Forms.Label();
- this.linkLabel2 = new System.Windows.Forms.LinkLabel();
- this.label18 = new System.Windows.Forms.Label();
- this.linkLabel1 = new System.Windows.Forms.LinkLabel();
- this.label17 = new System.Windows.Forms.Label();
- this.appVersion = new System.Windows.Forms.Label();
- this.appName = new System.Windows.Forms.Label();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- this.donateButton = new System.Windows.Forms.Button();
- this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.windowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.serverMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
- this.exitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.tabControl1.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.tabPage2.SuspendLayout();
- this.tabPage5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.wrongAttemptsCount)).BeginInit();
- this.tabPage3.SuspendLayout();
- this.tabPage4.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- this.contextMenuStrip.SuspendLayout();
- this.SuspendLayout();
- //
- // tabControl1
- //
- this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.tabControl1.Controls.Add(this.tabPage1);
- this.tabControl1.Controls.Add(this.tabPage2);
- this.tabControl1.Controls.Add(this.tabPage5);
- this.tabControl1.Controls.Add(this.tabPage3);
- this.tabControl1.Controls.Add(this.tabPage4);
- this.tabControl1.ItemSize = new System.Drawing.Size(91, 30);
- this.tabControl1.Location = new System.Drawing.Point(-3, -1);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(481, 327);
- this.tabControl1.TabIndex = 8;
- //
- // tabPage1
- //
- this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage1.Controls.Add(this.databaseFileName);
- this.tabPage1.Controls.Add(this.label21);
- this.tabPage1.Controls.Add(this.useWatcher);
- this.tabPage1.Controls.Add(this.duplicates);
- this.tabPage1.Controls.Add(this.label16);
- this.tabPage1.Controls.Add(this.label15);
- this.tabPage1.Controls.Add(this.status);
- this.tabPage1.Controls.Add(this.label14);
- this.tabPage1.Controls.Add(this.rate);
- this.tabPage1.Controls.Add(this.label12);
- this.tabPage1.Controls.Add(this.elapsedTime);
- this.tabPage1.Controls.Add(this.label10);
- this.tabPage1.Controls.Add(this.startTime);
- this.tabPage1.Controls.Add(this.label6);
- this.tabPage1.Controls.Add(this.booksProcessed);
- this.tabPage1.Controls.Add(this.label5);
- this.tabPage1.Controls.Add(this.invalidBooks);
- this.tabPage1.Controls.Add(this.label9);
- this.tabPage1.Controls.Add(this.skippedBooks);
- this.tabPage1.Controls.Add(this.label7);
- this.tabPage1.Controls.Add(this.booksFound);
- this.tabPage1.Controls.Add(this.booksInDB);
- this.tabPage1.Controls.Add(this.folderButton);
- this.tabPage1.Controls.Add(this.label2);
- this.tabPage1.Controls.Add(this.label1);
- this.tabPage1.Controls.Add(this.scannerButton);
- this.tabPage1.Controls.Add(this.libraryPath);
- this.tabPage1.Location = new System.Drawing.Point(4, 34);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage1.Size = new System.Drawing.Size(473, 289);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "Scanner settings";
- //
- // databaseFileName
- //
- this.databaseFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.databaseFileName.Location = new System.Drawing.Point(125, 62);
- this.databaseFileName.Name = "databaseFileName";
- this.databaseFileName.ReadOnly = true;
- this.databaseFileName.Size = new System.Drawing.Size(336, 20);
- this.databaseFileName.TabIndex = 32;
- //
- // label21
- //
- this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(15, 66);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(104, 13);
- this.label21.TabIndex = 31;
- this.label21.Text = "Database file name: ";
- //
- // useWatcher
- //
- this.useWatcher.AutoSize = true;
- this.useWatcher.Checked = global::TinyOPDS.Properties.Settings.Default.WatchLibrary;
- this.useWatcher.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "WatchLibrary", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.useWatcher.Location = new System.Drawing.Point(329, 34);
- this.useWatcher.Name = "useWatcher";
- this.useWatcher.Size = new System.Drawing.Size(135, 17);
- this.useWatcher.TabIndex = 30;
- this.useWatcher.Text = "Monitor library changes";
- this.useWatcher.UseVisualStyleBackColor = true;
- this.useWatcher.CheckedChanged += new System.EventHandler(this.useWatcher_CheckedChanged);
- //
- // duplicates
- //
- this.duplicates.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.duplicates.AutoSize = true;
- this.duplicates.Location = new System.Drawing.Point(122, 209);
- this.duplicates.MinimumSize = new System.Drawing.Size(50, 0);
- this.duplicates.Name = "duplicates";
- this.duplicates.Size = new System.Drawing.Size(50, 13);
- this.duplicates.TabIndex = 29;
- this.duplicates.Text = "0";
- //
- // label16
- //
- this.label16.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label16.AutoSize = true;
- this.label16.Location = new System.Drawing.Point(15, 209);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(60, 13);
- this.label16.TabIndex = 28;
- this.label16.Text = "Duplicates:";
- //
- // label15
- //
- this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(14, 16);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(105, 13);
- this.label15.TabIndex = 27;
- this.label15.Text = "Path to books folder:";
- //
- // status
- //
- this.status.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.status.AutoSize = true;
- this.status.Location = new System.Drawing.Point(360, 209);
- this.status.MinimumSize = new System.Drawing.Size(50, 0);
- this.status.Name = "status";
- this.status.Size = new System.Drawing.Size(58, 13);
- this.status.TabIndex = 26;
- this.status.Text = "STOPPED";
- //
- // label14
- //
- this.label14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(253, 209);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(40, 13);
- this.label14.TabIndex = 25;
- this.label14.Text = "Status:";
- //
- // rate
- //
- this.rate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.rate.AutoSize = true;
- this.rate.Location = new System.Drawing.Point(360, 183);
- this.rate.MinimumSize = new System.Drawing.Size(50, 0);
- this.rate.Name = "rate";
- this.rate.Size = new System.Drawing.Size(66, 13);
- this.rate.TabIndex = 24;
- this.rate.Text = "0 books/min";
- //
- // label12
- //
- this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(253, 183);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(33, 13);
- this.label12.TabIndex = 23;
- this.label12.Text = "Rate:";
- //
- // elapsedTime
- //
- this.elapsedTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.elapsedTime.AutoSize = true;
- this.elapsedTime.Location = new System.Drawing.Point(360, 157);
- this.elapsedTime.MinimumSize = new System.Drawing.Size(50, 0);
- this.elapsedTime.Name = "elapsedTime";
- this.elapsedTime.Size = new System.Drawing.Size(50, 13);
- this.elapsedTime.TabIndex = 22;
- this.elapsedTime.Text = "00:00:00";
- //
- // label10
- //
- this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(253, 157);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(70, 13);
- this.label10.TabIndex = 21;
- this.label10.Text = "Elapsed time:";
- //
- // startTime
- //
- this.startTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.startTime.AutoSize = true;
- this.startTime.Location = new System.Drawing.Point(360, 131);
- this.startTime.MinimumSize = new System.Drawing.Size(50, 0);
- this.startTime.Name = "startTime";
- this.startTime.Size = new System.Drawing.Size(50, 13);
- this.startTime.TabIndex = 20;
- this.startTime.Text = "00:00:00";
- //
- // label6
- //
- this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(253, 131);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(54, 13);
- this.label6.TabIndex = 19;
- this.label6.Text = "Start time:";
- //
- // booksProcessed
- //
- this.booksProcessed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.booksProcessed.AutoSize = true;
- this.booksProcessed.Location = new System.Drawing.Point(123, 235);
- this.booksProcessed.MinimumSize = new System.Drawing.Size(50, 0);
- this.booksProcessed.Name = "booksProcessed";
- this.booksProcessed.Size = new System.Drawing.Size(50, 13);
- this.booksProcessed.TabIndex = 18;
- this.booksProcessed.Text = "0";
- //
- // label5
- //
- this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(15, 235);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(92, 13);
- this.label5.TabIndex = 17;
- this.label5.Text = "Books processed:";
- //
- // invalidBooks
- //
- this.invalidBooks.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.invalidBooks.AutoSize = true;
- this.invalidBooks.Location = new System.Drawing.Point(123, 157);
- this.invalidBooks.MinimumSize = new System.Drawing.Size(50, 0);
- this.invalidBooks.Name = "invalidBooks";
- this.invalidBooks.Size = new System.Drawing.Size(50, 13);
- this.invalidBooks.TabIndex = 16;
- this.invalidBooks.Text = "0";
- //
- // label9
- //
- this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(15, 157);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(73, 13);
- this.label9.TabIndex = 15;
- this.label9.Text = "Invalid books:";
- //
- // skippedBooks
- //
- this.skippedBooks.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.skippedBooks.AutoSize = true;
- this.skippedBooks.Location = new System.Drawing.Point(123, 183);
- this.skippedBooks.MinimumSize = new System.Drawing.Size(50, 0);
- this.skippedBooks.Name = "skippedBooks";
- this.skippedBooks.Size = new System.Drawing.Size(50, 13);
- this.skippedBooks.TabIndex = 14;
- this.skippedBooks.Text = "0";
- //
- // label7
- //
- this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(15, 183);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(81, 13);
- this.label7.TabIndex = 13;
- this.label7.Text = "Skipped books:";
- //
- // booksFound
- //
- this.booksFound.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.booksFound.AutoSize = true;
- this.booksFound.Location = new System.Drawing.Point(123, 131);
- this.booksFound.MinimumSize = new System.Drawing.Size(50, 0);
- this.booksFound.Name = "booksFound";
- this.booksFound.Size = new System.Drawing.Size(79, 13);
- this.booksFound.TabIndex = 12;
- this.booksFound.Text = "fb2: 0 epub: 0";
- //
- // booksInDB
- //
- this.booksInDB.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.booksInDB.AutoSize = true;
- this.booksInDB.Location = new System.Drawing.Point(123, 92);
- this.booksInDB.MinimumSize = new System.Drawing.Size(50, 0);
- this.booksInDB.Name = "booksInDB";
- this.booksInDB.Size = new System.Drawing.Size(127, 13);
- this.booksInDB.TabIndex = 11;
- this.booksInDB.Text = "0 fb2: 0 epub: 0";
- //
- // folderButton
- //
- this.folderButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.folderButton.Image = global::TinyOPDS.Properties.Resources.folder;
- this.folderButton.Location = new System.Drawing.Point(287, 30);
- this.folderButton.Name = "folderButton";
- this.folderButton.Size = new System.Drawing.Size(29, 23);
- this.folderButton.TabIndex = 10;
- this.folderButton.UseVisualStyleBackColor = true;
- this.folderButton.Click += new System.EventHandler(this.folderButton_Click);
- //
- // label2
- //
- this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(15, 92);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(101, 13);
- this.label2.TabIndex = 9;
- this.label2.Text = "Books in database: ";
- //
- // label1
- //
- this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(15, 131);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(70, 13);
- this.label1.TabIndex = 8;
- this.label1.Text = "Books found:";
- //
- // scannerButton
- //
- this.scannerButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.scannerButton.Location = new System.Drawing.Point(255, 241);
- this.scannerButton.Name = "scannerButton";
- this.scannerButton.Size = new System.Drawing.Size(210, 40);
- this.scannerButton.TabIndex = 7;
- this.scannerButton.Text = "Start scanning";
- this.scannerButton.UseVisualStyleBackColor = true;
- this.scannerButton.Click += new System.EventHandler(this.scannerButton_Click);
- //
- // libraryPath
- //
- this.libraryPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.libraryPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::TinyOPDS.Properties.Settings.Default, "LibraryPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.libraryPath.Location = new System.Drawing.Point(17, 32);
- this.libraryPath.Name = "libraryPath";
- this.libraryPath.Size = new System.Drawing.Size(268, 20);
- this.libraryPath.TabIndex = 6;
- this.libraryPath.Text = global::TinyOPDS.Properties.Settings.Default.LibraryPath;
- this.libraryPath.Validated += new System.EventHandler(this.libraryPath_Validated);
- //
- // tabPage2
- //
- this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage2.Controls.Add(this.useAbsoluteUri);
- this.tabPage2.Controls.Add(this.interfaceCombo);
- this.tabPage2.Controls.Add(this.label29);
- this.tabPage2.Controls.Add(this.statUniqueClients);
- this.tabPage2.Controls.Add(this.label26);
- this.tabPage2.Controls.Add(this.statImages);
- this.tabPage2.Controls.Add(this.label27);
- this.tabPage2.Controls.Add(this.statBooks);
- this.tabPage2.Controls.Add(this.label25);
- this.tabPage2.Controls.Add(this.statRequests);
- this.tabPage2.Controls.Add(this.label23);
- this.tabPage2.Controls.Add(this.extLink);
- this.tabPage2.Controls.Add(this.intLink);
- this.tabPage2.Controls.Add(this.label13);
- this.tabPage2.Controls.Add(this.extIPlabel);
- this.tabPage2.Controls.Add(this.intIPlabel);
- this.tabPage2.Controls.Add(this.label4);
- this.tabPage2.Controls.Add(this.label3);
- this.tabPage2.Controls.Add(this.serverButton);
- this.tabPage2.Controls.Add(this.openPort);
- this.tabPage2.Controls.Add(this.serverPort);
- this.tabPage2.Controls.Add(this.useUPnP);
- this.tabPage2.Controls.Add(this.rootPrefix);
- this.tabPage2.Controls.Add(this.serverName);
- this.tabPage2.Location = new System.Drawing.Point(4, 34);
- this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage2.Size = new System.Drawing.Size(473, 289);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "OPDS server settings";
- //
- // useAbsoluteUri
- //
- this.useAbsoluteUri.AutoSize = true;
- this.useAbsoluteUri.Checked = global::TinyOPDS.Properties.Settings.Default.UseAbsoluteUri;
- this.useAbsoluteUri.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "UseAbsoluteUri", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.useAbsoluteUri.Location = new System.Drawing.Point(294, 126);
- this.useAbsoluteUri.Name = "useAbsoluteUri";
- this.useAbsoluteUri.Size = new System.Drawing.Size(91, 17);
- this.useAbsoluteUri.TabIndex = 48;
- this.useAbsoluteUri.Text = "Absolute links";
- this.useAbsoluteUri.UseVisualStyleBackColor = true;
- //
- // interfaceCombo
- //
- this.interfaceCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.interfaceCombo.FormattingEnabled = true;
- this.interfaceCombo.Location = new System.Drawing.Point(294, 35);
- this.interfaceCombo.Name = "interfaceCombo";
- this.interfaceCombo.Size = new System.Drawing.Size(113, 21);
- this.interfaceCombo.TabIndex = 47;
- this.interfaceCombo.SelectedIndexChanged += new System.EventHandler(this.interfaceCombo_SelectedIndexChanged);
- //
- // label29
- //
- this.label29.AutoSize = true;
- this.label29.Location = new System.Drawing.Point(292, 16);
- this.label29.Name = "label29";
- this.label29.Size = new System.Drawing.Size(94, 13);
- this.label29.TabIndex = 46;
- this.label29.Text = "Network interface:";
- //
- // statUniqueClients
- //
- this.statUniqueClients.AutoSize = true;
- this.statUniqueClients.Location = new System.Drawing.Point(144, 229);
- this.statUniqueClients.Name = "statUniqueClients";
- this.statUniqueClients.Size = new System.Drawing.Size(13, 13);
- this.statUniqueClients.TabIndex = 45;
- this.statUniqueClients.Text = "0";
- //
- // label26
- //
- this.label26.AutoSize = true;
- this.label26.Location = new System.Drawing.Point(20, 229);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(77, 13);
- this.label26.TabIndex = 44;
- this.label26.Text = "Unique clients:";
- //
- // statImages
- //
- this.statImages.AutoSize = true;
- this.statImages.Location = new System.Drawing.Point(445, 201);
- this.statImages.Name = "statImages";
- this.statImages.Size = new System.Drawing.Size(13, 13);
- this.statImages.TabIndex = 43;
- this.statImages.Text = "0";
- //
- // label27
- //
- this.label27.AutoSize = true;
- this.label27.Location = new System.Drawing.Point(352, 201);
- this.label27.Name = "label27";
- this.label27.Size = new System.Drawing.Size(67, 13);
- this.label27.TabIndex = 42;
- this.label27.Text = "Images sent:";
- //
- // statBooks
- //
- this.statBooks.AutoSize = true;
- this.statBooks.Location = new System.Drawing.Point(297, 201);
- this.statBooks.Name = "statBooks";
- this.statBooks.Size = new System.Drawing.Size(13, 13);
- this.statBooks.TabIndex = 41;
- this.statBooks.Text = "0";
- //
- // label25
- //
- this.label25.AutoSize = true;
- this.label25.Location = new System.Drawing.Point(200, 201);
- this.label25.Name = "label25";
- this.label25.Size = new System.Drawing.Size(63, 13);
- this.label25.TabIndex = 40;
- this.label25.Text = "Books sent:";
- //
- // statRequests
- //
- this.statRequests.AutoSize = true;
- this.statRequests.Location = new System.Drawing.Point(144, 201);
- this.statRequests.Name = "statRequests";
- this.statRequests.Size = new System.Drawing.Size(13, 13);
- this.statRequests.TabIndex = 39;
- this.statRequests.Text = "0";
- //
- // label23
- //
- this.label23.AutoSize = true;
- this.label23.Location = new System.Drawing.Point(20, 201);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(77, 13);
- this.label23.TabIndex = 38;
- this.label23.Text = "Total requests:";
- //
- // extLink
- //
- this.extLink.Location = new System.Drawing.Point(112, 152);
- this.extLink.Name = "extLink";
- this.extLink.Size = new System.Drawing.Size(176, 13);
- this.extLink.TabIndex = 37;
- this.extLink.TabStop = true;
- this.extLink.Text = "- - - - - -";
- this.extLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel_LinkClicked);
- //
- // intLink
- //
- this.intLink.Location = new System.Drawing.Point(112, 126);
- this.intLink.Name = "intLink";
- this.intLink.Size = new System.Drawing.Size(176, 13);
- this.intLink.TabIndex = 36;
- this.intLink.TabStop = true;
- this.intLink.Text = "- - - - - -";
- this.intLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel_LinkClicked);
- //
- // label13
- //
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(19, 72);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(127, 13);
- this.label13.TabIndex = 18;
- this.label13.Text = "OPDS root catalog prefix:";
- //
- // extIPlabel
- //
- this.extIPlabel.AutoSize = true;
- this.extIPlabel.Location = new System.Drawing.Point(19, 153);
- this.extIPlabel.Name = "extIPlabel";
- this.extIPlabel.Size = new System.Drawing.Size(73, 13);
- this.extIPlabel.TabIndex = 14;
- this.extIPlabel.Text = "External URL:";
- //
- // intIPlabel
- //
- this.intIPlabel.AutoSize = true;
- this.intIPlabel.Location = new System.Drawing.Point(19, 127);
- this.intIPlabel.Name = "intIPlabel";
- this.intIPlabel.Size = new System.Drawing.Size(61, 13);
- this.intIPlabel.TabIndex = 13;
- this.intIPlabel.Text = "Local URL:";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(17, 16);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(70, 13);
- this.label4.TabIndex = 11;
- this.label4.Text = "Server name:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(419, 16);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(29, 13);
- this.label3.TabIndex = 9;
- this.label3.Text = "Port:";
- //
- // serverButton
- //
- this.serverButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.serverButton.Location = new System.Drawing.Point(255, 241);
- this.serverButton.Name = "serverButton";
- this.serverButton.Size = new System.Drawing.Size(210, 40);
- this.serverButton.TabIndex = 8;
- this.serverButton.Text = "Start server";
- this.serverButton.Click += new System.EventHandler(this.serverButton_Click);
- //
- // openPort
- //
- this.openPort.AutoSize = true;
- this.openPort.Checked = global::TinyOPDS.Properties.Settings.Default.OpenNATPort;
- this.openPort.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "OpenNATPort", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.openPort.Enabled = false;
- this.openPort.Location = new System.Drawing.Point(294, 97);
- this.openPort.Name = "openPort";
- this.openPort.Size = new System.Drawing.Size(130, 17);
- this.openPort.TabIndex = 15;
- this.openPort.Text = "Forward port on router";
- this.openPort.UseVisualStyleBackColor = true;
- this.openPort.CheckedChanged += new System.EventHandler(this.openPort_CheckedChanged);
- //
- // serverPort
- //
- this.serverPort.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::TinyOPDS.Properties.Settings.Default, "ServerPort", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.serverPort.Location = new System.Drawing.Point(421, 35);
- this.serverPort.Name = "serverPort";
- this.serverPort.Size = new System.Drawing.Size(44, 20);
- this.serverPort.TabIndex = 10;
- this.serverPort.Text = global::TinyOPDS.Properties.Settings.Default.ServerPort;
- this.serverPort.Validated += new System.EventHandler(this.serverPort_Validated);
- //
- // useUPnP
- //
- this.useUPnP.AutoSize = true;
- this.useUPnP.Checked = global::TinyOPDS.Properties.Settings.Default.UseUPnP;
- this.useUPnP.CheckState = System.Windows.Forms.CheckState.Checked;
- this.useUPnP.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "UseUPnP", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.useUPnP.Location = new System.Drawing.Point(294, 68);
- this.useUPnP.Name = "useUPnP";
- this.useUPnP.Size = new System.Drawing.Size(76, 17);
- this.useUPnP.TabIndex = 35;
- this.useUPnP.Text = "Use UPnP";
- this.useUPnP.UseVisualStyleBackColor = true;
- this.useUPnP.CheckStateChanged += new System.EventHandler(this.useUPnP_CheckStateChanged);
- //
- // rootPrefix
- //
- this.rootPrefix.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::TinyOPDS.Properties.Settings.Default, "RootPrefix", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.rootPrefix.Location = new System.Drawing.Point(22, 92);
- this.rootPrefix.Name = "rootPrefix";
- this.rootPrefix.Size = new System.Drawing.Size(254, 20);
- this.rootPrefix.TabIndex = 19;
- this.rootPrefix.Text = global::TinyOPDS.Properties.Settings.Default.RootPrefix;
- this.rootPrefix.TextChanged += new System.EventHandler(this.rootPrefix_TextChanged);
- //
- // serverName
- //
- this.serverName.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::TinyOPDS.Properties.Settings.Default, "ServerName", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.serverName.Location = new System.Drawing.Point(20, 35);
- this.serverName.Name = "serverName";
- this.serverName.Size = new System.Drawing.Size(256, 20);
- this.serverName.TabIndex = 12;
- this.serverName.Text = global::TinyOPDS.Properties.Settings.Default.ServerName;
- //
- // tabPage5
- //
- this.tabPage5.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage5.Controls.Add(this.statBannedClients);
- this.tabPage5.Controls.Add(this.label31);
- this.tabPage5.Controls.Add(this.label24);
- this.tabPage5.Controls.Add(this.statWrongLogins);
- this.tabPage5.Controls.Add(this.label30);
- this.tabPage5.Controls.Add(this.statGoodLogins);
- this.tabPage5.Controls.Add(this.label28);
- this.tabPage5.Controls.Add(this.dataGridView1);
- this.tabPage5.Controls.Add(this.wrongAttemptsCount);
- this.tabPage5.Controls.Add(this.banClients);
- this.tabPage5.Controls.Add(this.rememberClients);
- this.tabPage5.Controls.Add(this.useHTTPAuth);
- this.tabPage5.Location = new System.Drawing.Point(4, 34);
- this.tabPage5.Name = "tabPage5";
- this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage5.Size = new System.Drawing.Size(473, 289);
- this.tabPage5.TabIndex = 4;
- this.tabPage5.Text = "Authentication";
- //
- // statBannedClients
- //
- this.statBannedClients.AutoSize = true;
- this.statBannedClients.Location = new System.Drawing.Point(429, 254);
- this.statBannedClients.Name = "statBannedClients";
- this.statBannedClients.Size = new System.Drawing.Size(13, 13);
- this.statBannedClients.TabIndex = 48;
- this.statBannedClients.Text = "0";
- this.statBannedClients.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // label31
- //
- this.label31.AutoSize = true;
- this.label31.Location = new System.Drawing.Point(334, 254);
- this.label31.Name = "label31";
- this.label31.Size = new System.Drawing.Size(80, 13);
- this.label31.TabIndex = 47;
- this.label31.Text = "Banned clients:";
- //
- // label24
- //
- this.label24.AutoSize = true;
- this.label24.Location = new System.Drawing.Point(329, 51);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(75, 13);
- this.label24.TabIndex = 46;
- this.label24.Text = "failed attempts";
- //
- // statWrongLogins
- //
- this.statWrongLogins.AutoSize = true;
- this.statWrongLogins.Location = new System.Drawing.Point(279, 254);
- this.statWrongLogins.Name = "statWrongLogins";
- this.statWrongLogins.Size = new System.Drawing.Size(13, 13);
- this.statWrongLogins.TabIndex = 43;
- this.statWrongLogins.Text = "0";
- this.statWrongLogins.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // label30
- //
- this.label30.AutoSize = true;
- this.label30.Location = new System.Drawing.Point(185, 254);
- this.label30.Name = "label30";
- this.label30.Size = new System.Drawing.Size(68, 13);
- this.label30.TabIndex = 42;
- this.label30.Text = "Failed logins:";
- //
- // statGoodLogins
- //
- this.statGoodLogins.AutoSize = true;
- this.statGoodLogins.Location = new System.Drawing.Point(128, 254);
- this.statGoodLogins.Name = "statGoodLogins";
- this.statGoodLogins.Size = new System.Drawing.Size(13, 13);
- this.statGoodLogins.TabIndex = 41;
- this.statGoodLogins.Text = "0";
- this.statGoodLogins.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // label28
- //
- this.label28.AutoSize = true;
- this.label28.Location = new System.Drawing.Point(23, 254);
- this.label28.Name = "label28";
- this.label28.Size = new System.Drawing.Size(92, 13);
- this.label28.TabIndex = 40;
- this.label28.Text = "Successful logins:";
- //
- // dataGridView1
- //
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.Location = new System.Drawing.Point(26, 83);
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.Size = new System.Drawing.Size(419, 150);
- this.dataGridView1.TabIndex = 1;
- this.dataGridView1.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dataGridView1_CellFormatting);
- //
- // wrongAttemptsCount
- //
- this.wrongAttemptsCount.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::TinyOPDS.Properties.Settings.Default, "WrongAttemptsCount", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.wrongAttemptsCount.Location = new System.Drawing.Point(283, 46);
- this.wrongAttemptsCount.Minimum = new decimal(new int[] {
- 3,
- 0,
- 0,
- 0});
- this.wrongAttemptsCount.Name = "wrongAttemptsCount";
- this.wrongAttemptsCount.Size = new System.Drawing.Size(40, 20);
- this.wrongAttemptsCount.TabIndex = 45;
- this.wrongAttemptsCount.Value = global::TinyOPDS.Properties.Settings.Default.WrongAttemptsCount;
- //
- // banClients
- //
- this.banClients.AutoSize = true;
- this.banClients.Checked = global::TinyOPDS.Properties.Settings.Default.BanClients;
- this.banClients.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "BanClients", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.banClients.Location = new System.Drawing.Point(283, 23);
- this.banClients.Name = "banClients";
- this.banClients.Size = new System.Drawing.Size(102, 17);
- this.banClients.TabIndex = 44;
- this.banClients.Text = "Ban clients after";
- this.banClients.UseVisualStyleBackColor = true;
- this.banClients.CheckedChanged += new System.EventHandler(this.banClients_CheckedChanged);
- //
- // rememberClients
- //
- this.rememberClients.AutoSize = true;
- this.rememberClients.Checked = global::TinyOPDS.Properties.Settings.Default.RememberClients;
- this.rememberClients.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "RememberClients", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.rememberClients.Location = new System.Drawing.Point(26, 51);
- this.rememberClients.Name = "rememberClients";
- this.rememberClients.Size = new System.Drawing.Size(162, 17);
- this.rememberClients.TabIndex = 2;
- this.rememberClients.Text = "Remember authorized clients";
- this.rememberClients.UseVisualStyleBackColor = true;
- //
- // useHTTPAuth
- //
- this.useHTTPAuth.AutoSize = true;
- this.useHTTPAuth.Checked = global::TinyOPDS.Properties.Settings.Default.UseHTTPAuth;
- this.useHTTPAuth.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "UseHTTPAuth", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.useHTTPAuth.Location = new System.Drawing.Point(26, 23);
- this.useHTTPAuth.Name = "useHTTPAuth";
- this.useHTTPAuth.Size = new System.Drawing.Size(175, 17);
- this.useHTTPAuth.TabIndex = 0;
- this.useHTTPAuth.Text = "Use HTTP basic authentication";
- this.useHTTPAuth.UseVisualStyleBackColor = true;
- this.useHTTPAuth.CheckedChanged += new System.EventHandler(this.useHTTPAuth_CheckedChanged);
- //
- // tabPage3
- //
- this.tabPage3.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage3.Controls.Add(this.label32);
- this.tabPage3.Controls.Add(this.updateCombo);
- this.tabPage3.Controls.Add(this.label22);
- this.tabPage3.Controls.Add(this.logVerbosity);
- this.tabPage3.Controls.Add(this.converterLinkLabel);
- this.tabPage3.Controls.Add(this.label11);
- this.tabPage3.Controls.Add(this.langCombo);
- this.tabPage3.Controls.Add(this.label8);
- this.tabPage3.Controls.Add(this.convertorFolder);
- this.tabPage3.Controls.Add(this.convertorPath);
- this.tabPage3.Controls.Add(this.saveLog);
- this.tabPage3.Controls.Add(this.closeToTray);
- this.tabPage3.Controls.Add(this.startMinimized);
- this.tabPage3.Controls.Add(this.startWithWindows);
- this.tabPage3.Location = new System.Drawing.Point(4, 34);
- this.tabPage3.Name = "tabPage3";
- this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage3.Size = new System.Drawing.Size(473, 289);
- this.tabPage3.TabIndex = 2;
- this.tabPage3.Text = "Miscellaneous";
- //
- // label32
- //
- this.label32.AutoSize = true;
- this.label32.Location = new System.Drawing.Point(298, 143);
- this.label32.Name = "label32";
- this.label32.Size = new System.Drawing.Size(92, 13);
- this.label32.TabIndex = 38;
- this.label32.Text = "Check for update:";
- //
- // updateCombo
- //
- this.updateCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.updateCombo.FormattingEnabled = true;
- this.updateCombo.Items.AddRange(new object[] {
- "Never",
- "Once a week",
- "Once a month"});
- this.updateCombo.Location = new System.Drawing.Point(299, 166);
- this.updateCombo.Name = "updateCombo";
- this.updateCombo.Size = new System.Drawing.Size(127, 21);
- this.updateCombo.TabIndex = 37;
- this.updateCombo.SelectedIndexChanged += new System.EventHandler(this.updateCombo_SelectedIndexChanged);
- //
- // label22
- //
- this.label22.AutoSize = true;
- this.label22.Location = new System.Drawing.Point(13, 195);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(95, 13);
- this.label22.TabIndex = 36;
- this.label22.Text = "Log verbosity level";
- //
- // logVerbosity
- //
- this.logVerbosity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.logVerbosity.FormattingEnabled = true;
- this.logVerbosity.Items.AddRange(new object[] {
- "Info, warnings and errors",
- "Warnings and errors",
- "Errors only"});
- this.logVerbosity.Location = new System.Drawing.Point(14, 218);
- this.logVerbosity.Name = "logVerbosity";
- this.logVerbosity.Size = new System.Drawing.Size(246, 21);
- this.logVerbosity.TabIndex = 35;
- this.logVerbosity.SelectedIndexChanged += new System.EventHandler(this.logVerbosity_SelectedIndexChanged);
- //
- // converterLinkLabel
- //
- this.converterLinkLabel.AutoSize = true;
- this.converterLinkLabel.Location = new System.Drawing.Point(12, 55);
- this.converterLinkLabel.Name = "converterLinkLabel";
- this.converterLinkLabel.Size = new System.Drawing.Size(268, 13);
- this.converterLinkLabel.TabIndex = 34;
- this.converterLinkLabel.TabStop = true;
- this.converterLinkLabel.Text = "Click here to download latest version of ePub converter";
- this.converterLinkLabel.Visible = false;
- this.converterLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(296, 82);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(130, 13);
- this.label11.TabIndex = 32;
- this.label11.Text = "GUI and OPDS language:";
- //
- // langCombo
- //
- this.langCombo.DisplayMember = "Value";
- this.langCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.langCombo.FormattingEnabled = true;
- this.langCombo.Location = new System.Drawing.Point(299, 107);
- this.langCombo.Name = "langCombo";
- this.langCombo.Size = new System.Drawing.Size(127, 21);
- this.langCombo.TabIndex = 31;
- this.langCombo.ValueMember = "Key";
- this.langCombo.SelectedValueChanged += new System.EventHandler(this.langCombo_SelectedValueChanged);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(8, 12);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(138, 13);
- this.label8.TabIndex = 30;
- this.label8.Text = "Path to the ePub converter:";
- //
- // convertorFolder
- //
- this.convertorFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.convertorFolder.Image = global::TinyOPDS.Properties.Resources.folder;
- this.convertorFolder.Location = new System.Drawing.Point(430, 26);
- this.convertorFolder.Name = "convertorFolder";
- this.convertorFolder.Size = new System.Drawing.Size(29, 23);
- this.convertorFolder.TabIndex = 29;
- this.convertorFolder.UseVisualStyleBackColor = true;
- this.convertorFolder.Click += new System.EventHandler(this.folderButton_Click);
- //
- // convertorPath
- //
- this.convertorPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.convertorPath.Location = new System.Drawing.Point(11, 28);
- this.convertorPath.Name = "convertorPath";
- this.convertorPath.Size = new System.Drawing.Size(415, 20);
- this.convertorPath.TabIndex = 28;
- this.convertorPath.Validated += new System.EventHandler(this.convertorPath_Validated);
- //
- // saveLog
- //
- this.saveLog.AutoSize = true;
- this.saveLog.Checked = global::TinyOPDS.Properties.Settings.Default.SaveLogToDisk;
- this.saveLog.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "SaveLogToDisk", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.saveLog.Location = new System.Drawing.Point(14, 166);
- this.saveLog.Name = "saveLog";
- this.saveLog.Size = new System.Drawing.Size(96, 17);
- this.saveLog.TabIndex = 33;
- this.saveLog.Text = "Save log to file";
- this.saveLog.UseVisualStyleBackColor = true;
- this.saveLog.CheckedChanged += new System.EventHandler(this.saveLog_CheckedChanged);
- //
- // closeToTray
- //
- this.closeToTray.AutoSize = true;
- this.closeToTray.Checked = global::TinyOPDS.Properties.Settings.Default.CloseToTray;
- this.closeToTray.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "CloseToTray", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.closeToTray.Location = new System.Drawing.Point(14, 138);
- this.closeToTray.Name = "closeToTray";
- this.closeToTray.Size = new System.Drawing.Size(138, 17);
- this.closeToTray.TabIndex = 2;
- this.closeToTray.Text = "Close or minimize to tray";
- this.closeToTray.UseVisualStyleBackColor = true;
- this.closeToTray.CheckedChanged += new System.EventHandler(this.closeToTray_CheckedChanged);
- //
- // startMinimized
- //
- this.startMinimized.AutoSize = true;
- this.startMinimized.Checked = global::TinyOPDS.Properties.Settings.Default.StartMinimized;
- this.startMinimized.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "StartMinimized", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.startMinimized.Location = new System.Drawing.Point(14, 110);
- this.startMinimized.Name = "startMinimized";
- this.startMinimized.Size = new System.Drawing.Size(96, 17);
- this.startMinimized.TabIndex = 1;
- this.startMinimized.Text = "Start minimized";
- this.startMinimized.UseVisualStyleBackColor = true;
- //
- // startWithWindows
- //
- this.startWithWindows.AutoSize = true;
- this.startWithWindows.Checked = global::TinyOPDS.Properties.Settings.Default.StartWithWindows;
- this.startWithWindows.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::TinyOPDS.Properties.Settings.Default, "StartWithWindows", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
- this.startWithWindows.Location = new System.Drawing.Point(14, 82);
- this.startWithWindows.Name = "startWithWindows";
- this.startWithWindows.Size = new System.Drawing.Size(117, 17);
- this.startWithWindows.TabIndex = 0;
- this.startWithWindows.Text = "Start with Windows";
- this.startWithWindows.UseVisualStyleBackColor = true;
- this.startWithWindows.CheckedChanged += new System.EventHandler(this.startWithWindows_CheckedChanged);
- //
- // tabPage4
- //
- this.tabPage4.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage4.Controls.Add(this.linkLabel5);
- this.tabPage4.Controls.Add(this.linkLabel4);
- this.tabPage4.Controls.Add(this.linkLabel3);
- this.tabPage4.Controls.Add(this.label20);
- this.tabPage4.Controls.Add(this.label19);
- this.tabPage4.Controls.Add(this.linkLabel2);
- this.tabPage4.Controls.Add(this.label18);
- this.tabPage4.Controls.Add(this.linkLabel1);
- this.tabPage4.Controls.Add(this.label17);
- this.tabPage4.Controls.Add(this.appVersion);
- this.tabPage4.Controls.Add(this.appName);
- this.tabPage4.Controls.Add(this.pictureBox1);
- this.tabPage4.Controls.Add(this.donateButton);
- this.tabPage4.Location = new System.Drawing.Point(4, 34);
- this.tabPage4.Name = "tabPage4";
- this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage4.Size = new System.Drawing.Size(473, 289);
- this.tabPage4.TabIndex = 3;
- this.tabPage4.Text = "About program";
- //
- // linkLabel5
- //
- this.linkLabel5.AutoSize = true;
- this.linkLabel5.Location = new System.Drawing.Point(195, 212);
- this.linkLabel5.Name = "linkLabel5";
- this.linkLabel5.Size = new System.Drawing.Size(97, 13);
- this.linkLabel5.TabIndex = 12;
- this.linkLabel5.TabStop = true;
- this.linkLabel5.Text = "ePubReader library";
- this.linkLabel5.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
- //
- // linkLabel4
- //
- this.linkLabel4.AutoSize = true;
- this.linkLabel4.Location = new System.Drawing.Point(195, 235);
- this.linkLabel4.Name = "linkLabel4";
- this.linkLabel4.Size = new System.Drawing.Size(86, 13);
- this.linkLabel4.TabIndex = 11;
- this.linkLabel4.TabStop = true;
- this.linkLabel4.Text = "DotNetZip library";
- this.linkLabel4.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
- //
- // linkLabel3
- //
- this.linkLabel3.AutoSize = true;
- this.linkLabel3.Location = new System.Drawing.Point(193, 190);
- this.linkLabel3.Name = "linkLabel3";
- this.linkLabel3.Size = new System.Drawing.Size(267, 13);
- this.linkLabel3.TabIndex = 10;
- this.linkLabel3.TabStop = true;
- this.linkLabel3.Text = "Lord KiRon, author of fb2librarynet library and converter";
- this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
- //
- // label20
- //
- this.label20.Location = new System.Drawing.Point(9, 190);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(161, 13);
- this.label20.TabIndex = 9;
- this.label20.Text = "Special thanks:";
- this.label20.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // label19
- //
- this.label19.AutoSize = true;
- this.label19.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.label19.Location = new System.Drawing.Point(192, 89);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(220, 20);
- this.label19.TabIndex = 8;
- this.label19.Text = "Copyright © 2013, SeNSSoFT";
- //
- // linkLabel2
- //
- this.linkLabel2.AutoSize = true;
- this.linkLabel2.Location = new System.Drawing.Point(193, 167);
- this.linkLabel2.Name = "linkLabel2";
- this.linkLabel2.Size = new System.Drawing.Size(184, 13);
- this.linkLabel2.TabIndex = 7;
- this.linkLabel2.TabStop = true;
- this.linkLabel2.Text = "http://tinyopds.codeplex.com/license";
- this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel_LinkClicked);
- //
- // label18
- //
- this.label18.Location = new System.Drawing.Point(11, 167);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(159, 13);
- this.label18.TabIndex = 6;
- this.label18.Text = "Project license:";
- this.label18.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // linkLabel1
- //
- this.linkLabel1.AutoSize = true;
- this.linkLabel1.Location = new System.Drawing.Point(193, 144);
- this.linkLabel1.Name = "linkLabel1";
- this.linkLabel1.Size = new System.Drawing.Size(151, 13);
- this.linkLabel1.TabIndex = 5;
- this.linkLabel1.TabStop = true;
- this.linkLabel1.Text = "http://tinyopds.codeplex.com/";
- this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel_LinkClicked);
- //
- // label17
- //
- this.label17.Location = new System.Drawing.Point(8, 144);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(162, 13);
- this.label17.TabIndex = 4;
- this.label17.Text = "Project home page:";
- this.label17.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // appVersion
- //
- this.appVersion.AutoSize = true;
- this.appVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.appVersion.Location = new System.Drawing.Point(262, 58);
- this.appVersion.Name = "appVersion";
- this.appVersion.Size = new System.Drawing.Size(85, 20);
- this.appVersion.TabIndex = 3;
- this.appVersion.Text = "version 1.0";
- //
- // appName
- //
- this.appName.AutoSize = true;
- this.appName.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.appName.Location = new System.Drawing.Point(190, 14);
- this.appName.Name = "appName";
- this.appName.Size = new System.Drawing.Size(226, 31);
- this.appName.TabIndex = 2;
- this.appName.Text = "TinyOPDS server";
- //
- // pictureBox1
- //
- this.pictureBox1.ErrorImage = null;
- this.pictureBox1.Image = global::TinyOPDS.Properties.Resources.TinyOPDS;
- this.pictureBox1.Location = new System.Drawing.Point(8, 9);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(103, 103);
- this.pictureBox1.TabIndex = 1;
- this.pictureBox1.TabStop = false;
- //
- // donateButton
- //
- this.donateButton.Image = global::TinyOPDS.Properties.Resources.donate;
- this.donateButton.Location = new System.Drawing.Point(9, 223);
- this.donateButton.Name = "donateButton";
- this.donateButton.Size = new System.Drawing.Size(157, 56);
- this.donateButton.TabIndex = 0;
- this.donateButton.UseVisualStyleBackColor = true;
- this.donateButton.Click += new System.EventHandler(this.donateButton_Click);
- //
- // contextMenuStrip
- //
- this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.windowMenuItem,
- this.serverMenuItem,
- this.toolStripMenuItem1,
- this.exitMenuItem});
- this.contextMenuStrip.Name = "contextMenuStrip1";
- this.contextMenuStrip.Size = new System.Drawing.Size(145, 76);
- //
- // windowMenuItem
- //
- this.windowMenuItem.Name = "windowMenuItem";
- this.windowMenuItem.Size = new System.Drawing.Size(144, 22);
- this.windowMenuItem.Text = "Hide window";
- this.windowMenuItem.Click += new System.EventHandler(this.windowMenuItem_Click);
- //
- // serverMenuItem
- //
- this.serverMenuItem.Name = "serverMenuItem";
- this.serverMenuItem.Size = new System.Drawing.Size(144, 22);
- this.serverMenuItem.Text = "Stop server";
- this.serverMenuItem.Click += new System.EventHandler(this.serverButton_Click);
- //
- // toolStripMenuItem1
- //
- this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size(141, 6);
- //
- // exitMenuItem
- //
- this.exitMenuItem.Name = "exitMenuItem";
- this.exitMenuItem.Size = new System.Drawing.Size(144, 22);
- this.exitMenuItem.Text = "Exit";
- this.exitMenuItem.Click += new System.EventHandler(this.exitMenuItem_Click);
- //
- // MainForm
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(474, 322);
- this.Controls.Add(this.tabControl1);
- this.DoubleBuffered = true;
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.Name = "MainForm";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "TinyOPDS server";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
- this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
- this.Resize += new System.EventHandler(this.MainForm_Resize);
- this.tabControl1.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- this.tabPage1.PerformLayout();
- this.tabPage2.ResumeLayout(false);
- this.tabPage2.PerformLayout();
- this.tabPage5.ResumeLayout(false);
- this.tabPage5.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.wrongAttemptsCount)).EndInit();
- this.tabPage3.ResumeLayout(false);
- this.tabPage3.PerformLayout();
- this.tabPage4.ResumeLayout(false);
- this.tabPage4.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- this.contextMenuStrip.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.TabControl tabControl1;
- private System.Windows.Forms.TabPage tabPage1;
- private System.Windows.Forms.Button folderButton;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button scannerButton;
- private System.Windows.Forms.TextBox libraryPath;
- private System.Windows.Forms.TabPage tabPage2;
- private System.Windows.Forms.TextBox serverPort;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Button serverButton;
- private System.Windows.Forms.TabPage tabPage3;
- private System.Windows.Forms.Label invalidBooks;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label skippedBooks;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label booksFound;
- private System.Windows.Forms.Label booksInDB;
- private System.Windows.Forms.Label label15;
- private System.Windows.Forms.Label status;
- private System.Windows.Forms.Label label14;
- private System.Windows.Forms.Label rate;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.Label elapsedTime;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.Label startTime;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label booksProcessed;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.TextBox serverName;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.CheckBox closeToTray;
- private System.Windows.Forms.CheckBox startMinimized;
- private System.Windows.Forms.CheckBox startWithWindows;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Button convertorFolder;
- private System.Windows.Forms.TextBox convertorPath;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.ComboBox langCombo;
- private System.Windows.Forms.CheckBox openPort;
- private System.Windows.Forms.Label extIPlabel;
- private System.Windows.Forms.Label intIPlabel;
- private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
- private System.Windows.Forms.ToolStripMenuItem windowMenuItem;
- private System.Windows.Forms.ToolStripMenuItem serverMenuItem;
- private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
- private System.Windows.Forms.ToolStripMenuItem exitMenuItem;
- private System.Windows.Forms.CheckBox saveLog;
- private System.Windows.Forms.Label duplicates;
- private System.Windows.Forms.Label label16;
- private System.Windows.Forms.TextBox rootPrefix;
- private System.Windows.Forms.Label label13;
- private System.Windows.Forms.CheckBox useWatcher;
- private System.Windows.Forms.TabPage tabPage4;
- private System.Windows.Forms.CheckBox useUPnP;
- private System.Windows.Forms.LinkLabel converterLinkLabel;
- private System.Windows.Forms.Button donateButton;
- private System.Windows.Forms.PictureBox pictureBox1;
- private System.Windows.Forms.Label label19;
- private System.Windows.Forms.LinkLabel linkLabel2;
- private System.Windows.Forms.Label label18;
- private System.Windows.Forms.LinkLabel linkLabel1;
- private System.Windows.Forms.Label label17;
- private System.Windows.Forms.Label appVersion;
- private System.Windows.Forms.Label appName;
- private System.Windows.Forms.Label label20;
- private System.Windows.Forms.LinkLabel intLink;
- private System.Windows.Forms.LinkLabel extLink;
- private System.Windows.Forms.LinkLabel linkLabel5;
- private System.Windows.Forms.LinkLabel linkLabel4;
- private System.Windows.Forms.LinkLabel linkLabel3;
- private System.Windows.Forms.TextBox databaseFileName;
- private System.Windows.Forms.Label label21;
- private System.Windows.Forms.TabPage tabPage5;
- private System.Windows.Forms.CheckBox useHTTPAuth;
- private System.Windows.Forms.DataGridView dataGridView1;
- private System.Windows.Forms.CheckBox rememberClients;
- private System.Windows.Forms.Label label22;
- private System.Windows.Forms.ComboBox logVerbosity;
- private System.Windows.Forms.Label statImages;
- private System.Windows.Forms.Label label27;
- private System.Windows.Forms.Label statBooks;
- private System.Windows.Forms.Label label25;
- private System.Windows.Forms.Label statRequests;
- private System.Windows.Forms.Label label23;
- private System.Windows.Forms.Label statUniqueClients;
- private System.Windows.Forms.Label label26;
- private System.Windows.Forms.Label statGoodLogins;
- private System.Windows.Forms.Label label28;
- private System.Windows.Forms.Label statWrongLogins;
- private System.Windows.Forms.Label label30;
- private System.Windows.Forms.Label label24;
- private System.Windows.Forms.NumericUpDown wrongAttemptsCount;
- private System.Windows.Forms.CheckBox banClients;
- private System.Windows.Forms.Label statBannedClients;
- private System.Windows.Forms.Label label31;
- private System.Windows.Forms.Label label32;
- private System.Windows.Forms.ComboBox updateCombo;
- private System.Windows.Forms.ComboBox interfaceCombo;
- private System.Windows.Forms.Label label29;
- private System.Windows.Forms.CheckBox useAbsoluteUri;
- }
-}
-
diff --git a/releases/1.1/MainForm.cs b/releases/1.1/MainForm.cs
deleted file mode 100644
index eda26ff..0000000
--- a/releases/1.1/MainForm.cs
+++ /dev/null
@@ -1,824 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * TinyOPDS main UI thread
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using System.Xml.Linq;
-using System.Threading;
-using System.Net;
-
-using TinyOPDS.Data;
-using TinyOPDS.Scanner;
-using TinyOPDS.OPDS;
-using TinyOPDS.Server;
-using UPnP;
-
-namespace TinyOPDS
-{
- public partial class MainForm : Form
- {
- OPDSServer _server;
- Thread _serverThread;
- FileScanner _scanner = new FileScanner();
- Watcher _watcher;
- DateTime _scanStartTime;
- UPnPController _upnpController = new UPnPController();
- NotifyIcon _notifyIcon = new NotifyIcon();
- BindingSource bs = new BindingSource();
- System.Windows.Forms.Timer _updateChecker = new System.Windows.Forms.Timer();
- string _updateUrl = string.Empty;
-
- #region Statistical information
- int _fb2Count, _epubCount, _skippedFiles, _invalidFiles, _duplicates;
- #endregion
-
- private const string urlTemplate = "http://{0}:{1}/{2}";
-
- #region Initialization and startup
-
- public MainForm()
- {
- Log.SaveToFile = Properties.Settings.Default.SaveLogToDisk;
-
- AppDomain currentDomain = AppDomain.CurrentDomain;
- currentDomain.UnhandledException += currentDomain_UnhandledException;
-
- InitializeComponent();
-
- // Assign combo data source to the list of all available interfaces
- interfaceCombo.DataSource = UPnPController.LocalInterfaces;
- interfaceCombo.DataBindings.Add(new Binding("SelectedIndex", Properties.Settings.Default, "LocalInterfaceIndex", false, DataSourceUpdateMode.OnPropertyChanged));
-
- logVerbosity.DataBindings.Add(new Binding("SelectedIndex", Properties.Settings.Default, "LogLevel", false, DataSourceUpdateMode.OnPropertyChanged));
- updateCombo.DataBindings.Add(new Binding("SelectedIndex", Properties.Settings.Default, "UpdatesCheck", false, DataSourceUpdateMode.OnPropertyChanged));
-
- this.PerformLayout();
-
- // Manually assign icons from resources (fix for Mono)
- this.Icon = Properties.Resources.trayIcon;
- _notifyIcon.ContextMenuStrip = this.contextMenuStrip;
- _notifyIcon.Icon = Properties.Resources.trayIcon;
- _notifyIcon.MouseClick += notifyIcon1_MouseClick;
- _notifyIcon.BalloonTipClicked += _notifyIcon_BalloonTipClicked;
- _notifyIcon.BalloonTipClosed += _notifyIcon_BalloonTipClosed;
-
- // Init localization service
- Localizer.Init();
- Localizer.AddMenu(contextMenuStrip);
- langCombo.DataSource = Localizer.Languages.ToArray();
-
- // Load application settings
- LoadSettings();
-
- // Initialize update checker timer
- _updateChecker.Interval = 1000 * 30;
- _updateChecker.Tick += _updateChecker_Tick;
-
- // Setup credentials grid
- bs.AddingNew += bs_AddingNew;
- bs.AllowNew = true;
- bs.DataSource = HttpProcessor.Credentials;
- dataGridView1.DataSource = bs;
- bs.CurrentItemChanged += bs_CurrentItemChanged;
- foreach (DataGridViewColumn col in dataGridView1.Columns) col.Width = 180;
-
- Library.LibraryPath = Properties.Settings.Default.LibraryPath;
- Library.LibraryLoaded += (_, __) =>
- {
- UpdateInfo();
- _watcher.DirectoryToWatch = Library.LibraryPath;
- _watcher.IsEnabled = Properties.Settings.Default.WatchLibrary;
- };
-
- // Create file watcher
- _watcher = new Watcher(Library.LibraryPath);
- _watcher.OnBookAdded += (object sender, BookAddedEventArgs e) =>
- {
- if (e.BookType == BookType.FB2) _fb2Count++; else _epubCount++;
- UpdateInfo();
- Log.WriteLine(LogLevel.Info, "Added: \"{0}\"", e.BookPath);
- };
- _watcher.OnInvalidBook += (_, __) =>
- {
- _invalidFiles++;
- UpdateInfo();
- };
- _watcher.OnFileSkipped += (object _sender, FileSkippedEventArgs _e) =>
- {
- _skippedFiles = _e.Count;
- UpdateInfo();
- };
-
- _watcher.OnBookDeleted += (object sender, BookDeletedEventArgs e) =>
- {
- UpdateInfo();
- Log.WriteLine(LogLevel.Info, "Deleted: \"{0}\"", e.BookPath);
- };
- _watcher.IsEnabled = false;
-
- intLink.Text = string.Format(urlTemplate, _upnpController.LocalIP.ToString(), Properties.Settings.Default.ServerPort, Properties.Settings.Default.RootPrefix);
- _upnpController.DiscoverCompleted += _upnpController_DiscoverCompleted;
- _upnpController.DiscoverAsync(Properties.Settings.Default.UseUPnP);
-
- Log.WriteLine("TinyOPDS version {0}.{1} started", Utils.Version.Major, Utils.Version.Minor);
-
- // Start OPDS server
- StartHttpServer();
-
- // Set server statistics handler
- HttpServer.ServerStatistics.StatisticsUpdated += (_, __) =>
- {
- this.BeginInvoke((MethodInvoker)delegate
- {
- statRequests.Text = HttpServer.ServerStatistics.GetRequests.ToString();
- statBooks.Text = HttpServer.ServerStatistics.BooksSent.ToString();
- statImages.Text = HttpServer.ServerStatistics.ImagesSent.ToString();
- statUniqueClients.Text = HttpServer.ServerStatistics.UniqueClientsCount.ToString();
- statGoodLogins.Text = HttpServer.ServerStatistics.SuccessfulLoginAttempts.ToString();
- statWrongLogins.Text = HttpServer.ServerStatistics.WrongLoginAttempts.ToString();
- statBannedClients.Text = HttpServer.ServerStatistics.BannedClientsCount.ToString();
- });
- };
-
- _scanStartTime = DateTime.Now;
- _notifyIcon.Visible = Properties.Settings.Default.CloseToTray;
- }
-
- ///
- /// Process unhandled exceptions
- ///
- ///
- ///
- void currentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs args)
- {
- Exception e = (Exception) args.ExceptionObject;
- Log.WriteLine(LogLevel.Error, "{2}: {0}\nStack trace: {1}", e.Message, e.StackTrace, args.IsTerminating ? "Fatal exception" : "Unhandled exception");
- }
-
- void _upnpController_DiscoverCompleted(object sender, EventArgs e)
- {
- if (!IsDisposed && _upnpController != null)
- {
- this.BeginInvoke((MethodInvoker)delegate
- {
- extLink.Text = string.Format(urlTemplate, _upnpController.ExternalIP.ToString(), Properties.Settings.Default.ServerPort, Properties.Settings.Default.RootPrefix);
- if (_upnpController.UPnPReady)
- {
- openPort.Enabled = true;
- if (Properties.Settings.Default.OpenNATPort) openPort_CheckedChanged(this, null);
- }
- });
- }
- }
-
- #endregion
-
- #region Application settings
-
- private void LoadSettings()
- {
- // Setup link labels
- converterLinkLabel.Links.Add(0, converterLinkLabel.Text.Length, "http://fb2epub.net/files/Fb2ePubSetup_1_1_3.zip");
- linkLabel3.Links.Add(0, linkLabel3.Text.Length, "https://code.google.com/p/fb2librarynet/");
- linkLabel5.Links.Add(0, linkLabel5.Text.Length, "http://epubreader.codeplex.com/");
- linkLabel4.Links.Add(0, linkLabel4.Text.Length, "http://dotnetzip.codeplex.com/");
- // Setup settings controls
- if (!string.IsNullOrEmpty(Properties.Settings.Default.LibraryPath))
- {
- databaseFileName.Text = Utils.CreateGuid(Utils.IsoOidNamespace, Properties.Settings.Default.LibraryPath).ToString() + ".db";
- }
- if (Utils.IsLinux) startWithWindows.Enabled = false;
- if (string.IsNullOrEmpty(Properties.Settings.Default.ConvertorPath))
- {
- if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ProgramFiles")))
- {
- if (File.Exists(Path.Combine(Environment.GetEnvironmentVariable("ProgramFiles"), "FB2ePub\\Fb2ePub.exe")))
- {
- convertorPath.Text = Properties.Settings.Default.ConvertorPath = Path.Combine(Environment.GetEnvironmentVariable("ProgramFiles"), "FB2ePub");
- }
- }
- }
- else convertorPath.Text = Properties.Settings.Default.ConvertorPath;
- converterLinkLabel.Visible = string.IsNullOrEmpty(convertorPath.Text);
-
- // We should update all invisible controls
- interfaceCombo.SelectedIndex = Math.Min(UPnPController.LocalInterfaces.Count-1, Properties.Settings.Default.LocalInterfaceIndex);
- logVerbosity.SelectedIndex = Math.Min(2, Properties.Settings.Default.LogLevel);
- updateCombo.SelectedIndex = Math.Min(2, Properties.Settings.Default.UpdatesCheck);
- langCombo.SelectedValue = Properties.Settings.Default.Language;
-
- openPort.Checked = Properties.Settings.Default.UseUPnP ? Properties.Settings.Default.OpenNATPort : false;
- banClients.Enabled = rememberClients.Enabled = dataGridView1.Enabled = Properties.Settings.Default.UseHTTPAuth;
- wrongAttemptsCount.Enabled = banClients.Checked && useHTTPAuth.Checked;
-
- _notifyIcon.Visible = Properties.Settings.Default.CloseToTray;
- if (Properties.Settings.Default.UpdatesCheck > 0) _updateChecker.Start();
-
- // Load saved credentials
- try
- {
- HttpProcessor.Credentials.Clear();
- string[] pairs = Crypt.DecryptStringAES(Properties.Settings.Default.Credentials, urlTemplate).Split(';');
- foreach (string pair in pairs)
- {
- string[] cred = pair.Split(':');
- if (cred.Length == 2) HttpProcessor.Credentials.Add( new Credential(cred[0], cred[1]));
- }
- }
- catch { }
- }
-
- private void SaveSettings()
- {
- Properties.Settings.Default.Language = langCombo.SelectedValue as string;
- Properties.Settings.Default.Save();
- }
-
- #endregion
-
- #region Credentials handling
-
- private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
- {
- if (dataGridView1.Columns[e.ColumnIndex].Name == "Password" && e.Value != null)
- {
- dataGridView1.Rows[e.RowIndex].Tag = e.Value;
- e.Value = new String('*', e.Value.ToString().Length);
- }
- }
-
- void bs_AddingNew(object sender, AddingNewEventArgs e)
- {
- e.NewObject = new Credential("", "");
- }
-
- void bs_CurrentItemChanged(object sender, EventArgs e)
- {
- string s = string.Empty;
- foreach (Credential cred in HttpProcessor.Credentials) s += cred.User + ":" + cred.Password + ";";
- try
- {
- Properties.Settings.Default.Credentials = string.IsNullOrEmpty(s) ? string.Empty : Crypt.EncryptStringAES(s, urlTemplate);
- }
- finally
- {
- Properties.Settings.Default.Save();
- }
- }
-
- #endregion
-
- #region Library scanning support
-
- private void libraryPath_Validated(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(Properties.Settings.Default.LibraryPath) &&
- !Library.LibraryPath.Equals(Properties.Settings.Default.LibraryPath) &&
- Directory.Exists(Properties.Settings.Default.LibraryPath))
- {
- if (Library.IsChanged) Library.Save();
- Library.LibraryPath = Properties.Settings.Default.LibraryPath;
- booksInDB.Text = string.Format("{0} fb2: {1} epub: {2}", 0, 0, 0);
- databaseFileName.Text = Utils.CreateGuid(Utils.IsoOidNamespace, Properties.Settings.Default.LibraryPath).ToString() + ".db";
- _watcher.IsEnabled = false;
- // Reload library
- Library.LoadAsync();
- }
- else libraryPath.Undo();
- }
-
- private void folderButton_Click(object sender, EventArgs e)
- {
- using (FolderBrowserDialog dialog = new FolderBrowserDialog())
- {
- dialog.SelectedPath = (sender as Button == folderButton) ? libraryPath.Text : convertorPath.Text;
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- if (sender as Button == folderButton)
- {
- libraryPath.Text = dialog.SelectedPath;
- libraryPath_Validated(sender, e);
- }
- else
- {
- convertorPath.Text = dialog.SelectedPath;
- convertorPath_Validated(sender, e);
- }
- }
- }
- }
-
- private void scannerButton_Click(object sender, EventArgs e)
- {
- if (_scanner.Status != FileScannerStatus.SCANNING)
- {
- _scanner.OnBookFound += scanner_OnBookFound;
- _scanner.OnInvalidBook += (_, __) => { _invalidFiles++; };
- _scanner.OnFileSkipped += (object _sender, FileSkippedEventArgs _e) =>
- {
- _skippedFiles = _e.Count;
- UpdateInfo();
- };
- _scanner.OnScanCompleted += (_, __) =>
- {
- Library.Save();
- UpdateInfo(true);
-
- Log.WriteLine("Directory scanner completed");
- };
- _fb2Count = _epubCount = _skippedFiles = _invalidFiles = _duplicates = 0;
- _scanStartTime = DateTime.Now;
- startTime.Text = _scanStartTime.ToString(@"hh\:mm\:ss");
- _scanner.Start(libraryPath.Text);
- scannerButton.Text = Localizer.Text("Stop scanning");
-
- Log.WriteLine("Directory scanner started");
- }
- else
- {
- _scanner.Stop();
- Library.Save();
- UpdateInfo(true);
- scannerButton.Text = Localizer.Text("Start scanning");
-
- Log.WriteLine("Directory scanner stopped");
- }
- }
-
- void scanner_OnBookFound(object sender, BookFoundEventArgs e)
- {
- if (Library.Add(e.Book))
- {
- if (e.Book.BookType == BookType.FB2) _fb2Count++; else _epubCount++;
- }
- else _duplicates++;
- if (Library.Count % 500 == 0) Library.Save();
- UpdateInfo();
- }
-
- private void UpdateInfo(bool IsScanFinished = false)
- {
- if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker)delegate { internalUpdateInfo(IsScanFinished); }); }
- else { internalUpdateInfo(IsScanFinished); }
- }
-
- private void internalUpdateInfo(bool IsScanFinished)
- {
- booksInDB.Text = string.Format("{0} fb2: {1} epub: {2}", Library.Count, Library.FB2Count, Library.EPUBCount);
- booksFound.Text = string.Format("fb2: {0} epub: {1}", _fb2Count, _epubCount);
- skippedBooks.Text = _skippedFiles.ToString();
- invalidBooks.Text = _invalidFiles.ToString();
- duplicates.Text = _duplicates.ToString();
- int totalBooksProcessed = _fb2Count + _epubCount + _skippedFiles + _invalidFiles + _duplicates;
- booksProcessed.Text = totalBooksProcessed.ToString();
-
- TimeSpan dt = DateTime.Now.Subtract(_scanStartTime);
- elapsedTime.Text = dt.ToString(@"hh\:mm\:ss");
- rate.Text = (dt.TotalSeconds) > 0 ? string.Format("{0:0.} books/min", totalBooksProcessed / dt.TotalSeconds * 60) : "---";
- if (scannerButton.Enabled)
- {
- status.Text = IsScanFinished ? Localizer.Text("FINISHED") : (_scanner.Status == FileScannerStatus.SCANNING ? Localizer.Text("SCANNING") : Localizer.Text("STOPPED"));
- scannerButton.Text = (_scanner.Status == FileScannerStatus.SCANNING) ? Localizer.Text("Stop scanning") : Localizer.Text("Start scanning");
- }
- }
-
- #endregion
-
- #region HTTP (OPDS) server & network support
-
- private void serverButton_Click(object sender, EventArgs e)
- {
- if (_server == null) StartHttpServer(); else StopHttpServer();
- }
-
- private void StartHttpServer()
- {
- // Create and start HTTP server
- HttpProcessor.AuthorizedClients.Clear();
- HttpProcessor.BannedClients.Clear();
- _server = new OPDSServer(_upnpController.LocalIP, int.Parse(Properties.Settings.Default.ServerPort));
-
- _serverThread = new Thread(new ThreadStart(_server.Listen));
- _serverThread.Priority = ThreadPriority.BelowNormal;
- _serverThread.Start();
- _server.ServerReady.WaitOne(TimeSpan.FromMilliseconds(500));
- if (!_server.IsActive)
- {
- if (_server.ServerException != null)
- {
- if (_server.ServerException is System.Net.Sockets.SocketException)
- {
- MessageBox.Show(string.Format(Localizer.Text("Probably, port {0} is already in use. Please try different port value."), Properties.Settings.Default.ServerPort));
- }
- else
- {
- MessageBox.Show(_server.ServerException.Message);
- }
- _server.StopServer();
- _serverThread = null;
- _server = null;
- }
- }
- else
- {
- serverButton.Text = serverMenuItem.Text = Localizer.Text("Stop server");
- Log.WriteLine("HTTP server started");
- }
- }
-
- private void StopHttpServer()
- {
- if (_server != null)
- {
- _server.StopServer();
- _serverThread = null;
- _server = null;
- Log.WriteLine("HTTP server stopped");
- }
- serverButton.Text = serverMenuItem.Text = Localizer.Text("Start server");
- }
-
- private void RestartHttpServer()
- {
- StopHttpServer();
- StartHttpServer();
- }
-
- private void useUPnP_CheckStateChanged(object sender, EventArgs e)
- {
- if (useUPnP.Checked)
- {
- // Re-detect IP addresses using UPnP
- _upnpController.DiscoverAsync(true);
- }
- else
- {
- openPort.Enabled = openPort.Checked = false;
- }
- }
-
- private void openPort_CheckedChanged(object sender, EventArgs e)
- {
- if (_upnpController != null && _upnpController.UPnPReady)
- {
- int port = int.Parse(Properties.Settings.Default.ServerPort);
- if (openPort.Checked)
- {
- _upnpController.ForwardPort(port, System.Net.Sockets.ProtocolType.Tcp, "TinyOPDS server");
-
- Log.WriteLine("Port {0} forwarded by UPnP", port);
- }
- else
- {
- _upnpController.DeleteForwardingRule(port, System.Net.Sockets.ProtocolType.Tcp);
-
- Log.WriteLine("Port {0} closed", port);
- }
- }
- }
-
- private void interfaceCombo_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (_upnpController != null && _upnpController.InterfaceIndex != interfaceCombo.SelectedIndex)
- {
- _upnpController.InterfaceIndex = interfaceCombo.SelectedIndex;
- intLink.Text = string.Format(urlTemplate, _upnpController.LocalIP.ToString(), Properties.Settings.Default.ServerPort, Properties.Settings.Default.RootPrefix);
- if (Properties.Settings.Default.UseUPnP && openPort.Checked)
- {
- int port = int.Parse(Properties.Settings.Default.ServerPort);
- _upnpController.DeleteForwardingRule(port, System.Net.Sockets.ProtocolType.Tcp);
- _upnpController.ForwardPort(port, System.Net.Sockets.ProtocolType.Tcp, "TinyOPDS server");
- }
- RestartHttpServer();
- }
- }
-
- #endregion
-
- #region Form minimizing and closing
-
- private void MainForm_Resize(object sender, EventArgs e)
- {
- if (Properties.Settings.Default.CloseToTray)
- {
- Visible = (WindowState == FormWindowState.Normal);
- windowMenuItem.Text = Localizer.Text("Show window");
- }
- }
-
- private void windowMenuItem_Click(object sender, EventArgs e)
- {
- if (!ShowInTaskbar) ShowInTaskbar = true; else Visible = !Visible;
- if (Visible) WindowState = FormWindowState.Normal;
- windowMenuItem.Text = Localizer.Text(Visible ? "Hide window" : "Show window");
- }
-
- private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
- {
- if (e.Button == System.Windows.Forms.MouseButtons.Left) windowMenuItem_Click(this, null);
- }
-
- private bool realExit = false;
- private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (Properties.Settings.Default.CloseToTray && !realExit)
- {
- e.Cancel = true;
- Visible = false;
- WindowState = FormWindowState.Minimized;
- windowMenuItem.Text = Localizer.Text("Show window");
- }
- }
-
- private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
- {
- SaveSettings();
- if (_server != null && _server._isActive)
- {
- _server.StopServer();
- _serverThread = null;
- _server = null;
- }
-
- if (_scanner.Status == FileScannerStatus.SCANNING) _scanner.Stop();
- if (Library.IsChanged) Library.Save();
-
- if (_upnpController != null)
- {
- _upnpController.DiscoverCompleted -= _upnpController_DiscoverCompleted;
- _upnpController.Dispose();
- }
-
- _notifyIcon.Visible = false;
-
- // Remove port forwarding
- openPort.Checked = false;
-
- Log.WriteLine("TinyOPDS closed\n");
- }
-
- private void exitMenuItem_Click(object sender, EventArgs e)
- {
- realExit = true;
- Close();
- }
-
- #endregion
-
- #region Form controls handling
-
- private void convertorPath_Validated(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(convertorPath.Text) && Directory.Exists(convertorPath.Text) && File.Exists(Path.Combine(convertorPath.Text, Utils.IsLinux ? "fb2toepub" : "Fb2ePub.exe")))
- {
- Properties.Settings.Default.ConvertorPath = convertorPath.Text;
- }
- else
- {
- convertorPath.Text = Properties.Settings.Default.ConvertorPath;
- }
- }
-
- private void useWatcher_CheckedChanged(object sender, EventArgs e)
- {
- if (_watcher != null && _watcher.IsEnabled != useWatcher.Checked)
- {
- _watcher.IsEnabled = useWatcher.Checked;
- }
- }
-
- private void closeToTray_CheckedChanged(object sender, EventArgs e)
- {
- _notifyIcon.Visible = closeToTray.Checked;
- }
-
- private void startWithWindows_CheckedChanged(object sender, EventArgs e)
- {
- Microsoft.Win32.RegistryKey registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
- bool exists = (registryKey.GetValue("TinyOPDS") != null);
- if (startWithWindows.Checked && !exists) registryKey.SetValue("TinyOPDS", Application.ExecutablePath);
- else if (exists && !startWithWindows.Checked) registryKey.DeleteValue("TinyOPDS");
- }
-
- private void saveLog_CheckedChanged(object sender, EventArgs e)
- {
- Log.SaveToFile = label22.Enabled = logVerbosity.Enabled = saveLog.Checked;
- }
-
- private void UpdateServerLinks()
- {
- if (_upnpController != null)
- {
- if (_upnpController.LocalIP != null)
- intLink.Text = string.Format(urlTemplate, _upnpController.LocalIP.ToString(), Properties.Settings.Default.ServerPort, rootPrefix.Text);
- if (_upnpController.ExternalIP != null)
- extLink.Text = string.Format(urlTemplate, _upnpController.ExternalIP.ToString(), Properties.Settings.Default.ServerPort, rootPrefix.Text);
- }
- }
-
- ///
- /// Handle server's root prefix change
- ///
- ///
- ///
- private void rootPrefix_TextChanged(object sender, EventArgs e)
- {
- if (_upnpController != null && _upnpController.UPnPReady)
- {
- while (rootPrefix.Text.IndexOf("/") >= 0) rootPrefix.Text = rootPrefix.Text.Replace("/", "");
- UpdateServerLinks();
- }
- }
-
- ///
- /// Validate server port
- ///
- ///
- ///
- private void serverPort_Validated(object sender, EventArgs e)
- {
- int port = 8080;
- bool valid = int.TryParse(serverPort.Text, out port);
- if (valid && port >= 1 && port <= 65535)
- {
- if (_upnpController != null && _upnpController.UPnPReady && openPort.Checked)
- {
- openPort.Checked = false;
- Properties.Settings.Default.ServerPort = port.ToString();
- openPort.Checked = true;
- }
- else Properties.Settings.Default.ServerPort = port.ToString();
- if (_server != null && _server.IsActive)
- {
- RestartHttpServer();
- }
- }
- else
- {
- MessageBox.Show(Localizer.Text("Invalid port value: value must be numeric and in range from 1 to 65535"));
- serverPort.Text = Properties.Settings.Default.ServerPort.ToString();
- }
- // Update link labels
- UpdateServerLinks();
- }
-
- ///
- /// Set UI language
- ///
- ///
- ///
- private void langCombo_SelectedValueChanged(object sender, EventArgs e)
- {
- Localizer.SetLanguage(this, langCombo.SelectedValue as string);
- appVersion.Text = string.Format(Localizer.Text("version {0}.{1} {2}"), Utils.Version.Major, Utils.Version.Minor, Utils.Version.Major == 0?" (beta)":"");
- scannerButton.Text = Localizer.Text( (_scanner.Status == FileScannerStatus.STOPPED) ? "Start scanning" : "Stop scanning");
- serverButton.Text = Localizer.Text((_server == null) ? "Start server" : "Stop server");
- serverMenuItem.Text = Localizer.Text((_server == null) ? "Start server" : "Stop server");
- windowMenuItem.Text = Localizer.Text(Visible || ShowInTaskbar ? "Hide window" : "Show window");
- logVerbosity.Items[0] = Localizer.Text("Info, warnings and errors");
- logVerbosity.Items[1] = Localizer.Text("Warnings and errors");
- logVerbosity.Items[2] = Localizer.Text("Errors only");
- updateCombo.Items[0] = Localizer.Text("Never");
- updateCombo.Items[1] = Localizer.Text("Once a week");
- updateCombo.Items[2] = Localizer.Text("Once a month");
- }
-
- ///
- /// Handle PayPal donation
- ///
- ///
- ///
- private void donateButton_Click(object sender, EventArgs e)
- {
- const string business = "sens.boston@gmail.com", description = "Donation%20for%20the%20TinyOPDS", country = "US", currency = "USD";
- string url = string.Format("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business={0}&lc={1}&item_name={2}¤cy_code={3}&bn=PP%2dDonationsBF",
- business, country, description, currency);
- System.Diagnostics.Process.Start(url);
- }
-
- private bool checkUrl(string uriName)
- {
- Uri uriResult;
- bool result = Uri.TryCreate(uriName, UriKind.Absolute, out uriResult);
- return result && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
- }
-
- private void linkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- if (sender is LinkLabel && checkUrl((sender as LinkLabel).Text))
- {
- System.Diagnostics.Process.Start((sender as LinkLabel).Text);
- }
- }
-
- private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- if (sender is LinkLabel && checkUrl((sender as LinkLabel).Links[0].LinkData as string))
- {
- System.Diagnostics.Process.Start((sender as LinkLabel).Links[0].LinkData as string);
- }
- }
-
- private void useHTTPAuth_CheckedChanged(object sender, EventArgs e)
- {
- dataGridView1.Enabled = banClients.Enabled = rememberClients.Enabled = useHTTPAuth.Checked;
- wrongAttemptsCount.Enabled = banClients.Enabled && banClients.Checked;
- }
-
- private void banClients_CheckedChanged(object sender, EventArgs e)
- {
- wrongAttemptsCount.Enabled = banClients.Checked;
- }
-
- private void logVerbosity_SelectedIndexChanged(object sender, EventArgs e)
- {
- Log.VerbosityLevel = (LogLevel)logVerbosity.SelectedIndex;
- }
-
- private void updateCombo_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (Properties.Settings.Default.UpdatesCheck == 0) _updateChecker.Stop(); else _updateChecker.Start();
- }
-
- #endregion
-
- #region TinyOPDS updates checker
-
- ///
- /// This timer event should be raised every hour
- ///
- ///
- ///
- static int[] checkIntervals = new int[] { 0, 60 * 24 * 7, 60 * 24 * 30, 1};
- void _updateChecker_Tick(object sender, EventArgs e)
- {
- if (Properties.Settings.Default.UpdatesCheck >= 0)
- {
- _updateUrl = string.Empty;
- int minutesFromLastCheck = (int) Math.Round(DateTime.Now.Subtract(Properties.Settings.Default.LastCheck).TotalMinutes);
- if (minutesFromLastCheck >= checkIntervals[Properties.Settings.Default.UpdatesCheck])
- {
- Log.WriteLine(LogLevel.Info, "Checking software update. Minutes from the last check: {0}", minutesFromLastCheck);
- WebClient wc = new WebClient();
- wc.DownloadStringCompleted += wc_DownloadStringCompleted;
- wc.DownloadStringAsync(new Uri("http://senssoft.com/tinyopds.txt"));
- }
- }
- }
-
- void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
- {
- if (e.Error == null)
- {
- Properties.Settings.Default.LastCheck = DateTime.Now;
- Properties.Settings.Default.Save();
-
- string[] s = e.Result.Split('\n');
- if (s.Length == 2)
- {
- s[0] = s[0].Replace("\r", "");
- double currentVersion = 0, newVersion = 0;
- if (double.TryParse(string.Format("{0}.{1}", Utils.Version.Major, Utils.Version.Minor), out currentVersion))
- {
- if (double.TryParse(s[0], out newVersion))
- {
- if (newVersion > currentVersion)
- {
- _updateUrl = s[1];
- _notifyIcon.Visible = true;
- _notifyIcon.ShowBalloonTip(30000, Localizer.Text("TinyOPDS: update found"), string.Format(Localizer.Text("Click here to download update v {0}"), s[0]), ToolTipIcon.Info);
- }
- }
- }
- }
- }
- }
-
- void _notifyIcon_BalloonTipClicked(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start(_updateUrl);
- }
-
- void _notifyIcon_BalloonTipClosed(object sender, EventArgs e)
- {
- _notifyIcon.Visible = Properties.Settings.Default.CloseToTray;
- }
-
- #endregion
- }
-}
diff --git a/releases/1.1/MainForm.resx b/releases/1.1/MainForm.resx
deleted file mode 100644
index acce9e6..0000000
--- a/releases/1.1/MainForm.resx
+++ /dev/null
@@ -1,123 +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
-
-
- 17, 17
-
-
\ No newline at end of file
diff --git a/releases/1.1/Misc/Crypt.cs b/releases/1.1/Misc/Crypt.cs
deleted file mode 100644
index b383fc4..0000000
--- a/releases/1.1/Misc/Crypt.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module contains string extensions and some helpers
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Text;
-using System.Security.Cryptography;
-
-namespace TinyOPDS
-{
- public class Crypt
- {
- private static byte[] _salt = Encoding.ASCII.GetBytes("o6806642kbM7c5");
-
- ///
- /// Encrypt the given string using AES. The string can be decrypted using
- /// DecryptStringAES(). The sharedSecret parameters must match.
- ///
- /// The text to encrypt.
- /// A password used to generate a key for encryption.
- public static string EncryptStringAES(string plainText, string sharedSecret)
- {
- if (string.IsNullOrEmpty(plainText))
- throw new ArgumentNullException("plainText");
- if (string.IsNullOrEmpty(sharedSecret))
- throw new ArgumentNullException("sharedSecret");
-
- string outStr = null; // Encrypted string to return
- RijndaelManaged aesAlg = null; // RijndaelManaged object used to encrypt the data.
-
- try
- {
- // generate the key from the shared secret and the salt
- Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, _salt);
-
- // Create a RijndaelManaged object
- aesAlg = new RijndaelManaged();
- aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
-
- // Create a decrytor to perform the stream transform.
- ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
-
- // Create the streams used for encryption.
- using (MemoryStream msEncrypt = new MemoryStream())
- {
- // prepend the IV
- msEncrypt.Write(BitConverter.GetBytes(aesAlg.IV.Length), 0, sizeof(int));
- msEncrypt.Write(aesAlg.IV, 0, aesAlg.IV.Length);
- using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
- {
- using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
- {
- //Write all data to the stream.
- swEncrypt.Write(plainText);
- }
- }
- outStr = Convert.ToBase64String(msEncrypt.ToArray());
- }
- }
- finally
- {
- // Clear the RijndaelManaged object.
- if (aesAlg != null)
- aesAlg.Clear();
- }
-
- // Return the encrypted bytes from the memory stream.
- return outStr;
- }
-
- ///
- /// Decrypt the given string. Assumes the string was encrypted using
- /// EncryptStringAES(), using an identical sharedSecret.
- ///
- /// The text to decrypt.
- /// A password used to generate a key for decryption.
- public static string DecryptStringAES(string cipherText, string sharedSecret)
- {
- if (string.IsNullOrEmpty(cipherText))
- throw new ArgumentNullException("cipherText");
- if (string.IsNullOrEmpty(sharedSecret))
- throw new ArgumentNullException("sharedSecret");
-
- // Declare the RijndaelManaged object
- // used to decrypt the data.
- RijndaelManaged aesAlg = null;
-
- // Declare the string used to hold
- // the decrypted text.
- string plaintext = null;
-
- try
- {
- // generate the key from the shared secret and the salt
- Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, _salt);
-
- // Create the streams used for decryption.
- byte[] bytes = Convert.FromBase64String(cipherText);
- using (MemoryStream msDecrypt = new MemoryStream(bytes))
- {
- // Create a RijndaelManaged object
- // with the specified key and IV.
- aesAlg = new RijndaelManaged();
- aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
- // Get the initialization vector from the encrypted stream
- aesAlg.IV = ReadByteArray(msDecrypt);
- // Create a decrytor to perform the stream transform.
- ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
- using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
- {
- using (StreamReader srDecrypt = new StreamReader(csDecrypt))
-
- // Read the decrypted bytes from the decrypting stream
- // and place them in a string.
- plaintext = srDecrypt.ReadToEnd();
- }
- }
- }
- finally
- {
- // Clear the RijndaelManaged object.
- if (aesAlg != null)
- aesAlg.Clear();
- }
-
- return plaintext;
- }
-
- private static byte[] ReadByteArray(Stream s)
- {
- byte[] rawLength = new byte[sizeof(int)];
- if (s.Read(rawLength, 0, rawLength.Length) != rawLength.Length)
- {
- throw new SystemException("Stream did not contain properly formatted byte array");
- }
-
- byte[] buffer = new byte[BitConverter.ToInt32(rawLength, 0)];
- if (s.Read(buffer, 0, buffer.Length) != buffer.Length)
- {
- throw new SystemException("Did not read byte array properly");
- }
-
- return buffer;
- }
- }
-}
diff --git a/releases/1.1/Misc/CustomSettingsProvider.cs b/releases/1.1/Misc/CustomSettingsProvider.cs
deleted file mode 100644
index 3b5830e..0000000
--- a/releases/1.1/Misc/CustomSettingsProvider.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module defines custom settings provider, to define
- * straightforward settings folder
- *
- * That code was copied from the StackOverflow site:
- * http://stackoverflow.com/questions/2265271/custom-path-of-the-user-config
- *
- *
- ************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Configuration;
-using System.Reflection;
-using System.Xml.Linq;
-using System.IO;
-
-namespace TinyOPDS
-{
- class CustomSettingsProvider : SettingsProvider
- {
- const string NAME = "name";
- const string SERIALIZE_AS = "serializeAs";
- const string CONFIG = "configuration";
- const string USER_SETTINGS = "userSettings";
- const string SETTING = "setting";
-
- ///
- /// Loads the file into memory.
- ///
- public CustomSettingsProvider()
- {
- SettingsDictionary = new Dictionary();
- }
-
- ///
- /// Override.
- ///
- public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
- {
- base.Initialize(ApplicationName, config);
- }
-
- ///
- /// Override.
- ///
- public override string ApplicationName
- {
- get
- {
- return System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name;
- }
- set
- {
- //do nothing
- }
- }
-
- ///
- /// Must override this, this is the bit that matches up the designer properties to the dictionary values
- ///
- ///
- ///
- ///
- public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection)
- {
- //load the file
- if (!_loaded)
- {
- _loaded = true;
- LoadValuesFromFile();
- }
-
- //collection that will be returned.
- SettingsPropertyValueCollection values = new SettingsPropertyValueCollection();
-
- //iterate thought the properties we get from the designer, checking to see if the setting is in the dictionary
- foreach (SettingsProperty setting in collection)
- {
- SettingsPropertyValue value = new SettingsPropertyValue(setting);
- value.IsDirty = false;
-
- //need the type of the value for the strong typing
- var t = Type.GetType(setting.PropertyType.FullName);
-
- if (SettingsDictionary.ContainsKey(setting.Name))
- {
- value.SerializedValue = SettingsDictionary[setting.Name].value;
- value.PropertyValue = Convert.ChangeType(SettingsDictionary[setting.Name].value, t);
- }
- else //use defaults in the case where there are no settings yet
- {
- value.SerializedValue = setting.DefaultValue;
- value.PropertyValue = Convert.ChangeType(setting.DefaultValue, t);
- }
-
- values.Add(value);
- }
- return values;
- }
-
- ///
- /// Must override this, this is the bit that does the saving to file. Called when Settings.Save() is called
- ///
- ///
- ///
- public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
- {
- //grab the values from the collection parameter and update the values in our dictionary.
- foreach (SettingsPropertyValue value in collection)
- {
- var setting = new SettingStruct()
- {
- value = (value.PropertyValue == null ? String.Empty : value.PropertyValue.ToString()),
- name = value.Name,
- serializeAs = value.Property.SerializeAs.ToString()
- };
-
- if (!SettingsDictionary.ContainsKey(value.Name))
- {
- SettingsDictionary.Add(value.Name, setting);
- }
- else
- {
- SettingsDictionary[value.Name] = setting;
- }
- }
-
- //now that our local dictionary is up-to-date, save it to disk.
- SaveValuesToFile();
- }
-
- ///
- /// Loads the values of the file into memory.
- ///
- private void LoadValuesFromFile()
- {
- if (!File.Exists(UserConfigPath))
- {
- //if the config file is not where it's supposed to be create a new one.
- CreateEmptyConfig();
- }
-
- //load the xml
- var configXml = XDocument.Load(UserConfigPath);
-
- //get all of the elements.
- var settingElements = configXml.Element(CONFIG).Element(USER_SETTINGS).Element(typeof(Properties.Settings).FullName).Elements(SETTING);
-
- //iterate through, adding them to the dictionary, (checking for nulls, xml no likey nulls)
- //using "String" as default serializeAs...just in case, no real good reason.
- foreach (var element in settingElements)
- {
- var newSetting = new SettingStruct()
- {
- name = element.Attribute(NAME) == null ? String.Empty : element.Attribute(NAME).Value,
- serializeAs = element.Attribute(SERIALIZE_AS) == null ? "String" : element.Attribute(SERIALIZE_AS).Value,
- value = element.Value ?? String.Empty
- };
- SettingsDictionary.Add(element.Attribute(NAME).Value, newSetting);
- }
- }
-
- ///
- /// Creates an empty user.config file...looks like the one MS creates.
- /// This could be overkill a simple key/value pairing would probably do.
- ///
- private void CreateEmptyConfig()
- {
- var doc = new XDocument();
- var declaration = new XDeclaration("1.0", "utf-8", "true");
- var config = new XElement(CONFIG);
- var userSettings = new XElement(USER_SETTINGS);
- var group = new XElement(typeof(Properties.Settings).FullName);
- userSettings.Add(group);
- config.Add(userSettings);
- doc.Add(config);
- doc.Declaration = declaration;
- string dirName = Path.GetDirectoryName(UserConfigPath);
- try
- {
- if (!Directory.Exists(dirName)) Directory.CreateDirectory(dirName);
- doc.Save(UserConfigPath);
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, e.Message);
- }
- }
-
- ///
- /// Saves the in memory dictionary to the user config file
- ///
- private void SaveValuesToFile()
- {
- //load the current xml from the file.
- var import = XDocument.Load(UserConfigPath);
-
- //get the settings group (e.g. )
- var settingsSection = import.Element(CONFIG).Element(USER_SETTINGS).Element(typeof(Properties.Settings).FullName);
-
- //iterate though the dictionary, either updating the value or adding the new setting.
- foreach (var entry in SettingsDictionary)
- {
- var setting = settingsSection.Elements().FirstOrDefault(e => e.Attribute(NAME).Value == entry.Key);
- if (setting == null) //this can happen if a new setting is added via the .settings designer.
- {
- var newSetting = new XElement(SETTING);
- newSetting.Add(new XAttribute(NAME, entry.Value.name));
- newSetting.Add(new XAttribute(SERIALIZE_AS, entry.Value.serializeAs));
- newSetting.Value = (entry.Value.value ?? String.Empty);
- settingsSection.Add(newSetting);
- }
- else //update the value if it exists.
- {
- setting.Value = (entry.Value.value ?? String.Empty);
- }
- }
- try
- {
- import.Save(UserConfigPath);
- }
- catch (Exception e)
- {
- Log.WriteLine(LogLevel.Error, e.Message);
- }
- }
-
- ///
- /// The setting key this is returning must set before the settings are used.
- /// e.g. Properties.Settings.Default.SettingsKey = @"C:\temp\user.config";
- ///
- private string UserConfigPath
- {
- get
- {
- return Path.Combine(Utils.ServiceFilesLocation, "user.config");
- }
- }
-
- ///
- /// In memory storage of the settings values
- ///
- private Dictionary SettingsDictionary { get; set; }
-
- ///
- /// Helper structure
- ///
- internal struct SettingStruct
- {
- internal string name;
- internal string serializeAs;
- internal string value;
- }
-
- bool _loaded;
- }
-}
-
diff --git a/releases/1.1/Misc/Localizer.cs b/releases/1.1/Misc/Localizer.cs
deleted file mode 100644
index 1551237..0000000
--- a/releases/1.1/Misc/Localizer.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * Very simple but very effective application localization
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Xml.Linq;
-#if !CONSOLE
-using System.Windows.Forms;
-#endif
-using System.Reflection;
-
-namespace TinyOPDS
-{
- public static class Localizer
- {
- private static string _lang = "en";
- private static Dictionary _translations = new Dictionary();
- private static XDocument _xml = null;
-#if !CONSOLE
- private static List _menuItems = new List();
-#endif
- ///
- /// Static classes don't have a constructors but we need to initialize translations
- ///
- /// Name of xml translations, added to project as an embedded resource
- public static void Init(string xmlFile = "translation.xml")
- {
- try
- {
- _xml = XDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("TinyOPDS."+xmlFile));
- }
- catch (Exception e)
- {
- Log.WriteLine("Localizer.Init({0}) exception: {1}", xmlFile, e.Message);
- }
- }
-
-#if !CONSOLE
- ///
- /// Add menu to translator
- ///
- ///
- public static void AddMenu(ContextMenuStrip menu)
- {
- foreach (ToolStripItem item in menu.Items) _menuItems.Add(item);
- }
-#endif
- ///
- /// Returns supported translations in Dictionary
- ///
- public static Dictionary Languages
- {
- get
- {
- return _xml != null ? _xml.Descendants("language").ToDictionary(d => d.Attribute("id").Value, d => d.Value) : null;
- }
- }
-
- ///
- /// Current selected language
- ///
- public static string Language { get { return _lang; } }
-
-#if !CONSOLE
- ///
- /// Sets current language
- ///
- ///
- ///
- public static void SetLanguage(Form form, string lang)
- {
- if (_lang != lang && _xml != null)
- {
- _lang = lang;
- try
- {
- // Update localized string dictionary
- List t = _xml.Descendants("property") // .Where(a => !a.HasAttributes)
- .Descendants("text").Where(b => b.Attribute("lang").Value == "en" || b.Attribute("lang").Value == _lang)
- .Select(c => c.Value).ToList();
- _translations.Clear();
-
- if (lang.Equals("en"))
- {
- for (int i = 0; i < t.Count; i++)
- if (!string.IsNullOrEmpty(t[i]))
- _translations.Add(t[i], t[i]);
- }
- else
- {
- for (int i = 0; i < t.Count / 2; i++)
- if (!string.IsNullOrEmpty(t[i * 2]))
- _translations.Add(t[i * 2], t[i * 2 + 1]);
- }
-
- // Update form controls
- UpdateControls(form);
- }
- catch (Exception e)
- {
- Log.WriteLine(".SetLanguage({0},{1}) exception: {2}", form, lang, e.Message);
- }
- }
- }
-#endif
-
- ///
- /// Translation helper
- ///
- ///
- ///
- public static string Text(string source)
- {
- return (_translations.ContainsKey(source)) ? _translations[source] : source;
- }
-
-#if !CONSOLE
- ///
- /// Updates texts for all form controls (if translation exists)
- ///
- /// Form to be updated
- private static void UpdateControls(Form form)
- {
- // Find all controls
- var controls = GetAllControls(form);
-
- foreach (Control ctrl in new IteratorIsolateCollection(controls))
- {
- var xmlProp = _xml.Descendants("property").Where(e => e.Attribute("form") != null && e.Attribute("form").Value.Equals(form.Name) &&
- e.Attribute("ctrl") != null && e.Attribute("ctrl").Value == ctrl.Name);
- if (xmlProp != null && xmlProp.Count() > 0)
- {
- var trans = xmlProp.FirstOrDefault().Descendants("text").Where(p => p.Attribute("lang").Value == _lang).Select(p => p.Value);
- if (trans != null && trans.Count() > 0) ctrl.Text = trans.First() as string;
- }
- }
-
- foreach (ToolStripItem ctrl in _menuItems)
- {
- var xmlProp = _xml.Descendants("property").Where(e => e.Attribute("ctrl") != null && e.Attribute("ctrl").Value == ctrl.Name);
- if (xmlProp != null && xmlProp.Count() > 0)
- {
- var trans = xmlProp.First().Descendants("text").Where(p => p.Attribute("lang").Value == _lang).Select(p => p.Value);
- if (trans != null && trans.Count() > 0) ctrl.Text = trans.First() as string;
- }
-
- }
- }
-
- ///
- /// Localization helper: scans form and return xml document with controls names and texts
- ///
- /// Form to localize
- /// Current form language
- /// Xml document
- public static XDocument Setup(Form form, string srcLang = "en")
- {
- XDocument doc = new XDocument();
- doc.Add(new XElement("root", new XElement("languages"), new XElement("properties")));
-
- if (form != null)
- {
-
- var controls = GetAllControls(form);
-
- foreach (Control ctrl in controls)
- {
- foreach (var propInfo in ctrl.GetType().GetProperties())
- {
- if (propInfo.Name == "Text")
- {
- try
- {
- var value = propInfo.GetValue(ctrl, null);
- doc.Root.Element("properties").Add(
- new XElement("property",
- new XAttribute("form", form.Name),
- new XAttribute("ctrl", ctrl.Name),
- new XElement("text",
- new XAttribute("lang", srcLang), value))
- );
- }
- catch
- { }
- }
- }
- }
- }
-
- return doc;
- }
-
- ///
- /// Enums all controls on the form
- ///
- ///
- ///
- private static List GetAllControls(Control control)
- {
- var controls = control.Controls.Cast();
- return (controls.SelectMany(ctrl => GetAllControls(ctrl)).Concat(controls)).ToList();
- }
-#endif
- }
-}
diff --git a/releases/1.1/Misc/Log.cs b/releases/1.1/Misc/Log.cs
deleted file mode 100644
index 39628a9..0000000
--- a/releases/1.1/Misc/Log.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module defines the Log class
- *
- * TODO: add threading for performance reason (may be, should check)
- *
- ************************************************************/
-
-using System;
-using System.IO;
-using System.Diagnostics;
-
-namespace TinyOPDS
-{
- ///
- /// A lightweight logging class for Silverlight.
- ///
- internal static class Log
- {
- private static string _logFileName = "TinyOPDS.log";
-
- ///
- ///
- ///
- internal static LogLevel VerbosityLevel = LogLevel.Info;
-
- ///
- /// Enable or disable logging to file
- ///
- private static bool _saveToFile = false;
- internal static bool SaveToFile
- {
- get { return _saveToFile; }
- set
- {
- _logFileName = Path.Combine(Utils.ServiceFilesLocation, "TinyOPDS.log");
- _saveToFile = value;
- }
- }
-
- ///
- /// Writes the args to the default logging output using the format provided.
- ///
- internal static void WriteLine(string format, params object[] args)
- {
- WriteLine(LogLevel.Info, format, args);
- }
-
- ///
- /// Writes the args to the default logging output using the format provided.
- ///
- internal static void WriteLine(LogLevel level, string format, params object[] args)
- {
- if (level >= VerbosityLevel)
- {
- string caller = new StackTrace().GetFrame(2).GetMethod().ReflectedType.Name;
- if (caller.StartsWith("<>")) caller = new StackTrace().GetFrame(1).GetMethod().ReflectedType.Name;
- string prefix = string.Format("{0}\t{1}\t{2}", (level == LogLevel.Info) ? 'I' : ((level == LogLevel.Warning) ? 'W' : 'E'), caller, (caller.Length > 7 ? "" : "\t"));
-
- string message = string.Format(prefix + format, args);
- Debug.WriteLine(message);
- if (SaveToFile) WriteToFile(message);
- }
- }
-
- private static object fileSyncObject = new object();
-
- ///
- /// Writes a line to the current log file.
- ///
- ///
- private static void WriteToFile(string message)
- {
- lock (fileSyncObject)
- {
- FileStream fileStream = null;
- try
- {
- fileStream = new FileStream(_logFileName, (File.Exists(_logFileName) ? FileMode.Append : FileMode.Create), FileAccess.Write, FileShare.ReadWrite);
- using (StreamWriter writer = new StreamWriter(fileStream))
- {
- fileStream = null;
- writer.WriteLine(string.Format("{0:MM/dd/yyyy HH:mm:ss.f}\t{1}", DateTime.Now, message), _logFileName);
- }
- }
- finally
- {
- if (fileStream != null) fileStream.Dispose();
- }
- }
- }
- }
-
- ///
- /// The type of error to log
- ///
- public enum LogLevel
- {
- ///
- /// A message containing information only.
- ///
- Info = 0,
- ///
- /// A non-critical warning error message.
- ///
- Warning = 1,
- ///
- /// A fatal error message.
- ///
- Error = 2
- }
-}
\ No newline at end of file
diff --git a/releases/1.1/Misc/OPDSComparer.cs b/releases/1.1/Misc/OPDSComparer.cs
deleted file mode 100644
index 391327a..0000000
--- a/releases/1.1/Misc/OPDSComparer.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-/***********************************************************
- * This file is a part of TinyOPDS server project
- *
- * Copyright (c) 2013 SeNSSoFT
- *
- * This code is licensed under the Microsoft Public License,
- * see http://tinyopds.codeplex.com/license for the details.
- *
- * This module defines the custom comparer class
- *
- * TODO: should sort down some rare used chars
- *
- ************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using TinyOPDS.Data;
-
-namespace TinyOPDS
-{
- public class OPDSComparer : IComparer