Ejemplo n.º 1
0
        protected BindableCollection<TreeViewModel> LoadChildren()
        {
            var filer = workspace.Filter ?? "";
            var filterStrings = filer.Split().Select(WildcardToRegex).ToArray();
            var filters = filterStrings.Select(fs=> new Regex(fs, RegexOptions.IgnoreCase)).ToArray();

            var items = new BindableCollection<TreeViewModel>();
            try
            {
              var dirs = directoryInfo.GetDirectories();
              foreach (var dir in dirs)
              {
                  if(filters.Any(f => f.IsMatch(dir.Name)))
                      continue;
                  var folderVm = new FolderViewModel(dir, workspace);
                  items.Add(folderVm);
              }
              var files = directoryInfo.GetFiles();
              foreach (var file in files)
              {
                  if (filters.Any(f => f.IsMatch(file.Name)))
                      continue;
                  var fileVm = new FileViewModel(file);
                  items.Add(fileVm);
              }
            }
            catch (UnauthorizedAccessException ) // Does not have access to the folder cannot iterate.
            { }

            return items;
        }
		public SaleCommandsViewModel(Dp25 ecr, IMessageAggregator messenger)
		{
			_ecr = ecr;
			_messenger = messenger;
			Items = new BindableCollection<SaleItem>();
			Items.CollectionChanged += (sender, args) => NotifyOfPropertyChange(() => CanExecuteCommands);
		}
 public CustomersAndOrdersViewModel(IValidationRepository validationRepository, IOrderDetailsViewModel orderDetailsViewModel)
 {
     this.validationRepository = validationRepository;
     this.orderDetailsViewModel = orderDetailsViewModel;
     var customers = validationRepository.ListDocuments<Customer>();
     Customers = new BindableCollection<Customer>(customers);
 }
Ejemplo n.º 4
0
        public SaleViewModel()
        {
            Items = new BindableCollection<ItemViewModel>();
            IsToolVisible = false;
            PaymentForms = new BindableCollection<AmountItemViewModel>();
            var pco = Observable.FromEventPattern<PropertyChangedEventArgs>(this, "PropertyChanged")
                                .Select(x => x.EventArgs)
                                .Where(x => x.PropertyName == "ViewState")
                                .Select(x => this.ViewState);
            var normal = pco.Where(x => x == "Normal").Select(x => Unit.Default);
            var other = pco.Where(x => x != "Normal").Select(x => Unit.Default);

            Scanner.ObservableKeys
                .Where(x => !char.IsWhiteSpace(x))
                .SkipUntil(normal)
                .Publish(o => o.Buffer(() => o.Throttle(TimeSpan.FromMilliseconds(500))))
                .Select(x => string.Join("", x))
                .TakeUntil(other)
                .Repeat()
                .Subscribe(x =>
                    {
                        AddItem["kodi"] = x;
                        AddItem.Execute(null);
                    });
        }
Ejemplo n.º 5
0
		private ApplicationModel()
		{
			Notifications = new BindableCollection<Notification>(x=>x.Message);
			LastNotification = new Observable<string>();
			Server = new Observable<ServerModel> {Value = new ServerModel()};
		    State = new ApplicationState();
		}
 public EditTemplatesViewModel()
 {
     var info = new DirectoryInfo(_templatesPath);
     _files =
         new BindableCollection<string>(
             info.EnumerateFiles("*.html").Select(fi => fi.Name.Remove(fi.Name.IndexOf('.')).ToUpper()));
 }
Ejemplo n.º 7
0
        public BindableCollection<ModoPago> BuscarModosPago()
        {
            BindableCollection<ModoPago> listaModoPagos = new BindableCollection<ModoPago>(); ;
            SqlConnection conn = new SqlConnection(Properties.Settings.Default.inf245g4ConnectionString);
            SqlCommand cmd = new SqlCommand();
            SqlDataReader reader;

            cmd.CommandText = "SELECT * FROM ModoPago";
            cmd.CommandType = CommandType.Text;
            cmd.Connection = conn;

            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    ModoPago mp = new ModoPago();
                    mp.IdModoPago = reader.IsDBNull(reader.GetOrdinal("idModoPago")) ? -1 : (int)reader["idModoPago"];
                    mp.Nombre = reader.IsDBNull(reader.GetOrdinal("nombre")) ? null : reader["nombre"].ToString();
                    listaModoPagos.Add(mp);
                }

                conn.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.StackTrace.ToString());
            }

            return listaModoPagos;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AdministrationCodeTableService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="errorService">The error service.</param>
 public AdministrationCodeTableService(AdministrationCodeTableDomainContext context, IErrorService errorService)
 {
     _codeTableDomainContext = context;
     _errorService = errorService;
     _groups=new BindableCollection<Group>();
     _userProfessions=new BindableCollection<UserProfession>();
 }
 public EditClearancesViewModel()
 {
     Courses =
         new BindableCollection<CourseViewModel>(
             JsonConvert.DeserializeObject<List<Course>>(File.ReadAllText(_courseDataPath, Encoding.UTF8))
                 .Select(c => new CourseViewModel(c)));
 }
        protected async void ContinueNearestSearchOnUiThread()
        {
            Haltestellen = null;
            NotifyOfPropertyChange(() => Haltestellen);

            var posResult = await _locationService.GetCurrentPosition();

            if (posResult.Succeeded)
            {
                var pos = posResult.Position;
                InfoMessage = String.Format("{0}: {1:F2} {2:F2}", AppResources.PositionMessage_YourPosition, pos.Coordinate.Point.Position.Longitude, pos.Coordinate.Point.Position.Latitude);

                MyLocation = new Wgs84Location(pos.Coordinate);

                var haltestellen = await _dataService.GetNearestHaltestellenAsync(MyLocation);

                if (!haltestellen.Any())
                {
                    InfoMessage = String.Format("{0}: {1:F2} {2:F2}", AppResources.PositionMessage_NoStopsFoundNear,
                        pos.Coordinate.Point.Position.Longitude, pos.Coordinate.Point.Position.Latitude);
                }
                else
                {
                    Haltestellen = new BindableCollection<Haltestelle>(haltestellen.OrderBy(h => h.Distanz));
                    NotifyOfPropertyChange(() => Haltestellen);
                }
            }
            else
            {
                InfoMessage = posResult.ErrorMessage;
            }
        }
