Example #1
0
        public AliasList(string name, AliasList parent, bool falldown, bool publish)
        {
            this.Name = name;
            this.Parent = parent;
            this.falldown = falldown;
            this.isPublished = publish;

            KeyName = "AliasList:" + Name;
            if (publish) {
                backup = CallContext.GetData(KeyName);
                CallContext.SetData(KeyName, this);
            }
        }
Example #2
0
 public AliasList(string name, AliasList parent)
     : this(name, parent, true)
 {
 }
Example #3
0
 public AliasList(string name, AliasList parent, bool publish)
     : this(name, parent, false, publish)
 {
 }
Example #4
0
 /// <summary>Объединаяет списки имен. Для тех имен. При совпвдении имен и различии сокращений,
 /// приоритет отдается собственным сокращениям. </summary>
 public virtual IList MergeByNames(AliasList al)
 {
     ArrayList res = new ArrayList();
     lock (this) {
         IList c = Names;
         foreach (string s in al.Names) {
             Name his_alias = al.GetAlias(s);
             if (c.Contains(s)) {
                 Name my_alias = GetAlias(s);
                 // TODO: Это убивает переданый al насмерть!
                 his_alias.Alias = my_alias.Alias;
             } else {
                 Name his_name = al.GetName(his_alias.Alias);
                 if (his_name != null) {
                     string new_alias = GetNewShortAlias(his_name.OwnAlias, his_alias.Alias);
                     his_alias.Alias = new_alias;
                     d[new_alias] = new Pair(his_name, his_alias);
                     res.Add(his_alias);
                 }
             }
         }
     }
     return res;
 }