Esempio n. 1
0
        public MainPage()
        {
            this.InitializeComponent();

            titleBar = ApplicationView.GetForCurrentView().TitleBar;

            //Allows other Classes to use methods in this Class
            Current = this;

            Start_Settings();
            tip = new Tip();

            Login_Start.Begin();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
            this.navigationHelper.SaveState += navigationHelper_SaveState;
            this.NavigationCacheMode = NavigationCacheMode.Required;

            if(Setting_SOMP == true)
            {
                RadioButton_3.IsChecked = true;
                RadioButton_3_Click(null, null);
            }

            Baaga();

            DC.Trace("(MainPage Loaded)");
            DC.Hide();

            //UpdateColorsStart();
        }
Esempio n. 2
0
    public void Awake()
    {
        i = this;
        t = Object.FindObjectOfType<Transport>();

        Developer = new Developer(t);
        Game = new Game(t);
        Player = new Player(t);
        Tip = new Tip(t);
        Bitcoin = new Bitcoin(t);
    }
 public static int TipPosition(this IEnumerable<Tip> tips, Tip tip)
 {
     int pos = 0;
     foreach (Tip item in tips)
     {
         if (item.Id == tip.Id)
         {
             return pos;
         }
         pos++;
     }
     return -1;
 }
Esempio n. 4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
            }
            Tip tip = _db.Tips.Find(id);

            if (tip == null)
            {
                return(HttpNotFound());
            }
            return(View(tip));
        }
Esempio n. 5
0
        /********** Tip methods ********************/

        public Task <int> AddTipAsync(Tip tip)
        {
            int success = 0;

            if (tip != null)
            {
                // We won't need to add the ID in the real repo
                tip.TipID = tips.Count + 1;
                tips.Add(tip);
                success = 1;  // This will come from DbContext.Add in the real repo
            }

            return(Task.FromResult <int>(success));
        }
Esempio n. 6
0
 public ActionResult Create(Tip model)
 {
     if (ModelState.IsValid)
     {
         model.Autor = User.Identity.Name;
         TipService srv = new TipService();
         srv.Salvar(model);
         return(View("Index", srv.Listar()));
     }
     else
     {
         return(View(model));
     }
 }
Esempio n. 7
0
 public TBlock AddBlock <TBlock>(TBlock block)
     where TBlock : Block
 {
     CloseUnmatchedBlocks();
     block.StartLine = LineNumber;
     while (!Tip.CanContain(block))
     {
         Tip.Close(this);
     }
     Tip.Add(block);
     Tip       = block;
     Container = block;
     return(block);
 }
Esempio n. 8
0
                public Tip_Detailled_Gump(Tip msg) : base(50, 40)
                {
                    objMsg = msg;

                    this.Closable   = true;
                    this.Disposable = true;
                    this.Dragable   = true;
                    this.Resizable  = false;
                    this.AddPage(0);
                    this.AddBackground(0, 0, 250, 250, 5170);
                    this.AddHtml(20, 24, 210, 200, "<BASEFONT COLOR=BLACK>" + msg.Texte + "</BASEFONT>", false, true);
                    this.AddButton(190, 228, 2180, 2180, (int)Buttons.Button3, GumpButtonType.Reply, 0);
                    this.AddImage(100, 8, 2506);
                }
Esempio n. 9
0
        public ActionResult Create([Bind(Include = "Id,Title,Content")] Tip tip)
        {
            tip.UserId = User.Identity.GetUserId();
            ModelState.Clear();
            TryValidateModel(tip);
            if (ModelState.IsValid)
            {
                db.Tips.Add(tip);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tip));
        }
Esempio n. 10
0
    /// <summary>
    /// 显示toast
    /// </summary>
    /// <param name="str">提示信息</param>
    /// <param name="trans">挂载的父类</param>
    public void ShowToastUI(string str, Transform trans, float time)
    {
        //加载预制体
        GameObject toast = Resources.Load("Tip") as GameObject;

        // 对象初始化
        m_toast = Instantiate(toast, null, true);
        m_toast.transform.SetParent(trans);
        m_toast.transform.localScale    = Vector3.one;
        m_toast.transform.localPosition = new Vector3(0, 0, 0);
        Tip tips = m_toast.GetComponent <Tip>();

        tips.ShowText(str, time);
    }
