public LibraryService(
     WebApiManager webApiManager,
     UserService spotifyServiceUser)
 {
     dispatcher = webApiManager;
     user       = spotifyServiceUser;
 }
示例#2
0
        public ActionResult DriverPayGridViewPartial(int WorkOrderNo = 0)
        {
            ViewBag.WorkOrder = WorkOrderNo;
            var result1 = WebApiManager.GetRequest <List <string> >(WebApiRequests.TypeOfLoad);

            ViewBag.TypeOfLoad = result1;

            var result4 = WebApiManager.GetRequest <List <string> >(WebApiRequests.PayType);

            ViewBag.PayType = result4;

            var result2 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Origin);

            ViewBag.Origin = result2;

            var result3 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Destination);

            ViewBag.Destination = result3;

            var model = from w in db.DriverPays
                        where w.WorkOrder == WorkOrderNo
                        orderby w.RowOrder
                        select w;

            return(PartialView("_DriverPayGridViewPartial", model.ToList()));
        }
 public ContextsService(
     WebApiManager webApiManager,
     PlaybackService spotifyServicePlayback)
 {
     dispatcher = webApiManager;
     spotifyServicePlayback.UnsafePlaybackChanged += FireIfContextChanged;
 }
示例#4
0
 public ExploreService(
     WebApiManager webApiManager,
     IndexedDbCache <string> indexedDbCache)
 {
     dispatcher       = webApiManager;
     listenLaterStore = indexedDbCache;
 }
示例#5
0
        public MsgViewModel()
        {
            PreWidth       = 270;
            apiManager     = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
            stringResource = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);

            Msgs            = new ObservableCollection <Msg>();
            MsgDetails      = new ObservableCollection <MsgDetail>();
            Friends         = new ObservableCollection <RelFriend>();
            SearchedFriends = new ObservableCollection <RelFriend>();
            ApplyFriends    = new ObservableCollection <RelFriend>();

            ApplyFriendCommand       = new RelayCommand(ApplyFriend);
            UpdateFriendCommand      = new RelayCommand(UpdateFriend);
            SendCommand              = new RelayCommand(Send);
            UpdateMsgCommand         = new RelayCommand(UpdateMsg);
            LoadMsgCommand           = new RelayCommand(LoadMsg);
            NextMsgPageCommand       = new RelayCommand(NextMsgPage);
            PrevMsgPageCommand       = new RelayCommand(PrevMsgPage);
            DeleteMsgCommand         = new RelayCommand(DeleteMsg);
            PrevMsgDetailPageCommand = new RelayCommand(PrevMsgDetailPage);
            NextMsgDetailPageCommand = new RelayCommand(NextMsgDetailPage);
            ApplyFriendCommand       = new RelayCommand(ApplyFriend);
            ApplyPageNextCommand     = new RelayCommand(ApplyPageNext);
            ApplyPagePrevCommand     = new RelayCommand(ApplyPagePrev);
            MsgTitle = stringResource.GetString("MsgTitleNull");
        }
 public MakeContentViewModel()
 {
     webApiManager     = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocator.WebApiManagerKey);
     Files             = new ObservableCollection <ApiFileModel>();
     SendCommand       = new RelayCommand(Send);
     RemoveFileCommand = new RelayCommand <ApiFileModel>(RemoveFile);
     GroupId           = DefaultGroupId;
 }
示例#7
0
        public ActionResult RQLineItemsPartial(int rateQuoteId = 0)
        {
            var billingItems = WebApiManager.GetRequest <List <string> >(WebApiRequests.BillingItems);

            ViewBag.BillingItem = billingItems;
            List <WOLineItems_RateQuote> model = db.WOLineItems_RateQuote.Where(item => item.RateQuoteId == rateQuoteId).ToList();

            return(PartialView("_RQLineItemsPartial", model));
        }
示例#8
0
        public ActionResult RateQuote(int RateQuoteId = 0)
        {
            var result1 = WebApiManager.GetRequest <List <string> >(WebApiRequests.BillTo);

            ViewBag.BillTo = result1;
            RateQuote ratequote = RateQuoteId == 0 ? new RateQuote() : db.RateQuotes.Where(item => item.RateQuoteId == RateQuoteId).FirstOrDefault();

            ratequote.RateQuoteId = RateQuoteId == 0 ? db.RateQuotes.Max(item => item.RateQuoteId) + 1 : ratequote.RateQuoteId;
            return(PartialView("RateQuote", ratequote));
        }
