コード例 #1
0
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse    = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
     if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
     {
         object capability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
         if (capability is bool && (bool)capability)
         {
             this.appCache = new RemoteApplicationCache(this);
         }
     }
     if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
     {
         object capability2 = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
         if (capability2 is bool && (bool)capability2)
         {
             this.locationContext = new RemoteLocationContext(this);
         }
     }
     if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
     {
         object capability3 = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
         if (capability3 is bool && (bool)capability3)
         {
             this.storage = new RemoteWebStorage(this);
         }
     }
 }
コード例 #2
0
 private ILocationContext CreateDataBaseIfNeeded(ILocationContext db)
 {
     if (db.DatabaseExists() == false)
     {
         db.CreateDatabase();
     }
     return(db);
 }
コード例 #3
0
ファイル: WebDriver.cs プロジェクト: nickgaya/selenium
        /// <summary>
        /// Initializes a new instance of the <see cref="WebDriver"/> class.
        /// </summary>
        /// <param name="executor">The <see cref="ICommandExecutor"/> object used to execute commands.</param>
        /// <param name="capabilities">The <see cref="ICapabilities"/> object used to configuer the driver session.</param>
        protected WebDriver(ICommandExecutor executor, ICapabilities capabilities)
        {
            this.executor = executor;
            this.StartSession(capabilities);
            this.elementFactory = new WebElementFactory(this);
            this.network        = new NetworkManager(this);
            this.registeredCommands.AddRange(DriverCommand.KnownCommands);

            if ((this as ISupportsLogs) != null)
            {
                // Only add the legacy log commands if the driver supports
                // retrieving the logs via the extension end points.
                this.RegisterDriverCommand(DriverCommand.GetAvailableLogTypes, new HttpCommandInfo(HttpCommandInfo.GetCommand, "/session/{sessionId}/se/log/types"), true);
                this.RegisterDriverCommand(DriverCommand.GetLog, new HttpCommandInfo(HttpCommandInfo.PostCommand, "/session/{sessionId}/se/log"), true);
            }

            // These below code exists solely to support obsolete protocol end points.
            // They should be removed at the earliest available opportunity.
            if (this.Capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
            {
                object appCacheCapability = this.Capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
                if (appCacheCapability is bool && (bool)appCacheCapability)
                {
                    this.appCache = new ApplicationCache(this);
                }
            }

            if (this.Capabilities.HasCapability(CapabilityType.SupportsLocationContext))
            {
                object locationContextCapability = this.Capabilities.GetCapability(CapabilityType.SupportsLocationContext);
                if (locationContextCapability is bool && (bool)locationContextCapability)
                {
                    this.locationContext = new LocationContext(this);
                }
            }

            if (this.Capabilities.HasCapability(CapabilityType.SupportsWebStorage))
            {
                object webContextCapability = this.Capabilities.GetCapability(CapabilityType.SupportsWebStorage);
                if (webContextCapability is bool && (bool)webContextCapability)
                {
                    this.storage = new WebStorage(this);
                }
            }
        }
コード例 #4
0
ファイル: ActivityContext.cs プロジェクト: formist/LinkMe
 public void Register(ISubActivityContext context)
 {
     if (context is IVerticalContext)
     {
         _verticalContext = (IVerticalContext)context;
     }
     else if (context is ICommunityContext)
     {
         _communityContext = (ICommunityContext)context;
     }
     else if (context is ILocationContext)
     {
         _locationContext = (ILocationContext)context;
     }
     else if (context is IChannelContext)
     {
         _channelContext = (IChannelContext)context;
     }
 }
コード例 #5
0
 public LocationObject(UserObject owner, ILocationContext context)
 {
     Owner   = owner;
     Context = context;
 }
コード例 #6
0
 public LocationLogic(ILocationContext context)
 {
     _context = context;
 }
コード例 #7
0
ファイル: LocationLogic.cs プロジェクト: djdino56/ICT4Events
 public LocationLogic(ILocationContext context)
 {
     _context = context;
 }
コード例 #8
0
 public void CopyTo(ILocationContext target)
 {
     target.Ip = Ip;
 }
コード例 #9
0
 public LocationFactory(ILocationContext context)
 {
     Context = context;
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationService"/> class.
 /// </summary>
 /// <param name="imeiService">The IMEI service this service should use.</param>
 /// <param name="context">The data context to store to.</param>
 /// <remarks>If <paramref name="imeiService"/> is null, it will be loaded from the DependencyResolver</remarks>
 public LocationService(ILocationContext context, IIMEIService imeiService)
 {
     _imeiService = imeiService;
     _dataContext = context;
 }
コード例 #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class
        /// </summary>
        /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
        /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
        public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
        {
            this.executor = commandExecutor;
            this.StartClient();
            this.StartSession(desiredCapabilities);
            this.mouse = new RemoteMouse(this);
            this.keyboard = new RemoteKeyboard(this);

            if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
            {
                object appCacheCapability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
                if (appCacheCapability is bool && (bool)appCacheCapability)
                {
                    this.appCache = new RemoteApplicationCache(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
            {
                object locationContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
                if (locationContextCapability is bool && (bool)locationContextCapability)
                {
                this.locationContext = new RemoteLocationContext(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
            {
                object webContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
                if (webContextCapability is bool && (bool)webContextCapability)
                {
                    this.storage = new RemoteWebStorage(this);
                }
            }
        }
コード例 #12
0
ファイル: RemoteWebDriver.cs プロジェクト: petruc/selenium
 /// <summary>
 /// Initializes a new instance of the RemoteWebDriver class
 /// </summary>
 /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
 /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
     this.storage = new RemoteWebStorage(this);
     this.appCache = new RemoteApplicationCache(this);
     this.locationContext = new RemoteLocationContext(this);
 }
コード例 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportService"/> class.
 /// </summary>
 /// <param name="context">The data context to store to.</param>
 public ReportService(ILocationContext context)
 {
     _dataContext = context;
 }
コード例 #14
0
 protected BaseRepository(ILocationContext store)
 {
     _locationStore = store;
 }
コード例 #15
0
 public LocationRepository(ILocationContext context)
 {
     context = new LocationContext();
 }
コード例 #16
0
 private void SetUp()
 {
     _factory = Substitute.For <ILocationContextFactory>();
     _context = Substitute.For <ILocationContext>();
     _factory.Create().Returns(_context);
 }
コード例 #17
0
 public LocationRepo(ILocationContext context)
 {
     Context = context;
 }
コード例 #18
0
 public LocationRepository(ILocationContext store)
     : base(store)
 {
 }
コード例 #19
0
 public LocationService(ILocationContext context) : this(context, null)
 {
 }