Esempio n. 11
0
    void CalculateDirection(bool isMoved = true)
    {
        Vector2[] dirPos = new Vector2[4]
        {
            new Vector2(_x + 1, _y), new Vector2(_x - 1, _y),
            new Vector2(_x, _y - 1), new Vector2(_x, _y + 1)
        };
        byte dir = 0;

        for (int i = 0; i < dirPos.Length; ++i)
        {
            // touch the door
            if (MapManager.Check(ref dir, MapManager._constDirs[i], dirPos[i], MapCode.WALL) == 0)
            {
                UIManager._Instance.SetTipInfo((isMoved ? "" : Tip._cannotMove) + Tip.GetShowTips(dir, true));
                if (GameData._IsShowedOpenDoorTutorial &&
                    GameData._IsOpenTutorial)
                {
                    GameData._IsShowedOpenDoorTutorial = false;
                    UIManager._Instance.SetSysMsgInfo(SystemMessage._tutorialString_OpenDoor);
                }
                return;
            }
        }
        UIManager._Instance.SetTipInfo((isMoved ? "" : Tip._cannotMove) + Tip.GetShowTips(dir));

        dir = 0;
        for (int i = 0; i < dirPos.Length; ++i)
        {
            MapManager.Check(ref dir, MapManager._constDirs[i], dirPos[i], MapCode.PIT);
        }
        string pitString = Tip.GetPitTips(dir);

        if (!(string.IsNullOrEmpty(pitString)))
        {
            UIManager._Instance.SetTipInfo(pitString);
        }

        dir = 0;
        for (int i = 0; i < dirPos.Length; ++i)
        {
            MapManager.Check(ref dir, MapManager._constDirs[i], dirPos[i], MapCode.ENEMY);
        }
        string enemyString = Tip.GetEnemyTips(dir);

        if (!(string.IsNullOrEmpty(enemyString)))
        {
            UIManager._Instance.SetTipInfo(enemyString);
        }
    }
Esempio n. 12
0
        private void LogoutHyberlink_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (AppCurrent.IsRunning)
            {
                Tip.Alert("系统正在运行,请先停止!");
                return;
            }

            if (User.Logout())
            {
                new LoginWindow().Show();
                Current.MainWindow.Close();
            }
        }
Esempio n. 13
0
        public static int TipPosition(this IEnumerable <Tip> tips, Tip tip)
        {
            int pos = 0;

            foreach (Tip item in tips)
            {
                if (item.Id == tip.Id)
                {
                    return(pos);
                }
                pos++;
            }
            return(-1);
        }
Esempio n. 14
0
        static async Task Main(string[] args)
        {
            var plot = Plot.New(new Source <Tip.Point>(Tip.Load()), x: o => o.Day, y: o => o.Avg)
                       .Geom_ErrorBar(ymin: o => o.Lower, ymax: o => o.Upper, position: PositionAdjustment.Dodge)
                       .Scale_Color_Discrete(o => o.Sex, new[] { "#69b3a2", "#404080" })
                       .YLab("Tip (%)")
                       .Theme(dark: false);

            //Save to File
            await plot.Save("tip.svg");

            //Render as string
            var svg = await plot.AsString();
        }
Esempio n. 15
0
    private void CreateTip(string tipText)
    {
        if (currentTipGo != null)
        {
            Destroy(currentTipGo);
        }

        currentTipGo = Instantiate(tipPreFab);
        Tip tip = currentTipGo.GetComponent <Tip>();

        currentTipGo.transform.SetParent(this.transform, false);
        tip.fullText = tipText;
        tip.tipList  = this;
    }
        public Ayrinti(int uyeId, bool puanSekmesi)
        {
            InitializeComponent();

            this.Text = btnUyeEkle.Text = "Üye Güncelle";
            tip       = Tip.Guncelle;

            this.uyeId = uyeId;
            if (puanSekmesi)
            {
                tabControl1.SelectedTab = tabPage2;
            }
            Doldur();
        }
