An activity where an existing recipe can be edited. More...
Inherits Foodolini::Activities::IActivity.
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< RecipeEventArgs > | OnRecipeEdited |
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 |
An activity where an existing recipe can be edited.
Definition at line 14 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Foodolini.Activities.Cookbook.RecipeEditor.RecipeEditor | ( | ) |
A constructor that sets up the nodeview.
Definition at line 28 of file RecipeEditor.cs.
virtual void Foodolini.Activities.Cookbook.RecipeEditor.Build | ( | ) | [protected, virtual] |
Definition at line 106 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
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.
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.
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.
Gtk.Button Foodolini.Activities.Cookbook.RecipeEditor.btnAddIngredient [private] |
Definition at line 80 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Button Foodolini.Activities.Cookbook.RecipeEditor.btnCancel [private] |
Definition at line 100 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Button Foodolini.Activities.Cookbook.RecipeEditor.btnNewSave [private] |
Definition at line 102 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Button Foodolini.Activities.Cookbook.RecipeEditor.btnRemoveIngredient [private] |
Definition at line 82 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Button Foodolini.Activities.Cookbook.RecipeEditor.btnSave [private] |
Definition at line 104 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.VBox Foodolini.Activities.Cookbook.RecipeEditor.bxIngredient [private] |
Definition at line 38 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
byte [] Foodolini.Activities.Cookbook.RecipeEditor.byteArray [private] |
Definition at line 272 of file RecipeEditor.cs.
Gtk.ComboBox Foodolini.Activities.Cookbook.RecipeEditor.cbxDifficulty [private] |
Definition at line 42 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.ComboBox Foodolini.Activities.Cookbook.RecipeEditor.cbxMealtype [private] |
Definition at line 44 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Entry Foodolini.Activities.Cookbook.RecipeEditor.entCategories [private] |
Definition at line 30 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Entry Foodolini.Activities.Cookbook.RecipeEditor.entTitle [private] |
Definition at line 26 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.FileChooserButton Foodolini.Activities.Cookbook.RecipeEditor.fcbPicture [private] |
Definition at line 90 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.ScrolledWindow Foodolini.Activities.Cookbook.RecipeEditor.GtkScrolledWindow [private] |
Definition at line 74 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.ScrolledWindow Foodolini.Activities.Cookbook.RecipeEditor.GtkScrolledWindow2 [private] |
Definition at line 34 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HBox Foodolini.Activities.Cookbook.RecipeEditor.hbox1 [private] |
Definition at line 46 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HBox Foodolini.Activities.Cookbook.RecipeEditor.hbox2 [private] |
Definition at line 20 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HBox Foodolini.Activities.Cookbook.RecipeEditor.hbox3 [private] |
Definition at line 78 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HBox Foodolini.Activities.Cookbook.RecipeEditor.hbox4 [private] |
Definition at line 96 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HBox Foodolini.Activities.Cookbook.RecipeEditor.hbox5 [private] |
Definition at line 86 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HBox Foodolini.Activities.Cookbook.RecipeEditor.hbox7 [private] |
Definition at line 52 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HSeparator Foodolini.Activities.Cookbook.RecipeEditor.hseparator1 [private] |
Definition at line 94 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.HSeparator Foodolini.Activities.Cookbook.RecipeEditor.hseparator2 [private] |
Definition at line 84 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Image Foodolini.Activities.Cookbook.RecipeEditor.imgRecipe [private] |
Definition at line 92 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
bool Foodolini.Activities.Cookbook.RecipeEditor.ingredientsAdded = false [private] |
Definition at line 80 of file RecipeEditor.cs.
NodeStore Foodolini.Activities.Cookbook.RecipeEditor.ingredientStorage = new NodeStore(typeof(IngredientAdapter)) [private] |
Definition at line 21 of file RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label1 [private] |
Definition at line 66 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label10 [private] |
Definition at line 64 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label11 [private] |
Definition at line 60 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label12 [private] |
Definition at line 56 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label13 [private] |
Definition at line 50 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label2 [private] |
Definition at line 68 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label3 [private] |
Definition at line 24 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label4 [private] |
Definition at line 28 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label5 [private] |
Definition at line 32 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label6 [private] |
Definition at line 88 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label7 [private] |
Definition at line 98 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label8 [private] |
Definition at line 70 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.label9 [private] |
Definition at line 72 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.Label Foodolini.Activities.Cookbook.RecipeEditor.lbWidgetTitle [private] |
Definition at line 18 of file Foodolini.Activities.Cookbook.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.
Gtk.NodeView Foodolini.Activities.Cookbook.RecipeEditor.nvIngredients [private] |
Definition at line 76 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Definition at line 19 of file RecipeEditor.cs.
Definition at line 20 of file RecipeEditor.cs.
Gtk.SpinButton Foodolini.Activities.Cookbook.RecipeEditor.sbDays [private] |
Definition at line 54 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.SpinButton Foodolini.Activities.Cookbook.RecipeEditor.sbHours [private] |
Definition at line 58 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.SpinButton Foodolini.Activities.Cookbook.RecipeEditor.sbMinuts [private] |
Definition at line 62 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.SpinButton Foodolini.Activities.Cookbook.RecipeEditor.sbMultiplier [private] |
Definition at line 48 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
FileStream Foodolini.Activities.Cookbook.RecipeEditor.stream [private] |
Definition at line 271 of file RecipeEditor.cs.
Gtk.Table Foodolini.Activities.Cookbook.RecipeEditor.table4 [private] |
Definition at line 40 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.TextView Foodolini.Activities.Cookbook.RecipeEditor.tvDirections [private] |
Definition at line 36 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.VBox Foodolini.Activities.Cookbook.RecipeEditor.vbox2 [private] |
Definition at line 16 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
Gtk.VBox Foodolini.Activities.Cookbook.RecipeEditor.vbox3 [private] |
Definition at line 22 of file Foodolini.Activities.Cookbook.RecipeEditor.cs.
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.
EventHandler<RecipeEventArgs> Foodolini.Activities.Cookbook.RecipeEditor.OnRecipeEdited |
Definition at line 67 of file RecipeEditor.cs.