Exemplo n.º 1
0
        public RailCommandDataSerializer(RailCommand instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException(nameof(instance));
            }

            command = instance;
            foreach (PropertyInfo prop in instance
                     .GetType()
                     .GetProperties(
                         BindingFlags.Instance |
                         BindingFlags.Public |
                         BindingFlags.NonPublic))
            {
                if (Attribute.IsDefined(prop, typeof(CommandDataAttribute)))
                {
                    members.Add(RailSynchronizedFactory.Create(instance, prop));
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Applies a command to this instance.
 ///     Called on controller and server.
 /// </summary>
 /// <param name="toApply"></param>
 protected virtual void ApplyControlGeneric(RailCommand toApply)
 {
 }