Example #1
0
        public Form1()
        {
            //Set MessagePack Resolvers
            CompositeResolver.RegisterAndSetAsDefault(
                DynamicObjectResolverAllowPrivate.Instance,
                StandardResolver.Instance
                );

            InitializeComponent();

            complexAnimationData = new ComplexAnimation();
            //labelFrameCount.DataBindings.Add(complexAnimationData.GetFrameCountDataBinding()); //Not working ...
            complexAnimationData.OnFrameCountChanged(ComplexDataFramecountChanged);

            IEnumerable <Animation.AnimationType> animationTypes = Enum.GetValues(typeof(Animation.AnimationType)).Cast <Animation.AnimationType>();

            foreach (Animation.AnimationType aT in animationTypes)
            {
                comboBoxAnimationType.Items.Add(aT.ToString());
            }
            comboBoxAnimationType.SelectedItem  = null;
            comboBoxAnimationType.SelectedIndex = 1;

            UpdateFrameDataOutput(-1);
        }
Example #2
0
 void CopyFromInstance(ComplexAnimation animationInstance)
 {
     Reset();
     SetAnimationType(animationInstance.GetAnimationType());
     SetFrametime(animationInstance.GetFrametime());
     foreach (FrameData d in animationInstance.data)
     {
         this.data.Add(d);
     }
     animationInstance.data.Clear();
 }
Example #3
0
        /// <summary>
        /// Deserialize data
        /// </summary>
        /// <param name="data"></param>
        public void DeserializeFromBytes(byte[] data)
        {
            ComplexAnimation _newData = MessagePackSerializer.Deserialize <ComplexAnimation>(data);

            this.CopyFromInstance(_newData);
        }