Ejemplo n.º 1
0
        protected VisualisableType(IContainer factory, Type type, VisualisableTypeData data, SubjectOrAssociate subjectOrAssociate)
        {
            if (type == null)
            {
                throw new ArgumentNullResourceException("type", Resources.General_Given_Parameter_Cannot_Be_Null);
            }

            this.doNotUseFactory = factory;
            this.NetType = type;
            this.PersistentDataField = data;
            this.SubjectOrAssociate = subjectOrAssociate;
            this.PersistentDataField.Modifiers = new ModifiersData(type);
            this.AssemblyName = type.Assembly.GetName().Name;
            this.AssemblyFullName = type.Assembly.FullName;
            this.AssemblyFileName = type.Assembly.Location;
            var genericNameHelper = new TypeDescriptorHelper(type);
            this.Id = genericNameHelper.GenerateId(); // It is not reliable to use type.GUID different generic parameters do not yeild different guids.
            this.Name = genericNameHelper.IsGeneric ? genericNameHelper.GenerateName() : type.Name;
            this.AssemblyQualifiedName = type.AssemblyQualifiedName ?? string.Format(CultureInfo.InvariantCulture, "{0}, {1}", type.Name, this.AssemblyFullName);
            this.ThisTypeNamespace = type.Namespace;
            if (type.IsEnum)
            {
                this.EnumMemberCount = Enum.GetNames(type).Length;
            }

            this.SetToolTip(type);
            this.SetAssociations(type);
            this.SetLinesOfCodeAndStaticAssociations(type);
        }
Ejemplo n.º 2
0
 protected VisualisableType(Type type, VisualisableTypeData data, SubjectOrAssociate subjectOrAssociate)
     : this(IoC.Default, type, data, subjectOrAssociate)
 {
 }