예제 #1
0
    private void InstantiateTeacher(ChallengePoint challengePoint)
    {
        var instance = Instantiate(challengePoint);

        ChallengePointDefinition definition = challengePointDefinitions.Find(x => x.id == challengePoint.ChallengeToTrigger);

        instance.latitude  = definition.lat;
        instance.longitude = definition.lon;

        liveChallengePoints.Add(instance);
    }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     components     = new System.ComponentModel.Container();
     this.CostLabel = new VLabel();
     this.CurrentLevelIncrementor = new VIncrementor();
     this.bindingSource           = new VBindingSource();
     ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
     //
     // CostLabel
     //
     this.CostLabel.AutoSize = true;
     this.CostLabel.Caption  = "Next Level Cost";
     this.CostLabel.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSource, "NextLevelCost"));
     this.CostLabel.Location  = DPIScalingHelper.GetScaledPoint(140, 29);
     this.CostLabel.Name      = "CostLabel";
     this.CostLabel.TabIndex  = 6;
     this.CostLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // CurrentLevelIncrementor
     //
     this.CurrentLevelIncrementor.Location = DPIScalingHelper.GetScaledPoint(48, 1);
     this.CurrentLevelIncrementor.DataBindings.Add("Value", bindingSource, "CurrentLevel");
     this.CurrentLevelIncrementor.DataBindings.Add("MaxValue", bindingSource, "MaxValue");
     this.CurrentLevelIncrementor.DataBindings.Add("MinValue", bindingSource, "MinValue");
     this.CurrentLevelIncrementor.DisableShiftClick = true;
     this.CurrentLevelIncrementor.IncrementorStyle  = IncrementorStyle.Compact;
     this.CurrentLevelIncrementor.MinValue          = 0;
     this.CurrentLevelIncrementor.IncrementHint     = (x) => ChallengePoint.GetIncrementHint(x);
     this.CurrentLevelIncrementor.DecrementHint     = (x) => ChallengePoint.GetDecrementHint(x);
     //
     // ChallengePointBindingSource
     //
     this.bindingSource.DataSource = typeof(ChallengePoint);
     //
     // VChallengePointControl
     //
     this.Controls.Add(this.CostLabel);
     this.Controls.Add(this.CurrentLevelIncrementor);
     this.Size = DPIScalingHelper.GetScaledSize(160, 50);
     ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit();
 }