@@ -176,6 +176,7 @@ public void Ribbon_Load(Office.IRibbonUI ribbonUI)
176176
177177 Data . CreateTableAliasTable ( ) ;
178178 Data . CreateDateFormatTable ( ) ;
179+ Data . CreateTimeFormatTable ( ) ;
179180 Data . CreateGraphDataTable ( ) ;
180181
181182 }
@@ -358,9 +359,10 @@ public int GetItemCount(Office.IRibbonControl control)
358359 {
359360 switch ( control . Id )
360361 {
361- case "cboDateFormatReplace" :
362- case "cboDateFormatFind" :
362+ case "cboFormatDate" :
363363 return Data . DateFormatTable . Rows . Count ;
364+ case "cboFormatTime" :
365+ return Data . TimeFormatTable . Rows . Count ;
364366 case "cboTableAlias" :
365367 return Data . TableAliasTable . Rows . Count ;
366368 default :
@@ -386,9 +388,10 @@ public string GetItemLabel(Office.IRibbonControl control, int index)
386388 {
387389 switch ( control . Id )
388390 {
389- case "cboDateFormatReplace" :
390- case "cboDateFormatFind" :
391+ case "cboFormatDate" :
391392 return UpdateDateFormatComboBoxSource ( index ) ;
393+ case "cboFormatTime" :
394+ return UpdateTimeFormatComboBoxSource ( index ) ;
392395 case "cboTableAlias" :
393396 return UpdateTableAliasComboBoxSource ( index ) ;
394397 default :
@@ -413,9 +416,9 @@ public string GetText(Office.IRibbonControl control)
413416 {
414417 switch ( control . Id )
415418 {
416- case "cboDateFormatReplace " :
419+ case "cboFormatDate " :
417420 return Properties . Settings . Default . Table_ColumnFormatDate ;
418- case "cboDateFormatFind " :
421+ case "cboFormatTime " :
419422 return Properties . Settings . Default . Table_ColumnFormatTime ;
420423 case "cboTableAlias" :
421424 return Properties . Settings . Default . Table_ColumnTableAlias ;
@@ -622,11 +625,11 @@ public void OnChange(Office.IRibbonControl control, string text)
622625 {
623626 switch ( control . Id )
624627 {
625- case "cboDateFormatReplace " :
628+ case "cboFormatDate " :
626629 Properties . Settings . Default . Table_ColumnFormatDate = text ;
627630 Data . InsertRecord ( Data . DateFormatTable , text ) ;
628631 break ;
629- case "cboDateFormatFind " :
632+ case "cboFormatTime " :
630633 Properties . Settings . Default . Table_ColumnFormatTime = text ;
631634 Data . InsertRecord ( Data . DateFormatTable , text ) ;
632635 break ;
@@ -1535,7 +1538,7 @@ public void OpenTableDataPane()
15351538 myTableData . Dispose ( ) ;
15361539 }
15371540 myTableData = new TaskPane . TableData ( ) ;
1538- myTaskPaneTableData = Globals . ThisAddIn . CustomTaskPanes . Add ( myTableData , "List of " + Ribbon . AppVariables . TableName + " for " + Scripts . AssemblyInfo . Title ) ;
1541+ myTaskPaneTableData = Globals . ThisAddIn . CustomTaskPanes . Add ( myTableData , Ribbon . AppVariables . TableName ) ;
15391542 myTaskPaneTableData . DockPosition = Office . MsoCTPDockPosition . msoCTPDockPositionRight ;
15401543 myTaskPaneTableData . DockPositionRestrict = Office . MsoCTPDockPositionRestrict . msoCTPDockPositionRestrictNoChange ;
15411544 myTaskPaneTableData . Width = 300 ;
@@ -1566,6 +1569,24 @@ public string UpdateDateFormatComboBoxSource(int itemIndex)
15661569 }
15671570 }
15681571
1572+ /// <summary>
1573+ /// Update the value of the combobox from a data table by index
1574+ /// </summary>
1575+ /// <param name="itemIndex">Represents the index of the list value </param>
1576+ /// <returns>the label value for the combobox index</returns>
1577+ public string UpdateTimeFormatComboBoxSource ( int itemIndex )
1578+ {
1579+ try
1580+ {
1581+ return Data . TimeFormatTable . Rows [ itemIndex ] [ "FormatString" ] . ToString ( ) ;
1582+ }
1583+ catch ( Exception ex )
1584+ {
1585+ ErrorHandler . DisplayMessage ( ex ) ;
1586+ return string . Empty ;
1587+ }
1588+ }
1589+
15691590 /// <summary>
15701591 /// Update the value of the combobox from a data table by index
15711592 /// </summary>
0 commit comments