Exemple #1
0
        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;
            }
        }
Exemple #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");
        }
        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;
            }
        }
Exemple #4
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");
		}
Exemple #5
0
 protected bool Equals(MemberBase other)
 {
     return(string.Equals(Name, other.Name) && XamlType.Equals(other.XamlType));
 }