Example #1
0
 public CharacterViewModels(IChatManager chatManager, ICharacterManager characterManager, IApiManager apiManager, CharacterListProvider characterListProvider)
 {
     this.chatManager           = chatManager;
     this.characterManager      = characterManager;
     this.apiManager            = apiManager;
     this.characterListProvider = characterListProvider;
 }
 public CharacterManager(IChatManager chatManager, IApiManager apiManager)
 {
     this.chatManager             = chatManager;
     this.apiManager              = apiManager;
     OnlineCharacters             = new FilteringObservableList <Character, StatusEnum>(characterList, x => x.Status, x => x != StatusEnum.Offline);
     chatManager.CommandReceived += HandleServerCommand;
 }
 public AppServiceController(IApiRequestHelper apiRequestHelper, IApiManager apiManager, IServiceManager serviceManager, IHttpClientFactory clientFactory) : base(apiRequestHelper)
 {
     _apiRequestHelper = apiRequestHelper;
     _apiManager       = apiManager;
     _serviceManager   = serviceManager;
     _clientFactory    = clientFactory;
 }
Example #4
0
 public CurrencyCalc(IApiManager connector)
 {
     _connector           = connector;
     _availableCurrencies = _connector.GetAvailableCurrencies()[0].Rates;
     _availableCurrencies.Add(new AvailableCurrency {
         Code = "PLN", Currency = "Polish Zloty"
     });
 }
 /// <summary>
 /// Creates a GKE step complete with behavior and visuals.
 /// </summary>
 public GkeStepContent(
     IPublishDialog publishDialog,
     IGkeDataSource dataSource        = null,
     IApiManager apiManager           = null,
     Func <Project> pickProjectPrompt = null) : this()
 {
     ViewModel = new GkeStepViewModel(dataSource, apiManager, pickProjectPrompt, publishDialog);
 }
Example #6
0
        public BasePageViewModel()
        {
#if MOCK
            Api = new ApiMockManager();
#else
            Api = new ApiManager();
#endif
        }
Example #7
0
        private async Task OnEnableApiCommand()
        {
            IApiManager apiManager = s_getApiManagerFunc(_selectedProject.ProjectId);
            await apiManager.EnableServicesAsync(s_requiredApis);

            NeedsApiEnabled = false;
            await RepositoriesAsync.StartListRepoTaskAsync(_selectedProject.ProjectId);
        }
Example #8
0
 public IndexModel(IOptions <FXZOptions> options,
                   IStoreProviderFactory storeProviderFactory,
                   IApiManager apiManager)
 {
     _options       = options;
     _apiManager    = apiManager;
     _storeProvider = storeProviderFactory.CreateStoreProvider();
 }
 public FriendStatusViewModel(IApiManager apiManager, string localCharacter, string remoteCharacter, int?requestId, StatusEnum status)
 {
     this.apiManager      = apiManager;
     this.remoteCharacter = remoteCharacter;
     LocalCharacterName   = localCharacter;
     RequestId            = requestId;
     Init(status);
 }
Example #10
0
 public AppEnvironment(IKeyManager keyManager, IServiceManager serviceManager, IRoleManager roleManager, IApiManager apiManager, IStringLocalizer <IAppEnvironment> stringLocalizer)
 {
     _keyManager      = keyManager;
     _serviceManager  = serviceManager;
     _roleManager     = roleManager;
     _apiManager      = apiManager;
     _stringLocalizer = stringLocalizer;
 }
Example #11
0
 public ApiKeyValidator(KeySecretValidator keySecretValidator, IStringLocalizer <ApiKeyValidator> localizer, ILogger <ApiKeyValidator> logger, IApiManager apiManager, IKeyManager keyManager, IServiceManager serviceManager)
 {
     _keySecretValidator = keySecretValidator;
     _localizer          = localizer;
     _logger             = logger;
     _apiManager         = apiManager;
     _keyManager         = keyManager;
     _serviceManager     = serviceManager;
 }
        private GceStepViewModel(GceStepContent content, IGceDataSource dataSource, IApiManager apiManager)
            : base(apiManager)
        {
            _content    = content;
            _dataSource = dataSource;

            ManageCredentialsCommand = new ProtectedCommand(OnManageCredentialsCommand, canExecuteCommand: false);
            EnableApiCommand         = new ProtectedAsyncCommand(OnEnableApiCommandAsync);
        }
 public TestPublishDialogStep(
     IApiManager apiManager,
     Func <GcpProject> pickProjectPrompt,
     IPublishDialog publishDialog) : base(
         apiManager, pickProjectPrompt,
         publishDialog)
 {
     PublishCommand = Mock.Of <IProtectedCommand>();
 }
