/// <summary> Move an Entry from an old Index to an new Index. </summary> /// <param name="oldIndex">Old index.</param> /// <param name="newIndex">New index.</param> public void MoveAudio(int oldIndex, int newIndex) { EntryAudio entry = entriesAudio[oldIndex]; RemoveAudioAt(oldIndex); Insert(entry, newIndex); }
/// <summary> Insert the specified entry with a given index. </summary> /// <param name="entry">Entry.</param> /// <param name="index">Index.</param> private void Insert(EntryAudio entry, int index) { if (index > entriesAudio.Count) { return; } entriesAudio.Insert(index, entry); }
private void CreateNewEntry(bool insertion = false) { if (indexToolbar == 0) { EntryImage entry = new EntryImage { key = "new entry", Localisations = new List <LocalisationImage> (), }; foreach (Language language in langManager.languages) { entry.Add(language.name); } if (insertion) { locManager.Add(entry, newIndex); index = newIndex; } else { locManager.Add(entry); index = locManager.entriesImage.Count - 1; } } else { EntryAudio entry = new EntryAudio { key = "new entry", Localisations = new List <LocalisationAudio> (), }; foreach (Language language in langManager.languages) { entry.Add(language.name); } if (insertion) { locManager.Add(entry, newIndex); index = newIndex; } else { locManager.Add(entry); index = locManager.entriesImage.Count - 1; } } listSize = (indexToolbar == 0) ? locManager.entriesImage.Count : locManager.entriesAudio.Count; SetTriggerList(); }
/// <summary> Insert the specified entry to the list. </summary> /// <param name="entry">Entry.</param> /// <param name="add">If set to <c>true</c> add or override.</param> private void Insert(EntryAudio entry, bool add) { int i = FindEntryAudio(entry.key); if (i >= 0) { if (add) { return; } entriesAudio[i] = entry; } if (add) { entriesAudio.Add(entry); } }
/// <summary> Refresh the specified entry. </summary> /// <param name="entry">Entry.</param> public void Refresh(EntryAudio entry) { Insert(entry, false); }
/// <summary> Add the specified entry with a given index. </summary> /// <param name="entry">Entry.</param> /// <param name="index">Index.</param> public void Add(EntryAudio entry, int index) { Insert(entry, index); }
/// <summary> Add the specified entry. </summary> /// <param name="entry">Entry.</param> public void Add(EntryAudio entry) { Insert(entry, true); }
/// <summary> Remove the specified entry. </summary> /// <param name="entry">Entry.</param> public void Remove(EntryAudio entry) { entriesAudio.Remove(entry); }