/// ------------------------------------------------------------------------------------ // ReSharper disable once UnusedParameter.Local private void PreventInvalidAudienceTypeForWorkStage(Enum invalidAudience, WorkStage stage) { if ((invalidAudience != null) && (invalidAudience.HasFlag(_metsAudienceType))) { throw new InvalidOperationException(string.Format( "Resources with an audience of \"{0}\" cannot have a work stage of {1}", _metsAudienceType, stage)); } }
public WorkEventArgs(WorkStage Stage, string Info) { this.Stage = Stage; this.Info = Info; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Sets the current stage of development of his resource. /// </summary> /// <param name="stage">Some work stage values relate to work being done for a /// particular type of audience. Where a stage is relevant to only a single type of /// audience, the audience will already be correctly inferred from the stage. For /// stages that can apply to more than one type of audience, either call SetAudience /// directly or "OR" the appropriate AudienceType with the WorkStage when calling this /// method. Not that some work stages can apply to a subset of the auidence types, so /// pay attention to the comments for each work stage to avoid pairing it with an /// invalid audience type.</param> /// ------------------------------------------------------------------------------------ public void SetStage(WorkStage stage) { PreventDuplicateMetadataProperty(MetadataProperties.Stage); // Some of the work stages imply a particular audience and therefore have the appropriate audience bit set if (stage.HasFlag(AudienceType.Vernacular)) SetAudience(AudienceType.Vernacular); if (stage.HasFlag(AudienceType.Training)) SetAudience(AudienceType.Training); if (stage.HasFlag(AudienceType.Internal)) SetAudience(AudienceType.Internal); if (stage.HasFlag(AudienceType.Wider)) SetAudience(AudienceType.Wider); if (stage.HasFlag(WorkStage.RoughDraft)) SetStage(kStageRoughDraft); if (stage.HasFlag(WorkStage.SelfReviewedDraft)) SetStage(kStageReviewedDraft); if (stage.HasFlag(WorkStage.ConsultantOrEditorReleasedDraft)) { PreventInvalidAudienceTypeForWorkStage(AudienceType.Training | AudienceType.Internal, WorkStage.ConsultantOrEditorReleasedDraft); SetStage(kStageReleasedDraft); } if (stage.HasFlag(WorkStage.ConsultantOrEditorApproved)) { PreventInvalidAudienceTypeForWorkStage(AudienceType.Training, WorkStage.ConsultantOrEditorApproved); SetStage(kStageApprovedDraft); } if (stage.HasFlag(WorkStage.InPressOrPublished)) { PreventInvalidAudienceTypeForWorkStage(AudienceType.Internal, WorkStage.InPressOrPublished); SetStage(kStagePublished); } if (stage.HasFlag(WorkStage.UsedInTrainingCourse)) SetStage(kStageUsedInCourse); if (stage.HasFlag(WorkStage.ReadyForPublicationOrFormalPreprint)) { PreventInvalidAudienceTypeForWorkStage(AudienceType.Vernacular | AudienceType.Internal, WorkStage.ReadyForPublicationOrFormalPreprint); SetStage(kStagePrepublication); } if (stage.HasFlag(WorkStage.FinishedInternal)) SetStage(kStageFinished); }
public WorkEventArgs(WorkStage Stage, string Info, int Position ) { this.Stage = Stage; this.Info = Info; this.Position = Position; }