Пример #1
0
        internal static AppContainerInfo CreateAppContainerInfo(string fullName, int sessionId)
        {
            Fx.Assert(IsAppContainerSupported, "AppContainers are not supported.");
            Fx.Assert(!string.IsNullOrEmpty(fullName), "fullName should be provided to initialize an AppContainerInfo.");

            int appSession = sessionId;

            if (appSession == ApplicationContainerSettings.CurrentSession)
            {
                lock (thisLock)
                {
                    if (currentSessionId == null)
                    {
                        currentSessionId = AppContainerInfo.GetCurrentSessionId();
                    }
                }

                appSession = currentSessionId.Value;
            }

            string namedObjectPath = AppContainerInfo.GetAppContainerNamedObjectPath(fullName);

            return(new AppContainerInfo(appSession, namedObjectPath));
        }