Exemple #1
0
        public HeliosProfile(bool autoAddInterfaces)
        {
            _monitors.CollectionChanged += new NotifyCollectionChangedEventHandler(Monitors_CollectionChanged);
            _interfaces.CollectionChanged += new NotifyCollectionChangedEventHandler(Interfaces_CollectionChanged);

            int i = 1;
            foreach (Monitor display in ConfigManager.DisplayManager.Displays)
            {
                Monitor monitor = new Monitor(display);
                monitor.Name = "Monitor " + i++;
                _monitors.Add(monitor);
            }

            if (autoAddInterfaces)
            {
                foreach (HeliosInterfaceDescriptor descriptor in ConfigManager.ModuleManager.InterfaceDescriptors)
                {
                    foreach(HeliosInterface newInterface in descriptor.GetAutoAddInstances(this))
                    {
                        Interfaces.Add(newInterface);
                    }
                }
            }

            LoadTime = DateTime.MinValue;
        }
Exemple #2
0
 public void SerializeMonitor(Monitor monitor, XmlWriter xmlWriter)
 {
     xmlWriter.WriteStartElement("Monitor");
     monitor.WriteXml(xmlWriter);
     SerializeControls(monitor.Children, xmlWriter);
     xmlWriter.WriteEndElement();
 }
Exemple #3
0
 private bool IsMonitorValid(Monitor display)
 {
     foreach (Monitor systemDisplay in ConfigManager.DisplayManager.Displays)
     {
         if (systemDisplay.Top == display.Top &&
             systemDisplay.Left == display.Left &&
             systemDisplay.Width == display.Width &&
             systemDisplay.Height == display.Height)
         {
             return true;
         }
     }
     return false;
 }
Exemple #4
0
 public Monitor(Monitor display)
     : this(display.Left, display.Top, display.Width, display.Height, display.Orientation)
 {
 }