Show MenuForm.cs syntax highlighted
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Whiteboard.MaseWS;
using EStory;
using New_Study_Project;
namespace Whiteboard
{
/// <summary>
/// Summary description for MenuForm.
/// </summary>
public class MenuForm : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
///
private ProjectVO project = null;
private webServicesService ws = null;
private EventHandler createCardEventHandler = null;
private EventHandler reArrangeCardsEventHandler = null;
private EventHandler createIterationEventHandler = null;
private EventHandler workspaceSwitchEventHandler = null;
private TabletVO newCreatedStoryVO = null;
private bool pulibWorkspaceOrNot = true;
private System.Windows.Forms.Button newIteraionBut;
private System.Windows.Forms.Button newTypedCardBut;
private System.Windows.Forms.Button newHWCardBut;
private System.Windows.Forms.Button reArrangeCardsBut;
private System.Windows.Forms.Button workspaceOptions;
private System.ComponentModel.Container components = null;
public MenuForm(ProjectVO project, ref TabletVO newCreatedStoryVO, bool pulibWorkspaceOrNot, EventHandler createCardEventHandler, EventHandler reArrangeCardsEventHandler, EventHandler createIterationEventHandler, EventHandler workspaceSwitchEventHandler)
{
this.project = project;
this.ws = SingleWS.getInstance(null);
this.createCardEventHandler = createCardEventHandler;
this.reArrangeCardsEventHandler = reArrangeCardsEventHandler;
this.createIterationEventHandler = createIterationEventHandler;
this.workspaceSwitchEventHandler = workspaceSwitchEventHandler;
this.newCreatedStoryVO = newCreatedStoryVO;
this.newCreatedStoryVO.tabletProcess = new TabletProcessVO();
this.newCreatedStoryVO.horizontalCenter = new CardLocationVO();
this.pulibWorkspaceOrNot = pulibWorkspaceOrNot;
//
// Required for Windows Form Designer support
//
InitializeComponent();
reArrangeCardsBut.Click += reArrangeCardsEventHandler;
workspaceOptions.Click += workspaceSwitchEventHandler;
newIteraionBut.Click += createIterationEventHandler;
if(pulibWorkspaceOrNot == false)
{
this.workspaceOptions.Text = "Switch to Public Workspace";
}
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.newIteraionBut = new System.Windows.Forms.Button();
this.newTypedCardBut = new System.Windows.Forms.Button();
this.newHWCardBut = new System.Windows.Forms.Button();
this.reArrangeCardsBut = new System.Windows.Forms.Button();
this.workspaceOptions = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// newIteraionBut
//
this.newIteraionBut.Dock = System.Windows.Forms.DockStyle.Top;
this.newIteraionBut.Location = new System.Drawing.Point(10, 10);
this.newIteraionBut.Name = "newIteraionBut";
this.newIteraionBut.Size = new System.Drawing.Size(420, 90);
this.newIteraionBut.TabIndex = 0;
this.newIteraionBut.Text = "Create New Iteration";
this.newIteraionBut.Click += new System.EventHandler(this.newIteraionBut_Click);
//
// newTypedCardBut
//
this.newTypedCardBut.Dock = System.Windows.Forms.DockStyle.Top;
this.newTypedCardBut.Location = new System.Drawing.Point(10, 100);
this.newTypedCardBut.Name = "newTypedCardBut";
this.newTypedCardBut.Size = new System.Drawing.Size(420, 90);
this.newTypedCardBut.TabIndex = 1;
this.newTypedCardBut.Text = "Create New Typed Story";
this.newTypedCardBut.Click += new System.EventHandler(this.newTypedCardBut_Click);
//
// newHWCardBut
//
this.newHWCardBut.Dock = System.Windows.Forms.DockStyle.Top;
this.newHWCardBut.Location = new System.Drawing.Point(10, 190);
this.newHWCardBut.Name = "newHWCardBut";
this.newHWCardBut.Size = new System.Drawing.Size(420, 90);
this.newHWCardBut.TabIndex = 2;
this.newHWCardBut.Text = "Create New Handwritten Story";
this.newHWCardBut.Click += new System.EventHandler(this.newHWCardBut_Click);
//
// reArrangeCardsBut
//
this.reArrangeCardsBut.Dock = System.Windows.Forms.DockStyle.Top;
this.reArrangeCardsBut.Location = new System.Drawing.Point(10, 280);
this.reArrangeCardsBut.Name = "reArrangeCardsBut";
this.reArrangeCardsBut.Size = new System.Drawing.Size(420, 90);
this.reArrangeCardsBut.TabIndex = 3;
this.reArrangeCardsBut.Text = "Re-Arrange All Story Cards";
//
// workspaceOptions
//
this.workspaceOptions.Dock = System.Windows.Forms.DockStyle.Top;
this.workspaceOptions.Location = new System.Drawing.Point(10, 370);
this.workspaceOptions.Name = "workspaceOptions";
this.workspaceOptions.Size = new System.Drawing.Size(420, 90);
this.workspaceOptions.TabIndex = 4;
this.workspaceOptions.Text = "Switch to Private Workspace";
this.workspaceOptions.Click += new System.EventHandler(this.workspaceOptions_Click);
//
// MenuForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(440, 469);
this.Controls.Add(this.workspaceOptions);
this.Controls.Add(this.reArrangeCardsBut);
this.Controls.Add(this.newHWCardBut);
this.Controls.Add(this.newTypedCardBut);
this.Controls.Add(this.newIteraionBut);
this.DockPadding.All = 10;
this.Name = "MenuForm";
this.Text = "MenuForm";
this.ResumeLayout(false);
}
#endregion
private void newIteraionBut_Click(object sender, System.EventArgs e)
{
cleanUpStoryVO();
newCreatedStoryVO.tabletProcess.processType = EStoryForm.ITERATION;
CreateIteration newIteration = new CreateIteration(project, ws, ref newCreatedStoryVO);
this.Visible = false;
newIteration.ShowDialog();
this.Visible = true;
}
private void newTypedCardBut_Click(object sender, System.EventArgs e)
{
cleanUpStoryVO();
newCreatedStoryVO.tabletProcess.handWritten = null;
newCreatedStoryVO.tabletProcess.activityType = EStoryForm.NA;
EStoryForm ef = new EStoryForm(Convert.ToInt32(project.id),ws.getAllIterationsByProject(project.id, false), ref newCreatedStoryVO, null, createCardEventHandler);
ef.ShowDialog();
}
private void newHWCardBut_Click(object sender, System.EventArgs e)
{
cleanUpStoryVO();
newCreatedStoryVO.tabletProcess.handWritten = "";
EStoryForm ef = new EStoryForm(Convert.ToInt32(project.id), ws.getAllIterationsByProject(project.id, false), ref newCreatedStoryVO, null, createCardEventHandler);
ef.ShowDialog();
}
private void cleanUpStoryVO()
{
newCreatedStoryVO.iterationID = -1;
newCreatedStoryVO.iterationName = "";
newCreatedStoryVO.pairProgrammerID = -1;
newCreatedStoryVO.pairProgrammerName = "";
newCreatedStoryVO.parentID = -1;
newCreatedStoryVO.projectID = -1;
newCreatedStoryVO.projectName = "";
newCreatedStoryVO.tabletProcess.initialEffort = -1.0f;
newCreatedStoryVO.tabletProcess.name = "";
newCreatedStoryVO.tabletProcess.processType = EStoryForm.USERSTORY;
newCreatedStoryVO.tabletProcess.activityType = EStoryForm.FEATURE;
newCreatedStoryVO.tabletProcess.complete = false;
newCreatedStoryVO.tabletProcess.description = "";
newCreatedStoryVO.tabletProcess.handWritten = null;
newCreatedStoryVO.tabletProcess.id = Convert.ToInt64(EStoryForm.NotAssigned);
}
private void workspaceOptions_Click(object sender, System.EventArgs e)
{
pulibWorkspaceOrNot = !pulibWorkspaceOrNot;
if(pulibWorkspaceOrNot == false)
{
this.workspaceOptions.Text = "Switch to Public Workspace";
}
else
{
this.workspaceOptions.Text = "Switch to Private Workspace";
}
}
}
}
See more files for this project here