Commit ccbb18c2 by liulongfei

修复添加页bug

parent b2f323f9
...@@ -432,7 +432,7 @@ namespace VIZ.Package.Module ...@@ -432,7 +432,7 @@ namespace VIZ.Package.Module
page.ThumbnailBitmap = template.ThumbnailBitmap; page.ThumbnailBitmap = template.ThumbnailBitmap;
page.PluginID = vm.SelectedTemplatePlugin?.ID; page.PluginID = vm.SelectedTemplatePlugin?.ID;
page.PluginName = vm.SelectedTemplatePlugin?.Name; page.PluginName = vm.SelectedTemplatePlugin?.Name;
page.PageNum = this.SelectedPageGroupModel.Pages.Max(p => p.PageNum) + 1; page.PageNum = this.SelectedPageGroupModel.Pages.Count == 0 ? 1 : (this.SelectedPageGroupModel.Pages.Max(p => p.PageNum) + 1);
this.SelectedPageGroupModel.Pages.Add(page); this.SelectedPageGroupModel.Pages.Add(page);
......
...@@ -122,33 +122,15 @@ namespace VIZ.Package.Module ...@@ -122,33 +122,15 @@ namespace VIZ.Package.Module
/// <param name="task">任务</param> /// <param name="task">任务</param>
public void PreviewUpdate(PackageTaskModel task) public void PreviewUpdate(PackageTaskModel task)
{ {
IPluginService pluginService = ApplicationDomainEx.ServiceManager.GetService<IPluginService>(ViewServiceKeys.PLUGIN_SERVICE);
if (pluginService == null)
return;
PageModel page = pluginService.GetPageModelFromView(task.View);
if (page == null)
return;
ConnGroupModel group = ApplicationDomainEx.ConnGroups.FirstOrDefault(p => p.GroupID == page.ConnGroupID);
if (group == null)
return;
foreach (var item in group.Items)
{
if (!item.IsEnabled || !item.IsConnected)
continue;
try try
{ {
task.PreviewUpdateAction(item); task.PreviewUpdateAction(ApplicationDomainEx.PreviewConn);
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error(ex); log.Error(ex);
} }
} }
}
/// <summary> /// <summary>
/// 上版更新 /// 上版更新
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment