Beispiel #1
0
        public List<VersionInfo> VersionInfoFromCriteria(VersionInfoSearchCriteria crit,Status stat)
        {
            string statusStr="";
            string CstatusStr = "";
            int cn=0;
            Stopwatch stopw = new Stopwatch();
            List<VersionInfo> ReturnListI = new List<VersionInfo>();
            List<VersionInfo> ReturnList = new List<VersionInfo>();
            List<VersionInfo> util;
            Dictionary<string, VersionInfo> RetuDic = new Dictionary<string, VersionInfo>();

            stopw.Reset();
            stopw.Start();
            foreach (DayOfWeek dayofweek in crit.DaysOfWeek)
            {
                cn = 0;

                if (VersionInfoFromDayOfWeek.TryGetValue(dayofweek, out util))
                {
                    foreach (VersionInfo vers in util)
                    {

                            cn++;

                        RetuDic[vers.versionName] = vers;
                        if (stopw.ElapsedMilliseconds > 250)
                        {
                            CstatusStr = "Added "+cn+" versions created on " + dayofweek+ " so far";
                            stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                            stopw.Reset();
                            stopw.Start();
                        }
                    }
                }
                statusStr += '\n'+"Added " + cn + " versions created on " + dayofweek;
            }

            stopw.Reset();
            stopw.Start();
            foreach (ChangeType changetype in crit.ChangeTypes)
            {
                cn = 0;

                if (VersionInfoFromChangeType.TryGetValue(changetype, out util))
                {
                    foreach (VersionInfo vers in util)
                    {
                        cn++;

                        RetuDic[vers.versionName] = vers;
                        if (stopw.ElapsedMilliseconds > 250)
                        {
                            CstatusStr = "Added " + cn + " versions created because of a " + changetype + " so far";
                            stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                            stopw.Reset();
                            stopw.Start();
                        }
                    }
                }
                statusStr += '\n'+"Added " + cn + " versions created because of a " + changetype;
            }

            stopw.Reset();
            stopw.Start();
            foreach (string changefile in crit.ChangeFile)
            {
                cn = 0;
                if (VersionInfoFromChangeFile[changefile] != null)
                {
                    foreach (VersionInfo vers in VersionInfoFromChangeFile[changefile])
                    {
                        cn++;

                        RetuDic[vers.versionName] = vers;
                        if (stopw.ElapsedMilliseconds > 250)
                        {
                            CstatusStr = "Added " + cn + " versions because of " + changefile + " so far";
                            stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                            stopw.Reset();
                            stopw.Start();
                        }
                    }
                }
                statusStr += '\n'+"Added " + cn + " versions because of " + changefile;
            }

            VersionInfo outVerIn;
            stopw.Reset();
            stopw.Start();
            foreach (string versionName in crit.VersionName)
            {
                cn = 0;
                if (versionName.Contains("*") == false)
                {
                    if (VersionInfoFromVersionName.TryGetValue(versionName,out outVerIn))
                    {
                        cn++;

                        RetuDic[outVerIn.versionName] = outVerIn;
                        if (stopw.ElapsedMilliseconds > 250)
                        {
                            CstatusStr = "Added " + cn + " versions because of version name" + versionName + " so far";
                            stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                            stopw.Reset();
                            stopw.Start();
                        }
                    }
                }
                else
                {
                    foreach (KeyValuePair<string, VersionInfo> k in VersionInfoFromVersionName)
                    {
                        if (Matches(versionName, k.Key))
                        {
                            cn++;

                            RetuDic[k.Value.versionName] = k.Value;
                            if (stopw.ElapsedMilliseconds > 250)
                            {
                                CstatusStr = "Added " + cn + " versions because of version name" + versionName + " so far";
                                stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                                stopw.Reset();
                                stopw.Start();
                            }
                        }
                    }

                }
                statusStr += '\n'+ "Added " + cn + " versions because of version name" + versionName;
            }

            stopw.Reset();
            stopw.Start();
            foreach (string discrip in crit.Notes)
            {
                cn = 0;
                foreach (KeyValuePair<string, List<VersionInfo>> k in VersionInfoFromNotes)
                {
                    if (k.Key.Contains(discrip) == true)
                    {
                        foreach (VersionInfo ve in k.Value)
                        {
                            cn++;

                            RetuDic[ve.versionName] = ve;
                            if (stopw.ElapsedMilliseconds > 250)
                            {
                                CstatusStr = "Added " + cn + " versions because notes contain\"" + discrip + "\" so far";
                                stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                                stopw.Reset();
                                stopw.Start();
                            }
                        }
                    }
                }
                statusStr += '\n'+ "Added " + cn + " versions because notes contain\"" + discrip + "\"";
            }

            AddItems(RetuDic, crit.DaysOfMonth, VersionInfoFromDayOfMonth, FromTypes.DayOfMonth,stat,statusStr);
            AddItems(RetuDic, crit.Hours, VersionInfoFromHour, FromTypes.Hour, stat, statusStr);
            AddItems(RetuDic, crit.Minutes, VersionInfoFromMinute, FromTypes.Minute, stat, statusStr);
            AddItems(RetuDic, crit.Months, VersionInfoFromMonth, FromTypes.Month, stat, statusStr);
            AddItems(RetuDic, crit.Years, VersionInfoFromYear, FromTypes.Year, stat, statusStr);
            AddItems(RetuDic, crit.UserVersions, VersionInfoFromUserVersion, FromTypes.UserVersion, stat, statusStr);

            if (crit.IncludeAllUserVersions == true)
            {
                stopw.Reset();
                stopw.Start();
                cn = 0;
                foreach (KeyValuePair<string, List<VersionInfo>> k in VersionInfoFromUserVersion)
                {

                    //If list has a key that has a user version
                    if (k.Key.Equals(String.Empty) == false)
                    {
                        foreach (VersionInfo ve in k.Value)
                        {
                            cn++;

                            RetuDic[ve.versionName] = ve;
                            if (stopw.ElapsedMilliseconds > 250)
                            {
                                CstatusStr = "Added " + cn + " versions so far because they have user versions";
                                stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                                stopw.Reset();
                                stopw.Start();
                            }
                        }

                    }
                    statusStr += '\n'+"Added " + cn + " versions because they have user versions";
                }

            }

            if (crit.IncludeNoUserVersions == true)
            {
                List<VersionInfo> NoUserVersion;
                stopw.Reset();
                stopw.Start();
                cn = 0;
                if (VersionInfoFromUserVersion.TryGetValue(String.Empty, out NoUserVersion))
                {
                    foreach (VersionInfo ve in NoUserVersion)
                    {
                        cn++;

                        RetuDic[ve.versionName] = ve;
                        if (stopw.ElapsedMilliseconds > 250)
                        {
                            CstatusStr = "Added " + cn + " versions so far because they do not have user versions";
                            stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                            stopw.Reset();
                            stopw.Start();
                        }
                    }
                    statusStr += '\n' + "Added " + cn + " versions because they do not have user versions";
                }
            }

            if (crit.IncludeDiscription == true)
            {
                stopw.Reset();
                stopw.Start();
                cn = 0;
                foreach (KeyValuePair<string, List<VersionInfo>> k in VersionInfoFromNotes)
                {
                    //If list has a key that has a user version
                    if (k.Key.Equals(String.Empty) == false)
                    {
                        foreach (VersionInfo ve in k.Value)
                        {
                            cn++;

                            RetuDic[ve.versionName] = ve;
                            if (stopw.ElapsedMilliseconds > 250)
                            {
                                CstatusStr = "Added " + cn + " versions so far because they have a description";
                                stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                                stopw.Reset();
                                stopw.Start();
                            }
                        }

                    }
                    statusStr += '\n'+"Added " + cn + " versions because they have a description";
                 }
                }

            if (crit.IncludeNoDiscription == true)
            {
                List<VersionInfo> NoDiscription;
                cn = 0;
                stopw.Reset();
                stopw.Start();
                if (VersionInfoFromUserVersion.TryGetValue(String.Empty, out NoDiscription))
                {
                    foreach (VersionInfo ve in NoDiscription)
                    {
                        cn++;

                        RetuDic[ve.versionName] = ve;
                        if (stopw.ElapsedMilliseconds > 250)
                        {
                            CstatusStr = "Added " + cn + " versions so far because they do not have a description";
                            stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                            stopw.Reset();
                            stopw.Start();
                        }
                    }
                    statusStr += '\n' + "Added " + cn + " versions because they do not have a description";
                }
            }

            ReturnListI.AddRange(RetuDic.Values);
            //used to get out of for each loops
            bool breakAndContinue;
            stopw.Reset();
            stopw.Start();
            cn = 0;
            foreach (VersionInfo vers in ReturnListI)
            {
                if (stopw.ElapsedMilliseconds > 250)
                {
                    CstatusStr = "Removed " + cn + " versions so far because they were exlcuded";
                    stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false);
                    stopw.Reset();
                    stopw.Start();
                }

                if (crit.DaysOfWeekR != null && crit.DaysOfWeekR.Contains(vers.date.DayOfWeek) == true)
                {
                    cn++;
                    continue;
                }

                if (crit.DaysOfMonthR != null && crit.DaysOfMonthR.Contains(vers.date.Day) == true)
                {
                    cn++;
                    continue;
                }

                if (crit.HoursR != null && crit.HoursR.Contains(vers.date.Hour) == true)
                {
                    cn++;
                    continue;
                }

                if (crit.MonthsR != null && crit.MonthsR.Contains(vers.date.Month) == true)
                {
                    cn++;
                    continue;
                }

                if (crit.YearsR != null && crit.YearsR.Contains(vers.date.Year) == true)
                {
                    cn++;
                    continue;
                }

                if (crit.MinutesR != null && crit.MinutesR.Contains(vers.date.Minute) == true)
                {
                    cn++;
                    continue;
                }

                if (vers.Removed == true && crit.includeRemove == false)
                {
                    cn++;
                    continue;
                }

                breakAndContinue = false;
                if (crit.VersionNameR != null)
                {
                    foreach (string versionName in crit.VersionNameR)
                    {
                        if (versionName.Contains("*") == false)
                        {
                            if (crit.VersionNameR.Contains(vers.versionName) == true)
                            {
                                breakAndContinue = true;
                                break;
                            }
                        }
                        else
                        {

                            if (Matches(versionName, vers.versionName))
                            {
                                    breakAndContinue = true;
                                    break;
                            }
                        }
                    }
                    if (breakAndContinue == true)
                    {
                        cn++;
                        continue;
                    }
                }

                breakAndContinue = false;
                if (crit.UserVersionsR != null)
                {
                    foreach (string userVersions in crit.UserVersionsR)
                    {
                        if (ContainsVersion(vers.UserVersionsThatContain,userVersions))
                        {
                            breakAndContinue = true;
                            break;
                        }
                    }
                    if (breakAndContinue == true)
                    {
                        cn++;
                        continue;
                    }

                }

                breakAndContinue = false;
                if (crit.ChangeTypesR!= null)
                {
                    foreach (ChangeType changetype in crit.ChangeTypesR)
                    {
                        foreach (ChangeInstruction changeinstructions in vers.changesInVersion)
                        {
                            if (changeinstructions.change == changetype)
                            {
                                breakAndContinue = true;
                                break;
                            }
                        }
                        if (breakAndContinue == true)
                        {
                            break;
                        }
                    }
                    if (breakAndContinue == true)
                    {
                        cn++;
                        continue;
                    }

                }

                breakAndContinue = false;
                if (crit.ChangeFileR != null)
                {
                    foreach (string changefile in crit.ChangeFileR)
                    {
                        foreach (ChangeInstruction changeinstructions in vers.changesInVersion)
                        {
                            if (changeinstructions.externalLocation.Equals(changefile))
                            {
                                breakAndContinue = true;
                                break;
                            }
                        }
                        if (breakAndContinue == true)
                        {
                            break;
                        }
                    }
                    if (breakAndContinue == true)
                    {
                        cn++;
                        continue;
                    }

                }

                if (RejectExclude(vers.date, crit) != null)
                {
                    cn++;
                    continue;
                }

                ReturnList.Add(vers);

            }
            statusStr += '\n' + "Removed " + cn + " versions because they were exlcuded";
            stat.ReceiveStatus(statusStr, true);
            return ReturnList;
        }
