예제 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            prepareViews();

            Title             = ViewModel.Title;
            VersionLabel.Text = ViewModel.Version;

            LoggingOutView.Hidden          = true;
            SendFeedbackSuccessView.Hidden = true;

            this.Bind(ViewModel.Email, EmailLabel.Rx().Text());
            this.Bind(ViewModel.IsSynced, SyncedView.Rx().IsVisible());
            this.Bind(ViewModel.WorkspaceName, WorkspaceLabel.Rx().Text());
            this.Bind(ViewModel.DurationFormat, DurationFormatLabel.Rx().Text());
            this.Bind(ViewModel.IsRunningSync, SyncingView.Rx().IsVisible());
            this.Bind(ViewModel.DateFormat, DateFormatLabel.Rx().Text());
            this.Bind(ViewModel.BeginningOfWeek, BeginningOfWeekLabel.Rx().Text());
            this.Bind(ViewModel.IsFeedbackSuccessViewShowing, SendFeedbackSuccessView.Rx().AnimatedIsVisible());
            this.BindVoid(ViewModel.LoggingOut, () =>
            {
                LoggingOutView.Hidden = false;
                SyncingView.Hidden    = true;
                SyncedView.Hidden     = true;
            });

            this.Bind(HelpView.Rx().Tap(), ViewModel.OpenHelpView);
            this.Bind(LogoutButton.Rx().Tap(), ViewModel.TryLogout);
            this.Bind(AboutView.Rx().Tap(), ViewModel.OpenAboutView);
            this.Bind(FeedbackView.Rx().Tap(), ViewModel.SubmitFeedback);
            this.Bind(DateFormatView.Rx().Tap(), ViewModel.SelectDateFormat);
            this.Bind(WorkspaceView.Rx().Tap(), ViewModel.PickDefaultWorkspace);
            this.Bind(DurationFormatView.Rx().Tap(), ViewModel.SelectDurationFormat);
            this.BindVoid(ManualModeSwitch.Rx().Changed(), ViewModel.ToggleManualMode);
            this.Bind(BeginningOfWeekView.Rx().Tap(), ViewModel.SelectBeginningOfWeek);
            this.Bind(CalendarSettingsView.Rx().Tap(), ViewModel.OpenCalendarSettingsAction);
            this.BindVoid(SendFeedbackSuccessView.Rx().Tap(), ViewModel.CloseFeedbackSuccessView);
            this.Bind(NotificationSettingsView.Rx().Tap(), ViewModel.OpenNotificationSettingsAction);
            this.Bind(TwentyFourHourClockSwitch.Rx().Changed(), ViewModel.ToggleUseTwentyFourHourClock);

            UIApplication.Notifications
            .ObserveWillEnterForeground((sender, e) => startAnimations())
            .DisposedBy(DisposeBag);

            if (!ViewModel.CalendarSettingsEnabled)
            {
                hideCalendarSettingsSection();
            }

            ViewModel.IsManualModeEnabled
            .FirstAsync()
            .Subscribe(isEnabled => ManualModeSwitch.SetState(isEnabled, false))
            .DisposedBy(DisposeBag);

            ViewModel.UseTwentyFourHourFormat
            .FirstAsync()
            .Subscribe(useTwentyFourHourFormat => TwentyFourHourClockSwitch.SetState(useTwentyFourHourFormat, false))
            .DisposedBy(DisposeBag);
        }
예제 #2
0
        private void OnInstantFeedback(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Instant Feedback Clicked");
            var feedbackView = new FeedbackView();

            feedbackView.Show();
        }
 private void SetFeedbackInfo(FeedbackView feedbackView)
 {
     txt_Person.Text = feedbackView.Person;
     txt_Date.Text = feedbackView.FeedbackDate;
     txt_State.Text = feedbackView.FeedbackState;
     txt_Remark.Text = feedbackView.Remark;
 }
