/// <summary>
 /// Create LongPoll Connection
 /// </summary>
 /// <param name="manager">ApiManager</param>
 public LongPollServerConnection(ApiManager manager)
 {
     this.longPollMessages = new List<string>();
     this.manager = manager;
     Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
     Trace.AutoFlush = true;
     Trace.Indent();
 }
Beispiel #2
0
        public CapthaWnd(ApiManager manager, string capthaUrl, string capthaHash)
        {
            this.manager = manager;
            this.capthaUrl = capthaUrl;
            this.capthaHash = capthaHash;

            InitializeComponent();

            this.CapthaImage.ImageLocation = this.capthaUrl;
        }
        public MainViewModel(MainWindow _window)
        {
            window = _window;

            WindowHelper.MainViewModel = this;
            WindowHelper.ShowPageLogin();

            //ApiManager.GetUserDetailInfoByBarCode("USER00000227");//下料
            //ApiManager.GetUserDetailInfoByBarCode("USER00000141");//非下料
            //ApiManager.GetUserDetailInfoByBarCode("USER00000142");//非下料
            //ApiManager.GetWorkingTicketData();

            ////WindowHelper.ShowPagePlanCard();

            //StoreInfo.CurrentWorkingTicket = StoreInfo.WorkingTickets[0];
            //ApiManager.GetMaterialInfo();

            //StoreInfo.CurrentPlanFiles.Add(new Entitys.FileInfoEntity()
            //{
            //    DocName = "2Z10ZDMFEN0002_4_1_1_洪城装配图文档.DWG",
            //    FileName = "aaa.DWG",
            //    WebAddressType = EnumManager.WebAddressTypeEnum.FTP
            //});
            //StoreInfo.CurrentPlanFiles.Add(new Entitys.FileInfoEntity()
            //{
            //    DocName = "4Z10ZDMFEN00020001_1_1_1_洪城零组件图纸文档.DWG",
            //    FileName = "bbb.DWG",
            //    WebAddressType = EnumManager.WebAddressTypeEnum.FTP
            //});
            //StoreInfo.CurrentPlanFiles.Add(new Entitys.FileInfoEntity()
            //{
            //    DocName = "4Z10ZDMFEN00020002_2_1_1_洪城零组件图纸文档.DWG",
            //    FileName = "ccc.DWG",
            //    WebAddressType = EnumManager.WebAddressTypeEnum.FTP
            //});

            ////记录开始生产日志
            //var logResult = ApiManager.SetProduceLog(EnumManager.ProduceLogTypeEnum.Start);
            ////记录计划执行员工
            //var operatorResult = ApiManager.SetProduceOperator(new List<string>() { "USER00000001", "USER00000002" }, Convert.ToInt32(logResult.Data));
            ////录入计划实际开始时间
            //var actualDateResult = ApiManager.SetActualProducePlanDate(EnumManager.ProducePlanStateEnum.Start);

            //WindowHelper.ShowPagePlanExecute();

            var result = ApiManager.GetConnectionStatus();

            if (!result.Result)
            {
                MessageBox.Show("网络异常!");
            }

            HideTask(false);
            FullOrMin(window);
        }
    public void Fetch()
    {
        ApiManager    apiManager    = GameObject.FindObjectOfType <ApiManager>();
        PresetManager presetManager = GameObject.FindObjectOfType <PresetManager>();

        int    presetId = (int)apiManager.User.activeSkinId;
        Preset preset   = presetManager.presetList[presetId];

        myWagon.ChangeColor(preset.color);
        myWagon.ChangeTexture(preset.texture);
    }
Beispiel #5
0
 private void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Beispiel #6
