void loadFile_Click(object sender, MouseEventArgs mouseEvent)
        {
            GuiHalWidget.OpenFileDialogParams openParams = new GuiHalWidget.OpenFileDialogParams("MatterScript Files,c-sharp code", "*.part,*.cs");

            Stream streamToLoadFrom = GuiHalFactory.PrimaryHalWidget.OpenFileDialog(openParams);

            if (streamToLoadFrom != null)
            {
                loadedFileName = openParams.FileName;
                string extension = System.IO.Path.GetExtension(openParams.FileName).ToUpper(CultureInfo.InvariantCulture);
                if (extension == ".CS")
                {
                    loadedSourceFileType = SourceFileType.CSharp;
                }
                else if (extension == ".VB")
                {
                    loadedSourceFileType = SourceFileType.VisualBasic;
                }

                //string text = System.IO.File.ReadAllText(loadedFileName);

                StreamReader streamReader = new StreamReader(streamToLoadFrom);
                matterScriptEditor.Text = streamReader.ReadToEnd();
                streamToLoadFrom.Close();

                verticleSpliter.SplitterDistance = verticleSpliter.SplitterDistance - 1;
                verticleSpliter.SplitterDistance = verticleSpliter.SplitterDistance + 1;
            }
        }
        void openFileButton_ButtonClick(object sender, MouseEventArgs mouseEvent)
        {
            GuiHalWidget.OpenFileDialogParams openParams = new GuiHalWidget.OpenFileDialogParams("3D Mesh Files|*.stl;*.amf");
            Stream streamToLoadFrom = GuiHalFactory.PrimaryHalWidget.OpenFileDialog(openParams);

            MeshViewWidget.LoadMesh(openParams.FileName);

            Invalidate();
        }
        void loadFile_Click(object sender, MouseEventArgs mouseEvent)
        {
            GuiHalWidget.OpenFileDialogParams openParams = new GuiHalWidget.OpenFileDialogParams("MatterScript Files,c-sharp code", "*.part,*.cs");

            Stream streamToLoadFrom = GuiHalFactory.PrimaryHalWidget.OpenFileDialog(openParams);
            if (streamToLoadFrom != null)
            {
                loadedFileName = openParams.FileName;
                string extension = System.IO.Path.GetExtension(openParams.FileName).ToUpper(CultureInfo.InvariantCulture);
                if (extension == ".CS")
                {
                    loadedSourceFileType = SourceFileType.CSharp;
                }
                else if (extension == ".VB")
                {
                    loadedSourceFileType = SourceFileType.VisualBasic;
                }

                //string text = System.IO.File.ReadAllText(loadedFileName);

                StreamReader streamReader = new StreamReader(streamToLoadFrom);
                matterScriptEditor.Text = streamReader.ReadToEnd();
                streamToLoadFrom.Close();

                verticleSpliter.SplitterDistance = verticleSpliter.SplitterDistance - 1;
                verticleSpliter.SplitterDistance = verticleSpliter.SplitterDistance + 1;
            }
        }
        void openFileButton_ButtonClick(object sender, MouseEventArgs mouseEvent)
        {
            GuiHalWidget.OpenFileDialogParams openParams = new GuiHalWidget.OpenFileDialogParams("3D Mesh Files|*.stl;*.amf");
            Stream streamToLoadFrom = GuiHalFactory.PrimaryHalWidget.OpenFileDialog(openParams);

            MeshViewWidget.LoadMesh(openParams.FileName);

            Invalidate();
        }