Example #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            Favorites = await FavoriteHelper.LoadFavorites();

            FavoritesACV = new AdvancedCollectionView(Favorites, true);
            FavoritesACV.SortDescriptions.Add(new SortDescription("Title", SortDirection.Ascending));
            ShowEmptyNotify();
        }
Example #2
0
        public FormCodeLibrary()
        {
            InitializeComponent();
            DoubleBuffered   = true;
            _stateIconHelper = new StateIconHelper(this);

            _textboxHelper          = new TextBoxHelper(this);
            _themeHelper            = new ThemeHelper(this);
            _debugHelper            = new DebugHelper(this, _stateIconHelper);
            _passwordHelper         = new PasswordHelper(this, _stateIconHelper);
            _fileHelper             = new FileHelper(this, _debugHelper, _textboxHelper, _passwordHelper, _stateIconHelper);
            _treeHelper             = new TreeviewHelper(this, _textboxHelper, _fileHelper, _themeHelper);
            _fileHelper.TreeHelper  = _treeHelper;
            _FavoriteHelper         = new FavoriteHelper(this, _fileHelper);
            _clipboardMonitorHelper = new ClipboardMonitorHelper(this, _textboxHelper, _treeHelper, _stateIconHelper);
            _menuHelper             = new MenuHelper(this, _treeHelper, _FavoriteHelper);

            containerLeft.Dock = DockStyle.Fill;

            treeViewLibrary.Top    = 29;
            treeViewLibrary.Left   = 0;
            treeViewLibrary.Width  = containerTreeview.Width + 1;
            treeViewLibrary.Height = containerTreeview.Height - 29;

            mncChangeType.DropDownOpening += mncChangeType_DropDownOpening;
            mnuChangeType.DropDownOpening += mnuChangeType_DropDownOpening;

            containerCode.Location = new Point(0, 28);
            containerCode.Size     = new Size(splitContainerMain.Panel2.Width, splitContainerMain.Panel2.Height - 52);
            containerCode.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;

            containerRtfEditor.Location = new Point(0, 28);
            containerRtfEditor.Size     = new Size(splitContainerMain.Panel2.Width, splitContainerMain.Panel2.Height - 52);
            containerRtfEditor.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            rtfEditor.Dock = DockStyle.Fill;

            webBrowser.Dock = DockStyle.Fill;
            webBrowser.ScriptErrorsSuppressed = true;
            webBrowser.AllowWebBrowserDrop    = false;
            webBrowser.DocumentText           = "";

            splitContainerCode.Dock = DockStyle.Fill;

            containerImage.Location = new Point(0, 28);
            containerImage.Size     = new Size(splitContainerMain.Panel2.Width, splitContainerMain.Panel2.Height - 52);
            containerImage.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            imageViewer.Dock        = DockStyle.Fill;

            containerCode.BringToFront();

            fastColoredTextBox.Dock = DockStyle.Fill;

            containerTreeview.BringToFront();
        }
Example #3
0
        private void RemoveButton_Click(object sender, RoutedEventArgs e)
        {
            var currentItem = VisualHelper.GetListViewItem <FavoriteKeyModel>(sender as Button);

            if (currentItem != null)
            {
                var item = Favorites.Where(item => item.Key.Equals(currentItem.Key));

                Favorites.Remove(item.SingleOrDefault());
                FavoriteHelper.AddToFavorite(0, currentItem);
                ShowEmptyNotify();
            }
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            var param = (NavigationParamModel)e?.Parameter;

            if (param != null)
            {
                subtitleUrl   = param.Link;
                subtitleKey   = param.Key;
                subtitleTitle = param.Title;
                txtTitle.Text = param.Title;
                if (await FavoriteHelper.IsFavoriteExist(subtitleKey))
                {
                    Favorite.Value = 1;
                }
            }

            if (!string.IsNullOrEmpty(subtitleUrl))
            {
                GetSubtitle();
            }
        }
Example #5
0
 private void Favorite_ValueChanged(RatingControl sender, object args)
 {
     FavoriteHelper.AddToFavorite(Favorite.Value, new FavoriteKeyModel {
         Key = subtitleKey, Title = subtitleTitle, Value = subtitleUrl, Server = Server.WorldSubtitle
     });
 }
 private void Favorite_ValueChanged(RatingControl sender, object args)
 {
     FavoriteHelper.AddToFavorite(Favorite.Value, new FavoriteKeyModel {
         Key = subtitleKey, Title = subtitleTitle, Value = subtitleUrl.Replace(Helper.Settings.SubsceneServer.Url, ""), Server = Server.Subscene
     });
 }