Beispiel #1
0
        internal Paths()
        {
            if (FS == null)
            {
                FS = new FileSystem();
            }
            try
            {
                if (WorkingDirectory == null)
                {
                    if (Assembly.GetEntryAssembly() != null)
                    {
                        WorkingDirectory = Assembly.GetEntryAssembly().Location;
                    }
                    else
                    {
                        WorkingDirectory = Assembly.GetExecutingAssembly().Location;
                    }
                }
            }
            catch
            {
            }
            UserDirectory = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Octgn");
            BasePath        = FS.Path.GetDirectoryName(WorkingDirectory) + "\\";
            LogsPath        = FS.Path.Combine(BasePath, "Logs");
            CurrentLogPath  = FS.Path.Combine(LogsPath, "log.txt");
            PreviousLogPath = FS.Path.Combine(LogsPath, "log.txt.1");
            DataDirectory   = SimpleConfig.Get().DataDirectory;
            PluginPath      = FS.Path.Combine(UserDirectory, "Plugins");
            //DatabasePath = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "Database");
            DatabasePath      = FS.Path.Combine(DataDirectory, "GameDatabase");
            ImageDatabasePath = FS.Path.Combine(DataDirectory, "ImageDatabase");

            ConfigDirectory = System.IO.Path.Combine(UserDirectory, "Config");
            FeedListPath    = FS.Path.Combine(ConfigDirectory, "feeds.txt");
            LocalFeedPath   = FS.Path.Combine(UserDirectory, "LocalFeed");
            FS.Directory.CreateDirectory(LocalFeedPath);
            DeckPath      = FS.Path.Combine(DataDirectory, "Decks");
            MainOctgnFeed = "https://www.myget.org/F/octgngames/";

            Task.Factory.StartNew(() =>
            {
                foreach (var prop in this.GetType().GetProperties())
                {
                    Log.InfoFormat("Path {0} = {1}", prop.Name, prop.GetValue(this, null));
                }
            });
        }
Beispiel #2
0
        internal Paths()
        {
            Log.Info("Creating paths");
            if (FS == null)
            {
                FS = new FileSystem();
            }
            try
            {
                if (WorkingDirectory == null)
                {
                    WorkingDirectory = Assembly.GetEntryAssembly().Location;
                }
            }
            catch
            {
            }
            BasePath   = FS.Path.GetDirectoryName(WorkingDirectory) + "\\";
            PluginPath = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "Plugins");
            //DatabasePath = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "Database");
            DatabasePath    = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "GameDatabase");
            DataDirectory   = SimpleConfig.Get().DataDirectory;
            ConfigDirectory = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Octgn", "Config");
            //ConfigDirectory = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "Config");
            FeedListPath  = FS.Path.Combine(ConfigDirectory, "feeds.txt");
            LocalFeedPath = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "LocalFeed");
            FS.Directory.CreateDirectory(LocalFeedPath);
            DeckPath      = FS.Path.Combine(SimpleConfig.Get().DataDirectory, "Decks");
            MainOctgnFeed = "http://www.myget.org/F/octgngames/";

            foreach (var prop in this.GetType().GetProperties())
            {
                Log.InfoFormat("Path {0} = {1}", prop.Name, prop.GetValue(this, null));
            }
        }