Esempio n. 1
0
        public List <DateTime> DatabaseDateQuery()
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            List <DateTime> Date = new List <DateTime>();

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                string queryString = $"select S.[Date]  from Stocks as S   order by S.Date DESC";

                SqlCommand command = new SqlCommand(queryString, connection); //

                command.Parameters.AddWithValue($"Date", "Date");
                connection.Open();                                     // opens the connection to the database

                using (SqlDataReader reader = command.ExecuteReader()) // opens the datareader to retrieve data with query
                {
                    while (reader.Read())
                    {
                        Date.Add(Convert.ToDateTime(reader[$"Date"]));
                    }
                }

                connection.Close();
            }
            return(Date);
        }
        void UploadProfileImage(EditUserInfo info, string path)
        {
            if (path != null)
            {
                // Crop and Resize image
                System.Drawing.Image img = ProcessImage(path);
                if (img != null)
                {
                    // Generate random file name for processed/temp image (to be saved in temp folder)
                    string newFilename = String_Functions.RandomString(20);

                    // Get file extension of original file
                    string ext = Path.GetExtension(path);

                    // Make sure Temp directory exists
                    FileLocations.CreateTempDirectory();

                    // Create new full path of temp file
                    string localPath = Path.Combine(FileLocations.TrakHoundTemp, newFilename);
                    //if (ext != null) localPath += "." + ext;
                    if (ext != null)
                    {
                        localPath = Path.ChangeExtension(localPath, ext);
                    }

                    // Save the processed image to the new temp path
                    img.Save(localPath);

                    // Create a temp UserConfiguration object to pass the current SessionToken to the Files.Upload() method
                    var userConfig = new UserConfiguration();
                    userConfig.SessionToken = info.SessionToken;

                    // Set the HTTP Content Type based on the type of image
                    string contentType = null;
                    if (ext == "jpg")
                    {
                        contentType = "image/jpeg";
                    }
                    else if (ext == "png")
                    {
                        contentType = "image/png";
                    }
                    else if (ext == "gif")
                    {
                        contentType = "image/gif";
                    }

                    var fileData = new HTTP.FileContentData("uploadimage", localPath, contentType);

                    // Upload File
                    var uploadInfos = TrakHound.API.Files.Upload(userConfig, fileData);
                    if (uploadInfos != null && uploadInfos.Length > 0)
                    {
                        string fileId = uploadInfos[0].Id;

                        info.ImageUrl = fileId;
                    }
                }
            }
        }
Esempio n. 3
0
        private async Task <CreateTransferResult> UpdateFileTransferAsync(PictureparkAsset asset)
        {
            var transferIdentifier = $"Smint.io Update Import {Guid.NewGuid().ToString()}";

            var localFile = await asset.GetDownloadedFileAsync();

            var filePaths = new FileLocations[]
            {
                new FileLocations(localFile.FullName, asset.RecommendedFileName, asset.RecommendedFileName)
            };

            var request = new CreateTransferRequest
            {
                Name         = transferIdentifier,
                TransferType = TransferType.FileUpload,
                Files        = new TransferUploadFile[] {
                    new TransferUploadFile()
                    {
                        FileName = asset.RecommendedFileName
                    }
                }
            };

            var uploadOptions = new UploadOptions
            {
                ChunkSize                 = 1024 * 1024,
                ConcurrentUploads         = 4,
                SuccessDelegate           = Console.WriteLine,
                ErrorDelegate             = ErrorDelegate,
                WaitForTransferCompletion = true
            };

            return(await _client.Transfer.UploadFilesAsync(transferIdentifier, filePaths, uploadOptions));
        }
