Beispiel #1
0
        public static void RunAlbum(object Args)
        {
            using (Album game = new Album())
            {
                ConfigData.Monitor Mon = (ConfigData.Monitor)Args;

                Control C = Form.FromHandle(game.Window.Handle);
                Form    F = C.FindForm();

                F.FormBorderStyle = FormBorderStyle.None;
                game.Bounds       = new Rectangle(Mon.Bounds.X, Mon.Bounds.Y, Mon.Bounds.Width, Mon.Bounds.Height);

                game.Location       = Mon.Source;
                game.TransitionMode = Mon.TransitionMode;
                game.Order          = Mon.Order;

                game.TileType   = Mon.TileType;
                game.FixedTiles = Mon.FixedTiles;
                game.MinTiles   = Mon.MinTiles;
                game.MaxTiles   = Mon.MaxTiles;

                game.TransitionTime = Mon.TransitionTime;
                game.FixedTime      = Mon.FixedTime;
                game.MinTime        = Mon.MinTime;
                game.MaxTime        = Mon.MaxTime;

                game.Run();
            }
        }
Beispiel #2
0
        public void Load()
        {
            XmlHelper.Node Configuration = XMLHelper.LoadXML("MultiSaverConfiguration.xml");

            if (Configuration != null)
            {

                Unassigned.Clear();
                Maze.Clear();
                Slideshow.Clear();

                XmlHelper.Node UnassignedMonitors = Configuration.Children[1].Children[0];

                foreach (XmlHelper.Node N in UnassignedMonitors.Children)
                {

                    Monitor M = new Monitor();
                    M.ID = N.Attributes[0].Value;
                    M.Bounds = new System.Drawing.Rectangle(Convert.ToInt32(N.Attributes[1].Value),
                        Convert.ToInt32(N.Attributes[2].Value),
                        Convert.ToInt32(N.Attributes[3].Value),
                        Convert.ToInt32(N.Attributes[4].Value));

                    Unassigned.Add(M);

                }

                XmlHelper.Node MazeMonitors = Configuration.Children[1].Children[1];

                foreach (XmlHelper.Node N in MazeMonitors.Children)
                {

                    Monitor M = new Monitor();
                    M.ID = N.Attributes[0].Value;
                    M.Bounds = new System.Drawing.Rectangle(Convert.ToInt32(N.Attributes[1].Value),
                        Convert.ToInt32(N.Attributes[2].Value),
                        Convert.ToInt32(N.Attributes[3].Value),
                        Convert.ToInt32(N.Attributes[4].Value));

                    Maze.Add(M);

                }

                XmlHelper.Node SlideshowMonitors = Configuration.Children[1].Children[2];

                foreach (XmlHelper.Node N in SlideshowMonitors.Children)
                {

                    Monitor M = new Monitor();
                    M.ID = N.Attributes[0].Value;
                    M.Bounds = new System.Drawing.Rectangle(Convert.ToInt32(N.Attributes[1].Value),
                        Convert.ToInt32(N.Attributes[2].Value),
                        Convert.ToInt32(N.Attributes[3].Value),
                        Convert.ToInt32(N.Attributes[4].Value));

                    M.TransitionMode = N.Attributes[5].Value;

                    M.Source = N.Attributes[6].Value;
                    M.Order = N.Attributes[7].Value;

                    M.TileType = N.Attributes[8].Value;
                    M.FixedTiles = Convert.ToInt32(N.Attributes[9].Value);
                    M.MinTiles = Convert.ToInt32(N.Attributes[10].Value);
                    M.MaxTiles = Convert.ToInt32(N.Attributes[11].Value);

                    M.TransitionTime = N.Attributes[12].Value;
                    M.FixedTime = Convert.ToInt32(N.Attributes[13].Value);
                    M.MinTime = Convert.ToInt32(N.Attributes[14].Value);
                    M.MaxTime = Convert.ToInt32(N.Attributes[15].Value);

                    Slideshow.Add(M);

                }

            }
        }
Beispiel #3
0
        private void SetupMonitors()
        {
            Screens = Screen.AllScreens;

            foreach (Screen S in Screens)
            {

                #region MonitorIcons

                CreateIcon(UnassignedStackPanel, S);

                #endregion

                OptionComboBox.Items.Add(S.DeviceName.Replace("\\\\.\\", "").Replace("Y", "Y "));
                OptionComboBox.SelectionChanged += new SelectionChangedEventHandler(OptionComboBox_SelectionChanged);
                OptionComboBox.SelectedIndex = 0;

                Monitor M = new Monitor { ID = S.DeviceName, Bounds = S.Bounds };

                ConfigSettings.Unassigned.Add(M);

            }
        }
Beispiel #4
0
        public MainWindow()
        {
            InitializeComponent();

            SetupImage();
            SetupMonitors();

            ConfigSettings.Load();

            UnassignedStackPanel.Children.Clear();

            List<int> UsedIDs = new List<int>();

            for (int i = 0; i < ConfigSettings.Unassigned.Count; i++)
            {

                if (ScreenExists(ConfigSettings.Unassigned[i].IDNumber))
                {

                    UsedIDs.Add(ConfigSettings.Unassigned[i].IDNumber);
                    CreateIcon(UnassignedStackPanel, GetScreen(ConfigSettings.Unassigned[i].IDNumber));

                }

                else
                {

                    ConfigSettings.Unassigned.RemoveAt(i);
                    i--;

                }

            }

            for (int i = 0; i < ConfigSettings.Maze.Count; i++)
            {

                if (ScreenExists(ConfigSettings.Maze[i].IDNumber))
                {

                    UsedIDs.Add(ConfigSettings.Maze[i].IDNumber);
                    CreateIcon(MazeStackPanel, GetScreen(ConfigSettings.Maze[i].IDNumber));

                }

                else
                {

                    ConfigSettings.Maze.RemoveAt(i);
                    i--;

                }

            }

            for (int i = 0; i < ConfigSettings.Slideshow.Count; i++)
            {

                if (ScreenExists(ConfigSettings.Slideshow[i].IDNumber))
                {

                    UsedIDs.Add(ConfigSettings.Slideshow[i].IDNumber);
                    CreateIcon(SlideshowStackPanel, GetScreen(ConfigSettings.Slideshow[i].IDNumber));

                }
                else
                {

                    ConfigSettings.Slideshow.RemoveAt(i);
                    i--;

                }

            }

            foreach (int i in UsedIDs)
            {

                foreach (Screen S in Screens)
                {

                    if (i.ToString() != S.DeviceName.Replace("\\\\.\\DISPLAY", ""))
                    {

                        CreateIcon(UnassignedStackPanel, S);
                        Monitor M = new Monitor { ID = S.DeviceName, Bounds = S.Bounds };
                        ConfigSettings.Unassigned.Add(M);

                    }

                }

            }

            ShowOptions();
        }