Beispiel #1
0
        public static ViewModelBase GetViewModel(INotifyUser owner)
        {
            if (owner == null || !associations.ContainsKey(owner.GetType()))
            {
                throw new ArgumentException("Owner should not be null and should be registered via RegisterAssociation()", "owner");
            }

            Type          viewType             = owner.GetType();
            Type          viewModelType        = associations[viewType];
            ViewModelBase result               = null;
            bool          shouldCacheViewModel = cacheSettings[viewModelType];

            if (shouldCacheViewModel)
            {
                if (instancesCache.ContainsKey(viewModelType))
                {
                    result = instancesCache[viewModelType];
                }
                else
                {
                    result = InstantiateViewModel(viewType, owner);
                    instancesCache.Add(viewModelType, result);
                }
            }
            else
            {
                result = InstantiateViewModel(viewType, owner);
            }

            return(result);
        }
		public static QuickStartViewModelBase GetViewModel(INotifyUser owner)
		{
			if (owner == null || !associations.ContainsKey(owner.GetType()))
			{
				throw new ArgumentException("Owner should not be null and should be registered via RegisterAssociation()", "owner");
			}

			Type viewType = owner.GetType();
			Type viewModelType = associations[viewType];
			QuickStartViewModelBase result = null;
			bool shouldCacheViewModel = cacheSettings[viewModelType];

			if (shouldCacheViewModel)
			{
				if (instancesCache.ContainsKey(viewModelType))
				{
					result = instancesCache[viewModelType];
				}
				else
				{
					result = InstantiateViewModel(viewType, owner);
					instancesCache.Add(viewModelType, result);
				}
			}
			else
			{
				result = InstantiateViewModel(viewType, owner);
			}

			return result;
		}
 public SessionDetail(
     IGetLockResourcesBySpidQuery getLockResourcesBySpidQuery,
     IGetLockSummaryFromSpidQuery getLockSummaryFromSpidQuery,
     ILockResourceBySpidFactory lockResourceBySpidFactory,
     IKillSessionQuery killSessionQuery,
     INotifyUser notifyUser)
 {
     this.getLockResourcesBySpidQuery = getLockResourcesBySpidQuery;
     this.getLockSummaryFromSpidQuery = getLockSummaryFromSpidQuery;
     this.lockResourceBySpidFactory   = lockResourceBySpidFactory;
     this.killSessionQuery            = killSessionQuery;
     this.notifyUser  = notifyUser;
     this.DataContext = this;
     InitializeComponent();
 }
        public LockResourceBySpid(
            int lockingSpid,
            List <LockedResourceDto> lockedResourceDtos,
            SessionDto session,
            IGetRowOfLockedResourceQuery getRowOfLockedResourceQuery,
            INotifyUser notifyUser)
        {
            this.getRowOfLockedResourceQuery = getRowOfLockedResourceQuery;
            this.notifyUser    = notifyUser;
            LockingSPID        = lockingSpid;
            TooManyResult      = lockedResourceDtos.Count > MaxResults;
            LockedResourceDtos = lockedResourceDtos.Take(MaxResults).ToList();
            Session            = session;
            DataContext        = this;
            AllowQuery         = true;

            InitializeComponent();
        }
 public GetCommandProcessorsService(IScriptAccessor scriptAccessor
                                    , IFlagAccessor flagAccessor
                                    , LineService lineService
                                    , IImageAccessor imageAccessor
                                    , IVideoAccessor videoAccessor
                                    , IVariableAccessor variableAccessor
                                    , ITauntAccessor tauntAccessor
                                    , IConfigurationAccessor configurationAccessor
                                    , IRandomNumberService randomNumberService
                                    , INotifyUser notifyUser
                                    , ISettingsAccessor settingsAccessor
                                    , IPathsAccessor pathsAccessor
                                    , IBookmarkService bookmarkService
                                    , IMediaContainerService mediaContainerService
                                    , ITimeService timeService
                                    , ILineCollectionFilter lineCollectionFilter
                                    , IVitalSubService vitalSubService
                                    , IConditionalObjectLogic conditionalObjectLogic
                                    , IVocabularyProcessor sessionVocabularyProcessor
                                    )
 {
     _scriptAccessor             = scriptAccessor;
     _flagAccessor               = flagAccessor;
     _lineService                = lineService;
     _imageAccessor              = imageAccessor;
     _videoAccessor              = videoAccessor;
     _variableAccessor           = variableAccessor;
     _tauntAccessor              = tauntAccessor;
     _configurationAccessor      = configurationAccessor;
     _randomNumberService        = randomNumberService;
     _notifyUser                 = notifyUser;
     _settingsAccessor           = settingsAccessor;
     _pathsAccessor              = pathsAccessor;
     _bookmarkService            = bookmarkService;
     _mediaContainerService      = mediaContainerService;
     _timeService                = timeService;
     _lineCollectionFilter       = lineCollectionFilter;
     _vitalSubService            = vitalSubService;
     _conditionalObjectLogic     = conditionalObjectLogic;
     _sessionVocabularyProcessor = sessionVocabularyProcessor;
 }
