コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: daptiv/Malevich
		/// <summary>
		/// Displays files from a change list by adding a row with details regarding the file to a table.
		/// </summary>
		/// <param name="file"> The top-level file data (names). </param>
		/// <param name="lastVersion"> The last version of the file. </param>
		/// <param name="hasTextBody"> Whether to display the file as a hyperlink </param>
		/// <param name="latestReview">The latest review that the user has submitted for this changelist. May be null.</param>
		private TableRow GetChangeFileRow(
			DataModel.ChangeFile file,
			AbstractedFileVersion lastVersion,
			bool hasTextBody,
			Review latestReview)
		{
			TableRow row = new TableRow();
			if (!file.IsActive)
				row.AppendCSSClass("CssInactiveFile");

			TableCell cell = new TableCell();
			// If the latest version of this file has a timestamp greater than the latest review,
			// then present a "new!" icon in the list to allow the user to quickly determine what
			// has changed since they last reviewed this change.
			if (latestReview != null &&
				lastVersion.TimeStamp != null &&
				latestReview.TimeStamp.CompareTo(lastVersion.TimeStamp) < 0)
			{
				cell.AppendCSSClass("CssNewIcon");
				cell.Controls.Add(new Image()
				{
					ImageUrl = "~/images/new_icon.png",
					AlternateText = "This file has changed since your last review submission."
				});
			}
			row.Cells.Add(cell);

			cell = new TableCell();
			row.Cells.Add(cell);

			string moniker = null;
			if (lastVersion == null)
			{
				moniker = file.ServerFileName + "#" + " (no versions found)";
			}
			else if (lastVersion.Action == SourceControlAction.DELETE)
			{
				moniker = file.ServerFileName + "#" + lastVersion.Revision + " DELETE";
			}
			else if (lastVersion.Action == SourceControlAction.BRANCH)
			{
				moniker = file.ServerFileName + "#" + lastVersion.Revision + " BRANCH";
			}
			else if (lastVersion.Action == SourceControlAction.INTEGRATE)
			{
				moniker = file.ServerFileName + "#" + lastVersion.Revision + " INTEGRATE";
			}
			else if (lastVersion.Action == SourceControlAction.RENAME)
			{
				moniker = file.ServerFileName + "#" + lastVersion.Revision + " RENAME";
			}
			else
			{
				moniker = file.ServerFileName + "#" + lastVersion.Revision +
					((lastVersion.Action == SourceControlAction.ADD) ? " ADD" : " EDIT");
			}

			if (hasTextBody)
			{
				HyperLink link = new HyperLink();
				cell.Controls.Add(link);
				link.NavigateUrl = Request.FilePath + "?fid=" + file.Id;
				link.Text = moniker;
			}
			else
			{
				cell.Text = moniker;
			}

			return row;
		}
コード例 #2
0
 public void  CollectionContainerPrint(DataModel.ContainersCollection Collection,PointDimensions dimension)
 {
     RichTextBox1.AppendText("Numeric Type of CollectionContainer: " + Collection.NumericType + "\n");
     RichTextBox1.AppendText("Length of CollectionContainer: " + Collection.ListLength + "\n");
     foreach (var Container in Collection)
     {
         ContainerPrint(Container,dimension);
     }
 }
コード例 #3
0
 bool Equal(DataModel.Matrix position1, DataModel.Matrix position2)
 {
     if ((position1.ListLength == position2.ListLength) & (position1.NumericType == position2.NumericType) & (position1.MatrixType == position2.MatrixType))
         return true;
     else
         return false;
 }
コード例 #4
0
 public void MatrixPrint(DataModel.Matrix matrix)
 {
     RichTextBox1.AppendText("Type of Matrix: " + matrix.MatrixType + "\n");
     RichTextBox1.AppendText("Numeric Type of Matrix: " + matrix.NumericType + "\n");
     RichTextBox1.AppendText("Length of Matrix: " + matrix.ListLength + "\n");
     foreach (var position in matrix)
     {
         PositionPrint(position);
     }
 }
コード例 #5
0
 bool SearchEqual(List<DataModel.Matrix> list, DataModel.Matrix position)
 {
     foreach (DataModel.Matrix p in list)
     {
         if (Equal(p, position))
             return true;
     }
     return false;
 }