private void FindText_Click(object sender, RoutedEventArgs e) { //FileContent and Word are xaml elements setCurrentText(FileContent.Text.ToLower()); setSearchWord(Word.Text.ToLower()); StringBuilder occurrences = new StringBuilder(); bool NotFound = true; int index = 0; do { index = GetCurrentText().IndexOf(SearchWord, index); if (index != -1) { NotFound = false; occurrences.Append(" " + index + ", "); index++; } } while (index != -1); Indexes.Clear(); if (NotFound) { Indexes.AppendText("No Match!"); } else { string repeats = occurrences.ToString(); Indexes.AppendText(repeats); } index = 0; }
private void UpdateGroupedIndexList(DatabaseStatistics statistics) { Indexes.Clear(); if (string.IsNullOrWhiteSpace(SearchText.Value)) { Indexes.AddRange(statistics.Indexes.Where(stats => stats != null) .Select(stats => new IndexItem { Name = stats.Name, GroupName = GetIndexGroup(stats), IndexStats = stats })); } else { Indexes.AddRange(statistics.Indexes .Where(stats => stats != null && stats.Name.IndexOf(SearchText.Value, StringComparison.InvariantCultureIgnoreCase) != -1) .Select(stats => new IndexItem { Name = stats.Name, GroupName = GetIndexGroup(stats), IndexStats = stats })); } CleanGroupIndexes(); foreach (var indexItem in Indexes) { var groupItem = GroupedIndexes.FirstOrDefault(@group => string.Equals(@group.GroupName, indexItem.GroupName, StringComparison.OrdinalIgnoreCase)); if (groupItem == null) { groupItem = new Group(indexItem.GroupName); GroupedIndexes.Add(groupItem); } groupItem.Items.Add(indexItem); } OnPropertyChanged(() => GroupedIndexes); }
public virtual void Clear() { Vertices.Clear(); Normals.Clear(); Colors.Clear(); Lighting.Clear(); Indexes.Clear(); }
public override void Clear() { Tables.Clear(); Views.Clear(); MaterializedViews.Clear(); Indexes.Clear(); Sequences.Clear(); Synonyms.Clear(); Triggers.Clear(); StoredProcedures.Clear(); }
public void Reload() { Tables.Clear(); Triggers.Clear(); Indexes.Clear(); _domains = null; _dbInfo = new DatabaseInfo(new FirebirdInfo(_dbInfo.Path)); LoadDatabase(_dbInfo.Path); AdditionalInfo.RefrechData(this); CollectionViewSource.GetDefaultView(this.Tables).Refresh(); }
public void Reset() { TrackNumber = 0; Type = string.Empty; Performer = string.Empty; Title = string.Empty; Songwriter = string.Empty; PreGap = string.Empty; PostGap = string.Empty; ISRC = string.Empty; Indexes.Clear(); }
private void TestUpdate_Click(object sender, EventArgs e) { Indexes.Clear(); indexesLength = 0; CurrentSearchIndex = 0; var transforms = Transformations.Select(x => new TrackedTransformation { Method = x }).ToArray(); int updatedVideos = 0; foreach (var video in Videos) { bool updated = false; foreach (var transformation in transforms) { var transformResult = AdditionalMethods.DoReplacements(video.DisplayDescription, transformation.Method); if (transformResult.Item2) { updated = true; video.DisplayDescription = transformResult.Item4; transformation.TransformCount += transformResult.Item3; } } if (updated) { updatedVideos++; } } UpdateDescriptions.Text = $"Upload {updatedVideos} Changes"; var response = $"Test Updated {updatedVideos} videos\r\n"; foreach (var transform in transforms) { if (transform.Method.Method == AdditionalMethods.StringTransformation.TransformationMethod.Replace) { response += $"Replaced {transform.TransformCount} occurrences of {transform.Method.PrimaryValue} with {transform.Method.SecondaryValue}\r\n"; } else if (transform.Method.Method == AdditionalMethods.StringTransformation.TransformationMethod.Remove) { response += $"Removed {transform.TransformCount} occurrences of {transform.Method.PrimaryValue}\r\n"; } } VideoInformation.Text = NewLineFix(string.Join("\r\n----------\r\n", Videos.Select(x => $"Title: {x.Video.Snippet.Title} ({x.Video.Id})\r\n----------\r\n{x.DisplayDescription}"))); LogMessage("Tested Descriptions update."); LogMessage(response); UpdateDescriptionTextChange(); }
public BrowseIndexesViewModel() { DisplayName = "Indexes"; Events.Subscribe(this); Server.CurrentDatabaseChanged += delegate { ActiveItem = null; if (Indexes != null) { Indexes.Clear(); } }; }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the view model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (Indexes != null) { foreach (IndexViewModel itemView in Indexes) { itemView.Updated -= Children_Updated; itemView.Dispose(); } Indexes.Clear(); Indexes = null; } Entity = null; base.OnDispose(); }
public BrowseIndexesViewModel(IServer server, IEventAggregator events) : base(events) { DisplayName = "Indexes"; this.server = server; events.Subscribe(this); server.CurrentDatabaseChanged += delegate { ActiveItem = null; if (Indexes != null) { Indexes.Clear(); } }; }
private async Task LoadIndexList() { if (IsReadOnly) { return; } Indexes.Clear(); IEnumerable <Index> indexes = await _interpreter.GetIndexesAsync(); foreach (var indx in indexes) { Indexes.Add(new IndexLookupItem { DisplayableName = indx.Name, IndexPattern = indx.Pattern }); } }
/// <summary> /// Build vertex and indexes buffer and clear lists. /// </summary> public void Build() { // get device var device = Graphics.GraphicsManager.GraphicsDevice; // build vertex buffer Vertices.Trim(); _VertexBuffer = new VertexBuffer(device, typeof(VertexType), Vertices.Count, BufferUsage.WriteOnly); _VertexBuffer.SetData <VertexType>(Vertices.InternalArray); Vertices.Clear(); // build indexes buffer Indexes.Trim(); _IndexBuffer = new IndexBuffer(device, typeof(ushort), Indexes.Count, BufferUsage.WriteOnly); _IndexBuffer.SetData(Indexes.InternalArray); Indexes.Clear(); }
/// <summary> /// Sets all cells to the state specified by <i>value</i>. /// </summary> /// <param name="value">the value to be filled into the cells.</param> /// <returns><i>this</i> (for convenience only).</returns> public override DoubleMatrix2D Assign(double value) { // overriden for performance only if (value == 0) { Indexes.Clear(); Values.Clear(); for (int i = Starts.Length; --i >= 0;) { Starts[i] = 0; } } else { base.Assign(value); } return(this); }
private void UpdateGroupedIndexList(DatabaseStatistics statistics) { Indexes.Clear(); Indexes.AddRange(statistics.Indexes.Select(stats => new IndexItem { Name = stats.Name, GroupName = GetIndexGroup(stats), IndexStats = stats })); CleanGroupIndexes(); foreach (var indexItem in Indexes) { var groupItem = GroupedIndexes.FirstOrDefault(@group => string.Equals(@group.GroupName, indexItem.GroupName, StringComparison.OrdinalIgnoreCase)); if (groupItem == null) { groupItem = new Group(indexItem.GroupName); GroupedIndexes.Add(groupItem); } groupItem.Items.Add(indexItem); } OnPropertyChanged(() => GroupedIndexes); }
public static void Clear() { Indexes.Clear(); }