Exemple #1
0
 /// /////////////////////////////////////////
 private void InitAffichage()
 {
     m_panelVueHierarchique.Visible = !m_bModeListe;
     base.m_panelListe.Visible      = m_bModeListe;
     if (!m_bModeListe)
     {
         if (m_arbre.Nodes.Count == 0)
         {
             FillNode(null);
         }
         m_panelVueHierarchique.BringToFront();
     }
     else
     {
         base.m_panelListe.BringToFront();
     }
     m_chkVueArbre.BringToFront();
     m_chkVueListe.BringToFront();
     m_panelVues.BringToFront();
 }
Exemple #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                LayoutHelper.NaturalizeHeightAndDistribute(8, Controls);
                linkLabelDownloadPlugins.Top = pictureBoxAddPlugin.Top + 1;
                LayoutHelper.NaturalizeHeight(linkLabelPluginName);
                DisplayHelper.AutoFitSystemRadioButton(radioButtonEnablePlugin, 0, int.MaxValue);
                DisplayHelper.AutoFitSystemRadioButton(radioButtonDisablePlugin, 0, int.MaxValue);
                radioButtonEnablePlugin.BringToFront();
                DisplayHelper.AutoFitSystemButton(buttonOptions);
            }
        }
        public void CreateGUI()
        {
            this.MetaTab.Controls.Clear();
            int num = 0;
            int num2 = 0;
            int arg_25_0 = 0;
            checked
            {
                int num3 = [email protected] - 1;
                for (int i = arg_25_0; i <= num3; i++)
                {
                    GroupBox groupBox = new GroupBox();
                    groupBox.Text = this.@struct[i].name;
                    groupBox.Name = this.@struct[i].name + "GroupBox";
                    Point location;
                    int j;
                    if (!(this.@struct[i].name.Equals("Main")))
                    {
                        ComboBox comboBox = new ComboBox();
                        Label label = new Label();
                        label.Text = this.@struct[i].name;
                        Control arg_C2_0 = label;
                        location = new Point(2, num);
                        arg_C2_0.Location = location;
                        label.Width = this.@struct[i].name.Length * 7;
                        comboBox.Name = this.@struct[i].name + "ComboBox";
                        Control arg_11F_0 = comboBox;
                        location = new Point(label.Width + 10, num);
                        arg_11F_0.Location = location;
                        comboBox.SelectedIndexChanged += new EventHandler(this.somethingChanged);
                        comboBox.Click += new EventHandler(this.SetUserDidIt);
                        this.MetaTab.Controls.Add(label);
                        this.MetaTab.Controls.Add(comboBox);
                        int arg_188_0 = 0;
                        int num4 = this.@struct[0].values.Length - 1;
                        for (j = arg_188_0; j <= num4; j++)
                        {
                            if (this.@struct[i].name.Equals(this.@struct[0].values[j].name) & this.@struct[0].values[j].type.Equals("reflexive"))
                            {
                                int arg_212_0 = 0;
                                int num5 = this.@struct[0].values[j].count - 1;
                                for (int k = arg_212_0; k <= num5; k++)
                                {
                                    comboBox.Items.Add(k);
                                }

                            }
                        }

                        num += 25;
                    }

                    Control arg_252_0 = groupBox;
                    location = new Point(2, num);
                    arg_252_0.Location = location;
                    int x = 10;
                    int num6 = 15;
                    int arg_277_0 = 0;
                    int num7 = this.@struct[i].values.Length - 1;
                    j = arg_277_0;
                    Size size;
                    while (j <= num7)
                    {
                        string type = this.@struct[i].values[j].type;
                        if (type.Equals("float"))
                        {
                            goto IL_2E2;
                        }

                        if (type.Equals("string32"))
                        {
                            goto IL_2E2;
                        }

                        if (type.Equals("integer"))
                        {
                            goto IL_2E2;
                        }

                        if (type.Equals("short"))
                        {
                            goto IL_2E2;
                        }

                        if (type.Equals("id32") || type.Equals("id16"))
                        {
                            GroupBox groupBox2 = new GroupBox();
                            groupBox2.Tag = this.@struct[i].values[j].offset;
                            groupBox2.Name = this.@struct[i].values[j].name.Replace(" ", "") + "Group";
                            groupBox2.Text = this.@struct[i].values[j].name;
                            groupBox2.Width = this.MetaTab.Width - 20;
                            groupBox2.Height = 20 + (this.@struct[i].values[j].offset_options.Length / 2 + this.@struct[i].values[j].offset_options.Length % 2) * 16;
                            Control arg_5BD_0 = groupBox2;
                            location = new Point(x, num6);
                            arg_5BD_0.Location = location;
                            groupBox2.TabIndex = num2;
                            num2++;
                            int x2 = 10;
                            int num8 = 15;
                            int arg_5F9_0 = 0;
                            int num9 = this.@struct[i].values[j].offset_options.Length - 1;
                            for (int k = arg_5F9_0; k <= num9; k++)
                            {
                                RadioButton radioButton = new RadioButton();
                                radioButton.Name = this.@struct[i].values[j].offset_options[k].op_name.Replace(" ", "") + "RadioButton";
                                radioButton.Text = this.@struct[i].values[j].offset_options[k].op_name;
                                radioButton.Tag = this.@struct[i].values[j].offset_options[k].op_value;
                                if (Operators.ConditionalCompareObjectEqual(this.@struct[i].values[j].offset_options[k].op_value, this.@struct[i].values[j].data, false))
                                {
                                    radioButton.Checked = true;
                                }

                                else
                                {
                                    radioButton.Checked = false;
                                }

                                Control arg_71F_0 = radioButton;
                                location = new Point(x2, num8);
                                arg_71F_0.Location = location;
                                Control arg_742_0 = radioButton;
                                size = new Size(radioButton.Name.Length * 5 + 15, 15);
                                arg_742_0.Size = size;
                                radioButton.TabIndex = num2 + k;
                                radioButton.CheckedChanged += new EventHandler(this.somethingChanged);
                                groupBox2.Controls.Add(radioButton);
                                radioButton.BringToFront();
                                if (k % 2 == 1)
                                {
                                    x2 = 10;
                                    num8 += 15;
                                }

                                else
                                {
                                    x2 = (int)Math.Round((double)this.MetaTab.Width / 2.0);
                                }

                            }
                            groupBox.Controls.Add(groupBox2);
                            num6 += groupBox2.Height;
                            x = 10;
                            num2 += this.@struct[i].values[j].offset_options.Length;
                        }

                        else
                        {
                            if (type.Equals("bitmask32"))
                            {
                                GroupBox groupBox3 = new GroupBox();
                                groupBox3.Tag = this.@struct[i].values[j].offset;
                                groupBox3.Name = this.@struct[i].values[j].name.Replace(" ", "") + "Group";
                                groupBox3.Text = this.@struct[i].values[j].name;
                                groupBox3.Width = this.MetaTab.Width - 20;
                                groupBox3.Height = 20 + (this.@struct[i].values[j].offset_options.Length / 2 + this.@struct[i].values[j].offset_options.Length % 2) * 16;
                                groupBox3.TabIndex = num2;
                                Control arg_916_0 = groupBox3;
                                location = new Point(x, num6);
                                arg_916_0.Location = location;
                                int x2 = 10;
                                int num8 = 15;
                                num2++;
                                int arg_94A_0 = 0;
                                int num10 = this.@struct[i].values[j].offset_options.Length - 1;
                                for (int k = arg_94A_0; k <= num10; k++)
                                {
                                    CheckBox checkBox = new CheckBox();
                                    checkBox.Name = this.@struct[i].values[j].offset_options[k].op_name.Replace(" ", "") + "CheckBox";
                                    checkBox.Text = this.@struct[i].values[j].offset_options[k].op_name;
                                    checkBox.Tag = this.@struct[i].values[j].offset_options[k].op_value;
                                    Control arg_A0E_0 = checkBox;
                                    location = new Point(x2, num8);
                                    arg_A0E_0.Location = location;
                                    Control arg_A31_0 = checkBox;
                                    size = new Size(checkBox.Name.Length * 5 + 15, 15);
                                    arg_A31_0.Size = size;
                                    checkBox.TabIndex = num2 + k;
                                    if (this.@struct[i].values[j].data != null)
                                    {
                                        object arg_ADE_0 = this.@struct[i].values[j].data;
                                        Type arg_ADE_1 = null;
                                        string arg_ADE_2 = "BitOn";
                                        object[] array = new object[1];
                                        object[] arg_AC6_0 = array;
                                        int arg_AC6_1 = 0;
                                        XMLMain.TAG_STRUCT[] arg_A99_0 = this.@struct;
                                        int num11 = i;
                                        XMLMain.VALUE_STRUCT[] arg_AA8_0 = arg_A99_0[num11].values;
                                        int num12 = j;
                                        XMLMain.OFFSET_OPTIONS[] arg_AB7_0 = arg_AA8_0[num12].offset_options;
                                        int num13 = k;
                                        arg_AC6_0[arg_AC6_1] = arg_AB7_0[num13].op_value;
                                        object[] array2 = array;
                                        object[] arg_ADE_3 = array2;
                                        string[] arg_ADE_4 = null;
                                        Type[] arg_ADE_5 = null;
                                        bool[] array3 = new bool[]
                                        {
                                            true
                                        };
                                        object arg_B35_0 = NewLateBinding.LateGet(arg_ADE_0, arg_ADE_1, arg_ADE_2, arg_ADE_3, arg_ADE_4, arg_ADE_5, array3);
                                        if (array3[0])
                                        {
                                            this.@struct[num11].values[num12].offset_options[num13].op_value = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array2[0]), typeof(int));
                                        }

                                        if (Conversions.ToBoolean(arg_B35_0))
                                        {
                                            checkBox.Checked = true;
                                        }

                                    }
                                    checkBox.CheckedChanged += new EventHandler(this.somethingChanged);
                                    groupBox3.Controls.Add(checkBox);
                                    checkBox.BringToFront();
                                    if (k % 2 == 1)
                                    {
                                        x2 = 10;
                                        num8 += 15;
                                    }

                                    else
                                    {
                                        x2 = (int)Math.Round((double)this.MetaTab.Width / 2.0);
                                    }

                                }
                                groupBox.Controls.Add(groupBox3);
                                num6 += groupBox3.Height;
                                num2 += this.@struct[i].values[j].offset_options.Length;
                                x = 10;
                            }

                        }
                    IL_BE9:
                        j++;
                        continue;
                    IL_2E2:
                        TextBox textBox = new TextBox();
                        Label label2 = new Label();
                        textBox.Name = this.@struct[i].values[j].name + "TextBox";
                        textBox.Tag = this.@struct[i].values[j].offset;
                        if (this.@struct[i].values[j].data != null)
                        {
                            textBox.Text = Conversions.ToString(this.@struct[i].values[j].data);
                        }

                        label2.Name = this.@struct[i].values[j].name + "Label";
                        label2.Text = this.@struct[i].values[j].name;
                        label2.TabIndex = num2;
                        textBox.TabIndex = num2 + 1;
                        label2.AutoSize = true;
                        Control arg_404_0 = label2;
                        location = new Point(x, num6);
                        arg_404_0.Location = location;
                        x = (int)Math.Round((double)this.MetaTab.Width / 2.0);
                        Control arg_436_0 = textBox;
                        size = new Size(75, 20);
                        arg_436_0.Size = size;
                        Control arg_44A_0 = textBox;
                        location = new Point(x, num6);
                        arg_44A_0.Location = location;
                        textBox.TextChanged += new EventHandler(this.somethingChanged);
                        groupBox.Controls.Add(label2);
                        groupBox.Controls.Add(textBox);
                        textBox.BringToFront();
                        num6 += 20;
                        x = 10;
                        num2 += 2;
                        goto IL_BE9;
                    }

                    Control arg_C12_0 = groupBox;
                    size = new Size(this.MetaTab.Width - 24, num6 + 5);
                    arg_C12_0.Size = size;
                    num += groupBox.Height;
                    this.MetaTab.Controls.Add(groupBox);
                }

            }
        }
