当前位置: 首页>>代码示例>>C#>>正文


C# DictionaryNode类代码示例

本文整理汇总了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;
     }
 }
开发者ID:akingunes,项目名称:eXpand,代码行数:7,代码来源:StringPropertyEditorBase.cs

示例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;
 }
开发者ID:akingunes,项目名称:eXpand,代码行数:7,代码来源:CloneViewController.cs

示例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));
                }
        }
开发者ID:akingunes,项目名称:eXpand,代码行数:31,代码来源:DictionaryHelper.cs

示例4: GetCurrentAspectXml

 public string GetCurrentAspectXml(DictionaryNode node)
 {
     if (node.Dictionary == null){
         return GetAspectXml(DictionaryAttribute.DefaultLanguage, node);
     }
     return GetAspectXml(node.Dictionary.CurrentAspect, node);
 }
开发者ID:cevious,项目名称:eXpand,代码行数:7,代码来源:DictionaryXmlWriterEx.cs

示例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++;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:ListDictionary.cs

示例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;


        }
开发者ID:akingunes,项目名称:eXpand,代码行数:8,代码来源:ModuleRefNodeProvider.cs

示例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;
 }
开发者ID:cevious,项目名称:eXpand,代码行数:8,代码来源:DictionaryXmlWriterEx.cs

示例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++;
            }
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:57,代码来源:ListDictionaryInternal.cs

示例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;
        }
开发者ID:akingunes,项目名称:eXpand,代码行数:10,代码来源:DictionaryHelper.cs

示例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());
        }
开发者ID:akingunes,项目名称:eXpand,代码行数:10,代码来源:SchemaHelperFixture.cs

示例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;
        }
开发者ID:akingunes,项目名称:eXpand,代码行数:13,代码来源:RefNodeStringPropertyProvider+.cs

示例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());
        }
开发者ID:akingunes,项目名称:eXpand,代码行数:15,代码来源:SchemaHelperFixture.cs

示例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;
 }
开发者ID:akingunes,项目名称:eXpand,代码行数:15,代码来源:ViewVisibilityCalculator.cs

示例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++;
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:47,代码来源:ListDictionaryInternal.cs

示例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;
 }
开发者ID:akingunes,项目名称:eXpand,代码行数:18,代码来源:ClassRefNodeProvider.cs


注:本文中的DictionaryNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。