Marked as 'AdvertsingProfitControl (New Add Form)' by its folder name. I think this was one of the first appearences of a modify record form, however I may have gotten the order mixed up here with the previous commit. Reguardless, this version still introduced the first appearence of a new 'Modify Record' form.

This commit is contained in:
2021-01-28 20:02:35 -06:00
parent 21eaae4d67
commit 676a9dd890
24 changed files with 7495 additions and 491 deletions
+10 -17
View File
@@ -28,6 +28,7 @@ namespace AdvertsingProfitControl
var isPreviousCharWhiteSpace = false;
var cleanedInputString = "";
var lastnumberStartingIndex = -1;
var removedCharacterOffset = 0;
//Create an array of brackets to test for, and either balance out or simply ignore the extras.
char[] openBrackets = { '(', '<', '{', '[' };
char[] closedBrackets = { ')', '>', '}', ']' };
@@ -46,6 +47,7 @@ namespace AdvertsingProfitControl
if (isPreviousCharWhiteSpace)
{
//If more then one space is found to be in a row, then ignore it and move onto the next character.
removedCharacterOffset++;
continue;
}
//IF the current character is whitespace, then mark it and move onto the next loop.
@@ -60,6 +62,7 @@ namespace AdvertsingProfitControl
if (isInsideBrackets)
{
//If we are already inside of brackets then don't add anymore to the string just continue.
removedCharacterOffset++;
continue;
}
isInsideBrackets = true;
@@ -73,6 +76,7 @@ namespace AdvertsingProfitControl
//IF we're not inside brackets then there is an imbalance so discard this parenthesis.
if (!isInsideBrackets)
{
removedCharacterOffset++;
continue;
}
//Just gonna force parenthesis for now.
@@ -81,19 +85,19 @@ namespace AdvertsingProfitControl
//Clear the current working word.
isInsideBrackets = false;
continue;
}
}
//IF the current character is not a number and the previous character is a white space character
//then capitalize the current character and add it to the string.
if (!char.IsNumber(adItemText[currentCharacter]) && isPreviousCharWhiteSpace)
{
//Check to see the length of the string and determine if the word with the number needs to be capitalized.
if (char.IsNumber(cleanedInputString[cleanedInputString.Length - 2]))
if (char.IsNumber(cleanedInputString[currentCharacter - (2 + removedCharacterOffset)]))
{
BuildAbbreviationsAndWordsLists(adItemText, currentCharacter, out abbreviations, out words);
//Remove the last space if there are any abbreviations or words found.
if (abbreviations.Count > 0 || words.Count > 0)
{
cleanedInputString = cleanedInputString.Remove(cleanedInputString.Length - 1, 1);
cleanedInputString = cleanedInputString.Remove(currentCharacter - (1 + removedCharacterOffset), 1);
}
//Begin checking to see how to place these items back into the final string.
if (abbreviations.Count >= 1 && words.Count == 0)
@@ -139,7 +143,7 @@ namespace AdvertsingProfitControl
else if (!char.IsNumber(adItemText[currentCharacter]) && char.IsLetter(adItemText[currentCharacter]))
{
//IF the previous character is a number...
if (char.IsNumber(cleanedInputString[cleanedInputString.Length - 1]))
if (char.IsNumber(cleanedInputString[currentCharacter - (1 + removedCharacterOffset)]))
{
//Check to see the length of the string and determine if the word with the number needs to be capitalized.
BuildAbbreviationsAndWordsLists(adItemText, currentCharacter, out abbreviations, out words);
@@ -179,7 +183,7 @@ namespace AdvertsingProfitControl
break;
}
}
else if (char.IsLetter(adItemText[currentCharacter - 1]) || adItemText[currentCharacter - 1] == '\'')
else if (char.IsLetter(adItemText[currentCharacter - 1]))
{
cleanedInputString += char.ToLowerInvariant(adItemText[currentCharacter]);
}
@@ -187,20 +191,10 @@ namespace AdvertsingProfitControl
//IF a number is found, and we're not inside brackets, check to see if there is an opening parenthesis and if there aren't create one.
if (char.IsNumber(adItemText[currentCharacter]))
{
cleanedInputString += adItemText[currentCharacter];
if (lastnumberStartingIndex == -1)
{
lastnumberStartingIndex = cleanedInputString.Length - 1; //Non-index based system, minus one for the index
lastnumberStartingIndex = currentCharacter - removedCharacterOffset;
}
}
//Check for any allowed punctuation.
if (adItemText[currentCharacter] == '\'')
{
cleanedInputString += adItemText[currentCharacter];
}
//Check if the previous character is an "'".
else if (cleanedInputString[cleanedInputString.Length - 1] == '\'')
{
cleanedInputString += adItemText[currentCharacter];
}
//Since whitespace booleans are handled above, set the boolean for white spaces false.
@@ -211,7 +205,6 @@ namespace AdvertsingProfitControl
{
cleanedInputString += ')';
}
//removedCharacterOffset++;
}
#if DEBUG