Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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();
            }
        }