private void BtLoad_Click(object sender, RoutedEventArgs e) { if (CollectionGrid.SelectedItem is CMColl coll) { var curs = LoadWnd.Cursor; LoadWnd.Cursor = Cursors.Wait; var settings = SccmUtils.GetSettingsFromCollection(coll.CollectionId); if (string.IsNullOrEmpty(settings)) { return; } SettingsLoaded(this, new LoadEventArg { Settings = settings, }); LoadWnd.Cursor = curs; Logger.Log($"User '{Environment.UserName}' Loaded settings from collection '{coll.CollectionId}' - '{coll.Name}'", LogType.Info); Close(); } }
private void CustomOnLoad() { var curs = DeployWnd.Cursor; DeployWnd.Cursor = Cursors.Wait; CollectionGrid.ItemsSource = SccmUtils.GetDeviceCollections(); var view = CollectionViewSource.GetDefaultView(CollectionGrid.ItemsSource) as CollectionView; view.Filter = CustomFilter; DeployWnd.Cursor = curs; }
private void CustomOnLoad() { var curs = LoadWnd.Cursor; LoadWnd.Cursor = Cursors.Wait; _observableCollection = SccmUtils.GetDeviceCollectionsWithVariables(); CollectionGrid.ItemsSource = _observableCollection; var view = CollectionViewSource.GetDefaultView(CollectionGrid.ItemsSource) as CollectionView; view.Filter = CustomFilter; LoadWnd.Cursor = curs; }
private void BtRemove_Click(object sender, RoutedEventArgs e) { if (CollectionGrid.SelectedItem is CMColl coll) { var curs = LoadWnd.Cursor; LoadWnd.Cursor = Cursors.Wait; SccmUtils.RemoveDeployment(coll.CollectionId); _observableCollection.Remove(coll); LoadWnd.Cursor = curs; Logger.Log($"User '{Environment.UserName}' Removed settings from collection '{coll.CollectionId}' - '{coll.Name}'", LogType.Info); } }
private void BtDeploy_Click(object sender, RoutedEventArgs e) { if (CollectionGrid.SelectedItem is CMColl coll) { var curs = DeployWnd.Cursor; DeployWnd.Cursor = Cursors.Wait; SccmUtils.DeploySettings(coll.CollectionId); SccmUtils.TriggerMachinePolicyRequest(coll.CollectionId); DeployWnd.Cursor = curs; Logger.Log($"User '{Environment.UserName}' Deployed settings to collection '{coll.CollectionId}' - '{coll.Name}'", LogType.Info); Close(); } }