Skip to content

Commit

Permalink
Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Dec 5, 2017
1 parent ea20f72 commit f9cd63a
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@
<Compile Include="NestedResourceConfigExtensions.cs" />
<Compile Include="ResourceConfigExtensions.cs" />
<Compile Include="StateExtensions.cs" />
<Compile Include="TargetDependencies.cs" />
<Compile Include="NestedResourceConfig.cs" />
<Compile Include="NestedResourceStrategy.cs" />
<Compile Include="TargetState.cs" />
<Compile Include="TargetStateExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceConfig.cs" />
<Compile Include="ResourceStrategy.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// Base interface for ResourceStrategy and NestedResourceStrategy classes.
/// </summary>
public interface IEntityStrategy
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// Base interface for ResourceConfig[].
/// </summary>
public interface IResourceConfig : IEntityConfig
{
new IResourceStrategy Strategy { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// Base interface for ResourceStrategy[].
/// </summary>
public interface IResourceStrategy : IEntityStrategy
{
string Type { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// Nested resource configuration. Fro example, Subnet.
/// </summary>
/// <typeparam name="TModel"></typeparam>
/// <typeparam name="TParenModel"></typeparam>
public sealed class NestedResourceConfig<TModel, TParenModel> : IEntityConfig<TModel>
where TModel : class
where TParenModel : class
Expand All @@ -26,6 +31,9 @@ public sealed class NestedResourceConfig<TModel, TParenModel> : IEntityConfig<TM

public string Name { get; }

/// <summary>
/// Parent. For example, VirtualNetwork is a parent of Subnet.
/// </summary>
public IEntityConfig<TParenModel> Parent { get; }

public Func<TModel> CreateModel { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public ProgressMap(Dictionary<IResourceConfig, Tuple<TimeSlot, int>> map, int du
}

/// <summary>
/// Returns a value [0..1] which is used to increment a progress bar when the resource is
/// created.
/// Returns a value of [0..1] range which is used to increment a progress bar when the
/// resource is created.
/// </summary>
/// <param name="config">a resource configuration.</param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// Resource configuration. It contains information to create a resource,
/// including name, resource group name, dependencies, model creation function, etc.
/// </summary>
/// <typeparam name="TModel"></typeparam>
public sealed class ResourceConfig<TModel> : IEntityConfig<TModel>, IResourceConfig
where TModel : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// Azure State. It contains information (models) of Azure resources.
/// </summary>
sealed class State : IState
{
readonly ConcurrentDictionary<string, object> _Map
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Collections.Generic;
using System.Linq;

namespace Microsoft.Azure.Commands.Common.Strategies
{
public static class TargetState
public static class TargetStateExtensions
{
public static IEnumerable<IResourceConfig> GetTargetDependencies(
this IResourceConfig config, IState target)
=> config.GetResourceDependencies().Where(target.Contains);

public static IState GetTargetState<TModel>(
this ResourceConfig<TModel> config,
IState current,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Commands.Common.Strategies
{
/// <summary>
/// TimeSlot is a node of a singly linked list of TimeSlots.
/// The last node of the list is always an empty time slot
/// The last node of the list is always an empty time slot:
/// - Duration = 0.
/// - Next = null.
/// - TaskCount = 0.
Expand Down

0 comments on commit f9cd63a

Please sign in to comment.