Example #1
0
 public SnippetController(IGroupRepository grepo, ISnippetRepository snippetSnipRepo, ILanguageRepository languageRepo, IUserRepository uRepo)
 {
     _snipRepo  = snippetSnipRepo;
     _langRepo  = languageRepo;
     _userRepo  = uRepo;
     _groupRepo = grepo;
 }
Example #2
0
 public SnippetService(IDateTime dateTime, ISnippetRepository snippetRepository,
                       ISnippetFileRepository snippetFileRepository)
 {
     _dateTime              = dateTime;
     _snippetRepository     = snippetRepository;
     _snippetFileRepository = snippetFileRepository;
 }
Example #3
0
        public SnippetService(IDateTime dateTime, ISnippetRepository snippetRepository, IUserRepository userRepository)
        {
            _dateTime          = dateTime;
            _snippetRepository = snippetRepository;
            _userRepository    = userRepository;

            hashids = new Hashids("randomSalt", 8);
        }
Example #4
0
 public SnippetService(ISnippetRepository snippetRepository,
                       ISnippetQuery snippetQuery,
                       IPublisher publisher)
 {
     _snippetRepository = snippetRepository;
     _snippetQuery      = snippetQuery;
     _publisher         = publisher;
 }
 public SnippetService(IUserRepository userRepository, ISnippetRepository snippetRepository,
                       ILanguageRepository languageRepository, ITagRepository tagRepository,
                       ISnippetTagRepository snippetTagRepository)
 {
     _userRepository       = userRepository;
     _snippetRepository    = snippetRepository;
     _languageRepository   = languageRepository;
     _tagReposory          = tagRepository;
     _snippetTagRepository = snippetTagRepository;
 }
Example #6
0
        public SnippetsViewModel()
        {
            _snippetRepository = new SnippetRepository();
            _snippetService    = new SnippetService();

            Snippets = new ObservableCollection <Snippet>(
                _snippetRepository.GetAll());

            _snippetService.ApplySnippets(Snippets);

            AddCommand    = new DelegatingCommand(x => true, OnAdd);
            SaveCommand   = new DelegatingCommand(x => true, OnSave);
            DeleteCommand = new DelegatingCommand(x => true, OnDelete);
        }
        public UserService(IMapper mapper, IUserRepository userContext, IUserPasswordEncoder encoder
                           , ISnippetRepository snippetRepository, ILanguageRepository languageRepository,
                           ISnippetTagRepository snippetTagRepository, ITagRepository tagRepository)
        {
            _mapper         = mapper;
            _encoder        = encoder;
            _userRepository = userContext;

            _snippetRepository    = snippetRepository;
            _languageRepository   = languageRepository;
            _snippetRepository    = snippetRepository;
            _snippetTagRepository = snippetTagRepository;
            _tagRepository        = tagRepository;
        }
        private async void InitGrid()
        {
            _repository = new SnippetRepository();
            var items = await _repository.GetAllAsync();

            if (items == null)
            {
                return;
            }

            snippetListView.ItemsSource = items;

            if (_selectedIndex != -1)
            {
                snippetListView.SelectedIndex = _selectedIndex;
            }
        }
        protected async override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState)
        {
            _repository = new SnippetRepository();

            try
            {
                if (navigationParameter != null)
                {
                    var snippetFile = navigationParameter as string;
                    if (string.IsNullOrEmpty(snippetFile))
                    {
                        throw new ArgumentException();
                    }

                    // Lookup the full detail of the selected snippet:
                    _snippet = await _repository.GetSnippetInfoAsync(snippetFile);

                    if (_snippet == null)
                    {
                        throw new ArgumentException();
                    }

                    // Set the WebView's source to be the html version of the snippet
                    webView.Source = new Uri("ms-appx-web:///Snippets/" + _snippet.SnippetFile + ".html");

                    // Register for DataRequested events (Share contract)
                    DataTransferManager.GetForCurrentView().DataRequested += OnDataRequested;
                    _registeredforShare = true;

                    // Read the plain-text version of the snippet...
                    await GetSnippetText();
                }
            }
            catch
            {
                webView.Source = new Uri("ms-appx-web:///Snippets/error.html");
            }
        }
Example #10
0
 public SnippetCollection(ISnippetRepository repo)
 {
     _repo = repo;
     this.AddRange(_repo.GetAllSnippets());
 }
Example #11
0
 public FlagProvider(IFlagRepository flagRepository, ISnippetRepository snippetRepository)
 {
     _flagRepository = flagRepository;
     _snippetRepository = snippetRepository;
 }
 public SnippetService(ISnippetRepository snippetsRepository, IUnitOfWork unitOfWork)
 {
     this.snippetsRepository = snippetsRepository;
     this.unitOfWork = unitOfWork;
 }
Example #13
0
 public SnippetProvider(ISnippetRepository repository)
 {
     _repository = repository;
 }
Example #14
0
 public SnippetsController(ISnippetRepository repository) : base(repository)
 {
 }
Example #15
0
 public HomeController(ILogger <HomeController> logger, ISnippetRepository repo, ISnippetFileService service)
 {
     _logger      = logger;
     _repo        = repo;
     _fileService = service;
 }
 public SnippetManager(ISnippetRepository snippetRepository)
 {
     _snippetRepository = snippetRepository;
 }
Example #17
0
 public SnippetProvider(ISnippetRepository repository)
 {
     _repository = repository;
 }
Example #18
0
 private readonly int voteValue = 1; // maybe give access to this in an options class that can be passed in via the constructor
 public VoteProvider(IVoteRepository voteRepo, ISnippetRepository snippetRepo)
 {
     _voteRepository    = voteRepo;
     _snippetRepository = snippetRepo;
 }
Example #19
0
 public FlagProvider(IFlagRepository flagRepository, ISnippetRepository snippetRepository)
 {
     _flagRepository    = flagRepository;
     _snippetRepository = snippetRepository;
 }
Example #20
0
 public SnippetService(ISnippetRepository snippetsRepository, IUnitOfWork unitOfWork)
 {
     this.snippetsRepository = snippetsRepository;
     this.unitOfWork         = unitOfWork;
 }
Example #21
0
 private void Init()
 {
     _snippetRepository = new SnippetRepository();
     _snippetRepository.LengthyOpStarting += (sender, args) => { ProgressRingSnippets.IsActive = true; };
     _snippetRepository.LengthyOpHasEnded += (sender, args) => { ProgressRingSnippets.IsActive = false; };
 }
 public HomeController(ISnippetRepository snippetRepository, IWebSecurity webSecurity)
 {
     this.snippetRepo = snippetRepository;
     this.webSecurity = webSecurity;
 }
Example #23
0
 private readonly int voteValue = 1; // maybe give access to this in an options class that can be passed in via the constructor
 public VoteProvider(IVoteRepository voteRepo, ISnippetRepository snippetRepo)
 {
     _voteRepository = voteRepo;
     _snippetRepository = snippetRepo;
 }
Example #24
0
 public HomeController(ISnippetRepository repo, IUserRepository urepo)
 {
     _snipRepo = repo;
     _userRepo = urepo;
 }