System.Resources.WindowsRuntimeResourceManager.InitializeStatics C# (CSharp) Méthode

InitializeStatics() private static méthode

private static InitializeStatics ( ) : bool
Résultat bool
        private static bool InitializeStatics()
        {
            global::Windows.ApplicationModel.Resources.Core.ResourceManager globalResourceManager = null;

            if (s_globalResourceManager == null)
            {
                lock (s_objectForLock)
                {
                    if (s_globalResourceManager == null)
                    {
                        globalResourceManager = global::Windows.ApplicationModel.Resources.Core.ResourceManager.Current;

                        InitializeStaticGlobalResourceContext(globalResourceManager);

                        s_charCultureSeparator = new char[] { ';' };

                        Package currentPackage = Package.Current;
                        if (currentPackage != null)
                        {
                            StorageFolder currentPackageLocation = currentPackage.InstalledLocation;

                            s_currentPackageInfo.Path = null;
                            s_currentPackageInfo.Name = null;
                            s_currentPackageInfo.FullName = null;

                            if (currentPackageLocation != null)
                                s_currentPackageInfo.Path = currentPackageLocation.Path;

                            PackageId id = currentPackage.Id;
                            if (id != null)
                            {
                                s_currentPackageInfo.Name = id.Name; // We do not enforce this to be non-null.
                                s_currentPackageInfo.FullName = id.FullName;
                            }
                        }

                        if (globalResourceManager != null &&
                            s_globalResourceContext != null &&
                            s_globalResourceContextFallBackList != null &&
                            s_globalResourceContextFallBackList.Length > 0 && // Should never be empty
                            s_charCultureSeparator != null &&
                            s_currentPackageInfo.Path != null)
                            s_globalResourceManager = globalResourceManager;
                    }
                }
            }

            return s_globalResourceManager != null;
        }