public void WriteXml(XmlTextWriter w) { w.WriteStartElement("ChildDataType"); w.WriteAttributeString("IsInternal", IsInternal.ToString()); w.WriteAttributeString("Name", name); w.WriteAttributeString("NameSpace", nameSpace); w.WriteElementString("SourceFileName", SourceFileName); w.WriteEndElement(); }
/// <inheritdoc /> public override int GetHashCode() { unchecked { var hashCode = (int)ErrorCode; hashCode = (hashCode * 397) ^ (TopicName?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (IsInternal?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Partitions?.GetHashCode() ?? 0); return(hashCode); } }
/// <summary> /// LUA结构支持 /// </summary> /// <returns></returns> public override void GetLuaStruct(StringBuilder code) { base.GetLuaStruct(code); int idx; code.AppendLine($@"['ColumnIndexStart'] ={ColumnIndexStart},"); code.AppendLine($@"['IsUniqueUnion'] ={(IsUniqueUnion.ToString().ToLower())},"); if (PrimaryColumn != null) { code.AppendLine($@"['PrimaryColumn'] = {PrimaryColumn.GetLuaStruct()},"); } if (!string.IsNullOrWhiteSpace(PrimaryField)) { code.AppendLine($@"['PrimaryField'] = '{PrimaryField.ToLuaString()}',"); } else { code.AppendLine($@"['PrimaryField'] = nil,"); } if (!string.IsNullOrWhiteSpace(RedisKey)) { code.AppendLine($@"['RedisKey'] = '{RedisKey.ToLuaString()}',"); } else { code.AppendLine($@"['RedisKey'] = nil,"); } if (!string.IsNullOrWhiteSpace(ModelInclude)) { code.AppendLine($@"['ModelInclude'] = '{ModelInclude.ToLuaString()}',"); } else { code.AppendLine($@"['ModelInclude'] = nil,"); } if (!string.IsNullOrWhiteSpace(ModelBase)) { code.AppendLine($@"['ModelBase'] = '{ModelBase.ToLuaString()}',"); } else { code.AppendLine($@"['ModelBase'] = nil,"); } code.AppendLine($@"['DataVersion'] ={DataVersion},"); code.AppendLine($@"['IsInternal'] ={(IsInternal.ToString().ToLower())},"); if (!string.IsNullOrWhiteSpace(Name)) { code.AppendLine($@"['Name'] = '{Name.ToLuaString()}',"); } else { code.AppendLine($@"['Name'] = nil,"); } code.AppendLine($@"['IsClass'] ={(IsClass.ToString().ToLower())},"); if (!string.IsNullOrWhiteSpace(Interfaces)) { code.AppendLine($@"['Interfaces'] = '{Interfaces.ToLuaString()}',"); } else { code.AppendLine($@"['Interfaces'] = nil,"); } if (!string.IsNullOrWhiteSpace(Project)) { code.AppendLine($@"['Project'] = '{Project.ToLuaString()}',"); } else { code.AppendLine($@"['Project'] = nil,"); } code.AppendLine($@"['MaxIdentity'] ={MaxIdentity},"); idx = 0; code.AppendLine("['Properties'] ={"); foreach (var val in Properties) { if (idx++ > 0) { code.Append(','); } code.AppendLine($@"{val.GetLuaStruct()}"); } code.AppendLine("},"); //idx = 0; //code.AppendLine("['LastProperties'] ={"); //foreach (var val in LastProperties) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); idx = 0; code.AppendLine("['Commands'] ={"); foreach (var val in Commands) { if (idx++ > 0) { code.Append(','); } code.AppendLine($@"{val.GetLuaStruct()}"); } code.AppendLine("},"); idx = 0; code.AppendLine("['Releations'] ={"); foreach (var val in Releations) { if (idx++ > 0) { code.Append(','); } code.AppendLine($@"{val.GetLuaStruct()}"); } code.AppendLine("},"); code.AppendLine($@"['MaxForm'] ={(MaxForm.ToString().ToLower())},"); code.AppendLine($@"['ListDetails'] ={(ListDetails.ToString().ToLower())},"); if (!string.IsNullOrWhiteSpace(ReadTableName)) { code.AppendLine($@"['TableName'] = '{ReadTableName.ToLuaString()}',"); } else { code.AppendLine($@"['TableName'] = nil,"); } if (!string.IsNullOrWhiteSpace(SaveTableName)) { code.AppendLine($@"['SaveTableName'] = '{SaveTableName.ToLuaString()}',"); } else { code.AppendLine($@"['SaveTableName'] = nil,"); } if (!string.IsNullOrWhiteSpace(SaveTable)) { code.AppendLine($@"['SaveTable'] = '{SaveTable.ToLuaString()}',"); } else { code.AppendLine($@"['SaveTable'] = nil,"); } code.AppendLine($@"['DbIndex'] ={DbIndex},"); code.AppendLine($@"['UpdateByModified'] ={(UpdateByModified.ToString().ToLower())},"); if (!string.IsNullOrWhiteSpace(CppName)) { code.AppendLine($@"['CppName'] = '{CppName.ToLuaString()}',"); } else { code.AppendLine($@"['CppName'] = nil,"); } if (!string.IsNullOrWhiteSpace(DisplayName)) { code.AppendLine($@"['DisplayName'] = '{DisplayName.ToLuaString()}',"); } else { code.AppendLine($@"['DisplayName'] = nil,"); } //idx = 0; //code.AppendLine("['PublishProperty'] ={"); //foreach (var val in PublishProperty) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); //idx = 0; //code.AppendLine("['CppProperty'] ={"); //foreach (var val in CppProperty) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); //idx = 0; //code.AppendLine("['ClientProperty'] ={"); //foreach (var val in ClientProperty) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); //idx = 0; //code.AppendLine("['UserProperty'] ={"); //foreach (var val in UserProperty) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); //idx = 0; //code.AppendLine("['PublishDbFields'] ={"); //foreach (var val in PublishDbFields) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); //idx = 0; //code.AppendLine("['DbFields'] ={"); //foreach (var val in DbFields) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); //idx = 0; //code.AppendLine("['ReadCoreCodes'] ={"); //foreach (var val in ReadCoreCodes.Values) //{ // if (idx++ > 0) // code.Append(','); // code.AppendLine($@"{val.GetLuaStruct()}"); //} //code.AppendLine("},"); }
/// <summary> /// Gets the hash code for this <see cref="DragDropInfo"/> object. /// </summary> /// <returns>The hash code.</returns> public override int GetHashCode() { return(Location.GetHashCode() ^ KeyStates.GetHashCode() ^ Data.GetHashCode() ^ IsInternal.GetHashCode() ^ Source.GetHashCode() ^ AllowedEffects.GetHashCode() ^ VirtualBufferPosition.GetHashCode()); }