2008-11-17 18:29:00 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
2008-03-05 09:52:00 -05:00
|
|
|
//
|
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
//
|
2008-11-17 18:29:00 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
2008-03-05 09:52:00 -05:00
|
|
|
|
|
|
|
#if !SINGULARITY_PROCESS
|
|
|
|
namespace Microsoft.Singularity.Directory
|
|
|
|
#else
|
|
|
|
namespace Microsoft.Application.DSP
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
using System;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This class contains state accumulated during the resolution
|
|
|
|
/// of a namespace path.
|
|
|
|
/// </summary>
|
|
|
|
public class ResolutionState
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// what we have resolved so far (modulo the current namespace provider)
|
|
|
|
/// </summary>
|
|
|
|
private string! resolved;
|
|
|
|
|
|
|
|
public ResolutionState()
|
|
|
|
{
|
|
|
|
resolved = "/";
|
|
|
|
}
|
|
|
|
|
|
|
|
public void UpdateResolved(string! current)
|
|
|
|
{
|
2008-11-17 18:29:00 -05:00
|
|
|
if (current.StartsWith("/") || resolved.EndsWith("/")) {
|
2008-03-05 09:52:00 -05:00
|
|
|
resolved = resolved + current;
|
|
|
|
}
|
2008-11-17 18:29:00 -05:00
|
|
|
else {
|
2008-03-05 09:52:00 -05:00
|
|
|
resolved = resolved + "/" + current;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public string! Resolved
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return (!)resolved;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|