Esempio n. 17
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tip tip = db.Tips.Find(id);

            if (tip == null)
            {
                return(HttpNotFound());
            }
            return(View(tip));
        }
Esempio n. 18
0
        private void Obrisi_Tip(object sender, RoutedEventArgs e)
        {
            Tip temp = (Tip)tipovi.SelectedItems[0];

            if (Animals.Any(x => x.TipZiv.Id == temp.Id))
            {
                visibility_settings((Button)sender);
            }
            else
            {
                upozorenje.Text = "Da li ste sigurni da zelite da obrisete ovaj tip?";
                visibility_settings((Button)sender);
            }
        }
Esempio n. 19
0
        public ActionResult Create()
        {
            var user = db.Institutos.Where(u => u.Correo == User.Identity.Name).FirstOrDefault();


            ViewBag.CategoriaTipId = new SelectList(CombosHelper.GetCategoriaTips(), "CategoriaTipId", "Nombre");

            var tips = new Tip
            {
                InstitutoId = user.InstitutoId,
            };

            return(View(tips));
        }
Esempio n. 20
0
        // GET: Tip/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tip tip = await db.Tip.FindAsync(id);

            if (tip == null)
            {
                return(HttpNotFound());
            }
            return(View(tip));
        }
Esempio n. 21
0
        public IHttpActionResult DeleteTip(int id)
        {
            Tip tip = db.Tip.Find(id);

            if (tip == null)
            {
                return(NotFound());
            }

            db.Tip.Remove(tip);
            db.SaveChanges();

            return(Ok(tip));
        }
Esempio n. 22
0
        private string GetTipContent(Tip src, string lang)
        {
            switch (lang)
            {
            case "EN":
                return(string.IsNullOrWhiteSpace(src.ContentEN) ? src.Content : src.ContentEN);

            case "IT":
                return(string.IsNullOrWhiteSpace(src.ContentIT) ? src.Content : src.ContentIT);

            default:
                return(src.Content);
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Renders a label and <see cref="T:System.Web.UI.WebControls.TextBox"/> control to the specified <see cref="T:System.Web.UI.HtmlTextWriter"/> object.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> that receives the rendered output.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            bool isValid = (!Required || requiredFieldValidator.IsValid) && dataValidator.IsValid;

            writer.AddAttribute("class", "control-group" +
                                (isValid ? "" : " error") +
                                (Required ? " required" : ""));
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            label.AddCssClass("control-label");
            label.RenderControl(writer);

            writer.AddAttribute("class", "controls");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            base.MaxLength = dataValidator.ValueMaxLength;

            RenderBase(writer);

            if (Required)
            {
                requiredFieldValidator.ErrorMessage = LabelText + " is Required.";
                requiredFieldValidator.RenderControl(writer);
            }

            dataValidator.RenderControl(writer);

            if (Tip.Trim() != string.Empty)
            {
                writer.AddAttribute("class", "help-tip");
                writer.AddAttribute("href", "#");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write(Tip.Trim());
                writer.RenderEndTag();
                writer.RenderEndTag();
            }

            if (Help.Trim() != string.Empty)
            {
                writer.AddAttribute("class", "alert alert-info");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(Help.Trim());
                writer.RenderEndTag();
            }

            writer.RenderEndTag();

            writer.RenderEndTag();
        }
Esempio n. 24
0
        public List <Artikli> Vrsta(Tip odabraniTip)
        {
            List <Artikli> listaArtikala = new List <Artikli>();

            using (var db = new NjamiNjamEntities())
            {
                var upit = from a in db.Artikli
                           where a.vk_tip == odabraniTip.ID
                           select a;

                listaArtikala = upit.ToList();
            }

            return(listaArtikala);
        }
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            odabirTipa s = new odabirTipa();

            s.ShowDialog();

            Tip temp = s.Odabran;

            if (temp != null)
            {
                tip              = temp;
                OznakaTipa       = tip.Oznaka;
                tip_textBox.Text = OznakaTipa;
            }
        }
