/// <summary> /// Deploys value <c>dtc_value</c> for <c>dtc</c> attribute name /// </summary> /// <param name="dtc">The DTC.</param> /// <param name="dtc_val">The DTC value.</param> public void deploy(imbAttributeName dtc, String dtc_val) { switch (dtc) { case imbAttributeName.basicColor: color = dtc_val.toStringSafe(""); break; case imbAttributeName.cacheInstanceId: break; case imbAttributeName.codeCacheMethod: break; case imbAttributeName.collectionDefaultMemberName: break; case imbAttributeName.collectionDefaultParentName: break; case imbAttributeName.collectionDisablePrimaryKey: break; case imbAttributeName.collectionPrimaryKey: isPrimaryKey = true; break; case imbAttributeName.DataTableExport: break; case imbAttributeName.dataTemplateOverride: break; case imbAttributeName.defineEditor: break; case imbAttributeName.diagnosticContentPreset: break; case imbAttributeName.diagnosticContentText: break; case imbAttributeName.diagnosticEditorOperationInvoke: break; case imbAttributeName.diagnosticMode: break; case imbAttributeName.diagnosticModuleOperationInvoke: break; case imbAttributeName.diagnosticTestMetodInvoke: break; case imbAttributeName.diagnosticValue: break; case imbAttributeName.editorDisplayOption: break; case imbAttributeName.editorFlowViewMode: break; case imbAttributeName.editorHideMenu: break; case imbAttributeName.editorModulePropertyMode: break; case imbAttributeName.editorRelatedModulesMode: break; case imbAttributeName.editorToolSize: break; case imbAttributeName.evaluation: break; case imbAttributeName.evaluationPropertyRole: break; case imbAttributeName.evaluationStrictValues: break; case imbAttributeName.fileBackupAndRecovery: break; case imbAttributeName.fileEncodingType: break; case imbAttributeName.fileFormatDefaultSubdir: break; case imbAttributeName.fileFormatExtensions: break; case imbAttributeName.fileFormatForType: break; case imbAttributeName.fileFormatReaderType: break; case imbAttributeName.fileFormatWritterType: break; case imbAttributeName.fileFormatZippedReaderType: break; case imbAttributeName.fileFormatZippedWritterType: break; case imbAttributeName.fileProvideByteOrder: break; case imbAttributeName.helpPurpose: helpContent.purpose = dtc_val.toStringSafe(); break; case imbAttributeName.helpDescription: case imbAttributeName.help: case imbAttributeName.menuHelp: helpContent.description = dtc_val; additionalInfo.Add(dtc_val.toStringSafe("")); break; case imbAttributeName.helpTips: helpContent.hints = dtc_val.toStringSafe(""); break; case imbAttributeName.helpTitle: helpContent.title = dtc_val.toStringSafe(""); break; case imbAttributeName.hideInMenu: break; case imbAttributeName.isElementaryModule: break; case imbAttributeName.link: break; case imbAttributeName.linkPropertyHost: break; case imbAttributeName.linkPropertyName: break; case imbAttributeName.measure_calcGroup: case imbAttributeName.measure_displayGroup: case imbAttributeName.menuGroupPath: groups.Add(dtc_val.toStringSafe("")); if (categoryName.isNullOrEmpty()) { categoryName = dtc_val.toStringSafe("").ToUpper(); } break; case imbAttributeName.measure_displayGroupDescripton: break; case imbAttributeName.measure_expression: expression = dtc_val.toStringSafe(""); break; case imbAttributeName.measure_important: importance = dataPointImportance.important; if (dtc_val != null) { importance = dtc_val.imbToEnumeration <dataPointImportance>(); } break; case imbAttributeName.menuCommandKeyboard: letter = letter.or(dtc_val.toStringSafe(letter)); break; case imbAttributeName.measure_letter: case imbAttributeName.menuCommandKey: letter = dtc_val.toStringSafe(); break; case imbAttributeName.measure_metaModelName: break; case imbAttributeName.measure_metaModelPrefix: break; case imbAttributeName.measure_operand: break; case imbAttributeName.measure_operation: break; case imbAttributeName.measure_optimizeUnit: break; case imbAttributeName.measure_setAlarm: break; case imbAttributeName.measure_setRange: break; case imbAttributeName.measure_setRole: break; case imbAttributeName.measure_setUnit: unit = dtc_val.toStringSafe(""); break; case imbAttributeName.measure_target: break; case imbAttributeName.menuAskConfirmation: break; case imbAttributeName.menuCommandNode: break; case imbAttributeName.menuCommandTitle: break; case imbAttributeName.menuDelimiter: break; case imbAttributeName.menuEnabledSwitch: break; case imbAttributeName.menuIcon: break; case imbAttributeName.menuPriority: priority = dtc_val.imbToNumber <Int32>(); break; case imbAttributeName.menuRelevance: break; case imbAttributeName.menuRule_AcceptableRole: break; case imbAttributeName.menuRule_AcceptableType: break; case imbAttributeName.menuSpecialSubMenu: break; case imbAttributeName.menuStyle: break; case imbAttributeName.menuStyleImportant: break; case imbAttributeName.menuStyleNotRecommanded: break; case imbAttributeName.menuStyleVIP: break; case imbAttributeName.metaData: break; case imbAttributeName.metaValueFromAttribute: break; case imbAttributeName.neuralInput: break; case imbAttributeName.neuralOutput: break; case imbAttributeName.notChildrenResource: break; case imbAttributeName.postProcess: break; case imbAttributeName.preProcess: break; case imbAttributeName.rdfClassName: break; case imbAttributeName.rdfDefaultCollectionPath: break; case imbAttributeName.rdfIdProperty: break; case imbAttributeName.rdfPropertyName: break; case imbAttributeName.relatedTo: break; case imbAttributeName.relationChildUniqueMatchParentProperty: break; case imbAttributeName.relationKeyProperty: break; case imbAttributeName.relationMakeNewOnNull: break; case imbAttributeName.relationTakeAllBackrefference: break; case imbAttributeName.relationTakeFirstBackrefference: break; case imbAttributeName.reporting_aggregation: break; case imbAttributeName.reporting_agregate_function: break; case imbAttributeName.reporting_categoryOrder: CategoryByPriority.AddRange(imbSciStringExtensions.SplitSmart(dtc_val.toStringSafe(""), ",", "", true)); break; case imbAttributeName.reporting_columnWidth: width = dtc_val.imbToNumber <Int32>(); break; case imbAttributeName.reporting_escapeoff: escapeValueString = dtc_val.imbToBoolean(); break; case imbAttributeName.reporting_function: break; case imbAttributeName.reporting_hide: isHiddenInReport = true; break; case imbAttributeName.reporting_template: template = dtc_val.toStringSafe(""); break; case imbAttributeName.reporting_valueformat: format = dtc_val.toStringSafe(""); break; case imbAttributeName.selectionAllowSubTypes: break; case imbAttributeName.selectionAllowType: break; case imbAttributeName.serializationMode: break; case imbAttributeName.serializationOff: break; case imbAttributeName.serializationOn: break; case imbAttributeName.undefined: break; case imbAttributeName.viewPriority: priority = dtc_val.imbToNumber <Int32>(); break; case imbAttributeName.xmlEntityOutput: break; case imbAttributeName.xmlEntityOutputAsString: break; case imbAttributeName.xmlMapXpath: break; case imbAttributeName.xmlNodeTypeName: break; case imbAttributeName.xmlNodeValueProperty: break; default: throw new NotImplementedException("This attribute name [" + dtc + "] is not yet supported"); break; } }
/// <summary> /// Processes the type. /// </summary> /// <param name="type">The type.</param> /// <param name="includeCollectionItems">if set to <c>true</c> [include collection items].</param> /// <param name="target">The target.</param> protected void processType(Type type, Boolean includeCollectionItems, Object target = null, Int32 call = 0) { targetType = type; TypeInfo = new settingsMemberInfoEntry(type); var pTypes = type.GetBaseTypeList(false, true, null, call++); pTypes.Add(type); List <PropertyInfo> props = new List <PropertyInfo>(); foreach (var t in pTypes) { var pr = t.GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance); props.AddRange(pr); } List <PropertyInfo> propList = new List <PropertyInfo>(); foreach (PropertyInfo pro in props) { if (pro.CanWrite) { if (pro.PropertyType.IsEnum) { propList.Add(pro); } else if (pro.PropertyType.IsPrimitive) { propList.Add(pro); } else if (pro.PropertyType == typeof(String)) { propList.Add(pro); } else { if (pro.DeclaringType == targetType) { if (pro.Name != "Item") { propList.Add(pro); } else { } } } } } // propList.Sort(SortProperty); foreach (PropertyInfo pro in propList) { if (!pis.ContainsKey(pro.Name)) { pis.Add(pro.Name, pro); settingsPropertyEntryWithContext spe = new settingsPropertyEntryWithContext(pro, target, pce); spes.Add(pro.Name, spe); } } if (includeCollectionItems) { if (target is IList) { IList l = target as IList; foreach (var i in l) { settingsPropertyEntryWithContext spe = new settingsPropertyEntryWithContext(i, l, pce); spes.Add(spe.displayName, spe); } } } //// SORTING List <settingsPropertyEntryWithContext> tempList = new List <settingsPropertyEntryWithContext>(); // SORTING BY CATEGORY if (CategoryByPriority.Count > 0) { //aceDictionarySet<String, settingsPropertyEntry> pi_set = new aceDictionarySet<string, settingsPropertyEntry>(); Int32 pri = CategoryByPriority.Count; foreach (String cat in CategoryByPriority) { IEnumerable <settingsPropertyEntryWithContext> propInCat = spes.Values.Where(x => x.categoryName.ToLower() == cat.ToLower()); foreach (settingsPropertyEntryWithContext pic in propInCat) { pic.priority = (CategoryPrioritySpaceSize * pri) + pic.priority; tempList.Add(pic); } pri--; } foreach (var pair in spes) { if (!tempList.Contains(pair.Value)) { if (!CategoryByPriority.Contains(pair.Value.categoryName)) { CategoryByPriority.Add(pair.Value.categoryName); } tempList.Add(pair.Value); } } } else { foreach (settingsPropertyEntryWithContext pic in spes.Values) { tempList.Add(pic); } } // DEPLOYING PRIORITY SETTINGS INTO INDEX tempList = tempList.OrderByDescending(x => x.priority).ToList(); spes.Clear(); Int32 index = 0; foreach (var pic in tempList) { pic.index = index; index++; spes.Add(pic.name, pic); } // INHERITS MISSING VALUES foreach (var pair in spes) { inheritMissingSettings(pair.Value); } }