private static Lazy <TokenDictionary> CreateLazyWrapperOnDefaultAppDomain() { return(new Lazy <TokenDictionary>(() => { var wrapper = new TokenDictionary(); AppDomain.CurrentDomain.SetData(dicGuid, wrapper); return wrapper; })); }
private static Lazy <TokenDictionary> CreateLazyWrapperOnOtherDomain() { return(new Lazy <TokenDictionary>(() => { var defAppDomain = AppDomainHelper.DefaultAppDomain; TokenDictionary wrapper = (TokenDictionary)defAppDomain.GetData(dicGuid); if (wrapper == null) { defAppDomain.DoCallBack(CreateCallback); wrapper = (TokenDictionary)defAppDomain.GetData(dicGuid); } return wrapper; })); }