コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        /// <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);
            }
        }
コード例 #5
0
 /// <summary> Refresh the specified entry. </summary>
 /// <param name="entry">Entry.</param>
 public void Refresh(EntryAudio entry)
 {
     Insert(entry, false);
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 /// <summary> Add the specified entry. </summary>
 /// <param name="entry">Entry.</param>
 public void Add(EntryAudio entry)
 {
     Insert(entry, true);
 }
コード例 #8
0
 /// <summary> Remove the specified entry. </summary>
 /// <param name="entry">Entry.</param>
 public void Remove(EntryAudio entry)
 {
     entriesAudio.Remove(entry);
 }