Esempio n. 4
0
        /// <summary>
        /// Downloads the AppInfo using the given Url, parses the file, and returns the AppInfo object
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static AppInfo Get(string url)
        {
            // Create local path to download 'appinfo' file to
            string path = FileLocations.CreateTempPath();

            // Download File
            Logger.Log("Downloading AppInfo File...", LogLineType.Notification);
            if (Download(url, path))
            {
                // Parse File as AppInfo class
                var info = Parse(path);

                // Delete temp file
                if (File.Exists(path))
                {
                    File.Delete(path);
                }

                return(info);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 5
0
        static void LoadResources()
        {
            foreach (var file in FileLocations.GetAllSubFiles(FileLocations.GetApplicationDataDir("packages"), "*.pack"))
            {
                AssetManager.AddProvider(new PackAssetProvider(file));
            }

            foreach (var file in FileLocations.GetAllSubFiles(FileLocations.GetApplicationDataDir("packages"), "*.zip"))
            {
                AssetManager.AddProvider(new ZipPackageAssetProvider(file));
            }

            FileLocations.AddUserAndApplicationSubDirAssets("assets");
            FileLocations.AddUserAndApplicationSubDirAssets("music");

            foreach (var file in FileLocations.GetAllSubFiles(FileLocations.GetUserDataSubDir("packages"), "*.pack"))
            {
                AssetManager.AddProvider(new PackAssetProvider(file));
            }

            foreach (var file in FileLocations.GetAllSubFiles(FileLocations.GetUserDataSubDir("packages"), "*.zip"))
            {
                AssetManager.AddProvider(new ZipPackageAssetProvider(file));
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Returns the 50 most recent closing prices from the selected symbol.
        /// </summary>
        /// <param name="database"></param>
        /// <param name="stock"></param>
        /// <returns></returns>
        public List <double> NiftyFiftyQuery(string stock) /// TODO: make this method able to retrieve any price.
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            List <double> Close = new List <double>();

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                string queryString = $"SELECT TOP (50)(S.[Close] ) FROM Stocks AS S  WHERE S.[Symbol] = '{stock}'ORDER BY S.[Date] desc;";

                SqlCommand command = new SqlCommand(queryString, connection); //

                command.Parameters.AddWithValue($"{stock}", stock);
                connection.Open();                                     // opens the connection to the database

                using (SqlDataReader reader = command.ExecuteReader()) // opens the datareader to retrieve data with query
                {
                    while (reader.Read())
                    {
                        Close.Add(Convert.ToDouble(reader["Close"]));
                    }
                }

                connection.Close();
            }
            return(Close);
        }
Esempio n. 7
0
        private static void AddControlPanelApplets(SpecialCommandConfigurationElementCollection commands)
        {
            string controlPanelImage = FileLocations.ControlPanelImage;

            if (!File.Exists(controlPanelImage))
            {
                SaveBitmap(Properties.Resources.ControlPanel, controlPanelImage);
            }

            foreach (FileInfo file in SystemRoot.GetFiles("*.cpl"))
            {
                var command = new SpecialCommandConfigurationElement(file.Name);
                command.Thumbnail = controlPanelImage;
                string thumbName = FileLocations.FormatThumbFileName(file.Name);

                Icon[] fileIcons = IconHandler.IconHandler.IconsFromFile(file.FullName, IconHandler.IconSize.Small);
                if (fileIcons != null && fileIcons.Length > 0)
                {
                    SaveIcon(fileIcons[0], thumbName);
                }

                if (File.Exists(thumbName))
                {
                    command.Thumbnail = thumbName;
                }

                command.Name       = EnsureAppletName(file);
                command.Executable = @"%systemroot%\system32\" + file.Name;
                commands.Add(command);
            }
        }
Esempio n. 8
0
        public void SaveToTableWebResult(List <PeregrineResults> results)
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            try
            {
                using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
                {
                    connection.Open();
                    SqlCommand     command = connection.CreateCommand();
                    SqlTransaction transaction;

                    for (int i = 0; i < results.Count; i++)
                    {
                        transaction         = connection.BeginTransaction($"Transaction {i}");
                        command.Connection  = connection;
                        command.Transaction = transaction;
                        command.CommandText = $"Insert into [Peregrine Results] ([Date],[CIK],[Symbol],[Last Close],[50 Day Avg], [Name], [Address 1], [Address 2]," +
                                              $"[City / State], [Phone], [SIC], [Industry], [MACD], [MACD Signal], [Stochastic Slow], [Stochastic Signal]) " +
                                              $"Values (Convert(Date,'{results[i].Date}'),{results[i].CIK}, '{results[i].Symbol.Trim()}',{results[i].LastClose}," +
                                              $"{results[i].FiftyDay}, '{results[i].Name.Trim()}', '{results[i].Address1.Trim()}', '{results[i].Address2.Trim()}', '{results[i].CityState.Trim()}'," +
                                              $"'{results[i].Phone.Trim()}', {results[i].SIC}, '{results[i].Industry.Trim()}',{results[i].MACD},{results[i].MACDSignal}," +
                                              $"{results[i].Stochastic}, {results[i].StochasticSignal});";

                        command.ExecuteNonQuery();

                        transaction.Commit();
                    }
                }
            }
            // If Address 2 is Null the null ref ex is caught and the insert is tried without reference to address 2 allowing it to enter the table as a null ref.
            catch (NullReferenceException)
            {
                using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
                {
                    connection.Open();
                    SqlCommand     command = connection.CreateCommand();
                    SqlTransaction transaction;

                    for (int i = 0; i < results.Count; i++)
                    {
                        transaction         = connection.BeginTransaction($"Transaction {i}");
                        command.Connection  = connection;
                        command.Transaction = transaction;
                        command.CommandText = $"Insert into [Peregrine Results] ([Date],[CIK],[Symbol],[Last Close],[50 Day Avg], [Name], [Address 1], [Address 2]," +
                                              $"[City / State], [Phone], [SIC], [Industry], [MACD], [MACD Signal], [Stochastic Slow], [Stochastic Signal]) " +
                                              $"Values (Convert(Date,'{results[i].Date}'),{results[i].CIK}, '{results[i].Symbol.Trim()}',{results[i].LastClose}," +
                                              $"{results[i].FiftyDay}, '{results[i].Name.Trim()}', '{results[i].Address1.Trim()}', ' ', '{results[i].CityState.Trim()}'," +
                                              $"'{results[i].Phone.Trim()}', {results[i].SIC}, '{results[i].Industry.Trim()}',{results[i].MACD},{results[i].MACDSignal}," +
                                              $"{results[i].Stochastic}, {results[i].StochasticSignal});";

                        command.ExecuteNonQuery();

                        transaction.Commit();
                    }
                }
            }
        }
Esempio n. 9
0
        public GuildWarsModule()
        {
            xmlDatabase.Load(FileLocations.xmlDatabase());
            root = xmlDatabase.DocumentElement;

            // GW specific settings
            guildWarsNode = CoOpGlobal.XML.findOrCreateChild(xmlDatabase, root, "GuildWars");

            guildIDNode          = guildWarsNode.SelectSingleNode("descendant::GuildId");
            guildAccessTokenNode = guildWarsNode.SelectSingleNode("descendant::GuildAccessToken");

            if (guildIDNode != null && guildAccessTokenNode != null)
            {
                guildId          = guildIDNode.InnerText;
                guildAccessToken = guildAccessTokenNode.InnerText;
            }
            else
            {
                guildId          = null;
                guildAccessToken = null;
            }

            // GW non tradeable items
            accountBoundItemsNode = CoOpGlobal.XML.findOrCreateChild(xmlDatabase, guildWarsNode, "AccountBoundItems");
        }
Esempio n. 10
0
        public void Test_Language_Scan()
        {
            var languageConfig = LanguageConfigBuilder.Create()
                                 .WithSpecificDirectories(
                ScanLocations.GenerateScanDirectories(
#if NET471
                    "net471",
#else
                    "netcoreapp3.0",
#endif
                    "Application.Demo",
                    "Application.Demo.Addon",
                    "Application.Demo.MetroAddon",
                    "Application.Demo.OverlayAddon").ToArray()
                )
                                 .BuildLanguageConfig();


            var filePattern = new Regex(languageConfig.FileNamePattern, RegexOptions.Compiled);

            var groupedFiles = FileLocations.Scan(languageConfig.SpecifiedDirectories, filePattern)
                               .GroupBy(x => x.Item2.Groups["IETF"].Value)
                               .ToDictionary(group => group.Key, group => group.Select(x => x.Item1)
                                             .ToList());

            var foundFiles = FileLocations.Scan(languageConfig.SpecifiedDirectories, filePattern).Select(tuple => tuple.Item1).Select(Path.GetFileName).ToList();

            Assert.Contains("language_addon1-de-DE.xml", foundFiles);
            Assert.Contains("language_addon1-en-US.xml", foundFiles);
        }
Esempio n. 11
0
 public LoginPage()
 {
     _wait           = new Waits();
     _fileLocations  = new FileLocations();
     _elementActions = new ElementActions();
     PageFactory.InitElements(BeforeHooks.driver, this);
 }
Esempio n. 12
0
        public string Save(int id, HttpPostedFileBase image, FileLocations location)
        {
            var path = string.Empty;

            try
            {
                var extension  = Path.GetExtension(image.FileName);
                var folderPath = this.server.MapPath($"~/Content/DynamicResources/{location.ToString()}");

                if (!Directory.Exists(folderPath))
                {
                    Directory.CreateDirectory(folderPath);
                }

                path = $"~/Content/DynamicResources/{location.ToString()}/{id}{extension}";
                var serverPath = server.MapPath(path);
                image.SaveAs(serverPath);
            }
            catch
            {
                return(string.Empty);
            }

            return(path);
        }
Esempio n. 13
0
        //TODO: Complete the query. Check the Table.
        public void SaveToTableResult(string database, List <Results> results)
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                connection.Open();
                SqlCommand     command = connection.CreateCommand();
                SqlTransaction transaction;

                for (int i = 0; i < results.Count; i++)
                {
                    transaction         = connection.BeginTransaction($"Transaction {i}");
                    command.Connection  = connection;
                    command.Transaction = transaction;
                    command.CommandText = $"Insert into Results ([Date],[CIK],[Symbol],[Last Close],[50 Day Avg],[MACD],[MACD Signal],[EMA 12],[EMA 26],[Stochastic Fast],[Stochastic Slow],[Stochastic Signal]) " +
                                          $"Values (Convert(Date,'{results[i].Date}'),{results[i].CIK}, '{results[i].Symbol.Trim()}',{results[i].LastClose}," +
                                          $"{results[i].FiftyDayAvg}, {results[i].mACD},{results[i].MACDSignal}, {results[i].EMA12},{results[i].EMA26}," +
                                          $"{results[i].StochasticFast},{results[i].StochasticSlow},{results[i].StochasticSignal});";

                    command.ExecuteNonQuery();

                    transaction.Commit();
                }
            }
        }
