當前位置: 首頁>>代碼示例>>C#>>正文


C# AttributeCollection.GetMulti方法代碼示例

本文整理匯總了C#中AttributeCollection.GetMulti方法的典型用法代碼示例。如果您正苦於以下問題:C# AttributeCollection.GetMulti方法的具體用法?C# AttributeCollection.GetMulti怎麽用?C# AttributeCollection.GetMulti使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AttributeCollection的用法示例。


在下文中一共展示了AttributeCollection.GetMulti方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: allAttributes

        public SelectList allAttributes(object selObjId)
        {
            if (m_allAttributes == null)
            {
                m_allAttributes = new AttributeCollection();
                SortExpression se = new SortExpression(AttributeFields.Name | SortOperator.Ascending);
                m_allAttributes.GetMulti(null, 0, se);
            }

            SelectList selList = new SelectList(m_allAttributes, "Id", "Name", selObjId);
            return selList;
        }
開發者ID:habibvirji,項目名稱:Webinos-Platform,代碼行數:12,代碼來源:baseData.cs

示例2: subjectAttributes

        public SelectList subjectAttributes(object selObjId)
        {
            if (m_subjectAttributes == null)
            {
                m_subjectAttributes = new AttributeCollection();
                RelationCollection rels = new RelationCollection(AttributeEntity.Relations.ContextEntityUsingContextId);
                PredicateExpression pe = new PredicateExpression(ContextFields.Name == "subject");
                SortExpression se = new SortExpression(AttributeFields.Name | SortOperator.Ascending);
                m_subjectAttributes.GetMulti(pe, 0, se, rels);
            }

            SelectList selList = new SelectList(m_subjectAttributes, "Id", "Name", selObjId);
            return selList;
        }
開發者ID:habibvirji,項目名稱:Webinos-Platform,代碼行數:14,代碼來源:baseData.cs

示例3: getAttributeMap

        private string getAttributeMap(string name)
        {
            string map = string.Empty;

            RelationCollection rels = new RelationCollection(AttributeEntity.Relations.AttributeTypeEntityUsingAttributeTypeId);
            PredicateExpression pe = new PredicateExpression(AttributeTypeFields.Name == name);

            StringBuilder sb = new StringBuilder();

            AttributeCollection uris = new AttributeCollection();
            if (uris.GetMulti(pe, rels))
            {
                foreach (AttributeEntity ae in uris)
                {
                    sb.AppendFormat("{0}:true,", ae.Id);
                }
            }

            return string.Format("var {0}Map = {{ {1} }};", name, sb.ToString().Trim(','));
        }
開發者ID:habibvirji,項目名稱:Webinos-Platform,代碼行數:20,代碼來源:policyData.cs

示例4: importFile

        private PolicyDocumentEntity importFile(baseData vData,string title, string filepath)
        {
            AttributeCollection acoll = new AttributeCollection();
            acoll.GetMulti(AttributeFields.Name == "Literal");
            if (acoll.Count == 0)
                throw new Exception("can't find literal attribute");
            m_literalAttribute = acoll[0];

            XmlDocument doc = new XmlDocument();
            doc.Load(filepath);

            PolicyDocumentEntity pde = new PolicyDocumentEntity();
            pde.LibraryId = vData.Library.Id;
            pde.Name = title;

            PolicyLinkEntity ple = new PolicyLinkEntity();
            ple.Policy = new PolicyEntity();
            ple.Policy.LibraryId = pde.LibraryId;
            pde.PolicyLink = ple;

            XmlNode policySet = doc.SelectSingleNode("policy-set");
            if (policySet != null)
                loadPolicySet(1,title,ple,policySet);
            else
            {
                XmlNode policy = doc.SelectSingleNode("policy");
                loadPolicy(1,title,ple,policy);
            }

            pde.Save(true);

            return pde;
        }
開發者ID:habibvirji,項目名稱:Webinos-Platform,代碼行數:33,代碼來源:importController.cs

示例5: loadMatch

        private void loadMatch(int idx,DecisionNodeEntity ce, XmlNode node)
        {
            DecisionNodeEntity ame = new DecisionNodeEntity();
            ame.Type = constants.attributeMatchType;
            ame.Parent = ce;
            ame.Order = idx;

            XmlNode attr = node.Attributes.GetNamedItem("attr");
            if (attr == null)
                throw new Exception(string.Format("attr attribute missing from node: {0}", node.InnerXml));

            AttributeCollection acoll = new AttributeCollection();
            string attrVal;
            string attrExtra;
            resolveAttribute(attr.Value, out attrVal, out attrExtra);

            acoll.GetMulti(AttributeFields.Name == attrVal);
            if (acoll.Count == 0)
                throw new Exception(string.Format("unknown attribute {0} (toby please fix this)", attrVal));

            ame.Attribute = acoll[0];
            ame.Extra = attrExtra;

            attr = node.Attributes.GetNamedItem("match");
            if (attr != null)
            {
                AttributeValueEntity ave = new AttributeValueEntity();
                ave.Order = 0;
                ave.Attribute = m_literalAttribute;
                ave.Value = attr.Value;
                ave.AttributeMatch = ame;
            }
            else
            {
                int valueIdx = 0;
                foreach (XmlNode kid in node.ChildNodes)
                {
                    switch (kid.NodeType)
                    {
                        case XmlNodeType.Text:
                            {
                                AttributeValueEntity ave = new AttributeValueEntity();
                                ave.Order = valueIdx;
                                ave.Attribute = m_literalAttribute;
                                ave.Value = kid.Value.Trim();
                                ave.AttributeMatch = ame;
                            }
                            break;
                        case XmlNodeType.Element:
                            {
                                switch (kid.LocalName)
                                {
                                    case "environment-attr":
                                        loadAttributeValue(valueIdx, ame, kid);
                                        break;
                                    case "resource-attr":
                                        loadAttributeValue(valueIdx, ame, kid);
                                        break;
                                    case "subject-attr":
                                        loadAttributeValue(valueIdx, ame, kid);
                                        break;
                                    default:
                                        throw new Exception(string.Format("unknown attribute value type: {0}", kid.LocalName));
                                        break;
                                }
                            }
                            break;
                        default:
                            break;
                    }
                    valueIdx++;
                }
            }
        }
開發者ID:habibvirji,項目名稱:Webinos-Platform,代碼行數:74,代碼來源:importController.cs

示例6: loadAttributeValue

        private void loadAttributeValue(int idx,DecisionNodeEntity ame, XmlNode node)
        {
            XmlNode attr = node.Attributes.GetNamedItem("attr");
            if (attr == null)
                throw new Exception(string.Format("attr attribute missing from node: {0}", node.InnerXml));

            string attrVal;
            string attrExtra;
            resolveAttribute(attr.Value, out attrVal, out attrExtra);

            AttributeCollection acoll = new AttributeCollection();
            acoll.GetMulti(AttributeFields.Name == attrVal);
            if (acoll.Count == 0)
                throw new Exception(string.Format("unknown attribute {0} (toby please fix this)", attrVal));

            AttributeValueEntity ave = new AttributeValueEntity();
            ave.Order = idx;
            ave.Attribute = acoll[0];
            ave.Value = attr.Value.Trim();
            ave.AttributeMatch = ame;
        }
開發者ID:habibvirji,項目名稱:Webinos-Platform,代碼行數:21,代碼來源:importController.cs


注:本文中的AttributeCollection.GetMulti方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。