Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(byte id)
        {
            flag flag = db.flags.Find(id);

            db.flags.Remove(flag);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
Arquivo: value.cs Projeto: zjmit/go2cs
            private static flag ro(this flag f)
            {
                if (f & flagRO != 0L)
                {
                    return(flagStickyRO);
                }

                return(0L);
            }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "id,flagname")] flag flag)
 {
     if (ModelState.IsValid)
     {
         db.Entry(flag).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(flag));
 }
Exemplo n.º 4
0
        //public QnADialog(bool supressmsessage) => suppressmsg = supressmsessage;

        public QnADialog(flag fl) : base(new QnAMakerService(new QnAMakerAttribute(ConfigurationManager.AppSettings["QnAMakerAuthKey"], ConfigurationManager.AppSettings["QnAMakerKBId"], ConfigurationManager.AppSettings["QnAMakerDefaultMessage"], 0, 1, ConfigurationManager.AppSettings["QnAMakerEndPoint"])))
        {
            if (this.f == null)
            {
                this.f = fl;
            }
            else
            {
                f = fl;
            }
        }
Exemplo n.º 5
0
        public ActionResult Create([Bind(Include = "id,flagname")] flag flag)
        {
            if (ModelState.IsValid)
            {
                db.flags.Add(flag);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(flag));
        }
Exemplo n.º 6
0
 private void butmodify_Click(object sender, EventArgs e)
 {
     panel1.Visible = true;
     edtpn.Text     = "";
     edtoldpn.Text  = "";
     edpndesc.Text  = "";
     txtvenkp.Text  = "";
     edtpn.Enabled  = false;
     butadd.Enabled = false;
     sFlag          = flag.修改;
 }
Exemplo n.º 7
0
 public void allflgis(flag f)
 {
     MCOPY_FLAG = f;             //mcopy
     SIFT_FLAG  = f;             //sift
     RAND_FLAG  = f;             //rand
     CRAND_FLAG = f;             //crand
     CALL_FLAG  = f;             //call
     RV_FLAG    = f;             //reverse
     MR_FLAG    = f;             //mirror
     RMR_FLAG   = f;             //r.mirror
     RR_FLAG    = f;             //rotate right
     RL_FLAG    = f;             //rotate left
 }
Exemplo n.º 8
0
        public command(flag f, M98 m98)
        {
            this.m98 = m98;

            allflgis(f);
            name = "";            //, '\0', DEF.MAXCOMNAME);
            for (int i = 0; i < DEF.MAXCOMP; i++)
            {
                prm[0][i] = 0;
                prm[1][i] = 0;
            }
            spnum = pnum = 0;
        }
Exemplo n.º 9
0
        public void Event_Message(object data, int index, flag myflag)
        {
            if (data == null)
            {
                return;
            }

            switch (myflag)
            {
            case flag.LoginInfo:
                accListView.Items[index].SubItems[1].Text = botList[index].Balance;
                break;

            case flag.ReportProgress:
                toolStripProgressBar1.Value = (int)data;
                break;

            case flag.StripImg:
                int stat = (int)data;

                if (stat == 0)
                {
                    ImageLabel.Image = Properties.Resources.working;
                }
                else
                {
                    ImageLabel.Image = Properties.Resources.ready;
                }

                break;

            case flag.UpdStatus:

                var currbot = botList[index];

                accListView.Items[index].SubItems[2].Text = currbot.getAdCount();

                setDebugInfo(currbot.Pos);

                break;


            case flag.AdsLoaded:
                fillListView(botList[index].adList);
                break;

            case flag.SendText:
                accListView.Items[index].SubItems[3].Text = (string)data;
                break;
            }
        }
Exemplo n.º 10
0
        // GET: flags/Delete/5
        public ActionResult Delete(byte?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            flag flag = db.flags.Find(id);

            if (flag == null)
            {
                return(HttpNotFound());
            }
            return(View(flag));
        }
Exemplo n.º 11
0
        public void on_off(string com, flag f)
        {
            if (com == "mcopy")
            {
                MCOPY_FLAG = f;
            }
            if (com == "sift")
            {
                SIFT_FLAG = f;
            }
            if (com == "rand")
            {
                RAND_FLAG = f;
            }
            if (com == "crand")
            {
                CRAND_FLAG = f;
            }
            if (com == "call")
            {
                CALL_FLAG = f;
            }
            if (com == "rv")
            {
                RV_FLAG = f;
            }
            if (com == "mr")
            {
                MR_FLAG = f;
            }
            if (com == "rmr")
            {
                RMR_FLAG = f;
            }
            if (com == "rr")
            {
                RR_FLAG = f;
            }
            if (com == "rl")
            {
                RL_FLAG = f;
            }

            if (com == "ALL")
            {
                allflgis(f);
            }
        }
Exemplo n.º 12
0
        public attrib(flag a) : base(a)
        {
            nte = new atrb[DEF.MAXTONE + 1];
            vol = new atrb[DEF.MAXTONE + 1];
            voi = new atrb[DEF.MAXTONE + 1];
            len = new atrb[DEF.MAXTONE + 1];
            qtz = new atrb[DEF.MAXTONE + 1];
            kst = new atrb[DEF.MAXTONE + 1];
            pan = new atrb[DEF.MAXTONE + 1];
            ptm = new atrb[DEF.MAXTONE + 1];
            mac = new atrb[DEF.MAXTONE + 1];
            clk = new atrb[DEF.MAXTONE + 1];
            ext = new atrb[DEF.MAXTONE + 1];

            reset();
        }
Exemplo n.º 13
0
        public void doMessage(flag myflag, int searchId, object message, bool isMain)
        {
            try
            {
                if (delegMessage != null)
                {
                    Control target = delegMessage.Target as Control;

                    if (target != null && target.InvokeRequired)
                    {
                        target.Invoke(delegMessage, new object[] { this, message, searchId, myflag, isMain });
                    }
                    else
                    {
                        delegMessage(this, message, searchId, myflag, isMain);
                    }
                }
            }
            catch (Exception e)
            {
                SteamLibrary.AddtoLog(e.Message);
            }
        }
Exemplo n.º 14
0
        protected void doMessage(flag myflag, object message)
        {
            try
            {
                if (MainForm.delegMessage != null)
                {
                    Control target = MainForm.delegMessage.Target as Control;

                    if (target != null && target.InvokeRequired)
                    {
                        target.Invoke(MainForm.delegMessage, new object[] { message, Index, myflag });
                    }
                    else
                    {
                        MainForm.delegMessage(message, Index, myflag);
                    }
                }
            }
            catch (Exception e)
            {
                Utils.AddtoLog(e.Message);
            }
        }
Exemplo n.º 15
0
        public void doMessage(flag myflag, object message, string success)
        {
            try
            {
                if (delegMessage != null)
                {
                    Control target = delegMessage.Target as Control;

                    if (target != null && target.InvokeRequired)
                    {
                        target.Invoke(delegMessage, new object[] { this, message, myflag, success });
                    }
                    else
                    {
                        delegMessage(this, message, myflag, success);
                    }
                }
            }
            catch (Exception e)
            {
                //Log.
            }
        }
