UnityEditor.ASCommitWindow.AddToCommitMessageHistory C# (CSharp) Method

AddToCommitMessageHistory() private method

private AddToCommitMessageHistory ( string description ) : void
description string
return void
        internal void AddToCommitMessageHistory(string description)
        {
            if (description.Trim() != string.Empty)
            {
                if (ArrayUtility.Contains<string>(this.commitMessageList, description))
                {
                    ArrayUtility.Remove<string>(ref this.commitMessageList, description);
                }
                ArrayUtility.Insert<string>(ref this.commitMessageList, 0, description);
                InternalEditorUtility.SaveEditorSettingsList("ASCommitMsgs", this.commitMessageList, 20);
            }
        }

Usage Example

 private void DoCommit()
 {
   if (this.commitMessage == string.Empty && !EditorUtility.DisplayDialog("Commit without description", "Are you sure you want to commit with empty commit description message?", "Commit", "Cancel"))
     GUIUtility.ExitGUI();
   bool refreshCommit = AssetServer.GetRefreshCommit();
   ASCommitWindow asCommitWindow = new ASCommitWindow(this, ASCommitWindow.GetParentViewSelectedItems(this.pv, true, false).ToArray());
   asCommitWindow.InitiateReinit();
   if ((refreshCommit || asCommitWindow.lastTransferMovedDependencies) && (!refreshCommit && !EditorUtility.DisplayDialog("Committing with dependencies", "Assets selected for committing have dependencies that will also be committed. Press Details to view full changeset", "Commit", "Details") || refreshCommit))
   {
     this.committing = false;
     this.selectedPage = ASMainWindow.Page.Commit;
     asCommitWindow.description = this.commitMessage;
     if (refreshCommit)
       asCommitWindow.showReinitedWarning = 1;
     this.asCommitWin = asCommitWindow;
     this.Repaint();
     GUIUtility.ExitGUI();
   }
   else
   {
     string[] itemsToCommit = asCommitWindow.GetItemsToCommit();
     AssetServer.SetAfterActionFinishedCallback("ASEditorBackend", "CBOverviewsCommitFinished");
     AssetServer.DoCommitOnNextTick(this.commitMessage, itemsToCommit);
     AssetServer.SetLastCommitMessage(this.commitMessage);
     asCommitWindow.AddToCommitMessageHistory(this.commitMessage);
     this.committing = false;
     GUIUtility.ExitGUI();
   }
 }