Beispiel #1
0
 public virtual void InitObject(ref clsProjectObject obj)
 {
     if (!All.Contains(obj))
     {
         obj.AddToCollection();
     }
     obj.Name = NextFreeName(obj.ToFullString(""), Name, obj);
 }
Beispiel #2
0
        public static string NextFreeName(string prefix, string str, clsProjectObject obj = null)
        {
            int    num    = 1;
            string strRet = str;

            while (All.Find(itm => (obj != itm && itm.ToString() == prefix + strRet)) != null)
            {
                MatchCollection matchNum = Regex.Matches(strRet, @"\d{1,}\z");
                if (matchNum.Count >= 1)
                {
                    num = int.Parse(matchNum[0].Value);
                }
                else
                {
                    num = 1;
                }
                num++;
                strRet = Regex.Replace(str, @"\d{1,}\z", "") + num.ToString();
            }
            return(strRet);
        }
Beispiel #3
0
 public virtual void UpdateObject(ref clsProjectObject obj)
 {
 }
Beispiel #4
0
 public Xml_ProjectObject(clsProjectObject obj)
 {
     Name       = obj.Name;
     ObjectType = obj.ProjectObjType;
 }