コード例 #1
0
        private string boolArrToLiteral(TrulyObservableCollection <BoolNotifyPropertyChanged> x)
        {
            string str = "{";

            char[] charsToTrim = { ',', ' ' };
            for (int i = 0; i < x.Count; i++)
            {
                if (x[i].val)
                {
                    str += (i + 1).ToString() + ',';
                }
            }
            str  = str.Trim(charsToTrim);
            str += "}";
            return(str);
        }
コード例 #2
0
        private void Init()
        {
            var appsettings = ConfigurationManager.AppSettings;

            _PathToSave  = appsettings["TestPath"] ?? @"c:\";
            _fileProcess = new Process();
            FileName     = "";
            NewFileName  = "";
            Name         = "";
            Inn          = "";
            ADate        = DateTime.Now;
            updateNewFileName();
            IsKlient = false;
            IsKredit = false;

            // инициализируем три


            ex = new TrulyObservableCollection <BoolNotifyPropertyChanged>();
            ex.CollectionChanged += MyItemsSource_CollectionChanged;
            for (int i = 0; i < 16; i++)
            {
                ex.Add(new BoolNotifyPropertyChanged()
                {
                    val = false
                });
            }
            kl = new TrulyObservableCollection <BoolNotifyPropertyChanged>();
            kl.CollectionChanged += MyItemsSource_CollectionChanged;
            for (int i = 0; i < 12; i++)
            {
                kl.Add(new BoolNotifyPropertyChanged()
                {
                    val = false
                });
            }
            kr = new TrulyObservableCollection <BoolNotifyPropertyChanged>();
            kr.CollectionChanged += MyItemsSource_CollectionChanged;
            for (int i = 0; i < 12; i++)
            {
                kr.Add(new BoolNotifyPropertyChanged()
                {
                    val = false
                });
            }
        }