本文整理汇总了C#中IDriver类的典型用法代码示例。如果您正苦于以下问题:C# IDriver类的具体用法?C# IDriver怎么用?C# IDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDriver类属于命名空间,在下文中一共展示了IDriver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SaveDriver
public OpResult SaveDriver(IDriver newDriver)
{
OpResult result = OpResult.Success;
if (newDriver == null)
result = OpResult.NullParameter;
if (result == OpResult.Success)
{
if(newDriver.Validate())
{
try
{
result = _dataProvider.Save(newDriver);
}
catch (Exception ex)
{
result = OpResult.ExceptionOccurred;
_logger.TraceException(ex.Message, ex);
}
}
else
{
result = OpResult.InvalidParameters;
}
}
return result;
}
开发者ID:smclark,项目名称:DriverManager,代码行数:28,代码来源:DriverListModel.cs
示例2: ReturnElements
public IEnumerable<IElement> ReturnElements(IDriver driver)
{
IEnumerable<IElement> elements = null;
if (SelectorType == SelectorType.Name)
{
elements = driver.FindElementsByXpath(SelectorValue);
}
if (SelectorType == SelectorType.Id)
{
elements = driver.FindElementsById(SelectorValue);
}
if (SelectorType == SelectorType.ClassName)
{
elements = driver.FindElementsByCss(SelectorValue);
}
if (SelectorType == SelectorType.XPath)
{
elements = driver.FindElementsByXpath(SelectorValue);
}
if (elements == null)
throw new InvalidOperationException(this.SelectorValue);
return elements;
}
开发者ID:dburriss,项目名称:UiMatic,代码行数:29,代码来源:Selector.cs
示例3: SqlMapperPersistenceEngine
public SqlMapperPersistenceEngine(string connectionString, IDriver driver, DBDialect dialect, Mapping mapping, ArrayList cacheEntries, Models.Model model)
{
if (connectionString == null)
{
throw new ArgumentNullException("connectionString");
}
if (driver == null)
{
throw new ArgumentNullException("driver");
}
if (dialect == null)
{
throw new ArgumentNullException("dialect");
}
if (mapping == null)
{
throw new ArgumentNullException("mapping");
}
this.Driver = driver;
this.Dialect = dialect;
this._Mapping = mapping;
this._Connection = this._Driver.CreateConnection(connectionString);
if (_Connection is Evaluant.Uss.Data.FileClient.FileConnection)
{
((Evaluant.Uss.Data.FileClient.FileConnection)_Connection).Dialect = dialect;
}
base._Model = model;
this._CacheEntries = cacheEntries;
this.Initialize();
}
开发者ID:npenin,项目名称:uss,代码行数:32,代码来源:SqlMapperPersistenceEngine.cs
示例4: ReturnElement
public IElement ReturnElement(IDriver driver)
{
IElement el = null;
if(SelectorType == SelectorType.Name)
{
el = driver.FindByName(SelectorValue);
}
if(SelectorType == SelectorType.Id)
{
el = driver.FindById(SelectorValue);
}
if(SelectorType == SelectorType.ClassName)
{
el = driver.FindByCss(SelectorValue);
}
if (SelectorType == SelectorType.XPath)
{
el = driver.FindByXpath(SelectorValue);
}
if (el == null)
throw new InvalidOperationException(this.SelectorValue);
return el;
}
开发者ID:dburriss,项目名称:UiMatic,代码行数:28,代码来源:Selector.cs
示例5: synchronize
public static string synchronize(bool isJS, IDriver driver, IEnumerable<BuildIds> buildIds, IEnumerable<Langs> locs) {
var src = buildEnvelopes.adjust();
var dest = driver.readMap();
var delta = src.synchronize(dest, isJS, buildIds, locs);
if (delta == null) return "Up-to-date";
driver.update(delta);
return string.Format("Deleted: {0}, updated: {1}, inserted: {2}", delta.delete.Count, delta.update.Count, delta.insert.Count);
}
开发者ID:PavelPZ,项目名称:NetNew,代码行数:8,代码来源:SynchronizeDirs.cs
示例6: Up
public override void Up(IDriver driver, ILogger logger, ISchemaInfo schemaInfo)
{
using (var trans = driver.Database.BeginTransaction())
{
base.Up(driver, logger, schemaInfo);
trans.Commit();
}
}
开发者ID:geofflane,项目名称:zorched-migrations,代码行数:8,代码来源:TransactionalMigration.cs
示例7: Init
public static void Init(ILogger logger = null, IAssert assert = null,
TimeoutSettings timeouts = null, IDriver<IWebDriver> driverFactory = null)
{
DriverFactory = driverFactory ?? new WebDriverFactory();
Asserter = assert ?? new WebAssert();
Timeouts = timeouts ?? new WebTimeoutSettings();
Logger = logger ?? new LogAgregator(new NUnitLogger(), new Log4Net());
MapInterfaceToElement.Init(DefaultInterfacesMap);
}
开发者ID:epam,项目名称:JDI,代码行数:9,代码来源:WebSettings.cs
示例8: CheckDriver
static bool CheckDriver(IDriver driver)
{
if (!driver.IsExistLicence | !driver.IsExistCarDocuments)
{
return false;
}
return true;
}
开发者ID:AlehSkamarokhau,项目名称:PrototypeApps,代码行数:9,代码来源:Program.cs
示例9: BasePawn
private Model _collisionSphereModel; //sometimes not used if collision shere display is comented out
#endif
#region Constructors
public BasePawn(string resourcePath, IDriver driver = null, Vector3 rotation= new Vector3())
{
_resourcePath = resourcePath;
CollisionsHelper = ServiceLocator.Current.GetInstance<CollisionHelper>();
Movement = new Vector3();
Driver = driver;
Rotation = rotation;
}
开发者ID:ChaosSlave51,项目名称:StarMelee,代码行数:15,代码来源:BasePawn.cs
示例10: GetParamters
public System.Data.IDataParameter[] GetParamters(object data,IDriver driver)
{
IDataParameter[] parameters = new IDataParameter[mParameters.Count];
for (int i = 0; i < mParameters.Count; i++)
{
ProcParameterAttribute procp = mParameters[i];
parameters[i] = driver.CreateProcParameter(procp.Name,
procp.Handler.Get(data), procp.Direction);
}
return parameters;
}
开发者ID:hdxhan,项目名称:IKendeLib,代码行数:11,代码来源:ProcBuilder.cs
示例11: CreateCommand
public IDbCommand CreateCommand(IDriver driver)
{
IDbCommand cmd = driver.Command;
cmd.CommandText = driver.ReplaceSql(SqlText.ToString());
cmd.CommandType = CommandType;
DbCommand = cmd;
foreach (Parameter p in Parameters)
{
cmd.Parameters.Add(driver.CreateParameter(p.Name, p.Value, p.Direction));
}
return cmd;
}
开发者ID:shoy160,项目名称:Shoy.Common,代码行数:12,代码来源:Command.cs
示例12: YandexTest
public YandexTest(Configuration config, IDriver driver)
: base(config, driver)
{
this.loginPage = new LoginPage(driver, config);
this.userName = config.Get[Configuration.UserName];
this.password = config.Get[Configuration.Password];
this.recipient = config.Get[Configuration.Recipient];
this.subject = config.Get[Configuration.BrowserName] + " test " +
DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
this.message = config.Get[Configuration.Message];
}
开发者ID:ograchikov,项目名称:MailDriver,代码行数:12,代码来源:YandexTest.cs
示例13: BasePlayerShip
public BasePlayerShip(ShmupGameState gameState,IDriver<BasePlayerShip> driver)
: base("Models/Ships/p1_saucer", gameState, driver)
{
_gameState = gameState;
CollisionSpheres = new List<BoundingSphere>() { new BoundingSphere(new Vector3(), 700) };
SpeedSide=100.0f;
SpeedForward = 100.0f;
SpeedBack = 100.0f;
MaxBank=MathHelper.ToRadians(45);
EnterBankTime = 20;
ExitBankTime = 40;
}
开发者ID:ChaosSlave51,项目名称:StarMelee,代码行数:14,代码来源:BasePlayerShip.cs
示例14: OnSetUp
protected override void OnSetUp()
{
driverClass = (string)cfg.Properties["hibernate.connection.driver_class"];
if(driverClass.IndexOf(",") < 0)
{
driverClass += ", NHibernate";
}
driver = (IDriver)Activator.CreateInstance(System.Type.GetType(driverClass));
string prepare = (string)cfg.Properties[ Cfg.Environment.PrepareSql ] as string;
if( prepare=="true" )
{
prepareSql = true;
}
}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:16,代码来源:PerformanceTest.cs
示例15: Delete
/// <summary>
/// Deletes the specified driver.
/// </summary>
/// <param name="driver">The driver</param>
/// <exception cref="ArgumentNullException">NULL Driver passed into method</exception>
/// <returns></returns>
public OpResult Delete(IDriver driver)
{
OpResult result = OpResult.Success;
if (driver == null)
result = OpResult.NullParameter;
if (result == OpResult.Success)
{
if (_drivers.Contains(driver))
_drivers.Remove(driver);
else
result = OpResult.ObjectNotExists;
}
return result;
}
开发者ID:smclark,项目名称:DriverManager,代码行数:23,代码来源:DriverDataProvider.cs
示例16: GmailTest
public GmailTest(Configuration config, IDriver driver)
: base(config, driver)
{
this.loginPage = new LoginPage(this.driver, config)
{
UsernameInput = new TextArea(driver) { Locator = By.Id("Email") },
PasswordInput = new TextArea(driver) { Locator = By.Id("Passwd") },
SignInButton = new Button(driver) { Locator = By.Id("signIn") },
NextButton = new Button(driver) { Locator = By.Id("next") },
};
this.userName = config.Get[Configuration.UserName];
this.password = config.Get[Configuration.Password];
this.recipient = config.Get[Configuration.Recipient];
this.subject = config.Get[Configuration.BrowserName] + " test " +
DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
this.message = config.Get[Configuration.Message];
}
开发者ID:ograchikov,项目名称:MailDriver,代码行数:18,代码来源:GmailTest.cs
示例17: InitFromProperties
public static void InitFromProperties(ILogger logger = null, IAssert assert = null,
TimeoutSettings timeouts = null, IDriver<IWebDriver> driverFactory = null)
{
Init(logger, assert, timeouts, driverFactory);
JDISettings.InitFromProperties();
FillFromSettings(p => Domain = p, "Domain");
FillFromSettings(p => DriverFactory.DriverPath = p, "DriversFolder");
// FillFromSettings(p => DriverFactory.DriverVersion = p, "DriversVersion");
// fillAction(p->getDriverFactory().getLatestDriver =
// p.toLowerCase().equals("true") || p.toLowerCase().equals("1"), "driver.getLatest");
// fillAction(p->asserter.doScreenshot(p), "screenshot.strategy");
FillFromSettings(p =>
{
p = p.ToLower();
if (p.Equals("soft"))
p = "any,multiple";
if (p.Equals("strict"))
p = "visible,single";
if (p.Split(',').Length != 2) return;
var parameters = p.Split(',').ToList();
if (parameters.Contains("visible") || parameters.Contains("displayed"))
WebDriverFactory.ElementSearchCriteria = el => el.Displayed;
if (parameters.Contains("any") || parameters.Contains("all"))
WebDriverFactory.ElementSearchCriteria = el => el != null;
if (parameters.Contains("single") || parameters.Contains("displayed"))
OnlyOneElementAllowedInSearch = true;
if (parameters.Contains("multiple") || parameters.Contains("displayed"))
OnlyOneElementAllowedInSearch = false;
}, "SearchElementStrategy");
FillFromSettings(p =>
{
string[] split = null;
if (p.Split(',').Length == 2)
split = p.Split(',');
if (p.ToLower().Split('x').Length == 2)
split = p.ToLower().Split('x');
if (split != null)
BrowserSize = new Size(Parse(split[0]), Parse(split[1]));
}, "BrowserSize");
}
开发者ID:epam,项目名称:JDI,代码行数:42,代码来源:WebSettings.cs
示例18: ConfigureDriver
/// <summary>
/// Configures the driver for the ConnectionProvider.
/// </summary>
/// <param name="settings">An <see cref="IDictionary"/> that contains the settings for the Driver.</param>
/// <exception cref="HibernateException">
/// Thrown when the <see cref="Environment.ConnectionDriver"/> could not be
/// found in the <c>settings</c> parameter or there is a problem with creating
/// the <see cref="IDriver"/>.
/// </exception>
protected virtual void ConfigureDriver( IDictionary settings )
{
string driverClass = settings[ Environment.ConnectionDriver ] as string;
if( driverClass == null )
{
throw new HibernateException( "The " + Environment.ConnectionDriver + " must be specified in the NHibernate configuration section." );
}
else
{
try
{
driver = ( IDriver ) Activator.CreateInstance( ReflectHelper.ClassForName( driverClass ) );
}
catch( Exception e )
{
throw new HibernateException( "Could not create the driver from " + driverClass + ".", e );
}
}
}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:29,代码来源:ConnectionProvider.cs
示例19: Car
public Car(IDriver driver, IEngine engine, IFuel fuel)
{
if (driver == null)
{
throw new ArgumentNullException("driver");
}
if (engine == null)
{
throw new ArgumentNullException("engine");
}
if (fuel == null)
{
throw new ArgumentNullException("fuel");
}
_driver = driver;
_engine = engine;
_fuel = fuel;
}
开发者ID:AlehSkamarokhau,项目名称:PrototypeApps,代码行数:21,代码来源:Car.cs
示例20: DeleteDriver
public OpResult DeleteDriver(IDriver driver)
{
OpResult result = OpResult.Success;
if (driver == null)
result = OpResult.NullParameter;
if (result == OpResult.Success)
{
try
{
result = _dataProvider.Delete(driver);
}
catch (Exception ex)
{
result = OpResult.ExceptionOccurred;
_logger.TraceException(ex.Message, ex);
}
}
return result;
}
开发者ID:smclark,项目名称:DriverManager,代码行数:22,代码来源:DriverListModel.cs
注:本文中的IDriver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论