39
Appendixes for The Reference List Formatter: An Object-Oriented Development Project Appendix A: Reference Styles Help Sheets Book by a Single Author/Editor MLA AuthorLast, AuthorFirst M. Title of Book. City: Publisher, Year. Anthony, Robert N. Planning and Control Systems: A Framework for Analysis. Boston: Harvard University Press, 1965. APA AuthorLast, F.M. (Year). Title of book. City: Publisher. Anthony, R.N. (1965). Planning and control systems: A framework for analysis. Boston: Harvard University Press. Chica go AuthorLast, AuthorFirst M. Title of Book. City: Publisher, Year. Anthony, Robert N. Planning and Control Systems: A Framework for Analysis. Boston: Harvard University Press, 1965. Book by Multiple Authors MLA AuthorLast, AuthorFirst M. and AuthorFirst M.AuthorLast. Title of Book. City: Publisher, Year. Rich, Elaine and Kevin Knight. Artificial Intelligence. New York: McGraw-Hill, 1991. APA AuthorLast, F.M., AuthorLast, F.M. & AuthorLast, F.M. (Year). Title of book. City: Publisher. Rich, E. & Knight, K. (1991). Artificial intelligence. New

Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

  • Upload
    haanh

  • View
    218

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Appendixes forThe Reference List Formatter:

An Object-Oriented Development Project

Appendix A: Reference Styles Help Sheets

Book by a Single Author/Editor

MLA

AuthorLast, AuthorFirst M. Title of Book. City: Publisher, Year.

Anthony, Robert N. Planning and Control Systems: A Framework for Analysis. Boston: Harvard University Press, 1965.

APA

AuthorLast, F.M. (Year). Title of book. City: Publisher.

Anthony, R.N. (1965). Planning and control systems: A framework for analysis. Boston: Harvard University Press.

Chicago

AuthorLast, AuthorFirst M. Title of Book. City: Publisher, Year.

Anthony, Robert N. Planning and Control Systems: A Framework for Analysis. Boston: Harvard University Press, 1965.

 

Book by Multiple Authors

MLA

AuthorLast, AuthorFirst M. and AuthorFirst M.AuthorLast. Title of Book. City: Publisher, Year.

Rich, Elaine and Kevin Knight. Artificial Intelligence. New York: McGraw-Hill, 1991.

APA

AuthorLast, F.M., AuthorLast, F.M. & AuthorLast, F.M. (Year). Title of book. City: Publisher.

Rich, E. & Knight, K. (1991). Artificial intelligence. New York: McGraw-Hill.

Chicago

AuthorLast, AuthorFirst M., AuthorFirst M. AuthorLast, and AuthorFirst M.AuthorLast. Title of Book. City: Publisher, Year.

Rich, Elaine and Kevin Knight. Artificial Intelligence. New York: McGraw-Hill, 1991.

 

Page 2: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Anthologies/Chapters

MLA

AuthorLast, AuthorFirst M. "Chapter Title." Title of Book. Eds. EditorFirst M. EditorLast and EditorFirst M. EditorLast. City: Publisher, Year. PageStart-PageEnd.

Norman, Donald A. "Cognitive Engineering." User Centered System Design, Eds. Donald A. Norman and Stephen W. Draper. Hillsdale, New Jersey: Lawrence Erlbaum Associates, 1986.  31-62.

APA

AuthorLast, F.M. (Year). Chapter title. In F.M. EditorLast & F.M. EditorLast (Eds.), Title of book (pp. PageStart-PageEnd). City: Publisher.

Norman, D.A. (1986). Cognitive Engineering. In D.A. Norman & S.W. Draper (Eds.), User centered system design (pp. 31-62). Hillsdale, New Jersey: Lawrence Erlbaum Associates.

Chicago

AuthorLast, AuthorFirst M. "Chapter Title." In Title of Book, ed. EditorFirst M. EditorLast and EditorFirst M. EditorLast, PageStart-PageEnd. City: Publisher, Year.

Norman, Donald A. "Cognitive Engineering." In User Centered System Design, eds. Donald A. Norman and Stephen W. Draper, 31-62. Hillsdale, New Jersey: Lawrence Erlbaum Associates, 1986.

 

Journal with Continuous Pagination (page numbers continue from one issue to the next) (Optional)

MLA

AuthorLast, AuthorFirst M. "Article Title." Journal Name Vol (Year): PageStart-PageEnd.

Gross, Derek and Katherine J. Miller. “Adjectives in WordNet.” International Journal of Lexicography 3 (1990): 265-277.

APA

AuthorLast, F.M. (Year). Article title. Journal Name, Vol, PageStart-PageEnd.

Gross, D. & Miller, K.J. (1990). Adjectives in WordNet. International Journal of Lexicography, 3, 265-277.

Chicago

AuthorLast, AuthorFirst M.. "Article Title." Journal Name Vol (Year): PageStart-PageEnd.

Gross, Derek and Katherine J. Miller. “Adjectives in WordNet.” International Journal of Lexicography 3 (1990): 265-277.

 

Page 3: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Journal with Non-Continuous Pagination (each issue has separate page numbering)

MLA

AuthorLast, AuthorFirst M. "Article Title." Journal Name Vol.No (Year): PageStart-PageEnd.

Foltz, Peter W. and Susan T. Dumais. “Personalized Information Delivery: An Analysis of Information-Filtering Methods.” Communications of the ACM 35.12 (1992): 51-60.

APA

AuthorLast, F.M. (Year). Article title. Journal Name, Vol (No), PageStart-PageEnd.

Foltz, P.W. and Dumais, S.T. (1992). Personalized information delivery: An analysis of information-filtering methods. Communications of the ACM, 35 (12), 51-60.

Chicago

AuthorLast, AuthorFirst M. "Article Title." Journal Name Vol, no. No (Year): PageStart-PageEnd.

Foltz, Peter W. and Susan T. Dumais. “Personalized Information Delivery: An Analysis of Information-Filtering Methods.” Communications of the ACM 35, no. 12 (1992): 51-60.

 

Conference Proceedings (Optional)

MLA

AuthorLast, AuthorFirst M. “Article Title.” Proceedings Name, Location: Month Day. PubCity: Publisher, PubYear. PageStart-PageEnd.

Frisse, Mark E. and Steve B. Cousins. “Information Retrieval from Hypertext: Update on the Dynamic Medical Handbook Project.” Proceedings of Hypertext '89, Pittsburgh, PA: November 5-8. New York: ACM Press, 1989. 199-212.

APA

AuthorLast, F.M., AuthorLast, F.M., & AuthorLast, F.M. (Year). Article title. In Proceedings Name, Location, Month Day (pp. PageStart-PageEnd), PubCity: Publisher.

Frisse, M.E. & Cousins, S.B. (1989). Information retrieval from hypertext: Update on the dynamic medical handbook project. In Proceedings of Hypertext '89, Pittsburgh, PA: November 5-8 (pp. 199-212), New York: ACM Press.

Chicago

AuthorLast, AuthorFirst M. and AuthorFirst M. AuthorLast. Year. Article Name. In Proceedings Name, Location, Month Day, PageStart-PageEnd. City: Publisher

Frisse, Mark E. and Steve B. Cousins. 1989. Information Retrieval from Hypertext: Update on the Dynamic Medical Handbook Project. In Proceedings of Hypertext '89, Pittsburgh, PA: November 5-8 , 199-212. New York: ACM Press.

Page 4: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Appendix B: clsDate Using Generic Approach This appendix includes an example clsDate that makes use of accessor and mutator methods rather than property procedures, which is a more generic approach.

'----------------------------------------------------------------------------------------------------------------------' clsDate'' This class stores dates in a mm, dd, and yyyy format. A new date class is ' necessary because the built-in data types for date do not allow zero values for ' month and day, but sometimes that information is not known. Various accessor ' methods are provided to output the date in various formats. ''----------------------------------------------------------------------------------------------------------------------