Exemplo n.º 16
0
    new void Start()
    {
        base.Start();
        arriveflag = 0;

        Goal = new Vector2[] { Vector2.zero, Vector2.zero };

        if (Count < SpawnPocket.MaxEnemyCount / 2)
        {
            if (Mathf.Abs(_Tile.SpawnPoint[0].x - _Tile.SpawnPoint[1].x) > Mathf.Abs(_Tile.SpawnPoint[0].y - _Tile.SpawnPoint[1].y))
            {
                if (Mathf.Abs(_Tile.SpawnPoint[0].y - _Tile.Y) > Mathf.Abs(_Tile.SpawnPoint[0].y - 0))
                {
                    Goal[0].y = Random.Range(_Tile.Y - 4, _Tile.Y);
                }
                else
                {
                    Goal[0].y = Random.Range(0, 4);
                }

                Goal[0].x = _this.x;
                Goal[1].x = _Tile.SpawnPoint[0].x;
                Goal[1].y = Goal[0].y;

                if (_Tile.SpawnPoint[0].x - _Tile.SpawnPoint[1].x > 0)
                {
                    Locate    = 1;
                    Goal[1].x = _Tile.X - 1;
                }
                else
                {
                    Locate    = 2;
                    Goal[1].x = 0;
                }
            }
            else
            {
                if (Mathf.Abs(_Tile.SpawnPoint[0].x - _Tile.X) > Mathf.Abs(_Tile.SpawnPoint[0].x - 0))
                {
                    Goal[0].x = Random.Range(_Tile.X - 4, _Tile.X);
                }
                else
                {
                    Goal[0].x = Random.Range(0, 4);
                }

                Goal[0].y = _this.y;
                Goal[1].y = _Tile.SpawnPoint[0].y;
                Goal[1].x = Goal[0].x;

                if (_Tile.SpawnPoint[0].y - _Tile.SpawnPoint[1].y > 0)
                {
                    Locate    = 1;
                    Goal[1].y = _Tile.Y - 1;
                }
                else
                {
                    Locate    = 2;
                    Goal[1].y = 0;
                }
            }

            Count++;
            _this.Watch_Stop = false;
            _flag            = flag.ByPass;
        }
        else
        {
            Goal[0].x = Random.Range(
                ((int)_Tile.SpawnPoint[0].x - 6) > 0 ? (int)_Tile.SpawnPoint[0].x - 6 : 0,
                ((int)_Tile.SpawnPoint[0].x + 7) >= _Tile.X ? _Tile.X - 1 : (int)_Tile.SpawnPoint[0].x + 7);
            Goal[0].y = Random.Range(
                ((int)_Tile.SpawnPoint[0].y - 6) > 0 ? (int)_Tile.SpawnPoint[0].y - 6 : 0,
                ((int)_Tile.SpawnPoint[0].y + 7) >= _Tile.Y ? _Tile.Y - 1 : (int)_Tile.SpawnPoint[0].y + 7);

            _flag = flag.Move_Forward;
        }

        _this.MakeNav(Goal[0]);
    }
        public MineSweeperControl(int ButtonsX, int ButtonsY, double Mines, Assets MyAssets)
        {
            var sndclick = new click();
            var sndflag = new flag();
            var sndexplosion = new explosion();


            this.MyAssets = MyAssets;
            this.Alive = true;
            this.Mines = Mines;

            if (this.Mines > 0.8)
                this.Mines = 0.8;

            this.ButtonsX = ButtonsX;
            this.ButtonsY = ButtonsY;

            Control.style.backgroundColor = Color.Gray;
            Control.style.SetSize(Width, Height);
            Control.style.position = IStyle.PositionEnum.relative;

            for (int x = 0; x < ButtonsX; x++)
                for (int y = 0; y < ButtonsY; y++)
                {
                    var btn = new MineButton().AddTo(Buttons);

                    btn.MouseDownChanged +=
                        v =>
                        {
                            if (!Alive)
                                return;

                            if (v)
                            {
                                if (LookingForMines != null)
                                    LookingForMines();
                            }
                            else
                            {
                                if (DoneLookingForMines != null)
                                    DoneLookingForMines();
                            }


                        };

                    btn.Source = MyAssets.button;
                    btn.MouseDownSource = MyAssets.empty;

                    btn.Control.AttachTo(Control);
                    btn.MoveTo(x, y);

                    var NearbyButtons =
                               from i in Buttons
                               where i.IsNearTo(btn)
                               select i;

                    var NearbyMines =
                                from i in NearbyButtons
                                where i.IsMined
                                select i;

                    var NearbyFlags =
                               from i in NearbyButtons
                               where i.Source == MyAssets.flag
                               select i;

                    var NearbyNonFlags =
                               from i in NearbyButtons
                               where i.Source != MyAssets.flag
                               select i;

                    var IdleButtons =
                        from i in Buttons
                        where i.Source != MyAssets.flag
                        where !MyAssets.numbers.Contains(i.Source)
                        select i;

                    Action Resolve =
                        delegate
                        {
                            foreach (var v in NearbyNonFlags)
                            {
                                v.RaiseClick();
                            }
                        };


                    btn.ContextClick +=
                        delegate
                        {
                            sndflag.play();
                            sndflag = new flag();

                            if (MyAssets.numbers.Contains(btn.Source))
                            {
                                if (NearbyMines.Count() == NearbyFlags.Count())
                                {
                                    Resolve();

                                    CheckIdle(IdleButtons);
                                }

                                return;
                            }

                            if (btn.Source == MyAssets.button)
                                btn.Source = MyAssets.flag;
                            else
                                if (btn.Source == MyAssets.flag)
                                    btn.Source = MyAssets.question;
                                else
                                    if (btn.Source == MyAssets.question)
                                        btn.Source = MyAssets.button;

                            if (MinesFoundChanged != null)
                                MinesFoundChanged();

                            CheckIdle(IdleButtons);
                        };

                    //sndclick.load();

                    btn.Click +=
                        delegate
                        {
                            btn.Enabled = false;


                            sndclick.play();
                            sndclick = new click();

                            //sndclick.load();

                            if (btn.IsMined)
                            {
                                // end of game

                                foreach (var v in from i in Buttons
                                                  where !i.IsMined
                                                  where i.Source == MyAssets.flag
                                                  select i)
                                {
                                    v.Source = MyAssets.notmine;
                                }

                                foreach (var v in from i in Buttons
                                                  where i.IsMined
                                                  where i != btn
                                                  select i)
                                {
                                    v.Source = MyAssets.mine;
                                }

                                btn.Source = MyAssets.mine_found;

                                DisableButtons();

                                Alive = false;

                                sndexplosion.play();
                                sndexplosion = new explosion();

                                if (Bang != null)
                                    Bang();
                            }
                            else
                            {
                                // how many mines are near me?

                                var MineCount = NearbyMines.Count();

                                btn.Source = MyAssets.numbers[MineCount];

                                if (MineCount == 0)
                                {
                                    Resolve();

                                    CheckIdle(IdleButtons);

                                }

                            }


                        };
                }

            AttachMinesToButtons();
        }