Beispiel #2
0
        public void handleRolling(object RollinIn)
        {
            crit = new VersionInfoSearchCriteria();
            bool change = false;
            RollingInfo roi = (RollingInfo)RollinIn;
            DateTime date = DateTime.Now;
            CaledTypes.Clear();

            int ohour;
            int oday;
            int omonth;
            int oyear;

            if (roi.RolType == RollonTypes.today || roi.RolType == RollonTypes.Yesterday)
            {
                if (roi.RolType == RollonTypes.Yesterday)
                {
                    date = date.Subtract(TimeSpan.FromDays(1));
                }

                if (crit.DaysOfMonth.Contains(date.Day) == false ||
                    crit.DaysOfMonthR.Contains(date.Day) == true)
                {
                    if (CaledTypes.Contains(catTypes.DayOM) == false)
                    {
                        CaledTypes.Add(catTypes.DayOM);
                        Exclude(crit, catTypes.DayOM);
                    }

                    crit.RemoveDaysOfMonth(date.Day);
                    crit.AddDaysOfMonth(date.Day, false);
                    change = true;
                }

                if (crit.Months.Contains(date.Month) == false ||
                   crit.MonthsR.Contains(date.Month) == true)
                {
                    if (CaledTypes.Contains(catTypes.Month) == false)
                    {
                        CaledTypes.Add(catTypes.Month);
                        Exclude(crit, catTypes.Month);
                    }
                    crit.RemoveMonth(date.Month);
                    crit.AddMonth(date.Month, false);
                    change = true;
                }

                if (crit.Years.Contains(date.Year) == false ||
                    crit.YearsR.Contains(date.Year) == true)
                {
                    if (CaledTypes.Contains(catTypes.Year) == false)
                    {
                        CaledTypes.Add(catTypes.Year);
                        Exclude(crit, catTypes.Year);
                    }
                    crit.RemoveYears(date.Year);
                    crit.AddYears(date.Year, false);
                    change = true;
                }

                if (change == true)
                {

                }

            }
            else
            {

                TimeSpan span = new TimeSpan();
                int m = 0;
                int y = 0;

                int mnt;
                int yer;

                int lastamount = roi.lastAmount;
                catTypes rcatTyp = roi.lastType;
                switch (roi.lastType)
                {
                    case catTypes.Minute:
                        span = new TimeSpan(0, 1, 0);
                        break;

                    case catTypes.Hour:
                        span = new TimeSpan(1, 0, 0);
                        break;

                    case catTypes.Day:
                        span = new TimeSpan(1, 0, 0, 0);
                        break;

                    case catTypes.Week:
                        lastamount *= 7;
                        rcatTyp = catTypes.Day;
                        span = new TimeSpan(1, 0, 0, 0);
                        break;

                    case catTypes.Month:
                        m = 1;
                        break;

                    case catTypes.Year:
                        y = 1;
                        break;

                }

                date = DateTime.Now;
                mnt = date.Month;
                yer = date.Year;

                for (int i = 0; i <= lastamount; i++)
                {

                    if (rcatTyp == catTypes.Minute)
                    {
                        if (crit.Minutes.Contains(date.Minute) == false ||
                            crit.MinutesR.Contains(date.Minute) == true)
                        {
                            if (CaledTypes.Contains(catTypes.Minute) == false)
                            {
                                CaledTypes.Add(catTypes.Minute);
                                Exclude(crit, catTypes.Minute);
                            }
                            crit.RemoveMinutes(date.Minute);
                            crit.AddMinutes(date.Minute, false);
                            change = true;
                        }
                    }

                    if (rcatTyp == catTypes.Minute ||
                        rcatTyp == catTypes.Hour)
                    {
                        if (crit.Hours.Contains(date.Hour) == false ||
                            crit.HoursR.Contains(date.Hour) == true)
                        {
                            if (CaledTypes.Contains(catTypes.Hour) == false)
                            {
                                CaledTypes.Add(catTypes.Hour);
                                Exclude(crit, catTypes.Hour);
                            }
                            crit.RemoveHours(date.Hour);
                            crit.AddHours(date.Hour, false);
                            change = true;
                        }
                    }

                    if (rcatTyp == catTypes.Minute ||
                        rcatTyp == catTypes.Hour ||
                        rcatTyp == catTypes.Day)
                    {
                        if (CaledTypes.Contains(catTypes.DayOM) == false)
                        {
                            CaledTypes.Add(catTypes.DayOM);
                            Exclude(crit, catTypes.DayOM);
                        }

                        if (crit.DaysOfMonth.Contains(date.Day) == false ||
                            crit.DaysOfMonthR.Contains(date.Day) == true)
                        {
                            crit.RemoveDaysOfMonth(date.Day);
                            crit.AddDaysOfMonth(date.Day, false);
                            change = true;
                        }
                    }

                    if (rcatTyp != catTypes.Year)
                    {
                        yer = date.Year;
                    }

                    if (crit.Years.Contains(yer) == false ||
                        crit.YearsR.Contains(yer) == true)
                    {
                        if (CaledTypes.Contains(catTypes.Year) == false)
                        {
                            CaledTypes.Add(catTypes.Year);
                            Exclude(crit, catTypes.Year);
                        }
                        crit.RemoveYears(yer);
                        crit.AddYears(yer, false);
                        change = true;
                    }

                    if (rcatTyp == catTypes.Year)
                    {
                        yer--;
                    }

                    if (rcatTyp == catTypes.Minute ||
                        rcatTyp == catTypes.Hour ||
                        rcatTyp == catTypes.Day ||
                        rcatTyp == catTypes.Month)
                    {
                        if (rcatTyp != catTypes.Month)
                        {
                            mnt = date.Month;
                        }

                        if (crit.Months.Contains(mnt) == false ||
                           crit.MonthsR.Contains(mnt) == true)
                        {
                            if (CaledTypes.Contains(catTypes.Month) == false)
                            {
                                CaledTypes.Add(catTypes.Month);
                                Exclude(crit, catTypes.Month);
                            }
                            crit.RemoveMonth(mnt);
                            crit.AddMonth(mnt, false);
                            change = true;
                        }

                        if (rcatTyp == catTypes.Month)
                        {
                            mnt--;
                            if (mnt == 0)
                            {
                                mnt = 12;
                                yer--;
                            }
                        }
                    }

                    ohour = date.Hour;
                    oday = date.Day;
                    omonth = date.Month;
                    oyear = date.Year;
                    UnExcludeOver(date);
                    date = date.Subtract(span);

                    if (date.Day != oday && rcatTyp != catTypes.Day)
                    {
                        ExcludeOver(catTypes.Day, 0, date.Day, date.Month, date.Year, -1);
                    }

                    if (date.Hour != ohour )
                    {
                        ExcludeOver(catTypes.Hour, date.Hour, date.Day, date.Month, date.Year, date.Minute);
                    }

                    if (date.Month != omonth && rcatTyp != catTypes.Month)
                    {
                        ExcludeOver(catTypes.Month, 0, 0, date.Month, date.Year, -1);
                    }

                    if (date.Year != oyear && rcatTyp != catTypes.Year)
                    {
                        ExcludeOver(catTypes.Year, 0, 0, 0, date.Year, -1);
                    }

                }//for (int i = 0; i < lastamount; i++)

            }
            CritSet.SetCriteria(crit);
        }
