^{END}
{END}{ENTER}{ENTER}
namespace Microsoft.AnalysisServices 
{
}
{UP}{UP}{END}{ENTER}
using System;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Diagnostics;
using System.Collections;
using Microsoft.DataWarehouse;

public sealed partial class Level :
NamedComponent,
ICloneable
{
}
{UP}{UP}{END}{ENTER}
private string sourceAttributeID;
private HideIfValue hideMemberIf;
private TranslationCollection translations;

private void Initialize()
{
}

object ICloneable.Clone()
{
return CopyTo( new Level() );
}

public Level()
{
}

public Level( string name ): base(name)
{
}

public Level( string name, string id ) : base(name, id)
{
}

public string SourceAttributeID
{
get { return sourceAttributeID; }
set {  }
}

public HideIfValue HideMemberIf
{
get { return hideMemberIf; }
set {  }
}

public TranslationCollection Translations
{
get { return translations; }
}


public DimensionAttribute SourceAttribute
{
get
{
return null == this.sourceAttributeID ? null : this.SourceAttributeOrException;
}
set
{
}
}

internal DimensionAttribute SourceAttributeOrException
{
get
{
return this.ParentDimensionOrException.Attributes[this.sourceAttributeID];
}
}

internal DimensionAttribute SourceAttributeOrNull
{
get
{
Dimension dimension = this.ParentDimensionOrNull;

return null == dimension ? null : dimension.Attributes.Find(this.sourceAttributeID);
}
}

public Level CopyTo( Level obj )
{
return obj;
}

public Level Clone()
{
return CopyTo( new Level() );
}

internal void UpdateDependents( int index )
{

}

protected internal override void AfterInsert( int index )
{

}

protected internal override void BeforeRemove( bool cleanUp )
{

}

protected internal override void AfterMove( int fromIndex, int toIndex )
{
Hierarchy hierarchy = this.ParentOrNull;
Dimension dimension = this.ParentDimensionOrNull;
Database database = this.ParentDatabaseOrNull;
if ( null == database )
return;

string levelID = this.ID;
string hierarchyID = hierarchy.ID;
string dimensionID = dimension.ID;
}

public override bool Validate( ValidationErrorCollection errors, bool includeDetailedErrors )
{
if ( ! base.Validate(errors, includeDetailedErrors) )
return false;

DimensionAttribute sourceAttribute = this.SourceAttributeOrNull;

if ( null == sourceAttribute )
{
errors.Add(this, ValidationSR.Level_SourceAttributeIsUnknown);
return false;
}
else if ( ! sourceAttribute.AttributeHierarchyEnabled )
{
errors.Add(this, ValidationSR.Level_SourceAttributeDoesntHaveAttributeHierarchyEnabled);
return false;
}
else
{
return true;
}
}
^{END}