public ContinuousAxisPanel()
 {
     _largestLabelSize = new Size();
     SetValue(ItemsSourceKey, new ObservableCollection<String>());
     YValues = new ObservableCollection<double>();
     SetValue(TickPositionsKey, new ObservableCollection<double>());
 }
Ejemplo n.º 2
0
        public OrderViewModel()
        {
            this.DisplayName = "Add/Edit Order";

            context = new LittleTravellerDataContext();
            var CanSave = this.Changed.Select(_ => ValidateFields()).StartWith(false);
            SaveCommand = new ReactiveCommand(CanSave);
            SaveCommand.Subscribe(_ => SaveOrder());
            NewOrderNumCommand = new ReactiveCommand();
            NewOrderNumCommand.Subscribe(_ => NewOrderNum());
            CloseTabCommand = new ReactiveCommand();
            CloseTabCommand.Subscribe(_ => TabClosing());
            SaveCommand.Subscribe(_ => SaveOrder());
            var CanAddItem = this.Changed.Select(_ => CanAddItemValidate()).StartWith(false);
            AddItemCommand = new ReactiveCommand(CanAddItem);
            AddItemCommand.Subscribe(_ => AddItem());
            DeleteItemCommand = new ReactiveCommand();
            DeleteItemCommand.OfType<ItemOptionsClass>().Subscribe(item => DeleteItem(item));

            CustomerOptions = (from cs in context.Customers select cs.CompanyName).ToList();
            SeasonOptions = context.Seasons.ToList();
            SizeTypeOptions = context.SizeTypes.ToList();
            ItemOptions = new ReactiveCollection<ItemOptionsClass>();
            _orderItems = new ObservableCollection<ItemOptionsClass>();
            AllSeasonsChecked = true;
            AllSizeTypesChecked = true;

            FillItemOptions();
        }
Ejemplo n.º 3
0
        //public static int Insert(string dbFile, string sql,)
        public static ObservableCollection<Jewelry> GetAll()
        {
            ObservableCollection<Jewelry> ob = new ObservableCollection<Jewelry>();

            using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=c:/xhz/ms.db;"))
            //using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=DB/ms.db;"))
            {
                conn.Open();

                string sql = string.Format("select * from detail");

                SQLiteCommand cmd = new SQLiteCommand(sql, conn);

                using (SQLiteDataReader dr1 = cmd.ExecuteReader())
                {
                    while (dr1.Read())
                    {
                        var d = dr1;
                        var dd = dr1.GetValue(0);
                        var data = dr1.GetValue(1);
                        var insert = dr1.GetValue(2);
                        var update = dr1.GetValue(3);
                    }
                }

                conn.Close();
            }

            ob.Add(new Jewelry());

            return ob;
        }
 /// <summary>
 /// Initializes a new instance of <see cref="ViewsCollection"/>.
 /// </summary>
 /// <param name="list">The list to wrap and filter.</param>
 /// <param name="filter">A predicate to filter the <paramref name="list"/> collection.</param>
 public ViewsCollection(ObservableCollection<ItemMetadata> list, Predicate<ItemMetadata> filter)
 {
     this.subjectCollection = list;
     this.filter = filter;
     Initialize();
     subjectCollection.CollectionChanged += UnderlyingCollection_CollectionChanged;
 }
Ejemplo n.º 5
0
 public FinAnalysisVM(DataGrid dataGrid)
 {
     _dataGrid = dataGrid;
     _rowMapping = Rowmapping.EnglishRows();
     _showTable = new ObservableCollection<FinAnalysisData>();
     _columnHeader = new List<string>();
 }
