예제 #1
0
        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();
        }
예제 #2
0
 public PersonService(IPersonRepository pr, IPersonFactory pf, IUserRepository ur, IUserFactory uf)
 {
     this.PersonRepository = pr;
     this.PersonFactory = pf;
     this.UserRepository = ur;
     this.UserFactory = uf;
 }
예제 #3
0
        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);
        }
예제 #4
0
        /// <summary>
        /// Создаёт персонажа.
        /// </summary>
        /// <returns> Возвращает созданного персонажа. </returns>
        private static IPerson CreateStartPerson(string personSchemeSid, IPersonFactory personFactory,
                                                 IFraction fraction)
        {
            var startPerson = personFactory.Create(personSchemeSid, fraction);

            return(startPerson);
        }
예제 #5
0
 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;
 }
예제 #8
0
 public PersonHandler(
     IEntityRepository<IEndowmentEntity> entityRepository,
     IPersonRepository personRepository,
     IPersonFactory personFactory)
 {
     _entityRepository = entityRepository;
     _personRepository = personRepository;
     _personFactory = personFactory;
 }
예제 #9
0
 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);
 }
예제 #10
0
 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;
 }
예제 #11
0
 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();
 }
예제 #13
0
 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;
        }
예제 #15
0
 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;
 }
예제 #16
0
 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;
 }
예제 #18
0
 public AddPersonCommandHandler(IPersonRepository personRepository, IPersonFactory personFactory)
 {
     this._personRepository = personRepository;
     this._personFactory    = personFactory;
 }
 public MyTestClass(IPersonFactory personFactory)
 {
     _personFactory = personFactory;
 }
예제 #20
0
 public AddPersonCommand(IPersonFactory personFactory, IPersonalRepository repository, ILocalPersonalCollection localPersonalCollection)
 {
     _personFactory           = personFactory;
     _personalRepository      = repository;
     _localPersonalCollection = localPersonalCollection;
 }
예제 #21
0
 public HumanPersonInitializer(IPersonFactory personFactory, IPlayer player)
 {
     _personFactory = personFactory ?? throw new ArgumentNullException(nameof(personFactory));
     _player        = player ?? throw new ArgumentNullException(nameof(player));
 }
예제 #22
0
 public AutoPersonInitializer(IPersonFactory personFactory)
 {
     _personFactory = personFactory;
 }
예제 #23
0
 public PersonService(IPersonRepository personRepository, IPersonFactory personFactory, IUserRepository userRepository)
 {
     _personRepository = personRepository;
     _personFactory    = personFactory;
     _userRepository   = userRepository;
 }
예제 #24
0
 public ListEmployeesCommand(IPersonFactory personFactory, IEmployeeRepository employees, IWriter writer)
 {
     this.employees = employees ?? throw new ArgumentNullException("employees");
     this.writer    = writer ?? throw new ArgumentNullException("writer");
 }
예제 #25
0
 public Person(IPersonFactory IPF)
 {
     this.IPF = IPF;
     Arm = IPF.CreateArm();
 }
예제 #26
0
파일: Program.cs 프로젝트: dmohl/FSharpIoC
 public PersonService(IPersonFactory personFactory)
 {
     _personFactory = personFactory;
 }
예제 #27
0
 public SomethingThatNeedsNamedInstance(IPersonFactory factory)
 {
     this._factory = factory;   // regular DI greedy constructor, setup in registry.
 }
예제 #28
0
 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");
 }
예제 #29
0
 public School(IPersonFactory factory)
 {
     _director = factory.CreateDirector();
 }
예제 #30
0
 public RecordsController(IPersonFactory personFactory)
 {
     _personFactory = personFactory;
 }
예제 #31
0
 public Building(IPersonFactory factory)
 {
     _administrator = factory.CreateAdministrator();
 }
예제 #32
0
        public AutoPersonInitializer(IPersonFactory personFactory)
        {
            _pilgrimFraction = new Fraction(START_FACTION_NAME);

            _personFactory = personFactory;
        }
예제 #33
0
 public PersonDomainService(IPersonRepository personRepository, IPersonFactory personFactory)
 {
     _personRepository = personRepository;
     _personFactory    = personFactory;
 }
예제 #34
0
 public PersonParser(IPersonFactory personFactory = null)
 {
     m_personFactory = personFactory ?? new PersonFactory();
 }
예제 #35
0
 public Population(IPersonFactory pf)
 {
     _populus = new HashSet<IPerson>();
     _personFactory = pf;
 }
예제 #36
0
 public CreatePersonHandler(IPersonFactory personFactory, IPersonRepository personRepository)
 {
     _personFactory    = personFactory;
     _personRepository = personRepository;
 }
예제 #37
0
 public CalculationPreviewService(CalculationPreviewRuleProvider ruleProvider, IPersonFactory personFactory)
 {
     _ruleProvider  = ruleProvider;
     _personFactory = personFactory;
 }
예제 #38
0
 public Personuser(IConfiguration configuration, IPersonFactory personFactory)
 {
     Person person = personFactory.Create(configuration.Name);
 }
예제 #39
0
 public PersonService(IAppUnitOfWork uow, IPersonFactory personFactory)
 {
     _uow           = uow;
     _personFactory = personFactory;
 }