|
// -----------------------------------------------------------------------
// <copyright file="ConverterLocator.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace eShopping.Common.Converter
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// TODO: Update summary.
/// </summary>
public class ConverterLocator
{
public static IConverter Converter(string fullFilePath, string fileToSave)
{
IConverter converter = null;
string ext = fullFilePath.Split('.').Last().ToLower();
switch (ext)
{
case "doc": converter = new DocToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
case "docx": converter = new DocToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
case "dot": converter = new DocToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
case "dotx": converter = new DocToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
case "rtf": converter = new DocToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
case "xls": converter = new XlsToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
case "xlsx": converter = new XlsToHtml { FileToSave = fileToSave, FullFilePath = fullFilePath };
break;
}
return converter;
}
}
}
|
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.
I am vijay tanwar and i am a software engineer with passion of programming. I love to programming in c#, I love to warp up more and more things in few lines of code. my favirote languages are c# and javascript and both are fully object oriended. I always like to become the .net Architect.