public IControlFactory Make(GenerateFormModel generateFormModel, PropertyInformationViewModel propertyInformationViewModel) { return(new CheckBoxFactory(generateFormModel, propertyInformationViewModel)); }
void LoadPropertyInformation(TypeDefinition typeDefinition, ClassEntity classEntity, Hashtable assembliesToLoad, ProjectType projectFrameworkType, String parentPropertyName = "") { foreach (var property in GetAllPropertiesForType(typeDefinition, assembliesToLoad, projectFrameworkType)) { TypeDefinition td = property.PropertyType as TypeDefinition; if (td == null) { var tr = property.PropertyType; if (tr != null) { // Only Silverlight requires this try/catch. try { td = tr.Resolve(); } catch { Debug.WriteLine(property.Name); } } } var isEnumerable = IsTypeNameEnumerable(property.PropertyType.FullName); if (!isEnumerable) { if (td?.BaseType != null) { isEnumerable = IsTypeNameEnumerable(td.BaseType.FullName); } } var pi = new PropertyInformationViewModel(CanWrite(property), property.Name, FormatPropertyTypeName(property), property.PropertyType.Namespace, classEntity.ProjectType, classEntity.ClassName, isEnumerable, false, parentPropertyName); if (property.PropertyType is Mono.Cecil.GenericInstanceType) { var obj = (GenericInstanceType)property.PropertyType; if (obj.HasGenericArguments) { foreach (TypeReference genericTr in obj.GenericArguments) { pi.GenericArguments.Add(genericTr.Name); if (!genericTr.Namespace.Contains("System") && !genericTr.Namespace.Contains("Xamarin.")) { var genericTd = genericTr as TypeDefinition; if (genericTd == null) { try { genericTd = genericTr.Resolve(); } catch { Debug.WriteLine(genericTr.Name); continue; } } if (genericTd != null) { if (genericTd.HasProperties && genericTd.IsPublic && genericTd.IsClass && !genericTd.IsAbstract && !genericTd.Namespace.Contains("System") && !genericTd.Namespace.Contains("Xamarin.")) { foreach (var prop in genericTd.Properties) { pi.GenericCollectionClassPropertyNames.Add(prop.Name); } } } } } } } if (property.HasParameters) { foreach (var pd in property.Parameters) { pi.PropertyParameters.Add(new PropertyParameter(pd.Name, pd.ParameterType.Name)); } } classEntity.PropertyInformationCollection.Add(pi); if (td != null) { if (td.HasProperties && td.IsPublic && td.IsClass && !td.IsAbstract && !td.Namespace.Contains("System") && !td.Namespace.Contains("Xamarin.")) { var childTypeDefinition = td; var childAssemblyDefinition = td.Module.Assembly; pi.ClassEntity = new ClassEntity(childAssemblyDefinition, childTypeDefinition, classEntity.ProjectType, ""); LoadPropertyInformation(childTypeDefinition, pi.ClassEntity, assembliesToLoad, projectFrameworkType, pi.Name); } } } }
Boolean CanDrillIntoCommandExecute(PropertyInformationViewModel propertyInformationViewModel) { return(propertyInformationViewModel.IsDrillableProperty); }
public ControlTemplateModel(GenerateFormModel generateFormModel, PropertyInformationViewModel viewModel) : base(generateFormModel, viewModel) { this.EditorProperties = (T)viewModel.ControlSpecificProperties; }
public FormComponentModel(GenerateFormModel generateFormModel, PropertyInformationViewModel viewModel) : base(generateFormModel, viewModel) { this.ControlFactory = viewModel.GetTemplateFactory().Make(generateFormModel, viewModel); }
public bool Post([FromBody] PropertyInformationViewModel property) { return(_propertyRepository.Upsert(property)); }
public IControlFactory Make(GenerateFormModel generateFormModel, PropertyInformationViewModel propertyInformationViewModel) { return(new BindablePickerFactory(generateFormModel, propertyInformationViewModel)); }
void LoadPropertyInformation(AssemblyDefinition assemblyDefinition, TypeDefinition typeDefinition, ClassEntity classEntity, String parentPropertyName = "") { foreach (var property in GetAllPropertiesForType(assemblyDefinition, typeDefinition)) { var isEnumerable = IsTypeNameEnumerable(property.PropertyType.FullName); if (!isEnumerable) { var td = property.PropertyType as TypeDefinition; if (td?.BaseType != null) { isEnumerable = IsTypeNameEnumerable(td.BaseType.FullName); } } var pi = new PropertyInformationViewModel(CanWrite(property), property.Name, FormatPropertyTypeName(property), property.PropertyType.Namespace, classEntity.ProjectType, classEntity.ClassName, isEnumerable, false, parentPropertyName); if (property.PropertyType is Mono.Cecil.GenericInstanceType) { var obj = (GenericInstanceType)property.PropertyType; if (obj.HasGenericArguments) { foreach (TypeReference genericTr in obj.GenericArguments) { pi.GenericArguments.Add(genericTr.Name); if (!genericTr.Namespace.Contains("System")) { TypeDefinition genericTd = genericTr as TypeDefinition; if (genericTd == null) { genericTd = genericTr.Resolve(); } if (genericTd != null) { if (genericTd.HasProperties && genericTd.IsPublic && genericTd.IsClass && !genericTd.IsAbstract && !genericTd.Namespace.Contains("System")) { foreach (var prop in genericTd.Properties) { pi.GenericCollectionClassPropertyNames.Add(prop.Name); } } } } } } } if (property.HasParameters) { foreach (var pd in property.Parameters) { pi.PropertyParameters.Add(new PropertyParameter(pd.Name, pd.ParameterType.Name)); } } classEntity.PropertyInformationCollection.Add(pi); if (property.PropertyType is TypeDefinition) { var td = (TypeDefinition)property.PropertyType; if (td.HasProperties && td.IsPublic && td.IsClass && !td.IsAbstract) { var childTypeDefinition = assemblyDefinition.MainModule.GetType(td.FullName); pi.ClassEntity = new ClassEntity(assemblyDefinition, childTypeDefinition, classEntity.ProjectType, ""); LoadPropertyInformation(assemblyDefinition, childTypeDefinition, pi.ClassEntity, pi.Name); } } } }