Example #1
0
        public void addIndicator(Exchanges selectedExchange, Coins selectedCoin, Coins selectedPairing, CandleWidth selectedWidth, Indicators selectedIndicator, IndicatorConditions selectedCondition, double value)
        {
            foreach (AlertLayout l in listCellCoin.Children)                                               //in every current layout
            {
                if (l.Coin == selectedCoin && l.Pair == selectedPairing && l.Exchange == selectedExchange) // if layout exists with params
                {
                    foreach (AlertCard c in l.CardGrid.Children)                                           //search for card with same indicator exists
                    {
                        if (c.Indicator == selectedIndicator && c.CandleWidth == selectedWidth)            //if card with same indicator and candle width exists
                        {
                            c.addCondition(selectedCondition, value);                                      //just needed to add condition, else it is a new card
                            return;
                        }
                    }
                    //indicator was not found in card list, need to create new one
                    AlertCard _card = new AlertCard(l, selectedWidth, selectedExchange, selectedCoin, selectedPairing, selectedIndicator);
                    _card.addCondition(selectedCondition, value);
                    l.addTo(_card);
                    return;
                }
            }

            AlertLayout alert = new AlertLayout(selectedExchange, selectedCoin, selectedPairing);
            AlertCard   card  = new AlertCard(alert, selectedWidth, selectedExchange, selectedCoin, selectedPairing, selectedIndicator);

            card.addCondition(selectedCondition, value);
            alert.addTo(card);
            listCellCoin.Children.Add(alert);
            reSize();
        }
Example #2
0
        public void reSize()
        {
            AlertLayout lastCellCoin = null;
            double      lastY        = 0;

            foreach (AlertLayout cc in listCellCoin.Children)
            {
                Canvas.SetTop(cc, lastY);
                cc.Width = listCellCoin.ActualWidth;


                cc.Width     = listCellCoin.ActualWidth;
                lastCellCoin = cc;
                lastY       += cc.ActualHeight;
            }
        }