Esempio n. 14
0
        public void TruncateStockTable(string tablename)
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                connection.Open();                               // opens connection to SQL Database

                SqlCommand command = connection.CreateCommand(); // translates text to SQL commands for the database

                SqlTransaction transaction;

                transaction = connection.BeginTransaction("Truncate Table"); // transaction must have a name

                command.Connection  = connection;
                command.Transaction = transaction;


                command.CommandText = $"TRUNCATE TABLE [{tablename}];";
                command.ExecuteNonQuery();
                transaction.Commit();
            }
        }
Esempio n. 15
0
        /// <summary>
        ///     Helper to create the location of a file
        /// </summary>
        /// <param name="checkStartupDirectory"></param>
        /// <param name="postfix"></param>
        /// <param name="specifiedDirectory"></param>
        /// <returns>File location</returns>
        private string CreateFileLocation(bool checkStartupDirectory, string postfix = "", string specifiedDirectory = null)
        {
            string file = null;

            if (specifiedDirectory != null)
            {
                file = Path.Combine(specifiedDirectory, $"{_iniFileConfig.FileName}{postfix}.{_iniFileConfig.IniExtension}");
            }
            else
            {
                if (checkStartupDirectory)
                {
                    var startPath = FileLocations.StartupDirectory;
                    if (startPath != null)
                    {
                        file = Path.Combine(startPath, $"{_iniFileConfig.FileName}{postfix}.{_iniFileConfig.IniExtension}");
                    }
                }
                if (file is null || !File.Exists(file))
                {
                    var appDataDirectory = FileLocations.RoamingAppDataDirectory(_iniFileConfig.ApplicationName);
                    file = Path.Combine(appDataDirectory, $"{_iniFileConfig.FileName}{postfix}.{_iniFileConfig.IniExtension}");
                }
            }
            Log.Verbose().WriteLine("File location: {0}", file);
            return(file);
        }
        public int DatabaseCIKQuery(string stock)
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            int CIK = 0;

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                string queryString = $"SELECT CIK FROM CentralIndexKey WHERE Symbol = '{stock}'"; // Query sent to SQL database

                SqlCommand command = new SqlCommand(queryString, connection);                     //

                command.Parameters.AddWithValue($"{stock}", stock);
                connection.Open();                                     // opens the connection to the database

                using (SqlDataReader reader = command.ExecuteReader()) // opens the datareader to retrieve data with query
                {
                    while (reader.Read())
                    {
                        CIK = Convert.ToInt32(reader["CIK"]);
                    }
                }

                connection.Close();
            }
            return(CIK);
        }
