Пример #1
0
 /// <summary>
 /// Creates all TranlatorItems with the state translated
 /// </summary>
 private void DetermineTranslated(StringArray stringsTranslated, StringArray stringsOriginal)
 {
     foreach (StringItem item in stringsOriginal)
     {
         StringItem itemTranslated = null;
         if (stringsTranslated.GetStringById(item.Id, ref itemTranslated))
         {
             Add(new TranslatorItem(itemTranslated, item, TranslationState.Translated));
         }
     }
 }
Пример #2
0
        /// <summary>
        /// Returns the ids of all changed strings
        /// of arr.
        /// </summary>
        public long[] GetStringsChangedIn(StringArray arr)
        {
            ArrayList ret = new ArrayList();

            foreach (StringItem item in strings)
            {
                if (item.Id != 6)               // "XBMC SVN"
                {
                    StringItem stringItem = null;
                    arr.GetStringById(item.Id, ref stringItem);
                    if (stringItem != null && stringItem.Text != item.Text)
                    {
                        ret.Add(item.Id);
                    }
                }
            }

            return((long[])ret.ToArray(typeof(long)));
        }
Пример #3
0
        /// <summary>
        /// Returns a StringArray with all string not in
        /// arr.
        /// </summary>
        public StringArray GetStringsNotIn(StringArray arr)
        {
            StringArray ret = new StringArray();

            foreach (StringItem item in strings)
            {
                if (item.Id != 6)               // "XBMC SVN"
                {
                    StringItem stringItem = null;
                    arr.GetStringById(item.Id, ref stringItem);
                    if (stringItem == null)
                    {
                        ret.Add(item);
                    }
                }
            }

            return(ret);
        }
Пример #4
0
        /// <summary>
        /// Returns a StringArray with all string not in
        /// arr.
        /// </summary>
        public StringArray GetStringsNotIn(StringArray arr)
        {
            StringArray ret=new StringArray();

            foreach (StringItem item in strings)
            {
                if (item.Id!=6) // "XBMC SVN"
                {
                    StringItem stringItem=null;
                    arr.GetStringById(item.Id, ref stringItem);
                    if (stringItem==null)
                        ret.Add(item);
                }
            }

            return ret;
        }
Пример #5
0
        /// <summary>
        /// Returns the ids of all changed strings
        /// of arr.
        /// </summary>
        public long[] GetStringsChangedIn(StringArray arr)
        {
            ArrayList ret=new ArrayList();

            foreach (StringItem item in strings)
            {
                if (item.Id!=6) // "XBMC SVN"
                {
                    StringItem stringItem=null;
                    arr.GetStringById(item.Id, ref stringItem);
                    if (stringItem!=null && stringItem.Text!=item.Text)
                        ret.Add(item.Id);
                }
            }

            return (long[])ret.ToArray(typeof(long));
        }
Пример #6
0
 /// <summary>
 /// Creates all TranlatorItems with the state translated
 /// </summary>
 private void DetermineTranslated(StringArray stringsTranslated, StringArray stringsOriginal)
 {
     foreach (StringItem item in stringsOriginal)
     {
         StringItem itemTranslated=null;
         if (stringsTranslated.GetStringById(item.Id, ref itemTranslated))
         {
             Add(new TranslatorItem(itemTranslated, item, TranslationState.Translated));
         }
     }
 }