예제 #1
0
        protected override void OnAddCommand()
        {
            var newCPU = new CPU();
            var newDevice = new Device();
            newCPU.Device = newDevice;

            this.Context.CPUs.Add(newCPU);
            this.CPUsView.MoveCurrentTo(newCPU);
        }
예제 #2
0
        protected override void OnAddCommand()
        {
            var newMemory = new Memory();
            var newDevice = new Device();
            newMemory.Device = newDevice;

            this.Context.Memories.Add(newMemory);
            this.MemoriesView.MoveCurrentTo(newMemory);
        }
예제 #3
0
        protected override void OnAddCommand()
        {
            var newCooler = new Cooler();
            var newDevice = new Device();
            newCooler.Device = newDevice;

            this.Context.Coolers.Add(newCooler);
            this.CoolersView.MoveCurrentTo(newCooler);
        }
예제 #4
0
 private bool FilterDevice(Device entity)
 {
     return (entity.Id == this.DeviceId);
 }
예제 #5
0
 private bool FilterDevices(Device entity)
 {
     return (entity.ManufacturerId == this.Id);
 }
예제 #6
0
 private void DetachDevices(Device entity)
 {
     entity.Manufacturer = null;
 }
예제 #7
0
 private void AttachDevices(Device entity)
 {
     entity.Manufacturer = this;
 }
예제 #8
0
        protected override void OnAddCommand()
        {
            var newMotherboard = new Motherboard();
            var newDevice = new Device();
            newMotherboard.Device = newDevice;

            this.Context.Motherboards.Add(newMotherboard);
            this.MotherboardsView.MoveCurrentTo(newMotherboard);
        }
예제 #9
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Devices EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDevices(Device device)
 {
     base.AddObject("Devices", device);
 }
예제 #10
0
 /// <summary>
 /// Create a new Device object.
 /// </summary>
 /// <param name="model">Initial value of the Model property.</param>
 /// <param name="price">Initial value of the Price property.</param>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="manufacturerId">Initial value of the ManufacturerId property.</param>
 public static Device CreateDevice(global::System.String model, global::System.Double price, global::System.Int32 id, global::System.Int32 manufacturerId)
 {
     Device device = new Device();
     device.Model = model;
     device.Price = price;
     device.Id = id;
     device.ManufacturerId = manufacturerId;
     return device;
 }