Exemple #1
0
        public Bitmap ActionFast(int ActionID)
        {
            Image     image1    = Image.FromFile("icons/ActionBtn0.png");
            Bitmap    bitmap1   = new Bitmap(32, 32);
            Graphics  graphics1 = Graphics.FromImage((Image)bitmap1);
            Rectangle srcRect1  = new Rectangle(0, 0, 32, 32);

            graphics1.DrawImage(image1, 0, 0, srcRect1, GraphicsUnit.Pixel);
            graphics1.Dispose();
            if (ActionID == -1)
            {
                return(bitmap1);
            }
            ActionIcon ActionIcon = IconAction.List.Find((Predicate <ActionIcon>)(g => g.ActionID.Equals(ActionID)));

            if (ActionIcon == null)
            {
                return(bitmap1);
            }
            int       fileId    = ActionIcon.FileID;
            int       row       = ActionIcon.Row;
            int       col       = ActionIcon.Col;
            Image     image2    = Image.FromFile("icons/ActionBtn" + fileId.ToString() + ".png");
            Bitmap    bitmap2   = new Bitmap(32, 32);
            Graphics  graphics2 = Graphics.FromImage((Image)bitmap2);
            int       y         = row * 32;
            Rectangle srcRect2  = new Rectangle(col * 32, y, 32, 32);

            graphics2.DrawImage(image2, 0, 0, srcRect2, GraphicsUnit.Pixel);
            graphics2.Dispose();
            return(bitmap2);
        }
Exemple #2
0
        private void ActionHandler(NWActionConfig actionConfig, TableLayoutPanel parentPanel)
        {
            Queue <NWActionConfig> actionQueue;

            if (actionConfig.ChildActivities.Count > 0)
            {
                ActionHandler(actionConfig, new TableLayoutPanel(), parentPanel);
            }
            else
            {
                ActionIcon actionIcon = new ActionIcon(actionConfig);
                actionIcon.Anchor = AnchorStyles.None;

                if (parentPanel.InvokeRequired)
                {
                    parentPanel.Invoke((MethodInvoker) delegate
                    {
                        parentPanel.Controls.Add(actionIcon);
                    });
                }
                else
                {
                    parentPanel.Controls.Add(actionIcon);
                }
            }
        }
Exemple #3
0
 public override void OnEnable()
 {
     if (this._action != InputMappingIcons.Actions.None)
     {
         ActionIcon actionIcon = ActionIconSystem.GetActionIcon(base.transform.parent);
         actionIcon._follow._target2 = base.transform;
     }
 }
Exemple #4
0
    private void instantiateNewActionIcon()
    {
        GameObject instance = Instantiate(fab_actionIcon) as GameObject;

        instance.transform.SetParent(gameObject.transform);
        float colNumber = actionIcons.Count;
        float x         = firstActionCol + (colNumber * actionColWidth);

        instance.transform.localPosition = new Vector3(x, 0f, 0f);

        ActionIcon   actionIcon  = instance.GetComponent <ActionIcon> ();
        ActionOption emptyOption = ActionOptionBuilder.GetInstance().withEmptyAction().GetActionOption();

        actionIcon.Init(emptyOption, null);
        actionIcons.Add(actionIcon);
    }
Exemple #5
0
 public virtual void OnEnable()
 {
     if (this._action != InputMappingIcons.Actions.None)
     {
         ActionIcon actionIcon = ActionIconSystem.RegisterIcon(base.transform, this._action, this._sideIcon, ActionIconSystem.CurrentViewOptions.AllowInWorld, false, true);
         if (actionIcon)
         {
             this.FillSpriteAction = actionIcon._fillSpriteAction;
             if (this.FillSpriteAction && this.FillSpriteAction.gameObject.activeSelf != this.UseFillSprite)
             {
                 this.FillSpriteAction.gameObject.SetActive(this.UseFillSprite);
             }
             if (this.UseFillSprite)
             {
                 this.FillSpriteAction.SetAction(this._action);
             }
         }
     }
 }
