Example #1
0
 public WindowManager(IPathResolver pathResolver, DockPanel dockPanel, Settings settings)
 {
     m_settings = settings;
       m_fileEditorMap = new Dictionary<string, EditorContentBox>();
       m_pathResolver = pathResolver;
       m_dockPanel = dockPanel;
 }
Example #2
0
        public IronScriptManager(string mainScript, IPathResolver pathResolver, Settings settings)
        {
            m_settings = settings;
              m_pathResolver = pathResolver;
              m_mainScript = m_pathResolver.Resolve(mainScript);

              // Create script file if it doesn't exist
              if (!File.Exists(m_mainScript))
              {
            var stream = File.CreateText(m_mainScript);
            stream.Dispose();
              }

              // Create ruby engine
              m_engine = CreateAndInitEngine();
        }
Example #3
0
        public MainForm(IPathResolver pathResolver, IScriptManager scriptManager, Settings settings)
        {
            m_settings = settings;
              m_pathResolver = pathResolver;
              m_scriptMgr = scriptManager;

              InitializeComponent();

              // Window manager
              m_windowMgr = new WindowManager(m_pathResolver, dockPanel, m_settings);
              m_windowMgr.OnCaretChanged += new EventHandler<CaretChangedEventArgs>(WindowManagerOnCaretChanged);

              // Post component initialization
              openFileDialog.InitialDirectory = m_pathResolver.BaseDirectory;

              // Load output window
              m_outputContent = new OutputContentBox();
              m_outputContent.Show(dockPanel, DockState.DockBottom);

              // Load error window
              m_errorContent = new ErrorContentBox();
              m_errorContent.Show(dockPanel, DockState.DockBottom);
              m_errorContent.ErrorSelected += new EventOnErrorSelected(OnErrorSelected);

              // Adjust bottom panel
              dockPanel.DockBottomPortion = m_settings.DockBottom;
              dockPanel.DockRightPortion = m_settings.DockRight;
              dockPanel.DockLeftPortion = m_settings.DockLeft;
              dockPanel.DockTopPortion = m_settings.DockTop;

              // Attach event handlers
              m_scriptMgr.CompileFinished += new EventHandler(OnCompileFinished);
              m_scriptMgr.CompileInterrupted += new EventHandler(OnCompileInterrupted);
              m_scriptMgr.CompileStarting += new EventHandler(OnCompileStarting);
              m_scriptMgr.ScriptError += new EventHandler<ScriptErrorEventArgs>(OnScriptError);
              m_scriptMgr.ScriptOutput += new EventHandler<ScriptOutputEventArgs>(OnScriptOutput);

              m_scriptMgr.ScriptEngineRestarted += new EventHandler(OnScriptEngineRestarted);
              m_scriptMgr.ScriptEngineRestarting += new EventHandler(OnScriptEngineRestarting);

              // Disable Windows-XP default theme; use system colours
              ToolStripProfessionalRenderer renderer = new ToolStripProfessionalRenderer();
              renderer.ColorTable.UseSystemColors = true;
              renderer.RoundedEdges = true;
              ToolStripManager.Renderer = renderer;
        }