static void TestSavegame()
		{
			Property prop = PropertyFactory.Construct("ValueProperty", null);//, null, 0, 0, null);
			Trace.Write("Discovered: " + prop.TypeName + " = " + prop);

			var published = Publish.Retrieve(prop);
			Trace.Write("This property published the values following:");
			foreach (var mi in published)
			{
				Trace.Write("- " + mi.Key + ":" + mi.Value.MemberType + ":" + mi.Value);
			}

			var keys = prop.GetKeys();
			Trace.Write("This property published the properties following:");
			foreach (var k in keys)
			{
				Trace.Write("- " + k);
			}

			var childs = prop.GetChilds();
			Trace.Write("This property published the childs following:");
			foreach (var c in childs)
			{
				Trace.Write("- " + c);
			}
		}
Exemplo n.º 2
0
        public void Merge(JObject definition, bool first = false)
        {
            var cdef = Editor.ComponentDefinitionsMap[Name];

            foreach (var prop in cdef.Properties)
            {
                JToken value;
                if (definition.TryGetValue(prop.Property, out value))
                {
                    Properties[prop.Property] = PropertyFactory.Construct(Name, prop.Property, value);
                }
                else if (first)
                {
                    Properties[prop.Property] = PropertyFactory.Construct(Name, prop.Property, null);
                }
            }
        }