Public Class clsDate     Private mMonth As Integer     Private mDay As Integer     Private mYear As Integer

     '------------------------------------------------------------------------------     ' No-argument constructor set month, day, and year to current date.     '------------------------------------------------------------------------------     Public Sub New()          mDay = Microsoft.VisualBasic.DateAndTime.Day(Today)          mMonth = Month(Today)          mYear = Year(Today)     End Sub     '------------------------------------------------------------------------------     ' This accessor returns the day.     '------------------------------------------------------------------------------     Public Function getDay( ) As Integer          Return  mDay     End Function

     '------------------------------------------------------------------------------     ' This mutator method sets the day after calling validateDay.      '------------------------------------------------------------------------------    Public Sub setDay(ByVal dd As Integer)          mDay = validateDay(mMonth, dd, mYear)     End Sub     '------------------------------------------------------------------------------     ' This accessor method returns the month value.     '------------------------------------------------------------------------------     Public Function getMonth( ) As Integer          Return  mMonth     End Function

Page 5: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

     '------------------------------------------------------------------------------     ' This mutator method sets the month after calling validateMonth.      '------------------------------------------------------------------------------     Public Sub setMonth(ByVal mm As Integer)          mMonth = validateMonth(mm)     End Sub

     '------------------------------------------------------------------------------     ' This accessor method returns the year value.     '-------------------------------------------------------------------------------     Public Function getYear( ) As Integer          Return  mYear     End Function

     '------------------------------------------------------------------------------     ' This mutator method sets the year.     '------------------------------------------------------------------------------     Public Sub setYear(ByVal yyyy As Integer)          mYear = validateYear(yyyy)      End Sub

     '------------------------------------------------------------------------------     ' This accessor method returns the date in mm/dd/yyyy format.     '------------------------------------------------------------------------------     Public Overrides Function ToString( ) As String            Return  mMonth & "/" & mDay & "/" & mYear     End Function

     '------------------------------------------------------------------------------     ' This mutator method sets the date values by validating     ' the month, day, and year.      '------------------------------------------------------------------------------     Public Sub setDate(ByVal mth As Integer, _                              ByVal dy As Integer, _                              ByVal yr As Integer)          mMonth = validateMonth(mth)          mYear = validateYear(yr)          mDay = validateDay(mMonth, dy, mYear)               End Sub

     '------------------------------------------------------------------------------     ' This utility method checks the validity of the month argument. If it is      ' invalid, then it is arbitrarily reset to 1 so as to place the instance variable     ' into a consistent state. Invoked by setDate and setMonth.     '------------------------------------------------------------------------------     Private Function validateMonth(ByVal mth As Integer) As Integer          Dim typeOfBox As Integer          typeOfBox = vbOKOnly + vbExclamation + vbApplicationModal          If (mth > 0 And mth <= 12) Then               Return mth

Page 6: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

          Else               MsgBox("Invalid month value--reset to 1!", typeOfBox, "Error")               Return 1          End If     End Function

     '------------------------------------------------------------------------------     ' This utility method checks the validity of the day argument. If it is      ' invalid, then it is arbitrarily reset to 1 so as to place the instance variable     ' into a consistent state. Note that it also checks for a leap year. Invoked      ' by setDate and setDay.     '------------------------------------------------------------------------------    Private Function validateDay(ByVal mth As Integer, _                         ByVal dy As Integer, _                         ByVal yr As Integer) As Integer

          Dim daysPerMonth( ) As Integer = {0, 31, 28, 31, 30, 31, 30, 31, 31, _                                                                                30, 31, 30, 31}

          If dy > 0 And dy <= daysPerMonth(mth) Then               Return dy          ElseIf mth = 2 And dy = 29 And isLeapYear(yr) Then               Return  dy          Else               ' An invalid day was passed to validateDay               ' Set the day to a default value of 1               Return  1          End If     End Function      '------------------------------------------------------------------------------     ' This utility method checks the validity of the year argument. If it is      ' invalid, then it is arbitrarily reset to the current year so as to place the      ' instance variable into a consistent state. Invoked by setDate and setYear.     '------------------------------------------------------------------------------    Private Function validateYear(ByVal yyyy As Integer) As Integer          If yyyy > 1700 And yyyy < 10000 Then               Return yyyy          Else               Return Year(Today)          End If     End Function

    '------------------------------------------------------------------------------    ' This utility method checks to see if the year argument corresponds to a leap     ' year. It returns a true or false value.    '------------------------------------------------------------------------------    Private Function isLeapYear(ByVal year As Integer) As Boolean          Return year Mod 400 = 0 Or _               year Mod 4 = 0 And _               year Mod 100 <> 0     End Function

