|
Home > Archive > Microsoft Content Management Server > February 2004 > How to set default galleries using C#
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to set default galleries using C#
|
|
|
| I'm writing some C# code to set the default galleries for
channels. The following lines of code work OK:
ResourceGallery rootGallery;
rootGallery = cmsContextHttp.RootResourceGallery;
chan.DefaultResourceGallery = rootGallery;
This sets the default resource gallery to the root gallery
("/Resources"). My question is: how do I specify other
gallery locations? What I want to be able to do is
something like this:
chan.DefaultResourceGallery = "/Resources/Library/Admin";
The left-hand side doesn't like being passed a string, so
how is it done?
Regards,
Neil
| |
| Stefan [MSFT] 2004-02-25, 12:35 pm |
| Hi Neil,
use the searches object:
ResourceGallery rsg =
cmsContextHttp.Searches.GetByPath("/Resources/Library/Admin") as
ResourceGallery.
Cheers,
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Neil" <anonymous@discussions.microsoft.com> wrote in message
news:152901c3fbc1$b6920a70$a501280a@phx.gbl...
> I'm writing some C# code to set the default galleries for
> channels. The following lines of code work OK:
>
> ResourceGallery rootGallery;
> rootGallery = cmsContextHttp.RootResourceGallery;
> chan.DefaultResourceGallery = rootGallery;
>
> This sets the default resource gallery to the root gallery
> ("/Resources"). My question is: how do I specify other
> gallery locations? What I want to be able to do is
> something like this:
>
> chan.DefaultResourceGallery = "/Resources/Library/Admin";
>
> The left-hand side doesn't like being passed a string, so
> how is it done?
>
> Regards,
> Neil
| |
|
| Thank you Stefan. Sorted with your advice.
>-----Original Message-----
>Hi Neil,
>
>use the searches object:
>
>ResourceGallery rsg =
>cmsContextHttp.Searches.GetByPath
("/Resources/Library/Admin") as
>ResourceGallery.
>
>Cheers,
>Stefan.
>
>--
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>
>"Neil" <anonymous@discussions.microsoft.com> wrote in
message
>news:152901c3fbc1$b6920a70$a501280a@phx.gbl...
for[color=darkred]
gallery[color=darkred]
= "/Resources/Library/Admin";[color=darkred]
so[color=darkred]
>
>
>.
>
|
|
|
|
|