Ejemplo n.º 11
0
        public BindableCollection<SubLineaProducto> ObtenerSubLineas(int id)
        {
            db.cmd.CommandText = "SELECT * FROM SubLineaProducto WHERE idLinea=@idLinea";
            db.cmd.Parameters.AddWithValue("idLinea", id);
            SqlDataReader reader;
            BindableCollection<SubLineaProducto> lstSubLinea = new BindableCollection<SubLineaProducto>();
            try
            {
                db.conn.Open();
                reader=db.cmd.ExecuteReader();
                while (reader.Read())
                {
                    SubLineaProducto slp = new SubLineaProducto();
                    slp.IdLinea = id;
                    slp.Nombre=reader["Nombre"].ToString();
                    slp.IdSubLinea = Int32.Parse(reader["IdSubLinea"].ToString());
                    slp.Abreviatura = reader["Abreviatura"].ToString();
                    lstSubLinea.Add(slp);
                }
                db.cmd.Parameters.Clear();
                reader.Close();
                db.conn.Close();

            }
            catch (SqlException e)
            {
                Console.WriteLine(e);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace.ToString());
            }

            return lstSubLinea;
        }
Ejemplo n.º 12
0
		private ServerModel(string url)
		{
			this.url = url;
			Databases = new BindableCollection<DatabaseModel>(model => model.Name);
			SelectedDatabase = new Observable<DatabaseModel>();
			Initialize();
		}
Ejemplo n.º 13
0
 public SearchPresenter(IYearToVerseSearchService searchService, IHebrewNumberConverter hebrewNumberConverter)
 {
     this.searchService = searchService;
     this.hebrewNumberConverter = hebrewNumberConverter;
     jewishYear = new Observable<string>("5770");
     Verses = new BindableCollection<Verse>();
 }
Ejemplo n.º 14
0
 public MainViewModel(INavigationService navigationService, IProductService productService)
     : base(navigationService)
 {
     _productService = productService;
     Title = "Caliburn Demo";
     Products = new BindableCollection<Product>(_productService.GetAll());
 }
		public ShellViewModel(IEventAggregator eventAggregator, MessageHandler messageHandler)
		{
			this.eventAggregator = eventAggregator;
			LogMessages = new BindableCollection<LogEntry>();

			ViewAttached += OnViewAttachedEventHandler;
		}
        public ChartViewModel(ISevenDigitalClient sevenDigitalClient, INavigationService navigationService)
        {
            this.sevenDigitalClient = sevenDigitalClient;
            this.navigationService = navigationService;

            Items = new BindableCollection<ChartItem>();
        }
 public CharitiesViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     _justGivingCharityRepository = new JustGivingCharityRepository();
     Charities = new BindableCollection<Chairty>();
     LoadCharities();
 }
Ejemplo n.º 18
0
		public CollectionsModel()
		{
			ModelUrl = "/collections";
			ApplicationModel.Current.Server.Value.RawUrl = null;
            Collections = new BindableCollection<CollectionModel>(model => model.Name);
            SelectedCollection = new Observable<CollectionModel>();

            DocumentsForSelectedCollection.SetChangesObservable(d =>  d.IndexChanges
                                 .Where(n =>n.Name.Equals(CollectionsIndex,StringComparison.InvariantCulture))
                                 .Select(m => Unit.Default));

		    DocumentsForSelectedCollection.DocumentNavigatorFactory =
		        (id, index) =>
		        DocumentNavigator.Create(id, index, CollectionsIndex,
		                                 new IndexQuery() {Query = "Tag:" + GetSelectedCollectionName()});

            SelectedCollection.PropertyChanged += (sender, args) =>
            {
                PutCollectionNameInTheUrl();
                CollectionSource.CollectionName = GetSelectedCollectionName();

                DocumentsForSelectedCollection.Context = "Collection/" + GetSelectedCollectionName();
            };

		    SortedCollectionsList = new CollectionViewSource()
		    {
		        Source = Collections,
		        SortDescriptions =
		        {
		            new SortDescription("Count", ListSortDirection.Descending)
		        }
		    };
		}
Ejemplo n.º 19
0
        public DateTimeViewModel()
        {
            Days = new BindableCollection<int>();
            Months = new Dictionary<int, string>();
            Years = new BindableCollection<int>();
            Hours = new BindableCollection<int>();
            Minutes = new BindableCollection<int>();

            for (var i = 0; i < 24; i++)
                Hours.Add(i + 1);
            for (var i = 0; i < 60; i++)
                Minutes.Add(i);
            for (var i = DateTime.Now.Year - 20; i < DateTime.Now.Year + 20; i++)
                Years.Add(i);

            SelectedYear = DateTime.Now.Year;

            OnMonthsChanged();

            SelectedDay = DateTime.Now.Day;

            SelectedMonth = Months.Single(c => c.Key == DateTime.Now.Month);

            SelectedHour = DateTime.Now.Hour;
            SelectedMinute = DateTime.Now.Minute;
        }