Page 7: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

End Class

' Form module to test class clsDate   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load     Dim testDate1 As New clsDate ()     Dim testDate2 As New clsDate ()

     With testDate1           .setMonth(12)          .setDay(25)          .setYear(2003)     End With

     testDate2.setDate(1, 1, 2004)

     txtOutput.Text &= testDate1.ToString() & vbCrLf     txtOutput.Text &= testDate2.ToString() & vbCrLfEnd Sub

 

Page 8: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Appendix C: Sample Screen Shots

Figure 1: Screen shot of interface for Deliverable 2.

Figure 2: Screen shot of interface for Deliverable 3.

Page 9: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 3: Screen shot of opening interface for Deliverable 4.

Page 10: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 4: Screen shot of results interface for Deliverable 4.

Page 11: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 5: Screen shot of opening interface for Deliverable 5.

Page 12: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 6: Screen shot of book entry form for Deliverable 5.

Page 13: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 7: Screen shot of chapter entry form for Deliverable 5.

Page 14: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 8: Screen shot of journal entry form for Deliverable 5.

Page 15: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 9: Screen shot of opening interface for Deliverable 6.

Page 16: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 10: Screen shot of book entry form for Deliverable 6.

Page 17: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 11: Screen shot of chapter entry form for Deliverable 6.

Page 18: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 12: Screen shot of journal entry form for Deliverable 6.

Figure 13: Screen shot of opening interface for Deliverable 7.

Page 20: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 16: Screen shot of menu for Deliverable 7.

Figure 17: Screen shot of menu for Deliverable 7.

Page 21: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 18: Screen shot of book entry form for Deliverable 7.

Page 22: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 19: Screen shot of chapter entry form for Deliverable 7.

Page 23: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Figure 20: Screen shot of journal entry form for Deliverable 7.

Figure 21: Screen shot of help screen for Deliverable 7.

Page 24: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Appendix D: Method Details for Deliverable 4Table 1: Method Descriptions for clsReference.

Method Name Description

New – No arguments No-argument constructor that initializes all instance variables to their default value, but also instantiates the array of author names and the pub date.

New – Seven arguments This multi-argument constructor sets the values for the initial author, the title, and the pub date. Since many publications have more than one author it is of limited usefulness.

setAuthor This mutator method sets the value of an author name. It receives an index indicating the position of the author in the array. If it exceeds the array size it redims the array to add two new locations, and also initializes those new elements.

resetNumAuthors This mutator method redimensions the author array to the actual number of elements.

setTitle This mutator method sets the title.

setPubDate – Three arguments This mutator method sets the month, day, and year portions of the publication date.

setPubDate – Two arguments This mutator method sets the month and year portions of the publication date.

setPubDate – One argument This mutator method sets the year portion of the publication date.

getAuthorLastFirstMi This accessor method returns the array of author names, with each name listed in Last, First Mi order.

getAuthorLastFiMi This accessor method returns the array of author names, with each name listed in Last, Fi Mi order.

getAuthorLastFiMi_FirstMiLast This accessor method returns the array of author names, with the first name listed in Last, Fi Mi order and the remaining names in First Mi Last order. The method also places an "and" before the last name.

getAuthorLastFirstMi_FirstMiLast This accessor method returns the array of author names, with the first name listed in Last, First Mi order and the remaining names in First Mi Last order. This method places an "and" before the last name.