Beispiel #3
0
        public static VersionInfoSearchCriteria.ExcludeTime RejectExclude(DateTime date, VersionInfoSearchCriteria crit)
        {
            bool year = false;
            bool hour = false;
            bool day = false;
            bool month = false;
            bool minute = false;

            foreach (VersionInfoSearchCriteria.ExcludeTime ex in crit.ExcludeTimes)
            {
                year = false;
                hour = false;
                day = false;
                month = false;
                minute = false;

                if (ex.year != -1)
                {
                    if (date.Year == ex.year)
                    {
                        year = true;
                    }
                }
                else
                {
                    year = true;
                }

                if (ex.day != -1)
                {
                    if (date.Day == ex.day)
                    {
                        day = true;
                    }
                }
                else
                {
                    day = true;
                }

                if (ex.hour != -1)
                {
                    if (date.Hour == ex.hour)
                    {
                        hour = true;
                    }
                }
                else
                {
                    hour = true;
                }

                if (ex.month != -1)
                {
                    if (date.Month == ex.month)
                    {
                        month = true;
                    }
                }
                else
                {
                    month = true;
                }

                if (ex.minute != -1)
                {
                    if (date.Minute == ex.minute)
                    {
                        minute = true;
                    }
                }
                else
                {
                    minute = true;
                }

                if (year && month && day && hour && minute)
                {
                    return ex;
                }
            }
            return null;
        }
