コード例 #1
0
ファイル: ExportSlide.cs プロジェクト: AlexSneg/VIRD-1.0
        private static SlideBulk ComposeSlideBulk(PresentationInfo presentationInfo,
            IEnumerable<TechnicalServices.Persistence.SystemPersistence.Presentation.Slide> slideArr)
        {
            XmlSerializableDictionary<int, SlideLinkList> linkDic = new XmlSerializableDictionary<int, SlideLinkList>();
            XmlSerializableDictionary<int, Point> positionDic = new XmlSerializableDictionary<int, Point>();
            SlideBulk slideBulk = new SlideBulk();
            foreach (TechnicalServices.Persistence.SystemPersistence.Presentation.Slide slide in slideArr)
            {
                slideBulk.SlideList.Add(slide);
                positionDic[slide.Id] = presentationInfo.SlidePositionList[slide.Id];
                IList<LinkInfo> linkInfoList;
                if (!presentationInfo.SlideLinkInfoList.TryGetValue(slide.Id, out linkInfoList)) continue;
                foreach (LinkInfo linkInfo in linkInfoList)
                {
                    if (!slideArr.Any(sl => sl.Id == linkInfo.NextSlideId)) continue;
                    SlideLinkList slideLinkList;
                    if (!linkDic.TryGetValue(slide.Id, out slideLinkList))
                    {
                        linkDic[slide.Id] = slideLinkList = new SlideLinkList();
                    }
                    slideLinkList.LinkList.Add(linkInfo.CreateLinkStub());
                }
            }

            slideBulk.LinkDictionary = linkDic;
            slideBulk.SlidePositionList = positionDic;
            return slideBulk;
        }
コード例 #2
0
        protected override string GetValueImpl(string key)
        {
            string value = null;

            EncodedNameMap.TryGetValue(key, out value);
            return(value);
        }
コード例 #3
0
        }   // end of BeforeSaveLocalizedString()

        /// <summary>
        /// On load we want to see if there any localizations for the strings.
        /// If there are then we look for one that matches the current language.
        /// If not we just set all the strings to match each other.
        ///
        /// We return the main str so this can be used like Str = OnLoadLocalizedString(Str, ...
        /// even if Str is an accessor which doesn't work with ref.
        /// </summary>
        /// <param name="str"></param>
        /// <param name="originalStr"></param>
        /// <param name="localizedStr"></param>
        /// <param name="dict"></param>
        /// <returns>The new version of the in use string, str.</returns>
        public static string OnLoadLocalizedString(string str, ref string originalStr, ref string localizedStr, ref XmlSerializableDictionary <string, string> dict)
        {
            string curLang = Boku.Common.Localization.Localizer.LocalLanguage;

            originalStr = str;
            if (dict == null)
            {
                // If localized dictionary is null, must be an old level so do nothing.
            }
            else
            {
                // If localized dictionary is not null, see if we have a string from current language to use.
                string locStr;
                if (dict.TryGetValue(curLang, out locStr))
                {
                    str = TextHelper.CleanUpString(locStr);
                }
            }
            localizedStr = str;

            return(str);
        } // end of OnLoadLocalizedString()