getTitle  This accessor method returns the title. Note that it calls the convertToTitleCase routine to insure that all words in the title are capitalized.

getTitleLowercase  This accessor method returns the title, after first converting every word except the first to lower case.

getPubDate This accessor method returns the publication date by

Page 25: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

calling the dateString method of clsDate, which returns a date string in a certain format as specified by a parameter.

convertToLowerCase  This utility method converts a string to lower case, with the exception of the first character, which is capitalized.

convertToTitleCase  This utility method converts a string to title case.

Appendix E: Method Details for Deliverable 5Table 2: clsBook Methods.

Method Name Description

setPublisher Mutator method that sets the publisher value after converting it to title case.

setCity Mutator method that sets the city value after converting it to title case.

setState Mutator method that sets the state value after verifying that the length is 2 and then converting it to title case.

setCountry Mutator method that sets the country value after verifying that the length is 2 and then converting it to title case.

setBook Provides values for the instance variables for a book by calling the other set methods.

getPublisher Accessor method that gets the publisher value.

getCity Accessor method that gets the city value.

getState Accessor method that gets the state value.

getCountry Accessor method that gets the country value.

formatMLA Provides MLA format for a book.

formatAPA Provides APA format for a book.

formatChicago Provides Chicago format for a book.

Page 26: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Table 3: clsChapter Methods.

Method Name Description

setEditor This mutator method sets the value of an editor name. It receives an index indicating the position of the editor in the array. If it exceeds the array size it redims the array to add two new locations, and also initializes those new elements.

setBookTitle This mutator method sets the book title. (Note that the title field that is inherited from clsReference is the chapter title.)

setBeginningPage This mutator method sets the beginning page.setEndingPage This mutator method sets the ending page.setChapterInfo Provides values for the instance variables for a chapter.getEditorLastFirstMi This accessor method returns the array of editor names, with

each name listed in Last, First Mi order.getEditorLastFiMi This accessor method returns the array of editor names, with

each name listed in Last, Fi Mi order.getEditorLastFiMi_FirstMiLast This accessor method returns the array of editor names, with

the first name listed in Last, Fi Mi order and the remaining names in First Mi Last order. This version places an "and" before the last name.

getEditorFiMiLast This accessor method returns the array of editor names, with each name listed in Fi Mi Last order.

getEditorLastFirstMi_FirstMiLast This accessor method returns the array of editor names, with the first name listed in Last, First Mi order and the remaining names in First Mi Last order.

getEditorFirstMiLast This accessor method returns the array of editor names, with the first name listed in First Mi Last order.

getBookTitle This accessor method gets the book title. (Note that the title field that is inherited from clsReference is the chapter title.)

getBeginningPage This accessor method gets the beginning page.getEndingPage This accessor method gets the ending page.resetNumEditors This mutator method redimensions the editor array to the

actual number of elements.formatMLA Provides MLA format for a chapter.formatAPA Provides APA format for a chapter.formatChicago Provides Chicago format for a chapter.

Page 27: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Table 4: clsJournal Methods.

Method Name Description

setSource Mutator method that provides a source value.setVolume Mutator method that provides a volume value.setNumber Mutator method that provides a number value.setBeginningPage Mutator method that provides a beginning page

value.setEndingPage Mutator method that provides a ending page

value.setJournalInfo Provides values for the instance variables for a

journal.getSource Accessor method that returns the source value.getVolume Accessor method that returns a volume value.getNumber Accessor method that returns a number value.getBeginningPage Accessor method that returns a beginning page

value.getEndingPage Accessor method that returns a ending page

value.formatMLA Provides MLA format for a journal.formatAPA Provides APA format for a journal.formatChicago Provides Chicago format for a journal.

Page 28: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Appendix F: VB TipsThis appendix includes VB tips that you might find helpful when implementing the various deliverables.

Deliverables 1-4: Refer to text or class notes.

Deliverable 5: Inheritance and InterfacesRequirement Directions

