コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: sr3dna/big5sync
 /// <summary>
 /// Displays the Default Tag Window
 /// </summary>
 private void DisplayTagWindow()
 {
     TagWindow tw = new TagWindow(this, "", SelectedTag, false);
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: sr3dna/big5sync
        /// <summary>
        /// Displays the tag window for a given p.ath
        /// </summary>
        /// <param name="clipath">Path from Commandline</param>
        public void CliTag(string clipath)
        {
            string tagname = "";

            if (FileFolderHelper.IsFile(clipath))
            {
                DialogHelper.ShowError(this, "Tagging not Allowed", "You cannot tag a file.");
                return;
            }

            try
            {
                DirectoryInfo di = new DirectoryInfo(clipath);
                tagname = di.Name;
            }
            catch (Exception)
            {
                DialogHelper.ShowError(this, "Invalid Folder", "You cannot tag this folder.");
                return;
            }

            TagWindow tw = new TagWindow(this, clipath, tagname, true);
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: sr3dna/big5sync
        /// <summary>
        /// Mechanism which will handle any item that has been dragged into Syncless and dropped onto it.
        /// After dropping and if item is a valid folder, the tag window will be displayed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LayoutRoot_Drop(object sender, DragEventArgs e)
        {
            try
            {
                HideDropIndicator();

                // If it is of file/drop type
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    // Get all items that have been dropped and loops through them
                    string[] foldernames = e.Data.GetData(DataFormats.FileDrop, true) as string[];
                    if (foldernames != null)
                        foreach (string i in foldernames)
                        {
                            string path = i;

                            // convert potential shortcuts into folders
                            string shortcutfolderpath = FileFolderHelper.GetShortcutTargetFile(i);
                            if (shortcutfolderpath != null)
                            {
                                path = shortcutfolderpath;
                            }

                            // Check for the existence of folders
                            try
                            {
                                DirectoryInfo folder = new DirectoryInfo(path);
                                if (folder.Exists && !FileFolderHelper.IsFile(path))
                                {
                                    // displays the tag window for each folder
                                    TagWindow tw = new TagWindow(this, path, SelectedTag, false);
                                }
                            } catch {}  // do nothing, and this is the desired behavior. move on with the tagging process
                                        // if an exception was encountered.
                        }
                }
                TxtBoxFilterTag.IsHitTestVisible = true;
            }
            catch (UnhandledException)
            {
                DialogHelper.DisplayUnhandledExceptionMessage(this);
            }
        }