示例#1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(INoteRepository noteRepository, ICategoryRepository categoryRepository)
        {
            _noteRepository = noteRepository;
            _categoryRepository = categoryRepository;

            Notes = new ObservableCollection<Note>(_noteRepository.FindAll());
            Categories = new ObservableCollection<Category>(_categoryRepository.FindAll());

            // Is there categories list empty?
            if (Categories.Count == 0)
            {
                // In this case, I will create a default category with a welcome note
                var cat = new Category(Resources.Strings.GeneralCat, "#33CC00", "#FFFFFF");
                Categories.Add(cat);
                _categoryRepository.SaveAll(Categories);

                var note = new Note(Resources.Strings.WelcomeMessage, cat);
                Notes.Add(note);
                _noteRepository.Save(note);
            }

            ActualNote = new Note();
            SelectedCategory = _categories[0]; // We need to this for Category's ComboBox sake.
            Trash = new Category("Trash", "#f8f8f8", "#777777");

            AddNoteCommand = new RelayCommand(AddNote, CanAddNote);
            EditNoteCommand = new RelayCommand<Note>(EditNote);
            DeleteNoteCommand = new RelayCommand<Note>(DeleteNote);
            DeleteAllNotesCommand = new RelayCommand(DeleteAllNotes);
            CategoryOptionsCommand = new RelayCommand(OpenCategoryOptions);

            // We expect a message with some lists with changes.
            Messenger.Default.Register<CategoryEditorChangesMessage>(this, MakingNewCatChanges);
        }
        public override void OnCreate()
        {
            base.OnCreate();

            //NoteRepository = new StandardNoteRepository(this);
            NoteRepository = new OrmNoteRepository(this);
        }
示例#3
0
        public MainWindow()
        {
            InitializeComponent();

            myNote = new NoteViewModel();
            tbxNote.DataContext = myNote;
            tbxNoteEdit.DataContext = myNote;
            this._repository = new EFNoteRepository();

            dataGrid_load(dataGrid1, DateTime.Today);

            for (int k = 0; k < 24; k++)
            {
                cboHoursEventStart.Items.Add(k.ToString("00"));
                cboHoursEventFinish.Items.Add(k.ToString("00"));

                cboHoursEditStart.Items.Add(k.ToString("00"));
                cboHoursEditFinish.Items.Add(k.ToString("00"));
            }

            for (int k = 0; k < 60; k++)
            {
                cboMinutesEventStart.Items.Add(k.ToString("00"));
                cboMinutesEventFinish.Items.Add(k.ToString("00"));

                cboMinutesEditStart.Items.Add(k.ToString("00"));
                cboMinutesEditFinish.Items.Add(k.ToString("00"));
            }
        }
示例#4
0
        public NotePresenter(INoteView view, INoteRepository repository)
        {
            _view = view;
            _view.Presenter = this;
            _repository = repository;

            LoadNotes();
        }
示例#5
0
        public NoteService(INoteRepository noteRepository, IReferenceGenerator referenceGenerator)
        {
            Check.If(noteRepository).IsNotNull();
            Check.If(referenceGenerator).IsNotNull();

            _noteRepository = noteRepository;
            _referenceGenerator = referenceGenerator;
        }
 public NoteManager(INoteRepository repo, IUserRepository userRepo, ITaskListManager mgr, INotificationManager notify,
     IUserListsRepository userNotesRepo, IListUsersRepository noteUsersRepo)
 {
     _repository = repo;
     _userRepository = userRepo;
     _taskListManager = mgr;
     _noticationMgr = notify;
     _userNotesRepo = userNotesRepo;
     _noteUsersRepo = noteUsersRepo;
 }
示例#7
0
        public TasqueObjectFactory(ITaskListRepository taskListRepo,
			ITaskRepository taskRepo, INoteRepository noteRepo = null)
        {
            if (taskListRepo == null)
                throw new ArgumentNullException ("taskListRepo");
            if (taskRepo == null)
                throw new ArgumentNullException ("taskRepo");
            this.taskListRepo = taskListRepo;
            this.taskRepo = taskRepo;
            this.noteRepo = noteRepo;
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            NoteRepository = new AdoNoteRepository();

            _window = new UIWindow (UIScreen.MainScreen.Bounds);

            _navigationController = new UINavigationController();
            _navigationController.PushViewController(new NoteListViewController(), false);

            _window.RootViewController = _navigationController;

            _window.MakeKeyAndVisible ();

            return true;
        }
