コード例 #1
0
        public void CalculateFactorial(int number)
        {
            int result = number;

            for (int i = 1; i < number; i++)
            {
                result = result * i;
            }

            toSend.Invoke(result);
        }
コード例 #2
0
        void getClipboardCallback(SendResult <SaveableClipboard> resultCallback)
        {
            String error = null;

            resultCallback.Invoke(scratchAreaController.Clipboard, ref error);
        }
コード例 #3
0
        void captureButton_MouseButtonClick(Widget source, EventArgs e)
        {
            MedicalState medicalState = new MedicalState("");

            medicalState.update();
            CompoundPresetState compoundPresetState = new CompoundPresetState("", "", "");

            if (leftDisc.Checked)
            {
                DiscPresetState leftDiscPreset = new DiscPresetState("LeftTMJDisc", "", "", "");
                leftDiscPreset.captureFromState(medicalState.Disc.getPosition("LeftTMJDisc"));
                compoundPresetState.addSubState(leftDiscPreset);
            }
            if (rightDisc.Checked)
            {
                DiscPresetState rightDiscPreset = new DiscPresetState("RightTMJDisc", "", "", "");
                rightDiscPreset.captureFromState(medicalState.Disc.getPosition("RightTMJDisc"));
                compoundPresetState.addSubState(rightDiscPreset);
            }
            if (leftFossa.Checked)
            {
                FossaPresetState leftFossaPreset = new FossaPresetState("", "", "");
                leftFossaPreset.captureFromState("LeftFossa", medicalState.Fossa);
                compoundPresetState.addSubState(leftFossaPreset);
            }
            if (rightFossa.Checked)
            {
                FossaPresetState rightFossaPreset = new FossaPresetState("", "", "");
                rightFossaPreset.captureFromState("RightFossa", medicalState.Fossa);
                compoundPresetState.addSubState(rightFossaPreset);
            }
            if (mandible.Checked)
            {
                AnimationManipulatorPresetState animationManipPresetState = new AnimationManipulatorPresetState("", "", "");
                animationManipPresetState.captureFromState(medicalState.BoneManipulator);
                compoundPresetState.addSubState(animationManipPresetState);
                //Need to implement mandible, may be just as easy to support each individual element

                /* bonescalarstateentry
                 * rightRamusHeightMandible
                 * rightAntegonialNotchMandible
                 * rightCondyleHeightMandible
                 * rightCondyleDegenerationMandible
                 * rightMandibularNotchMandible
                 * rightLateralPoleMandible
                 * rightMedialPoleScaleMandible
                 *
                 * leftRamusHeightMandible
                 * leftCondyleHeightMandible
                 * leftAntegonialNotchMandible
                 * leftMandibularNotchMandible
                 * leftCondyleDegenerationMandible
                 * leftLateralPoleMandible
                 * leftMedialPoleScaleMandible
                 */
                /* bonerotator
                 * leftCondyleRotationMandible
                 * rightCondyleRotationMandible
                 */
                /* Pose Manipulator
                 * leftCondyleRoughnessMandible
                 * rightCondyleRoughnessMandible
                 */
            }
            if (teeth.Checked)
            {
                TeethPresetState teethPreset = new TeethPresetState("", "", "");
                teethPreset.captureFromState(medicalState.Teeth);
                compoundPresetState.addSubState(teethPreset);
            }

            String errorPrompt = null;

            resultCallback.Invoke(compoundPresetState, ref errorPrompt);
            this.close();
        }