Exemplo n.º 1
0
        private bool CompileGame()
        {
            string projectFile = $@"{ProjectPath}\Empty.sln -flp:logfile=MyProjectOutput.log;verbosity=diagnostic";
            string projectExe  = $@"{ProjectPath}\Empty\bin\Debug\Empty.exe";
            string strCmdText  = $@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe {projectFile} -t:go -fl -flp:logfile=MyProjectOutput.log;verbosity=diagnostic";

            try
            {
                File.Delete(projectExe);
            }
            catch
            {
            }

            var p = new Process();

            p.StartInfo           = new ProcessStartInfo(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe");
            p.StartInfo.Arguments = string.Format(projectFile);
            p.Start();
            p.WaitForExit();
            try
            {
                Process.Start(projectExe);
            }
            catch
            {
                MessageBox.Show("An error is occuperd, please check your code!");
                LogViewer logViewer = new LogViewer();
                logViewer.Text = $"Log View for {ProjectPath}";
                logViewer.Show();
                return(false);
            }
            return(true);
        }
    public static void Open()
    {
        var logViewer = new LogViewer();

        logViewer.Show();

        // Avoid the log viewer blocking the main window
        logViewer.Owner         = null;
        logViewer.ShowInTaskbar = true;
    }
        private void OpenIssues(object sender, RoutedEventArgs e)
        {
            MetroButton senderButton = (MetroButton)sender;
            AssemblyGenerationResult assemblyGenerationResult = (AssemblyGenerationResult)senderButton.Tag;

            LogViewer viewer = new LogViewer();

            viewer.Log   = assemblyGenerationResult.Log.LogData;
            viewer.Owner = App.MainWindow;
            viewer.Show();
        }
Exemplo n.º 4
0
        private void OpenIssues(object sender, RoutedEventArgs e)
        {
            MetroButton             senderButton            = (MetroButton)sender;
            ImportTranslationResult importTranslationResult = (ImportTranslationResult)senderButton.Tag;

            string    log    = CreateLogFromResult(importTranslationResult.Log);
            LogViewer viewer = new LogViewer();

            viewer.Title = StringUtils.String("ImportTranslationLogIssue", importTranslationResult.RelativeFileName);
            viewer.Log   = log;
            viewer.Owner = App.MainWindow;
            viewer.Show();
        }
Exemplo n.º 5
0
        public void ShowLogs(params Tuple <Log, string>[] logs)
        {
            if (!Application.Current.Dispatcher.CheckAccess())
            {
                Application.Current.Dispatcher.Invoke(() => ShowLogs(logs));
                return; // Important to leave the culprit thread
            }

            if (logs == null)
            {
                throw new ArgumentException("This method should only be called using an Log array");
            }

            foreach (Tuple <Log, string> tup in logs)
            {
                var l    = tup.Item1;
                var view = new LogViewer(l.vert, l.steps, tup.Item2);
                view.Show();
            }
        }
Exemplo n.º 6
0
 public void ShowLog()
 {
     logView.Show();
 }
Exemplo n.º 7
0
        public void InitializeButtonList(Form form)
        {
            Font font = new Font("Arial Narrow", 20.25F, FontStyle.Regular, GraphicsUnit.Point, 0);

            Button sendNotificationsButton = new Button
            {
                Font     = font,
                Location = new Point(10, 12),
                Name     = "sendNotificationsButton",
                Size     = new Size(220, 42),
                Text     = "Send &Notifications",
                UseVisualStyleBackColor = true
            };

            sendNotificationsButton.Click += (sender, e) =>
            {
                if (form is NotificationSender)
                {
                    return;
                }
                notificationSender.Show();
                notificationSender.Story2_Load(null, null);
                form.Hide();
            };
            form.Controls.Add(sendNotificationsButton);

            Button viewLogsButton = new Button
            {
                Font     = font,
                Location = new Point(235, 12),
                Name     = "viewLogsButton",
                Size     = new Size(220, 42),
                Text     = "&View Logs",
                UseVisualStyleBackColor = true
            };

            viewLogsButton.Click += (sender, e) =>
            {
                if (form is LogViewer)
                {
                    return;
                }
                logViewer.Show();
                form.Hide();
            };
            form.Controls.Add(viewLogsButton);

            if (account.Role == Role.Manager)
            {
                Button createTemplateButton = new Button
                {
                    Font     = font,
                    Location = new Point(460, 12),
                    Name     = "generateTemplateButton",
                    Size     = new Size(220, 42),
                    Text     = "&Generate Template",
                    UseVisualStyleBackColor = true
                };
                createTemplateButton.Click += (sender, e) =>
                {
                    if (form is TemplateCreator)
                    {
                        return;
                    }
                    templateCreator.Show();
                    form.Hide();
                };
                form.Controls.Add(createTemplateButton);
            }

            Label nameLabel = new Label
            {
                Font     = font,
                Location = account.Role == Role.Manager ? new Point(700, 16) : new Point(460, 16),
                Name     = "nameLabel",
                Size     = new Size(400, 42),
                Text     = account.Role.ToString() + ", " + account.Name
            };

            form.Controls.Add(nameLabel);
        }
Exemplo n.º 8
0
 private void ShowLogViewer()
 {
     LogViewer.Show("Log", GetLogPath(), this);
 }
Exemplo n.º 9
0
 private void ShowLogViewer()
 {
     LogViewer.Show("Log", GetLogPath(), Window.GetWindow(this));
 }