Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SetToNullCommand.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.Reflection;
4 
5 namespace SiliconStudio.Quantum.Commands
6 {
8  {
9  /// <inheritdoc/>
10  public override string Name { get { return "SetToNull"; } }
11 
12  /// <inheritdoc/>
13  public override CombineMode CombineMode { get { return CombineMode.AlwaysCombine; } }
14 
15  /// <inheritdoc/>
16  public override bool CanAttach(ITypeDescriptor typeDescriptor, MemberDescriptorBase memberDescriptor)
17  {
18  return ((typeDescriptor.Type.IsNullable() && typeDescriptor.Type.IsStruct()) || typeDescriptor.Type.IsClass || typeDescriptor.Type.IsAbstract)
19  && !(typeDescriptor is CollectionDescriptor) && !(typeDescriptor is DictionaryDescriptor);
20  }
21 
22  /// <inheritdoc/>
23  protected override object ModifyValue(object currentValue, ITypeDescriptor descriptor, object parameter)
24  {
25  return null;
26  }
27  }
28 }
Provides a descriptor for a System.Collections.ICollection.
Type Type
Gets the type described by this instance.
Provides a descriptor for a System.Collections.IDictionary.
CombineMode
An enum that describes what to do with a node or a command when combining view models.
Definition: CombineMode.cs:8
Provides access members of a type.
override object ModifyValue(object currentValue, ITypeDescriptor descriptor, object parameter)
Base class for IMemberDescriptor for a MemberInfo
override bool CanAttach(ITypeDescriptor typeDescriptor, MemberDescriptorBase memberDescriptor)
Indicates whether this command can be attached to an object or a member with the given descriptors...