本文整理汇总了C#中IType.IsDirty方法的典型用法代码示例。如果您正苦于以下问题:C# IType.IsDirty方法的具体用法?C# IType.IsDirty怎么用?C# IType.IsDirty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IType
的用法示例。
在下文中一共展示了IType.IsDirty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EqualsSnapshot
public override bool EqualsSnapshot(IType elementType)
{
IDictionary xmap = (IDictionary) GetSnapshot();
if (xmap.Count != this.map.Count)
{
return false;
}
foreach (DictionaryEntry entry in map)
{
if (elementType.IsDirty(entry.Value, xmap[entry.Key], Session))
{
return false;
}
}
return true;
}
示例2: EqualsSnapshot
/// <summary>
///
/// </summary>
/// <param name="elementType"></param>
/// <returns></returns>
public override bool EqualsSnapshot( IType elementType )
{
IList sn = ( IList ) GetSnapshot();
if( sn.Count != this.list.Count )
{
return false;
}
for( int i = 0; i < list.Count; i++ )
{
if( elementType.IsDirty( list[ i ], sn[ i ], Session ) )
{
return false;
}
}
return true;
}
示例3: NeedsUpdating
public override bool NeedsUpdating(object entry, int i, IType elemType)
{
Array sn = (Array) GetSnapshot();
return
i < sn.Length && sn.GetValue(i) != null && array.GetValue(i) != null
&& elemType.IsDirty(array.GetValue(i), sn.GetValue(i), Session);
}
示例4: NeedsUpdating
public override bool NeedsUpdating(object entry, int i, IType elemType)
{
IList sn = (IList) GetSnapshot();
return i < sn.Count && sn[i] != null && list[i] != null && elemType.IsDirty(list[i], sn[i], Session);
}
示例5: NeedsInserting
public override bool NeedsInserting(object entry, int i, IType elemType)
{
IDictionary sn = (IDictionary) GetSnapshot();
object oldKey = sn[entry];
// note that it might be better to iterate the snapshot but this is safe,
// assuming the user implements equals() properly, as required by the PersistentSet
// contract!
return oldKey == null || elemType.IsDirty(oldKey, entry, Session);
}
示例6: GetDeletes
public override IEnumerable GetDeletes(IType elemType, bool indexIsFormula)
{
IList deletes = new ArrayList();
IDictionary snapshot = (IDictionary) GetSnapshot();
foreach (DictionaryEntry e in snapshot)
{
object test = e.Key;
if (internalSet.Contains(test) == false)
{
deletes.Add(test);
}
}
foreach (object obj in internalSet)
{
//object testKey = e.Key;
object oldKey = snapshot[obj];
if (oldKey != null && elemType.IsDirty(obj, oldKey, Session))
{
deletes.Add(obj);
}
}
return deletes;
}
示例7: NeedsUpdating
public override bool NeedsUpdating(object entry, int i, IType elemType)
{
if (entry == null)
{
return false;
}
IDictionary snap = (IDictionary) GetSnapshot();
object id = GetIdentifier(i);
if (id == null)
{
return false;
}
object old = snap[id];
return old != null && elemType.IsDirty(old, entry, Session);
}
示例8: NeedsUpdating
public override bool NeedsUpdating(object entry, int i, IType elemType)
{
IDictionary sn = (IDictionary) GetSnapshot();
DictionaryEntry e = (DictionaryEntry) entry;
object snValue = sn[e.Key];
return (e.Value != null && snValue != null && elemType.IsDirty(snValue, e.Value, Session));
}
示例9: NeedsUpdating
public override bool NeedsUpdating(object entry, int i, IType elemType)
{
IDictionary sn = (IDictionary) GetSnapshot();
DictionaryEntry e = (DictionaryEntry) entry;
object snValue = sn[e.Key];
bool isNew = !sn.Contains(e.Key);
return e.Value != null && snValue != null && elemType.IsDirty(snValue, e.Value, Session)
|| (!isNew && ((e.Value == null) != (snValue == null)));
}
示例10: EqualsSnapshot
public override bool EqualsSnapshot(IType elementType)
{
IDictionary snapshot = (IDictionary) GetSnapshot();
if (snapshot.Count != internalSet.Count)
{
return false;
}
else
{
foreach (object obj in internalSet)
{
object oldValue = snapshot[obj];
if (oldValue == null || elementType.IsDirty(oldValue, obj, Session))
{
return false;
}
}
}
return true;
}
示例11: EqualsSnapshot
/// <summary>
///
/// </summary>
/// <param name="elementType"></param>
/// <returns></returns>
public override bool EqualsSnapshot( IType elementType )
{
Array snapshot = GetSnapshot() as Array;
int xlen = snapshot.Length;
if( xlen != array.Length )
{
return false;
}
for( int i = 0; i < xlen; i++ )
{
if( elementType.IsDirty( snapshot.GetValue( i ), array.GetValue( i ), Session ) )
{
return false;
}
}
return true;
}
示例12: EqualsSnapshot
public override bool EqualsSnapshot(IType elementType)
{
IDictionary snap = (IDictionary) GetSnapshot();
if (snap.Count != values.Count)
{
return false;
}
for (int i = 0; i < values.Count; i++)
{
object val = values[i];
object id = identifiers[i];
if (id == null)
{
return false;
}
object old = snap[id];
if (elementType.IsDirty(old, val, Session))
{
return false;
}
}
return true;
}