Ejemplo n.º 20
0
 public SeriesViewModel(Series series)
 {
     _series = series;
     Episodes =
         new BindableCollection<EpisodeViewModel>(
             series.Episodes.Where(e => !e.Watched).Select(e => new EpisodeViewModel(e)).OrderBy(e => e.CodedName));
 }
Ejemplo n.º 21
0
		public MainMenuViewModel()
		{
			Groups = new BindableCollection<MenuGroup>();

			if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled)
			{
				_running = IoC.Get<RunExperimentViewModel>();
				_runThresholdTest = IoC.Get<RunThresholdTestViewModel>();
				_permutations = IoC.Get<PermutationViewModel>();
				_nbsmConfig = IoC.Get<NBSmConfigViewModel>();

				_eventAggregator = IoC.Get<IEventAggregator>();
				_navService = IoC.Get<INavigationService>();
				_regionService = IoC.Get<IRegionService>();
				_subjectService = IoC.Get<ISubjectDataService>();
				_subjectFilterService = IoC.Get<ISubjectFilterService>();
				_computeService = IoC.Get<IComputeService>();

				var regionsVM = IoC.Get<RegionsViewModel>();

				Groups.Add(new MenuGroup { Title = "Source", Items = { regionsVM, IoC.Get<SubjectsViewModel>(), IoC.Get<GroupsViewModel>() } });
				Groups.Add(new MenuGroup { Title = "Config", Items = { _permutations, _nbsmConfig } });
				Groups.Add(new MenuGroup { Title = "Compute", Items = { _runThresholdTest, _running } });
				Groups.Add(new MenuGroup { Title = "Global", Items = { IoC.Get<GlobalStrengthViewModel>() } });
				Groups.Add(new MenuGroup { Title = "Component", Items = { IoC.Get<IntermodalViewModel>(), IoC.Get<IntraSummaryViewModel>()/*, new MenuItem { Title = "Associations" },*/ } });
				Groups.Add(new MenuGroup { Title = "Nodal", Items = { IoC.Get<NodalStrengthDataTypeViewModel>() } });
				Groups.Add(new MenuGroup { Title = "Edge", Items = { IoC.Get<EdgeSignificanceViewModel>() } });
			}
		}
 public DeviceWizard_LocalNetworkViewModel(DeviceInstallationWizardViewModel conductor)
 {
     this._conductor = conductor;
     this._availableClients = new BindableCollection<ClientInfoListItemViewModel>();
     this.IsScanning = false;
     Task.Factory.StartNew(UpdateAvailableClients, TaskCreationOptions.LongRunning);
 }
Ejemplo n.º 23
0
        public ProjectsViewModel(ITeamServicesClient teamServices, IApplicationNavigationService navigation)
        {
            this.teamServices = teamServices;
            this.navigation = navigation;

            Projects = new BindableCollection<ProjectViewModel>();
        }
Ejemplo n.º 24
0
        public InvoicePopupViewModel(IInvoiceService invoiceService, IProductService productService)
        {
            InvoiceService = invoiceService;
            ProductService = productService;

            Items = new BindableCollection<SaleItemViewModel>();
        }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainPageViewModel" /> class.
 /// </summary>
 /// <param name="navigationService">The navigation service.</param>
 public MainPageViewModel(INavigationService navigationService)
     : base(navigationService)
 {
     MainMenuItems = new BindableCollection<MainPageMenuItemViewModel>
     {
         new MainPageMenuItemViewModel
         {
             Text = "Define New Quiz",
             Image = new BitmapImage(new Uri(@"ms-appx:///Assets/DefineQuiz.jpg")),
             NavigateTo = typeof(DefineQuizView)
         },
         new MainPageMenuItemViewModel
         {
             Text = "Edit Existing Quiz",
             Image = new BitmapImage(new Uri(@"ms-appx:///Assets/EditQuiz.jpg")),
             NavigateTo = null // TODO
         },
         new MainPageMenuItemViewModel
         {
             Text = "Take Quiz",
             Image = new BitmapImage(new Uri(@"ms-appx:///Assets/TakeQuiz.jpg")),
             NavigateTo = null // TODO
         },
     };
 }
        public FingerTrackingOptionsViewModel()
        {
            Colors = new BindableCollection<Color>();

            foreach (var property in typeof(Color).GetProperties().Where(p => p.PropertyType == typeof(Color)))
            {
                Colors.Add((Color)property.GetValue(new Color()));
            }

            MinContourArea = 100;
            ConvexHullCW = false;

            ConvexHullColor = Color.Green;
            ContourHighlightColor = Color.Blue;
            DefectStartPointHighlightColor = Color.Violet;
            DefectDepthPointHighlightColor = Color.Black;
            DefectEndPointHighlightColor = Color.Yellow;
            DefectLinesColor = Color.Red;

            SelectedMethod = 2;

            TrackOnlyControlPoint = false;

            if (Execute.InDesignMode)
                LoadDesignTimeData();
        }
 public TypeOfPaymentViewModel(INavigationService navigationService)
     : base(navigationService)
 {
     _navigationService = navigationService;
     _title = "Type of Payment - Step 2/4";
     AvailablePayments = new BindableCollection<PaymentMethod>();
 }
Ejemplo n.º 28
0
 public CalendarWeekViewModel(IWindsorContainer container, IAppointmentService service)
 {
     this.container = container;
     this.appointmentService = service;
     Days = new BindableCollection<DayTileViewModel>();
     BuildUp();
 }
