本文整理汇总了C#中DictionaryNode类的典型用法代码示例。如果您正苦于以下问题:C# DictionaryNode类的具体用法?C# DictionaryNode怎么用?C# DictionaryNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DictionaryNode类属于命名空间,在下文中一共展示了DictionaryNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Load_From_Directory
public void Load_From_Directory()
{
Isolate.Fake.StaticMethods(typeof(Validator));
var store = new XpoModelDictionaryDifferenceStoreFactory<XpoWinModelDictionaryDifferenceStore>().Create(
Isolate.Fake.Instance<XafApplication>(), true);
#region isolate store
Isolate.WhenCalled(() => store.GetModelPaths()).WillReturn(new List<string> { "model.xafml", "model_el.xafml", "LogonParameters.xafml" });
Isolate.WhenCalled(() => store.UseModelFromPath()).WillReturn(true);
Isolate.WhenCalled(() => store.SaveDifference(null)).IgnoreCall();
#endregion
var dictionaryNode = new DictionaryNode("Application");
#region isolate dictionaryXmlReader
var dictionaryXmlReader = Isolate.Fake.Instance<DictionaryXmlReader>();
Isolate.Swap.AllInstances<DictionaryXmlReader>().With(dictionaryXmlReader);
Isolate.WhenCalled(() => dictionaryXmlReader.ReadFromFile(null)).WillReturn(dictionaryNode);
#endregion
Dictionary dictionary = store.LoadDifference(Schema.GetCommonSchema());
Assert.AreEqual(dictionaryNode.ToXml(), dictionary.RootNode.ToXml());
}
开发者ID:akingunes,项目名称:eXpand,代码行数:23,代码来源:Loading_ApplicationModel_Dictionary.cs
示例17: FindEntry
private DictionaryNode FindEntry (object key, out DictionaryNode prev)
{
if (key == null)
throw new ArgumentNullException ("key", "Attempted lookup for a null key.");
DictionaryNode entry = head;
prev = null;
if (comparer == null) {
while (entry != null) {
if (key.Equals (entry.key))
break;
prev = entry;
entry = entry.next;
}
} else {
while (entry != null) {
if (comparer.Compare (key, entry.key) == 0)
break;
prev = entry;
entry = entry.next;
}
}
return entry;
}
开发者ID:nlhepler,项目名称:mono,代码行数:24,代码来源:ListDictionary.cs
示例18: IntegerPropertyEditor
public IntegerPropertyEditor(Type objectType, DictionaryNode info) : base(objectType, info)
{
}
开发者ID:akingunes,项目名称:eXpand,代码行数:3,代码来源:IntegerPropertyEditor.cs
示例19: SetProperty
/// <summary>
/// Sets property into the container.
/// </summary>
/// <param name="key">Key.</param>
/// <param name="value">Value.</param>
public void SetProperty(object key, object value)
{
CheckKey(key);
//
object p = _type;
// empty list
if (p == null)
{
_type = key;
_obj = value;
}
// one item list, with the same key
else if (p == key)
{
_obj = value;
}
// linked list
else if (object.ReferenceEquals(p, TypeList))
{
Debug.Assert(_obj is DictionaryNode);
// replaces value if key already in collection,
// counts items
int count = 0;
for (var node = (DictionaryNode)_obj; node != null; node = node.next)
{
if (node.key == key)
{
node.value = value;
return;
}
count++;
}
// add new item
if (count < MaxListSize)
{
_obj = new DictionaryNode() { key = key, value = value, next = (DictionaryNode)_obj };
}
else
{
// upgrade to hashtable
var hashtable = ToHashtable((DictionaryNode)_obj);
hashtable.Add(key, value);
_obj = hashtable;
_type = TypeHashtable;
}
}
// hashtable
else if (object.ReferenceEquals(p, TypeHashtable))
{
Debug.Assert(_obj is Hashtable);
((Hashtable)_obj)[key] = value;
}
// one item list,
// upgrade to linked list
else
{
_obj = new DictionaryNode()
{
key = _type,
value = _obj,
next = new DictionaryNode()
{
key = key,
value = value,
next = null,
}
};
_type = TypeList;
}
}
开发者ID:kripper,项目名称:Phalanger,代码行数:80,代码来源:PropertyCollection.cs
示例20: ToList
private static DictionaryNode ToList(Hashtable/*!*/hashtable)
{
DictionaryNode list = null;
foreach (DictionaryEntry p in hashtable)
{
list = new DictionaryNode() { key = p.Key, value = p.Value, next = list };
}
return list;
}
开发者ID:kripper,项目名称:Phalanger,代码行数:9,代码来源:PropertyCollection.cs
注:本文中的DictionaryNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论