Ejemplo n.º 6
0
		void setupLogs()
		{
			RosLogs = new ObservableCollection<string>();
			
			_listener = ROS.Utils.Messenger.Client.Listener.CreateListener("prod", "edi-spy", "edi", "vog");
			_listener.MessageReceived += _listener_MessageReceived;
		}
 public StatementType() {
     this.statementLineField = new ObservableCollection<StatementLineType>();
     this.taxTotalField = new ObservableCollection<TaxTotalType>();
     this.allowanceChargeField = new ObservableCollection<AllowanceChargeType>();
     this.paymentTermsField = new ObservableCollection<PaymentTermsType>();
     this.paymentMeansField = new ObservableCollection<PaymentMeansType>();
     this.payeePartyField = new PartyType();
     this.originatorCustomerPartyField = new CustomerPartyType();
     this.sellerSupplierPartyField = new SupplierPartyType();
     this.buyerCustomerPartyField = new CustomerPartyType();
     this.accountingCustomerPartyField = new CustomerPartyType();
     this.accountingSupplierPartyField = new SupplierPartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.additionalDocumentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.statementPeriodField = new PeriodType();
     this.statementTypeCodeField = new StatementTypeCodeType();
     this.lineCountNumericField = new LineCountNumericType();
     this.totalBalanceAmountField = new TotalBalanceAmountType();
     this.totalCreditAmountField = new TotalCreditAmountType();
     this.totalDebitAmountField = new TotalDebitAmountType();
     this.documentCurrencyCodeField = new DocumentCurrencyCodeType();
     this.noteField = new ObservableCollection<NoteType>();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.uUIDField = new UUIDType();
     this.copyIndicatorField = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
 public static void AddTest()
 {
     string[] anArray = { "one", "two", "three" };
     ObservableCollection<string> col = new ObservableCollection<string>(anArray);
     CollectionAndPropertyChangedTester helper = new CollectionAndPropertyChangedTester();
     helper.AddOrInsertItemTest(col, "four");
 }
        public static void RemoveTest()
        {
            // trying to remove item in collection.
            string[] anArray = { "one", "two", "three", "four" };
            ObservableCollection<string> col = new ObservableCollection<string>(anArray);
            CollectionAndPropertyChangedTester helper = new CollectionAndPropertyChangedTester();
            helper.RemoveItemTest(col, 2, "three", true, hasDuplicates: false);

            // trying to remove item not in collection.
            anArray = new string[] { "one", "two", "three", "four" };
            col = new ObservableCollection<string>(anArray);
            helper = new CollectionAndPropertyChangedTester();
            helper.RemoveItemTest(col, -1, "three2", false, hasDuplicates: false);

            // removing null
            anArray = new string[] { "one", "two", "three", "four" };
            col = new ObservableCollection<string>(anArray);
            helper = new CollectionAndPropertyChangedTester();
            helper.RemoveItemTest(col, -1, null, false, hasDuplicates: false);

            // trying to remove item in collection that has duplicates.
            anArray = new string[] { "one", "three", "two", "three", "four" };
            col = new ObservableCollection<string>(anArray);
            helper = new CollectionAndPropertyChangedTester();
            helper.RemoveItemTest(col, 1, "three", true, hasDuplicates: true);
            // want to ensure that there is one "three" left in collection and not both were removed.
            int occurancesThree = 0;
            foreach (var item in col)
            {
                if (item.Equals("three"))
                    occurancesThree++;
            }
            Assert.Equal(1, occurancesThree);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes an instance of a TemplatePanel.
        /// </summary>
        public TemplatePanel()
        {
            _contentList = new ObservableCollection<UIElement>();
            _contentList.CollectionChanged += OnContentListCollectionChanged;

            Loaded += OnLoaded;
        }
 public GuaranteeCertificateType() {
     this.beneficiaryPartyField = new PartyType();
     this.interestedPartyField = new PartyType();
     this.guarantorPartyField = new PartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.immobilizedSecurityField = new ObservableCollection<ImmobilizedSecurityType>();
     this.guaranteeDocumentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.applicableRegulationField = new ObservableCollection<RegulationType>();
     this.applicablePeriodField = new PeriodType();
     this.noteField = new ObservableCollection<NoteType>();
     this.constitutionCodeField = new ConstitutionCodeType();
     this.liabilityAmountField = new LiabilityAmountType();
     this.purposeField = new ObservableCollection<PurposeType>();
     this.guaranteeTypeCodeField = new GuaranteeTypeCodeType();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.contractFolderIDField = new ContractFolderIDType();
     this.uUIDField = new UUIDType();
     this.copyIndicatorField = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
Ejemplo n.º 12
0
        public TestDataEditor()
        {
            InitializeComponent();

            //retrieve dat
            //            string strSelect = "SELECT ID,Name,Email,Desc FROM Customer ORDER BY ID ASC";
            //            _customerEntries = (Application.Current as App).db.SelectObservableCollection<Customer>(strSelect);
            string strSelect = "SELECT id FROM label";
            _labelEntries = (Application.Current as App).db.SelectObservableCollection<TableLable>(strSelect);
            int i = 0;
            foreach (TableLable data in _labelEntries)
            {
                if (i >= 10)
                    break;
                TextBlockID.Text += data.id + Environment.NewLine;
                i++;
            }
            //foreach (Customer data in _customerEntries)
            //{
            //    TextBlockID.Text += data.ID + Environment.NewLine;
            //    TextBlockName.Text +=data.Name + Environment.NewLine;
            //    TextBlockEmail.Text +=data.Email + Environment.NewLine;
            //    TextBlockDesc.Text +=data.Desc + Environment.NewLine;
            //}
        }
Ejemplo n.º 13
0
        public MainViewModel(IEventAggregator eventAggregator, ISignalRClient signalRClient, IAuthStore authStore,
            IProductsRepository productsRepository)
        {
            this.eventAggregator = eventAggregator;
            this.signalRClient = signalRClient;
            this.productsRepository = productsRepository;

            deleteRequest = new InteractionRequest<Confirmation>();
            CreateProductCommand = new DelegateCommand(CreateProduct);
            OpenProductCommand = new DelegateCommand<Product>(EditProduct);
            changePriceCommand = new DelegateCommand(ChangePrice, HasSelectedProducts);
            deleteCommand = new DelegateCommand(PromtDelete, HasSelectedProducts);

            cvs = new CollectionViewSource();
            items = new ObservableCollection<Product>();
            cvs.Source = items;
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("Size", ListSortDirection.Ascending));

            var token = authStore.LoadToken();
            if (token != null)
            {
                IsEditor = token.IsEditor();
                IsAdmin = token.IsAdmin();
            }
        }
 public RemittanceAdviceType() {
     this.remittanceAdviceLineField = new ObservableCollection<RemittanceAdviceLineType>();
     this.taxTotalField = new ObservableCollection<TaxTotalType>();
     this.paymentMeansField = new PaymentMeansType();
     this.payeePartyField = new PartyType();
     this.accountingSupplierPartyField = new SupplierPartyType();
     this.accountingCustomerPartyField = new CustomerPartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.additionalDocumentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.billingReferenceField = new BillingReferenceType();
     this.invoicePeriodField = new ObservableCollection<PeriodType>();
     this.lineCountNumericField = new LineCountNumericType();
     this.invoicingPartyReferenceField = new InvoicingPartyReferenceType();
     this.payerReferenceField = new PayerReferenceType();
     this.paymentOrderReferenceField = new PaymentOrderReferenceType();
     this.totalPaymentAmountField = new TotalPaymentAmountType();
     this.totalCreditAmountField = new TotalCreditAmountType();
     this.totalDebitAmountField = new TotalDebitAmountType();
     this.documentCurrencyCodeField = new DocumentCurrencyCodeType();
     this.noteField = new ObservableCollection<NoteType>();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.uUIDField = new UUIDType();
     this.copyIndicatorField = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
 public CatalogueType() {
     this.catalogueLineField = new ObservableCollection<CatalogueLineType>();
     this.tradingTermsField = new ObservableCollection<TradingTermsType>();
     this.contractorCustomerPartyField = new CustomerPartyType();
     this.sellerSupplierPartyField = new SupplierPartyType();
     this.receiverPartyField = new PartyType();
     this.providerPartyField = new PartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.documentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.sourceCatalogueReferenceField = new CatalogueReferenceType();
     this.referencedContractField = new ObservableCollection<ContractType>();
     this.validityPeriodField = new ObservableCollection<PeriodType>();
     this.lineCountNumericField = new LineCountNumericType();
     this.previousVersionIDField = new PreviousVersionIDType();
     this.versionIDField = new VersionIDType();
     this.descriptionField = new ObservableCollection<DescriptionType>();
     this.noteField = new ObservableCollection<NoteType>();
     this.revisionTimeField = new RevisionTimeType();
     this.revisionDateField = new RevisionDateType();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.nameField = new NameType1();
     this.actionCodeField = new ActionCodeType();
     this.uUIDField = new UUIDType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
 /// <summary>${pubilc_Constructors_Initializes} <see cref="ElementsLayer">ElementsLayer</see>
 ///     ${pubilc_Constructors_instance}</summary>
 public ElementsLayer()
 {
     Children = new ObservableCollection<UIElement>();
     Children.CollectionChanged += new NotifyCollectionChangedEventHandler(children_CollectionChanged);
     IsAutoAvoidance = false;
     BoundsCollection = new TObservableDictionary<object, Rectangle2D>();
 }
Ejemplo n.º 17
0
		public TaskListPad()
		{
			instance = this;
			this.displayedTokens = new Dictionary<string, bool>();
			TaskService.Cleared += TaskServiceCleared;
			TaskService.Added   += TaskServiceAdded;
			TaskService.Removed += TaskServiceRemoved;
			TaskService.InUpdateChanged += TaskServiceInUpdateChanged;
			
			this.tasks = new ObservableCollection<SDTask>(TaskService.CommentTasks);
			
			InitializePadContent();
			
			SD.Workbench.ActiveViewContentChanged += WorkbenchActiveViewContentChanged;
			
			if (SD.Workbench.ActiveViewContent != null) {
				UpdateItems();
				WorkbenchActiveViewContentChanged(null, null);
			}
			
			SD.ProjectService.SolutionOpened += OnSolutionOpen;
			SD.ProjectService.SolutionClosed += OnSolutionClosed;
			SD.ProjectService.CurrentProjectChanged += ProjectServiceCurrentProjectChanged;
			
			this.isInitialized = true;
		}
        public void Ctor()
        {
            var vm = new CalendarDetailsViewModel();

            Assert.IsFalse(vm.CanScrollHorizontal);
            Assert.IsTrue(vm.CanScrollVertical);

            Assert.AreEqual(LanguageService.Translate("Cmd_CreateCalendar"), vm.ToolbarItemList.First().Caption);
            Assert.AreEqual(LanguageService.Translate("Cmd_RemoveCalendar"), vm.ToolbarItemList.Last().Caption);
            Assert.AreEqual(LanguageService.Translate("Cmd_Save"), vm.WindowCommandItemList.First().Caption);
            Assert.AreEqual(LanguageService.Translate("Cmd_Cancel"), vm.WindowCommandItemList.Last().Caption);

            var daysOfWeek = new ObservableCollection<DayOfWeek>(new[]
                                                                 {
                                                                     DayOfWeek.Sunday,
                                                                     DayOfWeek.Monday,
                                                                     DayOfWeek.Tuesday,
                                                                     DayOfWeek.Wednesday,
                                                                     DayOfWeek.Thursday,
                                                                     DayOfWeek.Friday,
                                                                     DayOfWeek.Saturday
                                                                 });

            CollectionAssert.AreEqual(daysOfWeek, vm.DaysOfWeek);

            var workingIntervals = new CollectionViewSource();
            workingIntervals.SortDescriptions.Add(new SortDescription("StartDate", ListSortDirection.Ascending));
            workingIntervals.SortDescriptions.Add(new SortDescription("FinishDate", ListSortDirection.Ascending));

            CollectionAssert.AreEqual(workingIntervals.SortDescriptions, vm.WorkingIntervals.SortDescriptions);
        }
Ejemplo n.º 19
0
        public ObservableCollection<LinkageSetOR> selectAllDate()
        {
            string sql = @"select tl.*,t.StationName,d.DeviceName,c.ChannelName
             ,tLine.StationName as LineStationName,dLine.DeviceName as LineDeviceName,cLine.ChannelName  as LineChannelName
            from t_LinkageSet tl
            inner join t_Station t  on tl.StationID=t.StationID
            inner join t_Device d on tl.DeviceID=d.DeviceID
            inner join t_Channel c on tl.ChannelNo=c.ChannelNo and c.DeviceID=d.DeviceID
            inner join t_Station tLine  on tl.LinkageStationID=tLine.StationID
            inner join t_Device dLine on tl.LinkageDeviceID=dLine.DeviceID
            inner join t_Channel cLine on tl.LinkageChannelNo=cLine.ChannelNo and cLine.DeviceID=dLine.DeviceID";

            DataTable dt = null;
            try
            {
                dt = db.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            ObservableCollection<LinkageSetOR> _List = new ObservableCollection<LinkageSetOR>();
            foreach (DataRow dr in dt.Rows)
            {
                LinkageSetOR obj = new LinkageSetOR(dr);
                _List.Add(obj);
            }
            return _List;
        }
 public QuotationType() {
     this.quotationLineField = new ObservableCollection<QuotationLineType>();
     this.quotedMonetaryTotalField = new MonetaryTotalType();
     this.taxTotalField = new ObservableCollection<TaxTotalType>();
     this.destinationCountryField = new CountryType();
     this.allowanceChargeField = new ObservableCollection<AllowanceChargeType>();
     this.transactionConditionsField = new TransactionConditionsType();
     this.paymentMeansField = new PaymentMeansType();
     this.deliveryTermsField = new DeliveryTermsType();
     this.deliveryField = new ObservableCollection<DeliveryType>();
     this.originatorCustomerPartyField = new CustomerPartyType();
     this.buyerCustomerPartyField = new CustomerPartyType();
     this.sellerSupplierPartyField = new SupplierPartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.contractField = new ObservableCollection<ContractType>();
     this.additionalDocumentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.requestForQuotationDocumentReferenceField = new DocumentReferenceType();
     this.validityPeriodField = new PeriodType();
     this.lineCountNumericField = new LineCountNumericType();
     this.pricingCurrencyCodeField = new PricingCurrencyCodeType();
     this.noteField = new ObservableCollection<NoteType>();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.uUIDField = new UUIDType();
     this.copyIndicatorField = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
Ejemplo n.º 21
0
        //----------------------------------------------------- 
        //
        //  Constructors 
        // 
        //-----------------------------------------------------
 
        // Set up a ListCollectionView over the
        // snapshot.  We will delegate all CollectionView functionality
        // to this view.
        internal EnumerableCollectionView(IEnumerable source) 
            : base(source, -1)
        { 
            _snapshot = new ObservableCollection<object>(); 

            LoadSnapshotCore(source); 

            if (_snapshot.Count > 0)
            {
                SetCurrent(_snapshot[0], 0, 1); 
            }
            else 
            { 
                SetCurrent(null, -1, 0);
            } 

            // if the source doesn't raise collection change events, try to
            // detect changes by polling the enumerator
            _pollForChanges = !(source is INotifyCollectionChanged); 

            _view = new ListCollectionView(_snapshot); 
 
            INotifyCollectionChanged incc = _view as INotifyCollectionChanged;
            incc.CollectionChanged += new NotifyCollectionChangedEventHandler(_OnViewChanged); 

            INotifyPropertyChanged ipc = _view as INotifyPropertyChanged;
            ipc.PropertyChanged += new PropertyChangedEventHandler(_OnPropertyChanged);
 
            _view.CurrentChanging += new CurrentChangingEventHandler(_OnCurrentChanging);
            _view.CurrentChanged += new EventHandler(_OnCurrentChanged); 
        } 
Ejemplo n.º 22
0
        public PowerShellDataSource()
        {
            _allRecords = new ObservableCollection<object>();
            _specs = new List<DynamicMemberSpecification>();
            _scales = new ScaleDescriptorAssignmentCollection();
            _scales.CollectionChanged += OnScaleDescriptorAssignmentCollectionChanged;

            _dataCollectionMaxSize = 20;
            _data = new ObservableCollection<object>();
            _progressRecords = new ObservableCollection<ProgressRecord>();
            _dynamicMembers = new List<PSMemberInfo>();

            _powerShell = System.Management.Automation.PowerShell.Create();
            var runspace = RunspaceFactory.CreateRunspace();
            runspace.Open();
            runspace.SessionStateProxy.SetVariable( "seeShellDataSource", this );
            var tmp = System.Management.Automation.PowerShell.Create();
            tmp.Runspace = runspace;
            tmp.AddScript("function start-seeShellDataSet { $seeShellDataSource.StartDataSet(); }")
               .AddScript("function commit-seeShellDataSet { $seeShellDataSource.CommitDataSet(); }")
               .AddScript("function undo-seeShellDataSet { $seeShellDataSource.RollbackDataSet(); }");
            tmp.Invoke();

            _powerShell.Runspace = runspace;
            _powerShell.InvocationStateChanged += InvocationStateChanged;
            _powerShell.Streams.Debug.DataAdded += DebugRecordAdded;
            _powerShell.Streams.Verbose.DataAdded += VerboseRecordAdded;
            _powerShell.Streams.Progress.DataAdded += ProgressRecordAdded;
            _powerShell.Streams.Error.DataAdded += ErrorRecordAdded;
            _powerShell.Streams.Warning.DataAdded += WarningRecordAdded;
        }
        public void TestCollectionSync()
        {
            string item0 = "Item0";
            string item1 = "Item1";
            string item2 = "Item2";
            string item3 = "Item3";

            ObservableCollection<string> collection = new ObservableCollection<string>();

            HelperLabeledViewModelCollection viewModel = new HelperLabeledViewModelCollection(null, collection, o => o);

            collection.Add(item0);
            collection.Add(item1);
            collection.Add(item3);
            Assert.IsTrue(CompareCollectionValues(collection, viewModel), "Add did not work.");

            collection.Insert(2, item2);
            Assert.IsTrue(CompareCollectionValues(collection, viewModel), "Insert did not work.");

            collection.Remove(item3);
            Assert.IsTrue(CompareCollectionValues(collection, viewModel), "Remove did not work.");

            collection.Move(0, 1);
            Assert.IsTrue(CompareCollectionValues(collection, viewModel), "Move did not work.");

            collection.Clear();
            Assert.IsTrue(CompareCollectionValues(collection, viewModel), "Clear did not work.");
        }
 public ReceiptAdviceType() {
     this.receiptLineField = new ObservableCollection<ReceiptLineType>();
     this.shipmentField = new ShipmentType();
     this.sellerSupplierPartyField = new SupplierPartyType();
     this.buyerCustomerPartyField = new CustomerPartyType();
     this.despatchSupplierPartyField = new SupplierPartyType();
     this.deliveryCustomerPartyField = new CustomerPartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.additionalDocumentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.despatchDocumentReferenceField = new ObservableCollection<DocumentReferenceType>();
     this.orderReferenceField = new ObservableCollection<OrderReferenceType>();
     this.lineCountNumericField = new LineCountNumericType();
     this.noteField = new ObservableCollection<NoteType>();
     this.receiptAdviceTypeCodeField = new ReceiptAdviceTypeCodeType();
     this.documentStatusCodeField = new DocumentStatusCodeType();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.uUIDField = new UUIDType();
     this.copyIndicatorField = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
Ejemplo n.º 25
0
        public BookViewModel(
                    BookModel bookModel, string pageTitle,
                    INavigationServiceFacade navigationServiceFacade,
                    bool synchronizedWithSelection)
        {
            this._book = bookModel;
            this._pageTitle = pageTitle;
            this._navigationServiceFacade = navigationServiceFacade;

            if (_categoryService != null)
                this._categories =
                    new ObservableCollection<CategoryModel>(this._categoryService.GetByCriteria(CategoryCriteria.Empty));

            if (_authorService != null)
                this._authors =
                    new ObservableCollection<AuthorModel>(this._authorService.GetByCriteria(AuthorCriteria.Empty));

            #region Initialisation supplémentaire pour problème dans le ListPicker

            IEnumerator enumcat = this._categories.GetEnumerator();
            enumcat.MoveNext();
            _selectedCategory = enumcat.Current as CategoryModel;

            IEnumerator enumaut = this._authors.GetEnumerator();
            enumaut.MoveNext();
            _selectedAuthor = enumaut.Current as AuthorModel;

            #endregion // Initialisation supplémentaire pour problème dans le ListPicker
        }
Ejemplo n.º 26
0
 /**
  * This is the constructor for the LocationHandler.
  * It creates the internal floor list and registers a callback to it.
  */
 private LocationHandler()
 {
     this._handler = DatabaseHandler.GetInstance();
     this._locations = new ObservableCollection<Location>();
     this._locations.CollectionChanged += EventLocationCollectionChanged;
     LoadLocations();
 }
 public ContractNoticeType() {
     this.procurementProjectLotField = new ObservableCollection<ProcurementProjectLotType>();
     this.procurementProjectField = new ProcurementProjectType();
     this.tenderingProcessField = new TenderingProcessType();
     this.tenderingTermsField = new TenderingTermsType();
     this.receiverPartyField = new PartyType();
     this.originatorCustomerPartyField = new ObservableCollection<CustomerPartyType>();
     this.contractingPartyField = new ContractingPartyType();
     this.signatureField = new ObservableCollection<SignatureType>();
     this.frequencyPeriodField = new PeriodType();
     this.regulatoryDomainField = new ObservableCollection<RegulatoryDomainType>();
     this.requestedPublicationDateField = new RequestedPublicationDateType();
     this.noteField = new ObservableCollection<NoteType>();
     this.issueTimeField = new IssueTimeType();
     this.issueDateField = new IssueDateType();
     this.contractFolderIDField = new ContractFolderIDType();
     this.uUIDField = new UUIDType();
     this.copyIndicatorField = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField = new ProfileIDType();
     this.customizationIDField = new CustomizationIDType();
     this.uBLVersionIDField = new UBLVersionIDType();
     this.uBLExtensionsField = new ObservableCollection<UBLExtensionType>();
 }
Ejemplo n.º 28
0
 public static void Initialize()
 {
     Durations = new ObservableCollection<Duration>();
     noteCaptions = new string[definedDurations] {
         "Whole", "Half", "Quarter", "Eighth", "Sixteenth", "Thirtysecond",
         "DottedWhole", "DottedHalf", "DottedQuarter", "DottedEighth", "DottedSixteenth", "DottedThirtysecond" };
     switch (BeatUnit)
     {
         case 2:
             noteDurations = new double[definedDurations] { 2, 1, .5, .25, .125, .0675, 3, 1.5, .75, .375, .1875, .10125 };
             break;
         case 4:
             noteDurations = new double[definedDurations] { 4, 2, 1, .5, .25, .125, 6, 3, 1.5, .75, .375, .1875 };
             break;
         case 8:
             noteDurations = new double[definedDurations] { 8, 4, 2, 1, .5, .25, 12, 6, 3, 1.5, .75, .375 };
             break;
         default: /*default to 4/4 time */
             noteDurations = new double[definedDurations] { 4, 2, 1, .5, .25, .125, 6, 3, 1.5, .75, .375, .1875 };
             break;
     }
     //noteSpacings = new int[definedDurations] { 60, 50, 41, 30, 20, 12, 62, 52, 43, 32, 22, 14 };
     noteSpacings = new int[definedDurations] { 68, 62, 52, 44, 32, 20, 68, 62, 52, 44, 32, 20 };
     for (int i = 0; i < definedDurations; i++)
     {
         Durations.Add(new Duration(noteCaptions[i], noteDurations[i], noteSpacings[i], null));
     }
     PopulateNoteVectors();
 }
        public void RaisesCollectionChangedWithAddAndRemoveWhenFilteredCollectionChanges()
        {
            var originalCollection = new ObservableCollection<ItemMetadata>();
            IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.IsActive);
            bool addedToCollection = false;
            bool removedFromCollection = false;
            viewsCollection.CollectionChanged += (s, e) =>
                                                     {
                                                         if (e.Action == NotifyCollectionChangedAction.Add)
                                                         {
                                                             addedToCollection = true;
                                                         }
                                                         else if (e.Action == NotifyCollectionChangedAction.Remove)
                                                         {
                                                             removedFromCollection = true;
                                                         }
                                                     };
            var filteredInObject = new ItemMetadata(new object()) { IsActive = true };

            originalCollection.Add(filteredInObject);

            Assert.IsTrue(addedToCollection);
            Assert.IsFalse(removedFromCollection);

            originalCollection.Remove(filteredInObject);

            Assert.IsTrue(removedFromCollection);
        }
        private async Task<IEnumerable> GetUpdatesDataCore(string userID)
        {
            //Get all updates
            var updates = await ParseObject.GetQuery("Update").Include("User").FindAsync();

            var updatesModel = from c in updates select new UpdateModel(c);

            var groupedData = from u in updatesModel
                              group u by u.Date.Date into groupData
                              select new
                              {
                                  Name = groupData.Key,
                                  Items = groupData
                              };

            ObservableCollection<GroupedData<UpdateModel>> data = new ObservableCollection<GroupedData<UpdateModel>>();
            foreach (var item in groupedData)
            {
                GroupedData<UpdateModel> list = new GroupedData<UpdateModel>();
                list.Key = item.Name;
                foreach (var itemInGroup in item.Items)
                {
                    list.Add(itemInGroup);
                }
                data.Add(list);
            }

            return data;
        }