本文整理汇总了C#中View.Update方法的典型用法代码示例。如果您正苦于以下问题:C# View.Update方法的具体用法?C# View.Update怎么用?C# View.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View.Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateHiddenView
private void UpdateHiddenView(View xsltHiddenView, string schemaXml)
{
var viewSchemaElement = XElement.Parse(schemaXml);
var xml = string.Concat(viewSchemaElement.Elements());
xsltHiddenView.ListViewXml = xml;
xsltHiddenView.Update();
xsltHiddenView.Context.ExecuteQueryRetry();
}
示例2: UpdateFields
/// <summary>
/// String method to updating the view for site collection
/// </summary>
/// <param name="selectedField">Field which is being selected</param>
/// <param name="client">Client object</param>
/// <param name="clientContext">Context of client</param>
/// <param name="list">List object</param>
/// <param name="targetView">Targeted view</param>
/// <returns>Selected field</returns>
private static string UpdateFields(string selectedField, Client client, ClientContext clientContext, List list, View targetView)
{
List<string> updateFields = ConfigurationManager.AppSettings["ColumnName"].Split(';').ToList();
ErrorMessage.ShowMessage("\nUpdating View for site collection " + client.ClientName, ErrorMessage.MessageType.Notification);
foreach (string field in updateFields)
{
try
{
if (!string.IsNullOrEmpty(field))
{
selectedField = field;
if (!targetView.ViewFields.Contains(field))
{
targetView.ViewFields.Add(field);
targetView.Update();
list.Update();
clientContext.Load(list);
clientContext.ExecuteQuery();
}
}
}
catch (Exception)
{
ErrorMessage.ShowMessage(selectedField + " field failed to update/unavailable for site collection " + client.ClientName, ErrorMessage.MessageType.Error);
}
}
return selectedField;
}