Click here to Skip to main content
15,893,564 members
Articles / Desktop Programming / Windows Forms

Document Preview Application

Rate me:
Please Sign up or sign in to vote.
4.74/5 (25 votes)
2 Jul 2009CPOL2 min read 133.2K   12.6K   89  
An application to preview your documents and files such as PDF, Doc, JPG, PPT, XSL.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using DocExp.Attributes;

namespace DocExp.AbstractClasses
{
    
    public abstract class Action
    {
        public abstract void DoAction(string path,FileType parFileType,frmMain frm);
        public void ShowError(string errorMessage)
        {
            MessageBox.Show(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            
        }
        public bool FileExists(string path)
        {
            if (File.Exists(path))
            {
                return true;
            }
            else
            {
                ShowError("File is not accessable");
                return false;
            }
        }
        public bool DirectoryExists(string path)
        {
            if (Directory.Exists(path))
            {
                return true;
            }
            else
            {
                ShowError("Directory is not accessable");
                return false;
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
Turkey Turkey
Tamer Oz is a Microsoft MVP and works as Assistant Unit Manager.

Comments and Discussions