Exemplo n.º 1
0
        /// <summary>
        /// Создаём шаблон по умолчанию.
        /// </summary>
        /// <returns></returns>
        public static ViewWindowTemplate CreateDefoultTemplate()
        {
            ViewWindowTemplate template = new ViewWindowTemplate();
            template.Name = "defoult";

            LevelTemplate level1 = new LevelTemplate();
            //level1.Height = Properties.Settings.Default.HeightLevel;
            level1.Height = System.Windows.SystemParameters.PrimaryScreenHeight / 2 - 50;
            FilePanelTemplate fp1 = new FilePanelTemplate();
            fp1.FilePanelSettings = new FilePanelApps.FilePanelSettings();
            fp1.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            FilePanelTemplate fp2 = new FilePanelTemplate();
            fp2.FilePanelSettings = new FilePanelApps.FilePanelSettings();
            fp2.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            level1.FilePanels.Add(fp1);
            level1.FilePanels.Add(fp2);

            LevelTemplate level2 = new LevelTemplate();
            //level2.Height = Properties.Settings.Default.HeightLevel;
            level2.Height = System.Windows.SystemParameters.PrimaryScreenHeight / 2 - 50;
            FilePanelTemplate fp3 = new FilePanelTemplate();
            fp3.FilePanelSettings = new FilePanelApps.FilePanelSettings();
            fp3.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            FilePanelTemplate fp4 = new FilePanelTemplate();
            fp4.FilePanelSettings = new FilePanelApps.FilePanelSettings();
            fp4.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            level2.FilePanels.Add(fp3);
            level2.FilePanels.Add(fp4);

            template.Levels.Add(level1);
            template.Levels.Add(level2);

            return template;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Создаём шаблон по умолчанию.
        /// </summary>
        /// <returns></returns>
        public static ViewWindowTemplate CreateDefoultTemplate()
        {
            ViewWindowTemplate template = new ViewWindowTemplate();

            template.Name = "defoult";


            LevelTemplate level1 = new LevelTemplate();

            //level1.Height = Properties.Settings.Default.HeightLevel;
            level1.Height = System.Windows.SystemParameters.PrimaryScreenHeight / 2 - 50;
            FilePanelTemplate fp1 = new FilePanelTemplate();

            fp1.FilePanelSettings       = new FilePanelApps.FilePanelSettings();
            fp1.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            FilePanelTemplate fp2 = new FilePanelTemplate();

            fp2.FilePanelSettings       = new FilePanelApps.FilePanelSettings();
            fp2.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            level1.FilePanels.Add(fp1);
            level1.FilePanels.Add(fp2);

            LevelTemplate level2 = new LevelTemplate();

            //level2.Height = Properties.Settings.Default.HeightLevel;
            level2.Height = System.Windows.SystemParameters.PrimaryScreenHeight / 2 - 50;
            FilePanelTemplate fp3 = new FilePanelTemplate();

            fp3.FilePanelSettings       = new FilePanelApps.FilePanelSettings();
            fp3.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            FilePanelTemplate fp4 = new FilePanelTemplate();

            fp4.FilePanelSettings       = new FilePanelApps.FilePanelSettings();
            fp4.FilePanelSettings.Width = System.Windows.SystemParameters.PrimaryScreenWidth / 2 - 30;
            level2.FilePanels.Add(fp3);
            level2.FilePanels.Add(fp4);

            template.Levels.Add(level1);
            template.Levels.Add(level2);

            return(template);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Сохранение визуальных уровней и панелей в шаблон currentTemplate
        /// </summary>
        private void SaveTemplateView()
        {
            this.currentTemplate = new ViewWindowTemplate();
            this.currentTemplate.Skin = new SkinManager().GetCurrentSkin();
            foreach (var child in spMain.Children)
            {
                if (child.GetType() == typeof(Level))
                {
                    Level level = (Level)child;
                    LevelTemplate lTemplate = new LevelTemplate();

                    lTemplate.Height = level.Height;
                    //Перебираем все файловые панели
                    foreach (var c in level.spMain.Children)
                    {
                        if (c.GetType() == typeof(FilePanel))
                        {
                            FilePanel filePanel = (FilePanel)c;

                            FilePanelTemplate fpTemplate = new FilePanelTemplate();
                            fpTemplate.FilePanelSettings = filePanel.FilePanelSettings;
                            //fpTemplate.Width = filePanel.Width;
                            //fpTemplate.Path = filePanel.Path;

                            lTemplate.FilePanels.Add(fpTemplate);
                        }
                    }
                    currentTemplate.Levels.Add(lTemplate);
                }
            }
        }