Click here to Skip to main content
15,886,072 members
Articles / Desktop Programming / WPF

Marsa: A 3D approach to XML read data

,
Rate me:
Please Sign up or sign in to vote.
4.92/5 (109 votes)
30 Jun 2008CPOL13 min read 254.1K   2K   182  
WPF: An article on using 3D visualization of an RSS feed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace MarsaX
{
    static class Constants
    {
        static Constants()
        {
            //read the values from App.Config
            int.TryParse(ConfigurationSettings.AppSettings["rows"].ToString(), out Constants.ROWS);
            int.TryParse(ConfigurationSettings.AppSettings["columns"].ToString(), out Constants.COLUMNS); 
            bool.TryParse(ConfigurationSettings.AppSettings["should3DModelFlipOnMouseOver"].ToString(), 
                out Constants.should3DModelFlipOnMouseOver);
            Constants.savedImageLocation = 
                ConfigurationSettings.AppSettings["savedImageLocation"].ToString() != string.Empty ?
                ConfigurationSettings.AppSettings["savedImageLocation"].ToString() : @"c:\";
            bool.TryParse(ConfigurationSettings.AppSettings["stretchImagesFor3DModels"].ToString(),
                out Constants.stretchImagesFor3DModels);  
        }


        #region Data
        //These cant be bigger than 2 and 25 as Yahoo ImageSearch API 
        //has a limit of 50 (so ROWS * COLS can't be > 50)
        public static int ROWS = 2;
        public static int COLUMNS = 25;
        //Dictates what happens when mouse moves over 3d model. 
        //If True 3d Model rotates around its X-Axis
        public static bool should3DModelFlipOnMouseOver = false;
        //Just to be able to use it as the Maximum for the Slider control 
        //(since Slider supports binding to Doubles ONLY)
        //allow 5 images to be shown when fully scrolled
        public static double COLUMNSTOSHOW = (double)COLUMNS-5; 
        //Saved image default location
        public static string savedImageLocation = @"c:\";
        //Set this true to stretch images to fill 3D model, 
        //otherwise images will be shown at natural ratio
        public static bool stretchImagesFor3DModels = true;


        #endregion
    }
}

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)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Written By
Other Uniblue Systems (www.uniblue.com)
Malta Malta
Check out my Blog
http://marlongrech.wordpress.com/

Currently building a WPF Controls library aka AvalonControlsLibrary
http://marlongrech.wordpress.com/avalon-controls-library/

Comments and Discussions