Exemplo n.º 18
0
        //End JSON
        protected void doMessage(flag myflag, int searchId, string message)
        {
            if (delegMessage != null)
            {
                Control target = delegMessage.Target as Control;

                if (target != null && target.InvokeRequired)
                {
                    target.Invoke(delegMessage, new object[] { this, message, searchId, myflag });
                }
                else
                {
                    delegMessage(this, message, searchId, myflag);
                }
            }
        }
Exemplo n.º 19
0
 public void attachFlag(flag anyFlag)
 {
     list.Add(anyFlag);
 }
        public MineSweeperControl(int ButtonsX, int ButtonsY, double Mines, Assets MyAssets)
        {
            var sndclick     = new click();
            var sndflag      = new flag();
            var sndexplosion = new explosion();


            this.MyAssets = MyAssets;
            this.Alive    = true;
            this.Mines    = Mines;

            if (this.Mines > 0.8)
            {
                this.Mines = 0.8;
            }

            this.ButtonsX = ButtonsX;
            this.ButtonsY = ButtonsY;

            Control.style.backgroundColor = Color.Gray;
            Control.style.SetSize(Width, Height);
            Control.style.position = IStyle.PositionEnum.relative;

            for (int x = 0; x < ButtonsX; x++)
            {
                for (int y = 0; y < ButtonsY; y++)
                {
                    var btn = new MineButton().AddTo(Buttons);

                    btn.MouseDownChanged +=
                        v =>
                    {
                        if (!Alive)
                        {
                            return;
                        }

                        if (v)
                        {
                            if (LookingForMines != null)
                            {
                                LookingForMines();
                            }
                        }
                        else
                        {
                            if (DoneLookingForMines != null)
                            {
                                DoneLookingForMines();
                            }
                        }
                    };

                    btn.Source          = MyAssets.button;
                    btn.MouseDownSource = MyAssets.empty;

                    btn.Control.AttachTo(Control);
                    btn.MoveTo(x, y);

                    var NearbyButtons =
                        from i in Buttons
                        where i.IsNearTo(btn)
                        select i;

                    var NearbyMines =
                        from i in NearbyButtons
                        where i.IsMined
                        select i;

                    var NearbyFlags =
                        from i in NearbyButtons
                        where i.Source == MyAssets.flag
                        select i;

                    var NearbyNonFlags =
                        from i in NearbyButtons
                        where i.Source != MyAssets.flag
                        select i;

                    var IdleButtons =
                        from i in Buttons
                        where i.Source != MyAssets.flag
                        where !MyAssets.numbers.Contains(i.Source)
                        select i;

                    Action Resolve =
                        delegate
                    {
                        foreach (var v in NearbyNonFlags)
                        {
                            v.RaiseClick();
                        }
                    };


                    btn.ContextClick +=
                        delegate
                    {
                        sndflag.play();
                        sndflag = new flag();

                        if (MyAssets.numbers.Contains(btn.Source))
                        {
                            if (NearbyMines.Count() == NearbyFlags.Count())
                            {
                                Resolve();

                                CheckIdle(IdleButtons);
                            }

                            return;
                        }

                        if (btn.Source == MyAssets.button)
                        {
                            btn.Source = MyAssets.flag;
                        }
                        else
                        if (btn.Source == MyAssets.flag)
                        {
                            btn.Source = MyAssets.question;
                        }
                        else
                        if (btn.Source == MyAssets.question)
                        {
                            btn.Source = MyAssets.button;
                        }

                        if (MinesFoundChanged != null)
                        {
                            MinesFoundChanged();
                        }

                        CheckIdle(IdleButtons);
                    };

                    //sndclick.load();

                    btn.Click +=
                        delegate
                    {
                        btn.Enabled = false;


                        sndclick.play();
                        sndclick = new click();

                        //sndclick.load();

                        if (btn.IsMined)
                        {
                            // end of game

                            foreach (var v in from i in Buttons
                                     where !i.IsMined
                                     where i.Source == MyAssets.flag
                                     select i)
                            {
                                v.Source = MyAssets.notmine;
                            }

                            foreach (var v in from i in Buttons
                                     where i.IsMined
                                     where i != btn
                                     select i)
                            {
                                v.Source = MyAssets.mine;
                            }

                            btn.Source = MyAssets.mine_found;

                            DisableButtons();

                            Alive = false;

                            sndexplosion.play();
                            sndexplosion = new explosion();

                            if (Bang != null)
                            {
                                Bang();
                            }
                        }
                        else
                        {
                            // how many mines are near me?

                            var MineCount = NearbyMines.Count();

                            btn.Source = MyAssets.numbers[MineCount];

                            if (MineCount == 0)
                            {
                                Resolve();

                                CheckIdle(IdleButtons);
                            }
                        }
                    };
                }
            }

            AttachMinesToButtons();
        }
Exemplo n.º 21
0
 private readonly string[] flaglabel = new string[] { "", "📁", "♪", "♪♪" }; //  d -  folder 📁,  p -  song  ♪
 public Fav(string title, flag flag = flag.Nothing)
 {
     Title = title;
     Flag  = flag;
 }
Exemplo n.º 22
0
 public void allfon()
 {
     f_nte = f_vol = f_voi = f_len = f_qtz = f_kst = f_ext = f_pan = f_clk = flag.ON;
 }