Ejemplo n.º 29
0
		public DatabaseModel(string name, DocumentStore documentStore)
		{
			this.name = name;
			this.documentStore = documentStore;

			Tasks = new BindableCollection<TaskModel>(x => x.Name)
			{
				new ImportTask(),
				new ExportTask(),
				new StartBackupTask(),
				new IndexingTask(),
				new SampleDataTask()
			};

			SelectedTask = new Observable<TaskModel> { Value = Tasks.FirstOrDefault() };
			Statistics = new Observable<DatabaseStatistics>();
			Status = new Observable<string>
			{
				Value = "Offline"
			};

			asyncDatabaseCommands = name.Equals(Constants.SystemDatabase, StringComparison.OrdinalIgnoreCase)
											? documentStore.AsyncDatabaseCommands.ForDefaultDatabase()
											: documentStore.AsyncDatabaseCommands.ForDatabase(name);

		    DocumentChanges.Select(c => Unit.Default).Merge(IndexChanges.Select(c => Unit.Default))
		        .SampleResponsive(TimeSpan.FromSeconds(2))
		        .Subscribe(_ => RefreshStatistics(), exception => ApplicationModel.Current.Server.Value.IsConnected.Value = false);

			RefreshStatistics();
		}
Ejemplo n.º 30
0
		static CollectionsModel()
		{
			Collections = new BindableCollection<CollectionModel>(model => model.Name, new KeysComparer<CollectionModel>(model => model.Count));
			SelectedCollection = new Observable<CollectionModel>();

			SelectedCollection.PropertyChanged += (sender, args) => PutCollectionNameInTheUrl();
		}
Ejemplo n.º 31
0
 protected ElementViewModel()
 {
     _inputConnectors = new BindableCollection <InputConnectorViewModel>();
     _name            = GetType().Name;
 }
Ejemplo n.º 32
0
 public Shop()
 {
     Items      = new BindableCollection <Item>();
     Categories = new BindableCollection <Category>();
 }
Ejemplo n.º 33
0
        public TasksListViewModel()
        {
            var ideasList = Startup.ideasDataTable.ReadAll();

            Ideas = new BindableCollection <Entry>(ideasList);
        }
        // Initializations

        #region Initializations

        public ProjectExplorerViewModel()
        {
            DisplayName  = "Project Explorer";
            ProjectItems = new BindableCollection <ProjectItemBase>();
            MenuItems    = new BindableCollection <MenuItemBase>();
        }
Ejemplo n.º 35
0
 public PrintMegvaltasViewModel(Dolgozo Dolgozo, BindableCollection <Munkaruha> Ruhak)
 {
     this.Dolgozo = Dolgozo;
     this.Ruhak   = Ruhak;
 }
Ejemplo n.º 36
0
        public ShellViewModel()
        {
            DataAccess da = new DataAccess();

            People = new BindableCollection <PersonModel>(da.GetPeople());
        }
        public PresupuestoViewModel()
        {
            IEnumerable <Actividad> enumerableActividades = DatosEjemplo.Actividades;

            actividades = new BindableCollection <Actividad>(enumerableActividades);
        }
Ejemplo n.º 38
0
 private void InitializeClassesList(IList <ClassViewModel> classes = null)
 {
     Classes = new BindableCollection <ClassViewModel>(classes ?? new List <ClassViewModel>());
     Classes.CollectionChanged -= ClassesOnCollectionChanged;
     Classes.CollectionChanged += ClassesOnCollectionChanged;
 }
Ejemplo n.º 39
0
 private void InitializePatchesList(IList <PatchViewModel> patches = null)
 {
     Patches = new BindableCollection <PatchViewModel>(patches ?? new List <PatchViewModel>());
     Patches.CollectionChanged -= PatchesOnCollectionChanged;
     Patches.CollectionChanged += PatchesOnCollectionChanged;
 }
Ejemplo n.º 40
0
 protected MenuItemBase(string name)
 {
     Name     = name;
     Children = new BindableCollection <MenuItemBase>();
 }