Exemple #6
0
        public void LoadImageName()
        {
            // open folder, get all filenames
            //AppDomain.CurrentDomain.BaseDirectory

            string path = AppDomain.CurrentDomain.BaseDirectory + foldername;

            string[] filenames = Directory.GetFiles(path);


            // check filename to assign to variables
            foreach (var fullname in filenames)
            {
                string filename = Path.GetFileName(fullname);

                string[] tokens = StringProcess.SplitString(filename, new string[] { "_" });

                if (tokens[0].ToLower() == "Application".ToLower())
                {
                    ApplicationIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Option".ToLower())
                {
                    OptionIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Remove".ToLower())
                {
                    RemoveIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "RemoveAll".ToLower())
                {
                    RemoveAllIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Add".ToLower())
                {
                    AddIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Preview".ToLower())
                {
                    PreviewIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Start".ToLower())
                {
                    StartIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Refresh".ToLower())
                {
                    RefreshIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Help".ToLower())
                {
                    HelpIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Open".ToLower())
                {
                    OpenIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Save".ToLower())
                {
                    SaveIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Information".ToLower())
                {
                    InformationIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "File".ToLower())
                {
                    FileIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Folder".ToLower())
                {
                    FolderIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Action".ToLower())
                {
                    ActionIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "List".ToLower())
                {
                    ListIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
            }
        }
Exemple #7
0
        private void ActionHandler(NWActionConfig actionConfig, TableLayoutPanel panel, TableLayoutPanel parentPanel)
        {
            Queue <NWActionConfig> actionQueue;

            #region Panel Config
            panel.BorderStyle  = BorderStyle.FixedSingle;
            panel.AutoSize     = true;
            panel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            //panel.BackColor = Color.DarkOrange;
            panel.Anchor = AnchorStyles.Top;
            #endregion

            actionQueue = new Queue <NWActionConfig>();

            foreach (NWActionConfig childAction in actionConfig.ChildActivities)
            {
                actionQueue.Enqueue(childAction);
            }

            ActionIcon actionIcon = new ActionIcon(actionConfig);

            actionIcon.Anchor = AnchorStyles.None;

            if (actionConfig.Type == "Nintex.Workflow.Activities.Adapters.WFSequenceAdapter" || actionConfig.Type == "Nintex.Workflow.Activities.Adapters.WFIfElseBranchAdapter" || actionConfig.Type == "Nintex.Workflow.Activities.Adapters.NWSwitchBranchAdapter" || actionConfig.Type == "Nintex.Workflow.Activities.Adapters.NWApproverBranchAdapter")
            {
                //panel.Controls.Add(actionIcon);
                if (parentPanel.RowCount == 0)
                {
                    parentPanel.RowCount++;
                }
                parentPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
                parentPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                parentPanel.Controls.Add(panel, parentPanel.ColumnCount, parentPanel.RowCount);
                parentPanel.ColumnCount++;
            }
            else
            {
                //panel.BackColor = Color.Chartreuse;
                panel.BorderStyle = BorderStyle.FixedSingle;

                Panel headerPanel = new Panel();

                //headerPanel.BackColor = Color.Red;
                headerPanel.BorderStyle = BorderStyle.FixedSingle;

                actionIcon.Dock = DockStyle.Fill;

                headerPanel.Anchor = AnchorStyles.None;

                headerPanel.Controls.Add(actionIcon);
                headerPanel.Width  = actionIcon.Width;
                headerPanel.Height = actionIcon.Height;


                parentPanel.Controls.Add(headerPanel);
                parentPanel.Controls.Add(panel);
            }

            while (actionQueue.Count > 0)
            {
                NWActionConfig childActionConfig = actionQueue.Dequeue();
                CurrentActionType = childActionConfig.Type;
                ActionHandler(childActionConfig, panel);

                lock (_lock)
                {
                    --_newActionCount;
                    IncrementProgress();
                }
            }
        }
Exemple #8
0
        public void LoadImageName()
        {
            // open folder, get all filenames
            string path = AppDomain.CurrentDomain.BaseDirectory + foldername;

            string[] filenames = Directory.GetFiles(path);


            // check filename to assign to variables
            foreach (var fullname in filenames)
            {
                string filename = Path.GetFileName(fullname);

                string[] tokens = filename.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries);

                if (tokens[0].ToLower() == "Application".ToLower())
                {
                    ApplicationIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Option".ToLower())
                {
                    OptionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Remove".ToLower())
                {
                    RemoveIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "RemoveAll".ToLower())
                {
                    RemoveAllIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Add".ToLower())
                {
                    AddIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Preview".ToLower())
                {
                    PreviewIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Start".ToLower())
                {
                    StartIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Refresh".ToLower())
                {
                    RefreshIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Help".ToLower())
                {
                    HelpIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Open".ToLower())
                {
                    OpenIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Save".ToLower())
                {
                    SaveIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Information".ToLower())
                {
                    InformationIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "File".ToLower())
                {
                    FileIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Folder".ToLower())
                {
                    FolderIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Action".ToLower())
                {
                    ActionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "List".ToLower())
                {
                    ListIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "UpDirection".ToLower())
                {
                    UpDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "RightDirection".ToLower())
                {
                    RightDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "DownDirection".ToLower())
                {
                    DownDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "LeftDirection".ToLower())
                {
                    LeftDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else
                {
                    Images.Add
                    (
                        path + filename
                    );
                }
            }
        }