Beispiel #6
0
 public LockResourceBySpidFactory(IConnectionContainer connectionContainer, INotifyUser notifyUser)
 {
     this.connectionContainer = connectionContainer;
     this.notifyUser          = notifyUser;
 }
Beispiel #7
0
 private static ViewModelBase InstantiateViewModel(Type viewType, INotifyUser owner)
 {
     return((ViewModelBase)Activator.CreateInstance(associations[viewType], owner));
 }
 public SingleControlExamplesViewModel(INotifyUser ownerView)
     :base(ownerView)
 {
 }
Beispiel #9
0
 public AddTokensCommandProcessor(LineService lineService, ISettingsAccessor settingsAccessor, INotifyUser notifyUser) : base(Keyword.AddTokens, lineService)
 {
     _lineService      = lineService;
     _settingsAccessor = settingsAccessor;
     _notifyUser       = notifyUser;
 }
		private static QuickStartViewModelBase InstantiateViewModel(Type viewType, INotifyUser owner)
		{
			return (QuickStartViewModelBase)Activator.CreateInstance(associations[viewType], owner);
		}
		public SingleExampleViewModel(INotifyUser ownerView) : this()
		{
			this.OwnerView = ownerView;
		}
Beispiel #12
0
 private NotificationHub()
 {
     CurrentNotificationHandler = null;
 }
		public HomeViewModel(INotifyUser ownerView)
			: base(ownerView)
		{
            this.OpenAnalyticsSettingsDialogCommand = new DelegateCommand(this.OnOpenAnalyticsSettingsDialogCommandExecuted, OpenAnalyticsSettingsDialogCommandCanExecuted);
			this.CloseDialogOverlayAndNavigateCommand = new DelegateCommand(this.OnCloseDialogOverlayAndNavigateCommandExecuted);
		}
 public AllControlsTouchViewModel(INotifyUser ownerView)
     : base(ownerView)
 {
     this.nameGroupDescription = new ExampleNameGroupDescription(this);
 }
