コード例 #1
0
        private void CommandBinding_OpenFolder2(object sender, ExecutedRoutedEventArgs e)
        {
            object obj = e.Parameter;

            if (obj == null)
            {
                return;
            }

            try
            {
                if (obj.GetType() == typeof(CL_DuplicateFile))
                {
                    CL_DuplicateFile df = obj as CL_DuplicateFile;
                    if (File.Exists(df.GetLocalFilePath2()))
                    {
                        Utils.OpenFolderAndSelectFile(df.GetLocalFilePath2());
                    }
                    else
                    {
                        MessageBox.Show(Shoko.Commons.Properties.Resources.MSG_ERR_FileNotFound, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
コード例 #2
0
        private void CommandBinding_PlayVideo2(object sender, ExecutedRoutedEventArgs e)
        {
            object obj = e.Parameter;

            if (obj == null)
            {
                return;
            }

            try
            {
                if (obj.GetType() == typeof(CL_DuplicateFile))
                {
                    CL_DuplicateFile df = obj as CL_DuplicateFile;
                    Process.Start(new ProcessStartInfo(df.GetLocalFilePath2()));
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
            finally
            {
                Cursor = Cursors.Arrow;
            }
        }