/// ------------------------------------------------------------------------------------ public void PostDeserializeInitialization(PaProject project) { if (Type == DataSourceType.SA && FieldMappings.Count == 0) { // Make sure SA data sources have mappings. This check should really only be // necessary when upgrading from a project last saved in version 3.0.1 of PA. FieldMappings = CreateDefaultSaMappings(project.Fields).ToList(); } else if (Type == DataSourceType.FW) { // Make sure FW6 data source mappings include all the default FW6 fields // that cannot be mapped in the data source properties dialog box. This // check should only be necessary the first time the project has been // opened after having been migrated to version 3.3.0 foreach (var fname in Properties.Settings.Default.AllPossibleFw6Fields) { if (!Properties.Settings.Default.Fw6FieldsMappableInPropsDlg.Contains(fname) && !FieldMappings.Any(m => m.PaFieldName == fname)) { FieldMappings.Add(new FieldMapping( project.Fields.Single(f => f.Name == fname), false)); } } } }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("name"); writer.WriteStringValue(Name); if (Description != null) { writer.WritePropertyName("description"); writer.WriteStringValue(Description); } writer.WritePropertyName("dataSourceName"); writer.WriteStringValue(DataSourceName); if (SkillsetName != null) { writer.WritePropertyName("skillsetName"); writer.WriteStringValue(SkillsetName); } writer.WritePropertyName("targetIndexName"); writer.WriteStringValue(TargetIndexName); if (Schedule != null) { writer.WritePropertyName("schedule"); writer.WriteObjectValue(Schedule); } if (Parameters != null) { writer.WritePropertyName("parameters"); writer.WriteObjectValue(Parameters); } if (FieldMappings != null && FieldMappings.Any()) { writer.WritePropertyName("fieldMappings"); writer.WriteStartArray(); foreach (var item in FieldMappings) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (OutputFieldMappings != null && OutputFieldMappings.Any()) { writer.WritePropertyName("outputFieldMappings"); writer.WriteStartArray(); foreach (var item in OutputFieldMappings) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (IsDisabled != null) { writer.WritePropertyName("disabled"); writer.WriteBooleanValue(IsDisabled.Value); } if (_etag != null) { writer.WritePropertyName("@odata.etag"); writer.WriteStringValue(_etag); } writer.WriteEndObject(); }