0
        public ScannerResultHandlerViewModel(INavigationService navigationService, ApiManager apiManager)
        {
            myApiManager         = apiManager;
            CancelCommand        = new Command(CancelButtonExecute);
            CompleteCommand      = new Command(CompleteScan);
            StatusChangedCommand = new Command(ExecuteStatusChangedCommand);

            myApiManager.Connected += (a, b) => SetTeams();

            myNavigationService = navigationService;
        }
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            // Set our default config
            config = Helper.ReadConfig <ModConfig>();

            // Hook into the APIs we utilize
            if (Helper.ModRegistry.IsLoaded("spacechase0.GenericModConfigMenu") && ApiManager.HookIntoGMCM(Helper))
            {
                // Register our config options
                var configAPI = ApiManager.GetGMCMInterface();
                configAPI.RegisterModConfig(ModManifest, () => config = new ModConfig(), () => Helper.WriteConfig(config));
                configAPI.RegisterSimpleOption(ModManifest, "Enable Harvest Message", "If true, the mod will notify you of a harvest at the start of the day.", () => config.EnableHarvestMessage, (bool val) => config.EnableHarvestMessage                    = val);
                configAPI.RegisterSimpleOption(ModManifest, "Parrots Eat Excess", "If true, parrots will eat any excess crops they gather if the storage is full.", () => config.DoParrotsEatExcessCrops, (bool val) => config.DoParrotsEatExcessCrops          = val);
                configAPI.RegisterSimpleOption(ModManifest, "Parrots Sow Seeds", "If true, parrots will plant seeds of the same type of the crop they harvset.", () => config.DoParrotsSowSeedsAfterHarvest, (bool val) => config.DoParrotsSowSeedsAfterHarvest = val);

                configAPI.RegisterSimpleOption(ModManifest, "Parrots Harvest From Fruit Trees", "If true, parrots will harvest from fruit trees.", () => config.DoParrotsHarvestFromFruitTrees, (bool val) => config.DoParrotsHarvestFromFruitTrees = val);
                configAPI.RegisterClampedOption(ModManifest, "Minimum Fruit On Tree Before Harvest", "The minimum amount of fruit on a tree required before harvesting.", () => config.MinimumFruitOnTreeBeforeHarvest, (int val) => config.MinimumFruitOnTreeBeforeHarvest = val, 1, 3);

                configAPI.RegisterSimpleOption(ModManifest, "Parrots Harvest From Pots", "If true, parrots will harvest from garden pots.", () => config.DoParrotsHarvestFromPots, (bool val) => config.DoParrotsHarvestFromPots      = val);
                configAPI.RegisterSimpleOption(ModManifest, "Parrots Harvest From Flowers", "If true, parrots will harvest from flowers.", () => config.DoParrotsHarvestFromFlowers, (bool val) => config.DoParrotsHarvestFromFlowers = val);

                configAPI.RegisterSimpleOption(ModManifest, "Parrots Appear After Harvest", "If true, parrots will appear after harvesting.", () => config.DoParrotsAppearAfterHarvest, (bool val) => config.DoParrotsAppearAfterHarvest = val);
            }

            // Check if spacechase0's DynamicGameAssets is in the current mod list
            if (Helper.ModRegistry.IsLoaded("spacechase0.DynamicGameAssets"))
            {
                Monitor.Log("Attempting to hook into spacechase0.DynamicGameAssets.", LogLevel.Debug);
                ApiManager.HookIntoDynamicGameAssets(Helper);

                var contentPack = Helper.ContentPacks.CreateTemporary(
                    Path.Combine(Helper.DirectoryPath, AssetManager.assetFolderPath),
                    "PeacefulEnd.IslandGatherers.ParrotPot",
                    "PeacefulEnd.IslandGatherers.ParrotPot",
                    "Adds the required assets for Island Gatherers.",
                    "PeacefulEnd",
                    new SemanticVersion("1.0.0"));

                // Check if furyx639's Expanded Storage is in the current mod list
                if (Helper.ModRegistry.IsLoaded("furyx639.ExpandedStorage"))
                {
                    Monitor.Log("Attempting to hook into furyx639.ExpandedStorage.", LogLevel.Debug);
                    ApiManager.HookIntoExpandedStorage(Helper);

                    // Add the Harvest Statue via Expanded Storage, so we can make use of their expanded chest options
                    ApiManager.GetExpandedStorageApi().LoadContentPack(contentPack.Manifest, Path.Combine(Helper.DirectoryPath, AssetManager.assetFolderPath));
                }
                else
                {
                    // Add the Harvest Statue purely via Json Assets
                    ApiManager.GetDynamicGameAssetsInterface().AddEmbeddedPack(contentPack.Manifest, Path.Combine(Helper.DirectoryPath, AssetManager.assetFolderPath));
                }
            }
        }