Abstract Class

Insert the keyword MustInherit

Include the keywords Protected and MustOverride with the methods if they are necessary.

Tooltip Drag a tooltip from the toolbox to the form. Add the lines like the following to the Form1_Load event, or to a

procedure called by the Form1_Load event.  Be sure to change the control names to match your names.

 With Me.ToolTip1    .ShowAlways = True    .ReshowDelay = 500    .InitialDelay = 500

    .SetToolTip (txtInput, "Enter the blah blah blah.")    .SetToolTip (cmdButton, "Performs the something something.") End With

abstract interface

To add an abstract interface to a project in VB.NET you right click the project name in the Solution Explorer, then click Add, then New Item, and then select Interface from the Templates screen.

quotation mark

To print a quotation mark in a string, one approach is to create a constant and then concatenate it to your output string: Const QUOTE As Char = ChrW(34) or Const QUOTE As Char = """"

TabControl Drag a TabControl from the ToolBox to your form. Click in the area below the tab (not in the tabbed section itself) and

then look for the Text property of the TabPage. If you don't see it click until you do.

To modify the next tab, double click the tabbed section itself to activate the tab. Then click inside the TabPage and modify the Text property.

To add an additional tab, right click in the TabControl section (to the right of the last tab) and then select Add Tab from the pop up menu.

Deliverable 6: PolymorphismRequirement Directions

Writing to doc From Word 97 onward, files with html tags are read as Word doc files if the

Page 29: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

file file has a .doc extension.  In order to easily italicize our titles we simply enclose them in the html tags for italics, <i> and </i>, and write them to a file that has as its first line <html><body>, and as its final line </body></html>.

Open the doc file using a SaveFileDialog.

Use PrintLine to write each line.

Include html tags to allow formatting, as in

PrintLine(fileNumber, "<html><body>")

WebBrowser control

The review feature to display the doc file that was created by the application can be implemented by using the WebBrowser control.  In this example the destination file name was passed via the parameter called outFile. The WebBrowser control allows you to view an entire doc file. Here is sample code for the sub:

Private Sub reviewRefs(ByRef outfile as String)     Dim nullObject As System.Object = 0     Dim str As String = ""     Dim nullObjStr As System.Object = str     Cursor.Current = Cursors.WaitCursor     WebBrowser1.Url = New Uri(outFile)               Cursor.Current = Cursors.DefaultEnd Sub

RichTextBox A RichTextBox control could be used instead of the WebBrowser control and html tags.

Cursor icon If you have trouble with the version of the cursor command as used in the WebBroswer code snippet above, there are two fixes that you can try:

Me.Cursor = Cursors.WaitCursorMe.Cursor = Cursors.Default

You may need to refer to it as System.Windows.Forms.Cursor.Current

ArrayList Use a normal For loop to process your ArrayList.  If you use the For Each Next loop incorrectly it can "disable" polymorphism.

Object Type You should not need this (unless you ignore the previous comment), but remember that a line like CType(ref, clsBook)casts an object (in this case of clsReference) to a clsBook type. A line like If TypeOf ref Is clsBookreturns true if the type of the object ref is clsBook

Deliverable 7: Object PersistenceRequirement

Directions

MenuStrip Add a MenuStrip to your form.

Page 30: Appendix A: Reference Styles Help Sheetscobhomepages.cob.isu.edu/parkerkr/InSite2010/Appendixes.docx · Web viewNorman, Donald A. "Cognitive Engineering." In User Centered System

Add menu items one at a time in the areas where it displays "Type Here".

Be sure to give appropriate names to each individual menu item.

TabControl Drag a TabControl from the ToolBox to your form. Click in the area below the tab (not in the tabbed section itself) and

then look for the Text property of the TabPage. If you don't see it click until you do.

To modify the next tab, double click the tabbed section itself to activate the tab. Then click inside the TabPage and modify the Text property.

To add an additional tab, right click in the TabControl section (to the right of the last tab) and then select Add Tab from the pop up menu.