private int GetSearchHash() { unchecked { int hashCode = 13; hashCode = (hashCode * 397) ^ SampleText?.GetHashCode() ?? 5; hashCode = (hashCode * 397) ^ SearchFor?.GetHashCode() ?? 5; hashCode = (hashCode * 397) ^ TypeOfSearch.GetHashCode(); hashCode = (hashCode * 397) ^ CaseSensitive.GetHashCode(); hashCode = (hashCode * 397) ^ WholeWord.GetHashCode(); hashCode = (hashCode * 397) ^ Multiline.GetHashCode(); hashCode = (hashCode * 397) ^ Singleline.GetHashCode(); hashCode = (hashCode * 397) ^ BooleanOperators.GetHashCode(); hashCode = (hashCode * 397) ^ HighlightCaptureGroups.GetHashCode(); return(hashCode); } }
protected override void ProcessRecord() { var ctl = new PsMessage(); SetControlProps(ctl); ctl.OnDismiss = OnDismiss; ctl.Value = Value; if (Multiline.IsPresent) { ctl.Multiline = Multiline.ToBool(); } if (Truncated.IsPresent) { ctl.Truncated = Truncated.ToBool(); } if (Dismiss.IsPresent) { ctl.Dismiss = Dismiss.ToBool(); } if (Type.HasValue) { ctl.Type = Type.Value; } if (Buttons != null) { foreach (var button in Buttons) { ctl.Buttons.Add(button); } } WriteObject(ctl); }
public override void Serialize(ElementPropertyBag epb, IEnumerable <GraphicElement> elementsBeingSerialized) { Json["Multiline"] = Multiline.ToString(); Json["ReadOnly"] = ReadOnly.ToString(); base.Serialize(epb, elementsBeingSerialized); }
private void ReadFile(string name) { Trace.WriteLine(string.Format("Queries.file -> {0}", name)); using (StreamReader reader = new StreamReader(Assembly.GetExecutingAssembly() .GetManifestResourceStream(name))) { Multiline __multiLine = new Multiline(); while (true) { if (reader.Peek() == -1) { break; } string __line = reader.ReadLine().Trim(); if (__line.Trim().Length == 0) { continue; } if (__line.Trim().StartsWith(";")) { continue; } if (__line.Trim().StartsWith("--")) { continue; } // =================================================== // Inicio del modo multi línea // =================================================== if (__line.Trim().StartsWith(">>>")) { __multiLine.active = true; __multiLine.Name = ""; __multiLine.Buffer.Clear(); continue; } if (__multiLine.active) { // ================================================= // Nombre de la consulta // ================================================= if (__multiLine.Name == "") { __multiLine.Name = __line; continue; } // ============================================================ // Fin del modo multi línea // ============================================================ if (__line == "<<<") { _querys.Add(__multiLine.Name, __multiLine.Buffer.ToString()); __multiLine.active = false; continue; } if (__line.StartsWith("#")) { _querys.Add(__multiLine.Name, __multiLine.Buffer.ToString()); __multiLine.active = false; } else { // ============================================= // Almacenar la línea // ============================================= __multiLine.Buffer.AppendLine(__line); continue; } } // ========================================================================= // Consultas en una sola línea // ========================================================================= int index = __line.IndexOf('%'); _querys.Add(__line.Substring(1, index - 1), __line.Substring(index + 1)); } if (__multiLine.active) { _querys.Add(__multiLine.Name, __multiLine.Buffer.ToString()); } } }