Пример #1
0
        static void Main(string [] args)
        {
#if WINDOWS
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            History.Default.Load();

			var view = new MainView();
            if (args != null && args.Length > 0)
            {
                var projectFilePath = string.Join(" ", args);
                view.OpenProjectPath = projectFilePath;
            }

            var model = new PipelineProject();
            var controller = new PipelineController(view, model);   
            Application.Run(view);
#endif
#if LINUX || MONOMAC

			Gtk.Application.Init ();
			MainWindow win = new MainWindow ();
			win.Show (); 
			var model = new PipelineProject();
			new PipelineController(win, model);  
			if (args != null && args.Length > 0)
			{
				var projectFilePath = string.Join(" ", args);
				win.OpenProjectPath = projectFilePath;
			}
			win.OnShowEvent ();
			Gtk.Application.Run ();
#endif
        }
Пример #2
0
        public MainView()
        {            
            InitializeComponent();

            // Find an appropriate font for console like output.
            var faces = new [] { "Consolas", "Lucida Console", "Courier New" };
            for (var f=0; f < faces.Length; f++)
            {
                _outputWindow.Font = new System.Drawing.Font(faces[f], 9F, FontStyle.Regular, GraphicsUnit.Point, (byte)0);
                if (_outputWindow.Font.Name == faces[f])
                    break;               
            }

            _outputWindow.SelectionHangingIndent = TextRenderer.MeasureText(" ", _outputWindow.Font).Width;            

            _treeIcons = new ImageList();
            _treeIcons.Images.Add(Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(@"MonoGame.Tools.Pipeline.Icons.blueprint.png")));
            _treeIcons.Images.Add(Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(@"MonoGame.Tools.Pipeline.Icons.folder_open.png")));
            _treeIcons.Images.Add(Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(@"MonoGame.Tools.Pipeline.Icons.folder_closed.png")));
            _treeIcons.Images.Add(Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(@"MonoGame.Tools.Pipeline.Icons.settings.png")));
            _treeIcons.Images.Add(Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(@"MonoGame.Tools.Pipeline.Icons.font.png")));
            
            _treeView.ImageList = _treeIcons;
            _treeView.BeforeExpand += TreeViewOnBeforeExpand;
            _treeView.BeforeCollapse += TreeViewOnBeforeCollapse;
            _treeView.NodeMouseClick += TreeViewOnNodeMouseClick;
            _treeView.NodeMouseDoubleClick += TreeViewOnNodeMouseDoubleClick;

            _propertyGrid.PropertyValueChanged += OnPropertyGridPropertyValueChanged;

            Form = this;
        }
Пример #3
0
        public MainView()
        {            
            InitializeComponent();

            // Set the application icon this form.
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            // Find an appropriate font for console like output.
            var faces = new [] { "Consolas", "Lucida Console", "Courier New" };
            for (var f=0; f < faces.Length; f++)
            {
                _outputWindow.Font = new System.Drawing.Font(faces[f], 9F, FontStyle.Regular, GraphicsUnit.Point, (byte)0);
                if (_outputWindow.Font.Name == faces[f])
                    break;               
            }

            _outputWindow.SelectionHangingIndent = TextRenderer.MeasureText(" ", _outputWindow.Font).Width;            

            _treeIcons = new ContentIcons();
            
            _treeView.ImageList = _treeIcons.Icons;
            _treeView.BeforeExpand += TreeViewOnBeforeExpand;
            _treeView.BeforeCollapse += TreeViewOnBeforeCollapse;
            _treeView.NodeMouseClick += TreeViewOnNodeMouseClick;
            _treeView.NodeMouseDoubleClick += TreeViewOnNodeMouseDoubleClick;

            _propertyGrid.PropertyValueChanged += OnPropertyGridPropertyValueChanged;

            InitOutputWindowContextMenu();

            Form = this;
        }
Пример #4
0
        static void Main(string [] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var view = new MainView();
            if (args != null && args.Length > 0)
            {
                var projectFilePath = string.Join(" ", args);
                view.OpenProjectPath = projectFilePath;
            }

            var model = new PipelineProject();
            var controller = new PipelineController(view, model);   
            Application.Run(view);
        }
Пример #5
0
        static void Main(string [] args)
        {
#if WINDOWS
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            PipelineSettings.Default.Load();

			var view = new MainView();
            if (args != null && args.Length > 0)
            {
                var projectFilePath = string.Join(" ", args);
                view.OpenProjectPath = projectFilePath;
            }

            var controller = new PipelineController(view);
            Application.Run(view);
#endif
#if LINUX || MONOMAC

			Gtk.Application.Init ();
            Global.Initalize ();
			MainWindow win = new MainWindow ();
			win.Show (); 
			new PipelineController(win);
			#if LINUX
			if (args != null && args.Length > 0)
			{
				var projectFilePath = string.Join(" ", args);
				win.OpenProjectPath = projectFilePath;
			}
			#elif MONOMAC
			var project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
			if (!string.IsNullOrEmpty (project)) {
				win.OpenProjectPath = project;
			}
			#endif
			win.OnShowEvent ();
			Gtk.Application.Run ();
#endif
        }