IsConnected() 공개 정적인 메소드

public static IsConnected ( ) : bool
리턴 bool
예제 #1
0
        public async void SaveUIElementStatesToCloud(string sceneAggregateId)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                var items = AppDatabase.Current.RetrieveUIElementStatesByScene(sceneAggregateId);
                foreach (var item in items)
                {
                    AzureMobileService.Current.PushToCloud(item);
                }

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }
예제 #2
0
        public async void SavePromoteToCloud(Promote promote)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                //var items = AppDatabase.Current.RetrieveSolutionsByGrouping(sessionId);
                //foreach (var item in items)
                //{
                AzureMobileService.Current.PushToCloud(promote);
                //}

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch
            {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }
예제 #3
0
        public async void PushToCloud(AppWideSetting appWideSetting)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                if (appWideSetting != null && !String.IsNullOrEmpty(appWideSetting.Id))
                {
                    await mstAppWideSetting.UpdateAsync(appWideSetting);
                }
                else
                {
                    appWideSetting.Id   = string.Empty;
                    appWideSetting.MSId = string.Empty;
                    await mstAppWideSetting.InsertAsync(appWideSetting);
                }

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch
            {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }
예제 #4
0
        public async void DeleteFavouriteFromCloud(Favourite fav)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            await mstFavourite.DeleteAsync(fav);
        }
예제 #5
0
        public async Task <List <Comment> > RetrieveCommentLessThanDateFromCloudAsync(DateTime dateStamp, int pageSize = 30)
        {
            if (!AppService.IsConnected())
            {
                return(null);
            }

            var result = await mstComment.Where(x => x.TimeStamp < dateStamp).OrderByDescending(x => x.TimeStamp).Take(pageSize).ToListAsync();

            return(result);
        }
예제 #6
0
        public async Task <List <Promote> > RetrievePromotedGreaterThanDateFromCloudAsync(DateTime dateStamp, int pageSize = 30)
        {
            if (!AppService.IsConnected())
            {
                return(null);
            }

            var result = await mstPromote.Where(x => x.TimeStamp > dateStamp).OrderBy(x => x.TimeStamp).Take(pageSize).ToListAsync();

            return(result.OrderByDescending(x => x.TimeStamp).ToList());
        }
예제 #7
0
        public async Task <List <Promote> > RetrievePromotedFromCloudAsync(int pageSize = 30)
        {
            if (!AppService.IsConnected())
            {
                return(null);
            }

            var result = await mstPromote.OrderByDescending(x => x.TimeStamp).Take(pageSize).ToListAsync();

            return(result);
        }
예제 #8
0
        public async Task <List <AppWideSetting> > RetrieveAppWideSettingFromCloudAsync()
        {
            if (!AppService.IsConnected())
            {
                return(null);
            }

            var result = await mstAppWideSetting.ToListAsync();

            return(result);
        }
예제 #9
0
        public async void PushToCloud(Promote promote)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                if (!string.IsNullOrEmpty(promote.MSId))
                {
                    string id = promote.Id;
                    promote.Id   = promote.MSId;
                    promote.MSId = id;
                    await mstPromote.UpdateAsync(promote);

                    promote.Id = id;
                }
                else
                {
                    promote.Id   = string.Empty;
                    promote.MSId = string.Empty;
                    await mstPromote.InsertAsync(promote);

                    //AppDatabase.Current.UpdateFavouriteField(favourite.AggregateId, "MSId", favourite.Id, false);
                }

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch
            {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }
예제 #10
0
        public async void PushToCloud(Scene scene)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                if (scene.MSId != 0)
                {
                    int id = scene.Id;
                    scene.Id   = scene.MSId;
                    scene.MSId = id;
                    await mstScene.UpdateAsync(scene);

                    scene.Id = id;
                }
                else
                {
                    scene.Id = 0;
                    await mstScene.InsertAsync(scene);

                    AppDatabase.Current.UpdateSceneField(scene.AggregateId, "MSId", scene.Id, false);
                }

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }
예제 #11
0
        public async void PushToCloud(Comment comment)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                if (!string.IsNullOrEmpty(comment.MSId))
                {
                    string id = comment.Id;
                    comment.Id   = comment.MSId;
                    comment.MSId = id;
                    await mstComment.UpdateAsync(comment);

                    comment.Id = id;
                }
                else
                {
                    comment.Id   = string.Empty;
                    comment.MSId = string.Empty;
                    await mstComment.InsertAsync(comment);
                }

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch
            {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }
예제 #12
0
        public async void SaveFeedbackToCloud(Feedback fb)
        {
            if (!AppService.IsConnected())
            {
                return;
            }

            try
            {
                AzureMobileService.Current.PushToCloud(fb);

                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "WRITE"
                });
            }
            catch
            {
                Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...")
                {
                    Identifier = "CLOUD BAR", SourceId = "AzureMobileService", Action = "ERROR"
                });
            }
        }