예제 #1
0
 private void UpdateObjectFromFields()
 {
     selectedItem.Name          = Name.Text;
     selectedItem.Description   = Description.Text;
     selectedItem.SefTitle      = StringHelper.CreateSlug(selectedItem.Name);
     selectedItem.ThumbnailPath = ThumbnailPath.GetValue().ToString();
 }
예제 #2
0
        public Photo(string imagePath)
        {
            Url      = imagePath;
            FullPath = imagePath.Replace(@"Thumbnails\", string.Empty);
            Name     = Path.GetFileNameWithoutExtension(Url);
            Month    = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(Url));
            Year     = Path.GetFileNameWithoutExtension(Path.GetDirectoryName((Path.GetDirectoryName(Url))));
            string substring;
            int    index, length;

            length        = imagePath.Length;
            index         = imagePath.IndexOf("OutputDir");
            substring     = imagePath.Substring(index, length - index);
            ThumbnailPath = @"~\" + substring;
            ImagePath     = ThumbnailPath.Replace(@"Thumbnails\", string.Empty);
        }
예제 #3
0
 private void UpdateFieldsFromObject()
 {
     Name.Text        = selectedItem.Name;
     Description.Text = selectedItem.Description;
     ThumbnailPath.SetValue(selectedItem.ThumbnailPath);
 }