private static string show_hierarchy_value(Serial_Info serialInfo) { StringBuilder builder = new StringBuilder(); if ((serialInfo != null) && (serialInfo.Count > 0)) { builder.Append(serialInfo[0].Display + " (" + serialInfo[0].Order + ")"); } if ((serialInfo != null) && (serialInfo.Count > 1)) { if (builder.Length > 0) { builder.Append(" -- "); } builder.Append(serialInfo[1].Display + " (" + serialInfo[1].Order + ")"); } if ((serialInfo != null) && (serialInfo.Count > 2)) { if (builder.Length > 0) { builder.Append(" -- "); } builder.Append(serialInfo[2].Display + " (" + serialInfo[2].Order + ")"); } return(builder.ToString()); }
/// <summary> Saves the data stored in this instance of the /// element to the provided bibliographic object </summary> /// <param name="Bib"> Object to populate this element from </param> public override void Populate_From_Bib(SobekCM_Item Bib) { // Just save this object serialHierarchyObject = Bib.Bib_Info.Series_Part_Info; serialInfo = Bib.Behaviors.Serial_Info; // Check the type for default if (Bib.Bib_Info.SobekCM_Type == TypeOfResource_SobekCM_Enum.Newspaper ) newspaper = true; }
public void Set_PartInfo(Part_Info PartInfo, Serial_Info SerialInfo, bool isNewspaper) { partInfo = PartInfo; serialInfo = SerialInfo; volumeDisplayTextBox.Text = partInfo.Enum1; if (partInfo.Enum1_Index >= 0) { volumeOrderTextBox.Text = partInfo.Enum1_Index.ToString(); } issueDisplayTextBox.Text = partInfo.Enum2; if (partInfo.Enum2_Index >= 0) { issueOrderTextBox.Text = partInfo.Enum2_Index.ToString(); } partDisplayTextBox.Text = partInfo.Enum3; if (partInfo.Enum3_Index >= 0) { partOrderTextBox.Text = partInfo.Enum3_Index.ToString(); } yearDisplayTextBox.Text = partInfo.Year; if (partInfo.Year_Index >= 0) { yearOrderTextBox.Text = partInfo.Year_Index.ToString(); } monthDisplayTextBox.Text = partInfo.Month; if (partInfo.Month_Index >= 0) { monthOrderTextBox.Text = partInfo.Month_Index.ToString(); } dayDisplayTextBox.Text = partInfo.Day; if (partInfo.Day_Index >= 0) { dayOrderTextBox.Text = partInfo.Day_Index.ToString(); } if (serialInfo.Count > 0) { if (partInfo.Year == serialInfo[0].Display) { yearDisplayTextBox.Focus(); chronRadioButton.Checked = true; } else { volumeDisplayTextBox.Focus(); enumRadioButton.Checked = true; } } else { // If no default, set it by type if (isNewspaper) { yearDisplayTextBox.Focus(); chronRadioButton.Checked = true; } else { volumeDisplayTextBox.Focus(); enumRadioButton.Checked = true; } } dayOrderTextBox.TextChanged += textChanged; dayDisplayTextBox.TextChanged += textChanged; monthOrderTextBox.TextChanged += textChanged; monthDisplayTextBox.TextChanged += textChanged; yearOrderTextBox.TextChanged += textChanged; yearDisplayTextBox.TextChanged += textChanged; partOrderTextBox.TextChanged += textChanged; partDisplayTextBox.TextChanged += textChanged; issueOrderTextBox.TextChanged += textChanged; issueDisplayTextBox.TextChanged += textChanged; volumeDisplayTextBox.TextChanged += textChanged; volumeOrderTextBox.TextChanged += textChanged; enumRadioButton.CheckedChanged += checkedChanged; chronRadioButton.CheckedChanged += checkedChanged; }