Esempio n. 26
0
        // GET: Tips/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tip tip = this.Data.Tips.GetById(id);

            if (tip == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AuthorId = new SelectList(this.Data.Users.All(), "Id", "Email", tip.AuthorId);
            return(View(tip));
        }
Esempio n. 27
0
        private void DeleteUserButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var user = (User)UserListBox.SelectedItem;

            if (TengDa.Wpf.Context.UserContext.Users.Any(u => u.Id == user.Id))
            {
                TengDa.Wpf.Context.UserContext.Users.Remove(user);
                TengDa.Wpf.Context.UserContext.SaveChanges();
                Tip.Alert("用户删除成功,重启软件即可生效!");
            }
            else
            {
                Tip.Alert("该用户已删除,请勿重复操作!");
            }
        }
Esempio n. 28
0
        private void SaveAndDisplayTip()
        {
            //Maakt Tip Object om op te slaan
            Tip newTip = new Tip()
            {
                Restaurant = InputRestaurant, BillAmount = GivenPrice, TipPercent = GivenTipPercent
            };
            //Add Nieuwe Tip in de lijst (in Repository) en Return de geupdate lijst
            List <Tip> listOfTips = tipService.SetTips(newTip);
            //Convert van List<Tip> Naar ObservableCollection<Tip> om te displayen in listview
            ObservableCollection <Tip> myCollection = new ObservableCollection <Tip>(listOfTips);

            //Bind Nieuwe List op pagina
            SavedTips = myCollection;
        }
Esempio n. 29
0
    public Tip GetRandTipConcerningGroups(GroupMonsterFighter groupMonster, GroupHumanFighter groupHuman)
    {
        List <Tip> lFinalTips = GetAllTipConcerningGroups(groupMonster, groupHuman, true);

        if (lFinalTips.Count == 0)
        {
            return(null);
        }
        int randIndex = Random.Range(0, lFinalTips.Count);
        Tip tip       = lFinalTips[randIndex];

        LearnTip(tip);

        return(tip);
    }
Esempio n. 30
0
        public async Task <IActionResult> Create([Bind("Id,Title,Game,Description,User,Username,CreatedTime")] Tip tip)
        {
            if (ModelState.IsValid)
            {
                tip.User = User.FindFirstValue(ClaimTypes.NameIdentifier);
                //The usernamer that will actually be displayed
                tip.Username    = User.FindFirstValue(ClaimTypes.Name);
                tip.CreatedTime = DateTime.Now;
                _context.Add(tip);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tip));
        }
Esempio n. 31
0
        public async Task <ConcurrentDictionary <Tip, decimal[]> > GetTipStatsByTipAndLeague(int TipId, int LeagueId)
        {
            ConcurrentDictionary <Tip, decimal[]> TipStats = new ConcurrentDictionary <Tip, decimal[]>();

            Tip t = await tipRepository.GetTipByTipId(TipId);

            decimal Odds = await tipRepository.GetTipAverageOddsByLeague(TipId, LeagueId);

            decimal TotalPlayed = await tipRepository.GetTipTotalPlayedByLeague(TipId, LeagueId);

            decimal Wins = await tipRepository.GetTipWinsByLeague(TipId, LeagueId);

            TipStats.TryAdd(t, new decimal[] { Odds, TotalPlayed, Wins });
            return(TipStats);
        }
Esempio n. 32
0
        public async Task <IActionResult> Put(string id, [FromBody] Tip model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            Builders <Tip> .Filter.Eq("Id", id);


            var update = Builders <Tip> .Update.Set("Title", model.Title);

            await _repository.Update(id, update);

            return(Ok());
        }
Esempio n. 33
0
        public async Task <TipResponse> SaveAsync(Tip tip)
        {
            try
            {
                await _tipRepository.AddAsync(tip);

                await _unitOfWork.CompleteAsync();

                return(new TipResponse(tip));
            }
            catch (Exception ex)
            {
                return(new TipResponse($"An error ocurred while saving the Tip: {ex.Message}"));
            }
        }
