Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="output"></param>
        /// <param name="labelName"></param>
        /// <param name="fieldName"></param>
        /// <param name="customFieldId"></param>
        /// <param name="className"></param>
        protected void ReplaceParamsInAttributes(XmlNode output, string labelName, string fieldName, int customFieldId, string className)
        {
            SetupWsParams(output, customFieldId);
            ReplaceSubstringInAttr visitorFn = new ReplaceSubstringInAttr("$fieldName", fieldName);

            XmlUtils.VisitAttributes(output, visitorFn);
            AppendClassAttribute(output, fieldName, className);
            ReplaceSubstringInAttr visitorLab = new ReplaceSubstringInAttr("$label", labelName);

            XmlUtils.VisitAttributes(output, visitorLab);
            if (customFieldId != 0 && m_mdc is IFwMetaDataCacheManaged)
            {
                IFwMetaDataCacheManaged mdc = m_mdc as IFwMetaDataCacheManaged;
                if (mdc.IsCustom(customFieldId) && mdc.GetDstClsId(customFieldId) != 0)
                {
                    Guid guidList = (m_mdc as IFwMetaDataCacheManaged).GetFieldListRoot(customFieldId);
                    if (guidList != Guid.Empty)
                    {
                        string             targetList;
                        ICmPossibilityList list = m_cache.ServiceLocator.GetInstance <ICmPossibilityListRepository>().GetObject(guidList);
                        if (list.Owner != null)
                        {
                            targetList = String.Format("{0}.{1}", list.Owner.ClassName, mdc.GetFieldName(list.OwningFlid));
                        }
                        else
                        {
                            targetList = String.Format("unowned.{0}", guidList.ToString());
                        }
                        ReplaceSubstringInAttr visitorTarg = new ReplaceSubstringInAttr("$targetList", targetList);
                        XmlUtils.VisitAttributes(output, visitorTarg);
                    }
                }
            }
        }
Пример #2
0
        private void ReplaceParamsInAttributes(XmlNode output, string labelName, string fieldName, uint customFieldId, string className)
        {
            SetupWsParams(output, customFieldId);
            ReplaceSubstringInAttr visitorFn = new ReplaceSubstringInAttr("$fieldName", fieldName);

            XmlUtils.VisitAttributes(output, visitorFn);
            AppendClassAttribute(output, fieldName, className);
            ReplaceSubstringInAttr visitorLab = new ReplaceSubstringInAttr("$label", labelName);

            XmlUtils.VisitAttributes(output, visitorLab);
        }