private bool FeedInputValid() { return(Validater.IsPresent(tbUrl) && Validater.IsValidRss(tbUrl.Text) && Validater.DropDownBoxIsSelected(cbFrekvens) && Validater.DropDownBoxIsSelected(cbKategori)); }
public BaseForm() { InitializeComponent(); validater = new Validater(); //validater.ErrorColor = ColorConfiguration.GetColor("ErrorInputElementBackColor"); //validater.RequiredColor =ColorConfiguration.GetColor("RequiredInputElementBackColor"); this.FormClosing += new FormClosingEventHandler(BaseForm_FormClosing); }
private void btnSparaFeed_Click(object sender, EventArgs e) { if (Validater.DropDownBoxIsSelected(cbFrekvens) && Validater.DropDownBoxIsSelected(cbKategori)) { var feedTitle = lvFeed.FocusedItem.SubItems[1].Text; var nyFrekvens = int.Parse(cbFrekvens.SelectedItem.ToString()); string nyKategori = cbKategori.SelectedItem.ToString(); feedList.changeFeed(feedTitle, nyKategori, nyFrekvens); } }
private static void SeedPaymentMethods(BillsPaymentSystemContext database) { PaymentMethod[] paymentMethods = PaymentMethodGenerator.GeneratePaymentMethods(); for (int i = 0; i < paymentMethods.Length; i++) { if (Validater.IsEntityValid(paymentMethods[i])) { database.PaymentMethods.Add(paymentMethods[i]); } } database.SaveChanges(); }
private static void SeedCreditCards(BillsPaymentSystemContext database) { CreditCard[] creditCards = CreditCardGenerator.GenerateCreditCards(); for (int i = 0; i < creditCards.Length; i++) { if (Validater.IsEntityValid(creditCards[i])) { database.CreditCards.Add(creditCards[i]); } } database.SaveChanges(); }
private static void SeedBankAccounts(BillsPaymentSystemContext database) { BankAccount[] bankAccounts = BankAccountGenerator.GenerateBankAccounts(); for (int i = 0; i < bankAccounts.Length; i++) { if (Validater.IsEntityValid(bankAccounts[i])) { database.BankAccounts.Add(bankAccounts[i]); } } database.SaveChanges(); }
private static void SeedUsers(BillsPaymentSystemContext database) { User[] users = UserGenerator.GenerateUsers(); for (int i = 0; i < users.Length; i++) { if (Validater.IsEntityValid(users[i])) { database.Users.Add(users[i]); } } database.SaveChanges(); }
public void UpdateValues(TemplateSet origin) { this.validity = origin.validity; this.extension = origin.extension; this.context = origin.context; this.label = origin.label; this.ignores = new List<string>(origin.ignores); this.considers = new List<string>(origin.considers); this.functions = new List<ExecutorFunctionSet>(origin.functions); this.functions.ForEach(func => func.CheckMethod()); }
public TemplateSet() { this.validity = Validater.validate; this.Extension = ".cs"; this.context = "using UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\n\nnamespace %{NAMESPACE_PATH} {\n\t[AddComponentMenu(\"%{MENU_PATH}\")]\n\tpublic class %{CLASS_NAME} : MonoBehaviour {\n\t\t\n\t\t\n\t\tvoid Start () {\n\t\t\t\n\t\t}\n\t\t\n\t\tvoid Update () {\n\t\t\t\n\t\t}\n\t}\n}\n"; this.label = "Templatable"; this.ignores.Add("Assets/Common/"); this.considers.Add("Scripts"); this.functions.Add(new ExecutorFunctionSet("%{CLASS_NAME}", "GetClass")); this.functions.Add(new ExecutorFunctionSet("%{NAMESPACE_PATH}", "GetNamespacePath")); this.functions.Add(new ExecutorFunctionSet("%{MENU_PATH}", "GetMenuPath")); }
static void Main() { Validater v = new Validater(); String IISFilename = @"http://www.it.deakin.edu.au/SIT323/Task2/Test1.czl"; String azureFilename = @"http://sit323.azurewebsites.net/Task2/Test1.czl"; try { v.GetMaxCrozzle(IISFilename); } catch { v.GetMaxCrozzle(azureFilename); } /*Application.EnableVisualStyles(); * Application.SetCompatibleTextRenderingDefault(false); * Application.Run(new Form1());*/ /*SubSolutions subSolutions = new SubSolutions(v.WordList, 2); * subSolutions.testSolutions();*/ }
static void Main(string[] args) { var poolArgs = AnalysisArgs(args); if (poolArgs == null) { ShowCommandHelp(); return; } Init(poolArgs); if (!Validater.PoolAccount(poolArgs.Account)) { LogHelper.Error("Wallet Address is invalid"); return; } Start(poolArgs); Console.ReadKey(); }
private bool KategoriInputValid() { return(Validater.IsPresent(tbKategori)); }
private void validateFileToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog fileDialog = new OpenFileDialog(); if (fileDialog.ShowDialog() == DialogResult.OK) { Validater validater = new Validater(); validater.ValidateCrozzleText(fileDialog.FileName); char[,] crozzleGrid = validater.CrozzleGrid; String style = validater.ConfigDic["STYLE"] != null ? validater.ConfigDic["STYLE"].Split('\"')[1] : @"<style> table, td { border: 1px solid black; border-collapse: collapse; } td { width:24px; height:18px; text-align: center; } </style>"; String crozzleHTML = @"<!DOCTYPE html> <html> <head>" + style + @"</head> <body> <table>"; for (int row = 0; row < crozzleGrid.GetLength(0); row++) { String tr = "<tr>"; for (int column = 0; column < crozzleGrid.GetLength(1); column++) { String tdEmpty = validater.ConfigDic["BGCOLOUR_EMPTY_TD"] != null ? @"<td style='background-color:" + validater.ConfigDic["BGCOLOUR_EMPTY_TD"] + "'>" + crozzleGrid[row, column] + @"</td>" : @"<td>" + crozzleGrid[row, column] + @"</td>"; String tdNonEmpty = validater.ConfigDic["BGCOLOUR_NON_EMPTY_TD"] != null ? @"<td style='background-color:" + validater.ConfigDic["BGCOLOUR_NON_EMPTY_TD"] + "'>" + crozzleGrid[row, column] + @"</td>" : @"<td>" + crozzleGrid[row, column] + @"</td>"; // Empty. if (crozzleGrid[row, column] == '\0') { tr += tdEmpty; } else { tr += tdNonEmpty; } } tr += "</tr>"; crozzleHTML += tr; } crozzleHTML += @"</table> </body> </html>"; crozzleWebBrowser.DocumentText = crozzleHTML; String errorHTML = @"<!DOCTYPE html><html><head></head><body>"; try { String[] errorLines = File.ReadAllLines(validater.LogPath); foreach (String line in errorLines) { errorHTML += "<p>" + line + "</p>"; } } catch (Exception) { errorHTML += "<p>" + "LogFile path is not correct. So program cannot show the errors. Check the file you opened." + "</p>"; } errorHTML += "</body></html>"; errorWebBrowser.DocumentText = errorHTML; bool allValid = true; foreach (bool b in validater.ValidInfo) { if (!b) { allValid = false; } } scoreTextBox.Text = validater.Score.ToString(); if (!allValid) { if (validater.ConfigDic["INVALID_CROZZLE_SCORE"] != null) { scoreTextBox.Text += " " + validater.ConfigDic["INVALID_CROZZLE_SCORE"]; } } } }