Skip to content

Instantly share code, notes, and snippets.

Component.For<IEnvironment>()
.ImplementedBy<BasicEnvironment>()
.OnCreate((kernel, component) =>
{
var benvironment = (BasicEnvironment)component;
GraphicsDeviceManager gman = kernel.Resolve<GraphicsDeviceManager>();
}
Component.For<IEnvironment>()
.ImplementedBy<BasicEnvironment>()
.OnCreate((kernel, component,GraphicsDeviceManager gman) =>
{
var benvironment = (BasicEnvironment)component;
}
class Program
{
static void Main(string[] args)
{
int x=3, y=4;
Assert.That(()=>x==y);
}
}
public class Assert
{
[Test]
public void Can_register_handler_forwarding_with_keys()
{
IKernel kernel = new DefaultKernel();
kernel.Register(
Component.For<IRepository>()
.ImplementedBy<MyRepository>()
.Named("myComponent")
);
kernel.RegisterHandlerForwarding("newComponent","myComponent");
//DOES NOT SHOW THE USERNAME+HELLO IN THE username BOX
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(string username)
{
ViewData["username"] = username + "helloo";
return View();
}
//DOES SHOW THE EMAIL+HELLO IN THE username BOX
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
using System.Runtime.Serialization;
class Thing1
public class SimulationTimeSource : ITimeSource
{
private readonly LiveLab game;
private TimeSpan timeSpan;
public SimulationTimeSource(LiveLab game)
{
this.game = game;
this.timeSpan = new TimeSpan();
this.game.GameUpdated += (timeSpan) =>
this.timeSpan = timeSpan.Add(timeSpan);
from visual import *
print """
Right button drag to rotate "camera" to view scene.
On a one-button mouse, right is Command + mouse.
Middle button to drag up or down to zoom in or out.
On a two-button mouse, middle is left + right.
On a one-button mouse, middle is Option + mouse.
"""
/*
* Reference.h
*
* Created on: Mar 28, 2010
* Author: tehlike
*/
#include "../Threading/Mutex.h"
#ifndef REFERENCE_H_
#define REFERENCE_H_
template <typename T>
IWindsorContainer container=null;
container.Register(
Fluently.ConfigureFacility()
.Id("nhibernateFacility")
.DefaultConfigurationBuilder<DefaultConfigurationBuilder>()
.DefaultConfigurationPersister<DefaultConfigurationPersister>()
.AddFactory(
Fluently.ConfigureFactory()
.Alias("myAlias")
.Id("myId")