コード例 #1
0
        public static bool ExportCreate(this Item item)
        {
            if (item == null)
            {
                return(false);
            }

            IExportExecuter executer = MediaFrameworkContext.GetExportExecuter(item);

            if (executer != null && executer.IsNew(item))
            {
                executer.Export(new ExportOperation(item, ExportOperationType.Create));
                return(true);
            }

            return(false);
        }
コード例 #2
0
        /// <summary>
        /// Ingests items
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        public override void Process(MediaItemExportArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Operation, "args.Operation");

            try
            {
                IExportExecuter executer = MediaFrameworkContext.GetExportExecuter(args.Operation.Item);
                if (executer != null)
                {
                    executer.Export(args.Operation);
                }
                else
                {
                    args.AbortPipeline();
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("Sync failed.", this, ex);
                args.AbortPipeline();
            }
        }