MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed/Microsoft/InfoCards/SecondaryIndexDefinition.cs
2022-08-18 06:28:56 -05:00

85 lines
4.1 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.SecondaryIndexDefinition
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 1D4D5564-A025-490C-AF1D-DF4FBB709D1F
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed.exe
using Microsoft.InfoCards.Diagnostics;
using System;
namespace Microsoft.InfoCards
{
internal sealed class SecondaryIndexDefinition
{
public const string GlobalIdIndex = "ix_globalid";
public const string ObjectTypeIndex = "ix_objecttype";
public const string NameIndex = "ix_name";
public const string RecipientIdIndex = "ix_name";
public const string ProductionServiceIndex = "ix_production_svc_uri";
public const string ParentIdIndex = "ix_parentid";
public const string MasterKeyIndex = "ix_masterkey";
public const string SupportedClaimIndex = "ix_supportclaim";
public const string SupportedAuthIndex = "ix_supportauth";
private static readonly SecondaryIndexDefinition[] s_masterIndexes = new SecondaryIndexDefinition[8]
{
new SecondaryIndexDefinition("ix_globalid", 10, 20, SecondaryIndexSettings.Unique, Canonicalizers.Binary),
new SecondaryIndexDefinition("ix_objecttype", 10, 20, SecondaryIndexSettings.None, Canonicalizers.Binary),
new SecondaryIndexDefinition("ix_name", 10, 20, SecondaryIndexSettings.Nullable, Canonicalizers.CaseInsensitiveWithHashing),
new SecondaryIndexDefinition("ix_production_svc_uri", 10, 20, SecondaryIndexSettings.Nullable, Canonicalizers.CaseInsensitiveWithHashing),
new SecondaryIndexDefinition("ix_parentid", 10, 20, SecondaryIndexSettings.Nullable, Canonicalizers.Binary),
new SecondaryIndexDefinition("ix_masterkey", 10, 20, SecondaryIndexSettings.Nullable | SecondaryIndexSettings.Unique, Canonicalizers.BinaryWithHashing),
new SecondaryIndexDefinition("ix_supportclaim", 50, 20, SecondaryIndexSettings.Nullable, Canonicalizers.CaseSensitiveWithHashing),
new SecondaryIndexDefinition("ix_supportauth", 10, 20, SecondaryIndexSettings.Nullable, Canonicalizers.Binary)
};
private int m_initialSize;
private int m_growthFactor;
private SecondaryIndexSettings m_settings;
private string m_name;
private ICanonicalizer m_canonicalizer;
private SecondaryIndexDefinition(
string name,
int initialSize,
int growthFactor,
SecondaryIndexSettings settings,
ICanonicalizer canonicalizer)
{
if (string.IsNullOrEmpty(name))
throw InfoCardTrace.ThrowHelperArgumentNull(nameof (name));
if (initialSize <= 0)
throw InfoCardTrace.ThrowHelperError((Exception) new ArgumentOutOfRangeException(nameof (initialSize), (object) initialSize, SR.GetString("StoreIndexInitialSizeInvalid")));
if (canonicalizer == null)
throw InfoCardTrace.ThrowHelperArgumentNull(nameof (canonicalizer));
if (growthFactor <= 0)
throw InfoCardTrace.ThrowHelperError((Exception) new ArgumentOutOfRangeException(nameof (growthFactor), (object) growthFactor, SR.GetString("StoreIndexGrowthFactorInvalid")));
this.m_initialSize = initialSize;
this.m_growthFactor = growthFactor;
this.m_settings = settings;
this.m_name = name;
this.m_canonicalizer = canonicalizer;
}
public static SecondaryIndexDefinition[] MasterIndexes => SecondaryIndexDefinition.s_masterIndexes;
public ICanonicalizer Canonicalizer => this.m_canonicalizer;
public string Name => this.m_name;
public int InitialSize => this.m_initialSize;
public int GrowthFactor => this.m_growthFactor;
public SecondaryIndexSettings Settings => this.m_settings;
public static SecondaryIndexDefinition GetByName(string name)
{
for (int index = 0; index < SecondaryIndexDefinition.s_masterIndexes.Length; ++index)
{
if (SecondaryIndexDefinition.s_masterIndexes[index].Name == name)
return SecondaryIndexDefinition.s_masterIndexes[index];
}
return (SecondaryIndexDefinition) null;
}
}
}