コード例 #1
0
        ObservableList <ControlProperty> IWindowExplorerTreeItem.GetElementProperties()
        {
            //TODO: temp solution fix me hard coded [0[]
            ASCFDriver d = (ASCFDriver)App.AutomateTabGingerRunner.ApplicationAgents[0].Agent.Driver;

            string RC = d.Send("GetControlInfo", "ByName" + "", ASCFControlInfo.Path, " ", " ", false);

            if (RC.StartsWith("OK"))
            {
                string   vals   = RC.Substring(3);
                string[] valArr = vals.Split('~');
                ObservableList <ControlProperty> list = new ObservableList <ControlProperty>();
                foreach (string pv in valArr)
                {
                    if (pv.Length > 0)
                    {
                        string[] prop = pv.Split('=');
                        list.Add(new ControlProperty()
                        {
                            Name = prop[0], Value = prop[1]
                        });
                    }
                }
                return(list);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        List <ITreeViewItem> ITreeViewItem.Childrens()
        {
            //TODO: fix hard coded [0] ref
            ASCFDriver = (ASCFDriver)((Agent)App.AutomateTabGingerRunner.ApplicationAgents[0].Agent).Driver;

            List <ITreeViewItem> Childrens = new List <ITreeViewItem>();

            string rc = ASCFDriver.Send("GetFormControls", " ", Path, " ", " ", false);
            string controls;

            if (rc.StartsWith("OK"))
            {
                controls = rc.Substring(3);
            }
            else
            {
                //TODO: messagebox err
                return(null);
            }
            string[] a = controls.Split('~');
            foreach (string control in a)
            {
                if (control.Length > 0)
                {
                    string[] ControlInfo = control.Split('@');

                    if (ControlInfo[1] == "class com.amdocs.uif.widgets.TextFieldNative")
                    {
                        ASCFTextBoxTreeItem ACTI = new ASCFTextBoxTreeItem();
                        ACTI.Name            = ControlInfo[0];
                        ACTI.Path            = ControlInfo[2];
                        ACTI.ASCFControlInfo = new ASCFControlInfo()
                        {
                            Name = ACTI.Name, Path = ACTI.Path, ControlType = ASCFControlInfo.eControlType.TextBox
                        };
                        Childrens.Add(ACTI);
                    }
                    else if (ControlInfo[1] == "class com.amdocs.uif.widgets.UifForm")
                    {
                        ASCFFormTreeItem ACFI = new ASCFFormTreeItem();
                        ACFI.Name       = ControlInfo[0];
                        ACFI.Path       = ControlInfo[2];
                        ACFI.ASCFDriver = ASCFDriver;
                        Childrens.Add(ACFI);
                    }
                    else if (ControlInfo[1] == "SubForm")
                    {
                        ASCFFormTreeItem ACFF = new ASCFFormTreeItem();
                        ACFF.Name       = ControlInfo[0];
                        ACFF.Path       = ControlInfo[2];
                        ACFF.ASCFDriver = ASCFDriver;
                        Childrens.Add(ACFF);
                    }
                    else if (ControlInfo[1] == "class com.amdocs.uif.widgets.BrowserNative")
                    {
                        ASCFBrowserTreeItem ABTT = new ASCFBrowserTreeItem();
                        ABTT.Name            = ControlInfo[0];
                        ABTT.Path            = ControlInfo[2];
                        ABTT.ASCFControlInfo = new ASCFControlInfo()
                        {
                            Name = ABTT.Name, Path = ABTT.Path, ControlType = ASCFControlInfo.eControlType.Browser
                        };
                        Childrens.Add(ABTT);
                    }
                    else if (ControlInfo[1] == "class com.amdocs.uif.widgets.LabelNative")
                    {
                        ASCFLabelTreeItem ACTI = new ASCFLabelTreeItem();
                        ACTI.Name            = ControlInfo[0];
                        ACTI.Path            = ControlInfo[2];
                        ACTI.ASCFControlInfo = new ASCFControlInfo()
                        {
                            Name = ACTI.Name, Path = ACTI.Path, ControlType = ASCFControlInfo.eControlType.Label
                        };
                        Childrens.Add(ACTI);
                    }
                    else if (ControlInfo[1] == "class com.amdocs.uif.widgets.SearchGridNative")
                    {
                        ASCFGridTreeItem ACTI = new ASCFGridTreeItem();
                        ACTI.Name            = ControlInfo[0];
                        ACTI.Path            = ControlInfo[2];
                        ACTI.ASCFControlInfo = new ASCFControlInfo()
                        {
                            Name = ACTI.Name, Path = ACTI.Path, ControlType = ASCFControlInfo.eControlType.Grid
                        };
                        Childrens.Add(ACTI);
                    }
                    // TODO: add other types...

                    else
                    {
                        ASCFControlTreeItem ACTI = new ASCFControlTreeItem();
                        ACTI.Name            = ControlInfo[0];
                        ACTI.Path            = ControlInfo[2];
                        ACTI.ASCFControlInfo = new ASCFControlInfo()
                        {
                            Name = ACTI.Name, Path = ACTI.Path
                        };
                        Childrens.Add(ACTI);
                    }
                }
            }
            return(Childrens);
        }