SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 97 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

Topics;
static Style style = Style.WithText;
static Sort sort = Sort.ByMostRecent;
// Actions: enabling condition, then action method
static bool SelectMessagesEnabled()
{
return (page == Page.Topics);
}
[Action]
static void SelectMessages()
{
page = Page.Messages;
}
static bool SelectTopicsEnabled()
{
return (page == Page.Messages);
}
[Action]
static void SelectTopics()
{
page = Page.Topics;
}
// to be continued ...
Figure 5.4. Web-based newsreader: model program (part 1).
66 Model Programs
static bool ShowTitlesEnabled()
{
return (page == Page.Topics && style == Style.WithText);
}
[Action]
static void ShowTitles()
{
style = Style.TitlesOnly;
}
static bool ShowTextEnabled()
{
return (page == Page.Topics && style == Style.TitlesOnly);
}
[Action]
static void ShowText()
{
style = Style.WithText;
}
static bool SortByFirstEnabled()
{
return (page == Page.Topics && style == Style.TitlesOnly
&& sort == Sort.ByMostRecent);
}
[Action]
static void SortByFirst()
{
sort = Sort.ByFirst;
}
static bool SortByMostRecentEnabled()
{
return (page == Page.Topics && style == Style.TitlesOnly
&& sort == Sort.ByFirst);
}
[Action]
static void SortByMostRecent()
{
sort = Sort.ByMostRecent;
}
}
}
Figure 5.5. Web-based newsreader: model program (part 2).
Systems with Finite Models 67
5.4.1 Program structure
A model program must include using statements to use the namespaces of the modeling
library NModel.


Pages:
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6