示例#9
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public NoteViewModel(INoteRepository noteRepository, IHistoryNavigationService navigationService, IProgressService progressService)
        {
            _noteRepository = noteRepository;
            _navigationService = navigationService;
            _progressService = progressService;
            
            _saveNoteCommand = new LoadingRelayCommand(SaveNote, () => CanSaveNote);
            _removeNoteCommand = new LoadingRelayCommand(RemoveNote);

            _removeNoteCommand.AddDependentCommand(_saveNoteCommand);
            _saveNoteCommand.AddDependentCommand(_removeNoteCommand);

            if (IsInDesignMode)
            {
                ActiveNote = noteRepository.GetCollections()[0].CompletedNotes[0];
            }
        }
 public ApplicationDetailsService(IApplicationRepository applicationRepository, IBankAgencyRepository bankAgencyRepository, IApplicantRepository applicantRepository,
     IEmploymentRepository employmentRepository, IAddressRepository addressRepository, IContactRepository contactRepository,
     IBankAccountRepository bankAccountRepository, IBankCardRepository bankCardRepository, INoteRepository noteRepository, IDocumentRepository documentRepository,
     IReasonRepository reasonRepository, IActionLogRepository actionLogRepository)
 {
     _applicationRepository = applicationRepository;
     _bankAgencyRepository = bankAgencyRepository;
     _applicantRepository = applicantRepository;
     _employmentRepository = employmentRepository;
     _addressRepository = addressRepository;
     _contactRepository = contactRepository;
     _bankAccountRepository = bankAccountRepository;
     _bankCardRepository = bankCardRepository;
     _noteRepository = noteRepository;
     _documentRepository = documentRepository;
     _reasonRepository = reasonRepository;
     _actionLogRepository = actionLogRepository;
 }
示例#11
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(INoteRepository noteRepository, IProgressService progressService, IHistoryNavigationService navigationService)
        {
            _noteRepository = noteRepository;
            _progressService = progressService;
            _navigationService = navigationService;

            _refreshCommand = new LoadingRelayCommand(Refresh);
            _addNoteCommand = new LoadingRelayCommand(AddNote, () => CanAddNote);
            _removeNote = new LoadingRelayCommand<NoteModel>(RemoveNote);
            _toggleCompleted = new LoadingRelayCommand<NoteModel>(ToggleCompleted);

            NoteCollections = noteRepository.GetCollections();
            NoteCollections.CollectionChanged += NoteCollectionsOnCollectionChanged;
            if (IsInDesignMode)
            {
                ActiveCollection = NoteCollections[0];
            }

            _removeNoteCollection = new LoadingRelayCommand<NoteCollectionModel>(RemoveNoteCollection, CanRemoveNoteCollection);
            _saveNoteCollection = new LoadingRelayCommand<NoteCollectionModel>(SaveNoteCollection, CanSaveNoteCollection);
            _addNoteCollectionCommand = new LoadingRelayCommand(AddNoteCollection, () => CanAddNoteCollection);
            _selectNoteCommand = new RelayCommand<NoteModel>(SelectNote);
        }
 public NotificationRepository(IUserRepository userRepo, ITaskListRepository listRepo, INoteRepository noteRepo)
 {
     _userRepository = userRepo;
     _listRepository = listRepo;
     _noteRepository = noteRepo;
 }
示例#13
0
 public NoteService(INoteRepository repo)
 {
     this.repo = repo;
 }
