Ejemplo n.º 1
0
        /// <summary>
        /// -- Add preset windows and not replace them like load state do
        /// </summary>
        private void LoadPresetBtn_Click(object sender, RoutedEventArgs e)
        {
            if (TryGetZrfFile(out string filePath, Environment.CurrentDirectory + "\\Presets"))
            {
                var lines  = File.ReadAllLines(filePath);
                var states = lines.Select(o => JsonConvert.DeserializeObject <State>(o));

                foreach (var item in states)
                {
                    if (item.IsFutureWindow)
                    {
                        LayoutWindow fw = new LayoutWindow()
                        {
                            PreloadState = item
                        };
                        fw.Show();
                        futureWindows.Add(fw);
                    }
                    else
                    {
                        ReferenceWindow mw = new ReferenceWindow()
                        {
                            PreloadState = item
                        };
                        mw.Show();
                        referenceWindows.Add(mw);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// -- Do the actual load
        /// </summary>
        /// <param name="filePath"></param>
        private void LoadState(string filePath)
        {
            foreach (var item in referenceWindows)
            {
                item.Close();
            }
            referenceWindows.Clear();


            var lines  = File.ReadAllLines(filePath);
            var states = lines.Select(o => JsonConvert.DeserializeObject <State>(o)).ToList();


            foreach (var item in states)
            {
                if (item.IsFutureWindow)
                {
                    LayoutWindow fw = new LayoutWindow()
                    {
                        PreloadState = item
                    };
                    fw.Show();
                    futureWindows.Add(fw);
                }
                else
                {
                    ReferenceWindow mw = new ReferenceWindow()
                    {
                        PreloadState = item
                    };
                    mw.Show();
                    referenceWindows.Add(mw);
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// -- Create Reference window:
        /// </summary>
        private void CreateWindowBtn_Click(object sender, RoutedEventArgs e)
        {
            ReferenceWindow mw = new ReferenceWindow();

            mw.Show();
            mw.Activate();
            referenceWindows.Add(mw);
            RefreshList();
        }
Ejemplo n.º 4
0
        //Elements Events

        /// <summary>
        /// Drop something on the manager:
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Drop(object sender, DragEventArgs e)
        {
            drag.LoadDrag(sender, e, o =>
            {
                ReferenceWindow rw = new ReferenceWindow()
                {
                    PreloadImage = o
                };
                rw.Show();
                rw.Activate();
                referenceWindows.Add(rw);
                RefreshList();
            });
        }