Lines Matching refs:field
43 /// a field path in the FieldMask.</para>
91 /// Adds a field path to the tree. In a FieldMask, every field path matches the
92 /// specified field as well as all its sub-fields. For example, a field path
93 /// "foo.bar" matches field "foo.bar" and also "foo.bar.baz", etc. When adding
94 /// a field path to the tree, redundant sub-paths will be removed. That is,
97 /// Likewise, if the field path to add is a sub-path of an existing leaf node,
139 /// Merges all field paths in a FieldMask into this tree.
168 /// Gathers all field paths in a sub-tree.
264 var field = descriptor.FindFieldByName(entry.Key);
265 if (field == null)
267 Debug.WriteLine($"Cannot find field \"{entry.Key}\" in message type \"{descriptor.FullName}\"");
273 if (field.IsRepeated
274 || field.FieldType != FieldType.Message)
276 Debug.WriteLine($"Field \"{field.FullName}\" is not a singular message field and cannot have sub-fields.");
280 var sourceField = field.Accessor.GetValue(source);
281 var destinationField = field.Accessor.GetValue(destination);
285 // If the message field is not present in both source and destination, skip recursing
292 // If we have to merge but the destination does not contain the field, create it.
293 destinationField = field.MessageType.Parser.CreateTemplate();
294 field.Accessor.SetValue(destination, destinationField);
302 if (field.IsRepeated)
306 field.Accessor.Clear(destination);
309 var sourceField = (IList)field.Accessor.GetValue(source);
310 var destinationField = (IList)field.Accessor.GetValue(destination);
318 var sourceField = field.Accessor.GetValue(source);
319 if (field.FieldType == FieldType.Message)
325 field.Accessor.Clear(destination);
329 field.Accessor.SetValue(destination, sourceField);
337 var destinationValue = (IMessage)field.Accessor.GetValue(destination);
344 field.Accessor.SetValue(destination, field.MessageType.Parser.ParseFrom(sourceByteString));
354 field.Accessor.SetValue(destination, sourceField);
358 field.Accessor.Clear(destination);