Example #1
1
        public ConnectWindow()
        {
            InitializeComponent();

            try
            {
                IsAvailableServer = ServiceCtrlClass.ServiceIsInstalled("EpgTimer Service") == true ||
                    System.IO.File.Exists(SettingPath.ModulePath.TrimEnd('\\') + "\\EpgTimerSrv.exe") == true;

                btn_edit.Visibility = Visibility.Collapsed;

                ConnectionList = new ObservableCollection<NWPresetItem>(Settings.Instance.NWPreset);
                var nowSet = new NWPresetItem(DefPresetStr, Settings.Instance.NWServerIP, Settings.Instance.NWServerPort, Settings.Instance.NWWaitPort, Settings.Instance.NWMacAdd, Settings.Instance.NWPassword);
                int pos = ConnectionList.ToList().FindIndex(item => item.EqualsTo(nowSet, true));
                if (pos == -1)
                {
                    ConnectionList.Add(nowSet);
                    pos = ConnectionList.Count - 1;
                }
                if (IsAvailableServer == true)
                {
                    ConnectionList.Insert(0, new NWPresetItem("ローカル接続", "", 0, 0, "", new SerializableSecureString()));
                    pos++;
                }
                ConnectionList.Add(new NWPresetItem("<新規登録>", "", 0, 0, "", new SerializableSecureString()));

                listView_List.ItemsSource = ConnectionList;
                if (IsAvailableServer == false)
                {
                    Settings.Instance.NWMode = true;
                }
                listView_List.SelectedIndex = Settings.Instance.NWMode == true ? pos : 0;
            }
            catch { }
        }
 public void ConnectControlViewModel_AddNewServer_ResourceRepositoryReturnExistingServers_False()
 {
     //------------Setup for test--------------------------
     var mainViewModel = new Mock<IMainViewModel>();
     var connectControlSingleton = new Mock<IConnectControlSingleton>();
     var env1 = new TestEnvironmentModel(new Mock<IEventAggregator>().Object, Guid.NewGuid(), CreateConnection(true, false).Object, new Mock<IResourceRepository>().Object, false);
     var env2 = new TestEnvironmentModel(new Mock<IEventAggregator>().Object, Guid.NewGuid(), CreateConnection(true, false).Object, new Mock<IResourceRepository>().Object, false);
     var connectControlEnvironments = new ObservableCollection<IConnectControlEnvironment>();
     var controEnv1 = new Mock<IConnectControlEnvironment>();
     var controEnv2 = new Mock<IConnectControlEnvironment>();
     controEnv1.Setup(c => c.EnvironmentModel).Returns(env1);
     controEnv2.Setup(c => c.EnvironmentModel).Returns(env2);
     controEnv1.Setup(c => c.IsConnected).Returns(true);
     connectControlEnvironments.Add(controEnv2.Object);
     connectControlEnvironments.Add(controEnv1.Object);
     connectControlSingleton.Setup(c => c.Servers).Returns(connectControlEnvironments);
     var environmentRepository = new Mock<IEnvironmentRepository>();
     ICollection<IEnvironmentModel> environments = new Collection<IEnvironmentModel>
         {
             env1
         };
     environmentRepository.Setup(e => e.All()).Returns(environments);
     var viewModel = new ConnectControlViewModel(mainViewModel.Object, environmentRepository.Object, e => { }, connectControlSingleton.Object, "TEST : ", false);
     //------------Execution-------------------------------
     int serverIndex;
     var didAddNew = viewModel.AddNewServer(out serverIndex, i => { });
     //------------Assert----------------------------------
     Assert.IsNotNull(viewModel);
     Assert.IsFalse(didAddNew);
 }
Example #3
1
        public ViewModel()
        {
            mgt = new ManagementClass("Win32_Processor");
            procs = mgt.GetInstances();

            CPU = new ObservableCollection<Model>();
            timer = new DispatcherTimer();
            random = new Random();
            time = DateTime.Now;
            cpuCounter = new PerformanceCounter();
            cpuCounter.CategoryName = "Processor";
            cpuCounter.CounterName = "% Processor Time";
            cpuCounter.InstanceName = "_Total";
            ramCounter = new PerformanceCounter("Memory", "Available MBytes");
            ProcessorID = GetProcessorID();
            processes = Process.GetProcesses();
            Processes = processes.Length;
            MaximumSpeed = GetMaxClockSpeed();
            LogicalProcessors = GetNumberOfLogicalProcessors();
            Cores = GetNumberOfCores();
            L2Cache = GetL2CacheSize();
            L3Cache = GetL3CacheSize();
            foreach (ManagementObject item in procs)
                L1Cache = ((UInt32)item.Properties["L2CacheSize"].Value / 2).ToString() + " KB";

            timer.Interval = TimeSpan.FromMilliseconds(1000);
            timer.Tick += timer_Tick;
            timer.Start();
            for (int i = 0; i < 60; i++)
            {
                CPU.Add(new Model(time, 0,0));
                time = time.AddSeconds(1);
            }
        }
 public UserRateListViewModel(IUserInterop userInterop, IControllerInterop controllerInterop, Dispatcher dispatcher, BaseEntityDTO entity)
     : base(userInterop, controllerInterop, dispatcher)
 {
     this.entity = entity;
     rates = new ObservableCollection<UserRateItemDTO>();
     Rates = new ReadOnlyObservableCollection<UserRateItemDTO>(rates);
 }