Esempio n. 34
0
				public Tip_Gump( Tip msg, int y ) : base(0,y)
				{
					objMsg = msg;

					this.Closable=false;
					this.Disposable=false;
					this.Dragable=false;
					this.Resizable=false;
					this.AddPage(0);
					this.AddButton(0, 0, 2507, 2507, (int)Buttons.Button1, GumpButtonType.Reply, 0);
				}
Esempio n. 35
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;
                if (from == null || info.ButtonID == (int) Buttons.Cancel)
                {
                    return;
                }

                string tip = info.GetTextEntry((int)Buttons.Tip).Text.Trim();

                if(tip.Length == 0)
                {
                    from.SendMessage("You must enter a valid tip.");
                    from.SendGump(new AddTipGump());
                    return;
                }

                string creator = info.GetTextEntry((int)Buttons.From).Text;
                string url = info.GetTextEntry((int)Buttons.Url).Text;

                Tip t = new Tip();
                t.CreateDate = DateTime.Now.ToShortDateString();
                t.From = StringUtils.GetString(creator.Trim(), from.Name);
                t.Text = tip;
                t.Url = url.Trim();

                TipSystem.AddTip(t);
            }
Esempio n. 36
0
 //FR5.5
 public String getTips(Tip tip)
 {
     return "";
 }
Esempio n. 37
0
 /// <summary>
 ///  This class performs an important function.
 /// </summary>
 public TipWidget CreateTipWidget(Tip tip)
 {
     return TipWidgetStrategy.ContainsKey(tip.Type) ? TipWidgetStrategy[tip.Type]
         .Create(tip) : new DefaultTipWidgetFactory().Create(tip);
 }
Esempio n. 38
0
 public TipsGump(PlayerMobile m, Tip tip) : base(100, 100)
 {           
     if (m != null)
     {
         m_Mobile = m;
         CurrentTip = tip;
         MakeGump();
     }
 }
Esempio n. 39
0
				public Tip_Detailled_Gump( Tip msg ) : base(50, 40)
				{
					objMsg = msg;

					this.Closable=true;
					this.Disposable=true;
					this.Dragable=true;
					this.Resizable=false;
					this.AddPage(0);
					this.AddBackground(0, 0, 250, 250, 5170);
					this.AddHtml( 20, 24, 210, 200, "<BASEFONT COLOR=BLACK>" + msg.Texte + "</BASEFONT>", false, true);
					this.AddButton(190, 228, 2180, 2180, (int)Buttons.Button3, GumpButtonType.Reply, 0);
					this.AddImage(100, 8, 2506);
				}
Esempio n. 40
0
				public Tip_Prompt( Tip msg )
				{
					objMsg = msg;
				}
Esempio n. 41
0
 public TipWidget Create(Tip tip)
 {
     TipWidget tmp;
     tmp = new DefaultTipWidget();
     return tmp;
 }
Esempio n. 42
0
 public Node(int value, Tip left, Tip right)
 {
     Value = value;
     Left = new Union<Node, Tip>(left);
     Right = new Union<Node, Tip>(right);
 }
Esempio n. 43
0
			public InternalTarget( Tip msg ) : base( 12, false, TargetFlags.None )
			{
				msg.GM.SendMessage(stText[1]);
				objMsg = msg;
			}
Esempio n. 44
0
 private static void AddTip(Tip tip)
 {
     Tips.Add(tip);
 }
Esempio n. 45
0
 public Display()
 {
     t = new Tip();
     GetInput();
     ShowOutput();
 }
Esempio n. 46
0
 public void SumTree_CorrectlyAddsUpTheValues()
 {
     var tip = new Tip();
     var myTree = new Node(0, new Node(1, new Node(2, tip, tip), new Node(3, tip, tip)), new Node(4, tip, tip));
     AreEqual(10, TreeUsingUnions.SumTree(new Union<Node, Tip>(myTree)));
 }