Beispiel #1
0
        public TeaseForm(string[] args)
        {
            InitializeComponent();

            Text = AssemblyTitle + " " + AssemblyVersion;

            debugForm = new DebugForm(this);

            teaseLibrary = new TeaseLibrary(ApplicationDirectory);

            var arguments     = new List <string>(args);
            var fullscreenArg = arguments.FirstOrDefault(x => x.Equals("/full", StringComparison.OrdinalIgnoreCase));

            if (fullscreenArg != null)
            {
                Fullscreen();
                arguments.Remove(fullscreenArg);
            }
            var fileArg = arguments.FirstOrDefault(x => x.StartsWith("/tease:", StringComparison.OrdinalIgnoreCase));

            if (fileArg != null)
            {
                string fileName = fileArg.Remove(0, "/tease:".Length);
                if (File.Exists(fileName))
                {
                    SetCurrentTease(teaseLibrary.LoadTease(fileName));
                }
                else
                {
                    fileName = Path.Combine(teaseLibrary.TeasesFolder, fileName);
                    if (File.Exists(fileName))
                    {
                        SetCurrentTease(teaseLibrary.LoadTease(fileName));
                    }
                    else
                    {
                        SetCurrentTease(teaseLibrary.EmptyTease());
                    }
                }
            }
            else
            {
                SetCurrentTease(teaseLibrary.EmptyTease());
            }
        }
Beispiel #2
0
        public TeaseForm(string[] args)
        {
            InitializeComponent();

            Text = AssemblyTitle + " " + AssemblyVersion;

            debugForm = new DebugForm(this);

            teaseLibrary = new TeaseLibrary(ApplicationDirectory);

            var arguments = new List<string>(args);
            var fullscreenArg = arguments.FirstOrDefault(x => x.Equals("/full", StringComparison.OrdinalIgnoreCase));
            if (fullscreenArg != null)
            {
                Fullscreen();
                arguments.Remove(fullscreenArg);
            }
            var fileArg =  arguments.FirstOrDefault(x => x.StartsWith("/tease:", StringComparison.OrdinalIgnoreCase));
            if (fileArg != null)
            {
                string fileName = fileArg.Remove(0, "/tease:".Length);
                if (File.Exists(fileName))
                {
                    SetCurrentTease(teaseLibrary.LoadTease(fileName));
                }
                else
                {
                    fileName = Path.Combine(teaseLibrary.TeasesFolder, fileName);
                    if (File.Exists(fileName))
                    {
                        SetCurrentTease(teaseLibrary.LoadTease(fileName));
                    }
                    else
                    {
                        SetCurrentTease(teaseLibrary.EmptyTease());
                    }
                }
            }
            else
            {
                SetCurrentTease(teaseLibrary.EmptyTease());
            }
        }