EvaluatorWindow.fillDialog C# (CSharp) 메소드

fillDialog() 개인적인 메소드

private fillDialog ( ) : void
리턴 void
    private void fillDialog()
    {
        entry_name.Text = eval.Name;
        entry_email.Text = eval.Email;

        Console.Write(creating.ToString());
        if(creating)
            label_date.Text = Catalog.GetString(Constants.UndefinedDefault);
        else {
            dateTime = eval.DateBorn;
            if(dateTime == DateTime.MinValue)
                label_date.Text = Catalog.GetString(Constants.UndefinedDefault);
            else
                label_date.Text = dateTime.ToLongDateString();
        }

        if(! creating) {
            //country stuff
            if(eval.CountryID != Constants.CountryUndefinedID) {
                string [] countryString = SqliteCountry.Select(eval.CountryID);
                combo_continents.Active = UtilGtk.ComboMakeActive(continentsTranslated,
                        Catalog.GetString(countryString[3]));
                combo_countries.Active = UtilGtk.ComboMakeActive(countriesTranslated,
                        Catalog.GetString(countryString[1]));
            }

            label_confiable.Text = eval.Confiable.ToString();

            TextBuffer tb = new TextBuffer (new TextTagTable());
            tb.Text = eval.Comments;
            textview_comments.Buffer = tb;

            switch(eval.Chronometer) {
                case "":
                case Constants.UndefinedDefault:
                    radio_cp_undef.Active = true;
                    break;
                case Constants.ChronometerCp1:
                    radio_cp1.Active = true;
                    break;
                case Constants.ChronometerCp2:
                    radio_cp2.Active = true;
                    break;
                case Constants.ChronometerCp3:
                    radio_cp3.Active = true;
                    break;
                default:
                    radio_cp_other.Active = true;
                    entry_cp_other.Text = eval.Chronometer;
                    break;
            }

            switch(eval.Device) {
                case "":
                case Constants.UndefinedDefault:
                    radio_device_undef.Active = true;
                    break;
                case Constants.DeviceContactSteel:
                    radio_contact_steel.Active = true;
                    break;
                case Constants.DeviceContactCircuit:
                    radio_contact_modular.Active = true;
                    break;
                case Constants.DeviceInfrared:
                    radio_infrared.Active = true;
                    break;
                default:
                    radio_device_other.Active = true;
                    entry_device_other.Text = eval.Device;
                    break;
            }
        }

        //show or hide button_accept
        on_entries_required_changed(new object(), new EventArgs());
    }

Usage Example

예제 #1
0
    static public EvaluatorWindow Show(ServerEvaluator eval)
    {
        if (EvaluatorWindowBox == null)
        {
            EvaluatorWindowBox = new EvaluatorWindow(eval);
        }
        EvaluatorWindowBox.evaluator_window.Show();

        EvaluatorWindowBox.fillDialog();


        return(EvaluatorWindowBox);
    }