Ejemplo n.º 41
0
        public void GenerateRandomNames()
        {
            _firstName = string.Empty;
            _lastname  = string.Empty;
            _affix     = string.Empty;
            _postfix   = string.Empty;

            NameCollection = new BindableCollection <NameTemplate>();
            var tempNameCollection        = new List <NameTemplate>();
            var tempFirstPrefixCollection = new List <NamePrefix>();
            var tempFirstSuffixCollection = new List <NameSuffix>();
            var tempFirstInfixCollection  = new List <NameInfix>();
            var tempLastPrefixCollection  = new List <NamePrefix>();
            var tempLastSuffixCollection  = new List <NameSuffix>();
            var tempLastInfixCollection   = new List <NameInfix>();
            var tempAffixCollection       = new List <NameAffix>();
            var tempPostfixCollection     = new List <NamePostfix>();

            switch (_selectedRace)
            {
            case "Dhampir":
                _selectedRace = "Human";
                break;

            case "Half-Elf":
                _selectedRace = "Elf";
                break;

            default:
                break;
            }

            if (_isMale)
            {
                tempAffixCollection       = new List <NameAffix>(Global.Instance.AffixCollection.Where(x => x.Race == _selectedRace && (x.Sex == "Male" || x.Sex == "Both")));
                tempFirstPrefixCollection = new List <NamePrefix>(Global.Instance.PrefixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "First" && (x.Sex == "Male" || x.Sex == "Both")));
                tempFirstSuffixCollection = new List <NameSuffix>(Global.Instance.SuffixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "First" && (x.Sex == "Male" || x.Sex == "Both")));
                tempFirstInfixCollection  = new List <NameInfix>(Global.Instance.InfixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "First" && (x.Sex == "Male" || x.Sex == "Both")));
                tempLastPrefixCollection  = new List <NamePrefix>(Global.Instance.PrefixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "Last" && (x.Sex == "Male" || x.Sex == "Both")));
                tempLastSuffixCollection  = new List <NameSuffix>(Global.Instance.SuffixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "Last" && (x.Sex == "Male" || x.Sex == "Both")));
                tempLastInfixCollection   = new List <NameInfix>(Global.Instance.InfixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "Last" && (x.Sex == "Male" || x.Sex == "Both")));
                tempPostfixCollection     = new List <NamePostfix>(Global.Instance.PostfixCollection.Where(x => x.Race == _selectedRace && (x.Sex == "Male" || x.Sex == "Both")));
            }
            else
            {
                tempAffixCollection       = new List <NameAffix>(Global.Instance.AffixCollection.Where(x => x.Race == _selectedRace && (x.Sex == "Female" || x.Sex == "Both")));
                tempFirstPrefixCollection = new List <NamePrefix>(Global.Instance.PrefixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "First" && (x.Sex == "Female" || x.Sex == "Both")));
                tempFirstSuffixCollection = new List <NameSuffix>(Global.Instance.SuffixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "First" && (x.Sex == "Female" || x.Sex == "Both")));
                tempFirstInfixCollection  = new List <NameInfix>(Global.Instance.InfixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "First" && (x.Sex == "Female" || x.Sex == "Both")));
                tempLastPrefixCollection  = new List <NamePrefix>(Global.Instance.PrefixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "Last" && (x.Sex == "Female" || x.Sex == "Both")));
                tempLastSuffixCollection  = new List <NameSuffix>(Global.Instance.SuffixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "Last" && (x.Sex == "Female" || x.Sex == "Both")));
                tempLastInfixCollection   = new List <NameInfix>(Global.Instance.InfixCollection.Where(x => x.Race == _selectedRace && x.FirstLast == "Last" && (x.Sex == "Female" || x.Sex == "Both")));
                tempPostfixCollection     = new List <NamePostfix>(Global.Instance.PostfixCollection.Where(x => x.Race == _selectedRace && (x.Sex == "Female" || x.Sex == "Both")));
            }



            for (int i = 0; i <= 100; i++)
            {
                var _fullName = string.Empty;

                if (tempAffixCollection.Count > 0)
                {
                    _affix = tempAffixCollection[rand.Next(0, tempAffixCollection.Count)].Affix;
                }

                if (tempFirstInfixCollection.Count > 0)
                {
                    if (tempFirstPrefixCollection.Count > 0 && tempFirstSuffixCollection.Count > 0)
                    {
                        _firstName = tempFirstPrefixCollection[rand.Next(0, tempFirstPrefixCollection.Count)].Prefix
                                     + tempFirstInfixCollection[rand.Next(0, tempFirstInfixCollection.Count)].Infix
                                     + tempFirstSuffixCollection[rand.Next(0, tempFirstSuffixCollection.Count)].Suffix;
                    }
                }
                else
                {
                    if (tempFirstPrefixCollection.Count > 0 && tempFirstSuffixCollection.Count > 0)
                    {
                        _firstName = tempFirstPrefixCollection[rand.Next(0, tempFirstPrefixCollection.Count)].Prefix
                                     + tempFirstSuffixCollection[rand.Next(0, tempFirstSuffixCollection.Count)].Suffix;
                    }
                }

                if (tempLastInfixCollection.Count > 0)
                {
                    if (tempLastPrefixCollection.Count > 0 && tempLastSuffixCollection.Count > 0)
                    {
                        _lastname = tempLastPrefixCollection[rand.Next(0, tempLastPrefixCollection.Count)].Prefix
                                    + tempLastInfixCollection[rand.Next(0, tempLastInfixCollection.Count)].Infix
                                    + tempLastSuffixCollection[rand.Next(0, tempLastSuffixCollection.Count)].Suffix;
                    }
                }
                else
                {
                    if (tempLastPrefixCollection.Count > 0 && tempLastSuffixCollection.Count > 0)
                    {
                        _lastname = tempLastPrefixCollection[rand.Next(0, tempLastPrefixCollection.Count)].Prefix
                                    + tempLastSuffixCollection[rand.Next(0, tempLastSuffixCollection.Count)].Suffix;
                    }
                }

                if (tempPostfixCollection.Count > 0)
                {
                    _postfix = tempPostfixCollection[rand.Next(0, tempPostfixCollection.Count)].Postfix;
                }

                if (AffixChecked)
                {
                    _fullName += _affix + " ";
                }

                if (FirstNameChecked)
                {
                    _fullName += _firstName;
                }

                if (FirstNameChecked && LastNameChecked)
                {
                    _fullName += " ";
                }

                if (LastNameChecked)
                {
                    _fullName += _lastname;
                }

                if (PostfixChecked)
                {
                    _fullName += " " + _postfix;
                }

                tempNameCollection.Add(new NameTemplate
                {
                    Affix     = _affix,
                    FirstName = _firstName,
                    LastName  = _lastname,
                    Postfix   = _postfix,
                    FullName  = _fullName
                });
            }

            NameCollection = new BindableCollection <NameTemplate>(tempNameCollection);
        }
Ejemplo n.º 42
0
 public ShellViewModel()
 {
     ElectronicElements = new BindableCollection <ElectronicElement>();
     windowManager      = new WindowManager();
 }
Ejemplo n.º 43
0
 public CompletionPopupViewModel()
 {
     this.completionItems = new BindableCollection <ICompletionItem>();
     Observers            = new List <IEventObserver <IPopupEvent, ICancellablePopupEvent, CompletionPopupView> >();
 }
        public CronogramaViewModel()
        {
            IEnumerable <Trabajo> enumerableTrabajos = DatosEjemplo.Trabajos;

            trabajos = new BindableCollection <Trabajo>(enumerableTrabajos);
        }
