/// <summary> /// Kiểm tra tên của bạn bè có khớp với từ khóa tìm kiếm hay không (Phục vụ cho việc tìm kiếm bạn bè) /// </summary> /// <param name="Text">Từ khóa</param> /// <returns></returns> public bool NameContainsText(String Text) { if (String.IsNullOrWhiteSpace(FriendName) && String.IsNullOrWhiteSpace(Text)) { return(false); } return(FriendName.IndexOf(Text, StringComparison.InvariantCultureIgnoreCase) > -1); }
private void NewCertWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!Prompt) { DialogResult = NewCert != null ? true : false; } else { string exe = AppDomain.CurrentDomain.BaseDirectory + AppDomain.CurrentDomain.FriendlyName; string longTime = null; if (ExpirationDate.HasValue) { longTime = Convert.ToString(ExpirationDate.Value.ToFileTimeUtc()); } var procInfo = new ProcessStartInfo(exe, "/LaunchNewCert:" + SubText.Replace(" ", "%20") + "," + FriendName.Replace(" ", "%20") + "," + SavedAlgorithm + "," + SavedKeyLength + "," + longTime) { Verb = "RunAs", CreateNoWindow = false }; try { var proc = Process.Start(procInfo); } catch (Win32Exception ex) { Prompt = false; storeComboBox.SelectedIndex = 0; if (ex.Message == "The operation was canceled by the user") { e.Cancel = true; return; } else { throw new Win32Exception("Woah!", ex); } } } }