示例#9
0
        public AccountViewModel()
        {
            webApiManager   = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocator.WebApiManagerKey);
            LoginCommand    = new RelayCommand(Login);
            LogOffCommand   = new RelayCommand(LogOff);
            RegisterCommand = new RelayCommand(Register);
#if DEBUG
            UserName = "******";
            pwd      = "Asdfg123456";
#endif
        }
示例#10
0
        static void Main(string[] args)
        {
            var wa = new WebApiManager();

            Task.Run(async() =>
            {
                var l = await wa.LoginAsync(new LoginModel("HCricle", "Asdfg123456"));
                var c = await wa.GetContentsAsync(0, 0);
                var q = await wa.SearchContentAsync("ww", 1, 0);
            }).Wait();
        }
        public SendContentViewModel()
        {
            apiManager     = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
            stringResource = ViewModelLocatorBase.StringResources;

            SendFiles         = new ObservableCollection <ApiFileModel>();
            SendCommand       = new RelayCommand(Send);
            CleanFilesCommand = new RelayCommand(CleanFiles);

            Lable = string.Empty;
        }
示例#12
0
        public ActionResult Create()
        {
            TemplatesWO model = new TemplatesWO();

            model.ID          = db.TemplatesWOes.Max(itm => itm.ID);
            model.ID          = model.ID + 1;
            model.DateUpdated = DateTime.Now;
            model.DateCreated = DateTime.Now;


            var result1 = WebApiManager.GetRequest <List <string> >(WebApiRequests.BillTo);

            ViewBag.BillTo = result1;

            var result2 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Origin);

            ViewBag.Origin = result2;

            var result3 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Destination);

            ViewBag.Destination = result3;

            var result4 = WebApiManager.GetRequest <List <string> >(WebApiRequests.TypeOfMove);

            ViewBag.TypeOfMove = result4;

            var result5 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentPickup);

            ViewBag.EquipmentPickup = result5;

            var result6 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentProvider);

            ViewBag.EquipmentProvider = result6;

            var result7 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentReturn);

            ViewBag.EquipmentReturn = result7;

            var result8 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentSize);

            ViewBag.EquipmentSize = result8;

            var result9 = WebApiManager.GetRequest <List <string> >(WebApiRequests.ChassisProvider);

            ViewBag.ChassisProvider = result9;

            var result10 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Broker);

            ViewBag.Broker = result10;

            return(View(model));
        }
        public override async Task <Option <TModelResponse, ApizrException <TModelResponse> > > Handle(
            ExecuteOptionalRequest <TWebApi, TModelResponse, TApiResponse> request, CancellationToken cancellationToken)
        {
            try
            {
                switch (request.ExecuteApiMethod)
                {
                case Expression <Func <TWebApi, Task <TApiResponse> > > executeApiMethod:
                    return(await request
                           .SomeNotNull(new ApizrException <TModelResponse>(
                                            new NullReferenceException($"Request {request.GetType().GetFriendlyName()} can not be null")))
                           .MapAsync(_ => WebApiManager.ExecuteAsync(executeApiMethod))
                           .MapAsync(result => Task.FromResult(Map <TApiResponse, TModelResponse>(result)))
                           .ConfigureAwait(false));

                case Expression <Func <CancellationToken, TWebApi, Task <TApiResponse> > > executeApiMethod:
                    return(await request
                           .SomeNotNull(new ApizrException <TModelResponse>(
                                            new NullReferenceException($"Request {request.GetType().GetFriendlyName()} can not be null")))
                           .MapAsync(_ => WebApiManager.ExecuteAsync(executeApiMethod, cancellationToken))
                           .MapAsync(result => Task.FromResult(Map <TApiResponse, TModelResponse>(result)))
                           .ConfigureAwait(false));

                case Expression <Func <TWebApi, IMappingHandler, Task <TApiResponse> > > executeApiMethod:
                    return(await request
                           .SomeNotNull(new ApizrException <TModelResponse>(
                                            new NullReferenceException($"Request {request.GetType().GetFriendlyName()} can not be null")))
                           .MapAsync(_ => WebApiManager.ExecuteAsync(executeApiMethod))
                           .MapAsync(result => Task.FromResult(Map <TApiResponse, TModelResponse>(result)))
                           .ConfigureAwait(false));

                case Expression <Func <CancellationToken, TWebApi, IMappingHandler, Task <TApiResponse> > > executeApiMethod:
                    return(await request
                           .SomeNotNull(new ApizrException <TModelResponse>(
                                            new NullReferenceException($"Request {request.GetType().GetFriendlyName()} can not be null")))
                           .MapAsync(_ => WebApiManager.ExecuteAsync(executeApiMethod, cancellationToken))
                           .MapAsync(result => Task.FromResult(Map <TApiResponse, TModelResponse>(result)))
                           .ConfigureAwait(false));

                default:
                    throw new ApizrException <TApiResponse>(new NotImplementedException());
                }
            }
            catch (ApizrException <TApiResponse> e)
            {
                return(Option.None <TModelResponse, ApizrException <TModelResponse> >(
                           new ApizrException <TModelResponse>(e.InnerException,
                                                               Map <TApiResponse, TModelResponse>(e.CachedResult))));
            }
        }
