Ejemplo n.º 1
0
 public void SetPage(ProjectData.TrackTransformation.TransformType pageID)
 {
     selectedLine = 2;
     page         = pageID;
     RefreshValueLabel();
     if (keyframeEditor != null)
     {
         keyframeEditor.Destroy();
     }
     keyframeEditor = new TransformationList(this, pageID, new Vector2(pos.x, pos.y + HEIGHT * 0.5f - LINES_START - LINE_HEIGHT * (0.5f + numLines) - 25 - TransformationList.HEIGHT * 0.5f));
     VoezEditor.Editor.AddObject(keyframeEditor);
     colorButton.toggled = false;
     moveButton.toggled  = false;
     scaleButton.toggled = false;
     if (page == ProjectData.TrackTransformation.TransformType.COLOR)
     {
         colorButton.toggled = true;
     }
     else if (page == ProjectData.TrackTransformation.TransformType.MOVE)
     {
         moveButton.toggled = true;
     }
     else
     {
         scaleButton.toggled = true;
     }
 }
Ejemplo n.º 2
0
 public void TestAddTwo()
 {
     TransformationList<int> t = new TransformationList<int>();
     t.Add(x => x + 1);
     t.Add(x => x + 2);
     t.Invoke(1).Should().Be(4);
 }
        public void TestAddOne()
        {
            TransformationList <int> t = new TransformationList <int>();

            t.Add(x => x + 2);
            t.Invoke(1).Should().Be(3);
        }
Ejemplo n.º 4
0
        public void TestRecursion()
        {
            TransformationList<int> t = new TransformationList<int>();
            Func<int, int> func = null;
            func = x => (x < 100 ? func(x + 1) : x);

            t.Add(func);

            t.Invoke(1).Should().Be(100);
        }
        public void TestRecursion()
        {
            TransformationList <int> t    = new TransformationList <int>();
            Func <int, int>          func = null;

            func = x => (x < 100 ? func(x + 1) : x);

            t.Add(func);

            t.Invoke(1).Should().Be(100);
        }
Ejemplo n.º 6
0
 public TransformationItem(TransformationList parent, ProjectData.TrackTransformation data, Vector2 pos)
 {
     this.data   = data;
     this.parent = parent;
     this.pos    = pos;
     labels      = new FLabel[4];
     labels[0]   = new FLabel("Raleway16", "Value:");
     labels[1]   = new FLabel("Raleway16", "Start:");
     labels[2]   = new FLabel("Raleway16", "End:");
     labels[3]   = new FLabel("Raleway16", "Easing:");
     RefreshLabelValues();
 }
Ejemplo n.º 7
0
        public void TestAddTwoThenRemoveOne()
        {
            TransformationList<int> t = new TransformationList<int>();
            Func<int, int> func = x => x + 1;

            t.Add(func);
            t.Add(x => x + 2);

            t.Invoke(1).Should().Be(4);

            t.Remove(func);

            t.Invoke(1).Should().Be(3);
        }
        public void TestAddTwoThenRemoveOne()
        {
            TransformationList <int> t    = new TransformationList <int>();
            Func <int, int>          func = x => x + 1;

            t.Add(func);
            t.Add(x => x + 2);

            t.Invoke(1).Should().Be(4);

            t.Remove(func);

            t.Invoke(1).Should().Be(3);
        }
        public override void Dispatch(MessageDelivery messageDelivery)
        {
            MessageDeliveryContext context = messageDelivery.Context;

            Dictionary <MessageDeliveryContextKey, object> newContext = context.ToDictionary();

            TransformationList oldTransformedByList = new TransformationList();

            if (context.ContainsKey(TransformedByKeyName))
            {
                oldTransformedByList = (TransformationList)context[TransformedByKeyName];
            }

            // Don't transform this message more than once
            if (!oldTransformedByList.Contains(Endpoint.Id.ToString()) || AllowMultipleTransforms)
            {
                if (oldTransformedByList.Count() > 0)
                {
                    List <string> list = new List <string>(oldTransformedByList);
                    list.Add(Endpoint.Id.ToString());
                    newContext[TransformedByKeyName] = new TransformationList(list);
                }
                else
                {
                    List <string> list = new List <string>();
                    list.Add(Endpoint.Id.ToString());
                    newContext[TransformedByKeyName] = new TransformationList();
                }

                context = new MessageDeliveryContext(newContext);

                PublishRequest result = Transform(new PublishRequest(Endpoint.ContractType, messageDelivery.Action, messageDelivery.Message, context));
                if (result != null)
                {
                    Runtime.PublishOneWay(new PublishRequest(result.ContractType, result.Action, result.Message, context));
                }
            }
            else
            {
                System.Diagnostics.Trace.TraceInformation("Skipping already transformed message (" + messageDelivery.MessageDeliveryId + ")");
            }
        }
Ejemplo n.º 10
0
 public void TestNoTransformation()
 {
     TransformationList<int> t = new TransformationList<int>();
     t.Invoke(1).Should().Be(1);
 }
        public void TestNoTransformation()
        {
            TransformationList <int> t = new TransformationList <int>();

            t.Invoke(1).Should().Be(1);
        }