Example #3
0
        private void View_Resize(object sender, EventArgs e)
        {
            try
            {
                int width  = View.Width;
                int height = View.Height;

                Wrapper.SetControlRect(Tabs, new Rectangle(45, 50, width - 45, height - 65));

                DefinedLayout.SetControlRect(TimerList, new Rectangle(0, 0, width - 45, height - 80));
                PlayerLayout.SetControlRect(PlayerList, new Rectangle(0, 0, width - 45, (height - 65) / 2));
                PlayerLayout.SetControlRect(GuildList, new Rectangle(0, (height - 65) / 2, width - 45, (height - 65) / 2));
                LogoutLayout.SetControlRect(FriendsList, new Rectangle(0, 20, (width - 45) / 2, height - 145));
                LogoutLayout.SetControlRect(EnemiesList, new Rectangle((width - 45) / 2, 20, (width - 45) / 2, height - 145));
                CorpseLayout.SetControlRect(CorpseList, new Rectangle(0, 0, width - 45, height - 80));
                PortalLayout.SetControlRect(PortalList, new Rectangle(0, 0, width - 45, height - 80));

                PlayerList.SetColumnWidth(1, width - 215);
                PlayerList.SetColumnWidth(2, 45);
                PlayerList.SetColumnWidth(3, 75);
                PlayerList.SetColumnWidth(4, 0);

                GuildList.SetColumnWidth(1, width - 215);
                GuildList.SetColumnWidth(2, 45);
                GuildList.SetColumnWidth(3, 75);
                GuildList.SetColumnWidth(4, 0);

                TimerList.SetColumnWidth(1, width - 215);
                TimerList.SetColumnWidth(2, 45);
                TimerList.SetColumnWidth(3, 75);
                TimerList.SetColumnWidth(4, 0);

                PortalList.SetColumnWidth(1, width - 215);
                PortalList.SetColumnWidth(2, 45);
                PortalList.SetColumnWidth(3, 75);
                PortalList.SetColumnWidth(4, 0);

                CorpseList.SetColumnWidth(1, width - 215);
                CorpseList.SetColumnWidth(2, 45);
                CorpseList.SetColumnWidth(3, 75);
                CorpseList.SetColumnWidth(4, 0);

                FriendsList.SetColumnWidth(0, (width - 45) / 2 - 45);
                EnemiesList.SetColumnWidth(0, (width - 45) / 2 - 45);

                Wrapper2.SetControlRect(Tabs2, new Rectangle(45, 100, width - 45, height - 100));

                Rectangle controlRect = Wrapper.GetControlRect(VersusNote);
                Wrapper.SetControlRect(VersusNote, new Rectangle(width - 125, 32, 35, 15));
                controlRect = Wrapper.GetControlRect(GuildNote);
                Wrapper.SetControlRect(GuildNote, new Rectangle(width - 205, 32, 70, 15));
                controlRect = Wrapper.GetControlRect(EnemyNote);
                Wrapper.SetControlRect(EnemyNote, new Rectangle(width - 75, 32, 70, 15));

                controlRect = LogoutLayout.GetControlRect(AddFriend);
                LogoutLayout.SetControlRect(AddFriend, new Rectangle((width - 45) / 2 - 40, height - 125, 40, 15));
                controlRect = LogoutLayout.GetControlRect(AddEnemy);
                LogoutLayout.SetControlRect(AddEnemy, new Rectangle(width - 85, height - 125, 40, 15));
                controlRect = LogoutLayout.GetControlRect(Friend);
                LogoutLayout.SetControlRect(Friend, new Rectangle(4, height - 125, (width - 45) / 2 - 45, 15));
                controlRect = LogoutLayout.GetControlRect(Enemy);
                LogoutLayout.SetControlRect(Enemy, new Rectangle((width - 45) / 2 + 5, height - 125, (width - 45) / 2 - 45, 15));

                controlRect = LogoutLayout.GetControlRect(FriendsNote);
                LogoutLayout.SetControlRect(FriendsNote, new Rectangle(5, 0, (width / 2) - 5, 15));
                controlRect = LogoutLayout.GetControlRect(EnemiesNote);
                LogoutLayout.SetControlRect(EnemiesNote, new Rectangle((width / 2) + 5, 0, (width / 2) - 5, 15));

                controlRect = AlertLayout.GetControlRect(AudioNote);
                AlertLayout.SetControlRect(AudioNote, new Rectangle(5, 5, width - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertSPK);
                AlertLayout.SetControlRect(AlertSPK, new Rectangle(5, 25, ((width - 45) / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertSS);
                AlertLayout.SetControlRect(AlertSS, new Rectangle(((width - 45) / 2) + 10, 25, (width / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertOdds);
                AlertLayout.SetControlRect(AlertOdds, new Rectangle(5, 45, ((width - 45) / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertBc);
                AlertLayout.SetControlRect(AlertBc, new Rectangle(((width - 45) / 2) + 10, 45, (width / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertDT);
                AlertLayout.SetControlRect(AlertDT, new Rectangle(5, 65, ((width - 45) / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertPKT);
                AlertLayout.SetControlRect(AlertPKT, new Rectangle(((width - 45) / 2) + 10, 65, (width / 2) - 10, 20));

                controlRect = AlertLayout.GetControlRect(TextNote);
                AlertLayout.SetControlRect(TextNote, new Rectangle(5, 85, width - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertPA);
                AlertLayout.SetControlRect(AlertPA, new Rectangle(5, 105, ((width - 45) / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertPF);
                AlertLayout.SetControlRect(AlertPF, new Rectangle(5, 125, ((width - 45) / 2) - 10, 20));
                controlRect = AlertLayout.GetControlRect(AlertLogP);
                AlertLayout.SetControlRect(AlertLogP, new Rectangle(((width - 45) / 2) + 10, 105, ((width - 45) / 2) - 10, controlRect.Height));
                controlRect = AlertLayout.GetControlRect(AlertDA);
                AlertLayout.SetControlRect(AlertDA, new Rectangle(((width - 45) / 2) + 10, 125, ((width - 45) / 2) - 10, controlRect.Height));
                controlRect = AlertLayout.GetControlRect(AlertLS);
                AlertLayout.SetControlRect(AlertLS, new Rectangle(5, 145, ((width - 45) / 2) - 10, 20));

                controlRect = AlertLayout.GetControlRect(SaveSettings2);
                AlertLayout.SetControlRect(SaveSettings2, new Rectangle(0, height - 107, width - 45 - 60, 15));
                controlRect = AlertLayout.GetControlRect(ResetAlarms);
                AlertLayout.SetControlRect(ResetAlarms, new Rectangle(width - 45 - 60, height - 107, 60, 15));

                controlRect = SentryLayout.GetControlRect(ElementLbl);
                SentryLayout.SetControlRect(ElementLbl, new Rectangle(5, 5, 60, 20));
                controlRect = SentryLayout.GetControlRect(BehaviourLbl);
                SentryLayout.SetControlRect(BehaviourLbl, new Rectangle((width - 45) / 2 + 5, 5, 60, 20));

                controlRect = SentryLayout.GetControlRect(Element);
                SentryLayout.SetControlRect(Element, new Rectangle(5, 25, (width - 45) / 2 - 10, 20));
                controlRect = SentryLayout.GetControlRect(Behaviour);
                SentryLayout.SetControlRect(Behaviour, new Rectangle((width - 45) / 2 + 5, 25, (width - 45) / 2 - 10, 20));

                controlRect = SentryLayout.GetControlRect(Ticker);
                SentryLayout.SetControlRect(Ticker, new Rectangle(5, 45, 60, 15));
                controlRect = SentryLayout.GetControlRect(TickerNote);
                SentryLayout.SetControlRect(TickerNote, new Rectangle(70, 45, (width - 45) / 2 - 45, 15));
                controlRect = SentryLayout.GetControlRect(TickerNote2);
                SentryLayout.SetControlRect(TickerNote2, new Rectangle(5, 60, width - 45, 15));

                controlRect = SentryLayout.GetControlRect(Range);
                SentryLayout.SetControlRect(Range, new Rectangle(5, 85, 30, 15));
                controlRect = SentryLayout.GetControlRect(RangeNote);
                SentryLayout.SetControlRect(RangeNote, new Rectangle(40, 85, 120, 15));

                controlRect = SentryLayout.GetControlRect(Timer);
                SentryLayout.SetControlRect(Timer, new Rectangle(5, 105, 30, 15));
                controlRect = SentryLayout.GetControlRect(TimerNote);
                SentryLayout.SetControlRect(TimerNote, new Rectangle(40, 105, 120, 15));

                controlRect = SentryLayout.GetControlRect(Comps);
                SentryLayout.SetControlRect(Comps, new Rectangle(5, 125, 30, 15));
                controlRect = SentryLayout.GetControlRect(TapersNote);
                SentryLayout.SetControlRect(TapersNote, new Rectangle(40, 125, 120, 15));

                controlRect = SentryLayout.GetControlRect(Slots);
                SentryLayout.SetControlRect(Slots, new Rectangle(5, 145, 30, 15));
                controlRect = SentryLayout.GetControlRect(SlotsNote);
                SentryLayout.SetControlRect(SlotsNote, new Rectangle(40, 145, 120, 15));



                controlRect = SentryLayout.GetControlRect(UseMacroLogic);
                SentryLayout.SetControlRect(UseMacroLogic, new Rectangle((width - 45) / 2 + 5, 85, (width - 45) / 2 - 10, 15));
                controlRect = SentryLayout.GetControlRect(UseLogDie);
                SentryLayout.SetControlRect(UseLogDie, new Rectangle((width - 45) / 2 + 5, 105, (width - 45) / 2 - 10, 15));

                controlRect = SentryLayout.GetControlRect(SaveSettings3);
                SentryLayout.SetControlRect(SaveSettings3, new Rectangle(0, height - 107, width - 45 - 60, 15));
                controlRect = SentryLayout.GetControlRect(ResetOptions);
                SentryLayout.SetControlRect(ResetOptions, new Rectangle(width - 45 - 60, height - 107, 60, 15));

                controlRect = Wrapper.GetControlRect(Die);
                Wrapper.SetControlRect(Die, new Rectangle(0, height - 15, 40, 15));
                controlRect = Wrapper.GetControlRect(IgnoreVP);
                Wrapper.SetControlRect(IgnoreVP, new Rectangle(40, height - 15, 40, 15));
                controlRect = Wrapper.GetControlRect(Fixbusy);
                Wrapper.SetControlRect(Fixbusy, new Rectangle(80, height - 15, 40, 15));
                controlRect = Wrapper.GetControlRect(Loc);
                Wrapper.SetControlRect(Loc, new Rectangle(120, height - 15, 40, 15));

                controlRect = Wrapper.GetControlRect(ModeLbl);
                Wrapper.SetControlRect(ModeLbl, new Rectangle(165, height - 15, 35, 15));
                controlRect = Wrapper.GetControlRect(Mode);
                Wrapper.SetControlRect(Mode, new Rectangle(200, height - 15, width - 190, 15));

                controlRect = Wrapper.GetControlRect(Imperil);
                Wrapper.SetControlRect(Imperil, new Rectangle(0, 0, 40, 15));
                controlRect = Wrapper.GetControlRect(Bludge);
                Wrapper.SetControlRect(Bludge, new Rectangle(40, 0, 40, 15));
                controlRect = Wrapper.GetControlRect(Slash);
                Wrapper.SetControlRect(Slash, new Rectangle(80, 0, 40, 15));
                controlRect = Wrapper.GetControlRect(Pierce);
                Wrapper.SetControlRect(Pierce, new Rectangle(120, 0, 40, 15));
                controlRect = Wrapper.GetControlRect(Light);
                Wrapper.SetControlRect(Light, new Rectangle(0, 15, 40, 15));
                controlRect = Wrapper.GetControlRect(Acid);
                Wrapper.SetControlRect(Acid, new Rectangle(40, 15, 40, 15));
                controlRect = Wrapper.GetControlRect(Fire);
                Wrapper.SetControlRect(Fire, new Rectangle(80, 15, 40, 15));
                controlRect = Wrapper.GetControlRect(Cold);
                Wrapper.SetControlRect(Cold, new Rectangle(120, 15, 40, 15));

                controlRect = Wrapper.GetControlRect(Stam);
                Wrapper.SetControlRect(Stam, new Rectangle(200, 0, 40, 15));
                controlRect = Wrapper.GetControlRect(Harm);
                Wrapper.SetControlRect(Harm, new Rectangle(200, 15, 40, 15));
                controlRect = Wrapper.GetControlRect(Tag);
                Wrapper.SetControlRect(Tag, new Rectangle(240, 0, width - 240, 30));

                controlRect = AdminLayout.GetControlRect(AdminNote);
                AdminLayout.SetControlRect(AdminNote, new Rectangle(5, 5, width - 50, 15));
                controlRect = AdminLayout.GetControlRect(ForcelogNote);
                AdminLayout.SetControlRect(ForcelogNote, new Rectangle(5, 35, 100, 15));
                controlRect = AdminLayout.GetControlRect(ForcelogBox);
                AdminLayout.SetControlRect(ForcelogBox, new Rectangle(5, 55, width - 110, 15));
                controlRect = AdminLayout.GetControlRect(ForcelogButton);
                AdminLayout.SetControlRect(ForcelogButton, new Rectangle(0, 85, (width - 50) / 2, 15));
                controlRect = AdminLayout.GetControlRect(ForceRelogButton);
                AdminLayout.SetControlRect(ForceRelogButton, new Rectangle((width - 50) / 2, 85, (width - 50) / 2, 15));

                controlRect = AdminLayout.GetControlRect(ForcelocButton);
                AdminLayout.SetControlRect(ForcelocButton, new Rectangle(0, 105, (width - 50) / 2, 15));
                controlRect = AdminLayout.GetControlRect(ForcedieButton);
                AdminLayout.SetControlRect(ForcedieButton, new Rectangle((width - 50) / 2, 105, (width - 50) / 2, 15));

                controlRect = Wrapper.GetControlRect(Strength);
                Wrapper.SetControlRect(Strength, new Rectangle(0, 50, 20, 20));
                controlRect = Wrapper.GetControlRect(Endurance);
                Wrapper.SetControlRect(Endurance, new Rectangle(20, 50, 20, 20));
                controlRect = Wrapper.GetControlRect(Coordination);
                Wrapper.SetControlRect(Coordination, new Rectangle(0, 70, 20, 20));
                controlRect = Wrapper.GetControlRect(Quickness);
                Wrapper.SetControlRect(Quickness, new Rectangle(20, 70, 20, 20));
                controlRect = Wrapper.GetControlRect(Focus);
                Wrapper.SetControlRect(Focus, new Rectangle(0, 90, 20, 20));
                controlRect = Wrapper.GetControlRect(Willpower);
                Wrapper.SetControlRect(Willpower, new Rectangle(20, 90, 20, 20));

                controlRect = Wrapper.GetControlRect(Run);
                Wrapper.SetControlRect(Run, new Rectangle(0, 120, 20, 20));
                controlRect = Wrapper.GetControlRect(StamRegen);
                Wrapper.SetControlRect(StamRegen, new Rectangle(20, 120, 20, 20));

                controlRect = Wrapper.GetControlRect(Creature);
                Wrapper.SetControlRect(Creature, new Rectangle(0, 150, 20, 20));
                controlRect = Wrapper.GetControlRect(Life);
                Wrapper.SetControlRect(Life, new Rectangle(20, 150, 20, 20));
                controlRect = Wrapper.GetControlRect(War);
                Wrapper.SetControlRect(War, new Rectangle(0, 170, 20, 20));
                controlRect = Wrapper.GetControlRect(MagicD);
                Wrapper.SetControlRect(MagicD, new Rectangle(20, 170, 20, 20));
                controlRect = Wrapper.GetControlRect(HeavyW);
                Wrapper.SetControlRect(HeavyW, new Rectangle(0, 190, 20, 20));
                controlRect = Wrapper.GetControlRect(MelD);
                Wrapper.SetControlRect(MelD, new Rectangle(20, 190, 20, 20));
                controlRect = Wrapper.GetControlRect(MissW);
                Wrapper.SetControlRect(MissW, new Rectangle(0, 210, 20, 20));
                controlRect = Wrapper.GetControlRect(MissD);
                Wrapper.SetControlRect(MissD, new Rectangle(20, 210, 20, 20));
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }