Beispiel #1
0
 private void DrawRecordCheckbox(CleanerRecord cleanerRecord)
 {
     EditorGUI.BeginChangeCheck();
     cleanerRecord.selected = EditorGUILayout.ToggleLeft(new GUIContent(""), cleanerRecord.selected, GUILayout.Width(20));
     if (EditorGUI.EndChangeCheck())
     {
         SearchResultsStorage.Save();
     }
 }
Beispiel #2
0
 protected override void LoadLastRecords()
 {
     // ReSharper disable CoVariantArrayConversion
     records = SearchResultsStorage.CleanerSearchResults;
     if (records == null)
     {
         records = new CleanerRecord[0];
     }
     // ReSharper restore CoVariantArrayConversion
 }
Beispiel #3
0
        protected override void DrawRecord(int recordIndex, out bool recordRemoved)
        {
            recordRemoved = false;
            RecordBase    record        = records[recordIndex];
            CleanerRecord cleanerRecord = record as CleanerRecord;

            if (cleanerRecord == null)
            {
                GUILayout.Label("Incorrect record! Please report this to support.");
                return;
            }

            // hide cleaned records
            if (cleanerRecord.cleaned)
            {
                return;
            }

            UIHelpers.Separator();

            using (UIHelpers.Horizontal())
            {
                DrawRecordCheckbox(cleanerRecord);

                using (UIHelpers.Vertical())
                {
                    /* header */
                    using (UIHelpers.Horizontal())
                    {
                        DrawSeverityIcon(record);
                        GUILayout.Label(record.GetHeader(), UIHelpers.richLabel, GUILayout.ExpandWidth(false));
                    }

                    /* body */
                    GUILayout.Label(record.GetBody(), UIHelpers.richLabel);

                    DrawRecordButtons(record);
                }
            }
        }