Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel, false);

            ICommonFactory myICommonFactory = (ICommonFactory)Activator.GetObject(
                typeof(ICommonFactory),
                "http://localhost:1234/_Server_");

            myICommon = myICommonFactory.getNewInstance();
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel, false);

            ICommonFactory myICommonFactory = (ICommonFactory)Activator.GetObject(
                typeof(ICommonFactory),
                "http://localhost:1234/_Server_");

            myICommon = myICommonFactory.getNewInstance();

            arrControls = new Control[25];
            int currPosition = 3;

            for (int i = 0; i < arrControls.Length; i++)
            {
                if (myRand.Next(2) == 0)
                {
                    arrControls[i] = new Button();
                }
                else
                {
                    arrControls[i] = new Label();
                }
                switch (myRand.Next(3))
                {
                case 0: arrControls[i].BackColor = Color.FromArgb(myRand.Next(130, 256), 0, 0); break;

                case 1: arrControls[i].BackColor = Color.FromArgb(0, myRand.Next(130, 256), 0); break;

                case 2: arrControls[i].BackColor = Color.FromArgb(0, 0, myRand.Next(130, 256)); break;
                }
                arrControls[i].TabIndex = i;
                arrControls[i].Size     = new Size(40, 40);
                arrControls[i].Location = new Point(currPosition, 3);
                currPosition           += arrControls[i].Size.Width + 2;
                arrControls[i].Click   += new EventHandler(allControls_Click);
                this.Controls.Add(arrControls[i]);
            }
        }
Ejemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel, false);

            ICommonFactory myICommonFactory = (ICommonFactory)Activator.GetObject(
                typeof(ICommonFactory),
                "http://localhost:1234/_Server_");

            myICommon = myICommonFactory.getNewInstance();


            this.Text    = "Nim";
            last         = toolS5;
            last.Checked = true;
            val          = myICommon.numOfPens();
            UCnum        = myICommon.randPens();
            newGame(val, UCnum);
        }