public AccessController( MethodWeb web) { this.web = web; const bool truth = true; this.timerFinished = new ManualResetEvent(truth); }
public override bool AddWeb( MethodWeb web, string name = null) { if (web == null) { return(falsity); } ICollection <NamedMethodWebHolder> ws; NamedMethodWebHolder alreadyAddedWeb; lock (this.locker) { ws = this.webs; alreadyAddedWeb = EH.FirstOrDefault( ws, webHolder => ReferenceEquals(web, webHolder?.Web)); } if (alreadyAddedWeb != null) { return(falsity); } lock (this.locker) { if (EH.Contains( EH.Select( ws, webHolder => webHolder?.Name), name)) { return(falsity); } } this.add( new NamedMethodWebHolder { Web = web, Name = name }); return(truth); }
public virtual bool AddWeb( MethodWeb web, string name = null) { if (web == null) { return(falsity); } var ws = this.webs; var alreadyAddedWeb = EH.FirstOrDefault( ws, webHolder => ReferenceEquals( web, webHolder?.Web)); if (alreadyAddedWeb != null) { return(falsity); } if (EH.Contains( EH.Select( ws, webHolder => webHolder?.Name), name)) { return(falsity); } this.add( new NamedMethodWebHolder { Web = web, Name = name }); return(truth); }