Beispiel #1
0
	public void AddPost( string text, string transitionTo = "", string assignTo = "" )
	{
		TodoListTaskPost newPost = new TodoListTaskPost( text, transitionTo, assignTo );

		Posts.Insert( 0, newPost );
	}
	void DisplayActivityPostHeader( TodoListTaskPost post, bool specialCreatedHeader = false )
	{
		EditorGUILayout.BeginHorizontal();
		{
			EditorGUILayout.BeginVertical();
			{
				if( specialCreatedHeader )
				{
					GUILayout.Label( "Created", EditorStyles.miniLabel );
				}
				else
				{
					if( post.AssignTo != "" )
					{
						GUILayout.Label( "Assigned to " + post.AssignTo, EditorStyles.miniLabel );
					}

					if( post.TransitionTo != "" )
					{
						GUILayout.Label( "Transitioned to " + post.TransitionTo, EditorStyles.miniLabel );
					}
				}
			}
			EditorGUILayout.EndVertical();

			GUILayout.FlexibleSpace();

			int unixDate = 0;

			if( specialCreatedHeader )
			{
				unixDate = Task.TimeCreated;
			}
			else
			{
				unixDate = post.Date;
			}

			System.DateTime date = TodoList.FromUnixTimestamp( unixDate );

			GUILayout.Label( date.Day + "." + date.Month + "." + date.Year + " " + date.Hour.ToString( "00" ) + ":" + date.Minute.ToString( "00" ), EditorStyles.miniLabel );
			GUILayout.Space( 3 );
		}
		EditorGUILayout.EndHorizontal();

		GUILayout.Space( 5 );
	}