Read() public static method

public static Read ( ) : Settings
return Settings
コード例 #1
0
        public int GetNextAvailableProductId()
        {
            var s  = Settings.Read();
            var id = s.NextProductId++;

            s.Write();
            return(id);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            log4net.Config.BasicConfigurator.Configure();

            var pen = TipToiPen.GetAll().FirstOrDefault();

            if (pen == null)
            {
                pen = TipToiPen.Simulated;
                log.InfoFormat("Pen is not attached. Output will be written to {0}", pen.RootDirectory);
            }

            var package = Package.CreateFromInputPaths(args);

            var cacheDirectory = Path.Combine(About.LocalApplicationDataDirectory, "cache");
            var converter      = new MediaFileConverter(cacheDirectory);

            var structure      = new PackageDirectoryStructure(pen.RootDirectory, package);
            var packageBuilder = new PackageBuilder(structure, converter, Settings.Read().CreateOidSvgWriter());

            packageBuilder.Build(CancellationToken.None).Wait();
        }
コード例 #3
0
        public async Task Build(string[] mp3FilesOrDirectories)
        {
            if (!mp3FilesOrDirectories.Any())
            {
                throw new ArgumentOutOfRangeException(nameof(mp3FilesOrDirectories), String.Empty, "You must specify at least one audio file.");
            }

            var pen = TipToiPen.GetAll().FirstOrDefault();

            if (pen == null)
            {
                pen = TipToiPen.Simulated;
                log.InfoFormat("Pen is not attached. Output will be written to {0}", pen.RootDirectory);
            }

            var package = Package.CreateFromInputPaths(mp3FilesOrDirectories);

            var cacheDirectory = Path.Combine(About.Get().LocalApplicationDataDirectory, "cache");
            var converter      = new MediaFileConverter(cacheDirectory);

            var structure      = new PackageDirectoryStructure(pen.RootDirectory, package);
            var packageBuilder = new PackageBuilder(structure, converter, Settings.Read().CreateOidSvgWriter());
            await packageBuilder.Build(CancellationToken.None);
        }