示例#14
0
        public PlaybackService(
            WebApiManager webApiManager,
            WebPlaybackSdkManager webPlaybackSdkManager,
            MediaSessionManager mediaSessionManager,
            AuthorizationService spotifyServiceAuth,
            SpotifyServiceConfiguration spotifyServiceConfiguration)
        {
            dispatcher   = webApiManager;
            player       = webPlaybackSdkManager;
            mediaSession = mediaSessionManager;
            auth         = spotifyServiceAuth;
            config       = spotifyServiceConfiguration;

            PlaybackChanged       += OnDevicePotentiallyChanged;
            PlaybackChanged       += mediaSession.SetMetadata;
            auth.AuthStateChanged += OnReInitializationPotenitallyNeeded;

            playbackContextPollingTimer = new(
                callback : async _ => { if (await auth.IsUserLoggedIn())
                                        {
                                            await FirePlaybackContextChanged(await GetPlayback());
                                        }
                },
                state : null,
                dueTime : 0,
                period : 1000);

            playbackUpdateTimer = new(
                callback : async _ => { if (await auth.IsUserLoggedIn())
                                        {
                                            PlaybackDisplayUpdate?.Invoke(GetProgressMs());
                                        }
                },
                state : null,
                dueTime : 0,
                period : 33);

            int playbackKeepAliveTimerPeriod = Convert.ToInt32(TimeSpan.FromMinutes(1).TotalMilliseconds);

            playbackKeepAliveTimer = new(
                callback : async _ => { if (await auth.IsUserLoggedIn())
                                        {
                                            await KeepPlaybackAlive();
                                        }
                },
                state : null,
                dueTime : playbackKeepAliveTimerPeriod,
                period : playbackKeepAliveTimerPeriod);
        }
示例#15
0
        public ActionResult WOLineItemsPartial(int WorkOrderNo = 0)
        {
            //var model = db.WOLineItems;
            // WorkOrderNo = 3;
            var result1 = WebApiManager.GetRequest <List <string> >(WebApiRequests.BillingItems);

            ViewBag.BillingItem = result1;
            ViewBag.WorkOrder   = WorkOrderNo;

            var model = from w in db.WOLineItems
                        where w.WorkOrder == WorkOrderNo orderby w.RowOrder
                        select w;

            return(PartialView("_WOLineItemsPartial", model.ToList()));
        }
示例#16
0
        public HomeViewModel()
        {
            apiManager    = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
            accountHelper = SimpleIoc.Inst.GetInstance <ISettingHelper>(ViewModelLocatorBase.AccountSettingKey);
            appResources  = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);
            UserName      = accountHelper.GetValue <string>(UserNameKey);
            Pwd           = accountHelper.GetValue <string>(PwdKey);
            LoginCommand  = new RelayCommand(Login);
            LogOffCommand = new RelayCommand(LogOff);
            IocHelper.EnsureIocKey(this);
#if DEBUG
            UserName = "******";
            Pwd      = "Asdfg123456";
#endif
        }
