private void SetTitle(NavigationCommandType type) { switch (type) { case NavigationCommandType.RsaKeyGen: lblTitel.Content = RsaKeyGenCtrl.title; break; case NavigationCommandType.Start: lblTitel.Content = Common.startTitle; break; case NavigationCommandType.SigGen: lblTitel.Content = SigGenRsaCtrl.title; break; case NavigationCommandType.SigGenFakeBleichenb: lblTitel.Content = SigGenBleichenbCtrl.title; break; case NavigationCommandType.SigGenFakeShort: lblTitel.Content = SigGenKuehnCtrl.title; break; case NavigationCommandType.SigVal: lblTitel.Content = SigValCtrl.title; break; } }
private void link_Click(object sender, RoutedEventArgs e) { if (null != OnNavigate) { NavigationCommandType commandtype = NavigationCommandType.None; if (sender == link_SignatureGenerate) { commandtype = NavigationCommandType.SigGen; } else if (sender == link_RsaKeyGenerate) { commandtype = NavigationCommandType.RsaKeyGen; } else if (sender == link_AttackBleichenbacher) { commandtype = NavigationCommandType.SigGenFakeBleichenb; } else if (sender == link_AttackShortKeysVariant) { commandtype = NavigationCommandType.SigGenFakeShort; } else if (sender == link_SignatureValidate) { commandtype = NavigationCommandType.SigVal; } else if (sender == link_Start) { commandtype = NavigationCommandType.Start; } OnNavigate(commandtype); } }
private void Navigate(NavigationCommandType type) { if (m_ActualControl != null) { m_ActualControl.Dispose(); } SetTitle(type); switch (type) { case NavigationCommandType.RsaKeyGen: if (m_RsaKeyGenControl == null) { m_RsaKeyGenControl = new RsaKeyGenControl(); } SetUserControl(m_RsaKeyGenControl); break; case NavigationCommandType.SigGen: if (m_SigGenControl == null) { m_SigGenControl = new SigGenPkcs1Control(); } SetUserControl(m_SigGenControl); break; case NavigationCommandType.SigGenFakeBleichenb: if (m_SigGenFakeBleichenbControl == null) { m_SigGenFakeBleichenbControl = new SigGenFakeBleichenbControl(); } SetUserControl(m_SigGenFakeBleichenbControl); break; case NavigationCommandType.SigGenFakeShort: if (m_SigGenFakeShortControl == null) { m_SigGenFakeShortControl = new SigGenFakeShortControl(); } SetUserControl(m_SigGenFakeShortControl); break; case NavigationCommandType.SigVal: if (m_SigValControl == null) { m_SigValControl = new SigValControl(); } SetUserControl(m_SigValControl); break; case NavigationCommandType.Start: if (m_StartControl == null) { m_StartControl = new StartControl(); } SetUserControl(m_StartControl); break; } }
private void SetTitle(NavigationCommandType type) { imghelp.Visibility = Visibility.Visible; switch (type) { case NavigationCommandType.Factor_QS: case NavigationCommandType.Factor_Bf: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_factorize; break; case NavigationCommandType.Start: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_start; //imghelp.Visibility = Visibility.Hidden; break; case NavigationCommandType.Primetest_Miller: case NavigationCommandType.Primetest_Sieve: case NavigationCommandType.SieveOfAtkin: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_primetest; break; case NavigationCommandType.Primespirals: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_primespiral; break; case NavigationCommandType.Primesgeneration: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_primesgeneration; break; case NavigationCommandType.PrimeDistrib_Numberline: case NavigationCommandType.PrimeDistrib_Numberrec: case NavigationCommandType.PrimeDistrib_Ulam: case NavigationCommandType.Graph: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_distribution; break; case NavigationCommandType.NumberTheoryFunctions: case NavigationCommandType.PrimitivRoot: case NavigationCommandType.PowerMod: case NavigationCommandType.PrimeDistrib_Goldbach: lblTitel.Content = Primes.Resources.lang.PrimesControl.PrimesControl.title_Numbertheory; break; } }
private void link_Click(object sender, RoutedEventArgs e) { if (null == OnNavigate) { return; } NavigationCommandType commandtype = NavigationCommandType.None; if (Equals(sender, link_Start)) { commandtype = NavigationCommandType.Start; } else if (Equals(sender, link_Gauss)) { commandtype = NavigationCommandType.Gauss; } else if (Equals(sender, link_LLL)) { commandtype = NavigationCommandType.LLL; } else if (Equals(sender, link_CVP)) { commandtype = NavigationCommandType.CVP; } else if (Equals(sender, link_MerkleHellman)) { commandtype = NavigationCommandType.MerkleHellman; } else if (Equals(sender, link_RSA)) { commandtype = NavigationCommandType.RSA; } else if (Equals(sender, link_GGH)) { commandtype = NavigationCommandType.GGH; } else if (Equals(sender, link_LWE)) { commandtype = NavigationCommandType.LWE; } OnNavigate(commandtype); }
private void SetTitle(NavigationCommandType type) { switch (type) { case NavigationCommandType.Start: lblTitel.Content = Languages.LatticeSettings; break; case NavigationCommandType.Gauss: lblTitel.Content = Languages.tabGaussAlgorithm; break; case NavigationCommandType.LLL: lblTitel.Content = Languages.tabLLLAlgorithm; break; case NavigationCommandType.CVP: lblTitel.Content = Languages.tabFindCVP; break; case NavigationCommandType.MerkleHellman: lblTitel.Content = Languages.tabAttackMerkleHellman; break; case NavigationCommandType.RSA: lblTitel.Content = Languages.tabAttackRSA; break; case NavigationCommandType.GGH: lblTitel.Content = Languages.tabGGH; break; case NavigationCommandType.LWE: lblTitel.Content = Languages.tabLWE; break; } }
void b_Navigating(object sender, System.Windows.Forms.WebBrowserNavigatingEventArgs e) { string target = e.Url.AbsoluteUri; if (target.IndexOf("exec://") >= 0) { target = target.Replace("exec://", ""); target = target.Replace("/", ""); } if (!string.IsNullOrEmpty(target) && OnStartpageLinkClick != null) { NavigationCommandType action = NavigationCommandType.None; switch (target.ToLower()) { case "factor_bf": action = NavigationCommandType.Factor_Bf; break; case "factor_qs": action = NavigationCommandType.Factor_QS; break; case "primetest_sieve": action = NavigationCommandType.Primetest_Sieve; break; case "primetest_miller": action = NavigationCommandType.Primetest_Miller; break; case "primesgeneration": action = NavigationCommandType.Primesgeneration; break; case "graph": action = NavigationCommandType.Graph; break; case "primedistrib_numberline": action = NavigationCommandType.PrimeDistrib_Numberline; break; case "primedistrib_numberrec": action = NavigationCommandType.PrimeDistrib_Numberrec; break; case "primedistrib_ulam": action = NavigationCommandType.PrimeDistrib_Ulam; break; case "primitivroot": action = NavigationCommandType.PrimitivRoot; break; case "powermod": action = NavigationCommandType.PowerMod; break; case "numbertheoryfunctions": action = NavigationCommandType.NumberTheoryFunctions; break; case "primedistrib_goldbach": action = NavigationCommandType.PrimeDistrib_Goldbach; break; } if (action != NavigationCommandType.None) { OnStartpageLinkClick(action); e.Cancel = true; } } }
private void Navigate(NavigationCommandType type) { if (m_ActualControl != null) { m_ActualControl.Dispose(); } SetTitle(type); switch (type) { case NavigationCommandType.Start: if (m_StartControl == null) { m_StartControl = new StartControl(); } SetUserControl(m_StartControl); break; case NavigationCommandType.Gauss: if (m_GaussControl == null) { m_GaussControl = new SvpGaussView(); } SetUserControl(m_GaussControl); break; case NavigationCommandType.LLL: if (m_LLLControl == null) { m_LLLControl = new SvpLLLView(); } SetUserControl(m_LLLControl); break; case NavigationCommandType.CVP: if (m_CVPControl == null) { m_CVPControl = new CvpView(); } SetUserControl(m_CVPControl); break; case NavigationCommandType.MerkleHellman: if (m_MerkleHellmanControl == null) { m_MerkleHellmanControl = new MerkleHellmanView(); } SetUserControl(m_MerkleHellmanControl); break; case NavigationCommandType.RSA: if (m_RSAControl == null) { m_RSAControl = new RSAView(); } SetUserControl(m_RSAControl); break; case NavigationCommandType.GGH: if (m_GGHControl == null) { m_GGHControl = new GGHView(); } SetUserControl(m_GGHControl); break; case NavigationCommandType.LWE: if (m_LWEControl == null) { m_LWEControl = new LWEView(); } SetUserControl(m_LWEControl); break; } }
private void Navigate(NavigationCommandType type, bool incHistory) { if (m_ActualControl != null) { m_ActualControl.Dispose(); } SetTitle(type); switch (type) { case NavigationCommandType.Start: if (m_StartControl == null) { m_StartControl = new StartControl(); } SetUserControl(m_StartControl); break; case NavigationCommandType.Factor_Bf: if (m_FactorizationControl == null) { m_FactorizationControl = new FactorizationControl(); } SetUserControl(m_FactorizationControl, 0); break; case NavigationCommandType.Factor_QS: if (m_FactorizationControl == null) { m_FactorizationControl = new FactorizationControl(); } SetUserControl(m_FactorizationControl, 2); break; case NavigationCommandType.Primetest_Miller: if (m_PrimetestControl == null) { m_PrimetestControl = new PrimetestControl(NavigateHistory); } SetUserControl(m_PrimetestControl, 2); break; case NavigationCommandType.Primetest_Sieve: if (m_PrimetestControl == null) { m_PrimetestControl = new PrimetestControl(NavigateHistory); } SetUserControl(m_PrimetestControl, 0); break; case NavigationCommandType.SieveOfAtkin: if (m_PrimetestControl == null) { m_PrimetestControl = new PrimetestControl(NavigateHistory); } SetUserControl(m_PrimetestControl, 3); break; case NavigationCommandType.PrimeDistrib_Numberline: if (m_PrimesInNaturalNumbersControl == null) { m_PrimesInNaturalNumbersControl = new PrimesInNaturalNumbersControl(); } SetUserControl(m_PrimesInNaturalNumbersControl, 0); break; case NavigationCommandType.PrimeDistrib_Numberrec: if (m_PrimesInNaturalNumbersControl == null) { m_PrimesInNaturalNumbersControl = new PrimesInNaturalNumbersControl(); } SetUserControl(m_PrimesInNaturalNumbersControl, 1); break; case NavigationCommandType.Graph: if (m_GraphControl == null) { m_GraphControl = new GraphControl(); } if (m_PrimesInNaturalNumbersControl == null) { m_PrimesInNaturalNumbersControl = new PrimesInNaturalNumbersControl(); } SetUserControl(m_PrimesInNaturalNumbersControl, 2); break; case NavigationCommandType.PrimeDistrib_Ulam: if (m_PrimesInNaturalNumbersControl == null) { m_PrimesInNaturalNumbersControl = new PrimesInNaturalNumbersControl(); } SetUserControl(m_PrimesInNaturalNumbersControl, 3); break; case NavigationCommandType.Numberline: if (m_PrimesInNaturalNumbersControl == null) { m_PrimesInNaturalNumbersControl = new PrimesInNaturalNumbersControl(); } SetUserControl(m_PrimesInNaturalNumbersControl); break; case NavigationCommandType.Primespirals: if (m_PrimespiralControl == null) { m_PrimespiralControl = new PrimesprialControl(); } SetUserControl(m_PrimespiralControl); break; case NavigationCommandType.Primesgeneration: if (m_PrimesgenerationControl == null) { m_PrimesgenerationControl = new PrimesgenerationControl(); } SetUserControl(m_PrimesgenerationControl); break; case NavigationCommandType.PowerMod: if (m_NumberTheoryControl == null) { m_NumberTheoryControl = new NumberTheoryControl(); } SetUserControl(m_NumberTheoryControl, 0); break; case NavigationCommandType.NumberTheoryFunctions: if (m_NumberTheoryControl == null) { m_NumberTheoryControl = new NumberTheoryControl(); } SetUserControl(m_NumberTheoryControl, 1); break; case NavigationCommandType.PrimitivRoot: if (m_NumberTheoryControl == null) { m_NumberTheoryControl = new NumberTheoryControl(); } SetUserControl(m_NumberTheoryControl, 2); break; case NavigationCommandType.PrimeDistrib_Goldbach: if (m_NumberTheoryControl == null) { m_NumberTheoryControl = new NumberTheoryControl(); } SetUserControl(m_NumberTheoryControl, 3); break; } if (incHistory) { NavigateHistory(type); } SetHistoryButtons(); }
private void Navigate(NavigationCommandType type) { Navigate(type, true); }
private void NavigateHistory(NavigationCommandType type) { m_HistoryPointer++; m_History.RemoveRange(m_HistoryPointer, m_History.Count - m_HistoryPointer); m_History.Add(type); }
private void lnk_Click(object sender, RoutedEventArgs e) { if (OnNavigate != null) { NavigationCommandType commandtype = NavigationCommandType.None; if (sender == lnkFacBruteForce) { commandtype = NavigationCommandType.Factor_Bf; } else if (sender == lnkFacQS) { commandtype = NavigationCommandType.Factor_QS; } else if (sender == lnkTestEratothenes) { commandtype = NavigationCommandType.Primetest_Sieve; } else if (sender == lnkTestMillerRabin) { commandtype = NavigationCommandType.Primetest_Miller; } else if (sender == lnkDistribNumberline) { commandtype = NavigationCommandType.PrimeDistrib_Numberline; } else if (sender == lnkDistribNumberrec) { commandtype = NavigationCommandType.PrimeDistrib_Numberrec; } else if (sender == lnkDistribUlam) { commandtype = NavigationCommandType.PrimeDistrib_Ulam; } else if (sender == lnkPrimitivRoots) { commandtype = NavigationCommandType.PrimitivRoot; } else if (sender == lnkGenPrimes) { commandtype = NavigationCommandType.Primesgeneration; } else if (sender == lnkCountPrimes) { commandtype = NavigationCommandType.Graph; } else if (sender == lnkStartPage) { commandtype = NavigationCommandType.Start; } else if (sender == lnkNumberTheoryFunctions) { commandtype = NavigationCommandType.NumberTheoryFunctions; } else if (sender == lnkSieveOfAtkin) { commandtype = NavigationCommandType.SieveOfAtkin; } else if (sender == lnkDistribGoldbach) { commandtype = NavigationCommandType.PrimeDistrib_Goldbach; } else if (sender == lnkPowMod) { commandtype = NavigationCommandType.PowerMod; } OnNavigate(commandtype); } }