本文整理汇总了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;
}
示例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;
}
示例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(','));
}
示例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;
}
示例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++;
}
}
}
示例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;
}