// The settings of a load, for the object writer and for the text reader that feeds it.

///|
/// The settings of a load, in the style of System.Xaml `XamlObjectWriterSettings`.
pub struct LoadSettings {
  /// The object that the root element stands for, whose members the load sets instead of creating one. Its type is that
  /// of the element or derives from it. When the load fails, it keeps the members that were set before the error.
  /// Initialization text of the root replaces it: the result is then another object.
  root_object : @nodes.XamlObject?
  /// The scope of the application that loads the document. The namespaces `clr-namespace:N` and
  /// `clr-namespace:N;assembly=` are in it, in names that converters and markup extensions resolve too.
  local_scope : String?
  /// How many object elements the text reader nests. The object writer has no limit of its own.
  max_depth : Int32
  /// How many markup extensions the text reader nests in one attribute value.
  max_extension_depth : Int32
  /// Namespaces that the application understands although the schema context may register nothing in them. They are for
  /// the markup compatibility of the text reader.
  understood_namespaces : ReadOnlyArray[String]
  /// What every event adder of the load receives as its last argument. Those of routed events need the handle of a
  /// `@schema.HandlerTable`.
  event_handlers : @nodes.XamlObject?
}

///|
/// The settings, with the defaults of `XamlTextReader::new`.
pub fn LoadSettings::new(
  root_object? : @nodes.XamlObject,
  local_scope? : String,
  max_depth~ : Int32 = 512,
  max_extension_depth~ : Int32 = 128,
  understood_namespaces~ : ReadOnlyArray[String] = [],
  event_handlers? : @nodes.XamlObject,
) -> LoadSettings {
  {
    root_object,
    local_scope,
    max_depth,
    max_extension_depth,
    understood_namespaces,
    event_handlers,
  }
}