Esempio n. 1
0
        /// <summary>
        /// Converts to transfer data.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        protected override object ConvertToTransferData(EntityObjectHierarchy data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            if (data.InnerEntity.MetaClassName != CalendarEventEntity.ClassName)
            {
                throw new FormatException("event must be parrent element in hierarchy");
            }
            TransferDataConverFactory converFactory = new TransferDataConverFactory();

            SyncTransferData retVal = converFactory.Create <SyncTransferData>(data);

            return(retVal);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts from transfer data.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        protected override EntityObjectHierarchy ConvertFromTransferData(object data)
        {
            SyncTransferData transferData = data as SyncTransferData;

            if (transferData == null)
            {
                throw new NotSupportedException("transfer data not supported");
            }

            EntityObjectHierarchy     retVal        = null;
            TransferDataConverFactory converFactory = new TransferDataConverFactory();

            if (transferData.SyncDataName != AppointmentTransferData.DataName)
            {
                throw new FormatException("invalid structire transfer data");
            }

            retVal = converFactory.Create <EntityObjectHierarchy>(transferData);

            return(retVal);
        }