예제 #1
0
 protected bool Equals(AssemblyHistoryItem other)
 {
     return(string.Equals(FullName, other.FullName) &&
            Type == other.Type &&
            ChangedDate.Equals(other.ChangedDate) &&
            string.Equals(Author, other.Author) &&
            string.Equals(Description, other.Description));
 }
예제 #2
0
 /// <summary>
 /// The add descriptions.
 /// </summary>
 protected override void AddDescriptions()
 {
     AddDescription(nameof(Id), Id.ToStr());
     AddDescription(nameof(Status), Status.ToStr());
     AddDescription(nameof(Note), Note.ToStr());
     AddDescription(nameof(CreatedDate), CreatedDate.ToStr());
     AddDescription(nameof(ChangedDate), ChangedDate.ToStr());
 }
예제 #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (FullName != null ? FullName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Type;
         hashCode = (hashCode * 397) ^ ChangedDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (Author != null ? Author.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #4
0
 protected virtual void OnChangedDate(ChangedDateEvent e)
 {
     ChangedDate?.Invoke(this, e);
 }
예제 #5
0
        public void PopulateShapeDataFromInfo(Visio.Shape shape, WorkItemShapeVersion shapeVersion)
        {
            // These changed between V1 and V2

            if (shapeVersion.Equals(WorkItemShapeVersion.V1))
            {
                shape.CellsU["Prop.CreatedBy"].FormulaU   = CreatedBy.WrapInDblQuotes();
                shape.CellsU["Prop.CreatedDate"].FormulaU = CreatedDate.WrapInDblQuotes();

                shape.CellsU["Prop.TeamProject"].FormulaU = TeamProject.WrapInDblQuotes();

                shape.CellsU["Prop.PageName"].FormulaU = WorkItemType.WrapInDblQuotes();

                shape.CellsU["Prop.State"].FormulaU = State.WrapInDblQuotes();

                shape.CellsU["Prop.ChangedBy"].FormulaU   = ChangedBy.WrapInDblQuotes();
                shape.CellsU["Prop.ChangedDate"].FormulaU = ChangedDate.WrapInDblQuotes();
            }
            else
            {
                // Map the properties to the corresponding Prop Data fields on the generic shape

                shape.CellsU["Prop.TextUpper2"].FormulaU = CreatedBy.WrapInDblQuotes();
                shape.CellsU["Prop.TextUpper1"].FormulaU = CreatedDate.WrapInDblQuotes();

                shape.CellsU["Prop.TextHeader2"].FormulaU = TeamProject.WrapInDblQuotes();

                shape.CellsU["Prop.WorkItemType"].FormulaU = WorkItemType.WrapInDblQuotes();

                //shape.CellsU["Prop.TextFooter2"].FormulaU = state.ToString().WrapInDblQuotes();
                shape.CellsU["Prop.TextFooter1"].FormulaU = State.WrapInDblQuotes();

                shape.CellsU["Prop.TextLower1"].FormulaU = ChangedBy.WrapInDblQuotes();
                shape.CellsU["Prop.TextLower2"].FormulaU = ChangedDate.WrapInDblQuotes();

                // Most likely PageName

                shape.CellsU["Prop.PageName"].FormulaU = $"{WorkItemType} {ID}".WrapInDblQuotes();

                shape.CellsU["Prop.RelatedBugs"].FormulaU = RelatedBugs.WrapInDblQuotes();
            }

            // These didn't change

            shape.CellsU["Prop.Organization"].FormulaU = Organization.WrapInDblQuotes();
            shape.CellsU["Prop.ID"].FormulaU           = ID.WrapInDblQuotes();

            shape.CellsU["Prop.Title"].FormulaU = Title.WrapInDblQuotes();

            shape.CellsU["Prop.RelatedLinks"].FormulaU  = RelatedLinkCount.WrapInDblQuotes();
            shape.CellsU["Prop.ExternalLinks"].FormulaU = ExternalLinkCount.WrapInDblQuotes();
            shape.CellsU["Prop.RemoteLinks"].FormulaU   = RemoteLinkCount.WrapInDblQuotes();
            shape.CellsU["Prop.HyperLinks"].FormulaU    = HyperLinkCount.WrapInDblQuotes();

            shape.CellsU["Prop.ExternalLink"].FormulaU =
                $"http://dev.azure.com/{Organization}/{TeamProject}/_workitems/edit/{ID}/".WrapInDblQuotes();

            shape.CellsU["Prop.AreaPath"].FormulaU      = AreaPath.WrapInDblQuotes();
            shape.CellsU["Prop.IterationPath"].FormulaU = IterationPath.WrapInDblQuotes();

            switch (WorkItemType)
            {
            case "Bug":
                shape.CellsU["Prop.FieldIssue"].FormulaU = FieldIssue.WrapInDblQuotes();
                break;

            case "User Story":
                shape.CellsU["Prop.TaskType"].FormulaU = TaskType.WrapInDblQuotes();
                break;

            default:
                break;
            }
        }