Exemple #1
0
 public static bool SetCurrent(string name)
 {
     for (int i = 0; i < Count; i++)
     {
         if (Get(i).Name.CompareTo(name) == 0)
         {
             return(SetCurrent(i));
         }
     }
     for (int i = 0; i < Count; i++)
     {
         if (Get(i).Name.CompareTo(StringsDefaultEnglish.Get().Name) == 0)
         {
             return(SetCurrent(i));
         }
     }
     return(false);
 }
Exemple #2
0
            static public void Initialize()
            {
                m_strings.Clear();

                m_strings.Add(StringsDefaultEnglish.Get());
                m_strings.Add(StringsDefaultRussian.Get());

                DirectoryInfo directoryInfo = new DirectoryInfo(Path);

                if (directoryInfo.Exists)
                {
                    FileInfo[] fileInfos = directoryInfo.GetFiles(Filter, SearchOption.TopDirectoryOnly);
                    for (int i = 0; i < fileInfos.Length; i++)
                    {
                        AntiDupl.NET.Strings strings = Load(fileInfos[i].FullName);
                        if (strings != null)
                        {
                            string name = System.IO.Path.GetFileNameWithoutExtension(fileInfos[i].FullName);
                            if (name.CompareTo(StringsDefaultRussian.Get().Name) != 0 &&
                                name.CompareTo(StringsDefaultEnglish.Get().Name) != 0)
                            {
                                strings.Name = name;
                                m_strings.Add(strings);
                            }
                        }
                    }
                }

                try
                {
                    CreateIfNotExists(Path);
                    Save(StringsDefaultEnglish.Get());
                    Save(StringsDefaultRussian.Get());
                }
                catch (Exception)
                {
                }
            }
Exemple #3
0
 public Strings()
 {
     StringsDefaultEnglish.CopyTo(this);
 }
Exemple #4
0
 public static bool IsCurrentEnglish()
 {
     return(Current.Name.CompareTo(StringsDefaultEnglish.Get().Name) == 0);
 }