Esempio n. 17
0
        public double CloseQuery(string stock) /// TODO: make this method able to retrieve any price.
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            double Close = 0;

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                string queryString = $"select S.[Close]  from Stocks as S  where S.Symbol = '{stock}' order by S.Date ASC";

                SqlCommand command = new SqlCommand(queryString, connection); //

                command.Parameters.AddWithValue($"{stock}", stock);
                connection.Open();                                     // opens the connection to the database

                using (SqlDataReader reader = command.ExecuteReader()) // opens the datareader to retrieve data with query
                {
                    while (reader.Read())
                    {
                        Close = Convert.ToDouble(reader[$"Close"]);
                    }
                }

                connection.Close();
            }
            return(Close);
        }
Esempio n. 18
0
        public void SaveToTableStockPrices(List <Stock> stock)
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                connection.Open();
                SqlCommand     command = connection.CreateCommand();
                SqlTransaction transaction;

                for (int i = 0; i < stock.Count; i++)
                {
                    transaction         = connection.BeginTransaction($"Transaction {i}");
                    command.Connection  = connection;
                    command.Transaction = transaction;
                    command.CommandText = $"Insert into Stocks ([StockID],[Symbol],[Date],[Open],[High],[Low],[Close],[Volume]) " +
                                          $"Values ({stock[i].CIK}, '{stock[i].Symbol.Trim()}', Convert(Date,'{stock[i].Date}'), {stock[i].OpenPrice}, " +
                                          $"{stock[i].HighPrice}, {stock[i].LowPrice},{stock[i].ClosePrice}, {stock[i].Volume});";

                    command.ExecuteNonQuery();

                    transaction.Commit();
                }
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Returns a list of distinct stock ticker symbols for the specified table.
        /// </summary>
        /// <param name="database"></param>
        /// <param name="table"></param>
        /// <returns></returns>
        public List <string> DatabaseSymbolListQuery(string table)
        {
            FileLocations locations = new FileLocations();

            var connect = locations.DatabaseConnectionString(); // returns Database connectionstring for SQLConnection

            List <string> Symbol = new List <string>();

            using (SqlConnection connection = new SqlConnection(connect.ConnectionString))
            {
                string queryString = $"SELECT DISTINCT S.[Symbol] FROM [{table}] AS S ORDER BY S.Symbol ASC";

                SqlCommand command = new SqlCommand(queryString, connection); //

                command.Parameters.AddWithValue($"Symbol", "Symbol");
                connection.Open();                                     // opens the connection to the database

                using (SqlDataReader reader = command.ExecuteReader()) // opens the datareader to retrieve data with query
                {
                    while (reader.Read())
                    {
                        Symbol.Add(Convert.ToString(reader["Symbol"]));
                    }
                }

                connection.Close();
            }
            return(Symbol);
        }