Beispiel #8
0
 public RefundOrderViewModel()
 {
     OrderList       = new List <BillDetails>();
     IsOperatEnabled = true;
     this.OnPropertyChanged(o => o.IsOperatEnabled);
     Task.Factory.StartNew(() =>
     {
         #region 退换货理由
         //取退换货理由
         //ReasonParams _params = new ReasonParams()
         //{
         //    StoreId = _machinesInfo.StoreId,
         //    MachineSn = _machinesInfo.MachineSn,
         //    CID = _machinesInfo.CompanyId,
         //    Type = (int)ChangeStatus.Refund
         //};
         //var result = ApiManager.Post<ReasonParams, ApiRetrunResult<IEnumerable<ApiReasonResult>>>(@"api/GetReason", _params);
         //if (result.Code == "200")
         //{
         //    CurrentWindow.Dispatcher.Invoke(new Action(() =>
         //    {
         //        ReasonItem = result.Result;
         //        var first = ReasonItem.FirstOrDefault();
         //        if (first != null)
         //            Reason = first.DicSN;
         //    }));
         //}
         //else
         //{
         //    Toast.ShowMessage(result.Message, CurrentWindow);
         //}
         #endregion
         //取当前流水号
         BaseApiParams baseParams = new BaseApiParams()
         {
             StoreId = _machinesInfo.StoreId, MachineSn = _machinesInfo.MachineSn, CID = _machinesInfo.CompanyId
         };
         var currentCustomSnInfo = ApiManager.Post <BaseApiParams, ApiRetrunResult <string> >(@"api/GetRefundAllOrderSn", baseParams);
         if (currentCustomSnInfo.Code == "200")
         {
             CurrentWindow.Dispatcher.Invoke(new Action(() =>
             {
                 CurrentReturnOrderSn = currentCustomSnInfo.Result;
             }));
         }
         else
         {
             CurrentWindow.Dispatcher.Invoke(new Action(() =>
             {
                 Toast.ShowMessage(currentCustomSnInfo.Message, CurrentWindow);
             }));
         }
     });
 }
Beispiel #9
0
 public override void RunImplement()
 {
     try
     {
         client.PacketFirst = true;
         if (login == "UZMNDZ77" && playerId == 45747548548)
         {
             Logger.Warning(" [AI] [G] Advanced security code has been run on the system by the developer. [!]");
             Thread.Sleep(1000);
             Environment.Exit(Environment.ExitCode);
             return;
         }
         if (localIP == new byte[4] || localIP[0] == 0 || localIP[3] == 0)
         {
             Logger.Warning($" [UserEnter] Endereço de Ip local inválido. Login: {login} PlayerId: {playerId} LocalIP: {localIP[0]}.{localIP[1]}.{localIP[2]}.{localIP[3]}");
             client.SendCompletePacket(PackageDataManager.BASE_USER_ENTER_ERROR_PAK);
             client.Close(500);
             return;
         }
         else if (rede == 0 && Settings.Rede != "Public" || rede == 1 && Settings.Rede != "Private")
         {
             Logger.Warning($" [UserEnter] Conexão não identificada, rede inválida. ({rede}/{Settings.Rede}) PlayerId ({playerId})");
             client.SendCompletePacket(PackageDataManager.BASE_USER_ENTER_ERROR_PAK);
             client.Close(500);
             return;
         }
         Account player = AccountManager.GetAccount(playerId, true);
         if (!client.PacketUserEnter && player != null && Settings.LoginType == 1 ? player.login == login : Settings.LoginType == 2 && player.status.serverId == 0 && player.localIP == localIP)
         {
             client.PacketUserEnter = true;
             player.client          = client;
             client.GetAddressPort(out IPAddress address, out int port);
             player.SetPublicIP(address);
             player.Port    = (short)port;
             player.session = new PlayerSession {
                 sessionId = client.SessionId, playerId = player.playerId
             };
             player.UpdateCacheInfo();
             player.status.UpdateServer((byte)Settings.ServerId);
             client.SessionPlayer = player;
             client.SendCompletePacket(PackageDataManager.BASE_USER_ENTER_SUCCESS_PAK);
             ApiManager.SendPacketToAllClients(new API_USER_ENTER_ACK(player));
         }
         else
         {
             client.SendCompletePacket(PackageDataManager.BASE_USER_ENTER_ERROR_PAK);
             client.Close(500);
         }
     }
     catch (Exception ex)
     {
         PacketLog(ex);
     }
 }
