Click here to Skip to main content
15,894,540 members
Articles / Programming Languages / C#

OLE container surrogate for .NET

Rate me:
Please Sign up or sign in to vote.
4.94/5 (15 votes)
13 Mar 2013CPOL1 min read 92.7K   5.1K   18  
COM OLE-container analog for .NET
/*
 * FileName: DefaultPreviewHostsMapping.cs
 * Author: Alexei Bouravtsev
 * Profiles: http://www.linkedin.com/pub/alexei-bouravtsev/13/201/293
 *           http://aleksey-buravtsev.moikrug.ru/
 */

using System;
using System.Collections.Generic;

namespace PreviewHandlers
{
    public static class DefaultPreviewHostsMapping
    {
        public static List<Tuple<PreviewHandlerHostBase, List<string>, bool>> PreviewHostsMapping { get; set; }

        static DefaultPreviewHostsMapping()
        {
            PreviewHostsMapping = new List<Tuple<PreviewHandlerHostBase, List<string>, bool>>();

            PreviewHandlerHostBase defaultHandlerHost = new DefaultPreviewHandlerHost();
            var defaultHandlerHostMapping = new Tuple<PreviewHandlerHostBase, List<string>, bool>(
                defaultHandlerHost,
                null,
                true
            );
            PreviewHostsMapping.Add(defaultHandlerHostMapping);

            PreviewHandlerHostBase browsertHandlerHost = new BrowserPreviewHandlerHost();
            var browserHandlerHostMapping = new Tuple<PreviewHandlerHostBase, List<string>, bool>(
                browsertHandlerHost,
                new List<string>() { "xml", "htm", "html" }, 
                false
            );
            PreviewHostsMapping.Add(browserHandlerHostMapping);

            PreviewHandlerHostBase imageHandlerHost = new ImagePreviewHandlerHost();
            var imageHandlerHostMapping = new Tuple<PreviewHandlerHostBase, List<string>, bool>(
                imageHandlerHost,
                new List<string>() { "tif", "tiff", "jpg", "jpeg", "bmp", "gif", "png" },
                false
            );

            PreviewHostsMapping.Add(imageHandlerHostMapping);
        }
    }
}

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
Software Developer (Senior) GNIVC
Russian Federation Russian Federation
I'm a Russian (Moscow Aviational Institute 1996-2002) Software Engineer living in Moscow, Russia. I have a long experience in Windows programming and have been developing large GUI, Real Time Enterprise Client/Server C# applications and SQL Server/Oracle databases.

My point of interests is high load enterprise applications.

Comments and Discussions