예제 #4
0
        private void OnTechnicalSupport(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Technical Support Clicked");
            var feedbackView = new FeedbackView();

            feedbackView.Show();
        }
 private void SetFeedbackInfo(FeedbackView feedbackView)
 {
     txt_Person.Text = feedbackView.Person;
     txt_Date.Text   = feedbackView.FeedbackDate;
     txt_State.Text  = feedbackView.FeedbackState;
     txt_Remark.Text = feedbackView.Remark;
 }
        private void OnMailTss(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Mail TSS Clicked");
            string path         = TechnicalSupportInfoBuilder.CreateAndGetTechnicalSupportInfoAsTextFile(true);
            var    feedbackView = new FeedbackView(path);

            feedbackView.Show();
        }
예제 #7
0
        public Domain.Models.ResultModel AddFeedback(FeedbackView model)
        {
            var result = new ResultModel()
            {
                Data = base._database.Db.Feedback.Insert(model)
            };

            return(result);
        }
예제 #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var viewModel = new FeedbackViewModel(new WpfSender(), new Clock());
            var view      = new FeedbackView {
                ViewModel = viewModel
            };

            view.Show();
            base.OnStartup(e);
        }
예제 #9
0
 private async void OnFeedbackTapped(object sender, TappedRoutedEventArgs e)
 {
     try
     {
         // Launch SIUF interface
         await FeedbackView.LaunchFeedbackAsync(null);
     }
     catch (Exception ex)
     {
         TelemetryHelper.TrackExceptionAsync(ex);
     }
 }
예제 #10
0
 public ActionResult Feedback(FeedbackView FV)
 {
     using (CMSProjectEntities db = new CMSProjectEntities())
     {
         CMSProject.Models.DB.Feedback FB = new Feedback();
         FB.Description = FV.Description;
         UserManager UM                 = new UserManager();
         var         username           = System.Web.HttpContext.Current.User.Identity.Name;
         CMSProject.Models.DB.User user = db.Users.Where(o => o.Username.Equals(username)).FirstOrDefault();
         FB.CustomerID = db.CustomerUsers.Where(o => o.UserID.Equals(user.UserID)).FirstOrDefault().CustomerID;
         db.Feedbacks.Add(FB);
         db.SaveChanges();
     }
     return(RedirectToAction("Index", "Home"));
 }
예제 #11
0
        private void OnSubmitComment()
        {
            var model     = new FeedbackModel();
            var viewModel = new FeedbackViewModel(model, Title);
            var view      = new FeedbackView
            {
                DataContext = viewModel
            };

            var unused = new WindowInteropHelper(view)
            {
                Owner = Process.GetCurrentProcess().MainWindowHandle
            };

            view.ShowDialog();
        }
예제 #12
0
        private static void OnSubmitComment()
        {
            var title     = "Mission Control - Styles Manager v." + Assembly.GetExecutingAssembly().GetName().Version;
            var model     = new FeedbackModel();
            var viewModel = new FeedbackViewModel(model, title);
            var view      = new FeedbackView
            {
                DataContext = viewModel
            };

            var unused = new WindowInteropHelper(view)
            {
                Owner = Process.GetCurrentProcess().MainWindowHandle
            };

            view.ShowDialog();
        }
