Ejemplo n.º 1
0
 public static OneAction GetAndroidActID(string[] ActionsText, string[] oneActionText,int j)
 {
     OneAction oneAction = new OneAction();
     oneAction._actID = null;
     oneAction._pageID = null;
     string actid, pageid;
     oneActionText = ActionsText[j].Replace('[', ' ').Replace('{', ' ').Replace('\"', ' ').Replace(" ", "").Split(',');
     oneAction = GetAndroidActID(oneActionText);
     return oneAction;
 }
Ejemplo n.º 2
0
        public static Logs ReadFileByActions_iOS()
        {
            StreamReader sr = new StreamReader(iOSFilePath);
            string s = null;

            Logs logs = new Logs();
            logs._actions = new List<Actions>();
            Actions actions = new Actions();
            actions._oneAction = new List<OneAction>();
            OneAction oneAction = new OneAction();

            string actid, pageid;

            //List<string> logs = new List<string>();
            List<string> actionsList = new List<string>();
            List<string> oneActionList = new List<string>();
            List<string> pageIDList = new List<string>();
            List<string> actIDList = new List<string>();
            while ((s = sr.ReadLine()) != null)
            {

                string[] LogsText = s.Split(']');
                for (int i = 0; i < LogsText.Length - 1; i++)
                {
                    actions._oneAction = new List<OneAction>();
                    string[] ActionsText = LogsText[i].Split('}');
                    string[] oneActionText = ActionsText[i].Replace('[', ' ').Replace('{', ' ').Replace('\"', ' ').Replace(" ", "").Split(',');
                    if (ActionsText[i].Contains("i-ajk"))
                    {
                        for (int j = 0; j < ActionsText.Length - 1; j++)
                        {

                            oneAction = GetIOSActID(ActionsText, oneActionText, j);
                            actions._oneAction.Add(oneAction);
                        }
                        logs._actions.Add(actions);
                    }

                }
            }
            return logs;
        }
Ejemplo n.º 3
0
        public static Actions ReadFileByLines_iOS()
        {
            StreamReader sr = new StreamReader(iOSFilePath);
            sr.BaseStream.Seek(0, SeekOrigin.Begin);
            string s = sr.ReadToEnd();
            //string s = null;

            Actions actions = new Actions();
            actions._oneAction = new List<OneAction>();
            OneAction oneAction = new OneAction();
            List<string> undefineAction = new List<string>();

            string actid, pageid;

            string[] oneActionTextList = s.Split('}');
            for (int i = 0; i < oneActionTextList.Length - 1; i++)
            {
                if (oneActionTextList[i].Contains("i-ajk"))
                {
                    string[] oneActionText = oneActionTextList[i].Replace('[', ' ').Replace('{', ' ').Replace('\"', ' ').Replace(" ", "").Replace("]", "").Replace("\n", "").Split(',');

                    oneAction = GetIOSActID(oneActionText);
                    actions._oneAction.Add(oneAction);
                }

            }
            return actions;
        }
Ejemplo n.º 4
0
        public static OneAction GetIOSActID(string[] oneActionText)
        {
            OneAction oneAction = new OneAction();
            oneAction._actID = null;
            oneAction._pageID = null;
            string actid, pageid,ct;

            //if (oneActionText.Length == 23)
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        pageid = oneActionText[1];
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        pageid = oneActionText[1];
            //    }
            //    else
            //    {
            //        actid = oneActionText[10];
            //        pageid = oneActionText[1];
            //    }
            //    oneAction._actID = actid;
            //    oneAction._pageID = pageid;
            //    oneAction._isUndefined = false;
            //}
            //else if (oneActionText.Length == 24)
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        pageid = oneActionText[1];
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        pageid = oneActionText[1];
            //    }
            //    else
            //    {
            //        actid = oneActionText[10];
            //        pageid = oneActionText[1];
            //    }
            //    oneAction._actID = actid;
            //    oneAction._pageID = pageid;
            //    oneAction._isUndefined = false;
            //}
            //else if (oneActionText.Length == 25)
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        pageid = oneActionText[1];
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        pageid = oneActionText[1];
            //    }
            //    else
            //    {
            //        actid = oneActionText[10];
            //        pageid = oneActionText[1];
            //    }
            //    oneAction._actID = actid;
            //    oneAction._pageID = pageid;
            //    oneAction._isUndefined = false;
            //}
            //else if (oneActionText.Length == 26)
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        pageid = oneActionText[1];
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        pageid = oneActionText[1];
            //    }
            //    else
            //    {
            //        actid = oneActionText[10];
            //        pageid = oneActionText[1];
            //    }
            //    oneAction._actID = actid;
            //    oneAction._pageID = pageid;
            //    oneAction._isUndefined = false;
            //}
            //else if (oneActionText.Length == 27)
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        pageid = oneActionText[1];
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        pageid = oneActionText[1];
            //    }
            //    else
            //    {
            //        actid = oneActionText[10];
            //        pageid = oneActionText[1];
            //    }
            //    oneAction._actID = actid;
            //    oneAction._pageID = pageid;
            //    oneAction._isUndefined = false;
            //}
            //else if (oneActionText.Length == 28)
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        pageid = oneActionText[1];
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        pageid = oneActionText[1];
            //    }
            //    else
            //    {
            //        actid = oneActionText[10];
            //        pageid = oneActionText[1];
            //    }
            //    oneAction._actID = actid;
            //    oneAction._pageID = pageid;
            //    oneAction._isUndefined = false;
            //}
            //else
            //{
            //    if (oneActionText[8].Contains("act"))
            //    {
            //        actid = oneActionText[8];
            //        oneAction._actID = actid;
            //        oneAction._isUndefined = true;
            //    }
            //    else if (oneActionText[9].Contains("act"))
            //    {
            //        actid = oneActionText[9];
            //        oneAction._actID = actid;
            //        oneAction._isUndefined = true;
            //    }
            //    else if (oneActionText[10].Contains("act"))
            //    {
            //        actid = oneActionText[10];
            //        oneAction._actID = actid;
            //        oneAction._isUndefined = true;
            //    }
            //}

            actid = FindAct(oneActionText);
            pageid = FindPage(oneActionText);
            ct = FindCT(oneActionText);
            oneAction._actID = actid;
            oneAction._pageID = pageid;
            oneAction._ct = ct;
            if (actid != null)
            {
                oneAction._isUndefined = false;
            }

            return oneAction;
        }