Exemple #1
0
        //private void ShowProperties()

        private void buttonFavourite_Click(object sender, RoutedEventArgs e)
        {
            var displayInfo = (DisplayInfo)stackPanelInfo.DataContext;

            if (displayInfo == null)
            {
                return;
            }
            if (System.IO.Path.GetExtension(displayInfo.Path) == "")
            {
                if (Favourite.IsFavouriteFolder(displayInfo.Path))
                {
                    Favourite.DeleteFavourite(displayInfo.Path);
                    MessageBox.Show(
                        "Đã xóa " + displayInfo.Path + "khỏi favourite",
                        "Hoàn tất",
                        MessageBoxButton.OK,
                        MessageBoxImage.Asterisk);
                }
                else
                {
                    Favourite.AddFavourite(displayInfo.Path);
                    MessageBox.Show(
                        "Đã thêm " + displayInfo.Path + "vào favourite",
                        "Hoàn tất",
                        MessageBoxButton.OK,
                        MessageBoxImage.Asterisk);
                }
                LoadTreeFolder();
                Display(displayInfo.Path, null);
            }
        }
Exemple #2
0
        private void RefreshStackPanelInfo(string filePath)
        {
            if (filePath == null)
            {
                return;
            }
            FileInfo    fileInfo    = new FileInfo(filePath);
            DisplayInfo displayInfo = new DisplayInfo();

            displayInfo.Icon           = wExp.Icon.GetIconFromExtension((fileInfo.Extension != "") ? fileInfo.Extension : ".folder");
            displayInfo.Name           = Truncate(fileInfo.Name, 28);
            displayInfo.Extension      = (fileInfo.Extension != "") ? fileInfo.Extension : "folder";
            displayInfo.DateModified   = "DateModifies " + fileInfo.CreationTime.ToShortDateString();
            displayInfo.Path           = filePath;
            stackPanelInfo.DataContext = displayInfo;
            if (Favourite.IsFavouriteFolder(displayInfo.Path))
            {
                favouriteText.Text = "Unfavourite this!";
            }
            else
            {
                favouriteText.Text = "Favourite this!";
            }
            if (displayInfo.Extension != "folder")
            {
                buttonFavourite.Visibility = Visibility.Hidden;
            }
            else
            {
                buttonFavourite.Visibility = Visibility.Visible;
            }
        }