예제 #13
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            prepareViews();

            Title             = ViewModel.Title;
            VersionLabel.Text = ViewModel.Version;

            LoggingOutView.Hidden          = true;
            SendFeedbackSuccessView.Hidden = true;

            this.Bind(ViewModel.Email, EmailLabel.BindText());
            this.Bind(ViewModel.IsSynced, SyncedView.BindIsVisible());
            this.Bind(ViewModel.WorkspaceName, WorkspaceLabel.BindText());
            this.Bind(ViewModel.DurationFormat, DurationFormatLabel.BindText());
            this.Bind(ViewModel.IsRunningSync, SyncingView.BindIsVisible());
            this.Bind(ViewModel.DateFormat, DateFormatLabel.BindText());
            this.Bind(ViewModel.IsManualModeEnabled, ManualModeSwitch.BindIsOn());
            this.Bind(ViewModel.BeginningOfWeek, BeginningOfWeekLabel.BindText());
            this.Bind(ViewModel.UseTwentyFourHourFormat, TwentyFourHourClockSwitch.BindIsOn());
            this.BindVoid(ViewModel.LoggingOut, () =>
            {
                LoggingOutView.Hidden = false;
                SyncingView.Hidden    = true;
                SyncedView.Hidden     = true;
            });
            this.Bind(ViewModel.IsFeedbackSuccessViewShowing, SendFeedbackSuccessView.BindAnimatedIsVisible());

            this.Bind(HelpView.Tapped(), ViewModel.OpenHelpView);
            this.Bind(LogoutButton.Tapped(), ViewModel.TryLogout);
            this.Bind(AboutView.Tapped(), ViewModel.OpenAboutView);
            this.Bind(FeedbackView.Tapped(), ViewModel.SubmitFeedback);
            this.Bind(DateFormatView.Tapped(), ViewModel.SelectDateFormat);
            this.Bind(WorkspaceView.Tapped(), ViewModel.PickDefaultWorkspace);
            this.BindVoid(ManualModeView.Tapped(), ViewModel.ToggleManualMode);
            this.Bind(DurationFormatView.Tapped(), ViewModel.SelectDurationFormat);
            this.Bind(BeginningOfWeekView.Tapped(), ViewModel.SelectBeginningOfWeek);
            this.Bind(TwentyFourHourClockView.Tapped(), ViewModel.ToggleUseTwentyFourHourClock);
            this.BindVoid(SendFeedbackSuccessView.Tapped(), ViewModel.CloseFeedbackSuccessView);

            UIApplication.Notifications
            .ObserveWillEnterForeground((sender, e) => startAnimations())
            .DisposedBy(DisposeBag);
        }
예제 #14
0
        public override void OnFrameworkInitializationCompleted()
        {
#if DEBUG
            SerilogLogger.Initialize(new LoggerConfiguration()
                                     .MinimumLevel.Warning()
                                     .WriteTo.Trace(outputTemplate: "{Area}: {Message}")
                                     .CreateLogger());
#endif
            var view    = new FeedbackView();
            var context = new FeedbackViewModel(
                new AvaloniaSender(view),
                new Clock());

            view.DataContext = context;
            view.Show();

            base.OnFrameworkInitializationCompleted();
        }
예제 #15
0
        public List <FeedbackView> GetFeedbackViews()
        {
            List <FeedbackView> feedbacks = new List <FeedbackView>();

            using (CMSProjectEntities db = new CMSProjectEntities())
            {
                var feed = db.Feedbacks.ToList();
                foreach (Feedback f in feed)
                {
                    FeedbackView FV = new FeedbackView();
                    FV.FeedbackID  = f.FeedbackID;
                    FV.CustomerID  = f.CustomerID;
                    FV.Description = f.Description;
                    var cuid  = db.CustomerUsers.Where(o => o.CustomerID.Equals(FV.CustomerID)).FirstOrDefault();
                    var cname = db.UserProfiles.Where(o => o.UserID.Equals(cuid.UserID)).FirstOrDefault();
                    FV.CustomerName = cname.FirstName + " " + cname.LastName;
                    feedbacks.Add(FV);
                }
            }
            return(feedbacks);
        }