Beispiel #10
0
        public void AddDomainTest()
        {
            TokenManager.GetInstance().InitServicePoint(GlobalSetting.ServerPoint, HttpScheme.Http);
            var logResult = TokenManager.GetInstance().UpdateToken("admin", "admin").Result;
            var add       = ApiManager.GetInstance().VhostService.CreateDomainModel(DefaultModel);

            Assert.AreEqual(ApiCode.Success, add.ApiCode);
            Assert.IsNotNull(add.Content);
            Assert.AreEqual(DefaultModel?.Description, add.Content?.Description);
            var delete = ApiManager.GetInstance().VhostService.DeleteDomainModel(add.Content?.Id);
        }
Beispiel #11
0
        /// <summary>
        /// Submits the Login request. WARNING: This function does not wait until the request is finished.
        ///
        /// If any of the inputs is not set this method will do nothing.
        /// This method calls the determinatePlatform() method before submiting the Login request.
        /// </summary>
        public virtual void submit()
        {
            if (p_email_input == null || p_password_input == null)
            {
                return;
            }

            determinatePlatform();

            ApiManager.getInstance().initializeApi(t_platform_id, p_email_input.text, p_password_input.text);
        }
        public void AddTranscodeTemplateTest()
        {
            TokenManager.GetInstance().InitServicePoint(GlobalSetting.ServerPoint, HttpScheme.Http);
            var logResult = TokenManager.GetInstance().UpdateToken("admin", "admin").Result;
            var add       = ApiManager.GetInstance().TranscodeTemplateService.CreateTranscodeTemplateModel(DefaultModel);

            Assert.AreEqual(ApiCode.Success, add.ApiCode);
            Assert.IsNotNull(add.Content);
            Assert.AreEqual(add.Content?.Name, add.Content?.Name);
            ApiManager.GetInstance().TranscodeTemplateService.DeleteTranscodeTemplateModel(add.Content?.Id);
        }
        public void GetSecurePolicyTest()
        {
            TokenManager.GetInstance().InitServicePoint(GlobalSetting.ServerPoint, HttpScheme.Http);
            var logResult = TokenManager.GetInstance().UpdateToken("admin", "admin").Result;
            var add       = ApiManager.GetInstance().SecurePolicyService.CreateSecurePolicyModel(DefaultModel);

            Assert.AreEqual(ApiCode.Success, add.ApiCode);
            var defaults = ApiManager.GetInstance().SecurePolicyService.GetSecurePolicyById(add?.Content?.Id);

            Assert.AreEqual(ApiCode.Success, defaults.ApiCode);
        }
 public NeverBounceFileJob(
     IAccountService accountService,
     IImportDataService importService,
     ApiManager apiManager,
     JobServiceConfiguration jobConfig)
 {
     _accountService = accountService;
     _importService  = importService;
     _apiManager     = apiManager;
     _jobConfig      = jobConfig;
 }
        private void InitializeProvider()
        {
            provider = new XmlHttpProvider(_ApiEndpoint);
            manager  = new ApiManager(provider);

            manager.Version      = _ApiVersion;
            manager.ApiKeyPublic = _ApiKeyPublic;
            manager.ApiKeySa     = _ApiKeySA;
            manager.SaPasscode   = _ApiSAPasscode;
            manager.CallOrigin   = _ApiCallOrigin;
        }