示例#17
0
        public AuthorizationService(
            WebApiManager webApiManager,
            AuthManagerBase authManagerBase,
            SpotifyServiceConfiguration spotifyServiceConfiguration)
        {
            dispatcher  = webApiManager;
            authManager = authManagerBase;
            config      = spotifyServiceConfiguration;

            authPollingTimer = new(
                callback : async _ => { await HandleAuthStatePotentiallyChanged(); },
                state : null,
                dueTime : 1000,
                period : 1000);
        }
示例#18
0
        public ActionResult TemplateExternalEditForm(System.Int32 ID)
        {
            var result1 = WebApiManager.GetRequest <List <string> >(WebApiRequests.BillTo);

            ViewBag.BillTo = result1;

            var result2 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Origin);

            ViewBag.Origin = result2;

            var result3 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Destination);

            ViewBag.Destination = result3;

            var result4 = WebApiManager.GetRequest <List <string> >(WebApiRequests.TypeOfMove);

            ViewBag.TypeOfMove = result4;

            var result5 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentPickup);

            ViewBag.EquipmentPickup = result5;

            var result6 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentProvider);

            ViewBag.EquipmentProvider = result6;

            var result7 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentReturn);

            ViewBag.EquipmentReturn = result7;

            var result8 = WebApiManager.GetRequest <List <string> >(WebApiRequests.EquipmentSize);

            ViewBag.EquipmentSize = result8;

            var result9 = WebApiManager.GetRequest <List <string> >(WebApiRequests.ChassisProvider);

            ViewBag.ChassisProvider = result9;

            var result10 = WebApiManager.GetRequest <List <string> >(WebApiRequests.Broker);

            ViewBag.Broker = result10;


            var model = db.TemplatesWOes;
            var item  = model.FirstOrDefault(it => it.ID == ID);

            return(View("TemplateExternalEditFormView", item));
        }
 public ContentDetailViewModel()
 {
     IocHelper.EnsureIocKey(this);
     apiManager             = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
     appResources           = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);
     ContentStack           = new Stack <Content>();
     Comments               = new ObservableCollection <RelComment>();
     GoBackCommand          = new RelayCommand(GoBack);
     UpdateCommentCommand   = new RelayCommand(UpdateComment);
     PrevPageCommand        = new RelayCommand(PrevPage);
     NextPageCommand        = new RelayCommand(NextPage);
     SendCommentCommand     = new RelayCommand(SendComment);
     NavToCommentCommand    = new RelayCommand(NavToComment);
     GoBackToContentCommand = new RelayCommand(GoBackToContent);
     HasPrev   = false;
     PreSymbol = (char)0xE112;
 }
示例#20
0
 public ContentViewModel()
 {
     LocalPage            = 0;
     IsNotWebConnecting   = false;
     ParWidth             = _ParWidth;
     apiManager           = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocatorBase.ApiManagerKey);
     appResources         = SimpleIoc.Inst.GetInstance <IStringResource>(ViewModelLocatorBase.StringReourceKey);
     Contents             = new ObservableCollection <Content>();
     IsNotWebConnecting   = true;
     UpdateContentCommand = new RelayCommand(UpdateContent);
     SearchContentCommand = new RelayCommand(SearchContent);
     NextPageCommand      = new RelayCommand(NextPage);
     PrevPageCommand      = new RelayCommand(PrevPage);
     IocHelper.EnsureIocKey(this);
     MsgHandle.Add(SetVisitContentKey, SetVisitContent);
     MsgHandle.Add(SetLeftPartVisibilityKey, SetLeftPartVisibility);
 }
示例#21
0
 public SpotifyService(
     WebApiManager webApiManager,
     AuthorizationService spotifyServiceAuth,
     ContextsService spotifyServiceContext,
     ExploreService spotifyServiceExplore,
     LibraryService spotifyServiceLibrary,
     PlaybackService spotifyServicePlayback,
     UserService spotifyServiceUser)
 {
     dispatcher = webApiManager;
     Auth       = spotifyServiceAuth;
     Context    = spotifyServiceContext;
     Explore    = spotifyServiceExplore;
     Library    = spotifyServiceLibrary;
     Playback   = spotifyServicePlayback;
     User       = spotifyServiceUser;
 }
