コード例 #1
0
ファイル: ProjectCleaner.cs プロジェクト: s1gurd/W-Hub
        /// <summary>
        /// Starts garbage search and generates report.
        /// </summary>
        /// <returns>Project Cleaner report, similar to the exported report from the %Maintainer window.</returns>
        /// %Maintainer window is not shown.
        /// <br/>Useful when you wish to integrate %Maintainer in your build pipeline.
        public static string SearchAndReport()
        {
            var foundGarbage = StartSearch(false);

            // ReSharper disable once CoVariantArrayConversion
            return(ReportsBuilder.GenerateReport(ModuleName, foundGarbage));
        }
コード例 #2
0
        /// <summary>
        /// Starts garbage search and generates report.
        /// </summary>
        /// <returns>Project Cleaner report, similar to the exported report from the %Maintainer window.</returns>
        /// %Maintainer window is not shown.
        /// <br/>Useful when you wish to integrate %Maintainer in your build pipeline.
        public static string SearchAndReport()
        {
            CleanerRecord[] foundGarbage = StartSearch(false);

            // ReSharper disable once CoVariantArrayConversion
            return(ReportsBuilder.GenerateReport(MODULE_NAME, foundGarbage));
        }
コード例 #3
0
ファイル: AutoBuild.cs プロジェクト: w359405949/lhFramework
    public static void BuildSource()
    {
        var    dic      = GetCommandArgs();
        string mode     = dic["mode"];
        string platform = dic["platform"];

        if (mode.ToLower() == "debug")
        {
            if (dic.ContainsKey("maintainer_filePath"))
            {
                var records = IssuesFinder.StartSearch(false);
                using (StreamWriter sr = File.CreateText(dic["maintainer_filePath"]))
                {
                    sr.Write(ReportsBuilder.GenerateReport(IssuesFinder.MODULE_NAME, records));
                }
            }
        }
        if (dic.ContainsKey("currentLevel") && !string.IsNullOrEmpty(dic["currentLevel"]))
        {
            QualitySettings.SetQualityLevel(System.Convert.ToInt32(dic["currentLevel"]));
        }
        lhFramework.Tools.Bundle.BundleBuildManager bundleManager = new lhFramework.Tools.Bundle.BundleBuildManager();
        bundleManager.buildTarget = System.Convert.ToInt32(platform);
        if (dic.ContainsKey("rootName"))
        {
            bundleManager.rootName = dic["rootName"];
        }
        bundleManager.Initialize();
        bundleManager.BuildPackage();
        bundleManager = null;
    }
コード例 #4
0
ファイル: RecordsTab.cs プロジェクト: s1gurd/W-Hub
 protected void DrawCopyReportButton()
 {
     if (UIHelpers.ImageButton("Copy report to clipboard", CSIcons.Copy))
     {
         EditorGUIUtility.systemCopyBuffer = ReportsBuilder.GenerateReport(GetModuleName(), filteredRecords, GetReportHeader(), GetReportFooter());
         MaintainerWindow.ShowNotification("Report copied to clipboard!");
     }
 }
コード例 #5
0
        /// <summary>
        /// Starts garbage search, cleans what was found with optional confirmation and
        /// generates report to let you know what were cleaned up.
        /// </summary>
        /// <param name="showConfirmation">Enables or disables confirmation dialog about cleaning up found stuff.</param>
        /// <returns>Project Cleaner report about removed items.</returns>
        /// %Maintainer window is not shown.
        /// <br/>Useful when you wish to integrate %Maintainer in your build pipeline.
        public static string SearchAndCleanAndReport(bool showConfirmation = true)
        {
            CleanerRecord[] foundGarbage   = StartSearch(false);
            CleanerRecord[] cleanedGarbage = StartClean(foundGarbage, false, showConfirmation);

            // ReSharper disable once CoVariantArrayConversion
            return(ReportsBuilder.GenerateReport(MODULE_NAME, cleanedGarbage, "Following items were cleaned up:"));
        }
コード例 #6
0
        private void btnToReport_Click(object sender, System.EventArgs e)
        {
            var semester = (Semester)cbSemesters.SelectedItem;

            if (semester == null || _student == null)
            {
                return;
            }
            // показываем окно первого отчета
            new ReportsForm(ReportsBuilder.GetStudentPerformance(_root, semester, _student)).ShowDialog();
            Close();
        }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: ashsvis/hotel
        /// <summary>
        /// Вызов отчёта по клиентам за прошедший месяц
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiLastMonthClients_Click(object sender, EventArgs e)
        {
            var rc = new ReportViewControl()
            {
                Dock = DockStyle.Fill
            };
            var generator = new ReportsBuilder();
            var report    = generator.GetClientsByLastMonth(_hotel);

            rc.Build(_hotel, report);
            CreateAndShowUserControl(rc);
        }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: ashsvis/hotel
        /// <summary>
        /// Вызов отчёта по занятым номерам
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiBusyRooms_Click(object sender, EventArgs e)
        {
            var rc = new ReportViewControl()
            {
                Dock = DockStyle.Fill
            };
            var generator = new ReportsBuilder();
            var report    = generator.GetBusyRoomsByDate(_hotel, DateTime.Now);

            rc.Build(_hotel, report);
            CreateAndShowUserControl(rc);
        }
