public virtual void Register(RegisterEntry entry) { if (entry.GetType() != EntryType) { throw new ArgumentException($"{entry.GetType()}不是:{EntryType}"); } if (IsLock) { throw new InvalidOperationException($"注册表:{RegisterName}已锁定,不可再注册"); } if (EntryNameSet.Contains(entry.RegisterName)) { throw new InvalidOperationException($"重复的名字:{entry.RegisterName}"); } Container.Add(entry); EntryNameSet.Add(entry.RegisterName); }
public override void Register(RegisterEntry entry) { AddToWaitRegister(entry); }