Beispiel #1
0
        /// <summary>
        /// Register translation package
        /// </summary>
        /// <param name="translatePackage"></param>
        void ITranslationManSetter.RegisterPackage(ITranslatePackage translatePackage)
        {
            if (translatePackage == null)
            {
                return;
            }

            if (translatePackage.IsAnonymous)
            {
                var left  = _translatePackages[_hashOfAnonymousPackageKey];
                var right = translatePackage;
                TranslatePackageMerger.Merge(left, right, MergeLevel.Level_2);
                return;
            }

            if (Contains(translatePackage.PackageKey))
            {
                return;
            }

            lock (_translateLockObj) {
                if (Contains(translatePackage.PackageKey))
                {
                    return;
                }

                _translatePackages.Add(translatePackage.PackageKey.GetHashCode(), translatePackage);
            }
        }
Beispiel #2
0
        private void AddAnonymousResource(ITranslateResource resource)
        {
            var ops = (ITranslatePackageMergeOps)this;

            ops.Merge(resource, TranslatePackageMerger.AnonymousMergeCoreFunc(resource));
        }