当前位置: 首页>>代码示例>>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;未经允许,请勿转载。