コード例 #9
0
ファイル: ProjectCleaner.cs プロジェクト: s1gurd/W-Hub
        /// <summary>
        /// Starts garbage search, cleans what was found with optional confirmation and
        /// generates report to let you know what were cleaned up.
        /// </summary>
        /// <param name="showConfirmation">Enables or disables confirmation dialog about cleaning up found stuff.</param>
        /// <returns>Project Cleaner report about removed items.</returns>
        /// %Maintainer window is not shown.
        /// <br/>Useful when you wish to integrate %Maintainer in your build pipeline.
        public static string SearchAndCleanAndReport(bool showConfirmation = true)
        {
            var foundGarbage   = StartSearch(false);
            var cleanedGarbage = StartClean(foundGarbage, false, showConfirmation);

            var header = "Total cleaned bytes: " + CSEditorTools.FormatBytes(cleanedBytes);

            header += "\nFollowing items were cleaned up:";

            // ReSharper disable once CoVariantArrayConversion
            return(ReportsBuilder.GenerateReport(ModuleName, cleanedGarbage, header));
        }
コード例 #10
0
ファイル: RecordsTab.cs プロジェクト: s1gurd/W-Hub
 protected void DrawExportReportButton()
 {
     if (UIHelpers.ImageButton("Export report...", CSIcons.Export))
     {
         var filePath = EditorUtility.SaveFilePanel("Save " + GetModuleName() + " report", "", "Maintainer " + GetReportFileNamePart() + "Report.txt", "txt");
         if (!string.IsNullOrEmpty(filePath))
         {
             var sr = File.CreateText(filePath);
             sr.Write(ReportsBuilder.GenerateReport(GetModuleName(), filteredRecords, GetReportHeader(), GetReportFooter()));
             sr.Close();
             MaintainerWindow.ShowNotification("Report saved!");
         }
     }
 }
コード例 #11
0
        protected override void DrawSearchBody()
        {
            if (GUILayout.Button("Find issues!"))
            {
                startSearch = true;
            }
            GUILayout.Space(10);

            if (records == null || records.Length == 0)
            {
                GUILayout.Label("No issues");
            }
            else
            {
                ShowCollectionPages();

                GUILayout.Space(5);

                using (UIHelpers.Horizontal())
                {
                    if (GUILayout.Button("Copy report to clipboard"))
                    {
                        EditorGUIUtility.systemCopyBuffer = ReportsBuilder.GenerateReport(IssuesFinder.MODULE_NAME, records);
                        MaintainerWindow.ShowNotification("Report copied to clipboard!");
                    }

                    if (GUILayout.Button("Export report..."))
                    {
                        string filePath = EditorUtility.SaveFilePanel("Save Issues Finder report", "", "MaintainerIssuesReport.txt", "txt");
                        if (!string.IsNullOrEmpty(filePath))
                        {
                            StreamWriter sr = File.CreateText(filePath);
                            sr.Write(ReportsBuilder.GenerateReport(IssuesFinder.MODULE_NAME, records));
                            sr.Close();
                            MaintainerWindow.ShowNotification("Report saved!");
                        }
                    }

                    if (GUILayout.Button("Clear results"))
                    {
                        records = null;
                        SearchResultsStorage.IssuesSearchResults = null;
                    }
                }
            }
        }
コード例 #12
0
        protected override bool OnStepStart()
        {
            FixedIssues = IssuesFinder.StartFix(Issues, false, false);

            if (SaveReport)
            {
                var report = ReportsBuilder.GenerateReport("Fixed Issues Report (executed through RockTomate)", FixedIssues);
                File.WriteAllText(ReportFilePath, report);
            }

            if (PrintFixedIssues)
            {
                FixedIssues.ForEach(Debug.Log);
            }

            return(!FailOnIssues || FixedIssues.Length >= Issues.Length);
        }
