public async Task<int> InsertWorkingHours(Weekday day, TimeSpan startTime, TimeSpan endTime, int? workingHoursId)
        {
            var result = await _database.QueryAsync<int>("dbo.InsertWorkingHours", new
            {
                id = workingHoursId,
                weekdayId = (int)day,
                startTimeTicks = startTime.Ticks,
                endTimeTicks = endTime.Ticks
            });

            return result.Single();
        }
        public async Task<int> InsertWorkingHours(Weekday day, DateTime startTime, DateTime endTime, int? workingHoursId)
        {
            var result = await _database.QueryAsync<int>("dbo.InsertWorkingHours", new
            {
                id = workingHoursId,
                weekdayId = (int)day,
                startTime,
                endTime
            });

            return result.Single();
        }
Esempio n. 3
0
 // 功能: 得到某日的下一日(星期几)
 // 参数:
 //        wd : 枚举类型Weekday
 // 返回值: 枚举类型Weekday
 public static Weekday NextDay(Weekday wd)
 {
     Weekday wdnext;
     /*if (wd == Weekday.Sat)
     {
         wdnext = Weekday.Sun;
     }
     else
     {
         wdnext = wd + 1;
     }*/
     if (wd == Weekday.Sat)
         return wdnext = Weekday.Sun;
     else
         return wdnext = ++wd;
 }
Esempio n. 4
0
 public PeriodWithChargeDay(String interval)
 {
     try
     {
         String[] weekdayParts = interval.Split(',');
         if (weekdayParts.Count() > 1)
         {
             this.Weekday = Weekday.Create(weekdayParts[1]);
         }
         String[] intervalParts = weekdayParts[0].Split();
         this.Interval = int.Parse(intervalParts[0]);
         this.Unit = TypeUnit.Create(intervalParts[1]);
     }
     catch (IndexOutOfRangeException e)
     {
         throw new ArgumentException("Invalid period:" + interval);
     }
 }
Esempio n. 5
0
        private void SetWeekdays(Weekday value)
        {
            foreach (Control ctl in pnlCheckboxes.Controls)
            {
                OPMCheckBox chk = ctl as OPMCheckBox;
                if (chk != null)
                {
                    string tag = chk.Tag as string;
                    if (!string.IsNullOrEmpty(tag))
                    {
                        Weekday wdCtl = (Weekday)Enum.Parse(typeof(Weekday), tag);
                        chk.Checked = ((value & wdCtl) == wdCtl);
                    }
                }
            }

            chkAll.Checked = (value == Weekday.Everyday);
        }
Esempio n. 6
0
 public int GetPosition(Weekday weekday, Item item) => GetItems(weekday).IndexOf(item) + 1;
Esempio n. 7
0
 public Date(Weekday day, Month month, Year year)
 {
     this._month = month;
     this._day   = day;
     this._year  = year;
 }
