本文整理汇总了C#中DictionaryNode类的典型用法代码示例。如果您正苦于以下问题:C# DictionaryNode类的具体用法?C# DictionaryNode怎么用?C# DictionaryNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DictionaryNode类属于命名空间,在下文中一共展示了DictionaryNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StringPropertyEditorBase
protected StringPropertyEditorBase(Type objectType, DictionaryNode info)
: base(objectType, info)
{
if (string.IsNullOrEmpty(info.GetAttributeValue(DetailViewItemInfoNodeWrapper.ImmediatePostDataAttribute))){
ImmediatePostData = true;
}
}
示例2: GetNewVariantNode
private DictionaryNode GetNewVariantNode(DictionaryNode variantsNode, PopupWindowShowActionExecuteEventArgs e, out ViewCloner viewCloner) {
DictionaryNode newVariantNode = variantsNode.AddChildNode("Variant");
viewCloner = ((ViewCloner) e.PopupWindow.View.CurrentObject);
newVariantNode.SetAttribute("ViewID", viewCloner.Caption);
setAttributes(newVariantNode, viewCloner);
return newVariantNode;
}
示例3: AddFields
public static void AddFields(DictionaryNode rootNode, XPDictionary dictionary)
{
foreach (PropertyInfoNodeWrapper customFieldInfo in GetCustomFields(rootNode))
try
{
Type classType = ReflectionHelper.GetType(customFieldInfo.Class.Name);
var typeInfo = dictionary.GetClassInfo(classType);
lock (typeInfo)
{
if (typeInfo.FindMember(customFieldInfo.Name) == null)
{
Type memberType = ReflectionHelper.GetType(customFieldInfo.Type);
XPCustomMemberInfo memberInfo = typeInfo.CreateMember(customFieldInfo.Name, memberType);
if (customFieldInfo.Size != 0)
memberInfo.AddAttribute(new DevExpress.Xpo.SizeAttribute(customFieldInfo.Size));
XafTypesInfo.Instance.RefreshInfo(classType);
}
}
}
catch (Exception exception)
{
throw new Exception(
ExceptionLocalizerTemplate<SystemExceptionResourceLocalizer, ExceptionId>.GetExceptionMessage(
ExceptionId.ErrorOccursWhileAddingTheCustomProperty,
customFieldInfo.Type,
customFieldInfo.Class.Name,
customFieldInfo.Name,
exception.Message));
}
}
示例4: GetCurrentAspectXml
public string GetCurrentAspectXml(DictionaryNode node)
{
if (node.Dictionary == null){
return GetAspectXml(DictionaryAttribute.DefaultLanguage, node);
}
return GetAspectXml(node.Dictionary.CurrentAspect, node);
}
示例5: Add
public void Add(object key, object value)
{
if (key == null)
{
throw new ArgumentNullException("key", SR.GetString("ArgumentNull_Key"));
}
this.version++;
DictionaryNode node = null;
for (DictionaryNode node2 = this.head; node2 != null; node2 = node2.next)
{
object x = node2.key;
if ((this.comparer == null) ? x.Equals(key) : (this.comparer.Compare(x, key) == 0))
{
throw new ArgumentException(SR.GetString("Argument_AddingDuplicate"));
}
node = node2;
}
DictionaryNode node3 = new DictionaryNode {
key = key,
value = value
};
if (node != null)
{
node.next = node3;
}
else
{
this.head = node3;
}
this.count++;
}
示例6: GetNodesCollectionInternal
protected override ReadOnlyDictionaryNodeCollection GetNodesCollectionInternal(DictionaryNode node, string attributeName)
{
var collectionInternal = new DictionaryNodeCollection();
collectionInternal.AddRange(new ApplicationNodeWrapper(node.Dictionary.RootNode).Node.GetChildNode(ModuleController.Modules).ChildNodes);
return collectionInternal;
}
示例7: GetAspectXml
public string GetAspectXml(string aspect, DictionaryNode node, bool includeChildNodes)
{
string result = GetAspectXml(aspect, node, 0, includeChildNodes);
if (string.IsNullOrEmpty(result) && IsDefaultAspect(aspect, node)){
result = string.Format("<{0} />\r\n", node.Name);
}
return result;
}
示例8: ArgumentNullException
public Object this[Object key] {
get {
if (key == null) {
throw new ArgumentNullException("key", Environment.GetResourceString("ArgumentNull_Key"));
}
Contract.EndContractBlock();
DictionaryNode node = head;
while (node != null) {
if ( node.key.Equals(key) ) {
return node.value;
}
node = node.next;
}
return null;
}
set {
if (key == null) {
throw new ArgumentNullException("key", Environment.GetResourceString("ArgumentNull_Key"));
}
Contract.EndContractBlock();
#if FEATURE_SERIALIZATION
if (!key.GetType().IsSerializable)
throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), "key");
if( (value != null) && (!value.GetType().IsSerializable ) )
throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), "value");
#endif
version++;
DictionaryNode last = null;
DictionaryNode node;
for (node = head; node != null; node = node.next) {
if( node.key.Equals(key) ) {
break;
}
last = node;
}
if (node != null) {
// Found it
node.value = value;
return;
}
// Not found, so add a new one
DictionaryNode newNode = new DictionaryNode();
newNode.key = key;
newNode.value = value;
if (last != null) {
last.next = newNode;
}
else {
head = newNode;
}
count++;
}
}
示例9: GetCustomFields
private static ICollection<PropertyInfoNodeWrapper> GetCustomFields(DictionaryNode applicationNode)
{
var result = new List<PropertyInfoNodeWrapper>();
foreach (DictionaryNode node in applicationNode.GetChildNode(BOModelNodeWrapper.NodeName).GetChildNodes(PropertyInfoNodeWrapper.NodeName, IsRuntimeMember, bool.TrueString, true))
{
result.Add(new PropertyInfoNodeWrapper(node));
}
return result;
}
示例10: Create_Application
public void Create_Application()
{
var helper = new SchemaHelper();
DictionaryNode node=helper.CreateElement(ModelElement.Application);
var dictionaryNode = new DictionaryNode("Element");
dictionaryNode.SetAttribute("Name", ModelElement.Application.ToString());
Assert.AreEqual(dictionaryNode.ToXml(), node.ToXml());
}
示例11: GetNodesCollectionInternal
protected override ReadOnlyDictionaryNodeCollection GetNodesCollectionInternal(DictionaryNode node, string attributeName)
{
var allNodes = base.GetNodesCollectionInternal(node, attributeName);
var result = new DictionaryNodeCollection();
var nonStringProperties = allNodes.Where(n => n.GetAttributeValue("Type").Equals(typeof(string).FullName));
foreach (var stringProperty in nonStringProperties)
{
result.Add(stringProperty);
}
return result;
}
示例12: Create_Class
public void Create_Class()
{
var helper = new SchemaHelper();
DictionaryNode node=helper.CreateElement(ModelElement.Class);
var dictionaryNode = new DictionaryNode("Element");
dictionaryNode.SetAttribute("Name", ModelElement.Application.ToString());
var childNode = dictionaryNode.AddChildNode("Element");
childNode.SetAttribute("Name", ModelElement.BOModel.ToString());
childNode.AddChildNode("Element").SetAttribute("Name", ModelElement.Class.ToString());
Assert.AreEqual(dictionaryNode.ToXml(), node.ToXml());
}
示例13: IsInvisible
public override bool IsInvisible(DictionaryNode node, string attributeName)
{
var attributeValueByPath = helper.GetAttributeValueByPath(node, helper.GetParamValue("ID", "@ID"));
if (!string.IsNullOrEmpty(attributeValueByPath))
{
var wrapper = new ApplicationNodeWrapper(node.Dictionary).Views.FindViewById(attributeValueByPath);
if ((helper.GetParamValue("ViewType") == ViewType.DetailView.ToString() && wrapper is DetailViewInfoNodeWrapper) ||
(helper.GetParamValue("ViewType") == ViewType.ListView.ToString() && wrapper is ListViewInfoNodeWrapper))
return true;
if (helper.GetParamValue("ViewType") == ViewType.Any.ToString() && wrapper != null)
return true;
}
return false;
}
示例14: Add
public void Add(object key, object value)
{
if (key == null)
{
throw new ArgumentNullException("key", Environment.GetResourceString("ArgumentNull_Key"));
}
if (!key.GetType().IsSerializable)
{
throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), "key");
}
if ((value != null) && !value.GetType().IsSerializable)
{
throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), "value");
}
this.version++;
DictionaryNode node = null;
DictionaryNode head = this.head;
while (head != null)
{
if (head.key.Equals(key))
{
throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate__", new object[] { head.key, key }));
}
node = head;
head = head.next;
}
if (head != null)
{
head.value = value;
}
else
{
DictionaryNode node3 = new DictionaryNode {
key = key,
value = value
};
if (node != null)
{
node.next = node3;
}
else
{
this.head = node3;
}
this.count++;
}
}
示例15: GetNodesCollectionInternal
protected override ReadOnlyDictionaryNodeCollection GetNodesCollectionInternal(DictionaryNode node,
string attributeName) {
var result = new DictionaryNodeCollection();
DictionaryNode classesNode = node.Dictionary.RootNode.FindChildNode(BOModelNodeWrapper.NodeName);
if (classesNode != null) {
string typeName = parser.GetAttributeValueByPath(node, classNameAttrPath);
DictionaryNode classNode = classesNode.FindChildNode(ClassInfoNodeWrapper.NameAttribute, typeName);
Type type = ReflectionHelper.GetType(typeName);
result.Add(classNode);
foreach (DictionaryNode checkNode in classesNode.ChildNodes) {
Type checkType = ReflectionHelper.GetType(checkNode.GetAttributeValue("Name"));
if (checkType.IsSubclassOf(type) || type.IsSubclassOf(checkType)) {
result.Add(checkNode);
}
}
}
return result;
}