Foodolini.Activities.Cookbook.RecipeEditor Class Reference

An activity where an existing recipe can be edited. More...

Inherits Foodolini::Activities::IActivity.

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

List of all members.

Public Member Functions

 RecipeEditor ()
 A constructor that sets up the nodeview.
void SetParamenters (Recipe recipe)
 Method called to set the recipe to be editted. Sets the details of the recipe in the entries.
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 OnBtnNewSaveClicked (object sender, System.EventArgs e)
virtual void OnCancelClick (object sender, System.EventArgs e)
 Pops the activity when Cancel is clicked.
virtual void OnDeleteIngredientClick (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 OnEntryChanged (object sender, System.EventArgs e)
 Event called when an entry has been changed. Calls CheckIfFilled().
virtual void OnSaveClicked (object sender, System.EventArgs e)
 If no ingredients or recipes has the same name except the current recipe, the recipe is saved in the database. If there is, a dialog warns the user about this, and askes to change the title. 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.
virtual void OnTvDirectionsKeyReleaseEvent (object o, Gtk.KeyReleaseEventArgs args)
 Event called when directions have changed. Calls CheckIfFilled().

Properties

Recipe Recipe [get]
Widget Widget [get]

Events

EventHandler< RecipeEventArgsOnRecipeEdited

Private Member Functions

void CheckIfFilled ()
 Checks if a Title, at least one categori and ingredient has been given.
void SaveNewRecipe ()
void SaveRecipe ()
 Saves the Recipe in the database Button is only active when the title, the categories, the directions and Ingrediens have been set.
void SetRecipeDetails ()
 Sets the details of the recipe.

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 btnNewSave
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
FileStream stream
byte[] byteArray

Detailed Description

An activity where an existing recipe can be edited.

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


Constructor & Destructor Documentation

Foodolini.Activities.Cookbook.RecipeEditor.RecipeEditor (  ) 

A constructor that sets up the nodeview.

Definition at line 28 of file RecipeEditor.cs.


Member Function Documentation

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

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

Definition at line 72 of file RecipeEditor.cs.

virtual void Foodolini.Activities.Cookbook.RecipeEditor.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 85 of file RecipeEditor.cs.

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

Definition at line 99 of file RecipeEditor.cs.

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

Pops the activity when Cancel is clicked.

Definition at line 122 of file RecipeEditor.cs.

virtual void Foodolini.Activities.Cookbook.RecipeEditor.OnDeleteIngredientClick ( 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 132 of file RecipeEditor.cs.

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

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

Definition at line 147 of file RecipeEditor.cs.

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

If no ingredients or recipes has the same name except the current recipe, the recipe is saved in the database. If there is, a dialog warns the user about this, and askes to change the title. Button is only active when the title, the categories, the directions and Ingrediens have been set.

Definition at line 157 of file RecipeEditor.cs.

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

Previews the Recipe image when selected in the filechooserwidget.

Definition at line 277 of file RecipeEditor.cs.

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

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

Definition at line 291 of file RecipeEditor.cs.

void Foodolini.Activities.Cookbook.RecipeEditor.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 365 of file RecipeEditor.cs.

void Foodolini.Activities.Cookbook.RecipeEditor.SaveNewRecipe (  )  [private]

Definition at line 177 of file RecipeEditor.cs.

void Foodolini.Activities.Cookbook.RecipeEditor.SaveRecipe (  )  [private]

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 224 of file RecipeEditor.cs.

void Foodolini.Activities.Cookbook.RecipeEditor.SetParamenters ( Recipe  recipe  ) 

Method called to set the recipe to be editted. Sets the details of the recipe in the entries.

Parameters:
recipe A Recipe

Definition at line 302 of file RecipeEditor.cs.

void Foodolini.Activities.Cookbook.RecipeEditor.SetRecipeDetails (  )  [private]

Sets the details of the recipe.

Definition at line 310 of file RecipeEditor.cs.

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

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

Implements Foodolini.Activities.IActivity.

Definition at line 369 of file RecipeEditor.cs.


Member Data Documentation

Definition at line 272 of file RecipeEditor.cs.

Definition at line 80 of file RecipeEditor.cs.

Definition at line 21 of file RecipeEditor.cs.

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

Definition at line 22 of file RecipeEditor.cs.

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

Definition at line 23 of file RecipeEditor.cs.

Definition at line 19 of file RecipeEditor.cs.

Definition at line 20 of file RecipeEditor.cs.

Definition at line 271 of file RecipeEditor.cs.


Property Documentation

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

Definition at line 360 of file RecipeEditor.cs.

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

Implements Foodolini.Activities.IActivity.

Definition at line 375 of file RecipeEditor.cs.


Event Documentation

EventHandler<RecipeEventArgs> Foodolini.Activities.Cookbook.RecipeEditor.OnRecipeEdited

Definition at line 67 of file RecipeEditor.cs.


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

Foodolini 1.0.0 Documentation, generated with DoxyGen.