コード例 #1
0
        static void Main(string[] args)
        {
            var platform = Platform.Detect;

            var app = new Application(platform);

            Styles.Load();

            var win        = new MainWindow();
            var controller = PipelineController.Create(win);

            string project = null;

            if (Global.Unix && !Global.Linux)
            {
                project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
            }
            else if (args != null && args.Length > 0)
            {
                project = string.Join(" ", args);
            }

            if (!string.IsNullOrEmpty(project))
            {
                controller.OpenProject(project);
            }

            app.Run(win);
        }
コード例 #2
0
 public MoveAction(IProjectItem item, string newname)
 {
     _con     = Instance;
     _oldname = Path.GetFileName(item.OriginalPath);
     _newname = newname;
     _item    = item;
 }
コード例 #3
0
 public IncludeAction(List <IncludeItem> includes)
 {
     _items     = new List <IProjectItem>();
     _con       = Instance;
     _includes  = includes;
     _firsttime = true;
 }
コード例 #4
0
 public NewAction(PipelineController controller, string name, string location, ContentItemTemplate template)
 {
     _con      = controller;
     _name     = name;
     _location = location;
     _template = template;
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: SiSsi9873/zy1-monogame
        static void Main(string[] args)
        {
            var app = new Application(Platform.Detect);

            Styles.Load();

#if WINDOWS
            Xwt.Application.InitializeAsGuest(Xwt.ToolkitType.Wpf);
#elif LINUX
            Xwt.Application.InitializeAsGuest(Xwt.ToolkitType.Gtk3);
#endif

            var win        = new MainWindow();
            var controller = PipelineController.Create(win);

            string project = null;

            if (Global.Unix && !Global.Linux)
            {
                project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
            }
            else if (args != null && args.Length > 0)
            {
                project = string.Join(" ", args);
            }

            if (!string.IsNullOrEmpty(project))
            {
                controller.OpenProject(project);
            }

            app.Run(win);
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: yadiate/MonoGame
        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
        }
コード例 #7
0
 public NewAction(PipelineController controller, string name, string location, ContentItemTemplate template)
 {
     _con = controller;
     _name = name;
     _location = location;
     _template = template;                
 }
コード例 #8
0
        private PipelineController(IView view)
        {
            Instance = this;
            PipelineSettings.Default.Load();

            SelectedItems = new List <IProjectItem>();
            _actionStack  = new ActionStack(this);

            View = view;
            View.Attach(this);
            ProjectOpen = false;

            _watcher = new FileWatcher(this, view);

            _templateItems = new List <ContentItemTemplate>();
            var root = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (Directory.Exists(Path.Combine(root, "..", "Resources", "Templates")))
            {
                root = Path.Combine(root, "..", "Resources");
            }
            LoadTemplates(Path.Combine(root, "Templates"));
            UpdateMenu();

            view.UpdateRecentList(PipelineSettings.Default.ProjectHistory);
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: BrainSlugs83/MonoGame
        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
        }
コード例 #10
0
ファイル: PipelineController.cs プロジェクト: zad15c/MonoGame
        private PipelineController(IView view)
        {
            Instance = this;

            SelectedItems = new List <IProjectItem>();
            _actionStack  = new ActionStack(this);

            View = view;
            View.Attach(this);
            ProjectOpen = false;

            _templateItems = new List <ContentItemTemplate>();
            var root                = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var macPath             = Path.Combine(root, "..", "Resources");
            var windowsAndLinuxPath = Path.Combine(root, "Templates");

#if IDE
            LoadTemplates(root);
#else
            if (Directory.Exists(macPath))
            {
                LoadTemplates(macPath);
            }
            else
            {
                LoadTemplates(windowsAndLinuxPath);
            }
#endif

            UpdateMenu();

            view.UpdateRecentList(PipelineSettings.Default.ProjectHistory);
        }
コード例 #11
0
        static void Main(string[] args)
        {
            Styles.Load();

            var app = new Application(Platform.Detect);

            app.Style = "PipelineTool";

            var win        = new MainWindow();
            var controller = PipelineController.Create(win);

#if LINUX
            Global.Application.AddWindow(win.ToNative() as Gtk.Window);
#endif

            string project = null;

            if (Global.Unix && !Global.Linux)
            {
                project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
            }
            else if (args != null && args.Length > 0)
            {
                project = string.Join(" ", args);
            }

            if (!string.IsNullOrEmpty(project))
            {
                controller.OpenProject(project);
            }

            app.Run(win);
        }
コード例 #12
0
            public MoveAction(PipelineController controller, string[] paths, string[] newpaths, FileType[] types)
            {
                _con = controller;

                this.paths    = paths;
                this.newpaths = newpaths;
                this.types    = types;
            }
コード例 #13
0
            public MoveAction(PipelineController controller, string path, string newpath, FileType type)
            {
                _con = controller;

                this.path = path;
                this.newpath = newpath;
                this.type = type;
            }
コード例 #14
0
            public MoveAction(PipelineController controller, string path, string newpath, FileType type)
            {
                _con = controller;

                this.path    = path;
                this.newpath = newpath;
                this.type    = type;
            }
コード例 #15
0
            public MoveAction(PipelineController controller, string[] paths, string[] newpaths, FileType[] types)
            {
                _con = controller;

                this.paths = paths;
                this.newpaths = newpaths;
                this.types = types;
            }
コード例 #16
0
 public ExcludeAction(PipelineController controller, IEnumerable<ContentItem> items)
 {
     _con = controller;
     
     _state = new ContentItemState[items.Count()];
     
     var i = 0;
     foreach (var item in items)
     {
         _state[i++] = ContentItemState.Get(item);
     }
 }
コード例 #17
0
            public ExcludeAction(PipelineController controller, IEnumerable <ContentItem> items)
            {
                _con = controller;

                _state = new ContentItemState[items.Count()];

                var i = 0;

                foreach (var item in items)
                {
                    _state[i++] = ContentItemState.Get(item);
                }
            }
コード例 #18
0
        public CollectionEditorDialog(Window parrent, string text) : base(Global.GetNewDialog(parrent.Handle))
        {
            Build();

            this.Title = Mono.Unix.Catalog.GetString("Reference Editor");

            this.AddButton("Ok", ResponseType.Ok);
            this.AddButton("Cancel", ResponseType.Cancel);
            this.DefaultResponse = ResponseType.Ok;

            this.controller = ((PipelineController)((MainWindow)parrent)._controller);

            FileFilter filter = new FileFilter();

            filter.AddPattern("*.dll");

            filechooserwidget1.Filter = filter;
            filechooserwidget1.SetCurrentFolder(controller.ProjectLocation);
            filechooserwidget1.SelectMultiple = true;

            var column = new TreeViewColumn();

            var textCell = new CellRendererText();
            var dataCell = new CellRendererText();

            dataCell.Visible = false;

            column.PackStart(textCell, false);
            column.PackStart(dataCell, false);

            treeview1.AppendColumn(column);

            column.AddAttribute(textCell, "markup", 0);
            column.AddAttribute(dataCell, "text", 1);

            listStore = new TreeStore(typeof(string), typeof(string));

            treeview1.Model          = listStore;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            string[] refs = text.Replace("\r\n", "~").Split('~');

            foreach (string reff in refs)
            {
                if (reff != "")
                {
                    AddValue(reff);
                }
            }
        }
コード例 #19
0
ファイル: Program.cs プロジェクト: cazBlue/AIEYearOneProjects
        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);
        }