Ejemplo n.º 45
0
 public ListRoomViewModel()
 {
     ExistingRooms = new BindableCollection <RoomModel>(GlobalConfig.Connection.GetRoom_All());
 }
Ejemplo n.º 46
0
        public InitPapers()
        {
            peperList = new BindableCollection <Types>
            {
                new Types()
                {
                    id        = 1,
                    Type      = "papers1",
                    listSises = new BindableCollection <Sizes>()
                    {
                        new Sizes()
                        {
                            id       = 1,
                            SizeText = "jdsgkdjf",
                        },

                        new Sizes()
                        {
                            id       = 3,
                            SizeText = "sizes3",
                        },
                        new Sizes()
                        {
                            id       = 5,
                            SizeText = "5",
                        },

                        new Sizes()
                        {
                            id       = 3,
                            SizeText = "sizes3",
                        }
                    }
                },
                new Types()
                {
                    id        = 2,
                    Type      = "papers 2",
                    listSises = new BindableCollection <Sizes>()
                    {
                        new Sizes()
                        {
                            id       = 1,
                            SizeText = "sizes1",
                        },

                        new Sizes()
                        {
                            id       = 3,
                            SizeText = "sizes3",
                        },
                        new Sizes()
                        {
                            id       = 2,
                            SizeText = "sizes2",
                        },

                        new Sizes()
                        {
                            id       = 3,
                            SizeText = "sizes3",
                        }
                    }
                }
            };
        }
 public BindableCollectionMemoryTarget()
 {
     _messages       = new BindableCollection <LogEventInfo>();
     _limit          = 100;
     MinimumLogLevel = LogLevel.Info;
 }
        protected override Task OnInitializeAsync(CancellationToken cancellationToken)
        {
            Items = new BindableCollection <IOverviewItem>();

            return(Task.CompletedTask);
        }
Ejemplo n.º 49
0
 /// <summary>
 ///     Add the license of the libraries and software we use.
 /// </summary>
 private async void AddLicenses()
 {
     try
     {
         var tmpList = new List <License>
         {
             new License
             {
                 LicenseHeaderText  = "Simple DNSCrypt",
                 LicenseText        = await LoadLicense("SimpleDNSCrypt.txt").ConfigureAwait(false),
                 LicenseRegularLink = new LicenseLink
                 {
                     LinkText = "simplednscrypt.org",
                     LinkUri  = new Uri("https://simplednscrypt.org/")
                 },
                 LicenseCodeLink = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/bitbeans/SimpleDnsCrypt")
                 }
             },
             new License
             {
                 LicenseHeaderText  = "dnscrypt-proxy",
                 LicenseText        = await LoadLicense("dnscrypt-proxy.txt").ConfigureAwait(false),
                 LicenseRegularLink = new LicenseLink
                 {
                     LinkText = "dnscrypt.info",
                     LinkUri  = new Uri("https://dnscrypt.info/")
                 },
                 LicenseCodeLink = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/jedisct1/dnscrypt-proxy")
                 }
             },
             new License
             {
                 LicenseHeaderText  = "Caliburn.Micro",
                 LicenseText        = await LoadLicense("Caliburn.Micro.txt").ConfigureAwait(false),
                 LicenseRegularLink = new LicenseLink
                 {
                     LinkText = "caliburnmicro.com",
                     LinkUri  = new Uri("https://caliburnmicro.com/")
                 },
                 LicenseCodeLink = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/Caliburn-Micro/Caliburn.Micro")
                 }
             },
             new License
             {
                 LicenseHeaderText  = "MahApps.Metro",
                 LicenseText        = await LoadLicense("MahApps.Metro.txt").ConfigureAwait(false),
                 LicenseRegularLink = new LicenseLink
                 {
                     LinkText = "mahapps.com [http]",
                     LinkUri  = new Uri("http://mahapps.com/")
                 },
                 LicenseCodeLink = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/MahApps/MahApps.Metro")
                 }
             },
             new License
             {
                 LicenseHeaderText = "YamlDotNet",
                 LicenseText       = await LoadLicense("YamlDotNet.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/aaubry/YamlDotNet")
                 }
             },
             new License
             {
                 LicenseHeaderText = "Nett",
                 LicenseText       = await LoadLicense("Nett.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/paiden/Nett")
                 }
             },
             new License
             {
                 LicenseHeaderText  = "Newtonsoft.Json",
                 LicenseText        = await LoadLicense("Newtonsoft.Json.txt").ConfigureAwait(false),
                 LicenseRegularLink = new LicenseLink
                 {
                     LinkText = "www.newtonsoft.com",
                     LinkUri  = new Uri("https://www.newtonsoft.com/json")
                 },
                 LicenseCodeLink = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/JamesNK/Newtonsoft.Json")
                 }
             },
             new License
             {
                 LicenseHeaderText = "WPFLocalizationExtension",
                 LicenseText       = await LoadLicense("WPFLocalizationExtension.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/SeriousM/WPFLocalizationExtension")
                 }
             },
             new License
             {
                 LicenseHeaderText = "XAMLMarkupExtensions",
                 LicenseText       = await LoadLicense("XAMLMarkupExtensions.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/MrCircuit/XAMLMarkupExtensions")
                 }
             },
             new License
             {
                 LicenseHeaderText = "minisign-net",
                 LicenseText       = await LoadLicense("minisign-net.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/bitbeans/minisign-net")
                 }
             },
             new License
             {
                 LicenseHeaderText = "libsodium-net",
                 LicenseText       = await LoadLicense("libsodium-net.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/adamcaudill/libsodium-net")
                 }
             },
             new License
             {
                 LicenseHeaderText = "Costura.Fody",
                 LicenseText       = await LoadLicense("Costura.Fody.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/Fody/Costura")
                 }
             },
             new License
             {
                 LicenseHeaderText = "Fody",
                 LicenseText       = await LoadLicense("Fody.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/Fody/Fody")
                 }
             },
             new License
             {
                 LicenseHeaderText = "helper-net",
                 LicenseText       = await LoadLicense("helper-net.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/bitbeans/helper-net")
                 }
             },
             new License
             {
                 LicenseHeaderText = "ControlzEx",
                 LicenseText       = await LoadLicense("ControlzEx.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/ControlzEx/ControlzEx")
                 }
             },
             new License
             {
                 LicenseHeaderText = "Baseclass.Contrib.Nuget.Output",
                 LicenseText       = await LoadLicense("Baseclass.Contrib.Nuget.Output.txt").ConfigureAwait(false),
                 LicenseCodeLink   = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/baseclass/Contrib.Nuget")
                 }
             },
             new License
             {
                 LicenseHeaderText  = "NLog",
                 LicenseText        = await LoadLicense("NLog.txt").ConfigureAwait(false),
                 LicenseRegularLink = new LicenseLink
                 {
                     LinkText = "nlog-project.org [http]",
                     LinkUri  = new Uri("http://nlog-project.org/")
                 },
                 LicenseCodeLink = new LicenseLink
                 {
                     LinkText = LocalizationEx.GetUiString("about_view_on_github", Thread.CurrentThread.CurrentCulture),
                     LinkUri  = new Uri("https://github.com/nlog/NLog")
                 }
             }
         };
         var orderedList = tmpList.OrderBy(l => l.LicenseHeaderText);
         _licenses = new BindableCollection <License>(orderedList);
     }
     catch (Exception)
     {
     }
 }
 /// <summary>
 /// Get a List of all Dogs that are stored in the Database so far.
 /// </summary>
 /// <returns>
 /// Returns the List and shows it in the available dogs list
 /// </returns>
 private BindableCollection <DogModel> WireUpLists()
 {
     return(AvailableDogs = new BindableCollection <DogModel>(GlobalConfig.Connection.Get_DogsAll()));
 }
