Foodolini.Main.MainWindow Class Reference

Inherits Foodolini::Activities::IOwner.

Collaboration diagram for Foodolini.Main.MainWindow:
Collaboration graph

List of all members.

Public Member Functions

 MainWindow ()
void AddRecipe (Recipe recipe, double servings)
 Add all ingredients needed for the recipe to the shoppinglist.
void UpdateUserList ()
IActivity PushActivity (string activity)
 Load an activity and put on top of the activity stack.
PushActivity< T > ()
 Load an activity and put on top of the activity stack.
bool LoadActivity (string activity)
 Unloades the activity stack and load on activity.
bool PopActivity ()
 Pop the top of the activity stack, and set the next activity, uses "Home" if stack is empty.
bool HomeActivity ()
 Tries to load the home activity.
void ToggleShoppingList (bool state)
 Toggles the ShoppingList. If expanded, it will be collapsed, and if collapsed it will be expanded.

Protected Member Functions

virtual void Build ()
virtual void OnHomeButtonClicked (object sender, System.EventArgs e)
virtual void OnBtnShowHideShoppingListClicked (object sender, System.EventArgs e)

Properties

Person CurrentUser [get]
 The currently selected user, null if None or Anonymous.
Gtk.Window Window [get]
 Get the main window from IOwner.

Events

EventHandler< PersonEventArgsCurrentUserChanged
 Occurs when the current user is changed.
EventHandler
< ActivityUnloadedArgs
ActivityUnloading
 Occurs when an activity is unloading.

Private Member Functions

void LoadPlugins ()
string ActivityName (IActivity activity)
 Gets the name of an activity using reflection, return "Unknown" if attribute isn't present.
void SetActivity ()
 Set the top of the activity stack as active activity, e.g. display it.
void InitializeActivity (string activity)
 Initialize an activity.
bool HasActivity (string activity)
bool CloseActivity ()
 Closes the activity at the top of the activity stack.
void UpdateActivitiesComboBox ()
 Update the activities combobox to match the top of the stack.
void activityCombobox_Changed (object sender, EventArgs e)
void userCombobox_Changed (object sender, EventArgs e)
void PopulateUserCombobox ()
 Lists users of the system in the userCombobox.
void OnDeleteEvent (object sender, DeleteEventArgs a)
void LoadShoppingList ()
void ShowHideShoppingList ()

Private Attributes

Gtk.UIManager UIManager
Gtk.VBox vbox2
Gtk.HBox hbox1
Gtk.Button HomeButton
Gtk.Label label1
Gtk.ComboBox userCombobox
Gtk.Label label2
Gtk.ComboBox activityCombobox
Gtk.Fixed fixed1
Gtk.HBox hbox2
Gtk.HBox contentbox
Gtk.VBox vbox3
Gtk.Button btnShowHideShoppingList
Gtk.Table ShoppingListHandleTable
Gtk.Arrow ShoppingListArrow
Gtk.Label ShoppingListLabel
Gtk.VBox ShoppingListBox
Gtk.HButtonBox hbuttonbox1
Gtk.Statusbar statusbar2
List< string > mainActivities
Dictionary< string,
ConstructorInfo > 
plugins
Dictionary< string, Pixbuf > pluginIcons
Stack< IActivityactivities = new Stack<IActivity>()
 The Activity stack.
Widget currentView = null
ListStore activityStore
bool ignoreComboBoxChanges = false
 True, if the activityCombobox.Changed event should be ignored, e.g. the activityCombobox is manipulated programmatically.
ListStore userStore
 Store of all users.
IActivity shoppingList
bool shoppingListCollapsed = false

Detailed Description

Definition at line 14 of file Foodolini.Main.MainWindow.cs.


Constructor & Destructor Documentation

Foodolini.Main.MainWindow.MainWindow (  ) 

Definition at line 15 of file MainWindow.cs.


Member Function Documentation

void Foodolini.Main.MainWindow.activityCombobox_Changed ( object  sender,
EventArgs  e 
) [private]

Definition at line 243 of file MainWindow.cs.

string Foodolini.Main.MainWindow.ActivityName ( IActivity  activity  )  [private]

Gets the name of an activity using reflection, return "Unknown" if attribute isn't present.

Definition at line 98 of file MainWindow.cs.

void Foodolini.Main.MainWindow.AddRecipe ( Recipe  recipe,
double  servings 
)

Add all ingredients needed for the recipe to the shoppinglist.

