/// </summary>
        /// Erstellt den Email-Composer und fügt die übergebenen Eigenschaften ein.
        /// </summary>
        private EmailComposeTask GetDraftWithProperties(De.APPPlant.Cordova.Plugin.EmailComposer.Options options)
        {
            EmailComposeTask draft = new EmailComposeTask();

            SetSubject(options.Subject, draft);
            SetBody(options.Body, options.IsHtml, draft);
            SetTo(options.To, draft);
            SetCc(options.Cc, draft);
            SetBcc(options.Bcc, draft);
            SetAttachments(options.Attachments, draft);

            return draft;
        }
Example #2
0
        public int InsertDe(string TenDe, int MaKhoi, string DoKho)
        {
            /*
             * Insert đề vào bảng đề
             * Nếu Mã khối không tồn tại trong database -> trả về 1
             * DoKho khác với dễ hoặc trung bình khó -> trả về 2
             * MaDe = MA+NAM+STT VD : MA20190001 MA190002 , Nếu tạo mã đề , mà mã đề đã tồn tại thì trả về 3
             * Tạo thành công -> trả về 0
             *
             */

            using (DataContextDataContext DB = new DataContextDataContext())
            {
                string MaDe    = "0";
                string STTCuoi = " ";
                int    N;
                var    findOneMaDeCuoiCung = (from MD in DB.Des
                                              orderby MD.MaDe descending
                                              select MD).FirstOrDefault();
                if (DateTime.Now.Year != Int32.Parse(findOneMaDeCuoiCung.MaDe.Substring(2, 4)))
                {
                    MaDe = "MA" + DateTime.Now.Year.ToString() + "0000";
                }
                else
                {
                    STTCuoi = findOneMaDeCuoiCung.MaDe.Substring(6, 4);
                    if (!Int32.TryParse(STTCuoi, out N))
                    {
                        return(3);
                    }
                    N = Int32.Parse(STTCuoi) + 1;
                    if (N.ToString().Length == 1)
                    {
                        MaDe = "MA" + DateTime.Now.Year.ToString() + "000" + N.ToString();
                    }
                    if (N.ToString().Length == 2)
                    {
                        MaDe = "MA" + DateTime.Now.Year.ToString() + "00" + N.ToString();
                    }
                    if (N.ToString().Length == 3)
                    {
                        MaDe = "MA" + DateTime.Now.Year.ToString() + "0" + N.ToString();
                    }
                    if (N.ToString().Length == 4)
                    {
                        MaDe = "MA" + DateTime.Now.Year.ToString() + "" + N.ToString();
                    }
                }

                var findOneMaDe = from MD in DB.Des
                                  where MD.MaDe == MaDe
                                  select MD;
                if (findOneMaDe.Count() != 0)
                {
                    return(3);
                }

                De de = new De();
                de.MaDe   = MaDe;
                de.TenDe  = TenDe;
                de.MaKhoi = MaKhoi;
                de.DoKho  = DoKho;

                DB.Des.InsertOnSubmit(de);
                DB.SubmitChanges();

                return(0);
            }
        }
Example #3
0
		public FeedHelper (De.Dhoffmann.Mono.Adfcnewsapp.Touch.NewsListViewController controller)
		{
			this.parentController = controller;
		}