Ejemplo n.º 51
0
 public DialogViewModel()
 {
     Buttons = new BindableCollection <int>(Enumerable.Range(1, 3));
 }
Ejemplo n.º 52
0
 // Constructor for DishViewModel
 public DishViewModel(MenuManager menuManager)
 {
     SelectedMenuManager = menuManager;
     //SelectedMenu = menu;
     DishesBinded = new BindableCollection <Dish>(menuManager.AllDishes);
 }
Ejemplo n.º 53
0
        public Task HandleAsync(ServersUpdated message, CancellationToken cancellationToken)
        {
            Servers = new BindableCollection <MenuItem>(ReInitServers(StorageRepository.GetServersList().FindAll() ?? new List <Server>(), ServerClicked));

            return(Task.CompletedTask);
        }
Ejemplo n.º 54
0
 public DictionaryViewModel()
 {
     Genres       = new BindableCollection <GenreWrapper>();
     Conditions   = new BindableCollection <ConditionWrapper>();
     ProductTypes = new BindableCollection <ProductTypeWrapper>();
 }
Ejemplo n.º 55
0
        public ShellViewModel()
        {
            ((IActivate)this).Activate();

            _tools = new BindableCollection <ITool>();
        }
Ejemplo n.º 56
0
 public QueryPlanTraceViewModel(IEventAggregator eventAggregator, IGlobalOptions globalOptions) : base(eventAggregator, globalOptions)
 {
     _physicalQueryPlanRows = new BindableCollection <PhysicalQueryPlanRow>();
     _logicalQueryPlanRows  = new BindableCollection <LogicalQueryPlanRow>();
 }