예제 #16
0
파일: Feedback.cs 프로젝트: rudimk/HAMMER
        public static async Task<FeedbackResult> ShowFeedback()
        {
            var result = new FeedbackResult();
            var tcs = new TaskCompletionSource<int>();
            var p = new Popup
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Width = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height,
                
            };

            var f = new FeedbackView
                        {
                            VerticalAlignment = VerticalAlignment.Bottom,
                            HorizontalAlignment = HorizontalAlignment.Left,
                            Results = (r) =>
                                          {

                                              result = r;
                                              tcs.TrySetResult(1);
                                              p.IsOpen = false;
                                          }
                        };
            var g = new Grid
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Width = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height,
            };
            g.Children.Add(f);
            p.Child = g;
            p.IsOpen = true;
            await tcs.Task;
            return result;
        }
        void ReleaseDesignerOutlets()
        {
            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (WorkspaceLabel != null)
            {
                WorkspaceLabel.Dispose();
                WorkspaceLabel = null;
            }

            if (PlanLabel != null)
            {
                PlanLabel.Dispose();
                PlanLabel = null;
            }

            if (TwentyFourHourClockSwitch != null)
            {
                TwentyFourHourClockSwitch.Dispose();
                TwentyFourHourClockSwitch = null;
            }

            if (AddMobileTagSwitch != null)
            {
                AddMobileTagSwitch.Dispose();
                AddMobileTagSwitch = null;
            }

            if (FeedbackView != null)
            {
                FeedbackView.Dispose();
                FeedbackView = null;
            }

            if (RateView != null)
            {
                RateView.Dispose();
                RateView = null;
            }

            if (UpdateView != null)
            {
                UpdateView.Dispose();
                UpdateView = null;
            }

            if (HelpView != null)
            {
                HelpView.Dispose();
                HelpView = null;
            }

            if (VersionLabel != null)
            {
                VersionLabel.Dispose();
                VersionLabel = null;
            }

            if (AddMobileTagView != null)
            {
                AddMobileTagView.Dispose();
                AddMobileTagView = null;
            }

            if (TwentyFourHourClockView != null)
            {
                TwentyFourHourClockView.Dispose();
                TwentyFourHourClockView = null;
            }

            if (SubscriptionView != null)
            {
                SubscriptionView.Dispose();
                SubscriptionView = null;
            }

            if (WorkspaceView != null)
            {
                WorkspaceView.Dispose();
                WorkspaceView = null;
            }

            if (EmailView != null)
            {
                EmailView.Dispose();
                EmailView = null;
            }

            if (LoggingOutIndicator != null)
            {
                LoggingOutIndicator.Dispose();
                LoggingOutIndicator = null;
            }

            if (LoggingOutLabel != null)
            {
                LoggingOutLabel.Dispose();
                LoggingOutLabel = null;
            }

            if (LoggingOutView != null)
            {
                LoggingOutView.Dispose();
                LoggingOutView = null;
            }

            if (LogoutButton != null)
            {
                LogoutButton.Dispose();
                LogoutButton = null;
            }

            if (SyncedIcon != null)
            {
                SyncedIcon.Dispose();
                SyncedIcon = null;
            }

            if (SyncedLabel != null)
            {
                SyncedLabel.Dispose();
                SyncedLabel = null;
            }

            if (SyncedView != null)
            {
                SyncedView.Dispose();
                SyncedView = null;
            }

            if (SyncingIndicator != null)
            {
                SyncingIndicator.Dispose();
                SyncingIndicator = null;
            }

            if (SyncingLabel != null)
            {
                SyncingLabel.Dispose();
                SyncingLabel = null;
            }

            if (SyncingView != null)
            {
                SyncingView.Dispose();
                SyncingView = null;
            }
        }
 private void feedback_Click(object sender, RoutedEventArgs e)
 {
     FeedbackView pop = new FeedbackView();
     pop.WindowStartupLocation = WindowStartupLocation.CenterScreen;
     pop.Show();
 }
