本文整理汇总了C#中IDriver类的典型用法代码示例。如果您正苦于以下问题:C# IDriver类的具体用法?C# IDriver怎么用?C# IDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDriver类属于命名空间,在下文中一共展示了IDriver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
}
示例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);
}
示例8: CheckDriver
static bool CheckDriver(IDriver driver)
{
if (!driver.IsExistLicence | !driver.IsExistCarDocuments)
{
return false;
}
return true;
}
示例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;
}
示例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;
}
示例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;
}
示例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];
}
示例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;
}
示例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;
}
}
示例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;
}