-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDeviceConfiguration.cs
96 lines (75 loc) · 2.49 KB
/
DeviceConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright 2004, Microsoft Corporation
// Sample Code - Use restricted to terms of use defined in the accompanying license agreement (EULA.doc)
//--------------------------------------------------------------
// Autogenerated by XSDObjectGen version 1.4.2.1
// Schema file: DeviceConfiguration.xsd
// Creation Date: 2006-06-06 20:56:04
//--------------------------------------------------------------
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Xml.Schema;
using System.ComponentModel;
namespace Notpod.Configuration12
{
public class DeviceConfiguration
{
[XmlIgnore]
private ICollection<SyncPattern> syncPatterns = new List<SyncPattern>();
private ICollection<Device> devices = new List<Device>();
/// <summary>
/// Accessor for devices.
/// </summary>
public Device[] Devices
{
get
{
Device[] devicesarr = new Device[devices.Count];
devices.CopyTo(devicesarr, 0);
return devicesarr;
}
set
{
devices.Clear();
foreach (Device d in value)
devices.Add(d);
}
}
[XmlIgnore]
public SyncPattern[] SyncPatterns {
set { }
get { return new SyncPattern[0]; }
}
/// <summary>
/// Add a device.
/// </summary>
/// <param name="d">Device to add.</param>
public void AddDevice(Device d)
{
devices.Add(d);
}
/// <summary>
/// Remove a Device.
/// </summary>
/// <param name="d">Device to remove.</param>
/// <returns></returns>
public bool RemoveDevice(Device d)
{
return devices.Remove(d);
}
[XmlIgnore]
public ICollection<SyncPattern> SyncPattern {
get { return syncPatterns; }
set { syncPatterns = value;}
}
public bool ContainsSyncPattern(SyncPattern sp)
{
foreach(SyncPattern existingPattern in syncPatterns) {
if(existingPattern.Identifier == sp.Identifier) {
return true;
}
}
return false;
}
}
}