Foodolini.Activities.Cookbook.RecipeCreater Class Reference

An activity where a new recipe can be created. More...

Inherits Foodolini::Activities::IActivity.

Collaboration diagram for Foodolini.Activities.Cookbook.RecipeCreater:
Collaboration graph

List of all members.

Public Member Functions

 RecipeCreater ()
 Constructor that sets up the nodeview and sets the sensitivity on the save button to false.
void Register (IOwner owner)
 Subscribe to the events exposed by owner, and store a reference to owner.
void Unregister ()
 Unsubscribe to the events exposed by owner, and loose any references to owner.

Protected Member Functions

virtual void Build ()
virtual void OnAddIngredient (object sender, System.EventArgs e)
 Opens a dialog where a new ingredient and the amount can be selected and added to the Recipe opon saving.
virtual void OnBtnRemoveIngredientClicked (object sender, System.EventArgs e)
 Removes the selected ingredient form the list. If no ingredients are left, the variable ingredientsAdded is set to false. CheckIfFilled() is called at the end.
virtual void OnCancelClick (object sender, System.EventArgs e)
 Pops the activity when Cancel is clicked.
virtual void OnEntryChanged (object sender, System.EventArgs e)
 Event called when an entry has been changed. Calls CheckIfFilled().
virtual void OnTvDirectionsKeyReleaseEvent (object o, Gtk.KeyReleaseEventArgs args)
 Event called when directions have changed. Calls CheckIfFilled().
virtual void OnSaveClicked (object sender, System.EventArgs e)
 Saves the Recipe in the database Button is only active when the title, the categories, the directions and Ingrediens have been set.
virtual void OnSelectPictureClick (object sender, System.EventArgs e)
 Previews the Recipe image when selected in the filechooserwidget.

Properties

Recipe Recipe [get]
Widget Widget [get]

Events

EventHandler< RecipeEventArgsOnRecipeCreated

Private Member Functions

void CheckIfFilled ()
 Checks if a Title, at least one categori and ingredient has been given.

Private Attributes

Gtk.VBox vbox2
Gtk.Label lbWidgetTitle
Gtk.HBox hbox2
Gtk.VBox vbox3
Gtk.Label label3
Gtk.Entry entTitle
Gtk.Label label4
Gtk.Entry entCategories
Gtk.Label label5
Gtk.ScrolledWindow GtkScrolledWindow2
Gtk.TextView tvDirections
Gtk.VBox bxIngredient
Gtk.Table table4
Gtk.ComboBox cbxDifficulty
Gtk.ComboBox cbxMealtype
Gtk.HBox hbox1
Gtk.SpinButton sbMultiplier
Gtk.Label label13
Gtk.HBox hbox7
Gtk.SpinButton sbDays
Gtk.Label label12
Gtk.SpinButton sbHours
Gtk.Label label11
Gtk.SpinButton sbMinuts
Gtk.Label label10
Gtk.Label label1
Gtk.Label label2
Gtk.Label label8
Gtk.Label label9
Gtk.ScrolledWindow GtkScrolledWindow
Gtk.NodeView nvIngredients
Gtk.HBox hbox3
Gtk.Button btnAddIngredient
Gtk.Button btnRemoveIngredient
Gtk.HSeparator hseparator2
Gtk.HBox hbox5
Gtk.Label label6
Gtk.FileChooserButton fcbPicture
Gtk.Image imgRecipe
Gtk.HSeparator hseparator1
Gtk.HBox hbox4
Gtk.Label label7
Gtk.Button btnCancel
Gtk.Button btnSave
IOwner owner
Recipe recipe
NodeStore ingredientStorage = new NodeStore(typeof(IngredientAdapter))
IList< string > listCategory = new List<string>()
List< string > listDirections = new List<string>()
bool ingredientsAdded = false
byte[] byteArray

Detailed Description

An activity where a new recipe can be created.

Definition at line 14 of file Foodolini.Activities.Cookbook.RecipeCreater.cs.


Constructor & Destructor Documentation

Foodolini.Activities.Cookbook.RecipeCreater.RecipeCreater (  ) 

Constructor that sets up the nodeview and sets the sensitivity on the save button to false.

Definition at line 30 of file RecipeCreater.cs.


Member Function Documentation

virtual void Foodolini.Activities.Cookbook.RecipeCreater.Build (  )  [protected, virtual]
void Foodolini.Activities.Cookbook.RecipeCreater.CheckIfFilled (  )  [private]

Checks if a Title, at least one categori and ingredient has been given.

Definition at line 77 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnAddIngredient ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Opens a dialog where a new ingredient and the amount can be selected and added to the Recipe opon saving.

Definition at line 93 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnBtnRemoveIngredientClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Removes the selected ingredient form the list. If no ingredients are left, the variable ingredientsAdded is set to false. CheckIfFilled() is called at the end.

Definition at line 112 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnCancelClick ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Pops the activity when Cancel is clicked.

Definition at line 128 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnEntryChanged ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Event called when an entry has been changed. Calls CheckIfFilled().

Definition at line 136 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnSaveClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Saves the Recipe in the database Button is only active when the title, the categories, the directions and Ingrediens have been set.

Definition at line 153 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnSelectPictureClick ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Previews the Recipe image when selected in the filechooserwidget.

Definition at line 213 of file RecipeCreater.cs.

virtual void Foodolini.Activities.Cookbook.RecipeCreater.OnTvDirectionsKeyReleaseEvent ( object  o,
Gtk.KeyReleaseEventArgs  args 
) [protected, virtual]

Event called when directions have changed. Calls CheckIfFilled().

Definition at line 144 of file RecipeCreater.cs.

void Foodolini.Activities.Cookbook.RecipeCreater.Register ( IOwner  owner  ) 

Subscribe to the events exposed by owner, and store a reference to owner.

Parameters:
owner Instance of an implementation of IOwner

Implements Foodolini.Activities.IActivity.

Definition at line 233 of file RecipeCreater.cs.

void Foodolini.Activities.Cookbook.RecipeCreater.Unregister (  ) 

Unsubscribe to the events exposed by owner, and loose any references to owner.

Implements Foodolini.Activities.IActivity.

Definition at line 237 of file RecipeCreater.cs.


Member Data Documentation

Definition at line 209 of file RecipeCreater.cs.

Definition at line 25 of file RecipeCreater.cs.

Definition at line 22 of file RecipeCreater.cs.

IList<string> Foodolini.Activities.Cookbook.RecipeCreater.listCategory = new List<string>() [private]

Definition at line 23 of file RecipeCreater.cs.

List<string> Foodolini.Activities.Cookbook.RecipeCreater.listDirections = new List<string>() [private]

Definition at line 24 of file RecipeCreater.cs.

Definition at line 20 of file RecipeCreater.cs.

Definition at line 21 of file RecipeCreater.cs.


Property Documentation

Recipe Foodolini.Activities.Cookbook.RecipeCreater.Recipe [get]

Getter for the current recipe.

Definition at line 228 of file RecipeCreater.cs.

Widget Foodolini.Activities.Cookbook.RecipeCreater.Widget [get]

Implements Foodolini.Activities.IActivity.

Definition at line 241 of file RecipeCreater.cs.


Event Documentation

EventHandler<RecipeEventArgs> Foodolini.Activities.Cookbook.RecipeCreater.OnRecipeCreated

Definition at line 72 of file RecipeCreater.cs.


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

Foodolini 1.0.0 Documentation, generated with DoxyGen.