コード例 #1
0
ファイル: SubstitutionRenamer.cs プロジェクト: robness/Vixen
        private IEnumerable <string> GenerateNames()
        {
            List <string> newNames = new List <string>();

            if (_patterns.Any(x => !string.IsNullOrEmpty(x.Find)))
            {
                foreach (var oldName in OldNames)
                {
                    var tmpName = oldName;
                    foreach (var replacePattern in _patterns)
                    {
                        if (!string.IsNullOrEmpty(replacePattern.Find))
                        {
                            tmpName = tmpName.Replace(replacePattern.Find, replacePattern.Replace);
                        }
                    }
                    newNames.Add(tmpName);
                }
            }
            else
            {
                return(OldNames.ToList());
            }

            return(newNames);
        }
コード例 #2
0
        public PropertyImpl(string name)
            : this()
        {
            this.name = name;

            if (!string.IsNullOrEmpty(name))
            {
                OldNames.Add(name);
            }
        }
コード例 #3
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="p"></param>
        public PropertyImpl(Property p)
        {
            name = p.Name;

            if (!string.IsNullOrEmpty(name))
            {
                OldNames.Add(name);
            }

            type           = p.Type;
            nhibernateType = p.NHibernateType;
            readOnly       = p.ReadOnly;
            options        = new ValidationOptions(p.ValidationOptions);
            //isVirtual = p.IsVirtual;
            isKeyProperty = p.IsKeyProperty;
        }
コード例 #4
0
 private void MoveOldConfig()
 {
     try
     {
         string firstOldName = OldNames.FirstOrDefault(File.Exists);
         if (firstOldName != null && !firstOldName.IsEmpty())
         {
             EnsureParentDirectory();
             File.Move(firstOldName, SaveName);
         }
         RemoveOldConfig();
     }
     catch (Exception e)
     {
         Utility.DisplayMessage(e.ToString());
         Console.WriteLine(e);
     }
 }
コード例 #5
0
 private void MoveOldConfig()
 {
     try
     {
         string firstOldName = OldNames.FirstOrDefault(File.Exists);
         if (firstOldName != null && !firstOldName.IsEmpty())
         {
             Utility.DisplayLocalizedText("str_rts_camera_rename_old_config");
             EnsureSaveDirectory();
             File.Move(firstOldName, SaveName);
         }
         RemoveOldConfig();
     }
     catch (Exception e)
     {
         Utility.DisplayMessage(e.ToString());
         Console.WriteLine(e);
     }
 }
コード例 #6
0
 private void ParseHistory(XmlNode iNode)
 {
     if (iNode != null && iNode.Name.Equals("history"))
     {
         if (iNode.HasChildNodes)
         {
             foreach (XmlNode lChildNode in iNode.ChildNodes)
             {
                 if (lChildNode.Name == "misspelling")
                 {
                     OldNames.Add(TambonHelper.GetAttribute(lChildNode, "name").Trim());
                 }
                 if (lChildNode.Name == "rename")
                 {
                     OldNames.Add(TambonHelper.GetAttribute(lChildNode, "oldname").Trim());
                 }
             }
         }
     }
 }