Esempio n. 20
0
        private async Task convertToNewDbCommand()
        {
            XmlDocument xmlDatabase = new XmlDocument();
            XmlNode     dbRoot;
            XmlNode     usersNode;
            IEnumerator usersEnumerator;

            try
            {
                xmlDatabase.Load(FileLocations.xmlDatabase());
                dbRoot          = xmlDatabase.DocumentElement;
                usersNode       = CoOpGlobal.XML.findOrCreateChild(xmlDatabase, dbRoot, "Users");
                usersEnumerator = usersNode.GetEnumerator();

                while (usersEnumerator.MoveNext())
                {
                    XmlElement curNode = usersEnumerator.Current as XmlElement;
                    User       user    = new User();

                    user.userID   = ulong.Parse(curNode.GetAttribute("id"));
                    user.steamID  = CoOpGlobal.XML.findOrCreateChild(xmlDatabase, curNode, "steamID").InnerText;  // curNode.SelectSingleNode("descendant::steamID").InnerText;
                    user.gwAPIKey = CoOpGlobal.XML.findOrCreateChild(xmlDatabase, curNode, "gwAPIKey").InnerText; //curNode.SelectSingleNode("descendant::gwAPIKey").InnerText;
                    user.insert();
                }

                await ReplyAsync("Done");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Esempio n. 21
0
        public void TestScanRegex()
        {
            var startupDirectory = FileLocations.StartupDirectory;
            var files            = FileLocations.Scan(new[] { startupDirectory }, new Regex(@".*\.xml"));

            Assert.Contains(files, file => file.Item1.EndsWith("Dapplo.Addons.xml"));
        }
Esempio n. 22
0
 public Job(IGoogleService googleService,
            IAddressBuilder addressBuilder,
            IOptions <FileLocations> fileLocationOptions)
 {
     _googleService  = googleService;
     _addressBuilder = addressBuilder;
     _fileLocations  = fileLocationOptions.Value;
 }
Esempio n. 23
0
        public void TestScanFilePatternToRegex()
        {
            var startupDirectory = FileLocations.StartupDirectory;
            var regex            = FileTools.FilenameToRegex("*", new[] { ".xml" });
            var files            = FileLocations.Scan(new[] { startupDirectory }, regex);

            Assert.Contains(files, file => file.Item1.EndsWith("Dapplo.Addons.xml"));
        }
Esempio n. 24
0
        public string GetChannelInboundFilepath(Channel channel)
        {
            string prefix   = (!channel.InGameDll ? "outcmds" : "incmds");
            string filename = string.Format("{0}_{1}.txt", prefix, channel.ProcessId);
            string filepath = System.IO.Path.Combine(FileLocations.GetRunningFolder(), filename);

            return(filepath);
        }
Esempio n. 25
0
        static void SavePrefs()
        {
            // save off the last good FSAA value
            PreferencesManager.Set(PrefNames.FSAA, WindowManager.MainWindowAAFactor);

            // TODO, save window positions and resolutions

            PreferencesManager.Save(FileLocations.GetOptionsFile());
        }
Esempio n. 26
0
        static void LoadMods()
        {
            if (!PreferencesManager.GetValueB(PrefNames.ModName))
            {
                return;
            }

            FileLocations.AddUserAndApplicationSubDirAssets("mods/" + PreferencesManager.Get(PrefNames.ModName));
        }
 public RSSSettings(FileLocations location)
 {
     Location = location;
     SaveRSSFeedsOnEveryRefresh = false;
     NotifyOnRSSErrors          = true;
     EnabledRSSReader           = true;
     IncrementalSearch          = false;
     IntervalMinutes            = 5;
 }
Esempio n. 28
0
 private Task DoDeleteFileLocation(object o)
 {
     return(Task.Factory.StartNew(() =>
     {
         Parent.SyncContext.Post(c =>
         {
             FileLocations.Remove((FileLocation)o);
         }, null);
     }));
 }
Esempio n. 29
0
        private static IEnumerable <TaskDataset> CreateDatasetChoices(FileLocations fileLocations)
        {
            yield return(new TaskDataset {
                DatasetName = "Small dataset", DatasetPath = fileLocations.SmallTaskList, SavePath = fileLocations.SmallAssignmentList
            });

            yield return(new TaskDataset {
                DatasetName = "Large dataset", DatasetPath = fileLocations.LargeTaskList, SavePath = fileLocations.LargeAssignmentList
            });
        }
Esempio n. 30
0
 public static bool Initialize()
 {
     if (!DirectoryLocations.Initialize() || !FileLocations.Initialize())
     {
         return(false);
     }
     LogClassificationTypes.Initialize();
     Logger.AddLog(new LogData("", LogTypes.Default.LogConfigIo, LogClassificationTypes.Information));
     return(true);
 }