コード例 #13
0
ファイル: MainForm.cs プロジェクト: ashsvis/hotel
        /// <summary>
        /// Вызов списка клиентов за указанный период
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiByDateClients_Click(object sender, EventArgs e)
        {
            var frm = new SelectPeriodForm();

            if (frm.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            var rc = new ReportViewControl()
            {
                Dock = DockStyle.Fill
            };
            var generator = new ReportsBuilder();
            var report    = generator.GetClientsByDate(_hotel, frm.FirstDate, frm.LastDate);

            rc.Build(_hotel, report);
            CreateAndShowUserControl(rc);
        }
コード例 #14
0
        private void tsmiSummaryStudentProgress_Click(object sender, EventArgs e)
        {
            if (_student == null)
            {
                return;
            }
            var t   = Type.Missing;
            var xl1 = new Microsoft.Office.Interop.Excel.Application();

            xl1.Visible = true;
            var       book  = xl1.Workbooks.Add(t);
            var       lists = book.Worksheets;
            Worksheet list  = lists.Item[1];
            var       cell  = xl1.Selection.Cells;

            list.Range["C3", t].Value2  = _student.ToString();
            list.Range["C4", t].Value2  = _student.BirthDay.ToShortDateString();
            list.Range["H5", t].Value2  = "Минский радиотехнический колледж";
            list.Range["H6", t].Value2  = "г.Минск";
            list.Range["C7", t].Value2  = _student.EducationCertificate;
            list.Range["C8", t].Value2  = Helper.GetStudyGroupById(_student.IdStudyGroup).TrainingPeriod + " года";
            list.Range["C9", t].Value2  = Helper.SpecialityById(_student.IdSpeciality);
            list.Range["C10", t].Value2 = Helper.SpecializationById(_student.IdSpecialization);
            var row = 12;

            foreach (var semester in _root.Semesters)
            {
                var report = ReportsBuilder.GetStudentPerformance(_root, semester, _student);
                if (report.ReportRows.Count == 0)
                {
                    continue;
                }
                list.Range[$"A{row}", t].Value2 = $"Семестр {semester}";
                row++;
                for (var i = 0; i < report.ReportRows.Count; i++)
                {
                    list.Range[$"B{row}", t].Value2 = report.ReportRows[i].Items[0];
                    list.Range[$"H{row}", t].Value2 = report.ReportRows[i].Items[1];
                    row++;
                }
            }
        }
コード例 #15
0
        /// <inheritdoc />
        protected override bool OnStepStart()
        {
            var allIssues = IssuesFinder.StartSearch(false);

            Issues        = GetFilteredIssues(allIssues);
            IssuesPrinted = Issues.Select(x => x.ToString(true)).ToArray();

            if (SaveReport)
            {
                var report = ReportsBuilder.GenerateReport("Found Issues Report (executed through RockTomate)", Issues);
                File.WriteAllText(ReportFilePath, report);
            }

            if (PrintIssues)
            {
                Issues.ForEach(Debug.Log);
            }

            return(!FailOnIssues || Issues.Length <= 0);
        }
コード例 #16
0
        /////////////////////////////////////////////////////////////////////////
        // public methods
        /////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Starts issues search and generates report. %Maintainer window is not shown.
        /// Useful when you wish to integrate %Maintainer in your build pipeline.
        /// </summary>
        /// <returns>%Issues report, similar to the exported report from the %Maintainer window.</returns>
        public static string SearchAndReport()
        {
            var foundIssues = StartSearch(false);

            return(ReportsBuilder.GenerateReport(ModuleName, foundIssues));
        }
コード例 #17
0
        private void btnToExcel_Click(object sender, System.EventArgs e)
        {
            var semester = (Semester)cbSemesters.SelectedItem;
            var t        = Type.Missing;

            if (byGroup)
            {
                if (semester == null || _group == null)
                {
                    return;
                }
                var xl1 = new Microsoft.Office.Interop.Excel.Application();
                xl1.Visible = true;
                var       book  = xl1.Workbooks.Add(t);
                var       lists = book.Worksheets;
                Worksheet list  = lists.Item[1];
                var       cell  = xl1.Selection.Cells;
                list.Range["C1", t].Value2 = $"Отчет об успеваемости группы {_group} за {semester} семестр";
                var col = 6;
                foreach (var performances in _root.Performances.Where(x => x.IdSemester == semester.IdSemester)
                         .GroupBy(x => x.IdMatter))
                {
                    var cource = _root.MattersCourses.FirstOrDefault(x => x.IdMatter == performances.Key &&
                                                                     x.IdSpeciality == _group.IdSpeciality &&
                                                                     x.IdSpecialization == _group.IdSpecialization);
                    list.Cells[4, col].Value2   = $"{Helper.MatterById(performances.Key)} ({cource?.HoursCount})";
                    list.Cells[4, col].WrapText = true;
                    var row = 5;
                    foreach (var performance in performances)
                    {
                        var student = Helper.GetStudentById(performance.IdStudent);
                        if (student.IdStudyGroup != _group.IdStudyGroup)
                        {
                            continue;
                        }
                        list.Range[$"A{row}", t].Value2 = student.ToString();
                        list.Cells[row, col].Value2     = EnumConverter.GetName(performance.Grade);
                        row++;
                    }
                    col++;
                }
            }
            else
            {
                if (semester == null || _student == null)
                {
                    return;
                }
                var report = ReportsBuilder.GetStudentPerformance(_root, semester, _student);
                var xl1    = new Microsoft.Office.Interop.Excel.Application();
                xl1.Visible = true;
                var       book  = xl1.Workbooks.Add(t);
                var       lists = book.Worksheets;
                Worksheet list  = lists.Item[1];
                var       cell  = xl1.Selection.Cells;
                list.Range["C1", t].Value2 = report.Caption;
                list.Range["A3", t].Value2 = "Ф.И.О.:";
                list.Range["B3", t].Value2 = _student.FullName;
                list.Range["H3", t].Value2 = "Группа:";
                list.Range["I3", t].Value2 = Helper.StudyGroupById(_student.IdStudyGroup);
                list.Range["A6", t].Value2 = report.ReportColumns[0].Text;
                list.Range["H6", t].Value2 = report.ReportColumns[1].Text;
                for (var i = 0; i < report.ReportRows.Count; i++)
                {
                    list.Range[$"A{i + 8}", t].Value2 = report.ReportRows[i].Items[0];
                    list.Range[$"H{i + 8}", t].Value2 = report.ReportRows[i].Items[1];
                }
            }
            Close();
        }
コード例 #18
0
ファイル: MainForm.cs プロジェクト: ashsvis/Enrollee
 private void tsmiReport1_Click(object sender, EventArgs e)
 {
     // показываем окно первого отчета
     new ReportsForm(ReportsBuilder.GetEnrolleesWithGoldMedal(_root)).ShowDialog();
 }
コード例 #19
0
ファイル: MainForm.cs プロジェクト: ashsvis/Enrollee
 private void tsmiReport3_Click(object sender, EventArgs e)
 {
     // показываем окно третьего отчета
     new ReportsForm(ReportsBuilder.GetEnrolleesBySpeciality(_root)).ShowDialog();
 }
コード例 #20
0
        protected override void DrawSearchBody()
        {
            //GUILayout.BeginHorizontal();
            if (GUILayout.Button("1. Find garbage!"))
            {
                startSearch = true;
            }

            if (GUILayout.Button("2. Clean selected items!"))
            {
                startClean = true;
            }
            //GUILayout.EndHorizontal();
            GUILayout.Space(10);

            if (records == null || records.Length == 0)
            {
                GUILayout.Label("No garbage");
            }
            else
            {
                ShowCollectionPages();

                GUILayout.Space(5);

                using (UIHelpers.Horizontal())
                {
                    if (GUILayout.Button("Select all"))
                    {
                        foreach (CleanerRecord record in records.OfType <CleanerRecord>())
                        {
                            record.selected = true;
                        }
                        SearchResultsStorage.Save();
                    }

                    if (GUILayout.Button("Select none"))
                    {
                        foreach (CleanerRecord record in records.OfType <CleanerRecord>())
                        {
                            record.selected = false;
                        }
                        SearchResultsStorage.Save();
                    }

                    if (GUILayout.Button("Clear results"))
                    {
                        records = null;
                        SearchResultsStorage.CleanerSearchResults = null;
                    }
                }

                using (UIHelpers.Horizontal())
                {
                    if (GUILayout.Button("Copy report to clipboard"))
                    {
                        EditorGUIUtility.systemCopyBuffer = ReportsBuilder.GenerateReport(ProjectCleaner.MODULE_NAME, records);
                        MaintainerWindow.ShowNotification("Report copied to clipboard!");
                    }
                    if (GUILayout.Button("Export report..."))
                    {
                        string filePath = EditorUtility.SaveFilePanel("Save " + ProjectCleaner.MODULE_NAME + " report", "", "MaintainerCleanerReport.txt", "txt");
                        if (!string.IsNullOrEmpty(filePath))
                        {
                            StreamWriter sr = File.CreateText(filePath);
                            sr.Write(ReportsBuilder.GenerateReport(ProjectCleaner.MODULE_NAME, records));
                            sr.Close();
                            MaintainerWindow.ShowNotification("Report saved!");
                        }
                    }
                }
            }
        }