コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: ktr-hub/Generics
        public void testMaximum(int a, int b, int c)
        {
            GenericsClass <int> genericsClass = new GenericsClass <int>(a, b, c);
            int expected = 4;
            int result   = genericsClass.maxMethod();

            Assert.AreEqual(expected, result);
        }
コード例 #2
0
ファイル: N3292.cs プロジェクト: zwmyint/Bridge
            public InterfaceDriver(GenericsClass <IInterfaceProbe> errorIfFailed)
            {
                object probe = errorIfFailed;

                // We check here whether the object initializing it is of
                // ClassProbe. We don't check against ClassProbe here
                // even though it inherits due to covariance-related
                // limitations
                Consistent = probe is GenericsClass <IInterfaceProbe>;
            }
コード例 #3
0
ファイル: Index.aspx.cs プロジェクト: efournier92/.NET-Demos
    protected void DisplayValuesButton_Click(object sender, EventArgs e)
    {
        Label.Text = "";
        var ints = new GenericsClass <int>(new int[] { 1, 2, 3, 4, 5 });

        Label.Text = ints.DisplayValues();

        var dubs = new GenericsClass <double>(new double[] { 1.0, -2.3, 3.33, 4.57, 5.8 });

        Label.Text += "<br>" + dubs.DisplayValues();

        var dec = new GenericsClass <decimal>(new decimal[] { 1, 2.1M, 3, 4, 5.45M });

        Label.Text += "<br>" + dec.DisplayValues();
    }
コード例 #4
0
        private void InitializeComponent()
        {
            GenericsClass.CalcAllSceensBounds();
            this.SuspendLayout();

            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = AutoScaleMode.Font;
            this.BackColor           = System.Drawing.Color.Black;
            this.FormBorderStyle     = FormBorderStyle.None;
            this.MaximizeBox         = false;
            this.MinimizeBox         = false;
            this.ShowInTaskbar       = false;
            this.StartPosition       = FormStartPosition.Manual;
            //this.TopMost = true;//this seems to require focus on show

            this.ClientSize = GenericsClass.ScreenBounds.Size;
            this.Location   = GenericsClass.ScreenBounds.Location;
        }