Exemple #4
0
        public void Display(QuestionDescriptor question)
        {
            if (question != null)
              {
            this.question = question;

            this.textControl.Title = question.Text.Text;
            this.textControl.Description = question.Description.Text;
            this.textControl.Url = question.Url.Text;
            this.textControl.BeginInfo();
            this.textControl.InfoFont = new Font("Arial", 12);
            RecalculateLayout();

            this.optionControls = new Dictionary<InfoControl, int>();
            this.optionsPanel.Controls.Clear();

            if (question.MaxOptions == 1)
            {
              this.maxOptionLabel.Text = Resources.VotingDialogMaxOptionSingle;
              this.singleOptionControls = new Dictionary<int, RadioButton>();
              int index = 0;
              int top = Space;

              foreach (OptionDescriptor option in question.Options)
              {
            var optionInfo = AddOptionInfo(index, top, option);

            RadioButton optionControl = new RadioButton();
            optionControl.Text = string.Empty;
            optionControl.Left = Space;
            optionControl.Top = top + BoxTop;
            optionControl.Height = optionInfo.Height;
            optionControl.TextAlign = ContentAlignment.MiddleRight;
            optionControl.Width = BoxWidth;
            this.optionsPanel.Controls.Add(optionControl);
            optionControl.BringToFront();
            optionControl.CheckedChanged += new EventHandler(OptionControl_CheckedChanged);
            this.singleOptionControls.Add(index, optionControl);

            top += optionControl.Height + VerticalSpace;
            index++;
              }
            }
            else
            {
              this.maxOptionLabel.Text = string.Format(Resources.VotingDialogMaxOptionMulti, question.MaxOptions);
              this.multiOptionControls = new Dictionary<int, CheckBox>();
              int index = 0;
              int top = Space;

              foreach (OptionDescriptor option in question.Options)
              {
            if (!option.IsAbstentionSpecial)
            {
              var optionInfo = AddOptionInfo(index, top, option);

              CheckBox optionControl = new CheckBox();
              optionControl.Text = string.Empty;
              optionControl.Top = top + BoxTop;
              optionControl.Width = BoxWidth;
              optionControl.Height = optionInfo.Height;
              optionControl.TextAlign = ContentAlignment.MiddleRight;
              this.optionsPanel.Controls.Add(optionControl);
              optionControl.BringToFront();
              optionControl.CheckedChanged += new EventHandler(OptionControl_CheckedChanged);
              this.multiOptionControls.Add(index, optionControl);

              top += optionControl.Height + VerticalSpace;
            }

            index++;
              }
            }
              }
        }