Esempio n. 8
0
 public MySqlFunctionManager(bool allowFuncDefChange)
 {
     this.allowFuncDefChange                = allowFuncDefChange;
     parsingStrateg["CAST"]                 = FunctionParsingStrategy.Cast;
     parsingStrateg["POSITION"]             = FunctionParsingStrategy.Position;
     parsingStrateg["SUBSTR"]               = FunctionParsingStrategy.Substring;
     parsingStrateg["SUBSTRING"]            = FunctionParsingStrategy.Substring;
     parsingStrateg["TRIM"]                 = FunctionParsingStrategy.Trim;
     parsingStrateg["AVG"]                  = FunctionParsingStrategy.Avg;
     parsingStrateg["COUNT"]                = FunctionParsingStrategy.Count;
     parsingStrateg["GROUP_CONCAT"]         = FunctionParsingStrategy.GroupConcat;
     parsingStrateg["MAX"]                  = FunctionParsingStrategy.Max;
     parsingStrateg["MIN"]                  = FunctionParsingStrategy.Min;
     parsingStrateg["SUM"]                  = FunctionParsingStrategy.Sum;
     parsingStrateg["ROW"]                  = FunctionParsingStrategy.Row;
     parsingStrateg["CHAR"]                 = FunctionParsingStrategy.Char;
     parsingStrateg["CONVERT"]              = FunctionParsingStrategy.Convert;
     parsingStrateg["EXTRACT"]              = FunctionParsingStrategy.Extract;
     parsingStrateg["TIMESTAMPADD"]         = FunctionParsingStrategy.Timestampadd;
     parsingStrateg["TIMESTAMPDIFF"]        = FunctionParsingStrategy.Timestampdiff;
     parsingStrateg["GET_FORMAT"]           = FunctionParsingStrategy.GetFormat;
     functionPrototype["ABS"]               = new Abs(null);
     functionPrototype["ACOS"]              = new Acos(null);
     functionPrototype["ADDDATE"]           = new Adddate(null);
     functionPrototype["ADDTIME"]           = new Addtime(null);
     functionPrototype["AES_DECRYPT"]       = new AesDecrypt(null);
     functionPrototype["AES_ENCRYPT"]       = new AesEncrypt(null);
     functionPrototype["ANALYSE"]           = new Analyse(null);
     functionPrototype["ASCII"]             = new Ascii(null);
     functionPrototype["ASIN"]              = new Asin(null);
     functionPrototype["ATAN2"]             = new Atan2(null);
     functionPrototype["ATAN"]              = new Atan(null);
     functionPrototype["BENCHMARK"]         = new Benchmark(null);
     functionPrototype["BIN"]               = new Bin(null);
     functionPrototype["BIT_AND"]           = new BitAnd(null);
     functionPrototype["BIT_COUNT"]         = new BitCount(null);
     functionPrototype["BIT_LENGTH"]        = new BitLength(null);
     functionPrototype["BIT_OR"]            = new BitOR(null);
     functionPrototype["BIT_XOR"]           = new BitXor(null);
     functionPrototype["CEIL"]              = new Ceiling(null);
     functionPrototype["CEILING"]           = new Ceiling(null);
     functionPrototype["CHAR_LENGTH"]       = new CharLength(null);
     functionPrototype["CHARACTER_LENGTH"]  = new CharLength(null);
     functionPrototype["CHARSET"]           = new Charset(null);
     functionPrototype["COALESCE"]          = new Coalesce(null);
     functionPrototype["COERCIBILITY"]      = new Coercibility(null);
     functionPrototype["COLLATION"]         = new Collation(null);
     functionPrototype["COMPRESS"]          = new Compress(null);
     functionPrototype["CONCAT_WS"]         = new ConcatWs(null);
     functionPrototype["CONCAT"]            = new Concat(null);
     functionPrototype["CONNECTION_ID"]     = new ConnectionId(null);
     functionPrototype["CONV"]              = new Conv(null);
     functionPrototype["CONVERT_TZ"]        = new ConvertTz(null);
     functionPrototype["COS"]               = new Cos(null);
     functionPrototype["COT"]               = new Cot(null);
     functionPrototype["CRC32"]             = new Crc32(null);
     functionPrototype["CURDATE"]           = new Curdate();
     functionPrototype["CURRENT_DATE"]      = new Curdate();
     functionPrototype["CURRENT_TIME"]      = new Curtime();
     functionPrototype["CURTIME"]           = new Curtime();
     functionPrototype["CURRENT_TIMESTAMP"] = new Now();
     functionPrototype["CURRENT_USER"]      = new CurrentUser();
     functionPrototype["CURTIME"]           = new Curtime();
     functionPrototype["DATABASE"]          = new Database(null);
     functionPrototype["DATE_ADD"]          = new DateAdd(null);
     functionPrototype["DATE_FORMAT"]       = new DateFormat(null);
     functionPrototype["DATE_SUB"]          = new DateSub(null);
     functionPrototype["DATE"]              = new Date(null);
     functionPrototype["DATEDIFF"]          = new Datediff(null);
     functionPrototype["DAY"]               = new Dayofmonth(null);
     functionPrototype["DAYOFMONTH"]        = new Dayofmonth(null);
     functionPrototype["DAYNAME"]           = new Dayname(null);
     functionPrototype["DAYOFWEEK"]         = new Dayofweek(null);
     functionPrototype["DAYOFYEAR"]         = new Dayofyear(null);
     functionPrototype["DECODE"]            = new Decode(null);
     functionPrototype["DEFAULT"]           = new Default(null);
     functionPrototype["DEGREES"]           = new Degrees(null);
     functionPrototype["DES_DECRYPT"]       = new DesDecrypt(null);
     functionPrototype["DES_ENCRYPT"]       = new DesEncrypt(null);
     functionPrototype["ELT"]               = new Elt(null);
     functionPrototype["ENCODE"]            = new Encode(null);
     functionPrototype["ENCRYPT"]           = new Encrypt(null);
     functionPrototype["EXP"]               = new Exp(null);
     functionPrototype["EXPORT_SET"]        = new ExportSet(null);
     // functionPrototype.put("EXTRACT", new Extract(null));
     functionPrototype["EXTRACTVALUE"]  = new ExtractValue(null);
     functionPrototype["FIELD"]         = new Field(null);
     functionPrototype["FIND_IN_SET"]   = new FindInSet(null);
     functionPrototype["FLOOR"]         = new Floor(null);
     functionPrototype["FORMAT"]        = new Format(null);
     functionPrototype["FOUND_ROWS"]    = new FoundRows(null);
     functionPrototype["FROM_DAYS"]     = new FromDays(null);
     functionPrototype["FROM_UNIXTIME"] = new FromUnixtime(null);
     // functionPrototype.put("GET_FORMAT", new GetFormat(null));
     functionPrototype["GET_LOCK"]       = new GetLock(null);
     functionPrototype["GREATEST"]       = new Greatest(null);
     functionPrototype["HEX"]            = new Hex(null);
     functionPrototype["HOUR"]           = new Hour(null);
     functionPrototype["IF"]             = new IF(null);
     functionPrototype["IFNULL"]         = new IFNull(null);
     functionPrototype["INET_ATON"]      = new InetAton(null);
     functionPrototype["INET_NTOA"]      = new InetNtoa(null);
     functionPrototype["INSERT"]         = new Insert(null);
     functionPrototype["INSTR"]          = new Instr(null);
     functionPrototype["INTERVAL"]       = new Interval(null);
     functionPrototype["IS_FREE_LOCK"]   = new IsFreeLock(null);
     functionPrototype["IS_USED_LOCK"]   = new IsUsedLock(null);
     functionPrototype["ISNULL"]         = new IsNull(null);
     functionPrototype["LAST_DAY"]       = new LastDay(null);
     functionPrototype["LAST_INSERT_ID"] = new LastInsertId(null);
     functionPrototype["LCASE"]          = new Lower(null);
     functionPrototype["LEAST"]          = new Least(null);
     functionPrototype["LEFT"]           = new Left(null);
     functionPrototype["LENGTH"]         = new Length(null);
     functionPrototype["LN"]             = new Log(null);
     // Ln(X) equals Log(X)
     functionPrototype["LOAD_FILE"]       = new LoadFile(null);
     functionPrototype["LOCALTIME"]       = new Now();
     functionPrototype["LOCALTIMESTAMP"]  = new Now();
     functionPrototype["LOCATE"]          = new Locate(null);
     functionPrototype["LOG10"]           = new Log10(null);
     functionPrototype["LOG2"]            = new Log2(null);
     functionPrototype["LOG"]             = new Log(null);
     functionPrototype["LOWER"]           = new Lower(null);
     functionPrototype["LPAD"]            = new Lpad(null);
     functionPrototype["LTRIM"]           = new Ltrim(null);
     functionPrototype["MAKE_SET"]        = new MakeSet(null);
     functionPrototype["MAKEDATE"]        = new Makedate(null);
     functionPrototype["MAKETIME"]        = new Maketime(null);
     functionPrototype["MASTER_POS_WAIT"] = new MasterPosWait(null);
     functionPrototype["MD5"]             = new Md5(null);
     functionPrototype["MICROSECOND"]     = new Microsecond(null);
     functionPrototype["MID"]             = new Substring(null);
     functionPrototype["MINUTE"]          = new Minute(null);
     functionPrototype["MONTH"]           = new Month(null);
     functionPrototype["MONTHNAME"]       = new Monthname(null);
     functionPrototype["NAME_CONST"]      = new NameConst(null);
     functionPrototype["NOW"]             = new Now();
     functionPrototype["NULLIF"]          = new NullIF(null);
     functionPrototype["OCT"]             = new Oct(null);
     functionPrototype["OCTET_LENGTH"]    = new Length(null);
     functionPrototype["OLD_PASSWORD"]    = new OldPassword(null);
     functionPrototype["ORD"]             = new Ord(null);
     functionPrototype["PASSWORD"]        = new Password(null);
     functionPrototype["PERIOD_ADD"]      = new PeriodAdd(null);
     functionPrototype["PERIOD_DIFF"]     = new PeriodDiff(null);
     functionPrototype["PI"]              = new PI(null);
     functionPrototype["POW"]             = new Pow(null);
     functionPrototype["POWER"]           = new Pow(null);
     functionPrototype["QUARTER"]         = new Quarter(null);
     functionPrototype["QUOTE"]           = new Quote(null);
     functionPrototype["RADIANS"]         = new Radians(null);
     functionPrototype["RAND"]            = new Rand(null);
     functionPrototype["RELEASE_LOCK"]    = new ReleaseLock(null);
     functionPrototype["REPEAT"]          = new Repeat(null);
     functionPrototype["REPLACE"]         = new Replace(null);
     functionPrototype["REVERSE"]         = new Reverse(null);
     functionPrototype["RIGHT"]           = new Right(null);
     functionPrototype["ROUND"]           = new Round(null);
     functionPrototype["ROW_COUNT"]       = new RowCount(null);
     functionPrototype["RPAD"]            = new Rpad(null);
     functionPrototype["RTRIM"]           = new Rtrim(null);
     functionPrototype["SCHEMA"]          = new Database(null);
     functionPrototype["SEC_TO_TIME"]     = new SecToTime(null);
     functionPrototype["SECOND"]          = new Second(null);
     functionPrototype["SESSION_USER"]    = new User(null);
     functionPrototype["SHA1"]            = new Sha1(null);
     functionPrototype["SHA"]             = new Sha1(null);
     functionPrototype["SHA2"]            = new Sha2(null);
     functionPrototype["SIGN"]            = new Sign(null);
     functionPrototype["SIN"]             = new Sin(null);
     functionPrototype["SLEEP"]           = new Sleep(null);
     functionPrototype["SOUNDEX"]         = new Soundex(null);
     functionPrototype["SPACE"]           = new Space(null);
     functionPrototype["SQRT"]            = new Sqrt(null);
     functionPrototype["STD"]             = new Std(null);
     functionPrototype["STDDEV_POP"]      = new StdDevPop(null);
     functionPrototype["STDDEV_SAMP"]     = new StdDevSamp(null);
     functionPrototype["STDDEV"]          = new StdDev(null);
     functionPrototype["STR_TO_DATE"]     = new StrToDate(null);
     functionPrototype["STRCMP"]          = new Strcmp(null);
     functionPrototype["SUBDATE"]         = new Subdate(null);
     functionPrototype["SUBSTRING_INDEX"] = new SubstringIndex(null);
     functionPrototype["SUBTIME"]         = new Subtime(null);
     functionPrototype["SYSDATE"]         = new Sysdate(null);
     functionPrototype["SYSTEM_USER"]     = new User(null);
     functionPrototype["TAN"]             = new Tan(null);
     functionPrototype["TIME_FORMAT"]     = new TimeFormat(null);
     functionPrototype["TIME_TO_SEC"]     = new TimeToSec(null);
     functionPrototype["TIME"]            = new Time(null);
     functionPrototype["TIMEDIFF"]        = new Timediff(null);
     functionPrototype["TIMESTAMP"]       = new Timestamp(null);
     // functionPrototype.put("TIMESTAMPADD", new Timestampadd(null));
     // functionPrototype.put("TIMESTAMPDIFF", new Timestampdiff(null));
     functionPrototype["TO_DAYS"]             = new ToDays(null);
     functionPrototype["TO_SECONDS"]          = new ToSeconds(null);
     functionPrototype["TRUNCATE"]            = new Truncate(null);
     functionPrototype["UCASE"]               = new Upper(null);
     functionPrototype["UNCOMPRESS"]          = new Uncompress(null);
     functionPrototype["UNCOMPRESSED_LENGTH"] = new UncompressedLength(null);
     functionPrototype["UNHEX"]               = new Unhex(null);
     functionPrototype["UNIX_TIMESTAMP"]      = new UnixTimestamp(null);
     functionPrototype["UPDATEXML"]           = new UpdateXml(null);
     functionPrototype["UPPER"]               = new Upper(null);
     functionPrototype["USER"]          = new User(null);
     functionPrototype["UTC_DATE"]      = new UtcDate(null);
     functionPrototype["UTC_TIME"]      = new UtcTime(null);
     functionPrototype["UTC_TIMESTAMP"] = new UtcTimestamp(null);
     functionPrototype["UUID_SHORT"]    = new UuidShort(null);
     functionPrototype["UUID"]          = new Uuid(null);
     functionPrototype["VALUES"]        = new Values(null);
     functionPrototype["VAR_POP"]       = new VarPop(null);
     functionPrototype["VAR_SAMP"]      = new VarSamp(null);
     functionPrototype["VARIANCE"]      = new Variance(null);
     functionPrototype["VERSION"]       = new Version(null);
     functionPrototype["WEEK"]          = new Week(null);
     functionPrototype["WEEKDAY"]       = new Weekday(null);
     functionPrototype["WEEKOFYEAR"]    = new Weekofyear(null);
     functionPrototype["YEAR"]          = new Year(null);
     functionPrototype["YEARWEEK"]      = new Yearweek(null);
 }
