Ejemplo n.º 1
0
        public TestThemeSpeed()
        {
            InitializeComponent();
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            // Theme.Current.ButtonStyle = "System";           // if removed, its faster
            Theme.Current.WindowsFrame = true;

            System.Diagnostics.Debug.WriteLine($"start {AppTicks.TickCountLap("AP", true)}");

            for (int i = 0; i < 1000; i++)
            {
                ExtComboBox cb = new ExtComboBox();
                cb.Location      = new Point(1, 30 * i);
                cb.Size          = new Size(200, 24);
                cb.Items         = new string[] { "one", "two" };
                cb.SelectedIndex = 0;
                panelMain.Controls.Add(cb);
            }

            Theme.Current.ApplyStd(this);

            System.Diagnostics.Debug.WriteLine($"added {AppTicks.TickCountLap("AP")}");
        }
Ejemplo n.º 2
0
        public TestPanelScroll()
        {
            InitializeComponent();
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;

            int spacing = 30;

            for (int i = 0; i < 30; i++)
            {
                Label lx = new Label();
                lx.Location = new Point(44 + i % 10, i * spacing);
                lx.Text     = "Label " + i;
                lx.Size     = new Size(200, 20);
                extPanelScroll1.Controls.Add(lx);

                Label lx2 = new Label();
                lx2.Location = new Point(24, i * spacing);
                lx2.Text     = "px" + i;
                lx2.Size     = new Size(20, 20);
                extPanelScroll1.Controls.Add(lx2);

                Panel px = new Panel();
                px.Location              = new Point(5, i * spacing);
                px.BackgroundImage       = Properties.Resources.edlogo24;
                px.Size                  = new Size(24, 24);
                px.BackgroundImageLayout = ImageLayout.Stretch;
                extPanelScroll1.Controls.Add(px);
            }
        }
        // proving you can't control RTF for scroll bar purposes.

        public TestTextBoxesRTF()
        {
            theme = new ThemeList();
            theme.LoadBaseThemes();
            //theme.SetThemeByName("Elite EuroCaps");
            theme.SetThemeByName("Elite Verdana");
            //Theme.Current.FontName = "Microsoft Sans Serif";
            //Theme.Current.FontName = "Arial";
            //Theme.Current.FontName = "Euro Caps";
            Theme.Current.FontSize     = 14f;
            Theme.Current.WindowsFrame = true;

            InitializeComponent();

            string tx = "";

            for (int i = 0; i < 20; i++)
            {
                tx = tx.AppendPrePad(i.ToStringInvariant("0000") + ":" + " Here is some text", Environment.NewLine);
            }
            extRichTextBox1.Text = tx;

            var x = Properties.Resources.EDD_License;

            extRichTextBox1.Rtf = x;

            Theme.Current.ApplyStd(this);
        }
        private ExtendedControls.Theme GetThemeFromDB()
        {
            if (EliteDangerousCore.DB.UserDatabase.Instance.KeyExists("ThemeNameOf"))           //
            {
                // we convert into JSON and then let the JSON reader do the job, of course, if we were doing this again, the JSON would just be in the DB

                JObject jo   = new JObject();
                string  name = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString("ThemeNameOf", "Custom");

                jo["windowsframe"]       = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingBool("ThemeWindowsFrame", true);
                jo["formopacity"]        = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingDouble("ThemeFormOpacity", 100);
                jo["fontname"]           = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString("ThemeFont", ExtendedControls.Theme.DefaultFont);
                jo["fontsize"]           = (float)EliteDangerousCore.DB.UserDatabase.Instance.GetSettingDouble("ThemeFontSize", ExtendedControls.Theme.DefaultFontSize);
                jo["buttonstyle"]        = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString("ButtonStyle", ExtendedControls.Theme.ButtonstyleSystem);
                jo["textboxborderstyle"] = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString("TextBoxBorderStyle", ExtendedControls.Theme.TextboxborderstyleFixed3D);

                // pick a default, based on the name. This is useful when new names are introduced, as if we are using a default theme, we will pick the new colour from the theme
                var defaulttheme = ThemeList.FindTheme(name) ?? ThemeList.FindTheme("Windows Default");

                foreach (ExtendedControls.Theme.CI ci in Enum.GetValues(typeof(ExtendedControls.Theme.CI)))
                {
                    var cname = "ThemeColor" + ci.ToString();
                    int d     = defaulttheme.GetColor(ci).ToArgb();
                    int dbv   = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingInt(cname, d);
                    jo[ci.ToString()] = dbv;
                }

                ExtendedControls.Theme theme = new ExtendedControls.Theme();
                return(theme.FromJSON(jo, name, defaulttheme) ? theme : null);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
        private void BindData()
        {
            int ForumID = 0;

            CategoryList.DataSource = YAF.Classes.Data.DB.category_list(PageContext.PageBoardID, null);
            CategoryList.DataBind();

            if (Request.QueryString ["f"] != null)
            {
                ForumID = Convert.ToInt32(Request.QueryString ["f"]);
                AccessList.DataSource = YAF.Classes.Data.DB.forumaccess_list(ForumID);
                AccessList.DataBind();
            }

            // Load forum's combo
            BindParentList();

            // Load forum's themes
            ListItem listheader = new ListItem();

            listheader.Text  = "Choose a theme";
            listheader.Value = "";

            AccessMaskID.DataBind();

            ThemeList.DataSource     = YafStaticData.Themes();
            ThemeList.DataTextField  = "Theme";
            ThemeList.DataValueField = "FileName";
            ThemeList.DataBind();
            ThemeList.Items.Insert(0, listheader);
        }
Ejemplo n.º 6
0
        private void FillCombos()
        {
            ComboFunctions.FillSecGroupsComboExcRoot(ddlGroups);
            ComboFunctions.FillSubCompanyCombo(ddlSubCompany);

            ThemeList themeList = ThemeResolutionService.GetAvailableThemes();

            if (themeList.Count() > 0)
            {
                ddlThemes.DisplayMember    = "ThemeName";
                ddlThemes.ValueMember      = "ThemeName";
                ddlThemes.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                ddlThemes.DataSource       = themeList.Distinct().Where(t => !t.ThemeName.EndsWith("*") && t.ThemeName != "BreezeExtended").OrderBy(t => t.ThemeName).ToList();
            }

            ddlThemes.SelectedIndex = -1;
            ddlThemes.NullText      = "Select";
            ddlGroups.SelectedIndex = -1;


            if (ddlSubCompany.Items.Count > 0)
            {
                chkAllowTransferBooking.Visible = true;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 出稿処理呼び出し
        /// </summary>
        private async void Publish()
        {
            StatusModel.StatusMessage = "出稿開始";

            // TaskをまとめるListを作成
            var tasks = new List <Task <bool> >();

            // 出稿対象の素材のリストを生成
            var contents = ThemeList.SelectMany(thm => thm.ContentList).ToList();

            foreach (var item in contents)
            {
                //var cancelTokensource1 = new CancellationTokenSource();
                //var cToken = cancelTokensource1.Token;

                var task = Task.Run(() => PublishAsync(item));
                tasks.Add(task); // を、Listにまとめる

                //cancelTokensource1.Dispose();
                //cancelTokensource1 = null;
            }

            // Task配列の処理を実行し、全ての処理が終了するまで待機
            var arrayInt = await Task.WhenAll(tasks);

            if (arrayInt.All(ret => ret))
            {
                StatusModel.StatusMessage = "出稿終了:全件成功";
            }
            else
            {
                StatusModel.StatusMessage = "出稿終了:失敗したタスクがあります";
            }
        }
Ejemplo n.º 8
0
        public TestPanelDGV()
        {
            InitializeComponent();

            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;


            dataGridView.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridView.AutoSizeRowsMode          = DataGridViewAutoSizeRowsMode.DisplayedCells;

            dataGridView.RowHeightChanged += (a, e) => { System.Diagnostics.Debug.WriteLine("DGV Row Height"); };

            dataGridView.Dock = DockStyle.Fill;

            for (int i = 0; i < 100; i++)
            {
                DataGridViewRow row = dataGridView.RowTemplate.Clone() as DataGridViewRow;
                row.CreateCells(dataGridView, i.ToString(), (100 + i).ToString(), (10000 - i).ToString());
                row.Tag = i;
                dataGridView.Rows.Add(row);
            }
        }
        private void DropDown(bool themeit)
        {
            var dropdown = new ExtListBoxForm("", true);

            Image[] imagelist = new Image[] {
                Properties.Resources.galaxy_black,
                Properties.Resources.galaxy_gray,
                Properties.Resources.galaxy_red,
                Properties.Resources.galaxy_white,
            };

            string[] textlist = new string[] { "256", "192", "128", "96" };

            dropdown.Items      = textlist.ToList();
            dropdown.ImageItems = imagelist.ToList();
            dropdown.FlatStyle  = FlatStyle.Popup;
            dropdown.PositionBelow(extButton11);

            if (themeit)
            {
                Theme.Current.ApplyStd(dropdown);
            }
            else
            {
                var stdtheme = new ThemeList();
                stdtheme.LoadBaseThemes();
                stdtheme.SetThemeByName("Windows Default");
                Theme.Current.ApplyStd(dropdown, true);
            }


            dropdown.Show(this.FindForm());
        }
Ejemplo n.º 10
0
        private bool _Upgrade(GraphTheme graphTheme)
        {
            if (Options.LATESTOPTIONSVERSION > this.OptionsVersion)
            {
                switch (this.OptionsVersion)
                {
                case 0:
                //this.OptionsVersion = LATESTOPTIONSVERSION;
                //return true;
                case 1:
                    if (GraphTheme.IsCustom(graphTheme))
                    {
                        this.ThemeType = ThemeList.CUSTOM;
                    }
                    else
                    {
                        this.ThemeType = ThemeList.AUTOMATIC;
                    }
                    this.OptionsVersion = LATESTOPTIONSVERSION;
                    return(true);

                default:
                    break;
                }
            }
            return(false);
        }
Ejemplo n.º 11
0
 public TestListBoxIcon()
 {
     InitializeComponent();
     theme = new ThemeList();
     theme.LoadBaseThemes();
     theme.SetThemeByName("Elite EuroCaps");
     Theme.Current.FontSize = 12;
 }
 public TestPanelScroll2()
 {
     InitializeComponent();
     theme = new ThemeList();
     theme.LoadBaseThemes();
     theme.SetThemeByName("Elite Verdana");
     Theme.Current.WindowsFrame = true;
     extPanelScroll1.FlowControlsLeftToRight = true;
 }
Ejemplo n.º 13
0
 public TestVScroll()
 {
     InitializeComponent();
     theme = new ThemeList();
     theme.LoadBaseThemes();
     theme.SetThemeByName("Elite Verdana");
     Theme.Current.WindowsFrame = true;
     Theme.Current.ApplyStd(this);
 }
Ejemplo n.º 14
0
        public TestPanelScrollDGV()
        {
            InitializeComponent();
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;

            CreateDGVInPS(50);
            CreateDGV(500);
        }
Ejemplo n.º 15
0
        public TestVariousForms()
        {
            InitializeComponent();
            theme = new ThemeList();
            theme.LoadBaseThemes();
            //theme.SetThemeByName("Elite EuroCaps");
            theme.SetThemeByName("EDSM");
            Theme.Current.FontSize = 12;

            // extButton1_Click(null, null);
        }
Ejemplo n.º 16
0
        static void Main()
        {
            ThemeList tl = new ThemeList();
            ActiveTheme at = new ActiveTheme();
            ThemeSwitcher ts = new ThemeSwitcher();
            ThemeInstaller ti = new ThemeInstaller();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ThemeAgentForm(tl.List, at, ts, ti));
        }
Ejemplo n.º 17
0
        public override void RunStep()
        {
            var themeList = new ThemeList();

            CreateDynamicCSS();
            CopyFavIcon();

            CopyFolder(Path.Combine(Path.GetDirectoryName(GetType().Assembly.Location), "app"), StepInput.OutputPath);
            CopyFolder(themeList.GetThemeFolder(StepInput.HtmlConfig.Theme), StepInput.OutputPath);
            CopyImages(StepInput.SDProject.Images, Path.Combine(StepInput.OutputPath, "data"));
            CopyImage(StepInput.SDProject.LogoPath, Path.Combine(StepInput.OutputPath, "data"));
        }
        public TestTabControlCustom()
        {
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;

            InitializeComponent();
            tabControl1.FlatStyle        = FlatStyle.Popup;
            tabControl1.TabStyle         = new TabStyleAngled();
            tabControl1.AllowDragReorder = true;
        }
Ejemplo n.º 19
0
        public override void RunStep()
        {
            var themeList = new ThemeList();

            CreateDynamicCSS();
            CopyFavIcon();

            CopyFolder(Path.Combine(Path.GetDirectoryName(GetType().Assembly.Location), "app"), StepInput.OutputPath);
            CopyFolder(themeList.GetThemeFolder(StepInput.HtmlConfig.Theme), StepInput.OutputPath);
            CopyImages(StepInput.SDProject.Images, Path.Combine(StepInput.OutputPath, "data"));
            CopyImage(StepInput.SDProject.LogoPath, Path.Combine(StepInput.OutputPath, "data"));
        }
Ejemplo n.º 20
0
        public TestRollUpPanel()
        {
            InitializeComponent();

            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;

            rolluppanel.HiddenMarkerWidth = -100;
            rolluppanel.SetPinState(true);
        }
        public TestExtendedForms()
        {
            InitializeComponent();
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.FontSize = 12;

            BaseUtils.Translator.Instance.AddExcludedControls(new Type[]
                                                              { typeof(ExtendedControls.ExtComboBox), typeof(ExtendedControls.NumberBoxDouble), typeof(ExtendedControls.NumberBoxFloat), typeof(ExtendedControls.NumberBoxLong),
                                                                typeof(ExtendedControls.ExtScrollBar), typeof(ExtendedControls.ExtStatusStrip), typeof(ExtendedControls.ExtRichTextBox), typeof(ExtendedControls.ExtTextBox),
                                                                typeof(ExtendedControls.ExtTextBoxAutoComplete), typeof(ExtendedControls.ExtDateTimePicker), typeof(ExtendedControls.ExtNumericUpDown) });
        }
        private void extButton3_Click(object sender, EventArgs e)
        {
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite EuroCaps");
            Theme.Current.FontName     = "Microsoft Sans Serif";
            Theme.Current.FontSize     = 8.25f;
            Theme.Current.WindowsFrame = false;

            two = new DraggableForm();
            Theme.Current.ApplyStd(two);
            two.Show(this);
        }
Ejemplo n.º 23
0
        public TestTextBoxes()
        {
            theme = new ThemeList();
            theme.LoadBaseThemes();
            //theme.SetThemeByName("Elite EuroCaps");
            theme.SetThemeByName("Elite Verdana");
            //Theme.Current.FontName = "Microsoft Sans Serif";
            //Theme.Current.FontName = "Arial";
            //Theme.Current.FontName = "Euro Caps";
            //Theme.Current.FontSize = 20f;
            //  Theme.Current.WindowsFrame = true;

            InitializeComponent();

            Theme.Current.ApplyStd(this);

            textBoxDouble1.FormatCulture = CultureInfo.GetCultureInfo("en-gb");
            textBoxDouble2.FormatCulture = CultureInfo.GetCultureInfo("fr");
            numberBoxLong1.FormatCulture = CultureInfo.GetCultureInfo("en-gb");

            numberBoxLong1.Minimum       = 1000;
            numberBoxLong1.Maximum       = 2000;
            numberBoxLong1.ValueNoChange = 1100;

            numberBoxLong2.Minimum       = 1000;
            numberBoxLong2.Maximum       = 2000;
            numberBoxLong2.ValueNoChange = 1400;
            numberBoxLong2.SetComparitor(numberBoxLong1, 2);

            textBoxDouble1.Minimum       = -20.0;
            textBoxDouble1.Maximum       = 20.0;
            textBoxDouble1.ValueNoChange = 1.1;

            textBoxDouble2.Minimum       = 10.0;
            textBoxDouble2.Maximum       = 20.0;
            textBoxDouble2.ValueNoChange = 12.1;


            extRichTextBox1.HideScrollBar = true;

            string tx = "";

            for (int i = 0; i < 200; i++)
            {
                tx = tx.AppendPrePad(i.ToStringInvariant("0000") + ":" + " Here is some text", Environment.NewLine);
            }
            extRichTextBox1.Text = tx;

            extComboBoxFontSize.Items = new string[] { "8", "10", "12", "14", "16", "18", "20", "22", "24" };
            extComboBoxFont.Items     = new string[] { "Arial", "MS Sans Serif", "Euro Caps" };
        }
Ejemplo n.º 24
0
        public TestPictureBox()
        {
            InitializeComponent();
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;
            Theme.Current.ApplyStd(this);

            extScrollBar1.HideScrollBar           = true;
            extScrollBar1.SmallChange             = 16;
            extScrollBar2.HideScrollBar           = true;
            extPictureBoxScroll2.ScrollBarEnabled = false;
        }
        public TestDraggableForm()
        {
            theme = new ThemeList();
            theme.LoadBaseThemes();
            theme.SetThemeByName("Elite EuroCaps");
            Theme.Current.SetColor(Theme.CI.form, Color.FromArgb(50, 50, 0));
            Theme.Current.FontName     = "Microsoft Sans Serif";
            Theme.Current.FontSize     = 8.25f;
            Theme.Current.WindowsFrame = false;

            InitializeComponent();

            Theme.Current.ApplyStd(this);
        }
Ejemplo n.º 26
0
 public SettingsViewModel()
 {
     // 由于默认值不是常量,因此需要动态注册
     SettingService.Instance.RegisterSetting(this, nameof(PriorSource), null, MediaSources.First());
     SettingService.Instance.RegisterSetting(this, nameof(Theme), null, ThemeList.First());
     SettingService.Instance.RegisterSetting(this, nameof(ReminderSpanAhead), null, TimeSpan.FromMinutes(5));
     SettingService.Instance.ApplySettingAttributes(this);
     ClearCacheFiles = new DelegateCommand(async() =>
     {
         await CacheService.ClearCache();
         await new MessageDialog("成功清空缓存", "成功").ShowAsync();
         CacheFileSize = 0;
     }, () => CacheFileSize > 0);
 }
Ejemplo n.º 27
0
    public static ThemeList GetThemes()
    {
        ThemeList     objList = new ThemeList();
        DirectoryInfo dInfo   = new DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath("App_Themes"));

        DirectoryInfo[] dArrInfo = dInfo.GetDirectories();
        //ArrayList list = new ArrayList();
        foreach (DirectoryInfo sDirectory in dArrInfo)
        {
            BOTheme objBO = new BOTheme();
            objBO.Themename = sDirectory.Name;
            objList.AddToList(objBO);
        }
        return(objList);
    }
Ejemplo n.º 28
0
        /// <summary>
        /// Gets a list of all registered themes.
        /// </summary>
        /// <returns></returns>
        public static ThemeList GetAvailableThemes()
        {
            ThemeList res = new ThemeList();

            foreach (DictionaryEntry entry in ThemeResolutionService.registeredThemes)
            {
                Theme theme = (Theme)entry.Value;
                if (theme.ThemeName != asteriskThemeName)
                {
                    res.Add((Theme)entry.Value);
                }
            }

            return(res);
        }
Ejemplo n.º 29
0
        public TestTheme()
        {
            InitializeComponent();
            stdthemes = new ThemeList();
            stdthemes.LoadBaseThemes();
            stdthemes.SetThemeByName("Elite Verdana");
            Theme.Current.WindowsFrame = true;
            Theme.Current.ApplyStd(this);
            labelName.Text = Theme.Current.Name;

            for (int i = 0; i < 20; i++)
            {
                dataGridView.Rows.Add(new object[] { $"{i}", "two", "three" });
            }
        }
        public MainViewModel()
        {
            // テストデータ
            var thm = "ガソリン急落 半年ぶり143円台";

            ThemeList.Add(new ThemeModel(thm, "経済", _rdm.Next(1, 3), _rdm.Next(0, 3)));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("レギュラーガソリン急落、前週比2.9円安の143.5円 半年ぶりの安値", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("[ハイオクガソリン実売価格(「e燃費」調べ)]", "画像", "1920x1080", thm));
            thm = "新型コロナの影響拡大を受けて";
            ThemeList.Add(new ThemeModel("新型コロナの影響拡大を受けて", "政治", _rdm.Next(1, 3), _rdm.Next(0, 3)));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("公共料金の支払いを猶予 欧州から入国、待機要請 新型コロナ", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("電気など公共料金支払い猶予要請へ 欧州など38カ国に入国制限", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("新型コロナウイルス感染症対策本部", "画像", "355x466", thm));
            thm = "新型iPad、25日に発売";
            ThemeList.Add(new ThemeModel("新型iPad、25日に発売", "社会", _rdm.Next(1, 3), _rdm.Next(0, 3)));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("アップル、LiDARセンサー/2カメラの新iPad Pro。トラックパッドにも初対応", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("新型iPad、25日に発売 米アップル、超広角カメラ搭載", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("iPad(アイパッド)プロ", "画像", "400x448", thm));
            thm = "将棋の清水市代女流六段が史上初の女流七段に";
            ThemeList.Add(new ThemeModel("将棋の清水市代女流六段が史上初の女流七段に", "社会", _rdm.Next(1, 3), _rdm.Next(0, 3)));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("清水が史上初の女流七段に 里見は女流六段昇段", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("女流七段への昇段は史上初", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("日本将棋連盟", "画像", "1280x720", thm));
            thm = "【第1部】日経平均株価";
            ThemeList.Add(new ThemeModel("【第1部】日経平均株価", "経済", _rdm.Next(1, 3), _rdm.Next(0, 3)));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("乱高下後に小幅続落=不安定な値動き続く", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("日経平均は急速に切り返し底入れを期待", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ThemeList[ThemeList.Count - 1].ContentList.Add(new ContentModel("ダウ工業株30種平均が過去最大の下げ幅", "画像", "1920x1080", thm));

            ContentList = new ObservableCollection <ContentModel>(ThemeList.SelectMany(theme => theme.ContentList).ToList());

            thm = "";
            ContentFreeList.Add(new ContentModel("【コロナショックで資産が半分に!?】「iDeCo・つみたてNISA」利用者が今とるべき対処法とは", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ContentFreeList.Add(new ContentModel("東電、全社員に一時金9万円 初任給は3千円上げ", "画像", $"{_rdm.Next(600, 1980)}x{_rdm.Next(400, 1080)}", thm));
            ContentFreeList.Add(new ContentModel("死者64万人想定のコロナ緊急宣言は妥当なのか", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ContentFreeList.Add(new ContentModel("自然災害リスクへの警戒高まる 川沿いの住宅地、公示地価で下落顕著", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ContentFreeList.Add(new ContentModel("直ちに消費税率ゼロにする発想ない", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ContentFreeList.Add(new ContentModel("NY株1700ドル超下げ 2万ドル割り込む 取引一時停止", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ContentFreeList.Add(new ContentModel("18日東京株式市場終値 284円98銭安の1万6726円55銭", "画像", $"{_rdm.Next(600, 1980)}x{_rdm.Next(400, 1080)}", thm));
            ContentFreeList.Add(new ContentModel("USJが子ども達に『サプライズプレゼント』学童保育に通う3千人超に1300万円分", "記事", $"{_rdm.Next(15, 45)}行", thm));
            ContentFreeList.Add(new ContentModel("GPIF22兆円の大損失 株価暴落&運用失敗", "記事", $"{_rdm.Next(15, 45)}行", thm));

            // Drag&Drop
            this.Description           = new DropAcceptDescription();
            this.Description.DragOver += Description_DragOver;
            this.Description.DragDrop += Description_DragDrop;
        }
Ejemplo n.º 31
0
        private void Init(string file)
        {
            XmlDocument xmlDocument = new XmlDocument();

            if (File.Exists(file))
            {
                xmlDocument.Load(file);

                XmlNodeList languageList = xmlDocument.SelectNodes("/Configuration/Languages/Language");
                if (languageList.Count > 0)
                {
                    foreach (XmlNode item in languageList)
                    {
                        LanguageList.Add(item.Attributes["Name"].Value);
                        FilenameExtensionDic.Add(item.Attributes["Name"].Value, item.Attributes["Extension"].Value);
                    }
                }

                XmlNodeList themeList = xmlDocument.SelectNodes("/Configuration/Themes/Theme");
                if (themeList.Count > 0)
                {
                    foreach (XmlNode item in themeList)
                    {
                        ThemeList.Add(item.InnerText);
                    }
                }

                XmlNodeList fontSizeList = xmlDocument.SelectNodes("/Configuration/FontSizes/FontSize");
                if (fontSizeList.Count > 0)
                {
                    foreach (XmlNode item in fontSizeList)
                    {
                        FontSizeList.Add(int.Parse(item.InnerText));
                    }
                }

                XmlNodeList fontList = xmlDocument.SelectNodes("/Configuration/Fonts/Font");
                if (fontList.Count > 0)
                {
                    foreach (XmlNode item in fontList)
                    {
                        FontList.Add(item.InnerText);
                    }
                }
            }
        }
Ejemplo n.º 32
0
        private static void ProcessInstruction(string name, string content,
                                               ThemeList styles, StringDictionary variables, ContextDictionary context)
        {
            switch (name)
            {
            case "@vals":
                ParseVariables(variables, content);
                break;

            case "@include":
                break;

            case "@modules":
                ParseContext(content, context);
                break;
            }
        }