protected void SaveChoices(
            IDeviceSpecificDesigner designer,
            String deviceSpecificID,
            ICollection choices
            )
        {
            DeviceSpecific deviceSpecific;

            if (!designer.GetDeviceSpecific(deviceSpecificID, out deviceSpecific))
            {
                return;
            }

            if (choices.Count == 0)
            {
                designer.SetDeviceSpecific(deviceSpecificID, null);
                return;
            }

            if (deviceSpecific == null)
            {
                deviceSpecific = new DeviceSpecific();
            }
            else
            {
                deviceSpecific.Choices.Clear();
            }
            foreach (ChoiceTreeNode node in choices)
            {
                node.CommitChanges();
                DeviceSpecificChoice choice = node.Choice.RuntimeChoice;
                deviceSpecific.Choices.Add(choice);
            }
            designer.SetDeviceSpecific(deviceSpecificID, deviceSpecific);
        }
        protected void SaveChoices(
            IDeviceSpecificDesigner designer,
            String deviceSpecificID,
            ICollection choices
        ) {
            DeviceSpecific deviceSpecific;
            if (!designer.GetDeviceSpecific(deviceSpecificID, out deviceSpecific))
            {
                return;
            }

            if(choices.Count == 0)
            {
                designer.SetDeviceSpecific(deviceSpecificID, null);
                return;
            }
            
            if (deviceSpecific == null)
            {
                deviceSpecific = new DeviceSpecific();
            }
            else
            {
                deviceSpecific.Choices.Clear();
            }
            foreach (ChoiceTreeNode node in choices)
            {
                node.CommitChanges();
                DeviceSpecificChoice choice = node.Choice.RuntimeChoice;
                deviceSpecific.Choices.Add(choice);
            }
            designer.SetDeviceSpecific(deviceSpecificID, deviceSpecific);
        }
Example #3
0
 void IDeviceSpecificDesigner.SetDeviceSpecific(String deviceSpecificParentID, DeviceSpecific ds)
 {
     _ds = ds;
     _dsd.SetDeviceSpecific(deviceSpecificParentID, ds);
 }