Beispiel #4
0
        public VersionInfoSearchCriteria ProcessString(string text)
        {
            if (timer != null)
            {
                timer.Change(Timeout.Infinite, Timeout.Infinite);
                timer = null;
            }
            crit = new VersionInfoSearchCriteria();

            bool changed = false;

              string fixe = addIndicaToText(text);

            string[] tokens = fixe.Split(' ');
            int number;
            DayOfWeek dayOfweek;
            int []hour;
            int minute;
            bool last;
            string te;
            string tok;
            RollingInfo rollIn;
            for(int i = 0 ; i < tokens.Length; i++)
            {
                tok = tokens[i];

                if (isDayOfMonth(tok, out number))
                {
                //    if (CaledTypes.Contains(catTypes.DayOM) == false)
               //     {
               //         CaledTypes.Add(catTypes.DayOM);
                        Exclude(crit, catTypes.DayOM);
               //     }
                    crit.RemoveDaysOfMonth(number);
                    crit.AddDaysOfMonth(number,false);
                    changed = true;
                    continue;
                }

                if (isDayOfWeek(tok, out dayOfweek))
                {
                //    if (CaledTypes.Contains(catTypes.DayOW) == false)
                //    {
                //        CaledTypes.Add(catTypes.DayOW);
                        Exclude(crit, catTypes.DayOW);
                //    }
                    crit.RemoveDayOfWeek(dayOfweek);
                    crit.AddDayOfWeek(dayOfweek,false);
                    changed = true;
                    continue;
                }

                if (isMonth(tok, out number))
                {
              //          if (CaledTypes.Contains(catTypes.Month) == false)
            //        {
               //             CaledTypes.Add(catTypes.Month);
                        Exclude(crit, catTypes.Month);
               //         }
                    crit.RemoveMonth(number);
                    crit.AddMonth(number,false);
                    changed = true;
                    continue;
                }

                if (isTime(tok, out hour, out minute))
                {
                    if (tokens.Length > i + 1 && isTimeAMPM(tokens[i + 1]))
                    {
                        if (tokens[i + 1].Equals("am"))
                        {
                            foreach (int h in hour)
                            {
                                if (h < 12)
                                {
                               //     if (CaledTypes.Contains(catTypes.Hour) == false)
                                //    {
                                //        CaledTypes.Add(catTypes.Hour);
                                        Exclude(crit, catTypes.Hour);
                               //     }
                                    crit.RemoveHours(h);
                                    crit.AddHours(h, false);
                                    changed = true;
                                }
                            }
                        }
                        else
                        {
                            foreach (int h in hour)
                            {
                                if (h >= 12)
                                {
                              //      if (CaledTypes.Contains(catTypes.Hour) == false)
                              //      {
                               //         CaledTypes.Add(catTypes.Hour);
                                        Exclude(crit, catTypes.Hour);
                             //       }
                                    crit.RemoveHours(h);
                                    crit.AddHours(h, false);
                                    changed = true;
                                }
                            }
                        }

                    }
                    else
                    {
                        foreach (int h in hour)
                        {
                            if (h > -1 && h < 24)
                            {
                        //        if (CaledTypes.Contains(catTypes.Hour) == false)
                        //        {
                        //            CaledTypes.Add(catTypes.Hour);
                                    Exclude(crit, catTypes.Hour);
                         //       }
                                crit.RemoveHours(h);
                                crit.AddHours(h, false);
                                changed = true;
                            }
                        }
                    }

                    if (minute > 0)
                    {
                   //     if (CaledTypes.Contains(catTypes.Minute) == false)
                  //      {
                    //        CaledTypes.Add(catTypes.Minute);
                            Exclude(crit, catTypes.Minute);
                //        }
                        crit.RemoveMinutes(minute);
                        crit.AddMinutes(minute, false);
                        changed = true;
                    }
                    continue;
                }

                if (isRolling(tok, out rollIn))
                {

                        int dueTime = 60 - DateTime.Now.Second;
                        if (dueTime == 60)
                        {
                            dueTime = 0;
                        }
                        else
                        {
                            handleRolling(rollIn);
                        }
                        timer = new Timer(handleRolling, rollIn, dueTime * 1000, 60000);

                }
            }
            if (changed)
            {
                return crit;
            }
            else
            {
                return null;
            }
        }
