Exemplo n.º 1
0
        public DateTime GetBestTimeToPost(PromoterFactory.ePromoterType i_PostOption)
        {
            Promoter promoter;

            promoter = PromoterFactory.PromoterCreator(i_PostOption, LoggedInUser);

            return(promoter.FindBestTimeToPost());
        }
Exemplo n.º 2
0
        private string bestTimeToPostIdentifierAndStringMaking(PromoterFactory.ePromoterType i_OptionChoosed, ref int o_BestHourToPost)
        {
            string bestTimeToPostText;

            switch (i_OptionChoosed)
            {
            case PromoterFactory.ePromoterType.Photo:
                m_BestToPostAPhoto = FBEngine.Instance.GetBestTimeToPost(i_OptionChoosed);
                o_BestHourToPost   = m_BestToPostAPhoto.Hour;
                break;

            case PromoterFactory.ePromoterType.Status:
                m_BestToPostAStatus = FBEngine.Instance.GetBestTimeToPost(i_OptionChoosed);
                o_BestHourToPost    = m_BestToPostAStatus.Hour;
                break;
            }

            bestTimeToPostText = string.Format("The best time to post {0}:\n{1}:00:00", i_OptionChoosed.ToString(), o_BestHourToPost);

            return(bestTimeToPostText);
        }
Exemplo n.º 3
0
        public void FindBestTimeToPost()
        {
            PromoterFactory.ePromoterType optionChoosed =
                radioButtonPhoto.Checked ? PromoterFactory.ePromoterType.Photo : PromoterFactory.ePromoterType.Status;
            int    bestHourToPost     = 0;
            string bestTimeToPostText = null;

            try
            {
                bestTimeToPostText = bestTimeToPostIdentifierAndStringMaking(optionChoosed, ref bestHourToPost);
            }
            catch
            {
                labelBestTimeToPost.Text = "Please login first!";
            }

            labelBestTimeToPost.Invoke(new Action(() =>
            {
                labelBestTimeToPost.Text          = bestTimeToPostText;
                radioButtonPostAtBestTime.Enabled = true;
                buttonGetBestTime.Enabled         = true;
            }));
        }