Beispiel #15
0
        public SessionEngine(ISettingsAccessor settingsAccessor
                             , IStringService stringService
                             , IScriptAccessor scriptAccessor
                             , ITimerFactory timerFactory
                             , IFlagAccessor flagAccessor
                             , IImageAccessor imageAccessor
                             , IVideoAccessor videoAccessor
                             , IVariableAccessor variableAccessor
                             , ITauntAccessor tauntAccessor
                             , ISystemVocabularyAccessor systemVocabularyAccessor
                             , IVocabularyAccessor vocabularyAccessor
                             , ILineCollectionFilter lineCollectionFilter
                             , IRandomNumberService randomNumberService
                             , IConfigurationAccessor configurationAccessor
                             , INotifyUser notifyUser
                             , IPathsAccessor pathsAccessor
                             , IGetCommandProcessorsService getCommandProcessorsService
                             , IInterpolationProcessor interpolationProcessor
                             )
        {
            CommandProcessors = getCommandProcessorsService.CreateCommandProcessors();

            CommandProcessors[Keyword.StartStroking].CommandProcessed += StartStrokingCommandProcessed;
            CommandProcessors[Keyword.Edge].CommandProcessed          += EdgeCommandProcessed;
            CommandProcessors[Keyword.End].CommandProcessed           += EndCommandProcessed;
            CommandProcessors[Keyword.TauntFromFile].CommandProcessed += TauntFromFileCommandProcessed;

            CommandProcessors[Keyword.ShowImage].CommandProcessed         += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowButtImage].CommandProcessed     += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowBoobsImage].CommandProcessed    += ShowImageCommandProcessed;
            CommandProcessors[Keyword.SearchImageBlog].CommandProcessed   += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowHardcoreImage].CommandProcessed += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowSoftcoreImage].CommandProcessed += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowLesbianImage].CommandProcessed  += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowBlowjobImage].CommandProcessed  += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowFemdomImage].CommandProcessed   += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowLezdomImage].CommandProcessed   += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowHentaiImage].CommandProcessed   += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowGayImage].CommandProcessed      += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowMaledomImage].CommandProcessed  += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowCaptionsImage].CommandProcessed += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowGeneralImage].CommandProcessed  += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowLikedImage].CommandProcessed    += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowDislikedImage].CommandProcessed += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowBlogImage].CommandProcessed     += ShowImageCommandProcessed;
            CommandProcessors[Keyword.NewBlogImage].CommandProcessed      += ShowImageCommandProcessed;
            CommandProcessors[Keyword.ShowLocalImage].CommandProcessed    += ShowImageCommandProcessed;

            CommandProcessors[Keyword.PlayVideo].CommandProcessed              += PlayVideoCommandProcessed;
            CommandProcessors[Keyword.PlayJoiVideo].CommandProcessed           += PlayVideoCommandProcessed;
            CommandProcessors[Keyword.PlayCockHeroVideo].CommandProcessed      += PlayVideoCommandProcessed;
            CommandProcessors[Keyword.PlayCensorshipSucks].CommandProcessed    += PlayCensorshipSucksVideoTauntCommandProcessed;
            CommandProcessors[Keyword.PlayRedLightGreenLight].CommandProcessed += PlayRedLightGreenLightVideoTauntCommandProcessed;
            CommandProcessors[Keyword.StopVideo].CommandProcessed              += StopVideoCommandProcessed;
            CommandProcessors[Keyword.PauseVideo].CommandProcessed             += PauseVideoCommandProcessed;
            CommandProcessors[Keyword.UnpauseVideo].CommandProcessed           += UnpauseVideoCommandProcessed;
            CommandProcessors[Keyword.ShowCensorshipBar].CommandProcessed      += ShowCensorshipBarCommandProcessed;
            CommandProcessors[Keyword.HideCensorshipBar].CommandProcessed      += HideCensorshipBarCommandProcessed;

            CommandProcessors[Keyword.SendDailyTasks].CommandProcessed     += RequestTaskCommandProcessed;
            CommandProcessors[Keyword.VitalSubAssignment].CommandProcessed += VitalSubAssignmentCommandProcessed;

            MessageProcessors = CreateMessageProcessors(settingsAccessor, stringService, new LineService(), systemVocabularyAccessor, variableAccessor, new RandomNumberService());

            MessageProcessors[MessageProcessor.ScriptResponse].MessageProcessed += ScriptResponse_MessageProcessed;
            MessageProcessors[MessageProcessor.EdgeDetection].MessageProcessed  += EdgeDetection_MessageProcessed;

            CommandProcessors[Keyword.RiskyPickStart].CommandProcessed += RiskyPickStartCommandProcessed;

            CommandProcessors[Keyword.LikeImage].BeforeCommandProcessed += LikeImageCommandProcessed;

            _scriptAccessor        = scriptAccessor;
            _variableAccessor      = variableAccessor;
            _configurationAccessor = configurationAccessor;
            _scriptTimer           = timerFactory.Create();
            _scriptTimer.Elapsed  += _scriptTimer_Elapsed;

            _tauntTimer          = timerFactory.Create();
            _tauntTimer.Elapsed += _tauntTimer_Elapsed;

            _teaseCountDown          = timerFactory.Create();
            _teaseCountDown.Elapsed += _teaseCountDown_Elapsed;

            _vocabularyProcesser    = new VocabularyProcessor(lineCollectionFilter, new LineService(), vocabularyAccessor, imageAccessor, randomNumberService, settingsAccessor);
            _interpolationProcessor = interpolationProcessor;
        }
 public QuickStartViewModelBase(INotifyUser ownerView) 
     : this()
 {
     this.OwnerView = ownerView;
 }