示例#14
0
 public MemoService(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
 public NoteController(INoteRepository repository)
 {
     _repository = repository;
 }
示例#16
0
 public HomeController(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
示例#17
0
 public NoteServiceImpl(INoteRepository noteRepository)
 {
     this.NoteRepository = noteRepository;
 }
 public NoteService(INoteRepository repositary)
 {
     _repositary = repositary;
 }
示例#19
0
 public NoteService(IMapper mapper, INoteRepository noteRepository) : base(mapper)
 {
     base.InitializeBase(noteRepository);
 }
示例#20
0
 public NeckService(INoteRepository noteRepository, ITuningRepository tuningRepository)
 {
     _noteRepository   = noteRepository;
     _tuningRepository = tuningRepository;
 }
 public RemaindersController(IOptions <AppSettings> appSettings, INoteRepository context)
 {
     _appSettings = appSettings.Value;
     _context     = context;
 }
示例#22
0
 public ScaleRepository(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
示例#23
0
 public NoteBL()
 {
     this.noteRepository = new NoteRepository();
 }
 // intialise this repo with a dependency injection
 public TodoController(INoteRepository _noteRepo)
 {
     this.noteRepo = _noteRepo;
 }
 public NotesController(ITaskRepository taskRepository, INoteRepository noteRepository)
 {
     this.taskRepository = taskRepository;
     this.noteRepository = noteRepository;
 }
示例#26
0
 public CreateNoteCommandHandler(INoteRepository noteRepository, IMediator mediator, IHttpContextAccessor httpContextAccessor)
 {
     _noteRepository      = noteRepository;
     _mediator            = mediator;
     _httpContextAccessor = httpContextAccessor;
 }
示例#27
0
 public NoteService(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetNotesHandler"/> class.
 /// </summary>
 /// <param name="noteRepository">An instance of <see cref="INoteRepository"/> to interact with the notes.</param>
 /// <param name="mapper">The mapper.</param>
 /// <exception cref="ArgumentNullException">noteRepository</exception>
 public GetNotesHandler(INoteRepository noteRepository, IMapper mapper)
 {
     _noteRepository = noteRepository ?? throw new ArgumentNullException(nameof(noteRepository));
     _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
示例#29
0
 public NoteController(INoteRepository iNoteRepository)
 {
     _iNoteRepository = iNoteRepository;
 }
示例#30
0
 public NotesController(ILogger <NotesController> logger, INoteRepository repository)
 {
     _logger     = logger;
     _repository = repository;
 }
示例#31
0
        protected static DTO.GetNotesResponse GetStoredNotes(INoteRepository note_repo)
        {
            var notes = new List<DTO.DTONote> ();
            var stored_notes = note_repo.Engine.GetNotes ();

            foreach (var kvp in stored_notes) {
                var note = kvp.Value.ToDTONote ();

                // if we have a sync revision, set it
                if (note_repo.Manifest.NoteRevisions.Keys.Contains (note.Guid)) {
                    note.LastSyncRevision = note_repo.Manifest.NoteRevisions [note.Guid];
                }

                notes.Add (note);
            }

            var return_notes = new DTO.GetNotesResponse ();
            return_notes.Notes = notes;
            return_notes.LatestSyncRevision = note_repo.Manifest.LastSyncRevision;

            return return_notes;
        }
 public NoteDataService()
 {
     this._noteRepository      = (INoteRepository)Mvx.get_IoCProvider().Resolve <INoteRepository>();
     this._settingsDataService = (ISettingsDataService)Mvx.get_IoCProvider().Resolve <ISettingsDataService>();
 }
示例#33
0
 public NoteEntryPage()
 {
     InitializeComponent();
     noteRepository = new NoteRepository();
     BindingContext = new Note();
 }
示例#34
0
 public NoteService(INoteRepository noteRepository, IRepository <User> userRepository)
 {
     _noteRepository = noteRepository;
     _userRepository = userRepository;
 }
示例#35
0
        public void Initialize(IPreferences preferences)
        {
            if (preferences == null)
                throw new ArgumentNullException ("preferences");
            if (IsInitialized)
                return;

            // Establish connection to backend
            // Nothing to do for Dummy Backend

            // Setup repos
            noteRepo = new NoteRepository (this);
            taskListRepo = new TaskListRepository (this);
            taskRepo = new TaskRepository (this);

            // Setup TasqueObjectFactory
            Factory = new TasqueObjectFactory (
                taskListRepo, taskRepo, noteRepo);

            IsConfigured = true;
            IsInitialized = true;
            if (Initialized != null)
                Initialized (this, EventArgs.Empty);
        }
 public HomeController(INoteRepository repository, IConfiguration config)
 {
     _noteRepository = repository;
 }
示例#37
0
 //
 // GET: /Navigation/
 public MenuController(INoteRepository paramRepo)
 {
     repository = paramRepo;
 }
示例#38
0
 /*
  * Use constructor Injection to inject all required dependencies.
  */
 public NoteService(INoteRepository repository, ICategoryRepository category, IReminderRepository reminder)
 {
     noteRepo     = repository;
     categoryRepo = category;
     reminderRepo = reminder;
 }
示例#39
0
 public NotesController(NoteContext context)
 {
     _context        = context;
     _noteRepository = new NoteRepository(_context);
 }
 public NoteRepositoryTests()
 {
     _sut = Substitute.For <INoteRepository>();
 }
示例#41
0
 public NoteDomain()
 {
     _noteRepository = new NoteRepository();
 }
示例#42
0
 public NotesController(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
示例#43
0
 public NotesController(ICommandInvoker commandInvoker, INoteRepository noteRepository, IUserRepository userRepository)
 {
     this.commandInvoker = commandInvoker;
     this.userRepository = userRepository;
     this.noteRepository = noteRepository;
 }
示例#44
0
 public WhatsNewViewComponent(INoteRepository repository)
 {
     _repository = repository;
 }
 public ListUsersRepository(IUserRepository userRepository, ITaskListRepository taskListRepository, INoteRepository noteRepository)
 {
     _userRepository = userRepository;
     _taskListRepository = taskListRepository;
     _noteRepository = noteRepository;
 }
示例#46
0
 public NoteService(INoteRepository noteRepository)
 {
     NoteRepository = noteRepository;
 }
示例#47
0
 /// <summary>
 /// Constructs the Note service using Structure Map to inject the required repositories
 /// </summary>
 /// <param name="noteRepository">The SM Injected note repository.</param>
 /// <param name="boardRepository">The SM INjected board repository.</param>
 public NoteService(INoteRepository noteRepository, IBoardRepository boardRepository)
 {
     _noteRepository = noteRepository;
     _boardRepository = boardRepository;
 }
示例#48
0
 public NotesTests()
 {
     repo = new TestNoteRepo();
 }
示例#49
0
 public NoteLogic(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
示例#50
0
 public NoteService(INoteRepository noteRepository, ITriageRepository triageRepository, ITicketRepository ticketRepository)
 {
     this.noteRepository   = noteRepository;
     this.ticketRepository = ticketRepository;
     this.triageRepository = triageRepository;
 }
示例#51
0
 public NoteManager()
 {
     Repository = IoC.Instance.Resolve<INoteRepository>();
 }
示例#52
0
 public NoteAPIController(INoteRepository noteRepository, INoteTypeRepository noteTypeRepository)
 {
     _noteRepository     = noteRepository;
     _noteTypeRepository = noteTypeRepository;
 }
示例#53
0
 public override void OnCreate()
 {
     base.OnCreate();
     NoteRepository = new NoteRepository (this);
 }
 public SystemController(INoteRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
 public NoteController()
 {
     _repository = new NoteRepository();
 }
示例#56
0
 public NoteDeleteHandler(INoteRepository noteRepository,
                          IGroupRepository groupRepository)
 {
     _noteRepository  = noteRepository;
     _groupRepository = groupRepository;
 }
示例#57
0
 public CategoryList(INoteRepository repo)
 {
     repository = repo;
 }
        public void Setup()
        {
            _mockDbSettings.Setup(x => x.ConnectionString).Returns("TestConectionString");
            _mockContext.Setup(x => x.Notes).Returns(_mockDbSet.Object);
            _mockContext.Setup(x => x.SaveChanges()).Returns(1);
            _mockNoteMapper.Setup(x => x.Map(It.IsAny<Note>(), It.IsAny<Note>()));

            _noteRepository = new NoteRepository(_mockContext.Object, _mockNoteMapper.Object);
        }
示例#59
0
 public NoteController(INoteRepository db, IPermissionChecker userDb)
 {
     this.db = db;
     this.userDb = userDb;
 }
示例#60
0
 public MartenDataStore(IDocumentStore documentStore)
 {
     session = documentStore.LightweightSession();
     notes   = new NoteRepository(session);
 }