private void AddNewImageToDAM( string path, NexdoxResourceManager.ImageList updatedImages, string fileNameWithoutExtension) { Statics.CentralResources.DisconnectFromDam(); NexdoxResourceManager.ImageResource newResource = new NexdoxResourceManager.ImageResource(); newResource.ParentResourceManager = Statics.CentralResources; newResource.Name = fileNameWithoutExtension; newResource.UploadImageFile(path + fileNameWithoutExtension + ".eps", true, false); Statics.CentralResources.ConnectToDam(); newResource.Save("", true); newResource.CheckIn(); Statics.CentralResources.ResourceManagerAsset.CheckOut(); Statics.CentralResources.Images.Add(newResource); Statics.CentralResources.ResourceManagerAsset.Save("", false); Statics.CentralResources.ResourceManagerAsset.CheckIn(); if (string.Compare(_appInfo["Region"], "Live", true) == 0) { newResource.SetCurrentRegionVersion("Live", 0); newResource.SetCurrentRegionVersion("Test", 0); Statics.CentralResources.ResourceManagerAsset.SetCurrentRegionVersion( "Live", Statics.CentralResources.ResourceManagerAsset.VersionNo); Statics.CentralResources.ResourceManagerAsset.SetCurrentRegionVersion( "Test", Statics.CentralResources.ResourceManagerAsset.VersionNo); } else if (string.Compare(_appInfo["Region"], "Test", true) == 0) { newResource.SetCurrentRegionVersion("Test", 0); Statics.CentralResources.ResourceManagerAsset.SetCurrentRegionVersion( "Test", Statics.CentralResources.ResourceManagerAsset.VersionNo); } //Always into Dev newResource.SetCurrentRegionVersion("Dev", 0); Statics.CentralResources.ResourceManagerAsset.SetCurrentRegionVersion( "Dev", Statics.CentralResources.ResourceManagerAsset.VersionNo); updatedImages.Add(newResource); }
private void UpdateImageInDAM( string path, NexdoxResourceManager.ImageList updatedImages, string fileNameWithoutExtension, NexdoxResourceManager.ImageResource image) { NexdoxResourceManager.ImageResource imageResource = Statics.CentralResources.Images[image.Name]; imageResource.CheckOut(); imageResource.UploadImageFile(path + fileNameWithoutExtension + ".eps", false, false); imageResource.Save("", false); imageResource.CheckIn(); if (string.Compare(_appInfo["Region"], "Live", true) == 0) { imageResource.SetCurrentRegionVersion("Live", imageResource.VersionNo); imageResource.SetCurrentRegionVersion("Test", imageResource.VersionNo); } else if (string.Compare(_appInfo["Region"], "Test", true) == 0) { imageResource.SetCurrentRegionVersion("Test", imageResource.VersionNo); } //Always into Dev imageResource.SetCurrentRegionVersion("Dev", imageResource.VersionNo); updatedImages.Add(image); }