Example #1
0
 public ChangeAction(ChangeType changeType, TranscriptionElement changedElement, TranscriptionIndex changeIndex, int changeAbsoluteIndex)
 {
     _changeType               = changeType;
     _changedElement           = changedElement;
     _changeTranscriptionIndex = changeIndex;
     _changeAbsoluteIndex      = changeAbsoluteIndex;
 }
 public void ValidateIndexOrThrow(TranscriptionIndex index)
 {
     if (!index.IsValid)
     {
         throw new ArgumentOutOfRangeException("index", "invalid index value");
     }
 }
Example #3
0
        public override void RemoveAt(TranscriptionIndex index)
        {
            ValidateIndexOrThrow(index);
            if (!index.IsPhraseIndex)
            {
                throw new IndexOutOfRangeException("index");
            }

            Phrases.RemoveAt(index.PhraseIndex);
        }
Example #4
0
        public override void Insert(TranscriptionIndex index, TranscriptionElement value)
        {
            ValidateIndexOrThrow(index);
            if (!index.IsPhraseIndex)
            {
                throw new IndexOutOfRangeException("index");
            }

            Phrases.Insert(index.PhraseIndex, (TranscriptionPhrase)value);
        }
 public override TranscriptionElement this[TranscriptionIndex index]
 {
     get
     {
         throw new NotImplementedException();
     }
     set
     {
         throw new NotImplementedException();
     }
 }
Example #6
0
 public override void RemoveAt(TranscriptionIndex index)
 {
     ValidateIndexOrThrow(index);
     if (index.IsParagraphIndex)
     {
         if (index.IsPhraseIndex)
         {
             Paragraphs[index.ParagraphIndex].RemoveAt(index);
         }
         else
         {
             Paragraphs.RemoveAt(index.ParagraphIndex);
         }
     }
     else
     {
         throw new IndexOutOfRangeException("index");
     }
 }
Example #7
0
 public override void Insert(TranscriptionIndex index, TranscriptionElement value)
 {
     ValidateIndexOrThrow(index);
     if (index.IsParagraphIndex)
     {
         if (index.IsPhraseIndex)
         {
             Paragraphs[index.ParagraphIndex].Insert(index, value);
         }
         else
         {
             Paragraphs.Insert(index.ParagraphIndex, (TranscriptionParagraph)value);
         }
     }
     else
     {
         throw new IndexOutOfRangeException("index");
     }
 }
Example #8
0
        public override TranscriptionElement this[TranscriptionIndex index]
        {
            get
            {
                ValidateIndexOrThrow(index);
                if (!index.IsPhraseIndex)
                {
                    throw new IndexOutOfRangeException("index");
                }
                return(Phrases[index.PhraseIndex]);
            }
            set
            {
                ValidateIndexOrThrow(index);
                if (!index.IsPhraseIndex)
                {
                    throw new IndexOutOfRangeException("index");
                }

                Phrases[index.PhraseIndex] = (TranscriptionPhrase)value;
            }
        }
Example #9
0
        public override TranscriptionElement this[TranscriptionIndex index]
        {
            get
            {
                ValidateIndexOrThrow(index);

                if (index.IsParagraphIndex)
                {
                    if (index.IsPhraseIndex)
                    {
                        return(Paragraphs[index.ParagraphIndex][index]);
                    }

                    return(Paragraphs[index.ParagraphIndex]);
                }

                throw new IndexOutOfRangeException("index");
            }
            set
            {
                ValidateIndexOrThrow(index);

                if (index.IsParagraphIndex)
                {
                    if (index.IsPhraseIndex)
                    {
                        Paragraphs[index.ParagraphIndex][index] = value;
                    }
                    else
                    {
                        Paragraphs[index.ParagraphIndex] = (TranscriptionParagraph)value;
                    }
                }
                else
                {
                    throw new IndexOutOfRangeException("index");
                }
            }
        }
Example #10
0
 public ParagraphLanguageAction(TranscriptionParagraph changedParagraph, TranscriptionIndex changeIndex, int changeAbsoluteIndex, string oldLanguage)
     : base(ChangeType.Modify, changedParagraph, changeIndex, changeAbsoluteIndex)
 {
     _oldLanguage = oldLanguage;
 }
 public abstract void Insert(TranscriptionIndex index, TranscriptionElement value);
 public abstract void RemoveAt(TranscriptionIndex index);
 public abstract TranscriptionElement this[TranscriptionIndex index]
 {
     get;
     set;
 }
Example #14
0
 public ParagraphAttibutesAction(TranscriptionParagraph changedParagraph, TranscriptionIndex changeIndex, int changeAbsoluteIndex, ParagraphAttributes oldAttributes)
     : base(ChangeType.Modify, changedParagraph, changeIndex, changeAbsoluteIndex)
 {
     _oldAttributes = oldAttributes;
 }
 public override void RemoveAt(TranscriptionIndex index)
 {
     throw new NotImplementedException();
 }
Example #16
0
 public ReplaceAction(TranscriptionElement changedElement, TranscriptionIndex changeIndex, int changeAbsoluteIndex)
     : base(ChangeType.Replace, changedElement, changeIndex, changeAbsoluteIndex)
 {
 }
Example #17
0
 public InsertAction(TranscriptionElement changedElement, TranscriptionIndex changeIndex, int changeAbsoluteIndex)
     : base(ChangeType.Add, changedElement, changeIndex, changeAbsoluteIndex)
 {
 }
Example #18
0
 public EndAction(TranscriptionElement changedelement, TranscriptionIndex changeIndex, int changeAbsoluteIndex, TimeSpan oldtime)
     : base(ChangeType.Modify, changedelement, changeIndex, changeAbsoluteIndex)
 {
     _oldtime = oldtime;
 }
Example #19
0
 public PhrasePhoneticsAction(TranscriptionPhrase changedelement, TranscriptionIndex changeIndex, int changeAbsoluteIndex, string oldphonetics)
     : base(ChangeType.Modify, changedelement, changeIndex, changeAbsoluteIndex)
 {
     _oldtstring = oldphonetics;
 }
Example #20
0
 public TextAction(TranscriptionElement changedelement, TranscriptionIndex changeIndex, int changeAbsoluteIndex, string oldtstring)
     : base(ChangeType.Modify, changedelement, changeIndex, changeAbsoluteIndex)
 {
     _oldtstring = oldtstring;
 }
 public override void Insert(TranscriptionIndex index, TranscriptionElement value)
 {
     throw new NotImplementedException();
 }
Example #22
0
 public ParagraphSpeakerAction(TranscriptionParagraph changedParagraph, TranscriptionIndex changeIndex, int changeAbsoluteIndex, Speaker oldSpeaker)
     : base(ChangeType.Modify, changedParagraph, changeIndex, changeAbsoluteIndex)
 {
     _oldSpeaker = oldSpeaker;
 }