Beispiel #1
0
        public static void LoadSeason()
        {
            if (!File.Exists(fileOldSet))
            {
                return;
            }

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

            for (int i = 0; i < strSplitSeason.Length; i++)
            {
                string[] strSplit = strSplitSeason[i].Split(new string[] { "	"}, StringSplitOptions.RemoveEmptyEntries);

                SeasonData sdata = new SeasonData();

                sdata.Title        = strSplit[1];
                sdata.ArchiveTitle = strSplit[2];
                sdata.Keyword      = strSplit[3].Substring(1);
                sdata.Week         = Convert.ToInt32(strSplit[0][0].ToString());
                sdata.TimeString   = strSplit[0].Substring(2).Replace(":", "");

                if (!Data.DictArchive.ContainsKey(sdata.ArchiveTitle))
                {
                    continue;
                }
                Data.DictArchive[sdata.ArchiveTitle].SeasonTitle = sdata.Title;

                Data.DictSeason.Add(sdata.Title, sdata);
            }
        }
Beispiel #2
0
        private void DeleteSeason(string title)
        {
            SeasonData data = Data.DictSeason[title];

            (FindName(string.Format("containWeek{0}", data.Week)) as Container)
            .Delete(title);
        }
Beispiel #3
0
        public ListItem(SeasonData data, bool animate)
            : this(animate) {
            this.Title = data.Title;
            this.Time  = data.TimeString;

            this.Episode   = Data.DictArchive[data.ArchiveTitle].Episode;
            this.Reference = data.ArchiveTitle;
        }
Beispiel #4
0
        private void ModifySeason()
        {
            SeasonData data = Data.DictSeason[ModifyTag];

            DeleteSeason(ModifyTag);

            string newTitle = textboxTitle.Text.Trim();
            string arcTitle = data.ArchiveTitle;

            data.SetValue(newTitle, comboboxWeekday.SelectedIndex,
                          textboxHour.Text, textboxMinute.Text,
                          arcTitle, textboxKeyword.Text.Trim());

            Data.DictArchive[arcTitle].SeasonTitle = newTitle;
            Data.DictSeason.Add(data.Title, data);

            (FindName(string.Format("containWeek{0}", data.Week)) as Container).Add(true, data);

            RefreshArchiveEpisode(data.ArchiveTitle, textboxEpisode.Text);
        }
Beispiel #5
0
        private void AddSeason(string title, int weekday)
        {
            string archiveTitle = comboboxSync.SelectedValue as string;

            if (archiveTitle == null)
            {
                AddArchive(title, false);
                archiveTitle = title;
            }

            SeasonData data = new SeasonData();

            data.SetValue(title, weekday, textboxHour.Text, textboxMinute.Text,
                          archiveTitle, textboxKeyword.Text.Trim());

            Data.DictArchive[archiveTitle].SeasonTitle = title;

            Data.DictSeason.Add(data.Title, data);
            (FindName(string.Format("containWeek{0}", weekday)) as Container).Add(true, data);
        }
Beispiel #6
0
        public void Delete(string title)
        {
            stack.Children.Remove(ItemDicionary[title]);
            ItemDicionary.Remove(title);

            if (ContainerType == ListType.Season)
            {
                SeasonData data = Data.DictSeason[title];
                Data.DictArchive[data.ArchiveTitle].SeasonTitle = null;

                TableSeason.Remove(title);
                Data.DictSeason.Remove(title);
            }
            else
            {
                Data.DictArchive.Remove(title);
            }

            RefreshContainer();
        }
Beispiel #7
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");
        }
Beispiel #8
0
        private void ShowModifyWindow()
        {
            Mode = ShowMode.Modify;
            SetTitlebar(TabMode.Modify);

            gridAniTable.Visibility = Visibility.Collapsed;

            if (AddOpenMode == OpenMode.SeasonModify)
            {
                buttonOpenFolder.ViewMode = ImageButton.Mode.Hidden;
                buttonDisable.ViewMode    = ImageButton.Mode.Visible;
                buttonDelete.ViewMode     = ImageButton.Mode.Visible;

                gridModifyExtra.Visibility = Visibility.Visible;
                textSync.Visibility        = Visibility.Visible;
                comboboxSync.Visibility    = Visibility.Collapsed;
                textCaution.Visibility     = Visibility.Collapsed;
                textboxTitle.IsEnabled     = true;

                SeasonData data = Data.DictSeason[ModifyTag];

                textboxTitle.Text             = ModifyTag;
                comboboxWeekday.SelectedIndex = data.Week;
                textboxHour.Text    = data.TimeString.Substring(0, 2);
                textboxMinute.Text  = data.TimeString.Substring(2, 2);
                textSync.Text       = data.ArchiveTitle;
                textboxKeyword.Text = data.Keyword;

                RefreshDisableButton(data.ArchiveTitle);
            }
            else if (AddOpenMode == OpenMode.ArchiveModify)
            {
                if (Status.Root)
                {
                    buttonOpenFolder.ViewMode = ImageButton.Mode.Visible;
                }
                else
                {
                    buttonOpenFolder.ViewMode = ImageButton.Mode.Hidden;
                }

                buttonDisable.ViewMode = ImageButton.Mode.Visible;
                buttonDelete.ViewMode  = ImageButton.Mode.Visible;
                gridEpisode.Visibility = Visibility.Collapsed;

                if (Data.DictArchive[ModifyTag].SeasonTitle == null)
                {
                    textCaution.Visibility = Visibility.Collapsed;
                }
                else
                {
                    textCaution.Visibility = Visibility.Visible;
                    textCaution.Text       = string.Format("이 항목을 삭제하면 시즌 데이터의 항목도 삭제됩니다.\n\n\'{0}\'",
                                                           Data.DictArchive[ModifyTag].SeasonTitle);
                }

                gridModifyExtra.Visibility = Visibility.Collapsed;
                textboxTitle.IsEnabled     = false;

                textboxTitle.Text = ModifyTag;

                RefreshDisableButton(ModifyTag);
            }
            else
            {
                return;
            }

            textboxTitle.Focus();
            gridAddModify.IsHitTestVisible = true;
            AnimateAddModifyWindow(1, 0);
        }