public ColumnRelationship GetByChildField(CustomViewColumn column) { foreach (ColumnRelationship r in this) { var c = (CustomViewColumn)r.ParentColumnRef.Object; if (c == column) { return(r); } } return(null); }
public ReadOnlyCollection <ViewRelation> FindByChildColumn(CustomViewColumn column) { var retval = new List <ViewRelation>(); foreach (ViewRelation relation in this) { foreach (ViewColumnRelationship columnRelationship in relation.ColumnRelationships) { if (columnRelationship.ChildColumnRef.Object != null) { if (StringHelper.Match(columnRelationship.ChildColumnRef.Object.Key, column.Key, true)) { retval.Add(relation); } } } } return(retval.AsReadOnly()); }
private void AppendPropertyEventDeclarations(CustomViewColumn column, string codeType) { #if notdone CustomView typetable = _currentView.GetRelatedTypeTableByColumn(column); if (typetable != null) { this.AppendPropertyEventDeclarations(typetable.PascalName, codeType); } else { #endif this.AppendPropertyEventDeclarations(column.PascalName, codeType); #if notdone } #endif }
private string GetPropertyNode(CustomViewColumn column) { var propertyString = new StringBuilder(); //Attributes Name and Type propertyString.AppendFormat(" <Property Name=\"{0}\" Type=\"{1}\" ", column.PascalName, column.EFSqlCodeType()); //Attribute Nullable propertyString.Append("Nullable=\"" + (column.AllowNull ? "true" : "false") + "\" "); //Attribute MaxLength if (!string.IsNullOrEmpty(column.EFGetCodeMaxLengthString())) { propertyString.AppendFormat("MaxLength=\"{0}\" ", column.EFGetCodeMaxLengthString()); } //Attribute Precision Scale if (column.EFSupportsPrecision()) { propertyString.AppendFormat("Precision=\"{0}\" Scale=\"{1}\" ", column.Length.ToString(), column.Scale); } //Attribute Unicode if (column.EFUnicode().HasValue) { var unicodeString = column.EFUnicode().Value ? "true" : "false"; propertyString.AppendFormat("Unicode=\"{0}\" ", unicodeString); } //Attribute FixedLength if (column.EFIsFixedLength().HasValue) { var isFixedLengthString = column.EFIsFixedLength().Value ? "true" : "false"; propertyString.AppendFormat("FixedLength=\"{0}\" ", isFixedLengthString); } //Primary Key /* if (column.PrimaryKey) { //propertyString.Append("xmlns:a=\"http://schemas.microsoft.com/ado/2006/04/codegeneration\" "); if (column.IsIntegerType && column.Identity == IdentityTypeConstants.Database) { //propertyString.Append("a:SetterAccess=\"Private\" DefaultValue=\"-1\" annotation:StoreGeneratedPattern=\"Identity\" "); propertyString.Append("DefaultValue=\"-1\" annotation:StoreGeneratedPattern=\"Identity\" "); } else { //propertyString.Append("a:SetterAccess=\"Public\" "); } } */ propertyString.Append("/>").AppendLine(); return propertyString.ToString(); }