Refactored the Kernel registration fluent interface to be more readable, better suppo...
[castle.git] / InversionOfControl / Castle.Windsor.Tests / Components / Camera.cs
blobde4f469f67a5d86416a6f2f5ce91b123538f360f
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.Windsor.Tests.Components
17 using System;
19 public interface ICamera
21 int Id { get; }
22 string Name { get; set; }
23 string IPNumber { get; set; }
26 public interface ICameraServiceBase
28 ICamera Add(String name, string ipNumber);
31 public interface ICameraService : ICameraServiceBase
33 void Record(ICamera cam);
36 public class Camera : ICamera
38 private int myId;
39 private string myName;
40 private string myIPNumber;
42 public int Id
44 get { return myId; }
45 set { myId = value; }
48 public string Name
50 get { return myName; }
51 set { myName = value; }
54 public String IPNumber
56 get { return myIPNumber; }
57 set { myIPNumber = value; }
61 public class CameraService : MarshalByRefObject, ICameraService
63 public ICamera Add(String name, String ipNumber)
65 return new Camera();
68 public void Record(ICamera cam)
70 Console.WriteLine("Recording...");