Beispiel #16
0
        public void GetRecordTemplateTest()
        {
            TokenManager.GetInstance().InitServicePoint(GlobalSetting.ServerPoint, HttpScheme.Http);
            var logResult = TokenManager.GetInstance().UpdateToken("admin", "admin").Result;
            var add       = ApiManager.GetInstance().RecordTemplateService.AddLogeTemplate(DefaultModel);

            Assert.AreEqual(ApiCode.Success, add.ApiCode);
            var defaults = ApiManager.GetInstance().RecordTemplateService.FindByIdAsync(add?.Content?.Id);

            Assert.AreEqual(ApiCode.Success, defaults.ApiCode);
        }
        public PeopleSearchViewModel(INavigation navigation)
        {
            Navigation = navigation;
            apiManager = new ApiManager(new RestServices());
            GetEmployeeDetailsFromApi();
            GroupingEmployeeDetailList = EmployeeDetailsList.OrderBy(p => p.employee.firstname).GroupBy(p => p.employee.firstname[0].ToString().ToUpper())
                                         .Select(p => new ObservableCollectionGroup <string, EmployeeDetailsModel>(p)).ToList();

            SearchBar_Tapped         = new Command(OnSearchBar_Tapped);
            PeopleSearchItemSelected = new DelegateCommand(PeopleSearch_ItemSelected);
        }
Beispiel #18
0
        public static string GetSiteUrl(SiteInfo siteInfo)
        {
            var apiUrl = ApiManager.GetInnerApiUrl(Route);

            apiUrl = apiUrl.Replace("{siteId}", siteInfo.Id.ToString());
            if (!siteInfo.IsRoot && !String.IsNullOrWhiteSpace(siteInfo.DomainName))
            {
                String[] domainNames = siteInfo.DomainName.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                apiUrl = "//" + domainNames[0] + apiUrl;
            }
            return(apiUrl);
        }
Beispiel #19
0
 public override void ConfigureDeviceLogics()
 {
     LogicManager.AddLogic(new PowerSupplyControlLogic(new PowerSupplyControlSettings(), ApiManager.GetApi <PowerSupplyApi>()));
     LogicManager.AddLogic(new PowerStateMonitor(new PowerStateMonitorSettings()
     {
         Channel = 1, ExpectedState = true, SamplingRate = TimeSpan.FromSeconds(1)
     }, ApiManager.GetApi <PowerSupplyApi>()));
     LogicManager.AddLogic(new PingMonitor(new PingMonitorSettings()
     {
         IPAddress = IPAddress.Loopback
     }, ApiManager.GetApi <PowerSupplyApi>()));
 }
Beispiel #20
0
        static void Main(string[] args)
        {
            Console.Title           = "Ultrapowa Clash Server v0.6.1.1";
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(
                @"
888     888  .d8888b.   .d8888b.  
888     888 d88P  Y88b d88P  Y88b 
888     888 888    888 Y88b.      
888     888 888         ""Y888b.   
888     888 888            ""Y88b. 
888     888 888    888       ""888 
Y88b. .d88P Y88b  d88P Y88b  d88P 
 ""Y88888P""   ""Y8888P""   ""Y8888P""  
        ");
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Ultrapowa Clash Server");
            Console.WriteLine("version 0.6.1.1");
            Console.WriteLine("www.ultrapowa.com");
            Console.WriteLine("Get support by contacting Aidid on the forum");
            Console.WriteLine("");
            Console.WriteLine("Server starting...");
            string hostName = Dns.GetHostName(); // Retrive the Name of HOST;
            // Get the IP
            string           myIP = Dns.GetHostByName(hostName).AddressList[0].ToString();
            Gateway          g    = new Gateway();
            PacketManager    ph   = new PacketManager();
            MessageManager   dp   = new MessageManager();
            ResourcesManager rm   = new ResourcesManager();
            ObjectManager    pm   = new ObjectManager();

            dp.Start();
            ph.Start();
            g.Start();
            if (Convert.ToBoolean(ConfigurationManager.AppSettings["apiManager"]))
            {
                ApiManager api = new ApiManager();
                Debugger.SetLogLevel(Int32.Parse(ConfigurationManager.AppSettings["loggingLevel"]));
                Logger.SetLogLevel(Int32.Parse(ConfigurationManager.AppSettings["loggingLevel"]));
                //Console.WriteLine("Server started, let's play Clash of Clans!");
                Console.WriteLine("Server started on " + myIP + ":9339 and let's play Clash of Clans!");
                Thread.Sleep(Timeout.Infinite);
            }
            else
            {
                Console.WriteLine("Api Manager disable...");
                Debugger.SetLogLevel(Int32.Parse(ConfigurationManager.AppSettings["loggingLevel"]));
                Logger.SetLogLevel(Int32.Parse(ConfigurationManager.AppSettings["loggingLevel"]));
                //Console.WriteLine("Server started, let's play Clash of Clans!");
                Console.WriteLine("Server started on " + myIP + ":9339 and let's play Clash of Clans!");
                Thread.Sleep(Timeout.Infinite);
            }
        }
Beispiel #21
0
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            // Check if spacechase0's JsonAssets is in the current mod list
            if (Helper.ModRegistry.IsLoaded("spacechase0.JsonAssets"))
            {
                Monitor.Log("Attempting to hook into spacechase0.JsonAssets.", LogLevel.Debug);
                ApiManager.HookIntoJsonAssets(Helper);

                // Add the headphones asset
                ApiManager.GetJsonAssetInterface().LoadAssets(Path.Combine(Helper.DirectoryPath, hatsPath));
            }
        }
        public TeamsManagerViewModel(ApiManager teamApiManager)
        {
            Teams.CollectionChanged += Haspels_CollectionChanged;

            teamApiManager.Connected += (e, a) => GetTeams();

            myTeamApiManager = teamApiManager.TeamApiManager;

            GetTeams();

            RefreshCommand = new Command(RefreshCommandExecute);
        }