Example #4
0
    //int frameRate = 250;

    // Use this for initialization
    void Start()
    {
        //  Time.captureFramerate = frameRate;

        Time.fixedDeltaTime = 1.0f;
        Pa.SetActive(false);
        Pb.SetActive(false);
        Pc.SetActive(false);
        Pd.SetActive(false);
        Pe.SetActive(false);
        Pwin.SetActive(false);
        Pnon.SetActive(true);
        Pwrong.SetActive(false);
        Pnext.SetActive(false);
        Pnext1.SetActive(false);
        NEXTL.SetActive(false);

        animatorhand = Hand.GetComponent <Animator>();
        //print(animatorhand.GetInstanceID ());

        La.SetActive(false); Ld.SetActive(false);
        Da.SetActive(false); Db.SetActive(false); Dc.SetActive(false); Dd.SetActive(false); De.SetActive(false); Hand.SetActive(false);
        whichF       = 0;
        nowKeep      = 0;
        showcount    = 0;
        playercount  = 0;
        currentlevel = 0;

        Last       = 'F';
        nowplaying = false;

        int temptnum;

        #region random
        System.Random randNum = new System.Random();


        for (int i = 0; i < flowerlight_L0.Length;)
        {
            temptnum = randNum.Next(Min, Max);
            if (i == 0)
            {
                flowerlight_L0[i] = 0;
                i++;
            }

            else if (i == 1)
            {
                flowerlight_L0[i] = 1;
                i++;
            }

            else if (i == 2)
            {
                flowerlight_L0[i] = 4;
                i++;
            }
        }

        for (int i = 0; i < flowerlight_L1.Length;)
        {
            temptnum = randNum.Next(Min, Max);
            if (i == 0)
            {
                flowerlight_L1[i] = 0;
                i++;
            }

            else if (temptnum != flowerlight_L1[i - 1])
            {
                flowerlight_L1[i] = temptnum;
                i++;
            }
        }

        for (int i = 0; i < flowerlight_L2.Length;)
        {
            temptnum = randNum.Next(Min, Max);
            if (i == 0)
            {
                flowerlight_L2[i] = 0;
                i++;
            }

            else if (temptnum != flowerlight_L2[i - 1])
            {
                flowerlight_L2[i] = temptnum;
                i++;
            }
        }

        for (int i = 0; i < flowerlight_L3.Length;)
        {
            temptnum = randNum.Next(Min, Max);
            if (i == 0)
            {
                flowerlight_L3[i] = 0;
                i++;
            }

            else if (temptnum != flowerlight_L3[i - 1])
            {
                flowerlight_L3[i] = temptnum;
                i++;
            }
        }
        #endregion
        cantouch = false;
        tempkeep = false;

        #region show WIN
        for (int i = 0; i < WINNUM; i++)
        {
            WIN[i].SetActive(false);
        }
        KK = false;
        #endregion
    }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        //SHOW MOVE
        if (MovieOn)
        {
            //  print(Math.Round(Time.time - PlayTime, 1));
            if (Math.Round(Time.time - PlayTime, 1) == 1.2)
            {
                showPicture('A');
                print("inshowA");
            }
            if (Math.Round(Time.time - PlayTime, 1) == 3.3)
            {
                showPicture('D');
                print("inshowD");
            }
        }

        if ((Time.time - KKKEEP) > 1.0f && tempkeep)
        {
            showcount   = 0;
            playercount = 0;
            cantouch    = false;
            tempkeep    = false;
        }

        //SHOW WIN
        if (KK && counti < WINNUM && counti >= 0)
        {
            WIN[counti].SetActive(true);
            Text.text = "counti" + counti;
        }
        else if (counti == WINNUM)
        {
            SceneManager.LoadScene("G2End", LoadSceneMode.Single);
        }

        #region if cantouch
        if (cantouch)
        {
            if (currentlevel == 0)
            {
                if (!nowplaying)
                {
                    PlayAnimation();
                    winwintime = Time.time;
                    nowplaying = true;
                }

                else if (Time.time - winwintime > 4.8 && currentlevel == 0)
                {
                    Da.SetActive(false); Db.SetActive(false); Dc.SetActive(false); Dd.SetActive(false); De.SetActive(false);
                    Hand.SetActive(false);
                    currentlevel++;
                    showcount   = 0;
                    cantouch    = false;
                    playercount = 0;
                    Last        = 'F';
                }
            }

            else
            {
                //	print("level up!");

                if ((A && Last != 'A') || Input.GetKeyDown(KeyCode.A))
                {
                    Last = 'A';
                    PlayLightBall(1);
                }
                else if ((B && Last != 'B') || Input.GetKeyDown(KeyCode.B))
                {
                    Last = 'B';
                    PlayLightBall(2);
                }
                else if ((C && Last != 'C') || Input.GetKeyDown(KeyCode.C))
                {
                    Last = 'C';
                    PlayLightBall(3);
                }

                else if ((D && Last != 'D') || Input.GetKeyDown(KeyCode.D))
                {
                    Last = 'D';
                    PlayLightBall(4);
                }

                else if ((E && Last != 'E') || Input.GetKeyDown(KeyCode.E))
                {
                    Last = 'E';
                    PlayLightBall(5);
                }

                //else if (!A && !B && !C && !D && !E)
                //{
                //    showPicture('N');
                //}
            }

            // print(Last);

            //實際測試要記得打開,要記得調Timer設定
        }
        #endregion
    }
