Exemplo n.º 1
0
        private void Compute()
        {
            this.mList.BeginUpdate();
            this.mList.Clear();

            this.mList.BackColor = Color.AliceBlue;


            this.mList.Columns.Add("Body", -1, System.Windows.Forms.HorizontalAlignment.Left);
            this.mList.Columns.Add("Winner", -1, System.Windows.Forms.HorizontalAlignment.Left);

            int winner = 0;

            if (this.cbRasi1.SelectedIndex < 0)
            {
                this.cbRasi1.SelectedIndex = 0;
            }
            if (this.cbRasi2.SelectedIndex < 0)
            {
                this.cbRasi2.SelectedIndex = 0;
            }

            ZodiacHouse.Name z1 = (ZodiacHouse.Name) this.cbRasi1.SelectedIndex + 1;
            ZodiacHouse.Name z2 = (ZodiacHouse.Name) this.cbRasi2.SelectedIndex + 1;

            ArrayList al = this.GetRules();

            for (int i = 0; i < al.Count; i++)
            {
                ArrayList rule = new ArrayList();
                rule.Add(al[i]);
                FindStronger     fs = new FindStronger(h, options.Division, rule);
                ZodiacHouse.Name zw = fs.StrongerRasi(z1, z2, false, ref winner);
                ListViewItem     li = new ListViewItem();
                li.Text = string.Format("{0}", EnumDescConverter.GetEnumDescription((System.Enum)al[i]));

                if (winner == 0)
                {
                    li.SubItems.Add(string.Format("{0}", zw));
                }

                this.mList.Items.Add(li);
            }

            this.mList.Columns[0].Width = -1;
            this.mList.Columns[1].Width = -2;

            this.mList.EndUpdate();
        }
Exemplo n.º 2
0
        private void Compute()
        {
            this.mList.BeginUpdate();
            this.mList.Clear();

            this.mList.BackColor = Color.AliceBlue;


            this.mList.Columns.Add("Body", -1, System.Windows.Forms.HorizontalAlignment.Left);
            this.mList.Columns.Add("Winner", -1, System.Windows.Forms.HorizontalAlignment.Left);

            int winner = 0;

            Body.Name b1 = (Body.Name) this.cbGraha1.SelectedIndex;
            Body.Name b2 = (Body.Name) this.cbGraha2.SelectedIndex;

            bool      bSimpleLord = false;
            ArrayList al          = this.GetRules(ref bSimpleLord);

            for (int i = 0; i < al.Count; i++)
            {
                ArrayList rule = new ArrayList();
                rule.Add(al[i]);
                FindStronger fs = new FindStronger(h, options.Division, rule);
                Body.Name    bw = fs.StrongerGraha(b1, b2, bSimpleLord, ref winner);

                ListViewItem li = new ListViewItem();
                li.Text = string.Format("{0}", EnumDescConverter.GetEnumDescription((System.Enum)al[i]));

                if (winner == 0)
                {
                    li.SubItems.Add(Body.toString(bw));
                }

                this.mList.Items.Add(li);
            }

            this.mList.Columns[0].Width = -1;
            this.mList.Columns[1].Width = -2;

            this.mList.EndUpdate();
        }