void setSymbolState(string valueSelected = "") { // TODO: Figure out a way to set this consistent naming scheme better string symbolSetName = currentSymbol.Id.SymbolSet.ToString().Replace("_", " "); if (string.IsNullOrEmpty(valueSelected)) { // this is a special state (i.e. hack) to simulate a button press, to force // into the next state, when the previous panel is empty } else if (currentPane == PaneSequenceType.AffiliationPane) { string affiliationSelectedString = valueSelected; StandardIdentityAffiliationType affiliationSelection = (StandardIdentityAffiliationType) TypeUtilities.EnumHelper.getEnumFromString( typeof(StandardIdentityAffiliationType), affiliationSelectedString); currentSymbol.Id.Affiliation = affiliationSelection; currentPane = PaneSequenceType.SymbolSetPane; } else if (currentPane == PaneSequenceType.SymbolSetPane) { string symbolSetSelectedString = valueSelected; SymbolSetType symbolSetSelection = (SymbolSetType) TypeUtilities.EnumHelper.getEnumFromString( typeof(SymbolSetType), symbolSetSelectedString); currentSymbol.Id.SymbolSet = symbolSetSelection; currentPane = PaneSequenceType.EntityPane; } else if (currentPane == PaneSequenceType.EntityPane) { if (valueSelected == NOT_SET) { currentPane = PaneSequenceType.Modifier1Pane; } else { currentEntityName = valueSelected; string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName); currentSymbol.Id.EntityCode = entityCode; currentPane = PaneSequenceType.EntityTypePane; } } else if (currentPane == PaneSequenceType.EntityTypePane) { if (valueSelected == NOT_SET) { currentPane = PaneSequenceType.Modifier1Pane; } else { currentEntityTypeName = valueSelected; string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName, currentEntityTypeName); currentSymbol.Id.EntityCode = entityCode; currentPane = PaneSequenceType.EntitySubTypePane; } } else if (currentPane == PaneSequenceType.EntitySubTypePane) { if (valueSelected == NOT_SET) { currentPane = PaneSequenceType.Modifier1Pane; } else { currentEntitySubTypeName = valueSelected; string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName, currentEntityTypeName, currentEntitySubTypeName); currentSymbol.Id.EntityCode = entityCode; currentPane = PaneSequenceType.Modifier1Pane; } } else if (currentPane == PaneSequenceType.Modifier1Pane) { string currentModifier1Name = valueSelected; string modifier1Code = symbolLookup.GetModifierCodeFromName( currentSymbol.Id.SymbolSet, 1, currentModifier1Name); currentSymbol.Id.ModifierOne = modifier1Code; currentPane = PaneSequenceType.Modifier2Pane; } else if (currentPane == PaneSequenceType.Modifier2Pane) { string currentModifier2Name = valueSelected; string modifier2Code = symbolLookup.GetModifierCodeFromName( currentSymbol.Id.SymbolSet, 2, currentModifier2Name); currentSymbol.Id.ModifierTwo = modifier2Code; currentPane = PaneSequenceType.EchelonMobilityPane; } else if (currentPane == PaneSequenceType.EchelonMobilityPane) { string currentEchelonMobilityName = valueSelected; EchelonMobilityType echelonMobilitySelection = (EchelonMobilityType) TypeUtilities.EnumHelper.getEnumFromString( typeof(EchelonMobilityType), currentEchelonMobilityName); currentSymbol.Id.EchelonMobility = echelonMobilitySelection; currentPane = PaneSequenceType.HqTfFdPane; } else if (currentPane == PaneSequenceType.HqTfFdPane) { string currentHqTfFdName = valueSelected; HeadquartersTaskForceDummyType hqTfFdSelection = (HeadquartersTaskForceDummyType) TypeUtilities.EnumHelper.getEnumFromString( typeof(HeadquartersTaskForceDummyType), currentHqTfFdName); currentSymbol.Id.HeadquartersTaskForceDummy = hqTfFdSelection; currentPane = PaneSequenceType.StatusPane; } else if (currentPane == PaneSequenceType.StatusPane) { string currentStatusName = valueSelected; StatusType statusSelection = (StatusType)TypeUtilities.EnumHelper.getEnumFromString( typeof(StatusType), currentStatusName); currentSymbol.Id.Status = statusSelection; currentPane = PaneSequenceType.StartOver; } else if (currentPane == PaneSequenceType.StartOver) { // Reset the other values resetSymbolState(); // Go back when we are done currentPane = PaneSequenceType.SymbolSetPane; } setTagLabel(); updatePictureBox(); // Go To Next Pane SetPaneState(); }