Example #14
0
        public ViewModelBase(INavigationService navigationService, IPageDialogService pageDialogService,
                             IDeviceService deviceService)
        {
            _pageDialogService = pageDialogService;
            _deviceService     = deviceService;
            _navigationService = navigationService;

            ApiManager = new ApiManager(makeUpApi);
        }
Example #15
0
 public Script(IApiManager apiManager, IChatManager chatManager, IChannelManager channelManager, ICharacterManager characterManager, IEventManager eventManager, IMessageManager messageManager)
 {
     this.apiManager       = apiManager;
     this.chatManager      = chatManager;
     this.channelManager   = channelManager;
     this.characterManager = characterManager;
     this.eventManager     = eventManager;
     this.messageManager   = messageManager;
 }
Example #16
0
 public HomeController(
     ILogger <HomeController> logger,
     IHttpRequestHelper httpRequestHelper,
     IApiManager apiManager)
 {
     _logger              = logger;
     _httpRequestHelper   = httpRequestHelper;
     _apiService          = apiManager.ApiService;
     _genelParaWebService = apiManager.GenelParaWebService;
 }
Example #17
0
 public ViewModelBase(INavigationService navigationService, IApiManager apiManager)
 {
     NavigationService         = navigationService;
     ApiManager                = apiManager;
     NavigateCommand           = new DelegateCommand <string>(Navigate);
     AbsoluteNavigationCommand = new DelegateCommand <string>(AbsoluteNavigation);
     BackCommand               = new DelegateCommand(NavigateBack);
     PopToRootCommand          = new DelegateCommand(PopToRoot);
     ModalNavigateCommand      = new DelegateCommand <string>(ModalNavigate);
 }
 /// <summary>
 /// Creates a new step instance. This method will also create the necessary view and conect both
 /// objects together.
 /// </summary>
 public FlexStepContent(
     IPublishDialog publishDialog,
     IGaeDataSource dataSource                 = null,
     IApiManager apiManager                    = null,
     Func <Project> pickProjectPrompt          = null,
     Func <Task <bool> > setAppRegionAsyncFunc = null) : this()
 {
     ViewModel = new FlexStepViewModel(
         dataSource, apiManager, pickProjectPrompt, setAppRegionAsyncFunc, publishDialog);
 }
        private GkeStepViewModel(GkeStepContent content, IGkeDataSource dataSource, IApiManager apiManager)
            : base(apiManager)
        {
            _content    = content;
            _dataSource = dataSource;

            CreateClusterCommand       = new ProtectedCommand(OnCreateClusterCommand, canExecuteCommand: false);
            RefreshClustersListCommand = new ProtectedCommand(OnRefreshClustersListCommand, canExecuteCommand: false);
            EnableApiCommand           = new ProtectedAsyncCommand(OnEnableApiCommandAsync);
        }
        /// <inheritdoc />
        protected PublishDialogStepBase(IApiManager apiManager)
        {
            _apiManager = apiManager;

            SelectProjectCommand = new ProtectedCommand(OnSelectProjectCommand);
            CredentialsStore.Default.CurrentProjectIdChanged += (sender, args) =>
            {
                RaisePropertyChanged(nameof(GcpProjectId));
            };
        }
 public ServerRegisterMiddleware(RequestDelegate next,
                                 IApplicationBuilder app,
                                 IClientRequestRepository clientRequestRepository,
                                 ILoggerFactory factory,
                                 IApiManager apiManager) :
     base(next, app, clientRequestRepository, factory)
 {
     _logger     = factory.CreateLogger <ServerRegisterMiddleware>();
     _apiManager = apiManager;
 }
Example #22
0
 public ServiceManager(IServiceData serviceData, IStringLocalizer <IServiceManager> localizer, ILogger <IServiceManager> logger,
                       IKeyManager keyManager, IRoleManager roleManager, IApiManager apiManager
                       )
 {
     _serviceData = serviceData;
     _localizer   = localizer;
     _logger      = logger;
     _keyManager  = keyManager;
     _roleManager = roleManager;
     _apiManager  = apiManager;
 }
        public AccountService(IApiManager apiManager)
        {
            _apiManager             = apiManager;
            _apiManager.BaseAddress = ApiConstants.API_URL;

            var userContext = SessionStorage.Instance.UserContext;

            if (userContext != null)
            {
                _apiManager.BearerToken = userContext.Token;
            }
        }
