ISupportFullName Interface
Declares the property used to store a full path to the file specified by the object which implements the IFileData interface.
Namespace: DevExpress.Persistent.Base
Assembly:
DevExpress.Persistent.Base.v24.2.dll
Declaration
public interface ISupportFullName
Public Interface ISupportFullName
You can implement the ISupportFullName interface in your custom class that supports IFileData to access the file’s full path. XAF assigns the file’s full path to the ISupportFullName.FullName property before the IFileData.LoadFromStream method is called.
Note
In ASP.NET Web Forms applications, the FullName property stores the file’s name only, because a web browser doesn’t allow reading the uploaded file full path for security reasons (see UploadedFile.FileName).
You can implement ISupportFullName in your custom FileData object:
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl.EF;
using System.ComponentModel.DataAnnotations;
// ...
public class FileDataEx : FileData, ISupportFullName {
private string fullName;
[ModelDefault("AllowEdit", "False")]
public virtual string FullName {
get { return fullName; }
set { SetPropertyValue(ref fullName, value); }
}
}
public class DemoObject : BaseObject {
public virtual FileDataEx File { get; set; }
}
// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
// ...
public class FileDataEx : FileData, ISupportFullName {
public FileDataEx(Session session) : base(session) { }
private string fullName;
[ModelDefault("AllowEdit", "False")]
public string FullName {
get { return fullName; }
set { SetPropertyValue(nameof(FullName), ref fullName, value); }
}
}
[DefaultClassOptions]
public class DemoObject : BaseObject {
public DemoObject(Session session)
: base(session) { }
private FileDataEx file;
public FileDataEx File {
get { return file; }
set { SetPropertyValue(nameof(File), ref file, value); }
}
}
Imports DevExpress.ExpressApp.Model
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Xpo
' ...
Public Class FileDataEx
Inherits FileData
Implements ISupportFullName
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Private fullName_Renamed As String
<ModelDefault("AllowEdit", "False")>
Public Property FullName() As String
Get
Return fullName_Renamed
End Get
Set(ByVal value As String)
SetPropertyValue(NameOf(FullName), fullName_Renamed, value)
End Set
End Property
End Class
<DefaultClassOptions>
Public Class DemoObject
Inherits BaseObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Private file_Renamed As FileDataEx
Public Property File() As FileDataEx
Get
Return file_Renamed
End Get
Set(ByVal value As FileDataEx)
SetPropertyValue(NameOf(File), file_Renamed, value)
End Set
End Property
End Class
See Also