コード例 #1
0
ファイル: IntegrationService.cs プロジェクト: leonchen09/poc
        /// <summary>
        /// get all internal bookmark item (include USC) from document
        /// </summary>
        /// <param name="ibmDomain"></param>
        /// <returns></returns>
        private List <InternalBookmarkItem> GetInternalBookmarkItemCollection(InternalBookmarkDomain ibmDomain)
        {
            List <InternalBookmarkItem> items = new List <InternalBookmarkItem>();

            // internal bookmark item
            foreach (InternalBookmarkItem item in ibmDomain.InternalBookmarkItems)
            {
                InternalBookmarkItem newItem = null;
                if (item.Key.EndsWith(ProntoMarkup.KeySelect))
                {
                    newItem = new InternalBookmarkItem(MarkupUtilities.RemoveChars(item.BizName, 1, 2), item.UniqueName, item.DataType, XsltType.Select);
                }
                else if (item.Key.EndsWith(ProntoMarkup.KeyStartIf) && item.ItemType == DSIconType.Condition.ToString())
                {
                    newItem = new InternalBookmarkItem(MarkupUtilities.RemoveChars(item.BizName, 1, 1), item.UniqueName, item.DataType, XsltType.If);
                }

                if (newItem != null)
                {
                    if (string.IsNullOrEmpty(newItem.UniqueName)) // ngocbv: make sure unique name not is null in case UDF
                    {
                        newItem.UniqueName = item.TechName;
                    }
                    newItem.Key      = newItem.BizName; // ngocbv: keep key for highlight
                    newItem.TechName = item.TechName;
                    items.Add(newItem);
                }
            }

            // usc
            foreach (USCItem usc in ibmDomain.USCItems)
            {
                foreach (USCItem item in usc.Fields)
                {
                    InternalBookmarkItem newItem = new InternalBookmarkItem(item.BusinessName, item.UniqueName, item.DataType, XsltType.If);
                    newItem.Key = usc.BusinessName; // ngocbv: keep key for highlight
                    items.Add(newItem);
                }
            }

            return(items);
        }