コード例 #1
0
        public JavaScriptGenerator()
        {                                    
            Writers = new Dictionary<Type, IJavaScriptGenerator>();

            Writers[typeof(SimpleParameterEvaluator)] = new SimpleParameterGenerator();
            Writers[typeof(ReflectionParameterEvaluator)] = new ReflectionParameterGenerator();
            Writers[typeof(PatternLookupEvaluator)] = new PatternLookupGenerator();
            Writers[typeof(StringFormatFormatter)] = new StringFormatGenerator();
            Writers[typeof(DefaultFormatter)] = new DefaultGenerator();
            Writers[typeof(StringCaseFormatter)] = new StringCaseGenerator();

            Writers[typeof(TakeAllCondition)] = new TakeAllGenerator();
            Writers[typeof(SingleValueCondition<double>)] = new SingleValueGenerator<double>();
            Writers[typeof(SingleValueCondition<string>)] = new SingleValueGenerator<string>();
            Writers[typeof(ValueListCondition<double>)] = new ValueListGenerator<double>();
            Writers[typeof(ValueListCondition<string>)] = new ValueListGenerator<string>();
            Writers[typeof(IntervalCondition<double>)] = new IntervalGenerator<double>();
            Writers[typeof(IntervalCondition<TimeSpan>)] = new TimespanIntervalWriter();
            Writers[typeof(BooleanExpressionCondition)] = new BooleanExpressionGenerator();
            Writers[typeof(ArithmeticCondition)] = new ArithmeticGenerator();

            Writers[typeof(BooleanExpressionCondition)] = new BooleanExpressionGenerator();
            Writers[typeof(LookupCondition)] = new LookupGenerator();

            Writers[typeof(HashTagFormatGroupExpander)] = new HashTagFormatGroupExpanderGenerator();

        }
コード例 #2
0
        public JavaScriptGenerator()
        {
            Writers = new Dictionary <Type, IJavaScriptGenerator>();

            Writers[typeof(SimpleParameterEvaluator)]     = new SimpleParameterGenerator();
            Writers[typeof(ReflectionParameterEvaluator)] = new ReflectionParameterGenerator();
            Writers[typeof(PatternLookupEvaluator)]       = new PatternLookupGenerator();
            Writers[typeof(StringFormatFormatter)]        = new StringFormatGenerator();
            Writers[typeof(DefaultFormatter)]             = new DefaultGenerator();
            Writers[typeof(StringCaseFormatter)]          = new StringCaseGenerator();

            Writers[typeof(TakeAllCondition)] = new TakeAllGenerator();
            Writers[typeof(SingleValueCondition <double>)] = new SingleValueGenerator <double>();
            Writers[typeof(SingleValueCondition <string>)] = new SingleValueGenerator <string>();
            Writers[typeof(ValueListCondition <double>)]   = new ValueListGenerator <double>();
            Writers[typeof(ValueListCondition <string>)]   = new ValueListGenerator <string>();
            Writers[typeof(IntervalCondition <double>)]    = new IntervalGenerator <double>();
            Writers[typeof(IntervalCondition <TimeSpan>)]  = new TimespanIntervalWriter();
            Writers[typeof(BooleanExpressionCondition)]    = new BooleanExpressionGenerator();
            Writers[typeof(ArithmeticCondition)]           = new ArithmeticGenerator();

            Writers[typeof(BooleanExpressionCondition)] = new BooleanExpressionGenerator();
            Writers[typeof(LookupCondition)]            = new LookupGenerator();

            Writers[typeof(HashTagFormatGroupExpander)] = new HashTagFormatGroupExpanderGenerator();
        }
コード例 #3
0
        private void NextExercise()
        {
            this.HideSecondNote();
            this.AddPointerToFirstNote();

            IntervalGenerator intervalGenerator = new IntervalGenerator();
            this.ActualInterval = intervalGenerator.GenerateIntervalWithTones();
            this.QuestionInterval.InnerText = this.ActualInterval.GeneralInterval.ToString();
            this.QuestionInterval.Attributes.Add("title",
                this.WholeIntervalAdjective(this.ActualInterval.GeneralInterval.adjective) + " " +
                this.WholeIntervalNumeral(this.ActualInterval.GeneralInterval.numeral));
            this.Tone1Index.Value = ToneGraph.GetReferenceToneIndex(this.ActualInterval.Tone1).ToString();

            StaveObjectsPosition sop = new StaveObjectsPosition(226, 30);
            Tuple<Point, Point, Point> notePosition = sop.DrawNote(this.ActualInterval.Tone1, 240);

            this.ChangePositionOfNote(notePosition, this.Note1, this.LedgerLine1, this.SharpFlatSymbol1,
                                      this.ActualInterval.Tone1);
        }
コード例 #4
0
        private Tone GetNextToneToDisplay()
        {
            int actualNoteIndex = Convert.ToInt32(this.ActualNoteIndex.Value);

            if (this.ActualNoteIndex.Value.Equals(""))
            {
                return null;
            }

            if (this.PreviousTone.Value.Equals(""))
            {
                return this.ActualScale.StartingTone;
            }

            Tone tonePrev = ToneGraph.GetToneByName(this.PreviousTone.Value);

            int halftoneNumber;
            if (this.ActualScale.Type.Equals("dur"))
            {
                halftoneNumber = durIntervals[actualNoteIndex - 2];
            }
            else
            {
                halftoneNumber = molIntervals[actualNoteIndex - 2];
            }

            IntervalGenerator intervalGenerator = new IntervalGenerator();
            GeneralInterval interval = intervalGenerator.GetIntervalByNumeralAndNumberOfHalftones(2, halftoneNumber);
            return intervalGenerator.ComputeSecondToneOfInterval(tonePrev, interval);
        }
コード例 #5
0
ファイル: Default.aspx.cs プロジェクト: Desann36/MusicTheory
        private void NextExercise()
        {
            this.clearAnswerLabels();
            this.ChangeBackgroundOfAnswerButtons("#8C8C8C");
            IntervalGenerator intervalGenerator = new IntervalGenerator();
            ActualInterval = intervalGenerator.GenerateIntervalWithTones();

            StaveObjectsPosition sop = new StaveObjectsPosition(226, 30);
            Tuple<Point, Point, Point>[] notesPosition = sop.DrawInterval(ActualInterval, 240);

            this.ChangePositionOfNote(notesPosition[0], this.Note1, this.LedgerLine1, this.SharpFlatSymbol1,
                                      this.ActualInterval.Tone1);
            this.ChangePositionOfNote(notesPosition[1], this.Note2, this.LedgerLine2, this.SharpFlatSymbol2,
                                      this.ActualInterval.Tone2);
        }