CTCOfficeGUI.TrainGraphic.SetScale C# (CSharp) Méthode

SetScale() public méthode

Sets the scale of the train relative to the screen
Scale is represented as a ratio of the original size to the new size
public SetScale ( double scale ) : bool
scale double Scale to display
Résultat bool
        public bool SetScale(double scale)
        {
            if (scale > 0)
            {
                this.Width = this.Height = System.Convert.ToInt32(scale * m_originalSize);
                picIcon.Size = this.Size;
                return true;
            }
            return false;
        }

Usage Example

 public void SetScaleTest1()
 {
     ITrain train = null; // TODO: Initialize to an appropriate value
     TrainGraphic target = new TrainGraphic(train); // TODO: Initialize to an appropriate value
     double scale = 0F; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.SetScale(scale);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }