示例#1
0
		public ShellViewModel(IWindowManager windowManager, ISpotifyController spotifyController, ICoverService coverService, IEventAggregator eventAggregator, AppSettings settings, Core.ILog logger, IUpdateService updateService, IUsageTrackerService usageTrackerService, IBroadcastService broadcastService) {
			_WindowManager = windowManager;
			_SpotifyController = spotifyController;
			_CoverService = coverService;
			_EventAggregator = eventAggregator;
			_Settings = settings;
			_Logger = logger;
			_UpdateService = updateService;
			_UsageTrackerService = usageTrackerService;
			_BroadcastService = broadcastService;
			_ApplicationSize = _Settings.ApplicationSize;

			CoverImage = NoCoverUri;
			UpdateView();

			_SpotifyController.TrackChanged += (o, e) => UpdateView();
			_SpotifyController.SpotifyOpened += (o, e) => SpotifyOpened();
			_SpotifyController.SpotifyExited += (o, e) => SpotifyExited();
			_UpdateService.UpdateReady += UpdateReady;
			_UpdateService.StartBackgroundCheck();
			_UsageTrackerService.Track();

			_BroadcastService.BroadcastMessageReceived += BroadcastMessageReceived;
			_BroadcastService.StartListening();

			_Settings.PropertyChanged += (o, e) => {
				                             if (e.PropertyName == ApplicationSize.GetType().Name)
					                             ApplicationSize = _Settings.ApplicationSize;
			                             };
		}
示例#2
0
        /// <summary>
        /// ��������״̬�仯�¼�
        /// </summary>
        /// <param name="updateServiceService"></param>
        public void UpdateState(IUpdateService updateServiceService)
        {
            if (this.panelState.InvokeRequired)
            {
                this.panelState.Invoke(new MethodInvoker(delegate { UpdateState(updateServiceService); }));
            }
            else
            {
                UpdateState state = updateServiceService.State;
                panelState.BackColor = _defaultColore;

                switch (state)
                {
                    case AutoUpdate.UpdateState.Success:
                    case AutoUpdate.UpdateState.AfterUpdate:
                        panelState.BackColor = Color.Green;

                        break;
                    case AutoUpdate.UpdateState.Fail:
                        panelState.BackColor = Color.Red;
                        break;
                }
                this.lblState.Text = string.Format("{0}", Util.GetDescription(state));
            }
        }
示例#3
0
 public UpdateReadyViewModel(IUpdateService updateController, AppContracts contracts, Version newVersion, List<Release> changelog) {
     _UpdateController = updateController;
     _Contracts = contracts;
     NewVersion = newVersion.ToString();
     DisplayName = string.Format("Update ready - {0}", _Contracts.ApplicationName);
     Changelog = changelog.Where(r => r.ReleaseVersion > contracts.ApplicationVersion).OrderByDescending(r => r.ReleaseVersion).ToList();
 }
示例#4
0
        public QuietSupport()
        {
            var loc = new LocalServiceLocator();

            Update = loc.UpdateService;
            UpdateSettings = loc.UpdateSettingsService;
        }
 public PostPreparationOperation(
     IUpdateService updateService,
     IEnvironmentInformation environmentInformation,
     ITrayPreparationOperation trayPreparationOperation)
 {
     this.updateService = updateService;
     this.environmentInformation = environmentInformation;
     this.trayPreparationOperation = trayPreparationOperation;
 }
示例#6
0
 public UCUpdateState(IUpdateService updateServiceService)
 {
     InitializeComponent();
     if (this.DesignMode)
     {
         return;
     }
     this.panelState.Height = this.Height;
     this.Title = updateServiceService.Title;
 }
示例#7
0
 public InstallingViewModel()
 {
     Messenger.Default.Register<InstallationProgressMessage>(this, HandleMessage);
     var loc = new LocalServiceLocator();
     update = loc.UpdateService;
     nav = loc.NavigationService;
     Automation = loc.AutomationService;
     Loaded += OnLoaded;
     Title = "CoApp Update";
 }
 public AdminController(
     IUserAuthentication authentication,
     ILoginService loginService,
     IAdminService adminService,
     IUpdateService updateService)
     : base(authentication, loginService)
 {
     this.adminService = adminService;
     this.updateService = updateService;
 }
 public NotificationController(IGoalService goalService, IUpdateService updateService, ICommentService commentService, IGroupInvitationService groupInvitationService, ISupportInvitationService supportInvitationService, IFollowRequestService followRequestService, IUserService userService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.updateService = updateService;
     this.groupInvitationService = groupInvitationService;
     this.commentService = commentService;
     this.followRequestService = followRequestService;
     this.userService = userService;
 }
 public MainFormController()
 {
     Guard = ServiceLocator.GetInstance<IGuard>();
     projectService = ServiceLocator.GetInstance<IProjectService>();
     aboutboxService = ServiceLocator.GetInstance<IAboutBoxService>();
     settingsFormService = ServiceLocator.GetInstance<ISettingsFormService>();
     confirmationDialogService = ServiceLocator.GetInstance<IConfirmationDialogService>();
     renamerService = ServiceLocator.GetInstance<IRenameService>();
     errorDialogService = ServiceLocator.GetInstance<IErrorDialogService>();
     updateService = ServiceLocator.GetInstance<IUpdateService>();
 }
示例#11
0
        public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IUpdateService u)
        {
            indexerService = i;
            processService = p;
            serializeService = s;
            configService = c;
            logger = l;
            client = w;
            updater = u;

            LoadConfig();
        }
示例#12
0
        public UpdatingViewModel()
        {
            Title = "CoApp Update";

            var loc = new LocalServiceLocator();
            UpdateService = loc.UpdateService;
            NavigationService = loc.NavigationService;
            AutomationService = loc.AutomationService;

            Loaded += HandleLoaded;
            Unloaded += OnUnloaded;
        }
示例#13
0
 public AccountController(IUserService userService, IUserProfileService userProfileService, IGoalService goalService, IUpdateService updateService, ICommentService commentService, IFollowRequestService followRequestService, IFollowUserService followUserService, ISecurityTokenService securityTokenService, UserManager<ApplicationUser> userManager)
 {
     this.userService = userService;
     this.userProfileService = userProfileService;
     this.goalService = goalService;
     this.updateService = updateService;
     this.commentService = commentService;
     this.followRequestService = followRequestService;
     this.followUserService = followUserService;
     this.securityTokenService = securityTokenService;
     this.UserManager = userManager;
 }
示例#14
0
 public AdminController(IConfigurationService config, IIndexerManagerService i, IServerService ss, ISecuityService s, IProcessService p, ICacheService c, Logger l, ILogCacheService lc, IUpdateService u)
 {
     this.config = config;
     indexerService = i;
     serverService = ss;
     securityService = s;
     processService = p;
     cacheService = c;
     logger = l;
     logCache = lc;
     updater = u;
 }
示例#15
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService = metricService;
     this.focusService = focusService;
     this.supportService = supportService;
     this.updateService = updateService;
     this.commentService = commentService;
     this.userService = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService = goalStatusService;
     this.commentUserService = commentUserService;
     this.updateSupportService = updateSupportService;
 }
示例#16
0
 public HomeController(IMetricService metricService, IFocusService focusService, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupUserService groupUserService, IGroupService groupService, IGroupGoalService groupGoalService, IGroupUpdateService groupupdateService, IGroupCommentService groupcommentService, IFollowUserService followUserService, IGroupUpdateUserService groupUpdateUserService, IGroupCommentUserService groupCommentUserService, ICommentUserService commentUserService)
 {
     this.metricService = metricService;
     this.focusService = focusService;
     this.goalService = goalService;
     this.commentService = commentService;
     this.updateService = updateService;
     this.supportService = supportService;
     this.userService = userService;
     this.groupService = groupService;
     this.groupUserService = groupUserService;
     this.groupGoalService = groupGoalService;
     this.groupupdateService = groupupdateService;
     this.groupcommentService = groupcommentService;
     this.followUserService = followUserService;
     this.groupCommentUserService = groupCommentUserService;
     this.groupUpdateUserService = groupUpdateUserService;
     this.commentUserService = commentUserService;
 }
示例#17
0
        public RssUpdateJob()
        {
            var configureMapper = IsThereAnyNewsAutomapper.ConfigureMapper();

            var itanDatabaseContext = new ItanDatabaseContext();
            var updateRepository = new UpdateRepository(itanDatabaseContext);
            var rssEntriesRepository = new RssEntriesRepository(itanDatabaseContext, configureMapper);
            var rssChannelsRepository = new RssChannelsRepository(itanDatabaseContext);
            var rssChannelUpdateRepository = new RssChannelUpdateRepository(itanDatabaseContext);

            ISyndicationFeedAdapter syndicationFeedAdapter = new SyndicationFeedAdapter(configureMapper);

            this.updateService = new UpdateService(
                updateRepository,
                rssEntriesRepository,
                rssChannelsRepository,
                rssChannelUpdateRepository,
                syndicationFeedAdapter,
                configureMapper);
        }
示例#18
0
        public SettingsViewModel(IConfigurationService configurationService, IWorkspaceManager workspaceManager, IManageUserDataService manageUserDataService, IUpdateService updateService,
            ILogTableConfigurationService logTableConfigurationService)
        {
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => workspaceManager);
            Argument.IsNotNull(() => manageUserDataService);
            Argument.IsNotNull(() => updateService);
            Argument.IsNotNull(() => logTableConfigurationService);

            _configurationService = configurationService;
            _workspaceManager = workspaceManager;
            _manageUserDataService = manageUserDataService;
            _updateService = updateService;
            _logTableConfigurationService = logTableConfigurationService;

            OpenApplicationDataDirectory = new Command(OnOpenApplicationDataDirectoryExecute);
            BackupUserData = new Command(OnBackupUserDataExecute);
            ResetFilters = new Command(OnResetFiltersExecute);
            ResetWorkspaces = new Command(OnResetWorkspacesExecute);

            Title = "Settings";
        }
示例#19
0
        public PrimaryViewModel()
        {
            Title = "CoApp Update";
            MessengerInstance.Register<InstallationFailedMessage>(this, HandleInstallFailed);
            MessengerInstance.Register<InstallationFinishedMessage>(this, HandleInstallFinished);
            MessengerInstance.Register<SelectedProductsChangedMessage>(this, HandleChanged);

            Loaded += OnLoaded;
            var loc = new LocalServiceLocator();
            UpdateService = loc.UpdateService;
            PolicyService = loc.PolicyService;
            NavigationService = loc.NavigationService;
            AutomationService = loc.AutomationService;
            UpdateSettingsService = loc.UpdateSettingsService;

            SelectUpdates = new RelayCommand(() => NavigationService.GoTo(ViewModelLocator.SelectUpdatesViewModelStatic));
            Install = new RelayCommand(() => NavigationService.GoTo(ViewModelLocator.InstallingViewModelStatic, false));
            CheckForUpdates = new RelayCommand(() => NavigationService.GoTo(ViewModelLocator.UpdatingViewModelStatic));

            /*
            FeedWarning = new RelayCommand(() => MessengerInstance.Send(new MetroDialogBoxMessage
                                                                            {
                                                                                Title =
                                                                                    "The Following Feeds Could Not Be Reached",
                                                                                Content = Warnings,
                                                                                Buttons =
                                                                                    new ObservableCollection
                                                                                    <ButtonDescription>
                                                                                        {
                                                                                            new ButtonDescription
                                                                                                {
                                                                                                    Title = "Cancel",
                                                                                                    IsCancel = true
                                                                                                }
                                                                                        }
                                                                            }));*/
        }
        internal IEnumerable<NotificationsViewModel> GetNotifications(string userId, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupService groupService, IGroupUserService groupUserSevice, IGroupGoalService groupGoalService, IGroupCommentService groupcommentService, IGroupUpdateService groupupdateService, IFollowUserService followUserService, IGroupCommentUserService groupCommentUserService, ICommentUserService commentUserService, IGroupUpdateUserService groupUpdateUserService)
        {
            var goals = goalService.GetTop20GoalsofFollowing(userId);
            var comments = commentService.GetTop20CommentsOfPublicGoalFollwing(userId);
            var updates = updateService.GetTop20UpdatesOfFollowing(userId);
            var groupusers = groupUserSevice.GetTop20GroupsUsers(userId);
            var supports = supportService.GetTop20SupportsOfFollowings(userId);
            var groupgoals = groupGoalService.GetTop20GroupsGoals(userId, groupUserSevice);
            var groupupdates = groupupdateService.GetTop20Updates(userId, groupUserSevice);
            var groupComments = groupcommentService.GetTop20CommentsOfPublicGoals(userId, groupUserSevice);
            var followers = followUserService.GetTop20Followers(userId);
            // var groups = groupService.GetTop20Groups(groupids);

            return (from g in goals
                    select new NotificationsViewModel()
                    {
                        GoalId = g.GoalId,
                        UserId = g.UserId,
                        CreatedDate = g.CreatedDate,
                        UserName = g.User.UserName,
                        GoalName = g.GoalName,
                        Desc = g.Desc,
                        ProfilePicUrl = g.User.ProfilePicUrl,
                        Goal = g,
                        NotificationDate = DateCalculation(g.CreatedDate),
                        NotificationType = (int)NotificationType.createdGoal
                    })
                    .Concat(from c in comments
                            select new NotificationsViewModel()
                            {
                                CommentId = c.CommentId,
                                CreatedDate = c.CommentDate,
                                CommentText = c.CommentText,
                                UpdateId = c.UpdateId,
                                GoalName = c.Update.Goal.GoalName,
                                GoalId = c.Update.GoalId,
                                NumberOfComments = commentService.GetCommentsByUpdate(c.UpdateId).Count(),
                                Updatemsg = updateService.GetUpdate(c.UpdateId).Updatemsg,
                                NotificationDate = DateCalculation(c.CommentDate),
                                UserName = commentUserService.GetUser(c.CommentId).UserName,
                                UserId = commentUserService.GetUser(c.CommentId).Id,
                                ProfilePicUrl = commentUserService.GetUser(c.CommentId).ProfilePicUrl,

                                NotificationType = (int)NotificationType.commentedOnUpdate
                            })
                    .Concat(from u in updates
                            select new NotificationsViewModel()
                            {
                                Update = u,
                                UpdateId = u.UpdateId,
                                GoalId = u.GoalId,
                                ProfilePicUrl = u.Goal.User.ProfilePicUrl,
                                GoalName = u.Goal.GoalName,
                                Updatemsg = u.Updatemsg,
                                UserId = u.Goal.UserId,
                                UserName = u.Goal.User.UserName,
                                NumberOfComments = commentService.GetCommentsByUpdate(u.UpdateId).Count(),
                                CreatedDate = u.UpdateDate,
                                NotificationDate = DateCalculation(u.UpdateDate),
                                NotificationType = (int)NotificationType.updatedGoal
                            })
                    .Concat(from gr in groupgoals
                            select new NotificationsViewModel()
                            {

                                GroupGoalId = gr.GroupGoalId,
                                CreatedDate = gr.CreatedDate,

                                UserId = gr.GroupUser.UserId,
                                UserName = userService.GetUser(gr.GroupUser.UserId).UserName,
                                ProfilePicUrl = userService.GetUser(gr.GroupUser.UserId).ProfilePicUrl,

                                GroupName = gr.Group.GroupName,
                                GroupGoalName = gr.GoalName,
                                GroupId = gr.GroupId,
                                NotificationDate = DateCalculation(gr.CreatedDate),
                                NotificationType = (int)NotificationType.createGroup

                            })
                    .Concat(from gu in groupusers
                            select new NotificationsViewModel()
                            {
                                GroupUser = gu,
                                GroupUserId = gu.GroupUserId,

                                UserId = gu.UserId,
                                UserName = userService.GetUser(gu.UserId).UserName,
                                ProfilePicUrl = userService.GetUser(gu.UserId).ProfilePicUrl,

                                GroupName = groupService.GetGroup(gu.GroupId).GroupName,
                                GroupId = gu.GroupId,
                                CreatedDate = gu.AddedDate,
                                NotificationDate = DateCalculation(gu.AddedDate),
                                NotificationType = (int)NotificationType.joinGroup
                            })
                    .Concat(from s in supports
                            select new NotificationsViewModel()
                            {
                                Support = s,
                                SupportId = s.SupportId,
                                GoalName = s.Goal.GoalName,

                                ProfilePicUrl = userService.GetUser(s.UserId).ProfilePicUrl,
                                UserName = userService.GetUser(s.UserId).UserName,
                                UserId = s.UserId,
                                CreatedDate = s.SupportedDate,
                                GoalId = s.GoalId,
                                NotificationDate = DateCalculation(s.SupportedDate),
                                NotificationType = (int)NotificationType.supportGoal
                            })
                    .Concat(from gu in groupupdates
                            select new NotificationsViewModel()
                            {
                                GroupUpdate = gu,
                                GroupUpdateId = gu.GroupUpdateId,
                                GroupUpdatemsg = gu.Updatemsg,

                                UserId = groupUpdateUserService.GetGroupUpdateUser(gu.GroupUpdateId).Id,
                                ProfilePicUrl = groupUpdateUserService.GetGroupUpdateUser(gu.GroupUpdateId).ProfilePicUrl,
                                UserName = groupUpdateUserService.GetGroupUpdateUser(gu.GroupUpdateId).UserName,
                                NotificationDate = DateCalculation(gu.UpdateDate),
                                CreatedDate = gu.UpdateDate,
                                GroupGoalId = gu.GroupGoalId,
                                GroupId = gu.GroupGoal.GroupId,
                                GroupGoalName = gu.GroupGoal.GoalName,
                                GroupName = gu.GroupGoal.Group.GroupName,
                                NotificationType = (int)NotificationType.updatedGroupgoal

                            })
                    .Concat(from gc in groupComments
                            select new NotificationsViewModel()
                            {

                                GroupCommentId = gc.GroupCommentId,
                                GroupCommentText = gc.CommentText,
                                GroupUpdateId = gc.GroupUpdateId,

                                GroupGoalId = gc.GroupUpdate.GroupGoalId,
                                GroupGoalName = gc.GroupUpdate.GroupGoal.GoalName,

                                UserId = groupCommentUserService.GetGroupCommentUser(gc.GroupCommentId).Id,
                                UserName = groupCommentUserService.GetGroupCommentUser(gc.GroupCommentId).UserName,
                                ProfilePicUrl = groupCommentUserService.GetGroupCommentUser(gc.GroupCommentId).ProfilePicUrl,

                                GroupUpdatemsg = gc.GroupUpdate.Updatemsg,
                                GroupId = gc.GroupUpdate.GroupGoal.GroupUser.GroupId,
                                GroupName = gc.GroupUpdate.GroupGoal.Group.GroupName,
                                NotificationDate = DateCalculation(gc.CommentDate),
                                CreatedDate = gc.CommentDate,
                                NotificationType = (int)NotificationType.commentedonGroupUdate
                            })
                    .Concat(from f in followers
                            select new NotificationsViewModel()
                            {
                                FollowUserId = f.FollowUserId,
                                FromUser = f.FromUser,
                                ToUser = f.ToUser,
                                ProfilePicUrl = f.FromUser.ProfilePicUrl,
                                FromUserId = f.FromUserId,
                                ToUserId = f.ToUserId,
                                CreatedDate = f.AddedDate,
                                NotificationDate = DateCalculation(f.AddedDate),
                                NotificationType = (int)NotificationType.followUser
                            }).OrderByDescending(n => n.CreatedDate);
        }
示例#21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsViewModel"/> class.
        /// </summary>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        /// <param name="shellViewModel">
        /// The shell View Model.
        /// </param>
        /// <param name="updateService">
        /// The update Service.
        /// </param>
        public OptionsViewModel(IUserSettingService userSettingService, IShellViewModel shellViewModel, IUpdateService updateService)
        {
            this.Title = "Options";
            this.userSettingService = userSettingService;
            this.shellViewModel = shellViewModel;
            this.updateService = updateService;
            this.OnLoad();

            this.SelectedTab = OptionsTab.General;
            this.UpdateMessage = "Click 'Check for Updates' to check for new versions";
        }
示例#22
0
        public ProviderSystemUpdate(DvDevice aDevice, IUpdateService aUpdateService, string aDfltConfigFile, string aUserConfigFile)
            : base(aDevice)
        {
            iLogger = LogManager.GetLogger(typeof(ProviderSystemUpdate));

            stateTable = new StringCollection();
            stateTable.AddRange(StateNames);

            EnablePropertyState();
            EnablePropertyProgress();
            EnablePropertyServer();
            EnablePropertyChannel();
            EnablePropertyLastError();
            EnablePropertyAutoUpdate();

            EnableActionCheckForUpdate();
            EnableActionDownloadUpdate();
            EnableActionDoUpdate();
            EnableActionCancelUpdate();
            EnableActionSetSourceInfo();
            EnableActionReboot();
            EnableActionSetAutoUpdate();

            SetPropertyProgress(0);
            SetLastError("Service created OK");

            iUpdateService = aUpdateService;

            /* Set default values */
            CurrentState = kStateIdle;
            SetPropertyServer(aUpdateService.Server);
            SetPropertyChannel(aUpdateService.Channel);
            SetPropertyAutoUpdate(true);

            /* Read the default config file first, if it exists */
            if (aDfltConfigFile != null)
            {
                string file = aDfltConfigFile; // Path.Combine(aDfltConfigDir, kStorageFileName);
                try
                {
                    LoadConfig(file);
                }
                catch (FileNotFoundException)
                {
                    iLogger.Info("Default config file '" + file + "' not found. Using hard-coded values ...");
                }
                catch (DirectoryNotFoundException)
                {
                    iLogger.Info("Default config file '" + file + "' not found. Using hard-coded values ...");
                }
            }

            /* Then try to read the user config file */
            if (aUserConfigFile != null)
            {
                userConfigFile = aUserConfigFile; // Path.Combine(aUserConfigDir, kStorageFileName);
                try
                {
                    LoadConfig(userConfigFile, out userConfigXml);
                }
                catch (FileNotFoundException)
                {
                    iLogger.Info("User config file '" + userConfigFile + "' not found. Using defaults ...");
                }
                catch (DirectoryNotFoundException)
                {
                    iLogger.Info("User config file '" + userConfigFile + "' not found. Using defaults ...");
                }
            }

            if (userConfigXml == null)
            {
                userConfigXml = new XElement("SystemUpdate");
            }

            /* If the state read from the config file was UpdateAvailable then we set it
             * to Idle. The service will notify us if an update is still available.
             * If the state was RebootNeeded then this is our first reboot after a software update
             */
            if ( (CurrentState == kStateUpdateAvailable) || (CurrentState == kStateRebootNeeded))
            {
                CurrentState = kStateIdle;
            }

            UpdateUserConfig("State", PropertyState());

            autoUpdateTimer = new Timer(OnAutoUpdateTimer);

            iUpdateService.Server = PropertyServer();
            iUpdateService.Channel = PropertyChannel();

            iUpdateService.UpdateEventHandler += HandleUpdateEvent;

            /* If we are in Idle state then start the service */
            if (CurrentState == kStateIdle)
            {
                iUpdateService.Start();
            }

            /* If autoupdate is on and an update has been downloaded then
             * kick-off the timer to apply it */
            if (PropertyAutoUpdate() && (CurrentState == kStateUpdateDownloaded))
            {
                autoUpdateTimer.Change(kAutoUpdateDelay, Timeout.Infinite);
            }
        }
示例#23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// The viewmodel for HandBrakes main window.
        /// </summary>
        /// <param name="userSettingService">
        /// The User Setting Service
        /// </param>
        /// <param name="scanService">
        /// The scan Service.
        /// </param>
        /// <param name="encodeService">
        /// The encode Service.
        /// </param>
        /// <param name="presetService">
        /// The preset Service.
        /// </param>
        /// <param name="errorService">
        /// The Error Service
        /// </param>
        /// <param name="shellViewModel">
        /// The shell View Model.
        /// </param>
        /// <param name="updateService">
        /// The update Service.
        /// </param>
        /// <param name="notificationService">
        /// The notification Service.
        /// *** Leave in Constructor. *** 
        /// </param>
        /// <param name="whenDoneService">
        /// The when Done Service.
        /// *** Leave in Constructor. *** 
        /// </param>
        public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
            IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, INotificationService notificationService,
            IPrePostActionService whenDoneService)
        {
            this.scanService = scanService;
            this.encodeService = encodeService;
            this.presetService = presetService;
            this.errorService = errorService;
            this.shellViewModel = shellViewModel;
            this.updateService = updateService;
            this.userSettingService = userSettingService;
            this.queueProcessor = IoC.Get<IQueueProcessor>();

            // Setup Properties
            this.WindowTitle = "HandBrake";
            this.CurrentTask = new EncodeTask();
            this.CurrentTask.PropertyChanged += this.CurrentTask_PropertyChanged;
            this.ScannedSource = new Source();

            // Setup Events
            this.scanService.ScanStared += this.ScanStared;
            this.scanService.ScanCompleted += this.ScanCompleted;
            this.scanService.ScanStatusChanged += this.ScanStatusChanged;
            this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
            this.queueProcessor.QueueCompleted += this.QueueCompleted;
            this.queueProcessor.QueueChanged += this.QueueChanged;
            this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
            this.userSettingService.SettingChanged += this.UserSettingServiceSettingChanged;

            this.Presets = this.presetService.Presets;
            this.CancelScanCommand = new CancelScanCommand(this.scanService);
        }
