private void promote() { string text = this.textBox.Text; int maxLength = 120; if (text == null || text == "") { return; } if (text.Length > maxLength) { this.layoutStack.AddLayout(new TextblockLayout("The text of this Protoactivity is too long (" + text.Length + " " + "characters which is more than the limit of " + maxLength + ") to automatically promote into an Activity. " + "It's better to have a short Activity name because:\n" + "#1 It will have to fit onscreen and\n" + "#2 It will be saved to your device's storage every time you record having done it."), "Name too long"); } else { ActivityCreationLayout creationLayout = new ActivityCreationLayout(this.activityDatabase, this.layoutStack); creationLayout.SelectedActivityTypeIsToDo = true; creationLayout.ActivityName = this.textBox.Text; this.layoutStack.AddLayout(new StackEntry(creationLayout, "Proto", this)); } }
private void help_createNew_button_Clicked(object sender, EventArgs e) { ActivityCreationLayout creationLayout = new ActivityCreationLayout(this.activityDatabase, this.layoutStack); creationLayout.ActivityName = this.nameText; creationLayout.GoBackAfterCreation = true; this.layoutStack.AddLayout(creationLayout, "New Activity", this); }
public ActivitiesMenuLayout( ActivitySearchView browseInheritancesLayout, ActivityImportLayout importPremadeActivitiesLayout, ActivityCreationLayout activityCreationLayout, ActivityEditingLayout activityEditingLayout, ProtoActivities_Layout protoactivitiesLayout, LayoutStack layoutStack, ActivityDatabase activityDatabase) { this.SetTitle("Activities"); this.browseInheritancesLayout = browseInheritancesLayout; this.importPremadeActivitiesLayout = importPremadeActivitiesLayout; this.activityCreationLayout = activityCreationLayout; this.activityEditingLayout = activityEditingLayout; this.protoactivitiesLayout = protoactivitiesLayout; this.layoutStack = layoutStack; this.activityDatabase = activityDatabase; this.setupLayouts(); }
private void SuggestionView_Request_MakeNewActivity() { ActivityCreationLayout creationLayout = new ActivityCreationLayout(this.activityDatabase, this.layoutStack); this.layoutStack.AddLayout(creationLayout, "New Activity"); }