本文整理汇总了C#中Library.GetLibraryItem方法的典型用法代码示例。如果您正苦于以下问题:C# Library.GetLibraryItem方法的具体用法?C# Library.GetLibraryItem怎么用?C# Library.GetLibraryItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library.GetLibraryItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainView
protected void MainView()
{
if (ContentBlockId > 0)
{
Ektron.Cms.LibraryData libData = new LibraryData();
Ektron.Cms.API.Library lib = new Library();
libData = lib.GetLibraryItem(ContentBlockId);
if (!ReferenceEquals(libData, null))
{
string title = libData.Title;
string strTooltip = ToolTip.Trim() == "" ? libData.Title : ToolTip.Trim();
string strHtml = string.Format(@"<img src=""{0}"" border=""{1}"" width=""{2}"" height=""{3}"" title=""{4}"" alt=""{5}""></img>",
libData.FileName.Replace("//", "/"), ImageBorder, Width, Height, strTooltip, strTooltip);
ltrImage.Text = strHtml;
ltrImage.Visible = true;
}
phContent.Visible = true;
phHelpText.Visible = false;
}
else
{
phContent.Visible = false;
phHelpText.Visible = true;
}
if (!(_host == null || _host.IsEditable == false))
{
divHelpText.Visible = true;
}
else
{
divHelpText.Visible = false;
}
}
示例2: EditEvent
void EditEvent(string settings)
{
try
{
string webserviceURL = sitePath + "/widgets/image/ImageHandler.ashx";
// Register JS
JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJQueryClueTipJS);
JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
JS.RegisterJSInclude(this, sitePath + "/widgets/image/behavior.js", "ImageWidgetBehaviorJS");
JS.RegisterJSInclude(this, sitePath + "/widgets/image/Image.js", "ImageJS");
// Insert CSS Links
Css.RegisterCss(this, sitePath + "/widgets/image/ImageStyle.css", "ImageWidgetCSS");
JS.RegisterJSBlock(this, "Ektron.PFWidgets.Image.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.Image.setupAll('" + uniqueId + "');", "EktronPFWidgetsImageInit" + this.ID);
txtWidth.Text = Width;
txtHeight.Text = Height;
txtToolTip.Text = ToolTip;
txtBorder.Text = ImageBorder.ToString();
ViewSet.SetActiveView(Edit);
if (ContentBlockId > 0)
{
//load & set selected folder path
Ektron.Cms.API.Library lib = new Library();
Ektron.Cms.LibraryData ld = lib.GetLibraryItem(ContentBlockId);
if (!ReferenceEquals(ld, null))
{
long folderid = ld.ParentId;
txtSource.InnerText = ld.Title;
hdnContentId.Value = ld.Id.ToString();
hdnFolderId.Value = folderid.ToString();
hdnFolderPath.Value = folderid.ToString();
while (folderid != 0)
{
folderid = _api.GetParentIdByFolderId(folderid);
if (folderid > 0) hdnFolderPath.Value += "," + folderid.ToString();
}
//this will open the properties tab in edit mode
JS.RegisterJSBlock(this, "LoadPropertiesTab('" + uniqueId + "');", "LoadPropertiesTab" + this.ID);
}
}
}
catch (Exception e)
{
errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString();
_host.Title = _host.Title + " error";
ViewSet.SetActiveView(View);
}
}