/**************************************************************************** * Constructor * ****************************************************************************/ public EditSummaryStyle() { // Set default edit summary - for now at build // time (perhaps later as configuration): // Conditional compilation for this is isolated // here and only for setting a variable // Using conditional compilation for now (until // we can use configuration files, command-line // parameters instead, or some other method to // change to the revision summary style). // // Update 2019-06-03: The default is still by building, // but the user can now change it at // runtime, without the need to // launch the other build variation. #if SOME_SPECIAL_COMPILATION_SYMBOL mCurrentStyle = EditSummaryEnum.standard; //string msg = "Hi there! Special configuration build of Edit Overflow!"; //System.Windows.Forms.MessageBox.Show( // msg, // EditorOverflowApplication.applicationName()); #else mCurrentStyle = EditSummaryEnum.Stack_Overflow; #endif }
} //formatLookupList() /**************************************************************************** * <placeholder for header> * ****************************************************************************/ private static void formatLookupListWithCurrentStyle( List <correctedWord> aWordList, StringBuilder aScratchSB, EditSummaryStyle aEditSummaryStyle) { EditSummaryEnum currentEditStyle = aEditSummaryStyle.getCurrentStyle(); switch (currentEditStyle) { case EditSummaryEnum.standard: formatLookupList( aWordList, "Copy edited (e.g. ref. ", "). ", true, true, aScratchSB); break; case EditSummaryEnum.Stack_Overflow: formatLookupList( aWordList, "Active reading [", "].", false, true, aScratchSB); break; case EditSummaryEnum.oldStyle: //Alternative: append directly to mScratchSB, // and use an empty prefix for // formatLookupList() string prefix = "Added link"; int len = aWordList.Count; if (len > 1) { prefix += "s"; } prefix += " to "; formatLookupList( aWordList, prefix, " [Wikipedia]. ", true, false, aScratchSB); break; default: Trace.Assert(false, "Switch fall-through..."); break; } } //formatLookupListWithCurrentStyle()
/**************************************************************************** * <placeholder for header> * ****************************************************************************/ public void setCurrentStyle(EditSummaryEnum aCurrentStyle) { mCurrentStyle = aCurrentStyle; }