/// <summary> /// Updates all <see cref="Watch"/> in the current collection /// </summary> public void UpdateValues(PreviousType previousType) { foreach (var watch in _watchList) { watch.Update(previousType); } }
override public void Translate(XPathNavigator overrides, string category) { base.Translate(overrides, category); // Find out the necessary wrapper types. if (Pointer != 0)/* || CurrentType == "IntPtr")*/ { if (CurrentType.ToLower().Contains("string")) { // string* -> [In] String[] or [Out] StringBuilder[] QualifiedType = Flow == FlowDirection.Out ? "StringBuilder[]" : "String[]"; Pointer = 0; WrapperType = WrapperTypes.StringParameter; } else if (CurrentType.ToLower().Contains("char")) { // char* -> [In] String or [Out] StringBuilder QualifiedType = Flow == FlowDirection.Out ? "StringBuilder" : "String"; Pointer = 0; WrapperType = WrapperTypes.StringParameter; } else if (CurrentType.ToLower().Contains("void") || (!String.IsNullOrEmpty(PreviousType) && PreviousType.ToLower().Contains("void"))) /*|| CurrentType.Contains("IntPtr"))*/ { CurrentType = "IntPtr"; Pointer = 0; WrapperType = WrapperTypes.GenericParameter; } else { WrapperType = WrapperTypes.ArrayParameter; } } if (Reference) { WrapperType |= WrapperTypes.ReferenceParameter; } if (Name == "params") { Name = "@params"; } if (Name == "event") { Name = "@event"; } // This causes problems with bool arrays //if (CurrentType.ToLower().Contains("bool")) // WrapperType = WrapperTypes.BoolParameter; }
/// <summary> /// Updates all <see cref="Watch"/> in the current collection /// </summary> public void UpdateValues(PreviousType previousType) { Parallel.ForEach(_watchList, watch => { watch.Update(previousType); }); }
/// <summary> /// Update the Watch (read it from <see cref="MemoryDomain"/> /// </summary> public override void Update(PreviousType previousType) { switch (previousType) { case PreviousType.Original: return; case PreviousType.LastChange: var temp = _value; _value = GetWord(); if (_value != temp) { _previous = temp; ChangeCount++; } break; case PreviousType.LastFrame: _previous = _value; _value = GetWord(); if (_value != Previous) { ChangeCount++; } break; } }
public void Update(PreviousType type, MemoryDomain domain, bool bigendian) { var value = domain.PeekDWord(Address % domain.Size, bigendian); if (value != Previous) { _changecount++; } switch (type) { case PreviousType.Original: case PreviousType.LastSearch: break; case PreviousType.LastFrame: _previous = _prevFrame; break; case PreviousType.LastChange: if (_prevFrame != value) { _previous = _prevFrame; } break; } _prevFrame = value; }
public void Update(PreviousType type, MemoryDomain domain, bool bigEndian) { var value = MiniByteWatch.GetByte(Address, domain); if (value != _prevFrame) { ChangeCount++; } switch (type) { case PreviousType.Original: case PreviousType.LastSearch: break; case PreviousType.LastFrame: _previous = _prevFrame; break; case PreviousType.LastChange: if (_prevFrame != value) { _previous = _prevFrame; } break; } _prevFrame = value; }
// event handler for generating integer/double or char array values #region display array private void btn_genValues_Click(object sender, EventArgs e) { try { lbl_errorMsg.Text = null; if (rbtn_integer.Checked) { //textBox_numGenerator.Clear(); for (int i = 0; i < intArray.Length; i++) { intArray[i] = random.Next(10, 100); //textBox_numGenerator.Text += intArray[i].ToString(); //textBox_numGenerator.AppendText(Environment.NewLine); } listBox1.DataSource = intArray; Previous = PreviousType.Integer; } else if (rbtn_double.Checked) { //textBox_numGenerator.Clear(); for (int i = 0; i < doubleArray.Length; i++) { doubleArray[i] = Math.Round(random.NextDouble(10.0, 100.0), 2, MidpointRounding.AwayFromZero); //textBox_numGenerator.Text += doubleArray[i].ToString(); //textBox_numGenerator.AppendText(Environment.NewLine); } listBox1.DataSource = doubleArray; Previous = PreviousType.Double; } else if (rbtn_char.Checked) { //textBox_numGenerator.Clear(); for (int i = 0; i < intArray.Length; i++) { int num = random.Next(65, 122); charArray[i] = (char)(num); //textBox_numGenerator.Text += charArray[i].ToString(); //textBox_numGenerator.AppendText(Environment.NewLine); } listBox1.DataSource = charArray; Previous = PreviousType.Char; } else { lbl_errorMsg.ForeColor = Color.Red; lbl_errorMsg.Text = "You haven't selected any type of values"; } } catch (ArgumentNullException ee) { lbl_errorMsg.Text = ee.Message; } }
public void SetPreviousType(PreviousType type) { if (_settings.Mode == Settings.SearchMode.Fast) { if (type == PreviousType.LastFrame) { throw new InvalidOperationException(); } } _settings.PreviousType = type; }
/// <summary> /// Sets WatchList's domain list to a new one /// <see cref="Watch"/> domain will also be refreshed /// </summary> /// <param name="core">New domains</param> public void RefreshDomains(IMemoryDomains core, PreviousType previousType) { _memoryDomains = core; Parallel.ForEach(_watchList, watch => { if (watch.IsSeparator) { return; } watch.Domain = core[watch.Domain.Name]; watch.ResetPrevious(); watch.Update(previousType); watch.ClearChangeCount(); }); }
/// <summary> /// Sets WatchList's domain list to a new one /// <see cref="Watch"/> domain will also be refreshed /// </summary> /// <param name="core">New domains</param> public void RefreshDomains(IMemoryDomains core, PreviousType previousType) { _memoryDomains = core; foreach (var watch in _watchList) { if (watch.IsSeparator) { return; } watch.Domain = core[watch.Domain.Name]; watch.ResetPrevious(); watch.Update(previousType); watch.ClearChangeCount(); } }
public override void ToPrecedenceFreeEPL(TextWriter writer) { writer.Write(PreviousType.ToString().ToLowerInvariant()); writer.Write("("); if (PreviousType == ExprPreviousNodePreviousType.PREVCOUNT || PreviousType == ExprPreviousNodePreviousType.PREVWINDOW) { ChildNodes[1].ToEPL(writer, ExprPrecedenceEnum.MINIMUM); } else { ChildNodes[0].ToEPL(writer, ExprPrecedenceEnum.MINIMUM); if (ChildNodes.Length > 1) { writer.Write(","); ChildNodes[1].ToEPL(writer, ExprPrecedenceEnum.MINIMUM); } } writer.Write(')'); }
private void buttonGenerateValues_Click(object sender, EventArgs e) { try { // if radioButtonInteger is checked if (radioButtonInteger.Checked) { for (int i = 0; i < intArray.Length; i++) { intArray[i] = random.Next(10, 100); } listBox1.DataSource = intArray; Previous = PreviousType.Integer;// we need this when we search for a certain integer } // if radioButtonDouble is checked else if (radioButtonDouble.Checked) { for (int i = 0; i < doubleArray.Length; i++) { // generating double values and rounding them to two decimal places doubleArray[i] = Math.Round(random.NextDouble(10.0, 100.0), 2); } listBox1.DataSource = doubleArray; Previous = PreviousType.Double;// we need this when we search for a certain double } // if radioButtonChar is checked else if (radioButtonChar.Checked) { for (int i = 0; i < intArray.Length; i++) { int num = random.Next(65, 122); charArray[i] = (char)(num); } listBox1.DataSource = charArray; Previous = PreviousType.Char;// we need this when we search for a certain char } } catch (ArgumentNullException ee) { Console.WriteLine(ee.ToString()); } }
override public void Translate(string category) { base.Translate(category); // Find out the necessary wrapper types. if (Pointer)/* || CurrentType == "IntPtr")*/ { WrapperType = WrapperTypes.ArrayParameter; if (CurrentType.ToLower().Contains("char") || CurrentType.ToLower().Contains("string")) { // char* or string -> [In] String or [Out] StringBuilder CurrentType = Flow == Parameter.FlowDirection.Out ? "System.Text.StringBuilder" : "System.String"; Pointer = false; WrapperType = WrapperTypes.None; } else if (PreviousType != null && (CurrentType.ToLower().Contains("void") || PreviousType.ToLower().Contains("void"))) /*|| CurrentType.Contains("IntPtr"))*/ { CurrentType = "IntPtr"; Pointer = false; WrapperType = WrapperTypes.GenericParameter; } } if (Reference) { WrapperType = WrapperTypes.ReferenceParameter; } // This causes problems with bool arrays //if (CurrentType.ToLower().Contains("bool")) // WrapperType = WrapperTypes.BoolParameter; }
public Form1() { InitializeComponent(); radioButtonInteger.Checked = true; Previous = PreviousType.Integer; }
public Form1() { InitializeComponent(); rbtn_integer.Checked = true; Previous = PreviousType.Integer; }
private void SetPreviousStype(PreviousType type) { _settings.PreviousType = type; _searches.SetPreviousType(type); }
public void Update(PreviousType type, MemoryDomain domain, bool bigendian) { var value = domain.PeekUshort(Address % domain.Size, bigendian); if (value != Previous) { _changecount++; } switch (type) { case PreviousType.Original: case PreviousType.LastSearch: break; case PreviousType.LastFrame: _previous = _prevFrame; break; case PreviousType.LastChange: if (_prevFrame != value) _previous = _prevFrame; break; } _prevFrame = value; }
/// <summary> /// Ignore that stuff /// </summary> public override void Update(PreviousType previousType) { }
private void SetPreviousType(PreviousType type) { _settings.PreviousType = type; _searches.SetPreviousType(type); }