示例#24
0
 public UpdateController(IUpdateService updateService, BotConfiguration config)
 {
     _updateService = updateService;
     _config        = config;
 }
示例#25
0
 public HomeController(IUpdateService _updateService)
 {
     updateService = _updateService;
 }
示例#26
0
 protected void OnStateChange(IUpdateService updateService)
 {
     StateChangeHandler handler = StateChange;
     if (handler != null)
     {
         handler(updateService);
     }
 }
        public ActionResult Edit(Blog blog, IUpdateService service)
        {
            if (!ModelState.IsValid)
                //model errors so return immediately
                return View(blog);

            var response = service.Update(blog);
            if (response.IsValid)
            {
                TempData["message"] = response.SuccessMessage;
                return RedirectToAction("Index");
            }

            //else errors, so copy the errors over to the ModelState and return to view
            response.CopyErrorsToModelState(ModelState, blog);
            return View(blog);
        }
示例#28
0
 public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, Common.Utils.Clients.WebClient w, IUpdateService u, IProtectionService protectionService, ServerConfig serverConfig)
 {
     indexerService     = i;
     processService     = p;
     serializeService   = s;
     configService      = c;
     logger             = l;
     client             = w;
     updater            = u;
     config             = serverConfig;
     _protectionService = protectionService;
 }
示例#29
0
 public FirstViewModel(IGodsService pGodsService, IUpdateService updateService)
 {
     _GodsService = pGodsService;
     _UpdateService = updateService;
 }
示例#30
0
 public UpdateController(IUpdateService updateService)
 {
     _updateService = updateService;
 }
示例#31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// The viewmodel for HandBrakes main window.
        /// </summary>
        /// <param name="userSettingService">
        /// The User Setting Service
        /// </param>
        /// <param name="scanService">
        /// The scan Service.
        /// </param>
        /// <param name="encodeService">
        /// The encode Service.
        /// </param>
        /// <param name="presetService">
        /// The preset Service.
        /// </param>
        /// <param name="errorService">
        /// The Error Service
        /// </param>
        /// <param name="shellViewModel">
        /// The shell View Model.
        /// </param>
        /// <param name="updateService">
        /// The update Service.
        /// </param>
        /// <param name="notificationService">
        /// The notification Service.
        /// *** Leave in Constructor. *** 
        /// </param>
        /// <param name="whenDoneService">
        /// The when Done Service.
        /// *** Leave in Constructor. *** 
        /// </param>
        public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService,
            IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, INotificationService notificationService,
            IPrePostActionService whenDoneService)
        {
            this.scanService = scanService;
            this.encodeService = encodeService;
            this.presetService = presetService;
            this.errorService = errorService;
            this.shellViewModel = shellViewModel;
            this.updateService = updateService;
            this.userSettingService = userSettingService;
            this.queueProcessor = IoC.Get<IQueueProcessor>();

            // Setup Properties
            this.WindowTitle = Resources.HandBrake_Title;
            this.CurrentTask = new EncodeTask();
            this.CurrentTask.PropertyChanged += this.CurrentTask_PropertyChanged;
            this.ScannedSource = new Source();
            this.HasSource = false;

            // Setup Events
            this.scanService.ScanStarted += this.ScanStared;
            this.scanService.ScanCompleted += this.ScanCompleted;
            this.scanService.ScanStatusChanged += this.ScanStatusChanged;
            this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
            this.queueProcessor.QueueCompleted += this.QueueCompleted;
            this.queueProcessor.QueueChanged += this.QueueChanged;
            this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
            this.userSettingService.SettingChanged += this.UserSettingServiceSettingChanged;

            this.Presets = this.presetService.Presets;
            this.Drives = new BindingList<SourceMenuItem>();

            HandBrakeInstanceManager.Init();
        }