示例#22
0
 public ContentViewModel()
 {
     webApiManager          = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocator.WebApiManagerKey);
     SendFiles              = new List <ApiFileModel>();
     UpdateContentCommand   = new RelayCommand(UpdateContent);
     UpdateCommentCommand   = new RelayCommand(UpdateComment);
     SendContentCommand     = new RelayCommand(SendContent);
     SearchContentCommand   = new RelayCommand(SearchContent);
     SendCommentCommand     = new RelayCommand(SendComment);
     DeleteCommentCommand   = new RelayCommand(DeleteComment);
     DeleteContentCommand   = new RelayCommand(DeleteContent);
     NextContentPageCommand = new RelayCommand(NextContentPage);
     PrevContentPageCommand = new RelayCommand(PrevContentPage);
     PrevCommentCommand     = new RelayCommand(PrevCommentPage);
     NextCommentCommand     = new RelayCommand(NextCommentPage);
     Contents         = new ObservableCollection <Content>();
     Comments         = new ObservableCollection <Comment>();
     SearchedContents = new ObservableCollection <Content>();
 }
示例#23
0
    // === Core functions ========================================================================================================================================
    // ----------------------------------------------------------------
    void Start()
    {
        // Setting Manager and XML loading
        settingManager = SettingManager.instance;
        settingManager.LoadInternalSettings();
        debugger = YucoDebugger.instance;
        // UDP sender
        udpSender = GetComponent <UdpSender>();
        udpSender.SetServerInfo(settingManager.ip, 9999);
        // UDP receiver
        udpReceiver = GetComponent <UdpReceiver>();
        udpReceiver.StartListening(9998);
        udpReceiver.UdpReceived += OnUdpReceived;
        // Screensaver Timer
        screensaverTimer.SetTimeLimit(settingManager.idleTime);
        stillHerePopUp.SetTimeLimit(settingManager.stillHereCountdownTime);

        // Play BGM?
        if (settingManager.playBgm == true)
        {
            audioSrc_bgm.Play();
        }

        // Arrow X
        foreach (RectTransform arrow in lookCamArrows)
        {
            arrow.anchoredPosition = new Vector2(settingManager.arrowX, 0);
        }

        // Web API Manager
        webApiMgr = WebApiManager.instance;

        // Reset Game
        ResetGame();

        if (TouchManager.Instance != null)
        {
            TouchManager.Instance.PointersPressed += pointersPressedHandler;
        }
    }
示例#24
0
        public override async Task <TModelResponse> Handle(ExecuteRequest <TWebApi, TModelResponse, TApiResponse> request,
                                                           CancellationToken cancellationToken)
        {
            TApiResponse result;

            switch (request.ExecuteApiMethod)
            {
            case Expression <Func <TWebApi, Task <TApiResponse> > > executeApiMethod:
                result = await WebApiManager.ExecuteAsync(executeApiMethod)
                         .ConfigureAwait(false);

                break;

            case Expression <Func <CancellationToken, TWebApi, Task <TApiResponse> > > executeApiMethod:
                result = await WebApiManager.ExecuteAsync(executeApiMethod, cancellationToken)
                         .ConfigureAwait(false);

                break;

            case Expression <Func <TWebApi, IMappingHandler, Task <TApiResponse> > > executeApiMethod:
                result = await WebApiManager.ExecuteAsync(executeApiMethod)
                         .ConfigureAwait(false);

                break;

            case Expression <Func <CancellationToken, TWebApi, IMappingHandler, Task <TApiResponse> > > executeApiMethod:
                result = await WebApiManager.ExecuteAsync(executeApiMethod, cancellationToken)
                         .ConfigureAwait(false);

                break;

            default:
                throw new ApizrException <TApiResponse>(new NotImplementedException());
            }

            return(Map <TApiResponse, TModelResponse>(result));
        }
示例#25
0
 public UserService(WebApiManager webApiManager)
 {
     dispatcher = webApiManager;
 }
示例#26
0
        public ActionResult WorkOrderViewPartial()
        {
            var lst = WebApiManager.GetRequest <IEnumerable <WorkOrder> >(WebApiRequests.GetWorkOrders);

            return(PartialView("_WorkOrderViewPartial", lst));
        }
示例#27
0
 public MakeCommentViewModel()
 {
     webApiManager = SimpleIoc.Inst.GetInstance <WebApiManager>(ViewModelLocator.WebApiManagerKey);
     SendCommand   = new RelayCommand(Send);
 }