Пример #1
0
        private async void Update()
        {
            DateChangeable = false;
            Loading        = Visibility.Visible;

            ((App)Application.Current).AppData.Load(displayDate);
            MyDay today = ((App)Application.Current).AppData.AllDays[displayDate];

            Dictionary <string, Software> overView = today.GetOverView();

            DailyTime = await GenerateSumTime(overView);

            OverviewChart = await GenerateChart(today.GetTimeline());

            UpdateTime = LanguageHelper.InquireLocalizedWord("General_LastUpdate") + DateTime.Now.ToString("H:mm");

            Overview.Clear();
            foreach (OverViewItem item in await GenerateList(overView))
            {
                Overview.Add(item);
                MyDeviceHelper.DoEvents();
            }

            DateChangeable = true;
            Loading        = Visibility.Hidden;
        }
Пример #2
0
        //Set up the grid
        private void InitGrid(int year, int month, int daysInMonth, int startingDay)
        {
            int  lCurrentDay = 0; // Makes sure the arrays do not have more than expected number of days dealt with
            bool end         = false;

            dayCollection = new MyDay[6, 7];

            for (int i = 0; i < 6 && !end; i++)
            {
                for (int z = 0; z < 7; z++)
                {
                    if (lCurrentDay > 0 || z == startingDay)
                    {
                        lCurrentDay += 1;
                        if (lCurrentDay > daysInMonth)
                        {
                            end = true;
                            break;
                        }
                        dayCollection[i, z] = new MyDay()
                        {
                            aptDay     = new DateTime(year, month, lCurrentDay),
                            isOccupied = false
                        };
                    }
                }
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            MyDay day = Saturday; // "using static MyDay"로 인해 타입명 생략됨
            int   bit = ON;       // "using static BitMode"로 인해 타입명 생략됨

            WriteLine(day);       // 출력 결과: Saturday
            WriteLine(bit);       // 출력 결과: 1
        }
Пример #4
0
        static void Main(string[] args)
        {
            MyDay day = Saturday;
            int   bit = ON;

            WriteLine(day);
            WriteLine(bit);
        }
Пример #5
0
 private void txtFields_Search(object sender, MyDay.AutoCompleteBox.SearchEventArgs e)
 {
     _keepActive = true;
     if (sender == txtAction)
     {
         ActionSearch searchList = new ActionSearch();
         searchList.ProjectCode = txtProject.Text.Trim();
         searchList.TaskCode = txtTask.Text.Trim();
         e.SearchList = searchList;
     }
 }
    public void RefreshUI(int page)
    {
        switch (page)
        {
        case 0:
        {
            //SanctuaryUIViewManager.Instance.SetCurrentAchieve(weekContri.ToString());
            //SanctuaryUIViewManager.Instance.SetNextAchieve(MyInfo.nextLvNeedContribution.ToString());
            //SanctuaryUIViewManager.Instance.SetAcieveReward(SanctuaryRewardXMLData.GetAccuNextRankIcon(weekContri));
            //SanctuaryUIViewManager.Instance.SetNextAchievementRewardGoldNum(SanctuaryRewardXMLData.GetAccuNextGold(weekContri));
            var rwd = new List <MyRewardData>();
            foreach (var item in SanctuaryRewardXMLData.dataMap.
                     Where(x => x.Value.type == 3 && x.Value.level[0] <= weekLevel &&
                           weekLevel <= x.Value.level[1]))
            {
                if (weekContri >= item.Value.contribution)
                {
                    //可以领取
                    if (alreadyGetList.Contains(item.Key))
                    {
                        //已经领取过了
                        rwd.Add(new MyRewardData()
                            {
                                name         = string.Concat(ItemParentData.GetItem((int)ItemCode.GOLD).Name, " x ", item.Value.gold),
                                rewardID     = item.Key,
                                icon         = IconData.dataMap.Get(item.Value.icon).path,
                                isAlreadyGet = true,
                                isEnable     = true,
                                needScore    = item.Value.contribution,
                                progress     = (LanguageData.GetContent(46915, String.Concat(weekContri, '/', item.Value.contribution)))
                            });
                    }
                    else
                    {
                        rwd.Add(new MyRewardData()
                            {
                                name         = string.Concat(ItemParentData.GetItem((int)ItemCode.GOLD).Name, " x ", item.Value.gold),
                                rewardID     = item.Key,
                                icon         = IconData.dataMap.Get(item.Value.icon).path,
                                isAlreadyGet = false,
                                isEnable     = true,
                                needScore    = item.Value.contribution,
                                progress     = (LanguageData.GetContent(46915, String.Concat(weekContri, '/', item.Value.contribution)))
                            });
                    }
                }
                else
                {
                    rwd.Add(new MyRewardData()
                        {
                            name         = string.Concat(ItemParentData.GetItem((int)ItemCode.GOLD).Name, " x ", item.Value.gold),
                            rewardID     = item.Key,
                            icon         = IconData.dataMap.Get(item.Value.icon).path,
                            isAlreadyGet = false,
                            isEnable     = false,
                            needScore    = item.Value.contribution,
                            progress     = (LanguageData.GetContent(46915, String.Concat(weekContri, '/', item.Value.contribution)))
                        });
                }
            }

            SanctuaryUIViewManager.Instance.GenerateMyRewardList(rwd);
        }
        break;

        case 1:
        {
            SanctuaryUIViewManager.Instance.ClearRankGridList();
            for (int i = 0; i < weekData.Count; i++)
            {
                RankGridData data = new RankGridData();
                data.achieve = weekData[i].contribution.ToString();
                data.name    = weekData[i].name;
                data.rank    = (i + 1).ToString();
                if (data.name.Equals(MogoWorld.thePlayer.name))
                {
                    data.highLight = true;
                }
                else
                {
                    data.highLight = false;
                }
                SanctuaryUIViewManager.Instance.AddRankGrid(data, i);
            }
            SanctuaryUIViewManager.Instance.SetPlayerName(MogoWorld.thePlayer.name);
            SanctuaryUIViewManager.Instance.SetPlayerRank(MyWeek.ToString());
            SanctuaryUIViewManager.Instance.SetPlayerContribute(weekContri.ToString());
            var weekRank = SanctuaryRewardXMLData.GetWeekRankID();
            SanctuaryUIViewManager.Instance.ClearRewardGridList();

            for (int i = 0; i < weekRank.Count; i++)
            {
                RankRewardGridData rrgd = new RankRewardGridData();
                rrgd.imgName = IconData.dataMap.Get(SanctuaryRewardXMLData.dataMap.Get(weekRank[i]).icon).path;
                rrgd.text    = String.Format("第{0}名宝箱", i + 1);
                SanctuaryUIViewManager.Instance.AddRewardGrid(rrgd);
            }
            break;
        }

        case 2:
        {
            SanctuaryUIViewManager.Instance.ClearRankGridList();
            for (int i = 0; i < dayData.Count; i++)
            {
                RankGridData data = new RankGridData();
                data.achieve = dayData[i].contribution.ToString();
                data.name    = dayData[i].name;
                data.rank    = (i + 1).ToString();
                if (data.name.Equals(MogoWorld.thePlayer.name))
                {
                    data.highLight = true;
                }
                else
                {
                    data.highLight = false;
                }
                SanctuaryUIViewManager.Instance.AddRankGrid(data, i);
            }
            SanctuaryUIViewManager.Instance.SetPlayerName(MogoWorld.thePlayer.name);
            SanctuaryUIViewManager.Instance.SetPlayerRank(MyDay.ToString());
            SanctuaryUIViewManager.Instance.SetPlayerContribute(dayContri.ToString());
            var dayRank = SanctuaryRewardXMLData.GetDayRankID();
            SanctuaryUIViewManager.Instance.ClearRewardGridList();

            for (int i = 0; i < dayRank.Count; i++)
            {
                RankRewardGridData rrgd = new RankRewardGridData();
                rrgd.imgName = IconData.dataMap.Get(SanctuaryRewardXMLData.dataMap.Get(dayRank[i]).icon).path;
                rrgd.text    = String.Format("第{0}名宝箱", i + 1);
                SanctuaryUIViewManager.Instance.AddRewardGrid(rrgd);
            }
            break;
        }

        default:
            break;
        }
    }
Пример #7
0
        public string cancelEvent()
        {
            string Link = "/" + MyDay.ToString() + "-" + MyMonth.ToString() + "-" + MyYear.ToString();

            return(Link);
        }