예제 #19
0
        void ReleaseDesignerOutlets()
        {
            if (AboutView != null)
            {
                AboutView.Dispose();
                AboutView = null;
            }

            if (BeginningOfWeekLabel != null)
            {
                BeginningOfWeekLabel.Dispose();
                BeginningOfWeekLabel = null;
            }

            if (BeginningOfWeekView != null)
            {
                BeginningOfWeekView.Dispose();
                BeginningOfWeekView = null;
            }

            if (DateFormatLabel != null)
            {
                DateFormatLabel.Dispose();
                DateFormatLabel = null;
            }

            if (DateFormatView != null)
            {
                DateFormatView.Dispose();
                DateFormatView = null;
            }

            if (DurationFormatLabel != null)
            {
                DurationFormatLabel.Dispose();
                DurationFormatLabel = null;
            }

            if (DurationFormatView != null)
            {
                DurationFormatView.Dispose();
                DurationFormatView = null;
            }

            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (EmailView != null)
            {
                EmailView.Dispose();
                EmailView = null;
            }

            if (FeedbackView != null)
            {
                FeedbackView.Dispose();
                FeedbackView = null;
            }

            if (FormatSettingsTitle != null)
            {
                FormatSettingsTitle.Dispose();
                FormatSettingsTitle = null;
            }

            if (LoggingOutActivityIndicatorView != null)
            {
                LoggingOutActivityIndicatorView.Dispose();
                LoggingOutActivityIndicatorView = null;
            }

            if (LoggingOutIndicator != null)
            {
                LoggingOutIndicator.Dispose();
                LoggingOutIndicator = null;
            }

            if (LoggingOutLabel != null)
            {
                LoggingOutLabel.Dispose();
                LoggingOutLabel = null;
            }

            if (LoggingOutView != null)
            {
                LoggingOutView.Dispose();
                LoggingOutView = null;
            }

            if (LogoutButton != null)
            {
                LogoutButton.Dispose();
                LogoutButton = null;
            }

            if (LogoutContainerView != null)
            {
                LogoutContainerView.Dispose();
                LogoutContainerView = null;
            }

            if (LogoutVerticalOffsetConstraint != null)
            {
                LogoutVerticalOffsetConstraint.Dispose();
                LogoutVerticalOffsetConstraint = null;
            }

            if (ManualModeSwitch != null)
            {
                ManualModeSwitch.Dispose();
                ManualModeSwitch = null;
            }

            if (ManualModeView != null)
            {
                ManualModeView.Dispose();
                ManualModeView = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

            if (SyncedIcon != null)
            {
                SyncedIcon.Dispose();
                SyncedIcon = null;
            }

            if (SyncedLabel != null)
            {
                SyncedLabel.Dispose();
                SyncedLabel = null;
            }

            if (SyncedView != null)
            {
                SyncedView.Dispose();
                SyncedView = null;
            }

            if (SyncingActivityIndicatorView != null)
            {
                SyncingActivityIndicatorView.Dispose();
                SyncingActivityIndicatorView = null;
            }

            if (HelpView != null)
            {
                HelpView.Dispose();
                HelpView = null;
            }

            if (SyncingIndicator != null)
            {
                SyncingIndicator.Dispose();
                SyncingIndicator = null;
            }

            if (SyncingLabel != null)
            {
                SyncingLabel.Dispose();
                SyncingLabel = null;
            }

            if (SyncingView != null)
            {
                SyncingView.Dispose();
                SyncingView = null;
            }

            if (TopConstraint != null)
            {
                TopConstraint.Dispose();
                TopConstraint = null;
            }

            if (TwentyFourHourClockSwitch != null)
            {
                TwentyFourHourClockSwitch.Dispose();
                TwentyFourHourClockSwitch = null;
            }

            if (TwentyFourHourClockView != null)
            {
                TwentyFourHourClockView.Dispose();
                TwentyFourHourClockView = null;
            }

            if (VersionLabel != null)
            {
                VersionLabel.Dispose();
                VersionLabel = null;
            }

            if (WorkspaceLabel != null)
            {
                WorkspaceLabel.Dispose();
                WorkspaceLabel = null;
            }

            if (WorkspaceView != null)
            {
                WorkspaceView.Dispose();
                WorkspaceView = null;
            }
        }
예제 #20
0
        void ReleaseDesignerOutlets()
        {
            if (AboutCellLabel != null)
            {
                AboutCellLabel.Dispose();
                AboutCellLabel = null;
            }

            if (AboutView != null)
            {
                AboutView.Dispose();
                AboutView = null;
            }

            if (BeginningOfWeekLabel != null)
            {
                BeginningOfWeekLabel.Dispose();
                BeginningOfWeekLabel = null;
            }

            if (BeginningOfWeekView != null)
            {
                BeginningOfWeekView.Dispose();
                BeginningOfWeekView = null;
            }

            if (CalendarSectionTopConstraint != null)
            {
                CalendarSectionTopConstraint.Dispose();
                CalendarSectionTopConstraint = null;
            }

            if (CalendarSettingsCellLabel != null)
            {
                CalendarSettingsCellLabel.Dispose();
                CalendarSettingsCellLabel = null;
            }

            if (CalendarSettingsSection != null)
            {
                CalendarSettingsSection.Dispose();
                CalendarSettingsSection = null;
            }

            if (CalendarSettingsView != null)
            {
                CalendarSettingsView.Dispose();
                CalendarSettingsView = null;
            }

            if (DateFormatCellLabel != null)
            {
                DateFormatCellLabel.Dispose();
                DateFormatCellLabel = null;
            }

            if (DateFormatLabel != null)
            {
                DateFormatLabel.Dispose();
                DateFormatLabel = null;
            }

            if (DateFormatView != null)
            {
                DateFormatView.Dispose();
                DateFormatView = null;
            }

            if (DurationFormatCellLabel != null)
            {
                DurationFormatCellLabel.Dispose();
                DurationFormatCellLabel = null;
            }

            if (DurationFormatLabel != null)
            {
                DurationFormatLabel.Dispose();
                DurationFormatLabel = null;
            }

            if (DurationFormatView != null)
            {
                DurationFormatView.Dispose();
                DurationFormatView = null;
            }

            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (EmailView != null)
            {
                EmailView.Dispose();
                EmailView = null;
            }

            if (FeedbackToastTextLabel != null)
            {
                FeedbackToastTextLabel.Dispose();
                FeedbackToastTextLabel = null;
            }

            if (FeedbackToastTitleLabel != null)
            {
                FeedbackToastTitleLabel.Dispose();
                FeedbackToastTitleLabel = null;
            }

            if (FeedbackView != null)
            {
                FeedbackView.Dispose();
                FeedbackView = null;
            }

            if (FirstDayOfTheWeekCellLabel != null)
            {
                FirstDayOfTheWeekCellLabel.Dispose();
                FirstDayOfTheWeekCellLabel = null;
            }

            if (FormatSettingsHeaderLabel != null)
            {
                FormatSettingsHeaderLabel.Dispose();
                FormatSettingsHeaderLabel = null;
            }

            if (FormatSettingsTitle != null)
            {
                FormatSettingsTitle.Dispose();
                FormatSettingsTitle = null;
            }

            if (HelpCellLabel != null)
            {
                HelpCellLabel.Dispose();
                HelpCellLabel = null;
            }

            if (HelpView != null)
            {
                HelpView.Dispose();
                HelpView = null;
            }

            if (LoggingOutActivityIndicatorView != null)
            {
                LoggingOutActivityIndicatorView.Dispose();
                LoggingOutActivityIndicatorView = null;
            }

            if (LoggingOutIndicator != null)
            {
                LoggingOutIndicator.Dispose();
                LoggingOutIndicator = null;
            }

            if (LoggingOutLabel != null)
            {
                LoggingOutLabel.Dispose();
                LoggingOutLabel = null;
            }

            if (LoggingOutView != null)
            {
                LoggingOutView.Dispose();
                LoggingOutView = null;
            }

            if (LogoutButton != null)
            {
                LogoutButton.Dispose();
                LogoutButton = null;
            }

            if (LogoutContainerView != null)
            {
                LogoutContainerView.Dispose();
                LogoutContainerView = null;
            }

            if (LogoutVerticalOffsetConstraint != null)
            {
                LogoutVerticalOffsetConstraint.Dispose();
                LogoutVerticalOffsetConstraint = null;
            }

            if (ManualModeCellLabel != null)
            {
                ManualModeCellLabel.Dispose();
                ManualModeCellLabel = null;
            }

            if (ManualModeDescriptionLabel != null)
            {
                ManualModeDescriptionLabel.Dispose();
                ManualModeDescriptionLabel = null;
            }

            if (ManualModeSwitch != null)
            {
                ManualModeSwitch.Dispose();
                ManualModeSwitch = null;
            }

            if (ManualModeView != null)
            {
                ManualModeView.Dispose();
                ManualModeView = null;
            }

            if (NotificationSettingsView != null)
            {
                NotificationSettingsView.Dispose();
                NotificationSettingsView = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

            if (SendFeedbackSuccessView != null)
            {
                SendFeedbackSuccessView.Dispose();
                SendFeedbackSuccessView = null;
            }

            if (SmartAlertCellLabel != null)
            {
                SmartAlertCellLabel.Dispose();
                SmartAlertCellLabel = null;
            }

            if (SubmitFeedbackCellLabel != null)
            {
                SubmitFeedbackCellLabel.Dispose();
                SubmitFeedbackCellLabel = null;
            }

            if (SyncedIcon != null)
            {
                SyncedIcon.Dispose();
                SyncedIcon = null;
            }

            if (SyncedLabel != null)
            {
                SyncedLabel.Dispose();
                SyncedLabel = null;
            }

            if (SyncedView != null)
            {
                SyncedView.Dispose();
                SyncedView = null;
            }

            if (SyncingActivityIndicatorView != null)
            {
                SyncingActivityIndicatorView.Dispose();
                SyncingActivityIndicatorView = null;
            }

            if (SyncingIndicator != null)
            {
                SyncingIndicator.Dispose();
                SyncingIndicator = null;
            }

            if (SyncingLabel != null)
            {
                SyncingLabel.Dispose();
                SyncingLabel = null;
            }

            if (SyncingView != null)
            {
                SyncingView.Dispose();
                SyncingView = null;
            }

            if (TopConstraint != null)
            {
                TopConstraint.Dispose();
                TopConstraint = null;
            }

            if (TwentyFourHourClockSwitch != null)
            {
                TwentyFourHourClockSwitch.Dispose();
                TwentyFourHourClockSwitch = null;
            }

            if (TwentyFourHourClockView != null)
            {
                TwentyFourHourClockView.Dispose();
                TwentyFourHourClockView = null;
            }

            if (Use24HourClockCellLabel != null)
            {
                Use24HourClockCellLabel.Dispose();
                Use24HourClockCellLabel = null;
            }

            if (VersionLabel != null)
            {
                VersionLabel.Dispose();
                VersionLabel = null;
            }

            if (WorkspaceCellLabel != null)
            {
                WorkspaceCellLabel.Dispose();
                WorkspaceCellLabel = null;
            }

            if (WorkspaceLabel != null)
            {
                WorkspaceLabel.Dispose();
                WorkspaceLabel = null;
            }

            if (WorkspaceView != null)
            {
                WorkspaceView.Dispose();
                WorkspaceView = null;
            }

            if (YourProfileCellLabel != null)
            {
                YourProfileCellLabel.Dispose();
                YourProfileCellLabel = null;
            }

            if (GroupSimilarTimeEntriesLabel != null)
            {
                GroupSimilarTimeEntriesLabel.Dispose();
                GroupSimilarTimeEntriesLabel = null;
            }

            if (GroupSimilarTimeEntriesSwitch != null)
            {
                GroupSimilarTimeEntriesSwitch.Dispose();
                GroupSimilarTimeEntriesSwitch = null;
            }
        }
예제 #21
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            GroupSimilarTimeEntriesLabel.Text = Resources.GroupTimeEntries;
            YourProfileCellLabel.Text         = Resources.YourProfile;
            WorkspaceCellLabel.Text           = Resources.Workspace;
            FormatSettingsHeaderLabel.Text    = Resources.FormatSettings;
            DateFormatCellLabel.Text          = Resources.DateFormat;
            Use24HourClockCellLabel.Text      = Resources.Use24HourClock;
            DurationFormatCellLabel.Text      = Resources.DurationFormat;
            FirstDayOfTheWeekCellLabel.Text   = Resources.FirstDayOfTheWeek;
            ManualModeCellLabel.Text          = Resources.ManualMode;
            ManualModeDescriptionLabel.Text   = Resources.ManualModeDescription;
            CalendarSettingsCellLabel.Text    = Resources.CalendarSettingsTitle;
            SmartAlertCellLabel.Text          = Resources.SmartAlerts;
            SubmitFeedbackCellLabel.Text      = Resources.SubmitFeedback;
            AboutCellLabel.Text          = Resources.About;
            HelpCellLabel.Text           = Resources.Help;
            LoggingOutLabel.Text         = Resources.LoggingOutSecurely;
            SyncingLabel.Text            = Resources.Syncing;
            SyncedLabel.Text             = Resources.SyncCompleted;
            FeedbackToastTitleLabel.Text = Resources.DoneWithExclamationMark.ToUpper();
            FeedbackToastTextLabel.Text  = Resources.ThankYouForTheFeedback;
            LogoutButton.SetTitle(Resources.SignOutOfToggl, UIControlState.Normal);

            prepareViews();

            Title             = ViewModel.Title;
            VersionLabel.Text = ViewModel.Version;

            LoggingOutView.Hidden          = true;
            SendFeedbackSuccessView.Hidden = true;

            ViewModel.Email
            .Subscribe(EmailLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.IsSynced
            .Subscribe(SyncedView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.WorkspaceName
            .Subscribe(WorkspaceLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.DurationFormat
            .Subscribe(DurationFormatLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.IsRunningSync
            .Subscribe(SyncingView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.DateFormat
            .Subscribe(DateFormatLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.BeginningOfWeek
            .Subscribe(BeginningOfWeekLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.IsFeedbackSuccessViewShowing
            .Subscribe(SendFeedbackSuccessView.Rx().AnimatedIsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.LoggingOut
            .Subscribe(_ =>
            {
                LoggingOutView.Hidden = false;
                SyncingView.Hidden    = true;
                SyncedView.Hidden     = true;
            })
            .DisposedBy(DisposeBag);

            HelpView.Rx()
            .BindAction(ViewModel.OpenHelpView)
            .DisposedBy(DisposeBag);

            LogoutButton.Rx()
            .BindAction(ViewModel.TryLogout)
            .DisposedBy(DisposeBag);

            AboutView.Rx()
            .BindAction(ViewModel.OpenAboutView)
            .DisposedBy(DisposeBag);

            FeedbackView.Rx()
            .BindAction(ViewModel.SubmitFeedback)
            .DisposedBy(DisposeBag);

            DateFormatView.Rx()
            .BindAction(ViewModel.SelectDateFormat)
            .DisposedBy(DisposeBag);

            WorkspaceView.Rx()
            .BindAction(ViewModel.PickDefaultWorkspace)
            .DisposedBy(DisposeBag);

            DurationFormatView.Rx()
            .BindAction(ViewModel.SelectDurationFormat)
            .DisposedBy(DisposeBag);

            ManualModeSwitch.Rx().Changed()
            .Subscribe(ViewModel.ToggleManualMode)
            .DisposedBy(DisposeBag);

            GroupSimilarTimeEntriesSwitch.Rx()
            .BindAction(ViewModel.ToggleTimeEntriesGrouping)
            .DisposedBy(DisposeBag);

            BeginningOfWeekView.Rx()
            .BindAction(ViewModel.SelectBeginningOfWeek)
            .DisposedBy(DisposeBag);

            CalendarSettingsView.Rx()
            .BindAction(ViewModel.OpenCalendarSettings)
            .DisposedBy(DisposeBag);

            SendFeedbackSuccessView.Rx().Tap()
            .Subscribe(ViewModel.CloseFeedbackSuccessView)
            .DisposedBy(DisposeBag);

            NotificationSettingsView.Rx()
            .BindAction(ViewModel.OpenNotificationSettings)
            .DisposedBy(DisposeBag);

            TwentyFourHourClockSwitch.Rx().Changed()
            .Subscribe(ViewModel.ToggleTwentyFourHourSettings.Inputs)
            .DisposedBy(DisposeBag);

            UIApplication.Notifications
            .ObserveWillEnterForeground((sender, e) => startAnimations())
            .DisposedBy(DisposeBag);

            if (!ViewModel.CalendarSettingsEnabled)
            {
                hideCalendarSettingsSection();
            }

            ViewModel.IsManualModeEnabled
            .FirstAsync()
            .Subscribe(isEnabled => ManualModeSwitch.SetState(isEnabled, false))
            .DisposedBy(DisposeBag);

            ViewModel.IsGroupingTimeEntries
            .FirstAsync()
            .Subscribe(isGrouping => GroupSimilarTimeEntriesSwitch.SetState(isGrouping, false))
            .DisposedBy(DisposeBag);

            ViewModel.UseTwentyFourHourFormat
            .FirstAsync()
            .Subscribe(useTwentyFourHourFormat => TwentyFourHourClockSwitch.SetState(useTwentyFourHourFormat, false))
            .DisposedBy(DisposeBag);
        }
 private void feedback_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         FeedbackView pop = new FeedbackView();
         pop.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         pop.Show();
     }
     catch (Exception exception)
     {
         ErrorViewModel.Save(exception, exception.GetType());
     }
 }