Ejemplo n.º 57
0
        public SettingsViewModel(
            IConfigurationProvider configurationProvider,
            IAutostartProvider autostartProvider,
            IWindowManager windowManager,
            IProcessStartProvider processStartProvider,
            IAssemblyProvider assemblyProvider,
            IApplicationState applicationState,
            ISyncThingManager syncThingManager)
        {
            this.configurationProvider = configurationProvider;
            this.autostartProvider     = autostartProvider;
            this.windowManager         = windowManager;
            this.processStartProvider  = processStartProvider;
            this.assemblyProvider      = assemblyProvider;
            this.applicationState      = applicationState;
            this.syncThingManager      = syncThingManager;

            this.MinimizeToTray      = this.CreateBasicSettingItem(x => x.MinimizeToTray);
            this.NotifyOfNewVersions = this.CreateBasicSettingItem(x => x.NotifyOfNewVersions);
            this.CloseToTray         = this.CreateBasicSettingItem(x => x.CloseToTray);
            this.ObfuscateDeviceIDs  = this.CreateBasicSettingItem(x => x.ObfuscateDeviceIDs);
            this.UseComputerCulture  = this.CreateBasicSettingItem(x => x.UseComputerCulture);
            this.UseComputerCulture.RequiresSyncTrayzorRestart = true;
            this.DisableHardwareRendering = this.CreateBasicSettingItem(x => x.DisableHardwareRendering);
            this.DisableHardwareRendering.RequiresSyncTrayzorRestart = true;

            this.ShowTrayIconOnlyOnClose = this.CreateBasicSettingItem(x => x.ShowTrayIconOnlyOnClose);
            this.ShowSynchronizedBalloonEvenIfNothingDownloaded = this.CreateBasicSettingItem(x => x.ShowSynchronizedBalloonEvenIfNothingDownloaded);
            this.ShowDeviceConnectivityBalloons = this.CreateBasicSettingItem(x => x.ShowDeviceConnectivityBalloons);

            this.StartSyncThingAutomatically = this.CreateBasicSettingItem(x => x.StartSyncthingAutomatically);
            this.SyncthingPriorityLevel      = this.CreateBasicSettingItem(x => x.SyncthingPriorityLevel);
            this.SyncthingPriorityLevel.RequiresSyncthingRestart = true;
            this.SyncthingUseDefaultHome = this.CreateBasicSettingItem(x => !x.SyncthingUseCustomHome, (x, v) => x.SyncthingUseCustomHome = !v);
            this.SyncthingUseDefaultHome.RequiresSyncthingRestart = true;
            this.SyncThingAddress = this.CreateBasicSettingItem(x => x.SyncthingAddress, new SyncThingAddressValidator());
            this.SyncThingAddress.RequiresSyncthingRestart = true;
            this.SyncThingApiKey = this.CreateBasicSettingItem(x => x.SyncthingApiKey, new SyncThingApiKeyValidator());
            this.SyncThingApiKey.RequiresSyncthingRestart = true;

            this.CanReadAutostart  = this.autostartProvider.CanRead;
            this.CanWriteAutostart = this.autostartProvider.CanWrite;
            if (this.autostartProvider.CanRead)
            {
                var currentSetup = this.autostartProvider.GetCurrentSetup();
                this.StartOnLogon   = currentSetup.AutoStart;
                this.StartMinimized = currentSetup.StartMinimized;
            }

            this.SyncThingCommandLineFlags = this.CreateBasicSettingItem(
                x => String.Join(" ", x.SyncthingCommandLineFlags),
                (x, v) =>
            {
                IEnumerable <KeyValuePair <string, string> > envVars;
                KeyValueStringParser.TryParse(v, out envVars, mustHaveValue: false);
                x.SyncthingCommandLineFlags = envVars.Select(item => KeyValueStringParser.FormatItem(item.Key, item.Value)).ToList();
            }, new SyncThingCommandLineFlagsValidator());
            this.SyncThingCommandLineFlags.RequiresSyncthingRestart = true;


            this.SyncThingEnvironmentalVariables = this.CreateBasicSettingItem(
                x => KeyValueStringParser.Format(x.SyncthingEnvironmentalVariables),
                (x, v) =>
            {
                IEnumerable <KeyValuePair <string, string> > envVars;
                KeyValueStringParser.TryParse(v, out envVars);
                x.SyncthingEnvironmentalVariables = new EnvironmentalVariableCollection(envVars);
            }, new SyncThingEnvironmentalVariablesValidator());
            this.SyncThingEnvironmentalVariables.RequiresSyncthingRestart = true;

            this.SyncthingDenyUpgrade = this.CreateBasicSettingItem(x => x.SyncthingDenyUpgrade);
            this.SyncthingDenyUpgrade.RequiresSyncthingRestart = true;

            var configuration = this.configurationProvider.Load();

            foreach (var settingItem in this.settings)
            {
                settingItem.LoadValue(configuration);
            }

            this.FolderSettings = new BindableCollection <FolderSettings>();
            if (syncThingManager.State == SyncThingState.Running)
            {
                this.FolderSettings.AddRange(configuration.Folders.OrderByDescending(x => x.ID).Select(x => new FolderSettings()
                {
                    FolderName = x.ID,
                    IsWatched  = x.IsWatched,
                    IsNotified = x.NotificationsEnabled,
                }));
            }

            foreach (var folderSetting in this.FolderSettings)
            {
                folderSetting.Bind(s => s.IsWatched, (o, e) => this.UpdateAreAllFoldersWatched());
                folderSetting.Bind(s => s.IsNotified, (o, e) => this.UpdateAreAllFoldersNotified());
            }

            this.PriorityLevels = new BindableCollection <LabelledValue <SyncThingPriorityLevel> >()
            {
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_AboveNormal, SyncThingPriorityLevel.AboveNormal),
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_Normal, SyncThingPriorityLevel.Normal),
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_BelowNormal, SyncThingPriorityLevel.BelowNormal),
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_Idle, SyncThingPriorityLevel.Idle),
            };

            this.Bind(s => s.AreAllFoldersNotified, (o, e) =>
            {
                if (this.updatingFolderSettings)
                {
                    return;
                }

                this.updatingFolderSettings = true;

                foreach (var folderSetting in this.FolderSettings)
                {
                    folderSetting.IsNotified = e.NewValue.GetValueOrDefault(false);
                }

                this.updatingFolderSettings = false;
            });

            this.Bind(s => s.AreAllFoldersWatched, (o, e) =>
            {
                if (this.updatingFolderSettings)
                {
                    return;
                }

                this.updatingFolderSettings = true;

                foreach (var folderSetting in this.FolderSettings)
                {
                    folderSetting.IsWatched = e.NewValue.GetValueOrDefault(false);
                }

                this.updatingFolderSettings = false;
            });

            this.UpdateAreAllFoldersWatched();
            this.UpdateAreAllFoldersNotified();
        }
        public ListadoTrabajosViewModel()
        {
            IEnumerable <Trabajo> enumerableTrabajos = DatosEjemplo.Trabajos;

            trabajos = new BindableCollection <Trabajo>(enumerableTrabajos);
        }
Ejemplo n.º 59
0
 public RarListViewModel()
 {
     this.DisplayName = "Video List";
     FileList         = new BindableCollection <RarListItem>();
 }
Ejemplo n.º 60
0
 public ExportSchedulesViewModel(List <Schedule> schedules, string exportDir)
 {
     Schedules = new BindableCollection <Schedule>(schedules);
     ExportDir = exportDir;
 }