Пример #1
0
        private static string GetChangeString(SongEditableFields fields)
        {
            if (fields == SongEditableFields.Nothing)
                return string.Empty;

            return Translate.SongEditableFieldNames.GetAllNameNames(fields, SongEditableFields.Nothing);
        }
Пример #2
0
		private void Set(SongEditableFields field, bool val) {

			if (val && !IsChanged(field))
				ChangedFields |= field;
			else if (!val && IsChanged(field))
				ChangedFields -= field;

		}
Пример #3
0
        private static string GetChangeString(SongEditableFields fields)
        {
            if (fields == SongEditableFields.Nothing)
            {
                return(string.Empty);
            }

            return(Translate.SongEditableFieldNames.GetAllNameNames(fields, SongEditableFields.Nothing));
        }
Пример #4
0
        private static void DoIfExists(ArchivedSongVersion version, SongEditableFields field, XmlCache <ArchivedSongContract> xmlCache, Action <ArchivedSongContract, XDocument> func)
        {
            var versionWithField = version.GetLatestVersionWithField(field);

            if (versionWithField != null && versionWithField.Data != null)
            {
                var data = xmlCache.Deserialize(versionWithField.Version, versionWithField.Data);
                func(data, versionWithField.Data);
            }
        }
Пример #5
0
		private static void DoIfExists(ArchivedSongVersion version, SongEditableFields field, XmlCache<ArchivedSongContract> xmlCache, Action<ArchivedSongContract, XDocument> func) {

			var versionWithField = version.GetLatestVersionWithField(field);

			if (versionWithField != null && versionWithField.Data != null) {
				var data = xmlCache.Deserialize(versionWithField.Version, versionWithField.Data);
				func(data, versionWithField.Data);
			}

		}
Пример #6
0
 private void Set(SongEditableFields field, bool val)
 {
     if (val && !IsChanged(field))
     {
         ChangedFields |= field;
     }
     else if (!val && IsChanged(field))
     {
         ChangedFields -= field;
     }
 }
Пример #7
0
 private bool IsChanged(SongEditableFields field)
 {
     return(ChangedFields.HasFlag(field));
 }
Пример #8
0
 /// <summary>
 /// Checks whether a specific field is included in this diff.
 /// </summary>
 /// <param name="field">Field to be checked.</param>
 /// <returns>True if the field is included, otherwise false.</returns><
 /// <remarks>
 /// Snapshots include all fields except the Cover.
 /// Other fields are commonly included only they are changed.
 /// </remarks>
 public bool IsIncluded(SongEditableFields field)
 {
     return(IsSnapshot || IsChanged(field));
 }
Пример #9
0
 public static string SongEditableField(SongEditableFields field)
 {
     return(SongEditableFieldNames[field]);
 }
Пример #10
0
		private bool IsChanged(SongEditableFields field) {
			return ChangedFields.HasFlag(field);
		}
Пример #11
0
		/// <summary>
		/// Checks whether a specific field is included in this diff.
		/// </summary>
		/// <param name="field">Field to be checked.</param>
		/// <returns>True if the field is included, otherwise false.</returns><
		/// <remarks>
		/// Snapshots include all fields except the Cover.
		/// Other fields are commonly included only they are changed.
		/// </remarks>
		public bool IsIncluded(SongEditableFields field) {

			return (IsSnapshot || IsChanged(field));

		}
Пример #12
0
 public static string SongEditableField(SongEditableFields field)
 {
     return SongEditableFieldNames[field];
 }