コード例 #20
0
        public CollectionEditorDialog (Window parrent, string text) : base(Global.GetNewDialog(parrent.Handle))
        {
            Build();

            this.Title = Mono.Unix.Catalog.GetString ("Reference Editor");

            this.AddButton("Ok", ResponseType.Ok);
            this.AddButton("Cancel", ResponseType.Cancel);
            this.DefaultResponse = ResponseType.Ok;

            this.controller = ((PipelineController)((MainWindow)parrent)._controller);

            FileFilter filter = new FileFilter ();
            filter.AddPattern ("*.dll");

            filechooserwidget1.Filter = filter;
            filechooserwidget1.SetCurrentFolder(controller.ProjectLocation);
            filechooserwidget1.SelectMultiple = true;

            var column = new TreeViewColumn ();

            var textCell = new CellRendererText ();
            var dataCell = new CellRendererText ();

            dataCell.Visible = false;

            column.PackStart (textCell, false);
            column.PackStart (dataCell, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (textCell, "markup", 0);
            column.AddAttribute (dataCell, "text", 1);

            listStore = new TreeStore (typeof (string), typeof (string));

            treeview1.Model = listStore;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            string[] refs = text.Replace("\r\n", "~").Split('~');

            foreach (string reff in refs)
                if (reff != "")
                    AddValue(reff);
        }
コード例 #21
0
            public ExcludeAction(PipelineController controller, IEnumerable<ContentItem> items, IEnumerable<string> folders)
            {
                _con = controller;
                _folder = (folders == null) ? new string[0] : folders.ToArray();

                if(items == null)
                    _state = new ContentItemState[0];
                else
                {
                    _state = new ContentItemState[items.Count()];
                    
                    var i = 0;
                    foreach (var item in items)
                    {
                        _state[i++] = ContentItemState.Get(item);
                    }
                }
            }
コード例 #22
0
        public CollectionEditorDialog(string text, Window window)
        {
            Build();

            this.controller = ((PipelineController)((MainWindow)window)._controller);

            FileFilter filter = new FileFilter();

            filter.AddPattern("*.dll");

            filechooserwidget1.Filter = filter;
            filechooserwidget1.SetCurrentFolder(controller.ProjectLocation);
            filechooserwidget1.SelectMultiple = true;

            var column = new TreeViewColumn();

            var textCell = new CellRendererText();
            var dataCell = new CellRendererText();

            dataCell.Visible = false;

            column.PackStart(textCell, false);
            column.PackStart(dataCell, false);

            treeview1.AppendColumn(column);

            column.AddAttribute(textCell, "markup", 0);
            column.AddAttribute(dataCell, "text", 1);

            listStore = new TreeStore(typeof(string), typeof(string));

            treeview1.Model          = listStore;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            string[] refs = text.Replace("\r\n", "~").Split('~');

            foreach (string reff in refs)
            {
                if (reff != "")
                {
                    AddValue(reff);
                }
            }
        }
コード例 #23
0
            public ExcludeAction(PipelineController controller, IEnumerable <ContentItem> items, IEnumerable <string> folders)
            {
                _con    = controller;
                _folder = (folders == null) ? new string[0] : folders.ToArray();

                if (items == null)
                {
                    _state = new ContentItemState[0];
                }
                else
                {
                    _state = new ContentItemState[items.Count()];

                    var i = 0;
                    foreach (var item in items)
                    {
                        _state[i++] = ContentItemState.Get(item);
                    }
                }
            }
コード例 #24
0
            public IncludeAction(PipelineController controller, IEnumerable<string> files, IEnumerable<string> folders)
            {
                _con = controller;

                _files = files == null ? new string[0] : files.ToArray();
                _folder = folders == null ? new string[0] : folders.ToArray();

                for (int i = 0; i < _folder.Length; i++)
                {
                    if (Path.IsPathRooted(_folder[i]))
                    {
                        string projectloc = controller._project.Location;
                        if (_folder[i].Length >= projectloc.Length + 1)
                            _folder[i] = _folder[i].Substring(projectloc.Length + 1);
                    }

                    if(_folder[i].EndsWith(Path.DirectorySeparatorChar.ToString()))
                        _folder[i] = _folder[i].Remove(_folder[i].Length - 1);
                }
            }
コード例 #25
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
        }
