static void Main(string[] args) { // Start-up information System.Console.WriteLine("Starting client..."); System.Console.WriteLine("Current identity: " + WindowsIdentity.GetCurrent().Name); // Configure the remoting runtime RemotingConfiguration.Configure( AppDomain.CurrentDomain.SetupInformation.ConfigurationFile); // Instanciate the type try { IPersonFactory personCreator = RemotingHelper.CreateProxy(typeof(IPersonFactory)) as IPersonFactory; Person p = personCreator.GetPerson(); System.Console.WriteLine("Got the person: {0} {1} {2}", p.Firstname, p.Lastname, p.Age); System.Console.ReadLine(); } catch (Exception ex) { System.Console.WriteLine("Exception occured: " + ex.Message); } System.Console.WriteLine("Press key to stop..."); System.Console.Read(); }
public PersonService(IPersonRepository pr, IPersonFactory pf, IUserRepository ur, IUserFactory uf) { this.PersonRepository = pr; this.PersonFactory = pf; this.UserRepository = ur; this.UserFactory = uf; }
public SessionViewModel(SessionModel model ,IPersonFactory<Person> personFactory) { _model = model.ThrowIfNull("model"); _personFactory = personFactory.ThrowIfNull("personFactory"); AddNewPersonCommand = new ReactiveCommand(); AddNewPersonCommand.Subscribe(dontcare => _model.Participants.Add(_personFactory.GetNewPerson(Participants.Count))); Participants = _model.Participants .CreateDerivedCollection(x => new ParticipantViewModel(x)); Participants.ChangeTrackingEnabled = true; var deleteCanExecute = Observable.Merge(Participants.ItemChanged .Select(_ => Participants.Any(p => p.IsSelected)), Participants.CollectionCountChanged .Select(_ => Participants.Any(p=> p.IsSelected))); DeleteSelectedCommand = new ReactiveCommand ( deleteCanExecute ); DeleteSelectedCommand.Subscribe( x => { RemoveSelected(); } ); AddNewPersonCommand.Execute(null); }
/// <summary> /// Создаёт персонажа. /// </summary> /// <returns> Возвращает созданного персонажа. </returns> private static IPerson CreateStartPerson(string personSchemeSid, IPersonFactory personFactory, IFraction fraction) { var startPerson = personFactory.Create(personSchemeSid, fraction); return(startPerson); }
public MovieService(IContext context, IRequestMessageProvider requestMessageProvider, ICustomException customException, IMovieFactory movieFactory, ICategoryFactory categoryFactory, IPersonFactory personFactory) : base(context, requestMessageProvider, customException) { _movieFactory = movieFactory; _categoryFactory = categoryFactory; _personFactory = personFactory; }
public void ThrowArgumentNullException_IfPassedPersonFactoryIsNull() { var mockedEngine = new Mock <IEngine>(); IPersonFactory personFactory = null; var message = Assert.Throws <ArgumentNullException>(() => new CreateStudentCommand(mockedEngine.Object, personFactory)).Message; Assert.IsTrue(message.Contains("personFactory")); }
/// <summary> /// Initializes a new instance of the <see cref="PersonService" /> class. /// </summary> /// <param name="personRepository">The person repository.</param> /// <param name="personFactory">The person factory.</param> /// <param name="verificationRepository">The verification repository.</param> /// <param name="emailService">The email service.</param> /// <param name="profileService">The profile service.</param> public PersonService(IPersonRepository personRepository, IPersonFactory personFactory, IUserVerificationRepository verificationRepository, IEmailService emailService, IProfileService profileService) { this.personRepository = personRepository; this.personFactory = personFactory; this.verificationRepository = verificationRepository; this.emailService = emailService; this.profileService = profileService; }
public PersonHandler( IEntityRepository<IEndowmentEntity> entityRepository, IPersonRepository personRepository, IPersonFactory personFactory) { _entityRepository = entityRepository; _personRepository = personRepository; _personFactory = personFactory; }
public World(IPopulation pop, IPersonFactory pf, IRandomGenerator random, IMortalityCurve mc) { _mortalityCurve = mc; _registeredGenes = new GeneBank(this); WorldSeeds.BaseGenes(_registeredGenes, this); _population = pop; _personFactory = pf; _random = random; SeedWorld(1001); }
public AddPersonDialogueViewModel(IPersonFactory personFactory = null) { AddPersonCommand = new CustomCommand(AddPerson, (o) => { return(true); }); CancelAddPersonCommand = new CustomCommand(CancelAddPerson, (o) => { return(true); }); m_personFactory = personFactory ?? new PersonFactory(); Name = ""; Phone = ""; Address = ""; IsActive = true; }
public NationalUnityEventService( IPersonFactory personFactory, IDice dice, IActorTaskSource <ISectorTaskSourceContext> actorTaskSource, IUserTimeProvider userTimeProvider) { _personFactory = personFactory; _dice = dice; _actorTaskSource = actorTaskSource; _userTimeProvider = userTimeProvider; }
public MainWindowViewModel(IDialogService dialogService = null, IPersonListViewModel personListVM = null, IPersonParser parser = null, IPersonFactory factory = null, IFileProxy fileProxy = null, IFileWrapper wrapper = null) { m_dialogService = dialogService ?? new DialogService.DialogService(null); PersonListVM = personListVM ?? new PersonListViewModel(); m_factory = factory ?? new PersonFactory(); m_fileWrapper = wrapper ?? new FileWrapper(); m_fileProxy = fileProxy; m_parser = parser ?? new PersonParser(factory); HaveLoadedPeople = false; LoadCommands(); }
public World(IPopulation pop, IPersonFactory pf, IMortalityCurve mortalityCurve, IRandomGenerator random) { if (pop?.Populus?.Count > 0) pop.Populus.Clear(); _random = random; _population = pop; _registeredGenes = new GeneBank(this); _personFactory = pf; _mortalityCurve = mortalityCurve; WorldSeeds.BaseGenes(_registeredGenes, this); SeedWorld(1000); _population?.UpdatePopulus(); }
public CreateStudentCommand(IEngine engine, IPersonFactory personFactory) { if (engine == null) { throw new ArgumentNullException("engine"); } this.engine = engine; if (personFactory == null) { throw new ArgumentNullException("personFactory"); } this.personFactory = personFactory; }
public PersonFactory(PersonSpecifications specs) { if (specs.alignment == "Hero") { _factory = new HeroFactory(); } else if (specs.alignment == "Villain") { _factory = new VillainFactory(); } else { _factory = new AntiHeroFactory(); } _specs = specs; }
public FestiTimerContext( DbContextOptions options, IEmployerFactory employerFactory, IPersonFactory personFactory, IContractFactory contractFactory, IWorkscheduleFactory workscheduleFactory, IJobFactory jobFactory, IWorkshiftFactory workshiftFactory) : base(options) { EmployerFactory = employerFactory; PersonFactory = personFactory; ContractFactory = contractFactory; WorkscheduleFactory = workscheduleFactory; JobFactory = jobFactory; WorkshiftFactory = workshiftFactory; Database.EnsureCreated(); }
public RollbarDataFactory(IRootPathProvider rootPathProvider, IPersonFactory personFactory) { _rootPathProvider = rootPathProvider; _personFactory = personFactory; }
public AddPersonCommandHandler(IPersonRepository personRepository, IPersonFactory personFactory) { this._personRepository = personRepository; this._personFactory = personFactory; }
public MyTestClass(IPersonFactory personFactory) { _personFactory = personFactory; }
public AddPersonCommand(IPersonFactory personFactory, IPersonalRepository repository, ILocalPersonalCollection localPersonalCollection) { _personFactory = personFactory; _personalRepository = repository; _localPersonalCollection = localPersonalCollection; }
public HumanPersonInitializer(IPersonFactory personFactory, IPlayer player) { _personFactory = personFactory ?? throw new ArgumentNullException(nameof(personFactory)); _player = player ?? throw new ArgumentNullException(nameof(player)); }
public AutoPersonInitializer(IPersonFactory personFactory) { _personFactory = personFactory; }
public PersonService(IPersonRepository personRepository, IPersonFactory personFactory, IUserRepository userRepository) { _personRepository = personRepository; _personFactory = personFactory; _userRepository = userRepository; }
public ListEmployeesCommand(IPersonFactory personFactory, IEmployeeRepository employees, IWriter writer) { this.employees = employees ?? throw new ArgumentNullException("employees"); this.writer = writer ?? throw new ArgumentNullException("writer"); }
public Person(IPersonFactory IPF) { this.IPF = IPF; Arm = IPF.CreateArm(); }
public PersonService(IPersonFactory personFactory) { _personFactory = personFactory; }
public SomethingThatNeedsNamedInstance(IPersonFactory factory) { this._factory = factory; // regular DI greedy constructor, setup in registry. }
public CreateUserCommand(IPersonFactory personFactory, IUserRepository users, IWriter writer) { this.personFactory = personFactory ?? throw new ArgumentNullException("personFactory"); this.users = users ?? throw new ArgumentNullException("users"); this.writer = writer ?? throw new ArgumentNullException("writer"); }
public School(IPersonFactory factory) { _director = factory.CreateDirector(); }
public RecordsController(IPersonFactory personFactory) { _personFactory = personFactory; }
public Building(IPersonFactory factory) { _administrator = factory.CreateAdministrator(); }
public AutoPersonInitializer(IPersonFactory personFactory) { _pilgrimFraction = new Fraction(START_FACTION_NAME); _personFactory = personFactory; }
public PersonDomainService(IPersonRepository personRepository, IPersonFactory personFactory) { _personRepository = personRepository; _personFactory = personFactory; }
public PersonParser(IPersonFactory personFactory = null) { m_personFactory = personFactory ?? new PersonFactory(); }
public Population(IPersonFactory pf) { _populus = new HashSet<IPerson>(); _personFactory = pf; }
public CreatePersonHandler(IPersonFactory personFactory, IPersonRepository personRepository) { _personFactory = personFactory; _personRepository = personRepository; }
public CalculationPreviewService(CalculationPreviewRuleProvider ruleProvider, IPersonFactory personFactory) { _ruleProvider = ruleProvider; _personFactory = personFactory; }
public Personuser(IConfiguration configuration, IPersonFactory personFactory) { Person person = personFactory.Create(configuration.Name); }
public PersonService(IAppUnitOfWork uow, IPersonFactory personFactory) { _uow = uow; _personFactory = personFactory; }