Exemplo n.º 1
0
 /// <summary>
 /// UISwitch with on or off values will be displayed
 /// </summary>
 public TableItem(string title, SampleAction action, bool isOn)
 {
     Title          = title;
     Action         = action;
     SelectedAction = isOn ? 0 : -1;
     ItemType       = TableItemType.Toggle;
 }
Exemplo n.º 2
0
    public Action Create(ActionType type)
    {
        Action action = null;

        switch (type)
        {
        case ActionType.Sample1:
            action = new SampleAction();
            break;

        case ActionType.Sample2:
            action = new SampleAction2();
            break;

        default:
            Debug.Assert(false, "未定義のActionタイプ");
            break;
        }

        if (action != null)
        {
            action.Init(actionIdSeed);
            Register(actionIdSeed, action);
            actionIdSeed += 1;
        }

        return(action);
    }
Exemplo n.º 3
0
        public IEnumerable <string> Get()
        {
            _logger.LogInformation("Getting items");

            var action = new SampleAction(new ActionCallerContext());
            var result = _actionExecutor.Execute(action);

            return(new string[] { "value1", "value2", result.Test });
        }
Exemplo n.º 4
0
    private void CreateTestNode()
    {
        NodeFactory factory = new NodeFactory();

        rootNode = factory.CreateNode(NodeType.Root);
        var actionNode   = (ActionNode)factory.CreateNode(NodeType.Action);
        var sampleAction = new SampleAction();

        actionNode.Action = sampleAction;
        rootNode.AddNode(actionNode);
    }
        public void Setup()
        {
            MiniProfiler.Start();

            _identity = Guid.NewGuid();
            _queueName = Guid.NewGuid().ToString("N");
            _processName = Guid.NewGuid().ToString("N");

            _repository = Factory.Create();

            _repository.ReleaseProcessLock(_processName);

            _queueId = _repository.CreateQueue(_queueName);

            var message = new SampleAction {Name = Guid.NewGuid().ToString()};
            _repository.CreateMessage(_queueId, "Test", JsonSerializer.ToJson(message), null, null, 0, Guid.NewGuid());
            _repository.CreateMessage(_queueId, "Test", JsonSerializer.ToJson(message), null, null, 0, _identity);
        }