Exemplo n.º 23
0
Arquivo: Main.cs Projeto: rtcgy/SCMBot
        public void Event_Message(object sender, string message, int searchId, flag myflag, bool isMain)
        {
            switch (myflag)
            {
                case flag.Already_logged:

                    AddtoLog(Strings.AlreadyLogged);
                    StatusLabel1.Text = Strings.AlreadyLogged;
                    GetAccInfo(message);
                    break;

                case flag.Login_success:

                    AddtoLog(Strings.LoginSucc);
                    StatusLabel1.Text = Strings.LoginSucc;
                    GetAccInfo(message);
                    break;

                case flag.Login_cancel:

                    MessageBox.Show(Strings.ErrLogin + message, Strings.Attention, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    StatusLabel1.Text = message;

                    SetButton(loginButton, Strings.Login, 1);
                    ProgressBar1.Visible = false;
                    label5.Text = message;
                    break;

                case flag.Logout_:
                    StatusLabel1.Text = Strings.Logouted;
                    SetButton(loginButton, Strings.Login, 1);
                    setNotifyText(Strings.NotLogged);
                    break;

                case flag.Send_cancel:

                    var scanItem = scanItems[searchId];
                    scanItem.Steam.CancelScan();
                    break;

                case flag.StripImg:
                    if (searchId == 0)
                        toolStripImage.Image = Properties.Resources.working;
                    else
                        toolStripImage.Image = Properties.Resources.ready;
                    break;

                case flag.Lang_Changed:
                    StatusLabel1.Text = Strings.ChangeLang + message;
                    break;

                case flag.Price_htext:
                    AddToScanLog(message, searchId, 1, true, isMain);
                    break;

                case flag.Price_btext:
                    AddToScanLog(message, searchId, 2, true, isMain);
                    break;

                case flag.Price_text:
                    AddToScanLog(message, searchId, 0, true, isMain);
                   break;

                case flag.Rep_progress:
                    ProgressBar1.Value = Convert.ToInt32(message);
                    break;
                case flag.SetHeadName:
                    scanListView.Items[searchId].SubItems[1].Text = message;
                    SetColumnWidths(scanListView, true);
                    break;

                case flag.Scan_progress:
                    StatusLabel1.Text = Strings.ScanPrice;
                    break;

                case flag.Success_buy:
                    StatusLabel1.Text = Strings.Bought;
                    label5.Text = message;
                    buyNowButton.Enabled = true;
                    break;

                case flag.Error_buy:
                    StatusLabel1.Text = Strings.BuyError;
                    AddToScanLog(message, searchId, 1, false, isMain);

                    buyNowButton.Enabled = true;
                    break;
                case flag.Error_scan:
                    StatusLabel1.Text = Strings.ScanError;
                    string mess = GetScanErrMess(message);
                    AddtoLog(scanItems[searchId].Steam.scanInput.Name + ": " + mess);

                    AddToScanLog(mess, searchId, 1, false, isMain);
                    buyNowButton.Enabled = true;
                    break;

                case flag.Scan_cancel:
                    StatusLabel1.Text = Strings.ScanCancel;
                    break;
                case flag.Resold:
                    StatusLabel1.Text = string.Format("Item \"{0}\" resold!", message);
                    break;
                case flag.InvPrice:
                    string sweet = SteamSite.DoFracture(message);
                    InventoryList.Items[searchId].SubItems[3].Text = sweet;
                    textBox1.Text = sweet;
                    textBox1.ReadOnly = false;
                    break;
                case flag.Items_Sold:
                    if (searchId != 1)
                    {
                        if (steam_srch.isRemove)
                        {
                            StatusLabel1.Text = Strings.SellRemoved;
                        }
                        else
                        {
                            StatusLabel1.Text = Strings.SaleItems;
                        }
                        steam_srch.loadInventory();
                    }
                    else
                        StatusLabel1.Text = "Nothing to sell!";

                    ProgressBar1.Visible = false;
                    break;

                case flag.Sell_progress:
                    ProgressBar1.Value = Convert.ToInt32(message);
                    break;
                case flag.Search_success:
                    int searchLim = Convert.ToInt32(settings.searchRes);
                    StatusLabel1.Text = string.Format(Strings.FoundShown, message, steam_srch.searchList.Count.ToString());

                    if (sppos.CurrentPos == 1)
                    {
                        int found = Convert.ToInt32(message);
                        sppos.PageCount = found / searchLim;
                        if (found % searchLim != 0)
                            sppos.PageCount++;

                    }

                    label13.Text = string.Format("{0}/{1}", sppos.CurrentPos.ToString(), sppos.PageCount.ToString());

                    if (sppos.PageCount > 1)
                    {
                        prevButton.Enabled = true;
                        nextButton.Enabled = true;
                    }
                    else
                    {
                        prevButton.Enabled = false;
                        nextButton.Enabled = false;
                    }

                    FoundList.Items.Clear();

                    for (int i = 0; i < steam_srch.searchList.Count; i++)
                    {
                        var ourItem = steam_srch.searchList[i];

                        string[] row = { string.Empty, ourItem.Game, ourItem.Name, ourItem.StartPrice + " " + steam_srch.currencies.GetName(), ourItem.Quant };
                        var lstItem = new ListViewItem(row);
                        FoundList.Items.Add(lstItem);
                    }

                    if (addonComplete)
                    {
                        for (int i = 0; i < steam_srch.searchList.Count; i++)
                        {
                            var currItem = steam_srch.searchList[i];
                            addScanItem(currItem, 3000, 0, false, 0);
                        }
                        scanItems.UpdateIds();
                        addonComplete = false;
                    }
                    else
                        SetColumnWidths(FoundList, true);

                    searchButton.Enabled = true;

                    break;

                case flag.Inventory_Loaded:
                    InventoryList.Items.Clear();
                    label4.Text = steam_srch.inventList.Count.ToString();
                    button1.Enabled = true;

                    if (searchId == 0)
                    {
                        for (int i = 0; i < steam_srch.inventList.Count; i++)
                        {
                            var ourItem = steam_srch.inventList[i];

                            string priceRes;
                            if (ourItem.Price == "0")
                                priceRes = Strings.None;
                            else if (ourItem.Price == "1")
                                priceRes = Strings.NFS;
                            else
                                priceRes = ourItem.Price;

                            string[] row = { string.Empty, ourItem.Type, ourItem.Name, priceRes };
                            var lstItem = new ListViewItem(row);
                            InventoryList.Items.Add(lstItem);
                        }
                        SetColumnWidths(InventoryList, true);
                        SellButton.Enabled = true;
                        button2.Enabled = true;
                    }
                    else
                    {
                        button2.Enabled = false;
                        MessageBox.Show("Inventory section is empty!", Strings.Attention, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;
            }
        }
Exemplo n.º 24
0
 public void allflgon()            //すべてのフラグをonにする
 {
     fnte     = fvol = fqtz = flen = fvoi = fmac = fptm = fpan =
         fkst = fclk = fext = flag.ON;
 }
Exemplo n.º 25
0
        public void ParseToList(string input)
        {
            BranchStringList.Clear();
            HeadStringList.Clear();
            BranchlistValues.Clear();
            HeadlistValues.Clear();

            flag position        = flag.both;
            int  lineNumberLeft  = 0;
            int  lineNumberRight = 0;

            var    stringReader = new StringReader(input);
            string line         = String.Empty;

            while ((line = stringReader.ReadLine()) != null)
            {
                if (line.StartsWith("<<<<<<<"))
                {
                    position = flag.head;
                    continue;
                }
                else if (line.StartsWith("======="))
                {
                    position = flag.branch;
                    continue;
                }
                else if (line.StartsWith(">>>>>>>"))
                {
                    position = flag.both;
                    FillLines(ref lineNumberLeft, ref lineNumberRight);
                    continue;
                }


                if (position == flag.branch)
                {
                    BranchStringList.Add(lineNumberRight, line);
                    lineNumberRight++;
                    HasConflict = true;
                }
                else if (position == flag.head)
                {
                    HeadStringList.Add(lineNumberLeft, line);
                    lineNumberLeft++;
                    HasConflict = true;
                }
                else
                {
                    HeadStringList.Add(lineNumberLeft, line);
                    BranchStringList.Add(lineNumberRight, line);

                    lineNumberLeft++;
                    lineNumberRight++;
                }
            }

            int i = 0;

            foreach (var item in HeadStringList)
            {
                var ct = new ConflictText()
                {
                    LineNumber = i,
                    Text       = item.Value,
                    IsConflict = IsConflict(i++)
                };

                ct.PropertyChanged += Head_PropertyChanged;

                HeadlistValues.Add(ct);
            }
            i = 0;
            foreach (var item in BranchStringList)
            {
                var ct = new ConflictText()
                {
                    LineNumber = i,
                    Text       = item.Value,
                    IsConflict = IsConflict(i++)
                };

                BranchlistValues.Add(ct);

                ct.PropertyChanged += Branch_PropertyChanged;
            }
            FillResultList();
        }
Exemplo n.º 26
0
        public void Event_Message(object sender, object data, int searchId, flag myflag, bool isMain)
        {
            if (data == null)
                return;

            string message = data.ToString();

            switch (myflag)
            {
                case flag.Already_logged:

                    AddtoLog(Strings.AlreadyLogged);
                    StatusLabel1.Text = Strings.AlreadyLogged;
                    GetAccInfo((StrParam)data);
                    break;

                case flag.Login_success:
                    relog = false;
                    AddtoLog(Strings.LoginSucc);
                    StatusLabel1.Text = Strings.LoginSucc;
                    GetAccInfo((StrParam)data);
                    break;

                case flag.Login_cancel:

                    MessageBox.Show(Strings.ErrLogin + message, Strings.Attention, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    StatusLabel1.Text = message;

                    SetButton(loginButton, Strings.Login, 1);
                    ProgressBar1.Visible = false;
                    break;

                case flag.Logout_:
                    StatusLabel1.Text = Strings.Logouted;
                    SetButton(loginButton, Strings.Login, 1);
                    setNotifyText(Strings.NotLogged);
                    break;

                case flag.Send_cancel:

                    if (isMain)
                    {
                        var scanItem = scanItems[searchId];
                        scanItem.Steam.CancelScan();

                        var ourItem = scanItem.Steam.scanInput;
                        ourItem.StatId = status.Ready;
                         setStatImg(searchId, ourItem.StatId, scanListView);

                        if (scanListView.SelectedIndices[0] == searchId)
                        {
                            BindToControls(scanListView);
                        }
                    }
                    else
                    {
                        var ourItem = steam_srch.recentInputList[searchId];

                        if (isLastProc())
                                    steam_srch.CancelListed();
                        ourItem.StatId = status.Ready;

                        setStatImg(searchId, ourItem.StatId, recentListView);

                        if (recentListView.SelectedIndices[0] == searchId)
                        {
                            BindToControls(recentListView);
                        }
                    }

                    break;

                case flag.ReLogin:
                    if (relog == false)
                    {
                        relog = true;
                        steam_srch.Logged = false;
                        steam_srch.Login();
                        ProgressBar1.Visible = true;
                        StatusLabel1.Text = Strings.Relogin;
                        SetButton(loginButton, Strings.Cancel, 3);
                    }

                    break;

                case flag.StripImg:
                    if (searchId == 0)
                        toolStripImage.Image = Properties.Resources.working;
                    else
                        toolStripImage.Image = Properties.Resources.ready;
                    break;

                case flag.Lang_Changed:
                    StatusLabel1.Text = Strings.ChangeLang + message;
                    break;

                case flag.Price_htext:
                    AddToScanLog(message, searchId, 1, true, isMain);
                    break;

                case flag.Price_btext:
                    AddToScanLog(message, searchId, 2, true, isMain);
                    break;

                case flag.Price_text:
                    AddToScanLog(message, searchId, 0, true, isMain);
                   break;

                case flag.Rep_progress:
                    ProgressBar1.Value = Convert.ToInt32(message);
                    break;
                case flag.SetHeadName:

                    var info = (StrParam)data;

                        var item = scanItems[searchId].Steam.scanInput;
                        item.Name = info.P1;
                        item.ImgLink = info.P2;

                        scanListView.Items[searchId].SubItems[1].Text = info.P1;
                        SetColumnWidths(scanListView, true);

                        if (scanListView.SelectedIndices[0] == searchId)
                        {
                            BindToControls(scanListView);
                        }

                    break;

                case flag.Scan_progress:
                    StatusLabel1.Text = Strings.ScanPrice;
                    break;

                case flag.Success_buy:
                    PlaySound(0, settings.playSnd);
                    FlashWindow.Flash(this);

                    StatusLabel1.Text = Strings.Bought;
                    label5.Text = message;
                    buyNowButton.Enabled = true;
                    break;

                case flag.Error_buy:
                    PlaySound(1, settings.playSnd);
                    StatusLabel1.Text = Strings.BuyError;
                    AddToScanLog(message, searchId, 1, false, isMain);

                    buyNowButton.Enabled = true;
                    break;
                case flag.Error_scan:
                    StatusLabel1.Text = Strings.ScanError;
                    string mess = GetScanErrMess(message);

                    if (isMain)
                        AddtoLog(scanItems[searchId].Steam.scanInput.Name + ": " + mess);
                    else
                        AddtoLog("Recent Scan Error: " + mess);

                    AddToScanLog(mess, searchId, 1, false, isMain);
                    buyNowButton.Enabled = true;
                    break;

                case flag.Scan_cancel:
                    StatusLabel1.Text = Strings.ScanCancel;
                    if (isMain)
                    {
                        scanItems[searchId].Steam.scanInput.StatId = status.Ready;
                        setStatImg(searchId, status.Ready, scanListView);
                        BindToControls(scanListView);
                    }
                    else
                    {
                        for (int i = 0; i < steam_srch.recentInputList.Count; i++)
                        {
                            if (steam_srch.recentInputList[i].StatId == status.Wait)
                            {
                                steam_srch.recentInputList[i].StatId = status.Ready;
                                setStatImg(i, status.Ready, recentListView);
                            }
                        }

                        BindToControls(recentListView);
                    }
                    break;
                case flag.Resold:
                    PlaySound(2, settings.playSnd);
                    FlashWindow.Flash(this);

                    StatusLabel1.Text = string.Format("Item \"{0}\" resold!", message);
                    break;

                case flag.ResellErr:
                    PlaySound(3, settings.playSnd);
                    StatusLabel1.Text = string.Format("Resell Error, Item: \"{0}\"", message);
                    break;

                case flag.InvPrice:
                    var lowprice = ((StrParam)data).P1;
                    InventoryList.Items[searchId].SubItems[3].Text = lowprice;
                    filteredInvList[searchId].Price = SteamSite.GetSweetPrice(lowprice);
                    textBox1.Text = lowprice;
                    textBox1_KeyUp(this, null);

                    textBox1.ReadOnly = false;

                    //sold in the last 24 hours
                    //((StrParam)data).P2;

                    break;
                case flag.ActPrice:
                    var lowprice2 = ((StrParam)data).P1;

                    if (isFirstTab)
                    {
                        scanItems[searchId].Steam.scanInput.ResellPrice = lowprice2;
                        scanItems[searchId].Steam.scanInput.ResellType = 2;
                        if (scanListView.SelectedIndices[0] == searchId)
                        {
                            BindToControls(scanListView);
                       }
                    }
                    else
                    {

                        steam_srch.recentInputList[searchId].ResellPrice = lowprice2;
                        steam_srch.recentInputList[searchId].ResellType = 2;

                       if (recentListView.SelectedIndices[0] == searchId)
                        {
                            BindToControls(recentListView);
                        }

                    }

                    break;

                case flag.Items_Sold:
                    if (searchId != 1)
                    {
                        if (steam_srch.isRemove)
                        {
                            StatusLabel1.Text = Strings.SellRemoved;
                        }
                        else
                        {
                            StatusLabel1.Text = Strings.SaleItems;
                        }
                        steam_srch.loadInventory();
                    }
                    else
                        StatusLabel1.Text = "Set prices before Selling!";

                    ProgressBar1.Visible = false;
                    break;

                case flag.Sell_progress:
                    ProgressBar1.Value = Convert.ToInt32(message);
                    break;
                case flag.Search_success:
                    int searchLim = Convert.ToInt32(settings.searchRes);
                    StatusLabel1.Text = string.Format(Strings.FoundShown, message, steam_srch.searchList.Count.ToString());

                    if (sppos.CurrentPos == 1)
                    {
                        int found = Convert.ToInt32(message);
                        sppos.PageCount = found / searchLim;
                        if (found % searchLim != 0)
                            sppos.PageCount++;

                    }

                    label13.Text = string.Format("{0}/{1}", sppos.CurrentPos.ToString(), sppos.PageCount.ToString());

                    if (sppos.PageCount > 1)
                    {
                        prevButton.Enabled = true;
                        nextButton.Enabled = true;
                    }
                    else
                    {
                        prevButton.Enabled = false;
                        nextButton.Enabled = false;
                    }

                    FoundList.Items.Clear();

                    for (int i = 0; i < steam_srch.searchList.Count; i++)
                    {
                        var ourItem = steam_srch.searchList[i];

                        string[] row = { string.Empty, ourItem.Game, ourItem.Name, ourItem.StartPrice + " " + currencies.GetName(), ourItem.Quant };
                        var lstItem = new ListViewItem(row);
                        FoundList.Items.Add(lstItem);
                    }

                    if (addonComplete)
                    {
                        for (int i = 0; i < steam_srch.searchList.Count; i++)
                        {
                            var currItem = steam_srch.searchList[i];
                            addScanItem(currItem, 3000, 0, false, 0, status.Ready);
                        }
                        scanItems.UpdateIds();
                        addonComplete = false;
                    }
                    else
                        SetColumnWidths(FoundList, true);

                    searchButton.Enabled = true;

                    break;

                case flag.Inventory_Loaded:

                    SetInvFilter();

                    label4.Text = filteredInvList.Count.ToString();
                    button1.Enabled = true;

                    if (searchId == 0)
                    {
                        FillInventoryList();

                        SellButton.Enabled = true;
                        if (comboBox3.SelectedIndex != 8)
                        button2.Enabled = true;
                        else button2.Enabled = false;
                    }
                    else
                    {
                        InventoryList.Items.Clear();
                        button2.Enabled = false;
                        MessageBox.Show("Inventory section is empty!", Strings.Attention, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;
            }
        }
Exemplo n.º 27
0
        protected void doMessage(flag myflag, object message)
        {
            try
            {
                if (MainForm.delegMessage != null)
                {
                    Control target = MainForm.delegMessage.Target as Control;

                    if (target != null && target.InvokeRequired)
                    {
                        target.Invoke(MainForm.delegMessage, new object[] { message, Index, myflag });
                    }
                    else
                    {
                        MainForm.delegMessage(message, Index, myflag);
                    }
                }

            }
            catch (Exception e)
            {
                Utils.AddtoLog(e.Message);
            }
        }
Exemplo n.º 28
0
        //End JSON
        protected void doMessage(flag myflag, int searchId, object message, bool isMain)
        {
            try
            {

                if (delegMessage != null)
                {
                    Control target = delegMessage.Target as Control;

                    if (target != null && target.InvokeRequired)
                    {
                        target.Invoke(delegMessage, new object[] { this, message, searchId, myflag, isMain });
                    }
                    else
                    {
                        delegMessage(this, message, searchId, myflag, isMain);
                    }
                }

            }
            catch (Exception e)
            {
                Main.AddtoLog(e.Message);
            }
        }
Exemplo n.º 29
0
 public repval(int a, flag b)
 {
     min   = max = c_nte = c_vol = c_voi = c_len = c_qtz = c_kst = c_ext = c_pan = c_clk = a;
     f_nte = f_vol = f_voi = f_len = f_qtz = f_kst = f_ext = f_pan = f_clk = b;
 }
Exemplo n.º 30
0
 public QnADialog() : base(new QnAMakerService(new QnAMakerAttribute(ConfigurationManager.AppSettings["QnAMakerAuthKey"], ConfigurationManager.AppSettings["QnAMakerKBId"], ConfigurationManager.AppSettings["QnAMakerDefaultMessage"], 0, 1, ConfigurationManager.AppSettings["QnAMakerEndPoint"])))
 {
     f = new flag();
 }
Exemplo n.º 31
0
Arquivo: value.cs Projeto: zjmit/go2cs
 private static Kind kind(this flag f)
 {
     return(Kind(f & flagKindMask));
 }
Exemplo n.º 32
0
        public void Event_Message(object sender, object data, int searchId, flag myflag, bool isMain)
        {
            if (data == null)
            {
                return;
            }

            string message = data.ToString();

            switch (myflag)
            {
            case flag.Already_logged:

                StatusLabel1.Text = "Ready";
                StatusPB.Image    = null;
                SteamLibrary.AddtoLog("Already logged");
                GetAccInfo((SteamLibrary.StrParam)data);
                break;

            case flag.Login_success:

                StatusLabel1.Text = "Ready";
                StatusPB.Image    = null;
                SteamLibrary.AddtoLog("Login succesful");
                GetAccInfo((SteamLibrary.StrParam)data);
                break;

            case flag.Login_cancel:

                MessageBox.Show("Error logging in! " + message + "!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                StatusPB.Image    = null;
                StatusLabel1.Text = message;
                break;

            case flag.Logout_:

                StatusLabel1.Text = "Ready";
                StatusPB.Image    = null;
                LoginB.Text       = "Login";
                break;

            case flag.Search_success:

                ScanLV.Enabled   = true;
                button15.Enabled = true;

                if (SteamAutoFunction.sppos.CurrentPos == 1)
                {
                    int found = Convert.ToInt32(message);
                    SteamAutoFunction.sppos.PageCount = found / SteamAutoFunction.SearchResCount;
                    if (found % SteamAutoFunction.SearchResCount != 0)
                    {
                        SteamAutoFunction.sppos.PageCount++;
                    }
                }

                label5.Text = string.Format("{0}/{1}", SteamAutoFunction.sppos.CurrentPos.ToString(),
                                            SteamAutoFunction.sppos.PageCount.ToString());

                if (SteamAutoFunction.sppos.PageCount > 1)
                {
                    prepageBT.Visible  = true;
                    nextpageBT.Visible = true;
                    button16.Visible   = false;
                    button17.Visible   = false;
                }
                else
                {
                    prepageBT.Visible  = false;
                    nextpageBT.Visible = false;
                    button16.Visible   = false;
                    button17.Visible   = false;
                }

                ScanLV.Items.Clear();

                for (int i = 0; i < SteamAutoFunction.SearchList.Count; i++)
                {
                    var ourItem = SteamAutoFunction.SearchList[i];

                    string[] row = { ourItem.Game,     ourItem.Name,                                                  SteamParsing.Currencies.GetName() + " " + ourItem.StartPrice,
                                     ourItem.Quantity, SteamParsing.Currencies.GetName() + " " + ourItem.MedianPrice, ourItem.Hashname };
                    var      lstItem = new ListViewItem(row);
                    ScanLV.Items.Add(lstItem);
                }

                button2.Enabled   = true;
                StatusPB.Image    = null;
                StatusLabel1.Text = "Ready";

                break;

            case flag.Advance_search_success:

                ScanLV.Enabled               = true;
                button15.Enabled             = true;
                SteamAutoFunction.searchDone = true;

                if (SteamAutoFunction.sppos.CurrentPos == 1)
                {
                    int found = Convert.ToInt32(message);
                    SteamAutoFunction.sppos.PageCount = found / SteamAutoFunction.SearchResCount;
                    if (found % SteamAutoFunction.SearchResCount != 0)
                    {
                        SteamAutoFunction.sppos.PageCount++;
                    }
                }

                label5.Text = string.Format("{0}/{1}", SteamAutoFunction.sppos.CurrentPos.ToString(),
                                            SteamAutoFunction.sppos.PageCount.ToString());

                if (SteamAutoFunction.sppos.PageCount > 1)
                {
                    prepageBT.Visible  = false;
                    nextpageBT.Visible = false;
                    button16.Visible   = true;
                    button17.Visible   = true;
                }
                else
                {
                    prepageBT.Visible  = false;
                    nextpageBT.Visible = false;
                    button16.Visible   = false;
                    button17.Visible   = false;
                }

                ScanLV.Items.Clear();

                for (int i = 0; i < SteamAutoFunction.SearchList.Count; i++)
                {
                    var ourItem = SteamAutoFunction.SearchList[i];

                    string[] row = { ourItem.Game,     ourItem.Name,                                                  SteamParsing.Currencies.GetName() + " " + ourItem.StartPrice,
                                     ourItem.Quantity, SteamParsing.Currencies.GetName() + " " + ourItem.MedianPrice, ourItem.Hashname };
                    var      lstItem = new ListViewItem(row);
                    ScanLV.Items.Add(lstItem);
                }

                button2.Enabled   = true;
                StatusPB.Image    = null;
                StatusLabel1.Text = "Ready";

                break;

            case flag.Add_track:

                SteamLibrary.TrackingItem item = (SteamLibrary.TrackingItem)data;

                string lp = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", item.StartPrice);
                string mp = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", item.MedianPrice);

                string[] row1 = { item.Game,                   item.Name, lp,        mp, "", "",            item.BuyPercent.ToString(),
                                  item.SellPercent.ToString(), "",        item.Link, "", "", item.hashname, "" };
                var      lst1 = new ListViewItem(row1);
                TraItemLV.Items.Add(lst1);

                break;

            case flag.Track_progress:

                SteamLibrary.TrackingItem item1 = (SteamLibrary.TrackingItem)data;

                string lp1 = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", item1.StartPrice);
                string mp1 = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", item1.MedianPrice);

                TraItemLV.Items[item1.index].SubItems[2].Text  = lp1;
                TraItemLV.Items[item1.index].SubItems[3].Text  = mp1;
                TraItemLV.Items[item1.index].SubItems[13].Text = searchId.ToString();

                break;

            /*case flag.Error_scan:
             *
             *  string mess = GetScanErrMess(message);
             *  button12.Enabled = true;
             *  button3.Enabled = true;
             *  break;*/

            case flag.Success_buy:

                string[] price = message.Split(';');

                double itemcost = Math.Round(Convert.ToSingle(WalletL.Text.Remove(0, 2)) - Convert.ToSingle(price[0]), 2);

                FlashWindow.Flash(this);

                WalletL.Text     = SteamParsing.Currencies.GetName() + " " + price[0];
                button3.Enabled  = true;
                button12.Enabled = true;

                for (int i = 0; i < SteamAutoFunction.TrackingList.Count; i++)
                {
                    if (SteamAutoFunction.TrackingList[i].Name.Equals(price[1]))
                    {
                        SteamAutoFunction.TrackingList[i].Purchased = true;
                        TraItemLV.Items[i].SubItems[8].Text         = "x";
                        TraItemLV.Items[i].SubItems[10].Text        = SteamParsing.Currencies.GetName() + " " + itemcost;
                        TraItemLV.Items[i].SubItems[11].Text        = DateTime.Today.AddDays(7).ToString();
                        if (SteamAutoFunction.TrackingList[i].Buy == true)
                        {
                            SteamAutoFunction.TrackingList[i].Buy = false;
                            TraItemLV.Items[i].SubItems[4].Text   = "";
                        }
                        if (SteamAutoFunction.TrackingList[i].Buying == true)
                        {
                            SteamAutoFunction.TrackingList[i].Buying = false;
                        }
                        SteamAutoFunction.TrackingList[i].Refresh.Stop();
                        break;
                    }
                }

                break;

            case flag.Error_buy:

                button3.Enabled = true;
                break;


            case flag.Load_progress:

                for (int a = 0; a < SteamAutoFunction.TrackingList.Count; a++)
                {
                    SteamAutoFunction.TrackingList[a].index = a;

                    string lp2 = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", SteamAutoFunction.TrackingList[a].StartPrice);
                    string mp2 = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", SteamAutoFunction.TrackingList[a].MedianPrice);

                    string buy = ""; string sell = ""; string pured = ""; string pp = "";

                    if (SteamAutoFunction.TrackingList[a].Buy)
                    {
                        buy = "x";
                    }
                    if (SteamAutoFunction.TrackingList[a].Sell)
                    {
                        sell = "x";
                    }
                    if (SteamAutoFunction.TrackingList[a].Purchased)
                    {
                        pured = "x";
                        pp    = SteamParsing.Currencies.GetName() + " " + string.Format("{0:N2}", SteamAutoFunction.TrackingList[a].PurchasePrice);
                    }

                    string[] row2 = { SteamAutoFunction.TrackingList[a].Game,
                                      SteamAutoFunction.TrackingList[a].Name,                  lp2,                                             mp2,                                    buy, sell,
                                      SteamAutoFunction.TrackingList[a].BuyPercent.ToString(),
                                      SteamAutoFunction.TrackingList[a].SellPercent.ToString(),pured,                                           SteamAutoFunction.TrackingList[a].Link,
                                      pp,                                                      SteamAutoFunction.TrackingList[a].purchasedate,
                                      SteamAutoFunction.TrackingList[a].hashname,              "" };
                    var      lst2 = new ListViewItem(row2);
                    TraItemLV.Items.Add(lst2);
                }

                break;

            case flag.Inventory_Loaded:

                button9.Enabled   = true;
                InvenLV.Enabled   = true;
                StatusPB.Image    = null;
                StatusLabel1.Text = "Ready";
                //SetInvFilter();

                //label4.Text = filteredInvList.Count.ToString();
                button1.Enabled = true;
                if (searchId == 0)
                {
                    FillInventoryList();

                    button7.Enabled = true;
                    if (comboBox1.SelectedIndex != 8)
                    {
                        button10.Enabled = true;
                    }
                    else
                    {
                        button10.Enabled = false;
                    }
                }
                else
                {
                    InvenLV.Items.Clear();
                    button10.Enabled = false;
                    MessageBox.Show("Inventory section is empty!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                break;

            case flag.InvPrice:

                SteamLibrary.InventItem ourItem1 = (SteamLibrary.InventItem)data;

                string priceRes = SteamParsing.Currencies.GetName() + " " + SteamLibrary.DoFracture(ourItem1.BuyPrice);
                string priceMes = SteamParsing.Currencies.GetName() + " " + ourItem1.MedianPrice.ToString();

                InvenLV.Items[searchId].SubItems[2].Text = priceRes;
                InvenLV.Items[searchId].SubItems[3].Text = priceMes;

                textBox2.Text = SteamLibrary.DoFracture(ourItem1.BuyPrice);
                textBox2_KeyUp(this, null);

                textBox2.ReadOnly = false;

                button11.Enabled = true;
                InvenLV.Enabled  = true;

                break;

            case flag.Items_Sold:
                if (searchId != 1)
                {
                    StatusLabel1.Text = "Ready";
                    StatusPB.Image    = null;

                    button10.Text = "Set price";

                    int app = comboBox1.SelectedIndex;

                    SteamAuto.InventoryThreadExcute(app);
                }
                break;
            }
        }
Exemplo n.º 33
0
        private void Event_Message(object sender, string message, int searchId, flag myflag)
        {
            switch (myflag)
            {
                case flag.Already_logged:

                    AddtoLog("Already Logged");
                    StatusLabel1.Text = "Already Logged";
                    GetAccInfo(message);
                    break;

                case flag.Login_success:

                    AddtoLog("Login Success");
                    StatusLabel1.Text = "Login Success";
                    GetAccInfo(message);
                    break;

                case flag.Login_cancel:

                    MessageBox.Show("Login has been cancelled. Please try again.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    StatusLabel1.Text = "Login cancelled";

                    SetButton(loginButton, "Login");
                    ProgressBar1.Visible = false;
                    label5.Text = message;
                    break;

                case flag.Logout_:
                    StatusLabel1.Text = "Logouted";
                    SetButton(loginButton, "Login");
                    break;
                case flag.Price_htext:
                    ScanItLst[searchId].lboxAdd(GetPriceFormat(message), 1);
                    break;
                case flag.Price_btext:
                    ScanItLst[searchId].lboxAdd(GetPriceFormat(message), 2);
                    break;
                case flag.Price_text:
                    ScanItLst[searchId].lboxAdd(GetPriceFormat(message), 0);
                    break;

                case flag.Rep_progress:
                    ProgressBar1.Value = Convert.ToInt32(message);
                    break;

                case flag.Scan_progress:
                    //StatusLabel1.Text = "Prices Loaded: "+ message;
                    //Nonsense
                    break;

                case flag.Success_buy:
                    StatusLabel1.Text = "Item bought";
                    label5.Text = message;
                    buyNowButton.Enabled = true;
                    break;

                case flag.Scan_cancel:
                    StatusLabel1.Text = "Scan Cancelled";
                    break;

                case flag.Items_Sold:
                    StatusLabel1.Text = "Items on Sale";
                    ProgressBar1.Visible = false;
                    steam_srch.loadInventory();
                    break;

                case flag.Sell_progress:
                    ProgressBar1.Value = Convert.ToInt32(message);
                    break;
                case flag.Search_success:

                    comboBox1.Items.Clear();
                    StatusLabel1.Text = string.Format("Found: {0}, Shown: {1}", message, steam_srch.searchList.Count.ToString());

                    if (sppos.CurrentPos == 1)
                    {
                        int found = Convert.ToInt32(message);
                        sppos.PageCount = found / 10;
                        if (found % 10 != 0)
                            sppos.PageCount++;

                    }

                    label13.Text = string.Format("{0}/{1}", sppos.CurrentPos.ToString(), sppos.PageCount.ToString());

                    if (sppos.PageCount > 1)
                    {
                        prevButton.Enabled = true;
                        nextButton.Enabled = true;
                    }
                    else
                    {
                        prevButton.Enabled = false;
                        nextButton.Enabled = false;
                    }

                    for (int i = 0; i < steam_srch.searchList.Count; i++)
                    {
                        var ourItem = steam_srch.searchList[i];
                        comboBox1.Items.Add(string.Format("Type: {0}, Item: {1}", ourItem.Game, ourItem.Name));

                    }

                    if (addonComplete)
                    {
                        for (int i = 0; i < steam_srch.searchList.Count; i++)
                        {
                            var currItem = steam_srch.searchList[i];
                            addTabItem(currItem.Link, currItem.StartPrice, currItem.Name, currItem.ImgLink);
                        }
                        addonComplete = false;
                    }
                    else
                    comboBox1.DroppedDown = true;

                    searchButton.Enabled = true;

                    break;

                case flag.Inventory_Loaded:
                    InventoryList.Items.Clear();
                    label4.Text = message;

                    for (int i = 0; i < steam_srch.inventList.Count; i++)
                    {
                        var ourItem = steam_srch.inventList[i];
                        string[] row = { string.Empty, ourItem.Type, ourItem.Name, ourItem.Price };
                        InventoryList.Items.Add(new ListViewItem(row));

                    }

                    SetColumnWidths(InventoryList, true);
                    break;
            }
        }
Exemplo n.º 34
0
 public void attachFlag(flag anyFlag)
 {
     list.Add(anyFlag);
 }
Exemplo n.º 35
0
 public TONE(flag a, M98 m98)
 {
     this.m98 = m98;
 }
Exemplo n.º 36
0
 public flgdat(flag a)
 {
     fnte = fvol = fqtz = flen = fvoi = fmac = fptm = fpan = fkst = fclk = fext = a;
 }