示例#32
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService            = metricService;
     this.focusService             = focusService;
     this.supportService           = supportService;
     this.updateService            = updateService;
     this.commentService           = commentService;
     this.userService          = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService    = goalStatusService;
     this.commentUserService   = commentUserService;
     this.updateSupportService = updateSupportService;
 }
示例#33
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// The viewmodel for HandBrakes main window.
        /// </summary>
        /// <param name="userSettingService">
        /// The User Setting Service
        /// </param>
        /// <param name="scanService">
        /// The scan Service.
        /// </param>
        /// <param name="encodeService">
        /// The encode Service.
        /// </param>
        /// <param name="presetService">
        /// The preset Service.
        /// </param>
        /// <param name="errorService">
        /// The Error Service
        /// </param>
        /// <param name="updateService">
        /// The update Service.
        /// </param>
        /// <param name="whenDoneService">
        /// The when Done Service.
        /// *** Leave in Constructor. *** 
        /// </param>
        /// <param name="windowManager">
        /// The window Manager.
        /// </param>
        /// <param name="pictureSettingsViewModel">
        /// The picture Settings View Model.
        /// </param>
        /// <param name="videoViewModel">
        /// The video View Model.
        /// </param>
        /// <param name="filtersViewModel">
        /// The filters View Model.
        /// </param>
        /// <param name="audioViewModel">
        /// The audio View Model.
        /// </param>
        /// <param name="subtitlesViewModel">
        /// The subtitles View Model.
        /// </param>
        /// <param name="advancedViewModel">
        /// The advanced View Model.
        /// </param>
        /// <param name="chaptersViewModel">
        /// The chapters View Model.
        /// </param>
        /// <param name="staticPreviewViewModel">
        /// The static Preview View Model.
        /// </param>
        public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService, 
            IErrorService errorService, IUpdateService updateService,
            IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel,
            IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,
            IAdvancedViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel)
        {
            this.scanService = scanService;
            this.encodeService = encodeService;
            this.presetService = presetService;
            this.errorService = errorService;
            this.updateService = updateService;
            this.windowManager = windowManager;
            this.userSettingService = userSettingService;
            this.queueProcessor = IoC.Get<IQueueProcessor>();

            this.PictureSettingsViewModel = pictureSettingsViewModel;
            this.VideoViewModel = videoViewModel;
            this.FiltersViewModel = filtersViewModel;
            this.AudioViewModel = audioViewModel;
            this.SubtitleViewModel = subtitlesViewModel;
            this.ChaptersViewModel = chaptersViewModel;
            this.AdvancedViewModel = advancedViewModel;
            this.StaticPreviewViewModel = staticPreviewViewModel;

            // Setup Properties
            this.WindowTitle = Resources.HandBrake_Title;
            this.CurrentTask = new EncodeTask();
            this.CurrentTask.PropertyChanged += this.CurrentTask_PropertyChanged;
            this.ScannedSource = new Source();
            this.HasSource = false;

            // Setup Events
            this.scanService.ScanStarted += this.ScanStared;
            this.scanService.ScanCompleted += this.ScanCompleted;
            this.scanService.ScanStatusChanged += this.ScanStatusChanged;
            this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
            this.queueProcessor.QueueCompleted += this.QueueCompleted;
            this.queueProcessor.QueueChanged += this.QueueChanged;
            this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
            this.userSettingService.SettingChanged += this.UserSettingServiceSettingChanged;

            this.Presets = this.presetService.Presets;
            this.Drives = new BindingList<SourceMenuItem>();

            HandBrakeInstanceManager.Init();
        }
        internal IEnumerable<NotificationsViewModel> GetProfileNotifications(string userid, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupService groupService, IGroupUserService groupUserSevice, IGroupGoalService groupGoalService, IGroupCommentService groupcommentService, IGroupUpdateService groupupdateService, ICommentUserService commentUserService)
        {
            var goals = goalService.GetTop20Goals(userid);
            var comments = commentService.GetTop20CommentsOfPublicGoals(userid);
            var updates = updateService.GetTop20Updates(userid);
            var groupusers = groupUserSevice.GetTop20GroupsUsersForProfile(userid);
            var supports = supportService.GetTop20Support(userid);

            return (from g in goals
                    select new NotificationsViewModel()
                    {
                        GoalId = g.GoalId,
                        UserId = g.UserId,
                        CreatedDate = g.CreatedDate,
                        UserName = g.User.UserName,
                        GoalName = g.GoalName,
                        Desc = g.Desc,
                        ProfilePicUrl = g.User.ProfilePicUrl,
                        Goal = g,
                        NotificationDate = DateCalculation(g.CreatedDate),
                        NotificationType = (int)NotificationType.createdGoal
                    })
                    .Concat(from c in comments
                            select new NotificationsViewModel()
                            {
                                CommentId = c.CommentId,
                                CreatedDate = c.CommentDate,

                                UserName = commentUserService.GetUser(c.CommentId).UserName,
                                UserId = commentUserService.GetUser(c.CommentId).Id,
                                ProfilePicUrl = commentUserService.GetUser(c.CommentId).ProfilePicUrl,

                                CommentText = c.CommentText,
                                UpdateId = c.UpdateId,
                                GoalName = c.Update.Goal.GoalName,
                                GoalId = c.Update.GoalId,
                                NumberOfComments = commentService.GetCommentsByUpdate(c.UpdateId).Count(),
                                Updatemsg = updateService.GetUpdate(c.UpdateId).Updatemsg,
                                NotificationDate = DateCalculation(c.CommentDate),
                                NotificationType = (int)NotificationType.commentedOnUpdate
                            })
                    .Concat(from u in updates
                            select new NotificationsViewModel()
                            {
                                Update = u,
                                UpdateId = u.UpdateId,
                                GoalId = u.GoalId,
                                ProfilePicUrl = u.Goal.User.ProfilePicUrl,
                                GoalName = u.Goal.GoalName,
                                Updatemsg = u.Updatemsg,
                                UserId = u.Goal.UserId,
                                UserName = u.Goal.User.UserName,
                                NumberOfComments = commentService.GetCommentsByUpdate(u.UpdateId).Count(),
                                CreatedDate = u.UpdateDate,
                                NotificationDate = DateCalculation(u.UpdateDate),
                                NotificationType = (int)NotificationType.updatedGoal
                            })
                    .Concat(from s in supports
                            select new NotificationsViewModel()
                            {
                                Support = s,
                                SupportId = s.SupportId,
                                GoalName = s.Goal.GoalName,

                                ProfilePicUrl = userService.GetUser(s.UserId).ProfilePicUrl,
                                UserName = userService.GetUser(s.UserId).UserName,
                                UserId = s.UserId,

                                CreatedDate = s.SupportedDate,
                                GoalId = s.GoalId,
                                NotificationType = (int)NotificationType.supportGoal
                            })
                    .Concat(from gu in groupusers
                            select new NotificationsViewModel()
                            {
                                GroupUser = gu,

                                GroupUserId = gu.GroupUserId,

                                UserName = userService.GetUser(gu.UserId).UserName,
                                ProfilePicUrl = userService.GetUser(gu.UserId).ProfilePicUrl,
                                UserId = gu.UserId,

                                GroupName = groupService.GetGroup(gu.GroupId).GroupName,
                                GroupId = gu.GroupId,
                                CreatedDate = gu.AddedDate,
                                NotificationDate = DateCalculation(gu.AddedDate),
                                NotificationType = (int)NotificationType.joinGroup
                            })
                                                        .OrderByDescending(n => n.CreatedDate);
        }
示例#35
0
        public MainViewModel(IWindowManager windowManager, IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService,
            IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService)
        {
            this.scanService = scanService;
            this.encodeService = encodeService;
            this.presetService = presetService;
            this.errorService = errorService;
            this.shellViewModel = shellViewModel;
            this.updateService = updateService;
            this.userSettingService = userSettingService;
            this.queueProcessor = IoC.Get<IQueueProcessor>(); // TODO Instance ID!

            // Setup Properties
            this.WindowTitle = "HandBrake";
            this.CurrentTask = new EncodeTask();
            this.ScannedSource = new Source();

            // Setup Events
            this.scanService.ScanStared += this.ScanStared;
            this.scanService.ScanCompleted += this.ScanCompleted;
            this.scanService.ScanStatusChanged += this.ScanStatusChanged;
            this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
            this.queueProcessor.QueueCompleted += this.QueueCompleted;
            this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;

            this.Presets = this.presetService.Presets;
        }
示例#36
0
 public TrayIconManager(
     IUpdateService updateService)
 {
     trayIcon           = new NotifyIcon();
     this.updateService = updateService;
 }