Changeset 776 for trunk/sources/HeuristicLab.Core/Interfaces/IScope.cs
- Timestamp:
- 11/19/08 12:12:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/Interfaces/IScope.cs
r63 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface for a hierarchical container of variables (containing variables and subscopes). 30 /// </summary> 28 31 public interface IScope : IItem { 32 /// <summary> 33 /// Gets the name of the current instance. 34 /// </summary> 29 35 string Name { get; } 30 36 37 /// <summary> 38 /// Gets the varibles of the current scope. 39 /// </summary> 31 40 ICollection<IVariable> Variables { get; } 41 /// <summary> 42 /// Gets all aliases of the current scope. 43 /// </summary> 32 44 IEnumerable<KeyValuePair<string, string>> Aliases { get; } 45 /// <summary> 46 /// Gets all subscopes in the current scope. 47 /// </summary> 33 48 IList<IScope> SubScopes { get; } 34 49 50 /// <summary> 51 /// Sets the parent scope for the current instance. 52 /// </summary> 53 /// <param name="scope">The parent scope of the current instance.</param> 35 54 void SetParent(IScope scope); 36 55 56 /// <summary> 57 /// Gets a variable with the given <paramref name="name"/>. 58 /// </summary> 59 /// <param name="name">The name of the variable.</param> 60 /// <returns>The variable with the specified name.</returns> 37 61 IVariable GetVariable(string name); 62 /// <summary> 63 /// Adds the specified variable to the curent instance. 64 /// </summary> 65 /// <param name="variable">The variable to add.</param> 38 66 void AddVariable(IVariable variable); 67 /// <summary> 68 /// Deletes a variable with the specified <paramref name="name"/> from the current instance. 69 /// </summary> 70 /// <param name="name">The name of the variable to delete.</param> 39 71 void RemoveVariable(string name); 72 73 /// <inheritdoc cref="GetVariableValue(string, bool)"/> 74 /// <typeparam name="T">The type of the value that is searched.</typeparam> 40 75 T GetVariableValue<T>(string name, bool recursiveLookup) where T : class, IItem; 76 /// <inheritdoc cref="GetVariableValue(string, bool, bool)"/> 77 /// <typeparam name="T">The type of the value that is searched.</typeparam> 41 78 T GetVariableValue<T>(string name, bool recursiveLookup, bool throwOnError) where T : class, IItem; 79 /// <inheritdoc cref="GetVariableValue(string, bool, bool)" select="summary"/> 80 /// <param name="name">The name of the variable.</param> 81 /// <param name="recursiveLookup">Boolean value, whether the parent scopes shall be searched 82 /// when the variable is not found in the current instance.</param> 83 /// <returns>The value of the variable or <c>null</c> if it was not found.</returns> 42 84 IItem GetVariableValue(string name, bool recursiveLookup); 85 /// <summary> 86 /// Gets the value of the variable with the given <paramref name="name"/>. 87 /// </summary> 88 /// <param name="name">The name of the variable.</param> 89 /// <param name="recursiveLookup">Boolean value, whether the parent scopes shall be searched 90 /// when the variable is not found in the current instance.</param> 91 /// <param name="throwOnError">Boolean value, whether an exception shall be thrown when the searched 92 /// variable cannot be found, or only <c>null</c> shall be returned.</param> 93 /// <returns>The value of the searched variable or <c>null</c> if <paramref name="throwOnError"/> 94 /// is set to <c>false</c>.</returns> 43 95 IItem GetVariableValue(string name, bool recursiveLookup, bool throwOnError); 44 96 97 /// <summary> 98 /// Gets the actual name the given alias. 99 /// </summary> 100 /// <param name="name">The alias whose actual name is searched.</param> 101 /// <returns>The actual name.</returns> 45 102 string TranslateName(string name); 103 /// <summary> 104 /// Adds an alias to the current instance. 105 /// </summary> 106 /// <param name="alias">The alias to add.</param> 107 /// <param name="name">The actual name of the alias.</param> 46 108 void AddAlias(string alias, string name); 109 /// <summary> 110 /// Deletes the specified <paramref name="alias"/> from the current instance. 111 /// </summary> 112 /// <param name="alias">The alias to delete.</param> 47 113 void RemoveAlias(string alias); 48 114 115 /// <summary> 116 /// Adds the specified sub scope to the current instance. 117 /// </summary> 118 /// <param name="scope">The sub scope to add.</param> 49 119 void AddSubScope(IScope scope); 120 /// <summary> 121 /// Deletes the specified sub scope from the current instance. 122 /// </summary> 123 /// <param name="scope">The sub scope to delete.</param> 50 124 void RemoveSubScope(IScope scope); 125 /// <summary> 126 /// Reorders all sub scopes according to the specified chronology. 127 /// </summary> 128 /// <param name="sequence">The chronology how to order the sub scopes.</param> 51 129 void ReorderSubScopes(int[] sequence); 130 /// <summary> 131 /// Gets the sub scope with the given <paramref name="guid"/>. 132 /// </summary> 133 /// <param name="guid">The unique identifier of the sub scope.</param> 134 /// <returns>The sub scope with the given <paramref name="guid"/>.</returns> 52 135 IScope GetScope(Guid guid); 136 /// <summary> 137 /// Gets the sub scope with the given <paramref name="name"/>. 138 /// </summary> 139 /// <param name="name">The name of the sub scope.</param> 140 /// <returns>The sub scope with the given <paramref name="name"/>.</returns> 53 141 IScope GetScope(string name); 54 142 143 /// <summary> 144 /// Clears the current instance. 145 /// </summary> 55 146 void Clear(); 56 147 148 /// <summary> 149 /// Occurs when a variable has been added to the current instance. 150 /// </summary> 57 151 event EventHandler<VariableEventArgs> VariableAdded; 152 /// <summary> 153 /// Occurs when a variable has been deleted from the current instance. 154 /// </summary> 58 155 event EventHandler<VariableEventArgs> VariableRemoved; 156 /// <summary> 157 /// Occurs when an alias has been added to the current instance. 158 /// </summary> 59 159 event EventHandler<AliasEventArgs> AliasAdded; 160 /// <summary> 161 /// Occurs when an alias has been removed from the current instance. 162 /// </summary> 60 163 event EventHandler<AliasEventArgs> AliasRemoved; 164 /// <summary> 165 /// Occurs when a sub scope has been added to the current instance. 166 /// </summary> 61 167 event EventHandler<ScopeIndexEventArgs> SubScopeAdded; 168 /// <summary> 169 /// Occurs when a sub scope has been deleted from the current instance. 170 /// </summary> 62 171 event EventHandler<ScopeIndexEventArgs> SubScopeRemoved; 172 /// <summary> 173 /// Occurs when the sub scopes have been reordered. 174 /// </summary> 63 175 event EventHandler SubScopesReordered; 64 176 }
Note: See TracChangeset
for help on using the changeset viewer.