Beispiel #5
0
        private void Exclude(VersionInfoSearchCriteria crit,catTypes cator)
        {
            switch(cator)
            {
                case catTypes.DayOW:
                    foreach (DayOfWeek day in Enum.GetValues(typeof(DayOfWeek)))
                    {
                        if (crit.DaysOfWeek.Contains(day) == false)
                        {
                            crit.AddDayOfWeek(day, true);
                        }
                    }
                break;

                case catTypes.Month:
                    for (int i = 1; i <= 12; i++)
                    {
                        if (crit.Months.Contains(i) == false)
                        {
                            crit.AddMonth(i, true);
                        }
                    }
                break;

                case catTypes.DayOM:
                    for (int i = 1; i <= 31; i++)
                    {
                        if (crit.DaysOfMonth.Contains(i) == false)
                        {
                            crit.AddDaysOfMonth(i, true);
                        }
                    }
                break;

                case catTypes.Hour:
                    for (int i = 0; i < 24; i++)
                    {
                        if (crit.Hours.Contains(i) == false)
                        {
                            crit.AddHours(i, true);
                        }
                    }
                break;

                case catTypes.Minute:
                    for (int i = 0; i < 60; i++)
                    {
                        if (crit.Minutes.Contains(i) == false)
                        {
                            crit.AddMinutes(i, true);
                        }
                    }
                break;

                case catTypes.Year:
                    foreach (int y in YearsList)
                    {
                        if (crit.Years.Contains(y) == false)
                        {
                            crit.AddYears(y, true);
                        }
                    }
                    break;

            }
        }
