private void BindData(object x) { App.Current.Dispatcher.Invoke(() => // <--- HERE { Logs.Instance.Info("binding SPList to UI"); var list = (ListCollection)x; ExistList.Clear(); foreach (List lst in list) { ExistList.Add(new SpList() { Id = lst.Id, Title = lst.Title, TypeName = lst.BaseTemplate.GetTemplateBaseName(), IsSupport = lst.BaseTemplate.IsTemplateSupport() }); } Logs.Instance.Info("End SPList binding successfully"); }); }
public override bool Next() { if (!ExistList.Any(x => x.IsChecked && x.IsSupport)) { _mainViewModel.ShowMessage("Please select any supported list types."); return(false); } GetSupportedLists.Clear(); foreach (var spList in ExistList.Where(x => x.IsSupport && x.IsChecked)) { foreach (Column column in spList.Columns) { column.IsChecked = false; } GetSupportedLists.Add(spList); } this.BindColumns(); return(base.Next()); }
public AddPrivilegeWizard(string toolPath, List <string> ExistList, string PkgID, EnvDTE.DTE dte) { WindowStartupLocation = WindowStartupLocation.CenterOwner; Owner = Application.Current.MainWindow; InitializeComponent(); this.PkgID = PkgID; this.toolPath = toolPath; isAppDefined = false; textbox_appdef_privileges.Text = "http://" + PkgID + "/appdefined/"; textbox_appdef_privileges.TextChanged += radio_appdef_Checked; PrivilegeItems.RemoveAll(x => x.privilegeName != null); this.dte = dte; LoadPrivilegeXml(this.toolPath); if (ExistList == null) { ExistList = new List <string>(); } foreach (var f in PrivilegeItems) { if (!ExistList.Contains(f.privilegeName)) { this.listView_internal.Items.Add(f.privilegeName); } } OkBtnEnable(false); radio_internal.IsChecked = true; radio_internal.Checked += new RoutedEventHandler(CheckInternalPrivilege); listView_internal.SelectionChanged += new SelectionChangedEventHandler(CheckInternalPrivilege); ProjectPath = System.IO.Path.GetDirectoryName(dte.ActiveDocument.Path); LicensePath = System.IO.Path.Combine(ProjectPath, "res\\.appdefined-license"); GetLicenseFileList(); this.DataContext = this; }
public override bool Prev() { GetSupportedLists.Clear(); ExistList.Clear(); return(base.Prev()); }