This is all ingredients, and does not depend on what is on storage. If the nature of the shoppinglist is changed in the future, this may change.

Implements Foodolini.Activities.IOwner.

Definition at line 328 of file MainWindow.cs.

virtual void Foodolini.Main.MainWindow.Build (  )  [protected, virtual]

Definition at line 54 of file Foodolini.Main.MainWindow.cs.

bool Foodolini.Main.MainWindow.CloseActivity (  )  [private]

Closes the activity at the top of the activity stack.

Returns:
True, if the activity could be unloaded.

Definition at line 160 of file MainWindow.cs.

bool Foodolini.Main.MainWindow.HasActivity ( string  activity  )  [private]

Definition at line 152 of file MainWindow.cs.

bool Foodolini.Main.MainWindow.HomeActivity (  ) 

Tries to load the home activity.

Returns:
True, if Home was loaded

Implements Foodolini.Activities.IOwner.

Definition at line 418 of file MainWindow.cs.

void Foodolini.Main.MainWindow.InitializeActivity ( string  activity  )  [private]

Initialize an activity.

Parameters:
parameters Parameters for the activity constructor

Definition at line 140 of file MainWindow.cs.

bool Foodolini.Main.MainWindow.LoadActivity ( string  activity  ) 

Unloades the activity stack and load on activity.

Parameters:
activity Activity to load
Returns:
True, if the activity stack could be unloaded

Implements Foodolini.Activities.IOwner.

Definition at line 382 of file MainWindow.cs.

void Foodolini.Main.MainWindow.LoadPlugins (  )  [private]

Definition at line 44 of file MainWindow.cs.

void Foodolini.Main.MainWindow.LoadShoppingList (  )  [private]

Definition at line 455 of file MainWindow.cs.

virtual void Foodolini.Main.MainWindow.OnBtnShowHideShoppingListClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Definition at line 470 of file MainWindow.cs.

void Foodolini.Main.MainWindow.OnDeleteEvent ( object  sender,
DeleteEventArgs  a 
) [private]

Definition at line 301 of file MainWindow.cs.

virtual void Foodolini.Main.MainWindow.OnHomeButtonClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Definition at line 34 of file MainWindow.cs.

bool Foodolini.Main.MainWindow.PopActivity (  ) 

Pop the top of the activity stack, and set the next activity, uses "Home" if stack is empty.

Returns:
True, if current activity could be unloaded

Implements Foodolini.Activities.IOwner.

Definition at line 402 of file MainWindow.cs.

void Foodolini.Main.MainWindow.PopulateUserCombobox (  )  [private]

Lists users of the system in the userCombobox.

Definition at line 276 of file MainWindow.cs.

IActivity Foodolini.Main.MainWindow.PushActivity ( string  activity  ) 

Load an activity and put on top of the activity stack.

Parameters:
activity Activity to load
Returns:
The activity that was added, null if not found

Implements Foodolini.Activities.IOwner.

Definition at line 346 of file MainWindow.cs.

T Foodolini.Main.MainWindow.PushActivity< T > (  ) 

Load an activity and put on top of the activity stack.

Returns:
The activity that was added, null if not found

Implements Foodolini.Activities.IOwner.

Type Constraints
T :class 
T :new() 
void Foodolini.Main.MainWindow.SetActivity (  )  [private]

Set the top of the activity stack as active activity, e.g. display it.

Definition at line 113 of file MainWindow.cs.

void Foodolini.Main.MainWindow.ShowHideShoppingList (  )  [private]

Definition at line 475 of file MainWindow.cs.

void Foodolini.Main.MainWindow.ToggleShoppingList ( bool  state  ) 

Toggles the ShoppingList. If expanded, it will be collapsed, and if collapsed it will be expanded.

Implements Foodolini.Activities.IOwner.

Definition at line 464 of file MainWindow.cs.

void Foodolini.Main.MainWindow.UpdateActivitiesComboBox (  )  [private]

Update the activities combobox to match the top of the stack.

Definition at line 193 of file MainWindow.cs.

void Foodolini.Main.MainWindow.UpdateUserList (  ) 

Implements Foodolini.Activities.IOwner.

Definition at line 332 of file MainWindow.cs.

void Foodolini.Main.MainWindow.userCombobox_Changed ( object  sender,
EventArgs  e 
) [private]

Notifies subscribers if the current user has changed.

Definition at line 263 of file MainWindow.cs.


Member Data Documentation

Stack<IActivity> Foodolini.Main.MainWindow.activities = new Stack<IActivity>() [private]

The Activity stack.

Definition at line 93 of file MainWindow.cs.

Definition at line 30 of file Foodolini.Main.MainWindow.cs.

Definition at line 188 of file MainWindow.cs.

Definition at line 40 of file Foodolini.Main.MainWindow.cs.

Definition at line 36 of file Foodolini.Main.MainWindow.cs.

Widget Foodolini.Main.MainWindow.currentView = null [private]

Definition at line 108 of file MainWindow.cs.

Gtk.Fixed Foodolini.Main.MainWindow.fixed1 [private]

Definition at line 32 of file Foodolini.Main.MainWindow.cs.

Gtk.HBox Foodolini.Main.MainWindow.hbox1 [private]

Definition at line 20 of file Foodolini.Main.MainWindow.cs.

Gtk.HBox Foodolini.Main.MainWindow.hbox2 [private]

Definition at line 34 of file Foodolini.Main.MainWindow.cs.

Gtk.HButtonBox Foodolini.Main.MainWindow.hbuttonbox1 [private]

Definition at line 50 of file Foodolini.Main.MainWindow.cs.

Definition at line 22 of file Foodolini.Main.MainWindow.cs.

True, if the activityCombobox.Changed event should be ignored, e.g. the activityCombobox is manipulated programmatically.

Definition at line 241 of file MainWindow.cs.

Gtk.Label Foodolini.Main.MainWindow.label1 [private]

Definition at line 24 of file Foodolini.Main.MainWindow.cs.

Gtk.Label Foodolini.Main.MainWindow.label2 [private]

Definition at line 28 of file Foodolini.Main.MainWindow.cs.

Definition at line 40 of file MainWindow.cs.

Dictionary<string, Pixbuf> Foodolini.Main.MainWindow.pluginIcons [private]

Definition at line 42 of file MainWindow.cs.

Dictionary<string, ConstructorInfo> Foodolini.Main.MainWindow.plugins [private]

Definition at line 41 of file MainWindow.cs.

Definition at line 452 of file MainWindow.cs.

Definition at line 44 of file Foodolini.Main.MainWindow.cs.

Definition at line 48 of file Foodolini.Main.MainWindow.cs.

Definition at line 453 of file MainWindow.cs.

Definition at line 42 of file Foodolini.Main.MainWindow.cs.

Definition at line 46 of file Foodolini.Main.MainWindow.cs.

Gtk.Statusbar Foodolini.Main.MainWindow.statusbar2 [private]

Definition at line 52 of file Foodolini.Main.MainWindow.cs.

Gtk.UIManager Foodolini.Main.MainWindow.UIManager [private]

Definition at line 16 of file Foodolini.Main.MainWindow.cs.

Definition at line 26 of file Foodolini.Main.MainWindow.cs.

Store of all users.

Definition at line 271 of file MainWindow.cs.

Gtk.VBox Foodolini.Main.MainWindow.vbox2 [private]

Definition at line 18 of file Foodolini.Main.MainWindow.cs.

Gtk.VBox Foodolini.Main.MainWindow.vbox3 [private]

Definition at line 38 of file Foodolini.Main.MainWindow.cs.


Property Documentation

Person Foodolini.Main.MainWindow.CurrentUser [get]

The currently selected user, null if None or Anonymous.

Implements Foodolini.Activities.IOwner.

Definition at line 430 of file MainWindow.cs.

Gtk.Window Foodolini.Main.MainWindow.Window [get]

Get the main window from IOwner.

Implements Foodolini.Activities.IOwner.

Definition at line 442 of file MainWindow.cs.


Event Documentation

EventHandler<ActivityUnloadedArgs> Foodolini.Main.MainWindow.ActivityUnloading

Occurs when an activity is unloading.

Do only handle this is the Activity referenced in the arguments is the activity you are in. Be careful about changing the Unload property of the event arguments as this will cause the unload to fail.

Implements Foodolini.Activities.IOwner.

Definition at line 424 of file MainWindow.cs.

EventHandler<PersonEventArgs> Foodolini.Main.MainWindow.CurrentUserChanged

Occurs when the current user is changed.

Implements Foodolini.Activities.IOwner.

Definition at line 423 of file MainWindow.cs.


The documentation for this class was generated from the following files:

Foodolini 1.0.0 Documentation, generated with DoxyGen.