Beispiel #6
0
 public List<VersionInfo> VersionInfoFromCriteria(VersionInfoSearchCriteria criteria, DataManager.Status stat)
 {
     return dataManager.VersionInfoFromCriteria(criteria,stat);
 }
Beispiel #7
0
 private void ChangeFileButton_Click(object sender, EventArgs e)
 {
     VersionInfoSearchCriteria vers = new VersionInfoSearchCriteria();
     SearchFileList list = new SearchFileList(m_DataManager);
     list.ShowDialog();
     vers.ChangeFile = list.Selected;
     List<VersionInfo> lis = m_DataManager.VersionInfoFromCriteria(vers);
     foreach (VersionInfo v in lis)
     {
         shearch.addVersion(v);
     }
 }
Beispiel #8
0
 private void ChangeCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     VersionInfoSearchCriteria vers = new VersionInfoSearchCriteria();
     vers.ChangeTypes.Add(ChangeType.Change);
     List<VersionInfo> lis = m_DataManager.VersionInfoFromCriteria(vers);
     foreach (VersionInfo v in lis)
     {
         shearch.addVersion(v);
     }
 }
Beispiel #9
0
 private void UserVersionsComboBox_SelectedValueChanged(object sender, EventArgs e)
 {
     VersionInfoSearchCriteria vers = new VersionInfoSearchCriteria();
     vers.AddUserVersion((string) this.UserVersionsComboBox.SelectedItem,false);
     List<VersionInfo> lis = m_DataManager.VersionInfoFromCriteria(vers);
     foreach (VersionInfo v in lis)
     {
         shearch.addVersion(v);
     }
 }
Beispiel #10
0
 private void ShowDatePickerButton_Click(object sender, EventArgs e)
 {
     VersionInfoSearchCriteria vers = new VersionInfoSearchCriteria();
     vers.AddMonth(7,false);
     List<VersionInfo> lis = m_DataManager.VersionInfoFromCriteria(vers);
     foreach (VersionInfo v in lis)
     {
         shearch.addVersion(v);
     }
 }