コード例 #1
0
            /// <summary>
            /// Default ctor
            /// </summary>
            public Item(IImportableEntity sourceEntity, IImportableEntity targetEntity)
            {
                entity = sourceEntity;
                Text   = entity.Description;
                SubItems.Add(entity.TypeName);
                var remarks = string.Empty;

                SafeToImport = false;
                switch (sourceEntity.CompareTo(targetEntity))
                {
                case ImportComparison.TargetDoesNotExists:
                    remarks      = string.Empty;
                    SafeToImport = true;
                    break;

                case ImportComparison.SourceInNewer:
                    remarks      = "This item already exists, but is newer then what you have now.";
                    SafeToImport = true;
                    break;

                case ImportComparison.TargetIsNewer:
                    remarks      = "This item already exists and it older then what you have now.";
                    SafeToImport = false;
                    break;

                case ImportComparison.TargetExists:
                    remarks      = "This item already exists. It is unknown which version is older.";
                    SafeToImport = false;
                    break;
                }
                SubItems.Add(remarks);
                Checked = (targetEntity == null);
            }
コード例 #2
0
ファイル: LocGroup.cs プロジェクト: michaeloed/BinkyRailways
 /// <summary>
 /// Compare the last modification of this entity (from the import source) with the given entity found in
 /// the target package.
 /// </summary>
 /// <param name="target">The equal entity in the target package. Can be null.</param>
 ImportComparison IImportableEntity.CompareTo(IImportableEntity target)
 {
     if (target == null)
     {
         return(ImportComparison.TargetDoesNotExists);
     }
     return(ImportComparison.TargetExists);
 }
コード例 #3
0
 /// <summary>
 /// Compare the last modification of this entity (from the import source) with the given entity found in
 /// the target package.
 /// </summary>
 /// <param name="target">The equal entity in the target package. Can be null.</param>
 ImportComparison IImportableEntity.CompareTo(IImportableEntity target)
 {
     return(CompareTo((IPersistentEntity)target));
 }