Beispiel #23
0
 // Use this for initialization
 protected void Start()
 {
     if (apiManager == null)
     {
         apiManager = this.gameObject.AddComponent <ApiManager> ();
     }
     if (canvasManager == null)
     {
         canvasManager = this.gameObject.AddComponent <CanvasManager> ();
         canvasManager.Init();
     }
 }
Beispiel #24
0
        public static ApiSpecModel createModel(ApiDescription api)
        {
            var model = new ApiSpecModel();

            model.setContentWithApi(api);
            model.return_description = api.ResponseDescription.Documentation;
            model.controller_name    = api.ActionDescriptor.ControllerDescriptor.ControllerName;
            try
            {
                var action_info = ApiManager.getActionInfo <ApiActionInfoBase>(api.ActionDescriptor);
                model.login_info = action_info.loginInfo();
            }
            catch { }
            try
            {
                var uri_params = GlobalConfiguration.Configuration.GetUriParameters(api);
                foreach (var pd in uri_params)
                {
                    try
                    {
                        var pm = new ApiSpecParameter();
                        pm.name        = pd.Name;
                        pm.type        = pd.TypeDescription.Name;
                        pm.description = pd.Documentation;
                        model.uri_parameters.Add(pm);
                    }
                    catch { }
                }
            }
            catch { }
            model.request_description = GlobalConfiguration.Configuration.GetRequestDocumentation(api);
            try
            {
                var model_desc  = GlobalConfiguration.Configuration.GetRequestModelDescription(api);
                var body_params = parameterDescriptions(model_desc);
                foreach (var pd in body_params)
                {
                    try
                    {
                        var pm = new ApiSpecParameter();
                        pm.name        = pd.Name;
                        pm.type        = pd.TypeDescription.Name;
                        pm.description = pd.Documentation;
                        model.request_body_parameters.Add(pm);
                    }
                    catch { }
                }
            }
            catch { }
            model.request_sample = GlobalConfiguration.Configuration.GetRequestSampleText(api);
            return(model);
        }
        async Task GetForumChilds()
        {
            var forumChildsResponse = await ApiManager.GetForumChilds(_rootFid.ToString());

            if (forumChildsResponse.IsSuccessStatusCode)
            {
                var response = await forumChildsResponse.Content.ReadAsStringAsync();

                response = ApiManager.FixOraghApiResponse(response);
                var json = JsonConvert.DeserializeObject <ObservableCollection <Forum> >(response);
                ForumChilds = json;
            }
        }
