Ticket Q228964
Visible to All Users
Duplicate

How to create DC entities that can be used in the Scheduler Module

created 14 years ago

I'm trying Devexpress DC Technology.In early releases DC not support some futures but last release support(For example Scheduller). Shortly I create new DC class and it implement IResource interface. Like this:
    [DomainComponent]
    [DefaultClassOptions]
    [ImageName("Employee")]
    [XafDisplayName("Employee")]
    public interface IEmployee : IResource
    {
        [RuleRequiredField]
        string Name { get; set; }
        [RuleRequiredField]
        string Surname { get; set; }
        string FullName { get; }
        new object Id { get; }
        new string Caption { get; set; }
        int Color { get; set; }
        new int OleColor { get; }
    }
    [DomainLogic(typeof(IEmployee))]
    public class EmployeeLogic
    {
        public static void AfterChange_Name(IEmployee instance)
        {
            if (string.IsNullOrEmpty(instance.Caption))
                instance.Caption = instance.FullName;
        }
        public static void AfterChange_Surname(IEmployee instance)
        {
            if (string.IsNullOrEmpty(instance.Caption))
                instance.Caption = instance.FullName;
        }
        public static object Get_Id(IEmployee instance)
        {
            return ((XPObject)instance).Oid;
        }
        public static string Get_FullName(IEmployee instance)
        {
            return string.Format("{0} {1}", instance.Name, instance.Surname);
        }
        public static int Get_OleColor(IEmployee instance)
        {
            return ColorTranslator.ToOle(Color.FromArgb(instance.Color));
        }
    }
My question is how can show color property editor at rune time?
P.S. Without use DC Technology, actually we don't need do any thing for this:
        [Persistent("Color")]
        [Browsable(false)]
        public Int32 color;
        [NonPersistent]
        [DisplayName("Renk")]
        public Color Color
        {
            get { return Color.FromArgb(color); }
            set
            {
                color = value.ToArgb();
                OnChanged("Color");
            }
        }
UPDATE:
Also, before i write same type code and if I remember correctly when we write BO that inherit from resource, this recorce become resource for event BO automaticallly. But now i'm using DC tecnology and i think there is one more step i need to do. But i don't imagine.

Show previous comments (11)

    Hi Michael,
    Yes, please make it public.
    Thanks.

    DevExpress Support Team 14 years ago

      Thank you very much.

        You're welcome.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.