mardi 30 août 2016

Is it ok to call the method again from inside the method?

Is this ok, I feel like its not right, like im doing a "GOTO", is this ok?

private void myCopySpecial()
{
    TSMUI.Picker myPicker1 = new TSMUI.Picker();
    Component c1 = myPicker1.PickObject(TSMUI.Picker.PickObjectEnum.PICK_ONE_OBJECT) as Component;

    TSMUI.Picker myPicker2 = new TSMUI.Picker();
    Beam fromBeam = myPicker2.PickObject(TSMUI.Picker.PickObjectEnum.PICK_ONE_PART) as Beam;

    if (c1 == null)
    {
        MessageBox.Show("That's not a component? Try again.");
        //User selected something other than a component, start again.
        myCopySpecial();
    }

Aucun commentaire:

Enregistrer un commentaire