/// <summary> /// Creates a new resource, given the attributes for the resource and an indication /// of whether item resource should be importable. /// </summary> /// <param name="attribs"></param> /// <param name="allowImport"></param> /// <returns></returns> public static CpMediaResource CreateResource(ResourceBuilder.ResourceAttributes attribs, bool allowImport) { CpMediaResource newRes = new CpMediaResource(); ResourceBuilder.SetCommonAttributes(newRes, attribs); return newRes; }
/// <summary> /// The ability to modify objects directly to a container/item is not available /// for a public programmer. Each CpMediaItem object is responsible /// for maintaining its own state. /// </summary> /// <param name="addThis">the CpMediaResource object with a corresponding resource advertised by the MediaServer</param> /// <exception cref="InvalidCastException"> /// Thrown when attempting to add a non-CpMediaResource object to this container. /// </exception> public override void AddResource(IMediaResource addThis) { this.CheckRuntimeBindings(new StackTrace()); CpMediaResource res = (CpMediaResource)addThis; base.AddResource(addThis); }
/// <summary> /// Creates a new resource, given the attributes for the resource and an indication /// of whether item resource should be importable. /// </summary> /// <param name="attribs"></param> /// <param name="allowImport"></param> /// <returns></returns> public static CpMediaResource CreateResource(ResourceBuilder.ResourceAttributes attribs, bool allowImport) { CpMediaResource newRes = new CpMediaResource(); ResourceBuilder.SetCommonAttributes(newRes, attribs); return(newRes); }
/// <summary> /// Creates a new resource, given a contentUri and a protocolInfo. /// </summary> /// <param name="contentUri"></param> /// <param name="protocolInfo"></param> /// <returns></returns> public static CpMediaResource CreateResource(string contentUri, string protocolInfo) { ResourceBuilder.ResourceAttributes attribs = new ResourceBuilder.ResourceAttributes(); attribs.contentUri = contentUri; attribs.protocolInfo = new ProtocolInfoString(protocolInfo); CpMediaResource newRes = new CpMediaResource(); ResourceBuilder.SetCommonAttributes(newRes, attribs); return newRes; }
/// <summary> /// Creates a new resource, given a contentUri and a protocolInfo. /// </summary> /// <param name="contentUri"></param> /// <param name="protocolInfo"></param> /// <returns></returns> public static CpMediaResource CreateResource(string contentUri, string protocolInfo) { ResourceBuilder.ResourceAttributes attribs = new ResourceBuilder.ResourceAttributes(); attribs.contentUri = contentUri; attribs.protocolInfo = new ProtocolInfoString(protocolInfo); CpMediaResource newRes = new CpMediaResource(); ResourceBuilder.SetCommonAttributes(newRes, attribs); return(newRes); }