本文整理汇总了C#中ObjectName.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectName.Equals方法的具体用法?C# ObjectName.Equals怎么用?C# ObjectName.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectName
的用法示例。
在下文中一共展示了ObjectName.Equals方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContainsTable
public bool ContainsTable(ObjectName name)
{
// This set can not contain the table that is backing it, so we always
// return false for that. This check stops an annoying recursive
// situation for table name resolution.
if (name.Equals(TableName))
return false;
return FindByName(name) != -1;
}
示例2: RemoveNativeTableSequence
private bool RemoveNativeTableSequence(ObjectName tableName)
{
// If the Sequence or SequenceInfo tables don't exist then
// We can't add or remove native tables
if (tableName.Equals(SystemSchema.SequenceTableName) ||
tableName.Equals(SystemSchema.SequenceInfoTableName) ||
!Transaction.ObjectExists(SystemSchema.SequenceTableName) ||
!Transaction.ObjectExists(SystemSchema.SequenceInfoTableName)) {
return false;
}
// The SEQUENCE and SEQUENCE_INFO table
var seq = Transaction.GetMutableTable(SystemSchema.SequenceTableName);
var seqi = Transaction.GetMutableTable(SystemSchema.SequenceInfoTableName);
var list = seqi.SelectRowsEqual(2, DataObject.VarChar(tableName.Name), 1, DataObject.VarChar(tableName.Parent.FullName));
// Remove the corresponding entry in the SEQUENCE table
foreach (var rowIndex in list) {
var sid = seqi.GetValue(rowIndex, 0);
var list2 = seq.SelectRowsEqual(0, sid);
foreach (int rowIndex2 in list2) {
// Remove entry from the sequence table.
seq.RemoveRow(rowIndex2);
}
// Remove entry from the sequence info table
seqi.RemoveRow(rowIndex);
}
return true;
}
示例3: GetTable
/// <summary>
/// Tries to get an object with the given name formed as table.
/// </summary>
/// <param name="transaction">The transaction object.</param>
/// <param name="tableName">The name of the table to try to get.</param>
/// <returns>
/// Returns an instance of <see cref="ITable"/> if an object with the given name was
/// found in the underlying transaction and it is of <see cref="DbObjectType.Table"/> and
/// it is <c>not null</c>.
/// </returns>
public static ITable GetTable(this ITransaction transaction, ObjectName tableName)
{
tableName = ResolveReservedTableName(tableName);
var tableStateHandler = transaction as ITableStateHandler;
if (tableStateHandler != null) {
if (tableName.Equals(SystemSchema.OldTriggerTableName, transaction.IgnoreIdentifiersCase()))
return tableStateHandler.TableState.OldDataTable;
if (tableName.Equals(SystemSchema.NewTriggerTableName, transaction.IgnoreIdentifiersCase()))
return tableStateHandler.TableState.NewDataTable;
}
return (ITable) transaction.GetObject(DbObjectType.Table, tableName);
}
示例4: FindByName
public int FindByName(ObjectName name)
{
if (HasOldTable &&
name.Equals(SystemSchema.OldTriggerTableName, transaction.IgnoreIdentifiersCase()))
return 0;
if (HasNewTable &&
name.Equals(SystemSchema.NewTriggerTableName, transaction.IgnoreIdentifiersCase()))
return HasOldTable ? 1 : 0;
return -1;
}
示例5: SimpleName_Equals
public void SimpleName_Equals()
{
var objName1 = new ObjectName("id1");
var objName2 = new ObjectName("id1");
Assert.IsTrue(objName1.Equals(objName2));
}
示例6: IndexOfColumn
protected override int IndexOfColumn(ObjectName columnName)
{
for (int i = 0; i < aliases.Length; ++i) {
if (columnName.Equals(aliases[i])) {
return i;
}
}
return -1;
}
示例7: SimpleName_NotEquals
public void SimpleName_NotEquals()
{
var objName1 = new ObjectName("id1");
var objName2 = new ObjectName("id2");
Assert.IsFalse(objName1.Equals(objName2));
}
示例8: RemoveNotificationListener
public void RemoveNotificationListener(ObjectName name, NotificationCallback callback)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (callback == null)
{
throw new ArgumentNullException("callback");
}
var toRemove = _subscriptions.Keys.Where(x => callback.Equals(x.Callback) && name.Equals(x.ObjectName)).ToList();
foreach (var key in toRemove)
{
var listener = _subscriptions[key];
listener.Dispose();
_subscriptions.Remove(key);
}
}
示例9: SubstituteAliasedVariable
private static ObjectName SubstituteAliasedVariable(ObjectName v, IEnumerable<SelectColumn> columns)
{
var name = v;
if (columns != null) {
foreach (SelectColumn scol in columns) {
if (v.Equals(scol.Alias)) {
name =scol.InternalName.Clone();
break;
}
}
}
return name;
}
示例10: FindFieldName
/// <inheritdoc/>
public override int FindFieldName(ObjectName v)
{
for (int i = 0; i < aliases.Length; ++i) {
if (v.Equals(aliases[i])) {
return i;
}
}
return -1;
}
示例11: FindByName
public int FindByName(ObjectName name)
{
if (HasOldTable &&
name.Equals(SystemSchema.OldTriggerTableName))
return 0;
if (HasNewTable &&
name.Equals(SystemSchema.NewTriggerTableName))
return HasOldTable ? 1 : 0;
return -1;
}