コード例 #26
0
ファイル: Program.cs プロジェクト: Zodge/MonoGame
        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
        }
コード例 #27
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 XWT
#if MONOMAC
            Application.Initialize(ToolkitType.Cocoa);
#endif
#if LINUX
            Application.Initialize(ToolkitType.Gtk);
#endif
            var view = new XwtView();
            if (args != null && args.Length > 0)
            {
                var projectFilePath = string.Join(" ", args);
                view.OpenProjectPath = projectFilePath;
            }

            var model = new PipelineProject();
            new PipelineController(view, model);
            view.Show();
            Application.Run();
#endif
        }
コード例 #28
0
        public CollectionEditorDialog (string text, Window window)
        {
            Build();

            this.controller = ((PipelineController)((MainWindow)window)._controller);

            FileFilter filter = new FileFilter ();
            filter.AddPattern ("*.dll");

            filechooserwidget1.Filter = filter;
            filechooserwidget1.SetCurrentFolder(controller.ProjectLocation);
            filechooserwidget1.SelectMultiple = true;

            var column = new TreeViewColumn ();

            var textCell = new CellRendererText ();
            var dataCell = new CellRendererText ();

            dataCell.Visible = false;

            column.PackStart (textCell, false);
            column.PackStart (dataCell, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (textCell, "markup", 0);
            column.AddAttribute (dataCell, "text", 1);

            listStore = new TreeStore (typeof (string), typeof (string));

            treeview1.Model = listStore;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            string[] refs = text.Replace("\r\n", "~").Split('~');

            foreach (string reff in refs)
                if (reff != "")
                    AddValue(reff);
        }
コード例 #29
0
            public ExcludeAction(PipelineController controller, List <IProjectItem> items, bool delete)
            {
                _items    = new List <IProjectItem>();
                _subitems = new List <ContentItem>();

                _con = controller;
                _items.AddRange(items);
                _delete = delete;

                foreach (var item in items)
                {
                    if (item is DirectoryItem)
                    {
                        foreach (var citem in _con.ProjectItem.ContentItems)
                        {
                            if (citem.OriginalPath.StartsWith(item.OriginalPath))
                            {
                                _subitems.Add(citem);
                            }
                        }
                    }
                }
            }
コード例 #30
0
            public IncludeAction(PipelineController controller, IEnumerable <string> files, IEnumerable <string> folders)
            {
                _con = controller;

                _files  = files == null ? new string[0] : files.ToArray();
                _folder = folders == null ? new string[0] : folders.ToArray();

                for (int i = 0; i < _folder.Length; i++)
                {
                    if (Path.IsPathRooted(_folder[i]))
                    {
                        string projectloc = controller._project.Location;
                        if (_folder[i].Length >= projectloc.Length + 1)
                        {
                            _folder[i] = _folder[i].Substring(projectloc.Length + 1);
                        }
                    }

                    if (_folder[i].EndsWith(Path.DirectorySeparatorChar.ToString()))
                    {
                        _folder[i] = _folder[i].Remove(_folder[i].Length - 1);
                    }
                }
            }
コード例 #31
0
ファイル: Program.cs プロジェクト: zad15c/MonoGame
            public void Run(InvocationContext context, string project)
            {
                Styles.Load();

#if GTK
                var app = new Application(Platforms.Gtk);
#elif WPF
                var app = new Application(Platforms.Wpf);
#else
                var app = new Application(Platforms.Mac64);
#endif

                app.Style = "PipelineTool";

                PipelineSettings.Default.Load();

                if (!string.IsNullOrEmpty(PipelineSettings.Default.ErrorMessage))
                {
                    var logwin = new LogWindow();
                    logwin.LogText = PipelineSettings.Default.ErrorMessage;
                    app.Run(logwin);
                    return;
                }

#if !DEBUG
                try
#endif
                {
                    var win        = new MainWindow();
                    var controller = PipelineController.Create(win);

#if GTK
                    Global.Application.AddWindow(win.ToNative() as Gtk.Window);
#endif

#if GTK && !DEBUG
                    GLib.ExceptionManager.UnhandledException += (e) =>
                    {
                        var logwin = new LogWindow();
                        logwin.LogText = e.ExceptionObject.ToString();

                        logwin.Show();
                        win.Close();
                    };
#endif

                    if (!string.IsNullOrEmpty(project))
                    {
                        controller.OpenProject(project);
                    }

                    app.Run(win);
                }
#if !DEBUG
                catch (Exception ex)
                {
                    PipelineSettings.Default.ErrorMessage = ex.ToString();
                    PipelineSettings.Default.Save();
                    app.Restart();
                }
#endif
            }
コード例 #32
0
 public IncludeAction(PipelineController controller, IEnumerable<string> files)
 {
     _con = controller;
     _files = files.ToArray();
 }
コード例 #33
0
 public IncludeAction(PipelineController controller, IEnumerable <string> files) : this(controller, files, null)
 {
 }
コード例 #34
0
 public FileWatcher(PipelineController controller, IView view)
 {
     _controller = controller;
     _view = view;
 }
コード例 #35
0
 public FileWatcher(PipelineController controller, IView view)
 {
     _controller = controller;
     _view       = view;
 }
コード例 #36
0
 public ActionStack(PipelineController controller)
 {
     _controller = controller;
     _undoStack  = new List <IProjectAction>();
     _redoStack  = new List <IProjectAction>();
 }
コード例 #37
0
 public IncludeAction(PipelineController controller, IEnumerable <string> files)
 {
     _con   = controller;
     _files = files.ToArray();
 }
コード例 #38
0
 public IncludeAction(PipelineController controller, IEnumerable<string> files) : this(controller, files, null)
 {
     
 }