Esempio n. 9
0
        public void Test_ConvertFromInt()
        {
            Weekday value = (Weekday)1;

            value.Should().Be(Weekday.Monday);
        }
Esempio n. 10
0
        /// <summary>
        /// Get First Date Of Month
        /// </summary>
        /// <param name="weekday"></param>
        /// <param name="month"></param>
        /// <param name="year"></param>
        /// <returns></returns>
        public static int GetFirstDateOfMonth(Weekday weekday, int month, int year)
        {
            int date = -1;
            string dayCmp = weekday.ToString().Substring(0, 3);

            for (int i = 1; i <= 7; i++)
            {
                if (dayCmp.Equals(new DateTime(year, month, i).ToString("ddd")))
                {
                    date = i;
                    break;
                }
            }

            return date;
        }
Esempio n. 11
0
 internal PeriodWithChargeDay(int interval, TypeUnit unit, Weekday weekday)
 {
     this.Interval = interval;
     this.Unit = unit;
     this.Weekday = weekday;
 }
Esempio n. 12
0
 public void RemoveBooking(string aUsername, Weekday aDay, bool isTutor)
 {
     Days[(int)aDay].RemoveBooking(aUsername, isTutor);
 }
Esempio n. 13
0
        static void GetArgs(string[] args)
        {
            string env = System.Environment.GetEnvironmentVariable("name");
            if (null != env)
            {
                name = env;
                WriteLine("name from env=" + name);
            }

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i].StartsWith("-"))
                {
                    if (i + 1 < args.Length)
                    {
                        parameter = args[i + 1];
                        parameterIndex = i + 1;
                    }
                }

                if (args[i].Equals("-find"))
                {
                    command = args[i];
                    findArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-eval"))
                {
                    command = args[i];
                    evalArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-scan"))
                {
                    command = args[i];
                    scanArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-synth"))
                {
                    command = args[i];
                    synthArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-send"))
                {
                    command = args[i];
                    parameter = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-menu"))
                {
                    command = args[i];
                    parameter = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-move"))
                {
                    command = args[i];
                    i += 3;
                }
                else if (args[i].Equals("-cast"))
                {
                    command = args[i];
                    castArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-day"))
                {
                    string day = args[i + 1];
                    i++;
                    foreach (Weekday weekDay in Enum.GetValues(typeof(Weekday)))
                    {
                        if (match(weekDay.ToString(), day))
                            dayArgument = weekDay;
                    }
                }
                else if (args[i].Equals("-hotchick"))
                {
                    command = args[i];
                }
                else if (args[i].Equals("-inventory"))
                {
                    command = args[i];
                }
                else if (args[i].Equals("-script"))
                {
                    command = args[i];
                }
                else if (args[i].Equals("-locked"))
                {
                    command = args[i];
                }
                else if (args[i].Equals("-parties"))
                {
                    partiesArgument = args[i + 1];
                    i++;
                }

                if (args[i].Equals("-name"))
                {
                    name = args[i+1];
                    i++;
                }
                else if (args[i].Equals("-exec"))
                {
                    exec = true;
                    execParameter = args[i + 1];
                    i += 1;
                }
                else if (args[i].Equals("-loop"))
                {
                    loop = true;
                }
                else if (args[i].Equals("-follow"))
                {
                    follow = true;
                }
                else if (args[i].Equals("-homing"))
                {
                    homing = true;
                }
                else if (args[i].Equals("-norotate"))
                {
                    rotate = false;
                }
                else if (args[i].Equals("-distance"))
                {
                    distanceArgument = float.Parse(args[i + 1]);
                }
                else if (args[i].Equals("-alternate"))
                {
                    findAlternate = true;
                }
                else if (args[i].Equals("-immediate"))
                {
                    immediate = true;
                }
                else if (args[i].Equals("-maxDistance"))
                {
                    maxDistance = float.Parse(args[i + 1]);
                }
                else if (args[i].Equals("-castTarget"))
                {
                    castTarget = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-exactMatch"))
                {
                    enableExactMatch = true;
                }
                else if (args[i].Equals("-npc"))
                {
                    command = args[i];
                    npcArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-go"))
                {
                    command = args[i];
                    goArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-patrole"))
                {
                    command = args[i];
                    patroleArgument = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-patroleTarget"))
                {
                    patroleTarget = args[i + 1];
                    i++;
                }
                else if (args[i].Equals("-locate"))
                {
                    command = args[i];
                }
                else if (args[i].Equals("-target"))
                {
                    patroleTarget = args[i + 1];
                    target = args[i + 1];
                    i++;
                }

                checkYDiff = System.Environment.GetEnvironmentVariable("checky") != null;
            }
        }
 public override void Init(Irony.Parsing.ParsingContext context, Irony.Parsing.ParseTreeNode treeNode)
 {
     base.Init(context, treeNode);
     Weekday = treeNode.FirstChild.AstNode as Weekday;
    
 }
Esempio n. 15
0
 static void SetProcess()
 {
     Process[] processes = System.Diagnostics.Process.GetProcessesByName("pol");
     for (int i = 0; i < processes.Length; i++)
     {
         process = processes[i];
         fface = new FFACE(process.Id);
         prefix = fface.Player.Name;
         dayArgument = fface.Timer.GetVanaTime().DayType;
         ffaceList.Add(fface);
         if (match(name, fface.Player.Name))
         {
             break;
         }
     }
     WriteLine("Process=" + process.Id);
     WriteLine("Name=" + fface.Player.Name);
     windower = fface.Windower;
     if (enableExactMatch)
         exactMatch = true;
 }
Esempio n. 16
0
File: Date.cs Progetto: minikie/test
 public static Date nextWeekday(Date arg0, Weekday arg1) {
   Date ret = new Date(NQuantLibcPINVOKE.Date_nextWeekday(Date.getCPtr(arg0), (int)arg1), true);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 17
0
 public Date(Weekday day, Month month, Year year)
 {
     this._month = month;
     this._day = day;
     this._year = year;
 }
Esempio n. 18
0
 public Date()
 {
     this._month = Month.Jan;
     this._day = Weekday.Mon;
     this._year = 2000;
 }
Esempio n. 19
0
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["proper"]      = new Proper();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["abs"]         = new Abs();
     Functions["cos"]         = new Cos();
     Functions["cosh"]        = new Cosh();
     Functions["power"]       = new Power();
     Functions["sign"]        = new Sign();
     Functions["sqrt"]        = new Sqrt();
     Functions["sqrtpi"]      = new SqrtPi();
     Functions["pi"]          = new Pi();
     Functions["product"]     = new Product();
     Functions["ceiling"]     = new Ceiling();
     Functions["count"]       = new Count();
     Functions["counta"]      = new CountA();
     Functions["countif"]     = new CountIf();
     Functions["fact"]        = new Fact();
     Functions["floor"]       = new Floor();
     Functions["sin"]         = new Sin();
     Functions["sinh"]        = new Sinh();
     Functions["sum"]         = new Sum();
     Functions["sumif"]       = new SumIf();
     Functions["sumproduct"]  = new SumProduct();
     Functions["sumsq"]       = new Sumsq();
     Functions["stdev"]       = new Stdev();
     Functions["stdevp"]      = new StdevP();
     Functions["stdev.s"]     = new Stdev();
     Functions["stdev.p"]     = new StdevP();
     Functions["subtotal"]    = new Subtotal();
     Functions["exp"]         = new Exp();
     Functions["log"]         = new Log();
     Functions["log10"]       = new Log10();
     Functions["ln"]          = new Ln();
     Functions["max"]         = new Max();
     Functions["maxa"]        = new Maxa();
     Functions["min"]         = new Min();
     Functions["mod"]         = new Mod();
     Functions["average"]     = new Average();
     Functions["averagea"]    = new AverageA();
     Functions["averageif"]   = new AverageIf();
     Functions["round"]       = new Round();
     Functions["rounddown"]   = new Rounddown();
     Functions["roundup"]     = new Roundup();
     Functions["rand"]        = new Rand();
     Functions["randbetween"] = new RandBetween();
     Functions["quotient"]    = new Quotient();
     Functions["trunc"]       = new Trunc();
     Functions["tan"]         = new Tan();
     Functions["tanh"]        = new Tanh();
     Functions["atan"]        = new Atan();
     Functions["atan2"]       = new Atan2();
     Functions["var"]         = new Var();
     Functions["varp"]        = new VarP();
     // Information
     Functions["isblank"]   = new IsBlank();
     Functions["isnumber"]  = new IsNumber();
     Functions["istext"]    = new IsText();
     Functions["iserror"]   = new IsError();
     Functions["iserr"]     = new IsErr();
     Functions["iseven"]    = new IsEven();
     Functions["isodd"]     = new IsOdd();
     Functions["islogical"] = new IsLogical();
     Functions["isna"]      = new IsNa();
     Functions["na"]        = new Na();
     Functions["n"]         = new N();
     // Logical
     Functions["if"]   = new If();
     Functions["not"]  = new Not();
     Functions["and"]  = new And();
     Functions["or"]   = new Or();
     Functions["true"] = new True();
     // Reference and lookup
     Functions["address"] = new Address();
     Functions["hlookup"] = new HLookup();
     Functions["vlookup"] = new VLookup();
     Functions["lookup"]  = new Lookup();
     Functions["match"]   = new Match();
     Functions["row"]     = new Row();
     Functions["rows"]    = new Rows()
     {
         SkipArgumentEvaluation = true
     };
     Functions["column"]  = new Column();
     Functions["columns"] = new Columns()
     {
         SkipArgumentEvaluation = true
     };
     Functions["choose"]   = new Choose();
     Functions["index"]    = new Index();
     Functions["indirect"] = new Indirect();
     // Date
     Functions["date"]       = new Date();
     Functions["today"]      = new Today();
     Functions["now"]        = new Now();
     Functions["day"]        = new Day();
     Functions["month"]      = new Month();
     Functions["year"]       = new Year();
     Functions["time"]       = new Time();
     Functions["hour"]       = new Hour();
     Functions["minute"]     = new Minute();
     Functions["second"]     = new Second();
     Functions["weeknum"]    = new Weeknum();
     Functions["weekday"]    = new Weekday();
     Functions["days360"]    = new Days360();
     Functions["yearfrac"]   = new Yearfrac();
     Functions["edate"]      = new Edate();
     Functions["eomonth"]    = new Eomonth();
     Functions["isoweeknum"] = new IsoWeekNum();
     Functions["workday"]    = new Workday();
 }
Esempio n. 20
0
        public void GetMonth_ReturnMonth_True()
        {
            Weekday weekday = new Weekday("2018-01-01");

            Assert.AreEqual(1, weekday.GetMonth());
        }
Esempio n. 21
0
        //Check if a booking under a tutors name appears on this day
        public Boolean Check(string aTutorName, Weekday aDay)
        {
            Boolean result = Days[(int)aDay].CheckBookings(aTutorName);

            return(result);
        }
Esempio n. 22
0
        public void GetWeekDay_CalculateWeekDay_True()
        {
            Weekday weekday = new Weekday("2018-01-01");

            Assert.AreEqual("Monday", weekday.GetWeekDay());
        }
Esempio n. 23
0
 public static Interval.PeriodWithChargeDay periodWithChargeDay(int interval, TypeUnit unit, Weekday weekday)
 {
     return new Interval.PeriodWithChargeDay(interval, unit, weekday);
 }
Esempio n. 24
0
        public void ReturnCorrectWeekdayWhenIntIsPassed()
        {
            Weekday result = EnumMapper.MapValueToEnum <Weekday, int>(4);

            Assert.AreEqual(Weekday.Friday, result);
        }
Esempio n. 25
0
                } // @ public override string ToString()

                /// <summary>
                /// Will get a string representation of the current day of the week
                /// </summary>
                /// <param name="day">Weekday to convert to string</param>
                public string GetDayOfWeekName (Weekday day)
                {
                    string dayweek = String.Empty;
                    switch (day)
                    {
                        case Weekday.Darksday:
                            dayweek = "Darksday";
                            break;
                        case Weekday.Earthsday:
                            dayweek = "Earthsday";
                            break;
                        case Weekday.Firesday:
                            dayweek = "Firesday";
                            break;
                        case Weekday.Iceday:
                            dayweek = "Iceday";
                            break;
                        case Weekday.Lightningday:
                            dayweek = "Lightningday";
                            break;
                        case Weekday.Lightsday:
                            dayweek = "Lightsday";
                            break;
                        case Weekday.Watersday:
                            dayweek = "Watersday";
                            break;
                        case Weekday.Windsday:
                            dayweek = "Windsday";
                            break;

                    } // @ switch (day)

                    return dayweek;

                } // @ public string GetDayOfWeekName(Weekday day)
Esempio n. 26
0
File: Date.cs Progetto: minikie/test
 public static Date nthWeekday(uint n, Weekday arg1, Month m, int y) {
   Date ret = new Date(NQuantLibcPINVOKE.Date_nthWeekday(n, (int)arg1, (int)m, y), true);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 27
0
        public void GetYear_ReturnYear_True()
        {
            Weekday weekday = new Weekday("2018-01-01");

            Assert.AreEqual(2018, weekday.GetYear());
        }
Esempio n. 28
0
        public static DateTime DateOfNextWeekday(DateTime today, Weekday wd)
        {
            int diff = today.DayOfWeek - DayOfWeek.Sunday;

            return(today.AddDays(1));
        }
Esempio n. 29
0
        public void GetDay_ReturnDay_True()
        {
            Weekday weekday = new Weekday("2018-01-01");

            Assert.AreEqual(1, weekday.GetDay());
        }
Esempio n. 30
0
 /// ---------------------------------------------------------------------
 /// <summary>
 /// Generates a list of Weekdays from the Weekday enum 
 /// and then sets the selected value
 /// </summary>
 /// <param name="value">Weekday</param>
 /// <returns>SelectList</returns>
 /// ---------------------------------------------------------------------
 public SelectList WeekdaySelectList(Weekday? value)
 {
     try
     {
         int? selected = Convert.ToInt32(value);
         var lsList = new List<WeekDay>();
         for (int i = 0; i <= 6; i++)
         {
             lsList.Add(new WeekDay
             {
                 DayVal = (i + 1),
                 DayName = WeekdayList()[i].ToString()
             });
         }
         return new SelectList(lsList, "DayVal", "DayName", selected);
     }
     catch (Exception)
     {
         return null;
     }
 }
Esempio n. 31
0
        public void ReturnCorrectWeekdayWhenStringIsPassed()
        {
            Weekday result = EnumMapper.MapValueToEnum <Weekday, string>("Monday");

            Assert.AreEqual(Weekday.Monday, result);
        }
Esempio n. 32
0
 public async Task AddAndSave(Weekday weekday)
 {
     _repo.Add(weekday);
     await _repo.Save();
 }
Esempio n. 33
0
        public void Test_AssignByInt()
        {
            Weekday day = (Weekday)2;

            day.Should().Be(Weekday.Tuesday);
        }
Esempio n. 34
0
 public async Task Update(Weekday weekday)
 {
     _repo.Update(weekday);
     await _repo.Save();
 }
Esempio n. 35
0
 public Date()
 {
     this._month = Month.Jan;
     this._day   = Weekday.Mon;
     this._year  = 2000;
 }
Esempio n. 36
0
 public async Task Delete(Weekday weekday)
 {
     _repo.Delete(weekday);
     await _repo.Save();
 }
Esempio n. 37
0
 public List <Item> GetItems(Weekday weekday) => MenuMap[weekday].items;
 public void Test_Number_Ok(Weekday weekday, int expectedNumber)
 {
     Assert.Equal(expectedNumber, weekday.Number());
 }
Esempio n. 39
0
        /// <summary>
        /// Compares two RegularRegularHourss for equality.
        /// </summary>
        /// <param name="RegularRegularHours">A RegularRegularHours to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(RegularHours RegularRegularHours)

        => Weekday.Equals(RegularRegularHours.Weekday) &&
        Begin.Equals(RegularRegularHours.Begin) &&
        End.Equals(RegularRegularHours.End);
 public void Test_WeekdayForDayOfWeek_Ok(Weekday weekday, DayOfWeek dayOfWeek)
 {
     Assert.Equal(weekday, WeekdayExtensions.WeekdayForDayOfWeek(dayOfWeek));
 }
Esempio n. 41
0
        /*
         * public void SaveDays(string aFileName)
         * {
         *  List <string> lContent = new List<string>();
         *  foreach (Day aDay in Days)
         *  {
         *      {
         *          //save number of bookings for that day
         *          lContent.Add(aDay.NumBookings().ToString());
         *
         *          List <Booking> CurrentBooking = aDay.getAllBookings();
         *          foreach (Booking aBooking in CurrentBooking)
         *          {
         *              //save booking information
         *              lContent.Add(aBooking.TutorName);
         *              lContent.Add(aBooking.StudentName);
         *              lContent.Add(aBooking.Price.ToString());
         *
         *          }
         *      }
         *  }
         *  DataAccess.Write(aFileName, lContent);
         *
         * }
         */
        //Adds booking under the tutors name and the students on a given day. Stores price.
        public void  AddBooking(string aTutorName, string aUserName, int aPrice, Weekday aDay)
        {
            Booking lBooking = new Booking(aTutorName, aUserName, aPrice);

            Days[(int)aDay].AddBookings(lBooking);
        }
Esempio n. 42
0
 void GetDay(Weekday day)
 {
     textField.text = day.ToString();
 }
Esempio n. 43
0
 //Returns the Bookings for a given day and username. If the User is not a tutor, set aIsTutor to false.
 public Booking GetBookings(string aUserName, Weekday aDay, Boolean aIsTutor)
 {
     return(Days[(int)aDay].getBooking(aUserName, aIsTutor));
 }
Esempio n. 44
0
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["rept"]        = new Rept();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["concat"]      = new Concat();
     Functions["textjoin"]    = new Textjoin();
     Functions["char"]        = new CharFunction();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["fixed"]       = new Fixed();
     Functions["proper"]      = new Proper();
     Functions["search"]      = new Search();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     Functions["hyperlink"]   = new Hyperlink();
     Functions["value"]       = new Value(CultureInfo.CurrentCulture);
     Functions["trim"]        = new Trim();
     Functions["clean"]       = new Clean();
     Functions["unicode"]     = new Unicode();
     Functions["unichar"]     = new Unichar();
     Functions["numbervalue"] = new NumberValue();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["abs"]             = new Abs();
     Functions["asin"]            = new Asin();
     Functions["asinh"]           = new Asinh();
     Functions["acot"]            = new Acot();
     Functions["acoth"]           = new Acoth();
     Functions["cos"]             = new Cos();
     Functions["cot"]             = new Cot();
     Functions["coth"]            = new Coth();
     Functions["cosh"]            = new Cosh();
     Functions["csc"]             = new Csc();
     Functions["csch"]            = new Csch();
     Functions["power"]           = new Power();
     Functions["gcd"]             = new Gcd();
     Functions["lcm"]             = new Lcm();
     Functions["sec"]             = new Sec();
     Functions["sech"]            = new SecH();
     Functions["sign"]            = new Sign();
     Functions["sqrt"]            = new Sqrt();
     Functions["sqrtpi"]          = new SqrtPi();
     Functions["pi"]              = new Pi();
     Functions["product"]         = new Product();
     Functions["ceiling"]         = new Ceiling();
     Functions["ceiling.precise"] = new CeilingPrecise();
     Functions["ceiling.math"]    = new CeilingMath();
     Functions["iso.ceiling"]     = new IsoCeiling();
     Functions["combin"]          = new Combin();
     Functions["combina"]         = new Combina();
     Functions["count"]           = new Count();
     Functions["counta"]          = new CountA();
     Functions["countblank"]      = new CountBlank();
     Functions["countif"]         = new CountIf();
     Functions["countifs"]        = new CountIfs();
     Functions["fact"]            = new Fact();
     Functions["factdouble"]      = new FactDouble();
     Functions["floor"]           = new Floor();
     Functions["floor.precise"]   = new FloorPrecise();
     Functions["floor.math"]      = new FloorMath();
     Functions["radians"]         = new Radians();
     Functions["roman"]           = new Roman();
     Functions["sin"]             = new Sin();
     Functions["sinh"]            = new Sinh();
     Functions["sum"]             = new Sum();
     Functions["sumif"]           = new SumIf();
     Functions["sumifs"]          = new SumIfs();
     Functions["sumproduct"]      = new SumProduct();
     Functions["sumsq"]           = new Sumsq();
     Functions["sumxmy2"]         = new Sumxmy2();
     Functions["sumx2my2"]        = new SumX2mY2();
     Functions["sumx2py2"]        = new SumX2pY2();
     Functions["seriessum"]       = new Seriessum();
     Functions["stdev"]           = new Stdev();
     Functions["stdevp"]          = new StdevP();
     Functions["stdev.s"]         = new StdevDotS();
     Functions["stdev.p"]         = new StdevDotP();
     Functions["subtotal"]        = new Subtotal();
     Functions["exp"]             = new Exp();
     Functions["log"]             = new Log();
     Functions["log10"]           = new Log10();
     Functions["ln"]              = new Ln();
     Functions["max"]             = new Max();
     Functions["maxa"]            = new Maxa();
     Functions["median"]          = new Median();
     Functions["min"]             = new Min();
     Functions["mina"]            = new Mina();
     Functions["mod"]             = new Mod();
     Functions["mode"]            = new Mode();
     Functions["mode.sngl"]       = new ModeSngl();
     Functions["mround"]          = new Mround();
     Functions["average"]         = new Average();
     Functions["averagea"]        = new AverageA();
     Functions["averageif"]       = new AverageIf();
     Functions["averageifs"]      = new AverageIfs();
     Functions["round"]           = new Round();
     Functions["rounddown"]       = new Rounddown();
     Functions["roundup"]         = new Roundup();
     Functions["rand"]            = new Rand();
     Functions["randbetween"]     = new RandBetween();
     Functions["rank"]            = new Rank();
     Functions["rank.eq"]         = new RankEq();
     Functions["rank.avg"]        = new RankAvg();
     Functions["percentile"]      = new Percentile();
     Functions["percentile.inc"]  = new PercentileInc();
     Functions["percentrank"]     = new Percentrank();
     Functions["percentrank.inc"] = new PercentrankInc();
     Functions["quotient"]        = new Quotient();
     Functions["trunc"]           = new Trunc();
     Functions["tan"]             = new Tan();
     Functions["tanh"]            = new Tanh();
     Functions["atan"]            = new Atan();
     Functions["atan2"]           = new Atan2();
     Functions["atanh"]           = new Atanh();
     Functions["acos"]            = new Acos();
     Functions["acosh"]           = new Acosh();
     Functions["var"]             = new Var();
     Functions["var.s"]           = new VarDotS();
     Functions["varp"]            = new VarP();
     Functions["var.p"]           = new VarDotP();
     Functions["large"]           = new Large();
     Functions["small"]           = new Small();
     Functions["degrees"]         = new Degrees();
     Functions["odd"]             = new Odd();
     Functions["even"]            = new Even();
     // Information
     Functions["isblank"]    = new IsBlank();
     Functions["isnumber"]   = new IsNumber();
     Functions["istext"]     = new IsText();
     Functions["isnontext"]  = new IsNonText();
     Functions["iserror"]    = new IsError();
     Functions["iserr"]      = new IsErr();
     Functions["error.type"] = new ErrorType();
     Functions["iseven"]     = new IsEven();
     Functions["isodd"]      = new IsOdd();
     Functions["islogical"]  = new IsLogical();
     Functions["isna"]       = new IsNa();
     Functions["na"]         = new Na();
     Functions["n"]          = new N();
     Functions["type"]       = new TypeFunction();
     // Logical
     Functions["if"]      = new If();
     Functions["ifs"]     = new Ifs();
     Functions["maxifs"]  = new MaxIfs();
     Functions["minifs"]  = new MinIfs();
     Functions["iferror"] = new IfError();
     Functions["ifna"]    = new IfNa();
     Functions["not"]     = new Not();
     Functions["and"]     = new And();
     Functions["or"]      = new Or();
     Functions["true"]    = new True();
     Functions["false"]   = new False();
     Functions["switch"]  = new Switch();
     // Reference and lookup
     Functions["address"]  = new Address();
     Functions["hlookup"]  = new HLookup();
     Functions["vlookup"]  = new VLookup();
     Functions["lookup"]   = new Lookup();
     Functions["match"]    = new Match();
     Functions["row"]      = new Row();
     Functions["rows"]     = new Rows();
     Functions["column"]   = new Column();
     Functions["columns"]  = new Columns();
     Functions["choose"]   = new Choose();
     Functions["index"]    = new RefAndLookup.Index();
     Functions["indirect"] = new Indirect();
     Functions["offset"]   = new Offset();
     // Date
     Functions["date"]             = new Date();
     Functions["today"]            = new Today();
     Functions["now"]              = new Now();
     Functions["day"]              = new Day();
     Functions["month"]            = new Month();
     Functions["year"]             = new Year();
     Functions["time"]             = new Time();
     Functions["hour"]             = new Hour();
     Functions["minute"]           = new Minute();
     Functions["second"]           = new Second();
     Functions["weeknum"]          = new Weeknum();
     Functions["weekday"]          = new Weekday();
     Functions["days"]             = new Days();
     Functions["days360"]          = new Days360();
     Functions["yearfrac"]         = new Yearfrac();
     Functions["edate"]            = new Edate();
     Functions["eomonth"]          = new Eomonth();
     Functions["isoweeknum"]       = new IsoWeekNum();
     Functions["workday"]          = new Workday();
     Functions["workday.intl"]     = new WorkdayIntl();
     Functions["networkdays"]      = new Networkdays();
     Functions["networkdays.intl"] = new NetworkdaysIntl();
     Functions["datevalue"]        = new DateValue();
     Functions["timevalue"]        = new TimeValue();
     // Database
     Functions["dget"]     = new Dget();
     Functions["dcount"]   = new Dcount();
     Functions["dcounta"]  = new DcountA();
     Functions["dmax"]     = new Dmax();
     Functions["dmin"]     = new Dmin();
     Functions["dsum"]     = new Dsum();
     Functions["daverage"] = new Daverage();
     Functions["dvar"]     = new Dvar();
     Functions["dvarp"]    = new Dvarp();
     //Finance
     Functions["cumipmt"]    = new Cumipmt();
     Functions["cumprinc"]   = new Cumprinc();
     Functions["ddb"]        = new Ddb();
     Functions["effect"]     = new Effect();
     Functions["fvschedule"] = new FvSchedule();
     Functions["pduration"]  = new Pduration();
     Functions["rri"]        = new Rri();
     Functions["pmt"]        = new Pmt();
     Functions["ppmt"]       = new Ppmt();
     Functions["ipmt"]       = new Ipmt();
     Functions["ispmt"]      = new IsPmt();
     Functions["pv"]         = new Pv();
     Functions["fv"]         = new Fv();
     Functions["npv"]        = new Npv();
     Functions["rate"]       = new Rate();
     Functions["nper"]       = new Nper();
     Functions["nominal"]    = new Nominal();
     Functions["irr"]        = new Irr();
     Functions["mirr"]       = new Mirr();
     Functions["xirr"]       = new Xirr();
     Functions["sln"]        = new Sln();
     Functions["syd"]        = new Syd();
     Functions["xnpv"]       = new Xnpv();
     Functions["coupdays"]   = new Coupdays();
     Functions["coupdaysnc"] = new Coupdaysnc();
     Functions["coupdaybs"]  = new Coupdaybs();
     Functions["coupnum"]    = new Coupnum();
     Functions["coupncd"]    = new Coupncd();
     Functions["couppcd"]    = new Couppcd();
     Functions["price"]      = new Price();
     Functions["yield"]      = new Yield();
     Functions["duration"]   = new Duration();
     Functions["disc"]       = new Disc();
     //Engineering
     Functions["bitand"]       = new BitAnd();
     Functions["bitor"]        = new BitOr();
     Functions["bitxor"]       = new BitXor();
     Functions["bitlshift"]    = new BitLshift();
     Functions["bitrshift"]    = new BitRshift();
     Functions["convert"]      = new ConvertFunction();
     Functions["bin2dec"]      = new Bin2Dec();
     Functions["bin2hex"]      = new Bin2Hex();
     Functions["bin2oct"]      = new Bin2Oct();
     Functions["dec2bin"]      = new Dec2Bin();
     Functions["dec2hex"]      = new Dec2Hex();
     Functions["dec2oct"]      = new Dec2Oct();
     Functions["hex2bin"]      = new Hex2Bin();
     Functions["hex2dec"]      = new Hex2Dec();
     Functions["hex2oct"]      = new Hex2Oct();
     Functions["oct2bin"]      = new Oct2Bin();
     Functions["oct2dec"]      = new Oct2Dec();
     Functions["oct2hex"]      = new Oct2Hex();
     Functions["delta"]        = new Delta();
     Functions["erf"]          = new Erf();
     Functions["erf.precise"]  = new ErfPrecise();
     Functions["erfc"]         = new Erfc();
     Functions["erfc.precise"] = new ErfcPrecise();
     Functions["besseli"]      = new BesselI();
     Functions["besselj"]      = new BesselJ();
     Functions["besselk"]      = new BesselK();
     Functions["bessely"]      = new BesselY();
 }
Esempio n. 45
0
            /// <summary>
            /// Will get the name of the Weekday passed
            /// </summary>
            /// <param name="day">Weekday enum indicating the String to return</param>
            /// <returns>In-game name of the moon phase passed, String.Empty on error</returns>
            public static String GetDayName(Weekday day)
            {
                if (Instance == null)
                    return String.Empty;

                int key = (int)day | (int)ResourceBit.Day;
                String result;
                if (Instance.ResourcesCache.TryGetValue(key, out result))
                    return result;
                return String.Empty;
            }
 public RecurrenceRuleFreqMonthlyOnLastWeekday(Weekday weekday, int interval)
 {
     Weekday  = weekday;
     Interval = interval;
 }
 // 7ø1
 public static int dayToNumber(Weekday weekday)
 {
     return((int)weekday);
 }
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["rept"]        = new Rept();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["char"]        = new CharFunction();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["fixed"]       = new Fixed();
     Functions["proper"]      = new Proper();
     Functions["search"]      = new Search();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     Functions["hyperlink"]   = new Hyperlink();
     Functions["value"]       = new Value();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["abs"]         = new Abs();
     Functions["asin"]        = new Asin();
     Functions["asinh"]       = new Asinh();
     Functions["cos"]         = new Cos();
     Functions["cosh"]        = new Cosh();
     Functions["power"]       = new Power();
     Functions["sign"]        = new Sign();
     Functions["sqrt"]        = new Sqrt();
     Functions["sqrtpi"]      = new SqrtPi();
     Functions["pi"]          = new Pi();
     Functions["product"]     = new Product();
     Functions["ceiling"]     = new Ceiling();
     Functions["count"]       = new Count();
     Functions["counta"]      = new CountA();
     Functions["countblank"]  = new CountBlank();
     Functions["countif"]     = new CountIf();
     Functions["countifs"]    = new CountIfs();
     Functions["fact"]        = new Fact();
     Functions["floor"]       = new Floor();
     Functions["sin"]         = new Sin();
     Functions["sinh"]        = new Sinh();
     Functions["sum"]         = new Sum();
     Functions["sumif"]       = new SumIf();
     Functions["sumifs"]      = new SumIfs();
     Functions["sumproduct"]  = new SumProduct();
     Functions["sumsq"]       = new Sumsq();
     Functions["stdev"]       = new Stdev();
     Functions["stdevp"]      = new StdevP();
     Functions["stdev.s"]     = new Stdev();
     Functions["stdev.p"]     = new StdevP();
     Functions["subtotal"]    = new Subtotal();
     Functions["exp"]         = new Exp();
     Functions["log"]         = new Log();
     Functions["log10"]       = new Log10();
     Functions["ln"]          = new Ln();
     Functions["max"]         = new Max();
     Functions["maxa"]        = new Maxa();
     Functions["median"]      = new Median();
     Functions["min"]         = new Min();
     Functions["mina"]        = new Mina();
     Functions["mod"]         = new Mod();
     Functions["average"]     = new Average();
     Functions["averagea"]    = new AverageA();
     Functions["averageif"]   = new AverageIf();
     Functions["averageifs"]  = new AverageIfs();
     Functions["round"]       = new Round();
     Functions["rounddown"]   = new Rounddown();
     Functions["roundup"]     = new Roundup();
     Functions["rand"]        = new Rand();
     Functions["randbetween"] = new RandBetween();
     Functions["rank"]        = new Rank();
     Functions["rank.eq"]     = new Rank();
     Functions["rank.avg"]    = new Rank(true);
     Functions["quotient"]    = new Quotient();
     Functions["trunc"]       = new Trunc();
     Functions["tan"]         = new Tan();
     Functions["tanh"]        = new Tanh();
     Functions["atan"]        = new Atan();
     Functions["atan2"]       = new Atan2();
     Functions["atanh"]       = new Atanh();
     Functions["acos"]        = new Acos();
     Functions["acosh"]       = new Acosh();
     Functions["var"]         = new Var();
     Functions["varp"]        = new VarP();
     Functions["large"]       = new Large();
     Functions["small"]       = new Small();
     Functions["degrees"]     = new Degrees();
     // Information
     Functions["isblank"]    = new IsBlank();
     Functions["isnumber"]   = new IsNumber();
     Functions["istext"]     = new IsText();
     Functions["isnontext"]  = new IsNonText();
     Functions["iserror"]    = new IsError();
     Functions["iserr"]      = new IsErr();
     Functions["error.type"] = new ErrorType();
     Functions["iseven"]     = new IsEven();
     Functions["isodd"]      = new IsOdd();
     Functions["islogical"]  = new IsLogical();
     Functions["isna"]       = new IsNa();
     Functions["na"]         = new Na();
     Functions["n"]          = new N();
     // Logical
     Functions["if"]      = new If();
     Functions["iferror"] = new IfError();
     Functions["ifna"]    = new IfNa();
     Functions["not"]     = new Not();
     Functions["and"]     = new And();
     Functions["or"]      = new Or();
     Functions["true"]    = new True();
     Functions["false"]   = new False();
     // Reference and lookup
     Functions["address"]  = new Address();
     Functions["hlookup"]  = new HLookup();
     Functions["vlookup"]  = new VLookup();
     Functions["lookup"]   = new Lookup();
     Functions["match"]    = new Match();
     Functions["row"]      = new Row();
     Functions["rows"]     = new Rows();
     Functions["column"]   = new Column();
     Functions["columns"]  = new Columns();
     Functions["choose"]   = new Choose();
     Functions["index"]    = new RefAndLookup.Index();
     Functions["indirect"] = new Indirect();
     Functions["offset"]   = new Offset();
     // Date
     Functions["date"]             = new Date();
     Functions["today"]            = new Today();
     Functions["now"]              = new Now();
     Functions["day"]              = new Day();
     Functions["month"]            = new Month();
     Functions["year"]             = new Year();
     Functions["time"]             = new Time();
     Functions["hour"]             = new Hour();
     Functions["minute"]           = new Minute();
     Functions["second"]           = new Second();
     Functions["weeknum"]          = new Weeknum();
     Functions["weekday"]          = new Weekday();
     Functions["days360"]          = new Days360();
     Functions["yearfrac"]         = new Yearfrac();
     Functions["edate"]            = new Edate();
     Functions["eomonth"]          = new Eomonth();
     Functions["isoweeknum"]       = new IsoWeekNum();
     Functions["workday"]          = new Workday();
     Functions["networkdays"]      = new Networkdays();
     Functions["networkdays.intl"] = new NetworkdaysIntl();
     Functions["datevalue"]        = new DateValue();
     Functions["timevalue"]        = new TimeValue();
     // Database
     Functions["dget"]     = new Dget();
     Functions["dcount"]   = new Dcount();
     Functions["dcounta"]  = new DcountA();
     Functions["dmax"]     = new Dmax();
     Functions["dmin"]     = new Dmin();
     Functions["dsum"]     = new Dsum();
     Functions["daverage"] = new Daverage();
     Functions["dvar"]     = new Dvar();
     Functions["dvarp"]    = new Dvarp();
     //Finance
     Functions["pmt"] = new Pmt();
 }
Esempio n. 49
0
 static void increment(ref Weekday wd)
 {
     if (wd == Weekday.Sunday)
       wd = Weekday.Monday;
     else
       wd++;
 }
Esempio n. 50
0
 public void addWeekend(Weekday arg0) {
   NQuantLibcPINVOKE.BespokeCalendar_addWeekend(swigCPtr, (int)arg0);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }