示例#1
0
        internal sealed override void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations)
        {
            if (this.HasChanges)
            {
                writer.WriteStartApplicationDefinedType(
                    GlowElementCollection.Element.OuterId, GlowQualifiedMatrix.InnerNumber);

                writer.WriteValue(GlowQualifiedMatrix.Path.OuterId, this.NumberPath);
                writer.WriteStartSequence(GlowQualifiedMatrix.Connections.OuterId);

                foreach (var target in this.targetsWithChangedConnections)
                {
                    writer.WriteStartApplicationDefinedType(
                        GlowConnectionCollection.Connection.OuterId, GlowConnection.InnerNumber);
                    writer.WriteValue(GlowConnection.Target.OuterId, target);
                    writer.WriteValue(GlowConnection.Sources.OuterId, this.connections[target].ToArray());
                    writer.WriteEndContainer();
                }

                writer.WriteEndContainer();
                writer.WriteEndContainer();
                this.targetsWithChangedConnections.Clear();
                this.HasChanges = false;
            }
        }
 internal void WriteChangesCollection(EmberWriter writer, IInvocationCollection pendingInvocations)
 {
     foreach (var child in this.children.Values)
     {
         child.WriteChanges(writer, pendingInvocations);
     }
 }
示例#3
0
        internal sealed override void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations)
        {
            if (this.HasChanges)
            {
                writer.WriteStartApplicationDefinedType(
                    GlowElementCollection.Element.OuterId, GlowQualifiedParameter.InnerNumber);

                writer.WriteValue(GlowQualifiedParameter.Path.OuterId, this.NumberPath);
                writer.WriteStartSet(GlowQualifiedParameter.Contents.OuterId);

                if (this.theValue == null)
                {
                    // This can only happen when the parameter happens to be a trigger.
                    writer.WriteValue(GlowParameterContents.Value.OuterId, 0);
                }
                else
                {
                    this.WriteValue(writer, this.theValue);
                }

                writer.WriteEndContainer();
                writer.WriteEndContainer();
                this.HasChanges = false;
            }
        }
示例#4
0
 internal override void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations)
 {
     if (this.HasChanges)
     {
         this.WriteChangesCollection(writer, pendingInvocations);
         this.HasChanges = false;
     }
 }
示例#5
0
 internal sealed override void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations)
 {
     if (this.HasChanges)
     {
         writer.WriteStartApplicationDefinedType(GlowGlobal.Root.OuterId, GlowRootElementCollection.InnerNumber);
         this.WriteChangesCollection(writer, pendingInvocations);
         writer.WriteEndContainer();
         this.HasChanges = false;
     }
 }
示例#6
0
        internal sealed override void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations)
        {
            if (this.HasChanges)
            {
                writer.WriteStartApplicationDefinedType(
                    GlowElementCollection.Element.OuterId, GlowQualifiedFunction.InnerNumber);

                writer.WriteValue(GlowQualifiedFunction.Path.OuterId, this.NumberPath);
                writer.WriteStartApplicationDefinedType(
                    GlowQualifiedFunction.Children.OuterId, GlowElementCollection.InnerNumber);
                this.WriteInvocations(writer, pendingInvocations);
                writer.WriteEndContainer();
                writer.WriteEndContainer();
                this.HasChanges = false;
            }
        }
示例#7
0
        private void WriteInvocations(EmberWriter writer, IInvocationCollection pendingInvocations)
        {
            while (this.invocations.Count > 0)
            {
                writer.WriteStartApplicationDefinedType(GlowElementCollection.Element.OuterId, GlowCommand.InnerNumber);
                writer.WriteValue(GlowCommand.Number.OuterId, 33);
                writer.WriteStartApplicationDefinedType(GlowCommand.Invocation.OuterId, GlowInvocation.InnerNumber);
                var invocation   = this.invocations.Dequeue();
                var invocationId = pendingInvocations.Add(invocation.Key);
                writer.WriteValue(GlowInvocation.InvocationId.OuterId, invocationId);
                writer.WriteStartSequence(GlowInvocation.Arguments.OuterId);

                foreach (var writeValue in invocation.Value)
                {
                    writeValue(writer);
                }

                writer.WriteEndContainer();
                writer.WriteEndContainer();
                writer.WriteEndContainer();
            }
        }
示例#8
0
 internal abstract void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations);
 internal sealed override void WriteChanges(EmberWriter writer, IInvocationCollection pendingInvocations) =>
 this.HasChanges = false;