Пример #1
0
        public bool FilterOnlyCheckedPredicate(object obj)
        {
            AppObjectBase appObjectBase = obj as AppObjectBase;

            if (appObjectBase != null)
            {
                return(appObjectBase.IsChecked == true);
            }
            return(false);
        }
Пример #2
0
        public virtual bool FilterFindPredicate(object obj) //предикат для фильтра-поиск
        {
            bool result = false;

            if (String.IsNullOrEmpty(this.FilterFindValue))
            {
                return(true);
            }

            AppObjectBase appObjectBase = obj as AppObjectBase;

            if (appObjectBase != null)
            {
                string value  = StringHelper.RemoveUnnecessaryChars(appObjectBase.NameBase);
                string search = StringHelper.RemoveUnnecessaryChars(this.FilterFindValue);
                return(value.ToUpper().Contains(search.ToUpper()));
            }
            return(result);
        }
Пример #3
0
        //public ICommand ExportToMSExcelCommand
        //{
        //    get
        //    {
        //        if (this.exportToMSExcelCommand == null)
        //        {
        //            this.exportToMSExcelCommand = new RelayCommand(executeExportToMSExcelCommand, canExecuteExportToMSExcelCommandCommand);
        //        }
        //        return this.exportToMSExcelCommand;
        //    }
        //}

        //private async void logAuditEvent()
        //{
        //    CancellationTokenSource CTS = new CancellationTokenSource();
        //    CancellationToken token = CTS.Token;
        //    string audit_group = "others";
        //    string audit_action = "export_data_to_excel";
        //    string computer_name = System.Environment.MachineName;
        //    string appBuild = null;
        //    string extension = this.Title;
        //    try
        //    {
        //        await this.das.LogAuditEventAsync(token, audit_group, audit_action, computer_name, appBuild, extension);
        //    }
        //    catch (Exception e)
        //    {
        //        if (e is TaskCanceledException)
        //        {
        //        }
        //        else
        //        {
        //            CTS.Cancel();
        //            Message.ShowError(e.Message, e.GetType().ToString(), this.view);
        //        }
        //    }
        //}
        private void AppObjectBase_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "IsChecked")
            {
                AppObjectBase appObjectBase = sender as AppObjectBase;
                if (appObjectBase != null)
                {
                    if (appObjectBase.IsChecked == true)
                    {
                        this.SelectedItemsCount++;
                    }
                    else
                    {
                        this.SelectedItemsCount--;
                    }
                    this.isChecked = true;
                }
                this.OnPropertyChanged("Items");
            }
        }