Exemplo n.º 1
0
    void OnValidate()
    {
        //  if (EditorSceneManager.loadedSceneCount < 2 && EditorSceneManager.loadedSceneCount > 0 )
        //enabler = true;

        /*
         * if (EditorSceneManager.loadedSceneCount > 0 && popUpRequest)
         * {
         *  if (EditorSceneManager.loadedSceneCount < 2)
         *  {
         *      ControlOption();
         *  }
         * }
         */

        if (sk == con.waiting)
        {
            //wait for this scene to finish loading.
            sk = con.notLoaded;
        }

        if (sk == con.notLoaded)
        {
        }

        if (sk == con.loading)
        {
            //wait for right time
        }

        if (sk == con.loaded)
        {
            //all set!
        }



        if (LoadPlayerControls && EditorSceneManager.loadedSceneCount < 2)
        //if (EditorSceneManager.loadedSceneCount < 2 && EditorSceneManager.loadedSceneCount > 0)
        {
            // EditorSceneManager.OpenScene(controls, OpenSceneMode.Additive);
            LoadControls();
            //ControlOption();
            LoadPlayerControls = false;
        }
    }
Exemplo n.º 2
0
        public static List <con> CaseNumberReader()
        {
            List <con> writeCon = new List <con>();
            //List<string> id = new List<string>();
            // List<DateTime> time = new List<DateTime>();
            var mails = OutlookEmails.ReadMailItems();

            foreach (var mail in mails)
            {
                String pattern1   = @"[1]\d{14}";
                String CaseReader = mail.EmailSubject;
                Match  match1     = Regex.Match(CaseReader, pattern1, RegexOptions.IgnoreCase);
                if (match1.Success)
                {
                    con data = new con()
                    {
                        caseId = match1.Value, time = mail.EmailDate, alias = mail.EmailTo
                    };

                    String pattern2 = @"Task";
                    Match  match2   = Regex.Match(CaseReader, pattern2, RegexOptions.IgnoreCase);
                    if (match2.Success)
                    {
                        data.isTask = "Collaboration Task";
                    }
                    else
                    {
                        data.isTask = "Case";
                    }
                    StringBuilder ser = new StringBuilder();
                    ser.Append(CaseReader);
                    ser.Append(mail.EmailBody);
                    string pattern3 = @"\s[A|B|C]\s";
                    Match  match3   = Regex.Match(ser.ToString(), pattern3, RegexOptions.IgnoreCase);
                    if (match3.Success)
                    {
                        data.severity = match3.Value;
                    }
                    else
                    {
                        data.severity = "";
                    }



                    writeCon.Add(data);
                    //id.Add(match1.Value);
                    //time.Add(mail.EmailDate);
                }
            }
            //Sort the numbers from the oldest to the lastest.
            // id.Sort();
            //remove the dulplicate numbers
            // List<string> id1=id.Distinct().ToList();
            // time.ToString();
            // Console.WriteLine(string.Join("\n", time));
            //  return id1;
            List <con> nonDuplicateList = new List <con>();

            foreach (con mem in writeCon)
            {
                if (nonDuplicateList.Exists(x => x.caseId == mem.caseId) == false)
                {
                    nonDuplicateList.Add(mem);
                }
            }
            var sortedData =
                (from s in nonDuplicateList
                 select new
            {
                s.caseId,
                s.time,
                s.alias,
                s.severity
            }).Distinct().OrderBy(x => x.caseId).ToList();

            foreach (var i in sortedData)
            {
                Console.WriteLine("caseId:   " + i.caseId + "          " + "SentTime:   " + i.time + "          " + "Alias:   " + i.alias);
            }
            return(nonDuplicateList);
        }
 action(con, pair.Item1, pair.Item2);