Example #24
0
 public GceStepContent(
     IPublishDialog publishDialog,
     IGceDataSource dataSource = null,
     IApiManager apiManager    = null,
     Func <Google.Apis.CloudResourceManager.v1.Data.Project> pickProjectPrompt = null,
     IWindowsCredentialsStore currentWindowsCredentialStore = null,
     Action <Instance> manageCredentialsPrompt = null) : this()
 {
     ViewModel = new GceStepViewModel(
         dataSource, apiManager, pickProjectPrompt,
         currentWindowsCredentialStore, manageCredentialsPrompt, publishDialog);
 }
Example #25
0
        public ViolationService(IApiManager apiManager, IAWSS3Service awss3Service)
        {
            _apiManager   = apiManager;
            _awss3Service = awss3Service;

            _apiManager.BaseAddress = ApiConstants.API_URL;

            var token = SessionStorage.Instance.UserContext.Token;

            if (!string.IsNullOrEmpty(token))
            {
                _apiManager.BearerToken = token;
            }
        }
Example #26
0
        private void CarregarDadosApi()
        {
            var listOfComics = new List <ComicItem>();

            IApiManager manager = null;

            Device.OnPlatform(
                Android: () => manager = DependencyService.Get <IApiManager>(),
                Default: () => manager = new ApiManager()
                );

            var result1 = "";

            var t1 = Task.Run(() =>
            {
                result1 = manager.ObterDetalhePersonagem(IdPersonagem);
            });

            Task.WaitAll(t1);


            var result     = JsonConvert.DeserializeObject(result1) as JObject;
            var charDetail = result["data"]["results"].First();

            Nome.Text      = charDetail["name"].ToObject <string>();
            Descricao.Text = charDetail["description"].ToObject <string>();
            Imagem.Source  = ImageSource.FromUri(new Uri(charDetail["thumbnail"]["path"].ToObject <string>() + "." + charDetail["thumbnail"]["extension"].ToObject <string>()));

            foreach (var comic in charDetail["comics"]["items"])
            {
                var t = Task.Run(() =>
                {
                    result1 = manager.ObterDetalheComic(comic["resourceURI"].ToObject <string>());
                });
                Task.WaitAll(t);

                var resultComic = JsonConvert.DeserializeObject(result1) as JObject;
                var comicDetail = resultComic["data"]["results"].First()["thumbnail"];
                var image       = comicDetail["path"].ToObject <string>() + "." + comicDetail["extension"].ToObject <string>();
                listOfComics.Add(new ComicItem {
                    Thumbnail = ImageSource.FromUri(new Uri(image)), Nome = comic["name"].ToObject <string>()
                });
            }

            ListView.ItemsSource = listOfComics;
            ListView.IsVisible   = true;
        }
Example #27
0
        /// <summary>
        /// On creation, startup the IRC client to hook onto the twitch chat
        /// </summary>
        public override void OnCreated(IChirper c)
        {
            //c.DestroyBuiltinChirper();

            Configuration.ReloadConfigFile();

            if (IrcClient == null)
                IrcClient = new IrcClient(Logger);

            // The noise will drive people bonkers
            ChirpPanel cp = ChirpPanel.instance;
            if (cp != null)
                cp.m_NotificationSound = null;

            CustomCitizens = GetCustomCitizens();

            //bool enterPressed = Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter);

            // If they're using the default username, make them aware of the options tab
            GetChirperManager.AddMessage("chirpertestclient", "Welcome to Twitch Chirper Chat! Click the Options button or press Alt+C to access options!", MessagePriority.Critical);

            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message,
                String.Format("User Name: {0} - Channel: {1} - Connecting to Irc...",
                    Configuration.ConfigurationSettings.UserName,
                    Configuration.ConfigurationSettings.IrcChannel));

            try
            {
                if (_apiManager != null)
                    _apiManager.Dispose();
            }
            // ReSharper disable once EmptyGeneralCatchClause
            catch {}

            _apiManager = new ApiManager(Logger, Configuration.ConfigurationSettings.IrcChannel);
            _apiManager.NewFollowers += _apiManager_NewFollowers;
            _apiManager.StartWatching();

            // Hook up the Irc client events and execute a connection
            IrcClient.ChatMessageReceived += _ircClient_ChatMessageReceived;
            IrcClient.Disconnected += _ircClient_Disconnected;
            IrcClient.Connected += _ircClient_Connected;
            IrcClient.NewSubscriber += _ircClient_NewSubscriber;
            IrcClient.Connect(Configuration.ConfigurationSettings.UserName, Configuration.ConfigurationSettings.OAuthKey, Configuration.ConfigurationSettings.IrcChannel);
        }