Example #5
0
        /// <summary>
        /// Returns a list of visual branches which are around the given commit.
        /// </summary>
        /// <param name="commit"></param>
        /// <param name="repo"></param>
        /// <returns></returns>
        public static List<Branch> GetBranchesAroundCommit(Commit commit, ObservableCollection<Branch> branches)
        {
            List<Branch> list = new List<Branch>();

            // Loop through all branches and determine if they are around the specified commit.
            foreach (Branch branch in branches)
            {
                // Tip has to be found and in case multiple branches share the tree, get rid of the others -- messes up visual position counting.
                if (branch.Tip == null || list.Any(b => branch.Tip.Branches.Contains(b)) || list.Any(b => b.Tip.Branches.Contains(branch)))
                    continue;

                // The branch's tip must be newer/same than the commit.
                if (branch.Tip.Date >= commit.Date) // TODO: && first commit-ever must be older? We might not need to do that... ... ?
                {
                    list.Add(branch);
                }
                else
                {
                    // If there's a branch with a tip commit older than commit.Date, then it's around this commit if they don't share a single branch.
                    bool foundThisBranch = branch.Tip.Branches.Any(b => commit.Branches.Contains(b));

                    if (foundThisBranch == false)
                        list.Add(branch);
                }
            }

            return list;
        }
        public bool Dependencia_Insert(string KeySesion, string DependenciaName)
        {
            bool res = true;
            ObservableCollection<WAPP_USUARIO_SESION> Key = new ObservableCollection<WAPP_USUARIO_SESION>();

            try
            {
                using (var entity_ = new db_SeguimientoProtocolo_r2Entities())
                {
                    (from s in entity_.WAPP_USUARIO_SESION
                     where s.IdSesion == KeySesion
                     select s).ToList().ForEach(row =>
                     {
                         Key.Add(new WAPP_USUARIO_SESION()
                         {
                             IdUsuario = row.IdUsuario,
                             IdSesion = row.IdSesion
                         });
                     });
                    if (Key[0].IdSesion == KeySesion.ToString())
                    {
                        using (var entity = new db_SeguimientoProtocolo_r2Entities())
                        {
                            entity.SP_DependenciaInsert(DependenciaName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                var errr = ex.Message;
            }
            return res;
        }
        /// <summary>
        /// Initializes a new instance of the ChooseProfileViewModel class.
        /// </summary>
        public ChooseProfileViewModel(IExtendedApiClient apiClient, INavigationService navigationService, IApplicationSettingsService applicationSettings)
        {
            _apiClient = apiClient;
            _navigationService = navigationService;

            Profiles = new ObservableCollection<UserDto>();
            if (IsInDesignMode)
            {
                Profiles = new ObservableCollection<UserDto>
                {
                    new UserDto
                    {
                        Id = new Guid("dd425709431649698e92d86b1f2b00fa").ToString(),
                        Name = "ScottIsAFool"
                    },
                    new UserDto
                    {
                        Id = new Guid("dab28e40cfbc43658082f55a44cf139a").ToString(),
                        Name = "Redshirt",
                        LastLoginDate = DateTime.Now.AddHours(-1)
                    }
                };
            }
            else
            {
                WireCommands();
            }
        }
Example #8
0
        public GridViewModel()
        {
            ResultData = new ObservableCollection<TestPointDataObject>();

            //get the unique test points
            var definedTestPoints = _resultValueTags.Where(dt => dt.Name.ToLower().Contains("testpoint")).GroupBy(dt => dt.Name.Split('.').First()).Select(grp => grp.First().Name.Split('.').First());
            //var q2 = _resultValueTags.Where(dt => Regex.Match(dt.Name.Split('.').Single((s) => s.Contains("test")), @"(testpoint)[\d+]", RegexOptions.IgnoreCase).Success);

            //Add the test point with a header value of it's number.
            foreach (string tp in definedTestPoints)
                ResultData.Add(new TestPointDataObject(Regex.Match(tp,@"[\d+]").Value));

            foreach (DataTag tag in _resultValueTags.Where(dt => dt.Name.ToLower().Contains("testpoint")))
                ResultData.ElementAt(Convert.ToInt32(Regex.Match(tag.Name, @"[\d+]").Value) - 1).Results.Add(new ResultDataObject(tag.Name,tag.Double));

            foreach (DataTag tag in _results)
            {
                tag.ValueChanged += Tag_ValueChanged;
                tag.ValueSet += Tag_ValueSet;
            }

            foreach (var v in ResultData)
            {

                _view = CollectionViewSource.GetDefaultView(v.Results);
                _view.GroupDescriptions.Add(new PropertyGroupDescription("Name", new ResultNameGrouper()));
            }
        }
Example #9
0
        public ObservableCollection<OnTheSpot.Models.Category> GetCats(out string error)
        {
            ObservableCollection<OnTheSpot.Models.Category> modelCats = null;
            error = string.Empty;
            try
            {
                List<Category> dbCats = db.Categories.ToList();

                modelCats = new ObservableCollection<OnTheSpot.Models.Category>();
                foreach (Category cat in dbCats)
                {
                    OnTheSpot.Models.Category model = new OnTheSpot.Models.Category()
                    {
                        ID = cat.ID,
                        Description = cat.Description,
                        Name = cat.Name
                    };
                    modelCats.Add(model);
                }
            }
            catch  (Exception e)
            {
                error = "Critical Error: Could not open Categories DataBase";
            }

            return modelCats;
        }
        //Constructor
        private EventCatalogSingleton()
        {
            Events = new ObservableCollection<Event>();

            // The purpose of this is to make some instances of events. It creates instances of events and adds it to the observable collection.
            LoadEventAsync();
        }
 public DesignTimeCategoryListViewModel()
 {
     Categories = new ObservableCollection<Category>
     {
         new Category {Name = "Design Time Category 1"}
     };
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     history = new HistoriesViewModel();
     histories = history.getHistory();
     //listViewHistory.Items.Add(histories);
     try
     {
         if (histories != null)
         {
             foreach (var hist in histories)
             {
                 listViewHistory.Items.Add(hist.ID + " :Used :" + hist.USED_UNITS + " Remained " + hist.REMAINING_UNITS + " DATE: " + hist.DATE + "");
             }
         }
         else
         {
             messageBox("No history in the database");
         }
     }
     catch (Exception ex)
     {
         messageBox("error " + ex.Message);
     }
     base.OnNavigatedTo(e);
 }
 public async Task SearchAsync(string query)
 {
     _books.Clear();
     IBooksSearchEngine bSearchEngine = new GoogleBooksSearchEngine();
     var t = await bSearchEngine.SearchBooksAsync(query);
     _books = t;
 }
Example #14
0
        public AddProductViewModel()
        {
            LstStatus = new ObservableCollection<ProductStatusDTO>();
            LstCategories = new ObservableCollection<ProductCategoryDTO>();

            ////Hide attributes for all the items sold in loose quantity
            ////This is default setting, which will be overriden once
            ////user checks the checkbox on screen.
            HideAttributesForLooseItems();

            ////Get Product status from database
            GetProductStatus();

            ////Get all active Product categories from database
            GetCategories();

            SaveProductCommand = new RelayCommand(SaveProductSetting);
            CancelProductCommand = new RelayCommand(CancelSetting);
            SearchProductCommand = new RelayCommand(SearchProducts);
            CancelSearchCommand = new RelayCommand(CancelSearch);
            GenerateBarCodeCommand = new RelayCommand(GenerateBarCode);

            LstProducts = new List<ProductDTO>();

            ///Get all products
            GetProducts(string.Empty);
        }
        public BroadcastViewModel()
        {
            Positions = new ObservableCollection<Position>();
            Positions.CollectionChanged += Positions_CollectionChanged;

            TryDownloadMyPositions(50);
        }
		public DeviceList (IAdapter adapter)
		{
			InitializeComponent ();
			this.adapter = adapter;
			this.devices = new ObservableCollection<IDevice> ();
			listView.ItemsSource = devices;

			adapter.DeviceDiscovered += (object sender, DeviceDiscoveredEventArgs e) => {
				Device.BeginInvokeOnMainThread(() => {
					devices.Add (e.Device);
				});
			};

			adapter.ScanTimeoutElapsed += (sender, e) => {
				adapter.StopScanningForDevices(); // not sure why it doesn't stop already, if the timeout elapses... or is this a fake timeout we made?
				Device.BeginInvokeOnMainThread ( () => {
					IsBusy = false;
					DisplayAlert("Timeout", "Bluetooth scan timeout elapsed, no heart rate monitors were found", "OK");
				});
			};

			ScanHrmButton.Activated += (sender, e) => {
				InfoFrame.IsVisible = false;
				// this is the UUID for Heart Rate Monitors
				StartScanning (0x180D.UuidFromPartial());
			};
		}
Example #17
0
        private async void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
        {
            try
            {
                if (sender.Text.Length != 0)
                {
                    //ObservableCollection<String>
                    var data = new ObservableCollection<string>();
                    var httpclient = new Noear.UWP.Http.AsyncHttpClient();
                    httpclient.Url("http://mobilecdn.kugou.com/new/app/i/search.php?cmd=302&keyword="+sender.Text);
                    var httpresult = await httpclient.Get();
                    var jsondata = httpresult.GetString();
                    var obj = Windows.Data.Json.JsonObject.Parse(jsondata);
                    var arryobj = obj.GetNamedArray("data");
                    foreach (var item in arryobj)
                    {
                        data.Add(item.GetObject().GetNamedString("keyword"));
                    }
                    sender.ItemsSource = data;
                    //sender.IsSuggestionListOpen = true;
                }
                else
                {
                    sender.IsSuggestionListOpen = false;
                }
            }
            catch (Exception)
            {

            }
        }
Example #18
0
        void GroupSong()
        {
            if (_SourceSong != null)
                _SourceSong.Clear();
            for (int i = 0; i < _Song.Count; i++)
            {
                ArrSong add = new ArrSong(_Song[i].Name.ToString(), _Song[i].Artist.ToString(), _Song[i].Album.ToString());
                _SourceSong.Add(add);
            }

            _SourceArtist = _SourceSong;
            for (int i = 0; i < _SourceArtist.Count - 1; i++)
            {
                for (int j = i + 1; j < _SourceArtist.Count; j++)
                {
                    if (_SourceArtist[i].Artist.ToString() == _SourceArtist[j].Artist.ToString())
                    {
                        _SourceArtist.Remove(_SourceArtist[i]);
                    }
                }
            }

            List<AlphaKeyGroup<ArrSong>> DataSource = AlphaKeyGroup<ArrSong>.CreateGroups(_SourceSong,
                System.Threading.Thread.CurrentThread.CurrentUICulture,
                (ArrSong s) => { return s.Song; }, true);

            AddrSong.ItemsSource = DataSource;
        }
Example #19
0
 public Store(Connection source, string location)
 {
     ValidationMessages = new ObservableCollection<string>();
     _location = location;
     Source = source;
     Validate();
 }
Example #20
0
 public UserSettingsVM()
 {
     UnselectedTorrentSources = new ObservableCollection<TorrentSourceVM>();
     SelectedTorrentSources = new ObservableCollection<TorrentSourceVM>();
     AllTorrentSources = new ObservableCollection<TorrentSourceVM>(GetAllTorrentSources());
     CurrentSearchTorrentSources = new ObservableCollection<TorrentSourceVM>();
 }
Example #21
0
        public CalendarViewModel(ICalendarService calendarService, IRegionManager regionManager)
        {
            this.synchronizationContext = SynchronizationContext.Current ?? new SynchronizationContext();

            this.openMeetingEmailCommand = new DelegateCommand<Meeting>(this.OpenMeetingEmail);

            this.meetings = new ObservableCollection<Meeting>();

            this.calendarService = calendarService;
            this.regionManager = regionManager;

            this.calendarService.BeginGetMeetings(
                r =>
                {
                    var meetings = this.calendarService.EndGetMeetings(r);

                    this.synchronizationContext.Post(
                        s =>
                        {
                            foreach (var meeting in meetings)
                            {
                                this.Meetings.Add(meeting);
                            }
                        },
                        null);
                },
                null);
        }
        protected override async void OnPublished(object data)
        {
            try
            {
                IsBusy = true;

                var authorisationNodes = await authorisationManagerServiceManager.GetAuthorisationNodes();
                Activities = new ObservableCollection<ActivityNode>(authorisationNodes.ActivityNodes);
                Roles = new ObservableCollection<RoleNode>(authorisationNodes.RoleNodes);
                Users = new ObservableCollection<UserNode>(authorisationNodes.UserNodes);

                ResetStatus();
            }
            catch (Exception ex)
            {
                ShowMessage(new Message()
                {
                    MessageType = MessageTypeEnum.Error,
                    Text = ex.Message
                }, true);

                IsBusy = false;
            }
            finally
            {
                OnPropertyChanged("");
            }

            Logger.Log("ConfigurationAuthorisationViewModel OnPublished complete", Category.Info, Priority.None);
        }
 private void btnCerca_Click(object sender, RoutedEventArgs e)
 {
     
     var list = dag.cercaSoggiorni((DateTime)datePickerArrivo.SelectedDate, (DateTime)datePickerPartenza.SelectedDate, cliente);
     soggiorniResult = new ObservableCollection<Soggiorno>(list);
     dataGridSoggiorni.DataContext = soggiorniResult;
 }
Example #24
0
        public ServersList(ServersListMessage msg)
        {
            if (msg == null) throw new ArgumentNullException("msg");

            m_collection = new ObservableCollection<ServersListEntry>(msg.servers.Select(entry => new ServersListEntry(entry)));
            m_readOnlyCollection = new ReadOnlyObservableCollection<ServersListEntry>(m_collection);
        }
        public DocumentManagerViewModel()
        {
            TaxPayerList = new ObservableCollection<TaxPayerEntity>();
            TaxPayerTypeList = new ObservableCollection<TaxPayerTypeEntity>();
            TaxPayerTypeEntityDictionary = new Dictionary<int, TaxPayerTypeEntity>();
            FileTypeList = new ObservableCollection<FileTypeEntity>();
            FileTypeDictionary = new Dictionary<int, FileTypeEntity>();
            UserEntityDictionary = new Dictionary<int, UserEntity>();

            DocumentViewModel = new DocumentViewModel();
            DocumentViewModel.BeginLoadings += BeginLoading;
            DocumentViewModel.FinishLoadings += FinishLoading;

            documentManagerContext = new DocumentManager.Web.DocumentManagerDomainContext();
            OnAddTaxPayer = new DelegateCommand(onAddTaxPayer);
            OnAddProject = new DelegateCommand(onAddProject, canAddProject);
            OnModifyTaxPayer = new DelegateCommand(onModifyTaxPayer, canModifyTaxPayer);
            OnDeleteTaxPayer = new DelegateCommand(onDeleteTaxPayer, canDeleteTacPayer);

            OnRefresh = new DelegateCommand(onRefresh);
            OnDoubleClickList = new DelegateCommand(onDoubleClickList);

            taxPayerDocumentSource = new EntityList<Web.Model.taxpayerdocument>(documentManagerContext.taxpayerdocuments);
            taxPayerDocumentLoader = new DomainCollectionViewLoader<Web.Model.taxpayerdocument>(
                LoadTaxPayerDocument,
                LoadTaxPayerDocument_Complete
                );
            taxPayerDocumentView = new DomainCollectionView<Web.Model.taxpayerdocument>(taxPayerDocumentLoader, taxPayerDocumentSource);
        }
        public ConfigurationWindow()
        {
            InitializeComponent();
            DataContext = this;

            ObservableCollection<Personality> personalities = new ObservableCollection<Personality>();
            // Add our default personality
            personalities.Add(Personality.Default());
            foreach (Personality personality in Personality.AllFromDirectory())
            {
                personalities.Add(personality);
            }
            // Add local personalities
            foreach (Personality personality in personalities)
            {
                Logging.Debug("Found personality " + personality.Name);
            }
            Personalities = personalities;

            SpeechResponderConfiguration configuration = SpeechResponderConfiguration.FromFile();

            foreach (Personality personality in Personalities)
            {
                if (personality.Name == configuration.Personality)
                {
                    Personality = personality;
                    break;
                }
            }
        }
 public PaymentButtonGroupViewModel(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     _makePaymentCommand = makePaymentCommand;
     _settleCommand = settleCommand;
     _closeCommand = closeCommand;
     _paymentButtons = new ObservableCollection<CommandButtonViewModel<PaymentTemplate>>();
 }
		public TVsViewDefinition()
		{
			this.groupDescriptions = new ObservableCollection<GroupDescription>();
			this.groupDescriptions.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnGroupByCollectionChanged);
			this.Title = "Televisions";
			this.VisibleDays = 5;
		}
Example #29
0
        public MenuGeneral()
        {
            //Delegate pour exécuter du code personnalisé lors du changement de langue de l'UI.
            CultureManager.UICultureChanged += CultureManager_UICultureChanged;

            mapLangue = new ObservableCollection<LangueUI>();
            //Le tag de langue IETF (ie: fr-CA) utilisé directement pour changer la langue d'affichage.
            //Récupéré selon la Langue active.
            string codeLangueActif;

            //Si l'utilisateur est connecté, utilise la langue sauvegarder sous son profil.
            if (App.MembreCourant.IdMembre != null)
            {
                codeLangueActif = App.MembreCourant.LangueMembre.IETF;
            }
            else
            {
                //Sinon, utilise la valeur par défault tel que défini sous App.
                codeLangueActif = App.LangueInstance.IETF;
            }

            mapLangue.Add(francais);
            mapLangue.Add(anglais);
            //Dans le dictionnaire, trouve l'élément qui a le tag IETF équivalent à selui enregistré sous codeLangueActif et le met à actif.
            mapLangue.FirstOrDefault(l => l.LangueSys.IETF == codeLangueActif).Actif = true;

            InitializeComponent();
            //Configure la source de notre dataGrid.
            dgLangues.ItemsSource = mapLangue;
        }
Example #30
0
		public MachineStationsVM(MachineVM machine, AccessType access)
			: base(access)
		{
            UnitOfWork = new SoheilEdmContext();
			CurrentMachine = machine;
            MachineDataService = new MachineDataService(UnitOfWork);
			MachineDataService.StationAdded += OnStationAdded;
			MachineDataService.StationRemoved += OnStationRemoved;
            StationDataService = new StationDataService(UnitOfWork);

			var selectedVms = new ObservableCollection<StationMachineVM>();
			foreach (var stationMachine in MachineDataService.GetStations(machine.Id))
			{
				selectedVms.Add(new StationMachineVM(stationMachine, Access, StationMachineDataService, RelationDirection.Reverse));
			}
			SelectedItems = new ListCollectionView(selectedVms);

            var allVms = new ObservableCollection<StationVM>();
            foreach (var station in StationDataService.GetActives(SoheilEntityType.Machines, CurrentMachine.Id))
            {
                allVms.Add(new StationVM(station, Access, StationDataService));
            }
            AllItems = new ListCollectionView(allVms);

			IncludeCommand = new Command(Include, CanInclude);
			ExcludeCommand = new Command(Exclude, CanExclude);
		}
 public ProductSale()
 {
     SaleItems = new ObservableCollection<SaleItem>();
 }
 public RootViewModel()
 {
     _playlist = new ObservableCollection <PlaylistItem>();
 }
 public ExampleView_Base()
 {
     DemoProperties = new ObservableCollection <DemoProperty>();
     DemoProperties.CollectionChanged += DemoProperties_CollectionChanged;
 }
Example #34
0
        private void LoadActivatedCharacter(ManagedCharacter activatedCharacter, string actionGroupName, string actionName)
        {
            this.UnloadPreviousActivatedCharacter();

            this.ActiveCharacter = activatedCharacter;
            if (activatedCharacter != null)
            {
                (activatedCharacter as AnimatedAbility.AnimatedCharacter)?.LoadDefaultAbilities();
                if(this.CharacterActionGroups != null)
                {
                    foreach (var actionGroupVM in this.CharacterActionGroups)
                        actionGroupVM.UnregisterKeyEventHandlers();
                }
                
                this.CharacterActionGroups = new ObservableCollection<CharacterActionGroupViewModel>();
                foreach (CharacterActionGroup group in activatedCharacter.CharacterActionGroups)
                {
                    bool loadedOptionExists = group.Name == actionGroupName;
                    bool showActionsInGroup = false;
                    //if (character.OptionGroupExpansionStates.ContainsKey(group.Name))
                    //    showOptionsInGroup = character.OptionGroupExpansionStates[group.Name];
                    switch (group.Type)
                    {
                        case CharacterActionType.Ability:
                            var abilityActionGroupViewModel = IoC.Get<CharacterActionGroupViewModelImpl<AnimatedAbility.AnimatedAbility>>();
                            abilityActionGroupViewModel.ActionGroup = group;
                            abilityActionGroupViewModel.ShowActions = showActionsInGroup;
                            abilityActionGroupViewModel.IsReadOnly = true;
                            abilityActionGroupViewModel.LoadedActionName = loadedOptionExists ? actionName : "";
                            this.CharacterActionGroups.Add(abilityActionGroupViewModel);
                            break;
                        case CharacterActionType.Identity:
                            var identityActionGroupViewModel = IoC.Get<CharacterActionGroupViewModelImpl<Identity>>();
                            identityActionGroupViewModel.ActionGroup = group; 
                            identityActionGroupViewModel.ShowActions = showActionsInGroup;
                            identityActionGroupViewModel.IsReadOnly = true;
                            identityActionGroupViewModel.LoadedActionName = loadedOptionExists ? actionName : "";
                            this.CharacterActionGroups.Add(identityActionGroupViewModel);
                            break;
                        case CharacterActionType.Movement:
                            var movementActionGroupViewModel = IoC.Get<CharacterActionGroupViewModelImpl<CharacterMovement>>();
                            movementActionGroupViewModel.ActionGroup = group;
                            movementActionGroupViewModel.ShowActions = showActionsInGroup;  
                            movementActionGroupViewModel.IsReadOnly = true;
                            movementActionGroupViewModel.LoadedActionName = loadedOptionExists ? actionName : "";
                            this.CharacterActionGroups.Add(movementActionGroupViewModel);
                            break;
                        case CharacterActionType.Mixed:
                            var mixedActionGroupViewModel = IoC.Get<CharacterActionGroupViewModelImpl<CharacterAction>>();
                            mixedActionGroupViewModel.ActionGroup = group;
                            mixedActionGroupViewModel.ShowActions = showActionsInGroup;
                            mixedActionGroupViewModel.IsReadOnly = true;
                            mixedActionGroupViewModel.LoadedActionName = loadedOptionExists ? actionName : "";
                            this.CharacterActionGroups.Add(mixedActionGroupViewModel);
                            break;
                    }
                }
                this.ActiveCharacter = activatedCharacter;
            }

        }
Example #35
0
 public Player()
 {
     Inventory = new ObservableCollection <GameItem>();
     Quests    = new ObservableCollection <QuestStatus>();
 }
Example #36
0
 public TermsModel()
 {
     ModelUrl = "/terms";
     terms    = new ObservableCollection <KeyValuePair <string, ObservableCollection <string> > >();
 }
Example #37
0
        public MenuCollectionViewModel()
        {
            menuCollection = new ObservableCollection <MenuCollectionModel>();

            sender.Add("Adriana");
            sender.Add("Daleyza");
            sender.Add("Kyle");
            sender.Add("Victoriya");
            sender.Add("Steve");
            sender.Add("Briley");
            sender.Add("Maci");
            sender.Add("Zariah");
            sender.Add("Mckenna");
            sender.Add("Miranda");

            subject.Add("Goto Meeting");
            subject.Add("FW: Status Update");
            subject.Add("Greetings! Congrats");
            subject.Add("Report Monitor");
            subject.Add("News Letter");
            subject.Add("Conference about Latest Technology");
            subject.Add("RE: Status Update");
            subject.Add("Success! Report Automation");
            subject.Add("Monthly Reports Documents");
            subject.Add("Meeting Confirmation");

            subject.Add("Goto Meeting");
            subject.Add("FW: Status Update");
            subject.Add("Greetings! Congrats");
            subject.Add("Report Monitor");
            subject.Add("News Letter");
            subject.Add("Conference about Latest Technology");
            subject.Add("RE: Status Update");
            subject.Add("Success! Report Automation");
            subject.Add("Monthly Reports Documents");
            subject.Add("Meeting Confirmation");
            subject.Add("Goto Meeting");
            subject.Add("FW: Status Update");
            subject.Add("Greetings! Congrats");
            subject.Add("Report Monitor");
            subject.Add("News Letter");
            subject.Add("Conference about Latest Technology");
            subject.Add("RE: Status Update");
            subject.Add("Success! Report Automation");
            subject.Add("Monthly Reports Documents");
            subject.Add("Meeting Confirmation");

            textContent.Add("Join meeting to discuss about daily status, workflow, pending work and improve process");
            textContent.Add("Hi, Please find the today's status");
            textContent.Add("Hi, Congrats you have won the raffle");
            textContent.Add("Do not reply, Please find the attachment. Attachment have the full details of monitor report with timing");
            textContent.Add("Hi, Please find the attached news letter");
            textContent.Add("Hi, We are scheduled a meeting");
            textContent.Add("Thanks for the status report");
            textContent.Add("Do not reply, Automation result will update soon");
            textContent.Add("Hi, All documents are reviewed");
            textContent.Add("Thanks for scheduling the meeting");
            textContent.Add("Join meeting to discuss about daily status, workflow, pending work and improve process");
            textContent.Add("Hi, Please find the today's status");
            textContent.Add("Hi, Congrats you have won the raffle");
            textContent.Add("Do not reply, Please find the attachment. Attachment have the full details of monitor report with timing");
            textContent.Add("Hi, Please find the attached news letter");
            textContent.Add("Hi,We are scheduled a conference meeting");
            textContent.Add("Thanks for the status report");
            textContent.Add("Do not reply, Automation result will update soon");
            textContent.Add("Hi, All documents are reviewed");
            textContent.Add("Thanks for scheduling the meeting");
            textContent.Add("Join meeting to discuss about daily status, workflow, pending work and improve process");
            textContent.Add("Hi, Please find the today's status");
            textContent.Add("Hi, Congrats you have won the raffle");
            textContent.Add("Do not reply, Please find the attachment. Attachment have the full details of monitor report with timing");
            textContent.Add("Hi, Please find the attached news letter");
            textContent.Add("Hi,We are scheduled a conference meeting");
            textContent.Add("Thanks for the status report");
            textContent.Add("Do not reply, Automation result will update soon");
            textContent.Add("Hi, All documents are reviewed");
            textContent.Add("Thanks for scheduling the meeting");

            if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Android)
            {
                menuCollection.Add(getItem("Inbox", "I"));
                menuCollection.Add(getItem("Starred", "R"));
                menuCollection.Add(getItem("Sent mail", "G"));
                menuCollection.Add(getItem("Drafts", "D"));
                menuCollection.Add(getItem("All mail", "A"));
                menuCollection.Add(getItem("Trash", "T"));
                menuCollection.Add(getItem("Spam", "S"));
                menuCollection.Add(getItem("Follow up", "F"));
            }

            if (Device.RuntimePlatform == Device.UWP || (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone))
            {
                this.menuCollection.Add(getItem("Inbox", "\xEDB3"));
                this.menuCollection.Add(getItem("Starred", "\xE208"));
                this.menuCollection.Add(getItem("Sent mail", "\xE120"));
                this.menuCollection.Add(getItem("Drafts", "\xE70B"));
                this.menuCollection.Add(getItem("All mail", "\xE715"));
                this.menuCollection.Add(getItem("Trash", "\xE107"));
                this.menuCollection.Add(getItem("Spam", "\xE10A"));
                this.menuCollection.Add(getItem("Follow up", "\xE290"));
            }
        }
Example #38
0
 public MyOrdersViewModel(IOrderDataService orderDataService)
 {
     _orderDataService = orderDataService;
     MyOrders          = new ObservableCollection <Order>();
 }
 public FibonacciRetracementViewModel()
 {
     Annotations = new ObservableCollection<IAnnotation>();
 }
        private void openFileMenuItem_Click(object sender, RoutedEventArgs e)
        {
            persons.Clear();

            Microsoft.Win32.OpenFileDialog fileDialog = new Microsoft.Win32.OpenFileDialog();
            fileDialog.ShowDialog();

            try
            {
                using (StreamReader reader = new StreamReader(fileDialog.OpenFile()))
                {
                    while (reader.ReadLine() != "#nodes section")
                    {
                        ;
                    }

                    int nodesCount = int.Parse(reader.ReadLine());
                    persons = new ObservableCollection <Person>();

                    for (int i = 0; i < nodesCount; i++)
                    {
                        string   cur     = reader.ReadLine();
                        string[] splited = cur.Split(new char[2] {
                            '{', '}'
                        });
                        Person p = new Person(i)
                        {
                            Name = splited[1]
                        };
                        persons.Add(p);
                    }

                    reader.ReadLine();
                    reader.ReadLine();

                    int edgesCount = int.Parse(reader.ReadLine());

                    for (int i = 0; i < edgesCount; i++)
                    {
                        string   cur     = reader.ReadLine();
                        string[] splited = cur.Split(new char[1] {
                            ' '
                        });

                        int x = int.Parse(splited[0]) - 1, y = int.Parse(splited[1]) - 1;

                        persons[x].Neighbors.Add(persons[y]);
                        persons[y].Neighbors.Add(persons[x]);
                    }
                }
            }

            //File dialog closed without selecting anything
            catch (InvalidOperationException)
            { }

            lastID = persons.Count;

            hasChanged = true;

            BuildGUI();
        }
Example #41
0
 public MarketDataSettingsCache()
 {
     Settings = new ObservableCollection <MarketDataSettings>();
     Settings.CollectionChanged += OnSettingsCollectionChanged;
 }
Example #42
0
 private async void InitializeHomePage() => Events = new ObservableCollection <Event>(await NetworkAPI.GetAllEvents());
Example #43
0
 public StatusDetailSettingsFlyoutModel()
 {
     ActionStatuses = new ObservableCollection<Status>();
     Status = null;
 }
 public ActionCatalogViewModel()
 {
     Catalog = new ObservableCollection <ActionCatalogItem>();
     AddEmptyItem();
 }
Example #45
0
        //误差在ppm_mass_error范围内的误差最小的峰的索引号
        public static int IsInWithPPM2(double mass, int[] mass_inten, double ppm_mass_error, ObservableCollection <PEAK> peaks)
        {
            int start = (int)(mass - mass * ppm_mass_error);
            int end   = (int)(mass + mass * ppm_mass_error);

            if (start <= 0 || end >= Config_Help.MaxMass)
            {
                return(-1);
            }
            double min_mz_error = double.MaxValue;
            int    min_k        = -1;

            for (int k = mass_inten[start - 1]; k < mass_inten[end]; ++k)
            {
                PEAK   peak = (PEAK)(peaks[k]);
                double tmpd = System.Math.Abs((peak.Mass - mass) / mass);
                if (tmpd <= ppm_mass_error && tmpd < min_mz_error)
                {
                    min_mz_error = tmpd;
                    min_k        = k;
                }
            }
            return(min_k);
        }
        private async void CancelOrder(mstr_patient_info patient, bool IsDeleted = false)
        {
            mstr_meal_history meal = null;
            ObservableCollection <mstr_meal_history> dataList = new ObservableCollection <mstr_meal_history>();

            List <mstr_meal_option> list = new List <mstr_meal_option>();
            HttpClient httpClient        = new System.Net.Http.HttpClient();
            string     ss    = Library.KEY_USER_ROLE;
            string     scode = Library.KEY_USER_SiteCode;


            DateTime date = DateTime.ParseExact(patient.meal_order_date, "dd/MM/yy", null);


            //DateTime.TryParse(patient.meal_order_date, out date);

            HttpRequestMessage request = null;

            if (ss == "Nurse")
            {
                request = new HttpRequestMessage(HttpMethod.Get, Library.URL + "/Nurse_Cancel_order/" + patient.ID + "/" + patient.meal_order_id + "/" + date.ToString("dd-MM-yyyy") + "/" + scode);
            }
            else
            {
                request = new HttpRequestMessage(HttpMethod.Get, Library.URL + "/FSA_Cancel_order/" + patient.ID + "/" + patient.meal_order_id + "/" + date.ToString("dd-MM-yyyy") + "/" + scode);
            }

            HttpResponseMessage response = await httpClient.SendAsync(request);

            var data = await response.Content.ReadAsStringAsync();

            JArray jarray = JArray.Parse(data);

            for (int i = 0; i < jarray.Count; i++)
            {
                JObject row = JObject.Parse(jarray[i].ToString());
                meal = new mstr_meal_history
                {
                    orderdate      = row["orderdate"].ToString(),
                    createdby      = row["createdby"].ToString(),
                    mealtimename   = row["mealtimename"].ToString(),
                    Id             = row["Id"].ToString(),
                    mealtimeid     = row["mealtimeid"].ToString(),
                    meal_detail_id = row["meal_detail_id"].ToString(),
                    Cut_Off_time   = row["Cut_Off_time"].ToString(),
                    remarks        = ""
                };
                if (!String.IsNullOrEmpty(row["orderdate"].ToString()))
                {
                    DateTime dt = SelectedDate;
                    if (dt.Date > DateTime.Now.Date)
                    {
                        dataList.Add(meal);
                    }
                    else
                    {
                        DateTime cutDate  = DateTime.ParseExact(row["Cut_Off_time"].ToString(), "HH:mm", CultureInfo.InvariantCulture).ToUniversalTime();
                        DateTime currtime = DateTime.Now.ToUniversalTime();
                        if (currtime >= cutDate)
                        {
                        }
                        else
                        {
                            dataList.Add(meal);
                        }
                    }
                }

                //dbhelper.Insert_INTO_mstr_ingredient(new mstr_ingredient(Convert.ToInt32(row["ID"].ToString()), row["ingredient_name"].ToString(), row["ingredient_description"].ToString(), Convert.ToInt32(row["status_id"].ToString()), row["site_code"].ToString()));
            }
            if (IsDeleted && dataList.Count > 0)
            {
                //   DisplayPatientListOnPatientsearch();
            }
            else if (dataList.Count == 0)
            {
                await PageDialog.DisplayAlertAsync("Alert!!", AppResources.ResourceManager.GetString("nit2", AppResources.Culture), "OK");


                return;
            }
            PatientMealHistoryList = new List <mstr_meal_history>(dataList);

            //commented on 23/08/2017
            //this.clist.ItemsSource = dataList;
            // img_panels.Visibility = Visibility.Visible;



            var a  = PatientMealHistoryList;
            var ui = new CancelOrderPopup(PatientMealHistoryList, PageDialog);

            ui.Disappearing  += Ui_Disappearing;
            ui.BindingContext = patient;
            await navigation.PushPopupAsync(ui, false);
        }
Example #47
0
 public ReservationViewModel()
 {
     // Initialize collections
     courts  = new ObservableCollection <Court>();
     members = new ObservableCollection <Member>();
 }
Example #48
0
 public ValidatableObject()
 {
     _isValid     = true;
     _errors      = new ObservableCollection <string>();
     _validations = new List <IValidationRule <T> >();
 }
 public EntidadesMunicipalesViewModel()
 {
     _entidadesList = new ObservableCollection <EntidadMunicipal>();
     LoadEntidadesMunicipalesCommand = new Command(async() => await ExecuteLoadEntidadesMunicipalesCommand());
 }
Example #50
0
 public IPrompt Get(PromptInfo promptInfo, ObservableCollection <ITreeNode> availableItems, ObservableCollection <ITreeNode> defaultSelections)
 {
     return(new MultiSelectHierarchy(
                promptInfo.Name,
                promptInfo.Label,
                availableItems,
                defaultSelections));
 }
Example #51
0
        public static void parse_charge(ObservableCollection <PEAK> peaks, double max_inten, double inten_t)
        {
            //首先将所有谱峰的电荷清为0
            for (int i = 0; i < peaks.Count; ++i)
            {
                peaks[i].Charge  = 0;
                peaks[i].Is_mono = false;
            }
            max_inten /= 100.0;
            int[] mass_inten = new int[Config_Help.MaxMass];
            for (int k = 0; k < peaks.Count; ++k)
            {
                int massi = (int)peaks[k].Mass;
                mass_inten[massi] = k + 1;
            }
            int currindex = 0;

            for (int k = 0; k < Config_Help.MaxMass; ++k)
            {
                if (mass_inten[k] == 0)
                {
                    mass_inten[k] = currindex;
                }
                else
                {
                    currindex = mass_inten[k];
                }
            }

            bool[] is_mark_flag   = new bool[peaks.Count];
            int    max_charge     = 4;     //最大考虑四电荷的情况
            int    max_num        = 2;     //如果在某根峰后面有连续的二根峰那么则赋值为对应的电荷,否则赋值为0电荷,即不知道电荷
            double ppm_mass_error = 20e-6; //误差为20ppm
            double mass_iso       = Config_Help.mass_ISO;

            for (int i = 0; i < peaks.Count; ++i)
            {
                //if (is_mark_flag[i])
                //    continue;
                if (peaks[i].Intensity * max_inten < inten_t)
                {
                    continue;
                }
                is_mark_flag[i] = true;
                for (int charge = max_charge; charge >= 1; --charge)
                {
                    List <int> isotope_index = new List <int>();
                    double     cur_mass      = peaks[i].Mass + mass_iso / charge;
                    int        index         = IsInWithPPM(cur_mass, mass_inten, ppm_mass_error, peaks);
                    while (index != -1 && peaks[index].Intensity * max_inten >= inten_t)
                    {
                        isotope_index.Add(index);
                        cur_mass += mass_iso / charge;
                        index     = IsInWithPPM(cur_mass, mass_inten, ppm_mass_error, peaks);
                    }
                    if (isotope_index.Count >= max_num)
                    {
                        if (peaks[i].Charge < charge)
                        {
                            peaks[i].Charge  = charge;
                            peaks[i].Is_mono = true;
                        }
                        for (int j = 0; j < isotope_index.Count; ++j)
                        {
                            if (peaks[isotope_index[j]].Charge < charge)
                            {
                                peaks[isotope_index[j]].Charge = charge;
                            }
                            is_mark_flag[isotope_index[j]] = true;
                        }
                    }
                }
            }
        }
Example #52
0
        private async void BtnLoadMore_Clicked(object sender, EventArgs e)
        {
            if (this.btnLoadMore.Text == "点击隐藏!")
            {
                this.skltLoadMore.IsVisible = false;
                this.btnShrink.IsVisible = true;
                art_listView.ScrollTo(StoreSeries.LastOrDefault(), position: ScrollToPosition.End, animated: true);
                return;
            }

            if (this.btnLoadMore.Text == "没有更多数据了!")
            {
                this.btnLoadMore.Text = "点击隐藏!";
                art_listView.ScrollTo(StoreSeries.LastOrDefault(), position: ScrollToPosition.End, animated: true);
                return;
            }

            LoadingStart();

            double itemNumber = StoreSeries.Count / count + 1;

            page = (int)Math.Ceiling(itemNumber);

            StoreSeries = new ObservableCollection<ArticleInfo>(StoreSeries.Union(Paging(page, count, RandomSeries)));

            this.art_listView.ItemsSource = StoreSeries;


            if (Paging(page, count, RandomSeries).Count < count)
            {
                this.btnLoadMore.Text = "加载服务器数据中...";

                string Account = OptionText_Helper.ReadAllText("Account");

                Times++;

                var q = await GetListViewData(Account, Times);

                if (q.Count == 0)
                {
                    this.btnLoadMore.Text = "没有更多数据了!";

                    art_listView.ScrollTo(StoreSeries.LastOrDefault(), position: ScrollToPosition.End, animated: true);

                    LoadingEnd();
                    return;
                }

                foreach (var item in q)
                {
                    RandomSeries.Add(item);
                }

                this.btnLoadMore.Text = "点击加载更多...";

                BtnLoadMore_Clicked(sender, e);

            }

            art_listView.ScrollTo(StoreSeries.LastOrDefault(), position: ScrollToPosition.End, animated: true);

            LoadingEnd();

        }
Example #53
0
 public ObservableCollection <ClassBog> GetAllBooksWhereTheTitleContainsTheseWords(string SøgTekst)
 {
     boeger = GetAllBooksLike(søgTekst);
 }
Example #54
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     ActivityList = DatabaseList();
     OnPropertyChanged("ActivityList");
 }
        public ZoomingAndPanningViewModel()
        {
            MaleData = new ObservableCollection <ChartDataModel>()
            {
                new ChartDataModel(161, 65), new ChartDataModel(150, 65), new ChartDataModel(155, 65), new ChartDataModel(160, 65),
                new ChartDataModel(148, 66), new ChartDataModel(145, 66), new ChartDataModel(137, 66), new ChartDataModel(138, 66),
                new ChartDataModel(162, 66), new ChartDataModel(166, 66), new ChartDataModel(159, 66), new ChartDataModel(151, 66),
                new ChartDataModel(180, 66), new ChartDataModel(181, 66), new ChartDataModel(174, 66), new ChartDataModel(159, 66),
                new ChartDataModel(151, 67), new ChartDataModel(148, 67), new ChartDataModel(141, 67), new ChartDataModel(145, 67),
                new ChartDataModel(165, 67), new ChartDataModel(168, 67), new ChartDataModel(159, 67), new ChartDataModel(183, 67),
                new ChartDataModel(188, 67), new ChartDataModel(187, 67), new ChartDataModel(172, 67), new ChartDataModel(193, 67),
                new ChartDataModel(153, 68), new ChartDataModel(153, 68), new ChartDataModel(147, 68), new ChartDataModel(163, 68),
                new ChartDataModel(174, 68), new ChartDataModel(173, 68), new ChartDataModel(160, 68), new ChartDataModel(191, 68),
                new ChartDataModel(131, 62), new ChartDataModel(140, 62), new ChartDataModel(149, 62), new ChartDataModel(115, 62),
                new ChartDataModel(164, 63), new ChartDataModel(162, 63), new ChartDataModel(167, 63), new ChartDataModel(146, 63),
                new ChartDataModel(150, 64), new ChartDataModel(141, 64), new ChartDataModel(142, 64), new ChartDataModel(129, 64),
                new ChartDataModel(159, 64), new ChartDataModel(158, 64), new ChartDataModel(162, 64), new ChartDataModel(136, 64),
                new ChartDataModel(176, 64), new ChartDataModel(170, 64), new ChartDataModel(167, 64), new ChartDataModel(144, 64),
                new ChartDataModel(143, 65), new ChartDataModel(137, 65), new ChartDataModel(137, 65), new ChartDataModel(140, 65),
                new ChartDataModel(182, 65), new ChartDataModel(168, 65), new ChartDataModel(181, 65), new ChartDataModel(165, 65),
                new ChartDataModel(214, 74), new ChartDataModel(211, 74), new ChartDataModel(166, 74), new ChartDataModel(185, 74),
                new ChartDataModel(189, 68), new ChartDataModel(182, 68), new ChartDataModel(181, 68), new ChartDataModel(196, 68),
                new ChartDataModel(152, 69), new ChartDataModel(173, 69), new ChartDataModel(190, 69), new ChartDataModel(161, 69),
                new ChartDataModel(173, 69), new ChartDataModel(185, 69), new ChartDataModel(141, 69), new ChartDataModel(149, 69),
                new ChartDataModel(134, 62), new ChartDataModel(183, 62), new ChartDataModel(155, 62), new ChartDataModel(164, 62),
                new ChartDataModel(169, 62), new ChartDataModel(122, 62), new ChartDataModel(161, 62), new ChartDataModel(166, 62),
                new ChartDataModel(137, 63), new ChartDataModel(140, 63), new ChartDataModel(140, 63), new ChartDataModel(126, 63),
                new ChartDataModel(150, 63), new ChartDataModel(153, 63), new ChartDataModel(154, 63), new ChartDataModel(139, 63),
                new ChartDataModel(186, 69), new ChartDataModel(188, 69), new ChartDataModel(148, 69), new ChartDataModel(174, 69),
                new ChartDataModel(164, 70), new ChartDataModel(182, 70), new ChartDataModel(200, 70), new ChartDataModel(151, 70),
                new ChartDataModel(204, 74), new ChartDataModel(177, 74), new ChartDataModel(194, 74), new ChartDataModel(212, 74),
                new ChartDataModel(162, 70), new ChartDataModel(200, 70), new ChartDataModel(166, 70), new ChartDataModel(177, 70),
                new ChartDataModel(188, 70), new ChartDataModel(156, 70), new ChartDataModel(175, 70), new ChartDataModel(191, 70),
                new ChartDataModel(174, 71), new ChartDataModel(187, 71), new ChartDataModel(208, 71), new ChartDataModel(166, 71),
                new ChartDataModel(150, 71), new ChartDataModel(194, 71), new ChartDataModel(157, 71), new ChartDataModel(183, 71),
                new ChartDataModel(204, 71), new ChartDataModel(162, 71), new ChartDataModel(179, 71), new ChartDataModel(196, 71),
                new ChartDataModel(170, 72), new ChartDataModel(184, 72), new ChartDataModel(197, 72), new ChartDataModel(162, 72),
                new ChartDataModel(177, 72), new ChartDataModel(203, 72), new ChartDataModel(159, 72), new ChartDataModel(178, 72),
                new ChartDataModel(198, 72), new ChartDataModel(167, 72), new ChartDataModel(184, 72), new ChartDataModel(201, 72),
                new ChartDataModel(167, 73), new ChartDataModel(178, 73), new ChartDataModel(215, 73), new ChartDataModel(207, 73),
                new ChartDataModel(172, 73), new ChartDataModel(204, 73), new ChartDataModel(162, 73), new ChartDataModel(182, 73),
                new ChartDataModel(201, 73), new ChartDataModel(172, 73), new ChartDataModel(189, 73), new ChartDataModel(206, 73),
                new ChartDataModel(150, 74), new ChartDataModel(187, 74), new ChartDataModel(153, 74), new ChartDataModel(171, 74),
            };

            FemaleData = new ObservableCollection <ChartDataModel>()
            {
                new ChartDataModel(115, 57), new ChartDataModel(138, 57), new ChartDataModel(166, 57), new ChartDataModel(122, 57),
                new ChartDataModel(126, 57), new ChartDataModel(130, 57), new ChartDataModel(125, 57), new ChartDataModel(144, 57),
                new ChartDataModel(150, 57), new ChartDataModel(120, 57), new ChartDataModel(125, 57), new ChartDataModel(130, 57),
                new ChartDataModel(103, 58), new ChartDataModel(116, 58), new ChartDataModel(130, 58), new ChartDataModel(126, 58),
                new ChartDataModel(136, 58), new ChartDataModel(148, 58), new ChartDataModel(119, 58), new ChartDataModel(141, 58),
                new ChartDataModel(159, 58), new ChartDataModel(120, 58), new ChartDataModel(135, 58), new ChartDataModel(163, 58),
                new ChartDataModel(119, 59), new ChartDataModel(131, 59), new ChartDataModel(148, 59), new ChartDataModel(123, 59),
                new ChartDataModel(137, 59), new ChartDataModel(149, 59), new ChartDataModel(121, 59), new ChartDataModel(142, 59),
                new ChartDataModel(160, 59), new ChartDataModel(118, 59), new ChartDataModel(130, 59), new ChartDataModel(146, 59),
                new ChartDataModel(119, 60), new ChartDataModel(133, 60), new ChartDataModel(150, 60), new ChartDataModel(133, 60),
                new ChartDataModel(149, 60), new ChartDataModel(165, 60), new ChartDataModel(130, 60), new ChartDataModel(139, 60),
                new ChartDataModel(154, 60), new ChartDataModel(118, 60), new ChartDataModel(152, 60), new ChartDataModel(154, 60),
                new ChartDataModel(130, 61), new ChartDataModel(145, 61), new ChartDataModel(166, 61), new ChartDataModel(131, 61),
                new ChartDataModel(143, 61), new ChartDataModel(162, 61), new ChartDataModel(131, 61), new ChartDataModel(145, 61),
                new ChartDataModel(162, 61), new ChartDataModel(115, 61), new ChartDataModel(149, 61), new ChartDataModel(183, 61),
                new ChartDataModel(121, 62), new ChartDataModel(139, 62), new ChartDataModel(159, 62), new ChartDataModel(135, 62),
                new ChartDataModel(152, 62), new ChartDataModel(178, 62), new ChartDataModel(130, 62), new ChartDataModel(153, 62),
                new ChartDataModel(172, 62), new ChartDataModel(114, 62), new ChartDataModel(135, 62), new ChartDataModel(154, 62),
                new ChartDataModel(126, 63), new ChartDataModel(141, 63), new ChartDataModel(160, 63), new ChartDataModel(135, 63),
                new ChartDataModel(149, 63), new ChartDataModel(180, 63), new ChartDataModel(132, 63), new ChartDataModel(144, 63),
                new ChartDataModel(163, 63), new ChartDataModel(122, 63), new ChartDataModel(146, 63), new ChartDataModel(156, 63),
                new ChartDataModel(133, 64), new ChartDataModel(150, 64), new ChartDataModel(176, 64), new ChartDataModel(133, 64),
                new ChartDataModel(149, 64), new ChartDataModel(176, 64), new ChartDataModel(136, 64), new ChartDataModel(157, 64),
                new ChartDataModel(174, 64), new ChartDataModel(131, 64), new ChartDataModel(155, 64), new ChartDataModel(191, 64),
                new ChartDataModel(136, 65), new ChartDataModel(149, 65), new ChartDataModel(177, 65), new ChartDataModel(143, 65),
                new ChartDataModel(149, 65), new ChartDataModel(184, 65), new ChartDataModel(128, 65), new ChartDataModel(146, 65),
                new ChartDataModel(157, 65), new ChartDataModel(133, 65), new ChartDataModel(153, 65), new ChartDataModel(173, 65),
                new ChartDataModel(141, 66), new ChartDataModel(156, 66), new ChartDataModel(175, 66), new ChartDataModel(125, 66),
                new ChartDataModel(138, 66), new ChartDataModel(165, 66), new ChartDataModel(122, 66), new ChartDataModel(164, 66),
                new ChartDataModel(182, 66), new ChartDataModel(137, 66), new ChartDataModel(157, 66), new ChartDataModel(176, 66),
                new ChartDataModel(149, 67), new ChartDataModel(159, 67), new ChartDataModel(179, 67), new ChartDataModel(156, 67),
                new ChartDataModel(179, 67), new ChartDataModel(186, 67), new ChartDataModel(147, 67), new ChartDataModel(166, 67),
                new ChartDataModel(185, 67), new ChartDataModel(140, 67), new ChartDataModel(160, 67), new ChartDataModel(180, 67),
                new ChartDataModel(145, 68), new ChartDataModel(155, 68), new ChartDataModel(170, 68), new ChartDataModel(129, 68),
                new ChartDataModel(164, 68), new ChartDataModel(189, 68), new ChartDataModel(150, 68), new ChartDataModel(157, 68),
                new ChartDataModel(183, 68), new ChartDataModel(144, 68), new ChartDataModel(170, 68), new ChartDataModel(180, 68)
            };
        }
Example #56
0
 public MockManagerService()
 {
     innerBlogFiles = new ObservableCollection <IBlog>();
     blogFiles      = new ObservableCollection <IBlog>(innerBlogFiles);
     databases      = new ObservableCollection <IFiles>();
 }
Example #57
0
 public SyncMlSession(string sessionId)
 {
     this.SessionId = sessionId;
     this.Messages  = new ObservableCollection <SyncMlMessage>();
     this.DateTime  = DateTime.Now;
 }
Example #58
0
        public CategoriaModel()
        {
            var lista = (new BCategoria().Listar(0));

            Categorias = new ObservableCollection <Categoria>(lista);
        }
Example #59
0
        //误差在ppm_mass_error范围内的最高峰的索引号
        public static int IsInWithPPM(double mass, int[] mass_inten, double ppm_mass_error, ObservableCollection <PEAK> peaks)
        {
            int start = (int)(mass - mass * ppm_mass_error);
            int end   = (int)(mass + mass * ppm_mass_error);

            if (start <= 0 || end >= Config_Help.MaxMass)
            {
                return(-1);
            }
            double maxInten = 0.0;
            int    max_k    = -1;

            for (int k = mass_inten[start - 1]; k < mass_inten[end]; ++k)
            {
                PEAK   peak = (PEAK)(peaks[k]);
                double tmpd = System.Math.Abs((peak.Mass - mass) / mass);
                if (tmpd <= ppm_mass_error && peak.Intensity > maxInten)
                {
                    maxInten = peak.Intensity;
                    max_k    = k;
                }
            }
            return(max_k);
        }
Example #60
0
 /// <summary>
 /// Setups the graph collection and related variables.
 /// </summary>
 private void SetupGraph()
 {
     _data = new ObservableCollection <DataProfile>();
     _refreshCursorPosition = 0;
 }