예제 #1
0
 public ErrorListPad(Project project)
     : base(project)
 {
     InitializeComponent();
     listView.SmallImageList = imageList;
     CreateMenuItem("&Error List", MessyLab.Properties.Resources.ErrorList);
     CreateToolbarItem("Error List", MessyLab.Properties.Resources.ErrorList);
 }
예제 #2
0
        public WatchPad(Project project)
            : base(project)
        {
            InitializeComponent();
            CreateMenuItem("&Watch", MessyLab.Properties.Resources.Watch);
            CreateToolbarItem("Watch", MessyLab.Properties.Resources.Watch);
            ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockRight;

            WatchItems = new List<WatchItem>();
        }
예제 #3
0
        public HardwarePad(Project project)
            : base(project)
        {
            InitializeComponent();
            CreateMenuItem("&Hardware", MessyLab.Properties.Resources.Hardware);
            CreateToolbarItem("Hardware", MessyLab.Properties.Resources.Hardware);
            ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockRight;

            Content = new HardwareContent(listView);
        }
예제 #4
0
        public BreakpointsPad(Project project)
            : base(project)
        {
            InitializeComponent();
            CreateMenuItem("&Breakpoints", MessyLab.Properties.Resources.Breakpoints);
            CreateToolbarItem("Breakpoints", MessyLab.Properties.Resources.Breakpoints);
            ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft;

            ListViewItems = new Dictionary<BreakpointController.BreakpointDefinition, ListViewItem>();
            Breakpoints = new Dictionary<ListViewItem, BreakpointController.BreakpointDefinition>();

            NewMemoryBreakpointDialog = new NewMemoryBreakpointForm();
            NewRegisterBreakpointDialog = new NewRegisterBreakpointForm();
            NewIOBreakpointDialog = new NewIOBreakpointForm();
        }
예제 #5
0
파일: ListPad.cs 프로젝트: lazanet/messylab
 public ListPad(Project project)
     : base(project)
 {
     InitializeComponent();
     ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockBottomAutoHide;
     List = new List<ListItem>();
 }
예제 #6
0
파일: Pad.cs 프로젝트: lazanet/messylab
 public Pad(Project project)
     : this()
 {
     Project = project;
 }
예제 #7
0
        /// <summary>
        /// Creates a picoComputer project at the specified path.
        /// </summary>
        /// <param name="path">The path to the project file.</param>
        /// <returns>The created Project.</returns>
        protected Project CreatePicoProject(string path)
        {
            path = Path.GetFullPath(path);
            string dir = Path.GetDirectoryName(path);

            if (!Directory.Exists(dir))
            { Directory.CreateDirectory(dir); }

            if (Path.GetExtension(path).ToLower() != ".mlp")
            { path += ".mlp"; }

            Project p = new Project();
            p.SetPlatformByName("picoComputer");
            p.Path = path;

            // Create and add the Main item.
            var mainItem = p.Platform.ProjectItemFactory.CreateProjectItem(p, "Main");
            p.Items.Add(mainItem);
            p.MainItem = mainItem;

            p.Save(true);

            return p;
        }
 /// <summary>
 /// Creates a project item for specified parameters.
 /// </summary>
 /// <param name="project">The project to create item for.</param>
 /// <param name="relativePath">The relative path to the item file.</param>
 /// <returns>The created ProjectItem.</returns>
 public abstract ProjectItem CreateProjectItem(Project project, string relativePath);
예제 #9
0
        /// <summary>
        /// Opens the specified project.
        /// </summary>
        /// <param name="project">The project to open.</param>
        private void OpenProject(Project project)
        {
            CloseStartPage();
            CloseProject();

            OpenedProject = project;
            var pl = project.Platform;
            AddMenu(pl.Gui);
            AddToolbar(pl.Gui);

            pl.Gui.OpenPads();

            ShowEditorFor(project.MainItem);

            Text = System.IO.Path.GetFileNameWithoutExtension(project.Filename) + " - Messy Lab";

            // Notofy the RecentManager that the project has been opened.
            RecentManager.Notify(project.Path);
        }
예제 #10
0
        /// <summary>
        /// Opens the project from the specified path.
        /// </summary>
        /// <param name="path">Path to the project to open.</param>
        public void OpenProject(string path)
        {
            // Close currently open project with saving prompt.
            if (!CloseProjectClick()) return;

            Project p;
            try
            {
                p = new Project();
                p.Open(path);
            }
            catch (Exception e)
            {
                MessageBox.Show("Could not load selected project.\n\nException:\n" + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            OpenProject(p);
        }
예제 #11
0
        /// <summary>
        /// Closes the currently open project.
        /// </summary>
        public void CloseProject()
        {
            if (OpenedProject == null) return;
            RemoveMenu();
            RemoveToolbar();
            Text = "Messy Lab";

            // Close pads.
            foreach (var pad in OpenedProject.Platform.Gui.Pads)
            {
                pad.HideOnClose = false;
                pad.DockHandler.Close();
                pad.Dispose();
            }

            // Close editors.
            foreach (var item in OpenedProject.Items)
            {
                var ed = OpenedProject.Platform.Editors.GetEditorFormIfExists(item);
                if (ed != null)
                {
                    ed.DockHandler.Close();
                    ed.Dispose();
                }
            }

            // Stop debugging on an debuggable platform.
            var pl = OpenedProject.Platform as DebuggablePlatform;
            if (pl != null)
            {
                pl.DebuggerController.Stop();
            }

            OpenedProject = null;
        }