Example #6
0
 void PlayAnimation()
 {
     Da.SetActive(true); Db.SetActive(true); Dc.SetActive(true); Dd.SetActive(true); De.SetActive(true);
     Hand.SetActive(true);
     PlayTime = Time.time;
     MovieOn  = true;
 }
Example #7
0
 public Joueur(int points)
 {
     PtsDeVies = points;
     de        = new De();
 }
Example #8
0
        /// <summary>
        /// Обработчик появления нового бара
        /// Вычисляет отклонение цены (закрытия) от средней за период
        /// </summary>
        /// <param name="item">Bar</param>
        public override void OnItemAdded(Bar item)
        {
            bar = item;
            if (item.Symbol != this.strategyHeader.Symbol)
            {
                return;
            }

            bs = this.tradingData.Get <IEnumerable <BarSettings> >().SingleOrDefault(s => s.StrategyId == this.strategyHeader.Id);
            if (bs == null)
            {
                throw new System.Exception("BarSettings bs == null");
                //return;
            }

            //barsSet <= bars
            //IEnumerable<Bar> bars = this.tradingData.Get<IEnumerable<Bar>>().GetNewestBars(bs.Symbol, bs.Interval);
            IEnumerable <Bar> barsSet = this.tradingData.Get <IEnumerable <Bar> >().GetNewestBars(bs.Symbol, bs.Interval, bs.Period + 1);
            //int barsCount = bars.Count();
            int barsCount = this.tradingData.Get <IEnumerable <Bar> >().GetNewestBars(bs.Symbol, bs.Interval).Count();

            if (barsSet == null || barsSet.Count() == 0)
            {
                return;
            }

            IEnumerable <double> closePrices = from b in barsSet
                                               select b.Close;

            ///вычисляем новые занчения
            double iMa = Indicator.EMA_i(closePrices.ToList <double>(), Period, Ma.ToList <double>());
            double iDe = closePrices.Last() - iMa;

            Ma.Add(iMa);
            De.Add(iDe);

            ///вызываем обработчики значений
            foreach (var handler in HandlersMa)
            {
                handler.Invoke(Ma.Last());
            }

            foreach (var handler in HandlersDe)
            {
                handler.Invoke(De.Last());
            }

            ///упаковка посчитанных значений
            ValueMa.Add(new ValueDouble()
            {
                Id       = barsCount - 1,
                DateTime = item.DateTime,
                Name     = "MaSlow",
                Value    = iMa
            });

            ValueDe.Add(new ValueDouble()
            {
                Id       = barsCount - 1,
                DateTime = item.DateTime,
                Name     = "MaFast",
                //TODO 4. сейчас отрисовывается по имени MaFast, надо переделать на стороне отрисовки
                //Name = "MaDeviation",
                Value = iDe
            });

            ///отправка посчитанных значений
            foreach (var handler in HandlersValueMa)
            {
                handler.Invoke(ValueMa.Last());
            }

            foreach (var handler in HandlersValueDe)
            {
                handler.Invoke(ValueDe.Last());
            }
        }
Example #9
0
 private bool bouclierFonctionne()
 {
     return(De.LanceLeDe() <= 2);
 }
Example #10
0
 public int LanceLeDe(int valeur)
 {
     return(De.LanceLeDe(valeur));
 }
Example #11
0
 public int LanceLeDe()
 {
     return(De.LanceLeDe());
 }
Example #12
0
 public MonstreFacile()
 {
     de        = new De();
     EstVivant = true;
 }
Example #13
0
 public static int rollDe(De de)
 {
     return(rollDe(de, 1));
 }
Example #14
0
 /*  public static int getDonTotal(int Niveau)
  * {
  *    return ( Niveau / 3 ) + 1;
  * }*/
 public static string nomDe(De de, int nbr)
 {
     return(nbr.ToString() + "d" + ((int)de).ToString());
 }
Example #15
0
 private int LanceLeDe(int valeur)
 {
     return(De.LanceLeDe(valeur));
 }
Example #16
0
 public int LanceLeDe()
 {
     this.Numde = De.LanceLeDe();
     return(Numde);
 }