/// <summary>
        /// Makes a request to a remote media server to export the binary file from a resource
        /// to a specified URI.
        /// </summary>
        /// <param name="destinationUri">the URI where the binary should be sent</param>
        /// <param name="Tag">
        /// Miscellaneous, user-provided object for tracking this
        /// asynchronous call. Can be used as a means to pass a
        /// user-defined "state object" at invoke-time so that
        /// the executed callback during results-processing can be
        /// aware of the component's state at the time of the call.
        /// </param>
        /// <param name="callback">the callback to execute when results become available</param>
        /// <exception cref="InvalidCastException">
        /// Thrown if the owner of this object is not an <see cref="ICpMedia"/> instance.
        /// </exception>
        public void RequestExportResource(System.Uri destinationUri, object Tag, CpMediaDelegates.Delegate_ResultExportResource callback)
        {
            // simpy calls the owner object's implementation of the method by the same name
            ICpMedia owner = (ICpMedia)this.Owner;

            owner.RequestExportResource(this, destinationUri, Tag, callback);
        }
        /// <summary>
        /// Makes a request to a remote media server to delete the resource from its local file system.
        /// </summary>
        /// <param name="Tag">
        /// Miscellaneous, user-provided object for tracking this
        /// asynchronous call. Can be used as a means to pass a
        /// user-defined "state object" at invoke-time so that
        /// the executed callback during results-processing can be
        /// aware of the component's state at the time of the call.
        /// </param>
        /// <param name="callback">the callback to execute when results become available</param>
        /// <exception cref="InvalidCastException">
        /// Thrown if the owner of this object is not an <see cref="ICpMedia"/> instance.
        /// </exception>
        public void RequestDeleteResource(object Tag, CpMediaDelegates.Delegate_ResultDeleteResource callback)
        {
            // simpy calls the owner object's implementation of the method by the same name
            ICpMedia owner = (ICpMedia)this.Owner;

            owner.RequestDeleteResource(this, Tag, callback);
        }
        /// <summary>
        /// Call this method if a spider is no longer interested in an object
        /// that was earlier marked as being of interest to this spider.
        /// </summary>
        /// <param name="obj"></param>
        private void DecrementMatch(ICpMedia obj)
        {
            CpMediaContainer cpc = obj as CpMediaContainer;
            CpMediaItem      cpi = obj as CpMediaItem;

            if (cpc != null)
            {
                cpc.DecrementSpiderMatches();
            }
            else if (cpi != null)
            {
                cpi.DecrementSpiderMatches();
            }
        }
 /// <summary>
 /// Call this method if a spider is no longer interested in an object
 /// that was earlier marked as being of interest to this spider.
 /// </summary>
 /// <param name="obj"></param>
 private void DecrementMatch(ICpMedia obj)
 {
     CpMediaContainer cpc = obj as CpMediaContainer;
     CpMediaItem cpi = obj as CpMediaItem;
     if (cpc != null)
     {
         cpc.DecrementSpiderMatches();
     }
     else if (cpi != null)
     {
         cpi.DecrementSpiderMatches();
     }
 }
 private void ResultDestroyObjectSink(ICpMedia destroyThis, object Tag, UPnPInvokeException error)
 {
     MessageBox.Show(this, "Media " + destroyThis.Title + " Deleted","Delete Media");
 }
 public void PopupMediaPropertyDialog(ICpMedia media)
 {
     if (mediaPropertyForm == null || mediaPropertyForm.IsDisposed == true)
     {
         mediaPropertyForm = new MediaPropertyForm();
     }
     mediaPropertyForm.MediaObj = media;
     mediaPropertyForm.Show();
     mediaPropertyForm.Activate();
 }
Exemple #7
0
 public Error_CannotRequestCreate(ICpMedia parent, ICpMedia child)
     : base("Cannot create object")
 {
     Parent = parent;
     Child  = child;
 }
Exemple #8
0
 public Error_MediaNotOnServer(ICpMedia mediaObj, CpMediaServer server)
     : base("Media object not on server")
 {
     this.Media  = mediaObj;
     this.Server = server;
 }
Exemple #9
0
 public Error_CannotGetParent(ICpMedia mediaObj)
     : base("Cannot get CpMediaContainer parent")
 {
     this.ObjectMissingParent = mediaObj;
 }
Exemple #10
0
 public Error_CannotGetServer(ICpMedia mediaObj)
     : base("Cannot get MediaServer object")
 {
     this.RemovedObject = mediaObj;
 }
        private static void OnResult_RequestForUpdateObject(ICpMedia attemptChangeOnThis, IUPnPMedia usedThisMetadata, object Tag, UPnPInvokeException error)
        {
            MediaPropertyForm form = null;
            lock (MediaPropertyForm.MetadataRequests.SyncRoot)
            {
                form = (MediaPropertyForm)MediaPropertyForm.MetadataRequests[Tag];
                MediaPropertyForm.MetadataRequests.Remove(Tag);
            }

            if (error != null)
            {
                MessageBox.Show(error.UPNP.Message, "An error occurred while trying to update an object.");
            }
            if (form != null)
            {
            }
        }
 public override void RequestUpdateObject(ICpMedia changeThisChildObject, IUPnPMedia useThisMetadata, object Tag, CpMediaDelegates.Delegate_ResultUpdateObject callback)
 {
 }
Exemple #13
0
 public override void RequestUpdateObject(ICpMedia changeThisChildObject, IUPnPMedia useThisMetadata, object Tag, CpMediaDelegates.Delegate_ResultUpdateObject callback)
 {
 }