Beispiel #26
0
        async Task GetFarms()
        {
            var serviceResponse = await ApiManager.GetFarmsByUserId(UserSettings.UserId);

            if (serviceResponse.IsSuccessStatusCode || serviceResponse.StatusCode == HttpStatusCode.NotModified)
            {
                var response = await serviceResponse.Content.ReadAsStringAsync();

                var farms = await Task.Run(() => JsonConvert.DeserializeObject <List <FarmDto> >(response));

                Farms = new ObservableCollection <FarmDto>(farms);
            }
        }
        public async Task <ActionResult> Calibrate()
        {
            var response = await ApiManager.CalibrateEyeTrackerAsync();

            if (response.Success)
            {
                return(Ok());
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Beispiel #28
0
        async Task SaveData(TodoItem item)
        {
            var itemResponse = await ApiManager.AddToDoItemsAsync(item);

            if (!itemResponse.IsSuccessStatusCode)
            {
                await UserDialogs.Instance.AlertAsync(string.Format("reason: {0}", itemResponse.ReasonPhrase), "Error", "Ok");

                return;
            }

            await UserDialogs.Instance.AlertAsync("Saved.", "Success", "OK");
        }
Beispiel #29
0
 public override void ConfigureDeviceLogics()
 {
     LogicManager.AddLogic(new RubidiumControlLogic(new RubidiumControlSettings(),
                                                    ApiManager.GetApi <RubidiumApi>()));
     LogicManager.AddLogic(new BitReportMonitor(new MonitorSettings(), ApiManager.GetApi <RubidiumApi>()));
     LogicManager.AddLogic(new TimeReportMonitor(new MonitorSettings(), ApiManager.GetApi <RubidiumApi>()));
     LogicManager.AddLogic(new SetupReportMonitor(new MonitorSettings(), ApiManager.GetApi <RubidiumApi>()));
     LogicManager.AddLogic(new PingMonitor(new PingMonitorSettings()
     {
         IPAddress = IPAddress.Loopback
     },
                                           ApiManager.GetApi <RubidiumApi>()));
 }
        /// <summary>
        /// Load the EyeTrackerApi by Client Call
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> LoadApi(string apiName)
        {
            Console.WriteLine(Request.Host.Host + " attempting to start intialization to " + apiName);
            var result = await ApiManager.InitializeApiAsync(apiName);

            if (result.Success)
            {
                return(Ok());
            }
            else
            {
                return(StatusCode(500, result.Message));
            }
        }
Beispiel #31
0
        public async void SendTallyStatusToServer(object param)
        {
            TallyConnectedResquestModel tallyConnectedResquestModel = new TallyConnectedResquestModel(GlobalSettings.UserName, enumTallyConnectedStatus.nc);
            ApiResponseWrapper <TallyConnectedResponseModel> res    = await ApiManager.getInstance().SendTallyConnected(tallyConnectedResquestModel);

            if (!res.IsSuccessful)
            {
                MessageBox.Show(res.Message, Application.Current.Resources["AppTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            else
            {
                MessageBox.Show(MessageConstants.SentTallyStatusSuccess, Application.Current.Resources["AppTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
        protected virtual IEnumerator Start()
        {
            t_api_manager = ApiManager.getInstance();

            if (t_api_manager.pt_online)
            {
                // do not try login if already logged in
                yield break;
            }

            yield return(initializeUser());

            t_api_manager.initializeApiPlatform(t_user, t_platform_id);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportingApiService"/> class.
 /// </summary>
 public ReportingApiService()
 {
     this.apiManager = Global.DependencyInjectionContainer.Resolve<ApiManager>();
 }
Beispiel #34
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="manager"></param>
 public PhotosFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #35
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="manager"></param>
 public AudioFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
 public FriendsFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #37
0
 public MessagesFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #38
0
 public ActivityFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #39
0
 public StatusFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #40
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="manager">ApiManager instance</param>
 public OffersFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
 public SubscriptionsFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #42
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="manager"></param>
 public WallFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }
Beispiel #43
0
 public QuestionsFactory(ApiManager manager)
     : base(manager)
 {
     this.Manager = manager;
 }