Example #28
0
        static void Main(string[] args)
        {
            WebSocketFactory.Init(() => new WebSocketConnection());
            AppDomain.CurrentDomain.UnhandledException += (_, e) => File.AppendAllText("crash.log", DateTime.Now + "\r\n" + e.ExceptionObject + "\r\n\r\n");
            userName = ConfigurationManager.AppSettings["UserName"];
            if (userName == null)
            {
                throw new ConfigurationErrorsException("No user configured!");
            }
            character = ConfigurationManager.AppSettings["Character"];
            if (character == null)
            {
                throw new ConfigurationErrorsException("No character configured!");
            }
            apiManager = new ApiManager();

            var kill = new ManualResetEvent(false);

            Console.CancelKeyPress += delegate { kill.Set(); };

            var compiler = new CSharpCodeProvider();
            var results  = compiler.CompileAssemblyFromFile(compilerParameters, ConfigurationManager.AppSettings["Script"]);
            var errors   = results.Errors.Cast <CompilerError>().ToList();

            if (errors.Count > 0)
            {
                foreach (var error in errors)
                {
                    Console.WriteLine(error.ErrorText);
                }
            }
            else
            {
                script = results.CompiledAssembly.ExportedTypes.Single();
                Connect();
            }

            kill.WaitOne();
        }
Example #29
0
        private void CarregarDadosApi()
        {
            IApiManager manager = null;

            Device.OnPlatform(
                Android: () => manager = DependencyService.Get <IApiManager>(),
                Default: () => manager = new ApiManager());

            var apireturn = "";

            var t1 = Task.Run(() =>
            {
                apireturn = manager.ObterPersonagens();
            });

            Task.WaitAll(t1);

            var result = JsonConvert.DeserializeObject(apireturn) as JObject;
            var data   = result["data"]["results"];

            ListView.ItemsSource = new ObservableCollection <Character>(data.ToObject <List <Character> >());
        }
        public CharacterViewModel(IChatManager chatManager, ICharacterManager characterManager, IApiManager apiManager, CharacterListProvider characterListProvider)
        {
            this.characterManager      = characterManager;
            this.apiManager            = apiManager;
            this.characterListProvider = characterListProvider;
            ToggleBookmarkCommand      = new MvxCommand(() => apiManager.QueryApi($"bookmark-{(Character.IsBookmarked ? "remove" : "add")}.php?name={Character.Name}"));
            ToggleIgnoreCommand        = new MvxCommand(() => characterManager.SetIgnored(Character, !Character.IsIgnored));
            ShowProfileCommand         = new MvxCommand(() => Navigator.Navigate(this));
            MessageCommand             = new MvxCommand(() => {
                Navigator.Navigate <ChatViewModel, ChatViewModel.InitArgs>(new ChatViewModel.InitArgs {
                    Character = Character.Name
                });
            });

            KickCommand = new MvxCommand(() => {
                chatManager.Send(Helpers.CreateClientCommand(ClientCommandType.KIK, new { character = Character.Name }));
            });
            BanCommand = new MvxCommand(() => {
                chatManager.Send(Helpers.CreateClientCommand(ClientCommandType.ACB, new { character = Character.Name }));
            });
            AddToListCommand      = new MvxCommand <CustomCharacterList>(list => characterListProvider.AddCharacter(list, Character.Name));
            RemoveFromListCommand = new MvxCommand <CustomCharacterList>(list => characterListProvider.RemoveCharacter(list, Character.Name));
            characterListProvider.CustomListsChanged += SetCharacterLists;
        }
 internal SubscribersWrapper(IApiManager manager)
 {
     _Manager = manager;
 }
 internal SegmentsWrapper(IApiManager manager)
 {
     _Manager = manager;
 }
 public SchemasController(ISchemasService schemasService, IAppsService apps, IApiManager apiManager)
 {
     this.schemasService = schemasService;
     this.apiManager = apiManager;
     this.apps = apps;
 }
 internal MailingListsWrapper(IApiManager manager)
 {
     _Manager = manager;
 }
 internal CampaignsWrapper(IApiManager manager)
 {
     _Manager = manager;
 }