Beispiel #1
0
        internal void Commit()
        {
            if (this.WasEnabled == this.Enabled)
            {
                return;
            }
            IMedSettings medSettings = ((CPorts)base.Parent).MedSettings;

            this.WasEnabled = this.Enabled;
            if (this.Enabled)
            {
                medSettings.AddPort(this.Id);
                return;
            }
            int portCount = medSettings.PortCount;

            for (int i = 1; i <= portCount; i++)
            {
                if (medSettings.GetPort(i) == this.Id)
                {
                    medSettings.RemovePort(i);
                    return;
                }
            }
        }
Beispiel #2
0
        internal void Commit()
        {
            if (this.WasEnabled == this.Enabled)
            {
                return;
            }
            IMedSettings medSettings = ((CModels)base.Parent).MedSettings;

            this.WasEnabled = this.Enabled;
            if (this.Enabled)
            {
                medSettings.AddPhone(this.Id);
                return;
            }
            int phoneCount = medSettings.PhoneCount;

            for (int i = 1; i <= phoneCount; i++)
            {
                if (medSettings.GetPhone(i) == this.Id)
                {
                    medSettings.RemovePhone(i);
                    return;
                }
            }
        }
Beispiel #3
0
 internal CModels(CItem parent) : base(parent)
 {
     if (!(parent is CDriver))
     {
         throw new Exception("Internal error");
     }
     this.MedApplication = ((CDriver)parent).MedApplication;
     this.MedSettings    = (IMedSettings)this.MedApplication.Settings;
 }
Beispiel #4
0
        internal CPorts(CItem parent) : base(parent)
        {
            if (!(parent is CDriver))
            {
                throw new Exception("Cannot new");
            }
            this.MedApplication = ((CDriver)parent).MedApplication;
            this.MedSettings    = (IMedSettings)this.MedApplication.Settings;

            //int portCount = this.MedSettings.PortCount;
            //for (int i = 1; i <= portCount; i++)
            //{
            //    var port = MedSettings.GetPort(i);
            //    if (port != 0)
            //    this.MedSettings.RemovePort(port);
            //}
            //this.MedSettings.Save();
        }