public override void WriteStartObject(XamlType type)
        {
            switch (this.currentState)
            {
                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
                    if (type.Equals(new XamlType(typeof(ActivityTemplateFactoryBuilder), this.schemaContext)))
                    {
                        this.queuedNodes = new XamlNodeQueue(this.schemaContext);
                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BufferingState;
                    }
                    else
                    {
                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BypassState;
                        this.underlyingWriter.WriteStartObject(type);
                    }

                    break;
                case ActivityTemplateFactoryBuilderWriterStates.BypassState:
                    this.underlyingWriter.WriteStartObject(type);
                    break;
                default:
                    SharedFx.Assert(
                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingState
                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingNameState
                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState,
                        "These are the only possible ActivityTemplateFactoryBuilderWriterStates.");
                    SharedFx.Assert("It is impossible to start any object during the buffering state.");
                    break;
            }
        }
Example #2
0
		public void EmptyTypeArguments2 ()
		{
			var t1 = new XamlType ("System", "Int32", null, sctx);
			var t2 = new XamlType ("System", "Int32", new XamlType [0], sctx);
			Assert.IsNull (t1.TypeArguments, "#1");
			Assert.IsNull (t2.TypeArguments, "#2");
			Assert.IsTrue (t1 == t2, "#3");
			Assert.IsTrue (t1.Equals (t2), "#4");
		}