Example #1
0
        private string GetTypeNameForField(int depth = 2)
        {
            var    typeParts = _serializedTypeRef.TypeNameAndAssembly.Split(',');
            string typeName  = typeParts[0].Trim();

            if (typeName == string.Empty)
            {
                typeName = TypeReference.NoneElement;
            }
            else if (CachedTypeReference.GetType(_serializedTypeRef.TypeNameAndAssembly) == null)
            {
                _serializedTypeRef.TryUpdatingTypeUsingGUID();

                if (CachedTypeReference.GetType(_serializedTypeRef.TypeNameAndAssembly) == null)
                {
                    typeName += MissingSuffix;
                }
            }

            var split = typeName.Split('.');

            typeName = "";
            for (int i = 0; i < depth; i++)
            {
                typeName += "." + split[split.Length - depth + i];
            }

            return(typeName);
        }
        private string GetTypeNameForField()
        {
            var    typeParts = _serializedTypeRef.TypeNameAndAssembly.Split(',');
            string typeName  = typeParts[0].Trim();

            if (typeName == string.Empty)
            {
                typeName = ClassTypeReference.NoneElement;
            }
            else if (CachedTypeReference.GetType(_serializedTypeRef.TypeNameAndAssembly) == null)
            {
                _serializedTypeRef.TryUpdatingTypeUsingGUID();

                if (CachedTypeReference.GetType(_serializedTypeRef.TypeNameAndAssembly) == null)
                {
                    typeName += MissingSuffix;
                }
            }

            return(typeName);
        }
Example #3
0
 public TypeDropDownDrawer(string typeName, ClassTypeConstraintAttribute constraints, Type declaringType)
 {
     _selectedType  = CachedTypeReference.GetType(typeName);
     _constraints   = constraints;
     _declaringType = declaringType;
 }