Ejemplo n.º 1
0
        /// <summary>
        /// This method initializes activity UI controls to their default values.
        /// </summary>
        /// <param name="activity">An instance of the current workflow activity. This provides a way to extract the values of the properties to display in the UI.</param>
        public override void LoadActivitySettings(Activity activity)
        {
            Logger.Instance.WriteMethodEntry();

            try
            {
                // Cast the supplied activity as a UpdateResources activity
                UpdateResources wfa = activity as UpdateResources;
                if (wfa == null)
                {
                    return;
                }

                // Set form control values based on the activity's dependency properties
                this.activityDisplayName.Value        = wfa.ActivityDisplayName;
                this.queryResources.Value             = wfa.QueryResources;
                this.advanced.Value                   = wfa.Advanced;
                this.activityExecutionCondition.Value = wfa.ActivityExecutionCondition;
                this.iteration.Value                  = wfa.Iteration;
                this.actorType.Value                  = wfa.ActorType.ToString();
                this.actorString.Value                = wfa.ActorString;
                this.applyAuthorizationPolicy.Value   = wfa.ApplyAuthorizationPolicy;
                this.queries.LoadActivitySettings(wfa.QueriesTable);
                this.updates.LoadActivitySettings(wfa.UpdatesTable);
            }
            catch (Exception e)
            {
                Logger.Instance.ReportError(e);
                throw;
            }
            finally
            {
                Logger.Instance.WriteMethodExit();
            }
        }
Ejemplo n.º 2
0
 public CheckForUpdateHandler(
     IMediator mediator,
     ILogger <CheckForUpdateHandler> logger,
     IGithubClient githubClient,
     UpdateResources resources)
 {
     this.mediator     = mediator;
     this.logger       = logger;
     this.githubClient = githubClient;
     this.resources    = resources;
 }
Ejemplo n.º 3
0
        public override Activity GenerateActivityOnWorkflow(SequentialWorkflow workflow)
        {
            Logger.Instance.WriteMethodEntry();

            try
            {
                // Create a new instance of the UpdateResources activity and assign
                // dependenty property values based on inputs to standard activity controls
                UpdateResources wfa = new UpdateResources
                {
                    ActivityDisplayName        = this.activityDisplayName.Value,
                    QueryResources             = this.queryResources.Value,
                    Advanced                   = this.advanced.Value,
                    ActivityExecutionCondition = this.activityExecutionCondition.Value,
                    Iteration                  = this.iteration.Value,
                    ActorType                  = GetActorType(this.actorType.Value),
                    ActorString                = this.actorString.Value,
                    ApplyAuthorizationPolicy   = this.applyAuthorizationPolicy.Value,
                    ResolveDynamicGrammar      = this.resolveDynamicGrammar.Value
                };

                // Convert the definition listings (web controls) to hash tables which can be serialized to the XOML workflow definition
                // A hash table is used due to issues with deserialization of lists and other structured data
                DefinitionsConverter queriesConverter = new DefinitionsConverter(this.queries.DefinitionListings);
                DefinitionsConverter updatesConverter = new DefinitionsConverter(this.updates.DefinitionListings);
                wfa.QueriesTable = queriesConverter.DefinitionsTable;
                wfa.UpdatesTable = updatesConverter.DefinitionsTable;

                return(wfa);
            }
            catch (Exception e)
            {
                Logger.Instance.ReportError(e);
                throw;
            }
            finally
            {
                Logger.Instance.WriteMethodExit();
            }
        }
Ejemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        if ((Input.GetMouseButtonDown(0)) || (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began &&
                                              !EventSystem.current.IsPointerOverGameObject(0)))
        {
            objectToDrag = GetDraggableTransformUnderMouse();

            if (objectToDrag != null)
            {
                dragging = true;

                objectToDrag.SetAsLastSibling();

                //originalPosition = objectToDrag.position;

                objectToDragImage = objectToDrag.GetComponent <Image>();

                objectToDragImage.raycastTarget = false;
                draggedObject.GetComponentInChildren <Text>().text = "1";//.GetChild(1).GetComponent<Text>().text = "1";
            }
        }

        if (dragging)
        {
            draggedObject.SetActive(true);

            if (bDebug == true)
            {
                draggedObject.transform.position = Input.mousePosition;
            }
            else
            {
                draggedObject.transform.position = Input.GetTouch(0).position;
            }

            draggedObject.GetComponent <Image>().sprite = objectToDragImage.sprite;
        }

        if ((Input.GetMouseButtonUp(0)) || (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended &&
                                            !EventSystem.current.IsPointerOverGameObject(0)))
        {
            if (objectToDrag != null)
            {
                dragging = false;
                draggedObject.SetActive(false);
                //objectToDrag.position = originalPosition;

                GameObject clickedObject = GetObjectUnderMouse();

                if (clickedObject.tag == "Creature")
                {
                    //Get  deployhandler object script
                    petScreen = GameObject.Find("PetScreen");
                    if (petScreen != null)
                    {
                        updateResourcesScript = petScreen.GetComponent <UpdateResources>();
                        updateResourcesScript.SetElementDroppedOnCreature();
                    }
                }
            }
        }
    }