Пример #1
0
        private void ToggleAvailable(string title)
        {
            if (AddOpenMode == OpenMode.SeasonModify)
            {
                title = Data.DictSeason[ModifyTag].ArchiveTitle;
            }

            ArchiveData data = Data.DictArchive[title];

            if (data.Episode >= 0)
            {
                data.Episode       = -1;
                textAddScript.Text = "활성화";
            }
            else
            {
                data.Episode       = 0;
                textAddScript.Text = "비활성화";
            }

            RefreshArchiveEpisode(title, data.Episode);
            RefreshDisableButton(title);

            Setting.SaveSetting();
        }
Пример #2
0
        private void AddArchive(string title, bool scroll)
        {
            ArchiveData data = new ArchiveData();

            data.Title = title;

            Data.DictArchive.Add(data.Title, data);
            int index = containArchive.Add(true, data);

            if (scroll)
            {
                scrollArchive.ScrollToVerticalOffset(index * 40);
            }
        }
Пример #3
0
        public ListItem(ArchiveData data, bool animate)
            : this(animate) {
            ObjectType = ItemType.Archive;

            this.textTime.Visibility = Visibility.Collapsed;

            this.Title            = data.Title;
            this.textTitle.Margin = new Thickness(15, 0, 0, 0);
            Grid.SetColumn(this.textTitle, 0);
            Grid.SetColumnSpan(this.textTitle, 2);

            Grid.SetColumn(this.rect, 0);
            this.rect.Margin = new Thickness(15, 0, 0, 0);

            this.Episode   = data.Episode;
            this.Reference = data.Title;
        }
Пример #4
0
        public static void LoadArchive()
        {
            try {
                if (!File.Exists(fileOldList))
                {
                    return;
                }

                string[] strSplitList = null;
                using (StreamReader sr = new StreamReader(fileOldList)) {
                    strSplitList = sr.ReadToEnd().Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
                }

                foreach (string str in strSplitList)
                {
                    ArchiveData adata = new ArchiveData();

                    string[] str2 = str.Split(new string[] { " : ", @" \/ " }, StringSplitOptions.RemoveEmptyEntries);
                    str2 = str2[0].Split(new string[] { " - ", @" /\ " }, StringSplitOptions.RemoveEmptyEntries);

                    if (str2.Length == 2)
                    {
                        string[] str3 = str2[1].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries);
                        if (str3.Length == 1)
                        {
                            adata.Episode = Convert.ToInt32(str3[0].Trim());
                        }
                        else
                        {
                            adata.Episode = Convert.ToInt32(str3[1].Trim());
                        }
                    }
                    else
                    {
                        adata.Episode = -1;
                    }

                    adata.Title = str2[0].Trim();
                    Data.DictArchive.Add(adata.Title, adata);
                }
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }

            LoadSeason();
        }
Пример #5
0
        private void LoadSetting()
        {
            textVersion.Text = Version.NowVersion;

            if (Directory.Exists(@"X:\Anime"))
            {
                Status.Root = true;
                SetImageByMode(buttonArrange, Tab, true, TabMode.Season);
            }

            ClearFolder();

            if (Migration.CheckMigration())
            {
                Setting.SaveSetting();
            }
            else
            {
                if (!File.Exists(Setting.FileSetting))
                {
                    Setting.SaveSetting();
                }

                using (StreamReader sr = new StreamReader(Setting.FileSetting)) {
                    string text = sr.ReadToEnd();

                    JsonTextParser       parser         = new JsonTextParser();
                    JsonObjectCollection jsoncollection = (JsonObjectCollection)(parser.Parse(text));

                    // Setting
                    JsonObjectCollection jsonSetting = (JsonObjectCollection)jsoncollection["Setting"];
                    foreach (JsonStringValue value in jsonSetting)
                    {
                        switch (value.Name)
                        {
                        case "SaveDirectory":
                            Setting.SaveDirectory = value.Value;
                            break;

                        case "Tray":
                            Setting.Tray = Convert.ToBoolean(value.Value);
                            break;

                        case "NoQuestion":
                            Setting.NoQuestion = Convert.ToBoolean(value.Value);
                            break;

                        case "OldVersion":
                            Version.OldVersion = value.Value;
                            break;

                        case "ShowRaws":
                            Setting.ShowRaws = Convert.ToBoolean(value.Value);
                            break;
                        }
                    }

                    // Archive

                    JsonArrayCollection jsonArchive = (JsonArrayCollection)jsoncollection["Archive"];
                    foreach (JsonObjectCollection value in jsonArchive)
                    {
                        ArchiveData data = new ArchiveData();

                        data.Title   = value["Title"].GetValue().ToString();
                        data.Episode = Convert.ToInt32(value["Episode"].GetValue());

                        if (value["SeasonTitle"] != null)
                        {
                            data.SeasonTitle = value["SeasonTitle"].GetValue().ToString();
                        }

                        Data.DictArchive.Add(data.Title, data);
                    }

                    // Season

                    JsonArrayCollection jsonSeason = (JsonArrayCollection)jsoncollection["Season"];
                    foreach (JsonObjectCollection value in jsonSeason)
                    {
                        SeasonData data = new SeasonData();

                        data.Title        = value["Title"].GetValue().ToString();
                        data.Week         = Convert.ToInt32(value["Week"].GetValue());
                        data.TimeString   = value["TimeString"].GetValue().ToString();
                        data.Keyword      = value["Keyword"].GetValue().ToString();
                        data.ArchiveTitle = value["ArchiveTitle"].GetValue().ToString();

                        Data.DictSeason.Add(data.Title, data);
                    }
                }
            }

            ApplySettingToControl();
            InitTray();

            checkTray.Checked         += SettingCheck_Changed;
            checkTray.Unchecked       += SettingCheck_Changed;
            checkNoQuestion.Checked   += SettingCheck_Changed;
            checkNoQuestion.Unchecked += SettingCheck_Changed;
            checkShowRaws.Checked     += SettingCheck_Changed;
            checkShowRaws.Unchecked   += SettingCheck_Changed;

            ResourceManager rm = Simplist3.Properties.Resources.ResourceManager;

            Setting.ChangeLog = (string)rm.GetObject("ChangeLog");
        }