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

Grandiose projects 5. Audio support

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
3 Feb 2012CPOL8 min read 23.2K   2K   8  
Audio support for grandiose projects
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace BasicEngineeringUIFactory
{
    /// <summary>
    /// Static extension
    /// </summary>
    public static class StaticExtensionBasicEngineering
    {
        /// <summary>
        /// Plays error
        /// </summary>
        static public void PlayError()
        {
          System.IO.Stream st =  Properties.Resources.Error;
          System.Media.SoundPlayer pl = new System.Media.SoundPlayer();
          pl.Stream = st;
          pl.Play();
        }
  
        public static string Server
        {
            get
            {
                return Properties.Settings.Default.Server;
            }
            set
            {
                Properties.Settings.Default.Server = value;
            }
        }

        public static string SoundDirectory
        {
            get
            {
                SoundService.SoundCollection.SoundDirectory = Properties.Settings.Default.SoundDirectory;
                return Properties.Settings.Default.SoundDirectory;
            }
            set
            {
                string dir = value;
                if (dir[dir.Length - 1] != System.IO.Path.DirectorySeparatorChar)
                {
                    dir += System.IO.Path.DirectorySeparatorChar;
                }
                Properties.Settings.Default.SoundDirectory = dir;
                SoundService.SoundCollection.SoundDirectory = dir;
            }
        }

        public static double StartTime
        {
            get
            {
                return Properties.Settings.Default.StartTime;
            }
            set
            {
                Properties.Settings.Default.StartTime = value;
            }
        }

        public static int Pause
        {
            get
            {
                return Properties.Settings.Default.Pause;
            }
            set
            {
                Properties.Settings.Default.Pause = value;
            }
        }

        public static int TimeIndicator
        {
            get
            {
                return Properties.Settings.Default.TimeIndicator;
            }
            set
            {
                Properties.Settings.Default.TimeIndicator = value;
            }
        }


        public static int StartStep
        {
            get
            {
                return Properties.Settings.Default.StartStep;
            }
            set
            {
                Properties.Settings.Default.StartStep = value;
            }
        }

        public static int StepCount
        {
            get
            {
                return Properties.Settings.Default.StepCount;
            }
            set
            {
                Properties.Settings.Default.StepCount = value;
            }
        }

        public static double Step
        {
            get
            {
                return Properties.Settings.Default.Step;
            }
            set
            {
                Properties.Settings.Default.Step = value;
            }
        }

        public static global::System.Collections.Specialized.StringCollection ConnectionStrings
        {
            get
            {
                return Properties.Settings.Default.ConnectionStrings;
            }
            set
            {
                Properties.Settings.Default.ConnectionStrings = value;
            }
        }

        public static string SavedState
        {
            get
            {
                return Properties.Settings.Default.SavedState;
            }
            set
            {
                Properties.Settings.Default.SavedState = value;
            }
        }

        public static int Top
        {
            get
            {
                return Properties.Settings.Default.Top;
            }
            set
            {
                Properties.Settings.Default.Top = value;
            }
        }

        public static int Left
        {
            get
            {
                return Properties.Settings.Default.Left;
            }
            set
            {
                Properties.Settings.Default.Left = value;
            }
        }

        public static int Width
        {
            get
            {
                return Properties.Settings.Default.Width;
            }
            set
            {
                Properties.Settings.Default.Width = value;
            }
        }

        public static int Height
        {
            get
            {
                return Properties.Settings.Default.Height;
            }
            set
            {
                Properties.Settings.Default.Height = value;
            }
        }

        public static double LeftPortion
        {
            get
            {
                return Properties.Settings.Default.LeftPortion;
            }
            set
            {
                Properties.Settings.Default.LeftPortion = value;
            }
        }

        public static double RightPortion
        {
            get
            {
                return Properties.Settings.Default.RightPortion;
            }
            set
            {
                Properties.Settings.Default.RightPortion = value;
            }
        }

        public static bool ShowTree
        {
            get
            {
                return Properties.Settings.Default.ShowTree;
            }
            set
            {
                Properties.Settings.Default.ShowTree = value;
            }
        }

        public static bool ShowTools
        {
            get
            {
                return Properties.Settings.Default.ShowTools;
            }
            set
            {
                Properties.Settings.Default.ShowTools = value;
            }
        }

        public static bool ShowDatabase
        {
            get
            {
                return Properties.Settings.Default.ShowDatabase;
            }
            set
            {
                Properties.Settings.Default.ShowDatabase = value;
            }
        }

        public static bool FullScreen
        {
            get
            {
                return Properties.Settings.Default.FullScreen;
            }
            set
            {
                Properties.Settings.Default.FullScreen = value;
            }
        }

        public static int CheckLevel
        {
            get
            {
                return Properties.Settings.Default.CheckLevel;
            }
            set
            {
                Properties.Settings.Default.CheckLevel = value;
            }
        }

        public static void Save()
        {
            Properties.Settings.Default.Save();
        }
    }
}

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
Architect
Russian Federation Russian Federation
Ph. D. Petr Ivankov worked as scientific researcher at Russian Mission Control Centre since 1978 up to 2000. Now he is engaged by Aviation training simulators http://dinamika-avia.com/ . His additional interests are:

1) Noncommutative geometry

http://front.math.ucdavis.edu/author/P.Ivankov

2) Literary work (Russian only)

http://zhurnal.lib.ru/editors/3/3d_m/

3) Scientific articles
http://arxiv.org/find/all/1/au:+Ivankov_Petr/0/1/0/all/0/1

Comments and Discussions