internal FixedContainer GetContext(string relativePath)
        {
            if (relativePath == ".")
            {
                return(ContainerContext);
            }
            var chain = FieldChain <Container> .Create(ContainerContext.Container, ReplaceIndexes(relativePath));

            return(chain.GetFinalContext(ContainerContext).ToChildContext(chain.FinalField));
        }
Beispiel #2
0
 internal VisualTreeNode(
     VisualTreeNode?parent,
     FixedContainer context,
     Func <VisualTreeNode?, IReadOnlyList <VisualTreeNode> > childrenProvider,
     IReadOnlyList <VisualTreeDetail> details,
     FormattableDescription description,
     FormattableDescription?kitOnlyDescription,
     FieldChain <MidiNoteField>?midiNoteField,
     int?kitNumber,
     int?instrumentNumber) =>
 (Parent, Context, Children, Details, Description, KitOnlyDescription, MidiNoteField, KitNumber, InstrumentNumber) =
        private IModuleDataFormattableString GetFormattableString(string path)
        {
            var indexed = ReplaceIndexes(path);

            if (lookupsByPath.TryGetValue(indexed, out var lookupValue))
            {
                return(new LookupFormattableString(indexed, lookupValue));
            }
            var fieldChain = FieldChain <IPrimitiveField> .Create(ContainerContext.Container, indexed);

            return(new FieldFormattableString(fieldChain));
        }
 internal FieldChain <MidiNoteField> GetMidiNoteField(string relativePath) =>
 FieldChain <MidiNoteField> .Create(ContainerContext.Container, ReplaceIndexes(relativePath));
 public FieldFormattableString(FieldChain <IPrimitiveField> chain) => this.chain = chain;