/// <summary> /// Initializes a new <i>FileNameList</i> that may hold <see cref="Directories"/>. /// </summary> /// <param name="withDirectories">True to hold directories. Otherwise, <see cref="Directories"/> /// will remain null.</param> public FileNameList(bool withDirectories) { _files = new CKReadOnlyListOnIList <string>(Array.Empty <string>()); if (withDirectories) { _dir = new CKReadOnlyListOnIList <string>(Array.Empty <string>()); } }
public LogMethodConfig( string methodName, string returnType, List<ILogParameterInfo> p, ServiceLogMethodOptions logOptions, bool doLog ) { _doLog = doLog; LogOptions = logOptions; Name = methodName; ReturnType = returnType; _parameters = p; _parametersEx = new CKReadOnlyListOnIList<ILogParameterInfo>( _parameters ); }
public KeyInteractionEventArgs( IKey k, IKeyProgram p, KeyInteractionEventType eventType ) : base(k) { EventType = eventType; // Clone the commands: the emitted commands is a snapshot of the commands // at the time of the event. string[] copy = p.Commands.ToArray(); Commands = new CKReadOnlyListOnIList<string>( copy ); }
public LogEventConfig(string eventName, List<ILogParameterInfo> parameters, ServiceLogEventOptions logOptions, bool doLog) { Name = eventName; _doLog = doLog; _parameters = parameters; _parametersEx = new CKReadOnlyListOnIList<ILogParameterInfo>(_parameters); LogOptions = logOptions; }
internal FileNameList(IEnumerable <string> files, IEnumerable <string> dir) { Debug.Assert(files.IsSortedStrict(StringComparer.Ordinal.Compare)); Debug.Assert(dir == null || dir.IsSortedStrict(StringComparer.Ordinal.Compare)); _files = new CKReadOnlyListOnIList <string>(files.ToArray()); if (dir != null) { _dir = new CKReadOnlyListOnIList <string>(dir.ToArray()); } }
public VirtualZone( ICKReadOnlyList<IHighlightableElement> elements, int start, int length ) { List<IHighlightableElement> children = new List<IHighlightableElement>(); for( int i = start; i < elements.Count && i < length + start; i++ ) { children.Add( elements[i] ); } Children = new CKReadOnlyListOnIList<IHighlightableElement>( children ); }
/// <summary> /// Initializes a new <i>FileNameList</i> with a list of file names. /// The list can be (or must be) sorted thanks to <see cref="StringComparer.Ordinal"/>. /// </summary> /// <param name="files">List of file names.</param> /// <param name="prefix">Prefix if not null nor empty will be added to every file.</param> /// <param name="mustSort">True if sort must be called. False if the list is already sorted.</param> public FileNameList(IEnumerable <string> files, string prefix, bool mustSort) { if (mustSort) { files = files.OrderBy(s => s, StringComparer.Ordinal); } Debug.Assert(mustSort || files.IsSortedStrict(StringComparer.Ordinal.Compare)); _files = new CKReadOnlyListOnIList <string>(files.ToArray()); if (prefix != null && prefix.Length > 0) { for (int i = 0; i < _files.Count; ++i) { _files.Values[i] = prefix + _files[i]; } } }
public VirtualZone( IHighlightableElement element ) { WrappedElement = element; List<IHighlightableElement> children = new List<IHighlightableElement>(); int childPerZone = element.Children.Count / HalfZoneScrollingStrategy.ZoneDivider; for( int i = 0; i < HalfZoneScrollingStrategy.ZoneDivider; i++ ) { //On the last iteration, we add the remaining children. if( i == HalfZoneScrollingStrategy.ZoneDivider - 1 ) children.Add( new VirtualZone( element.Children, childPerZone * i, childPerZone + element.Children.Count % HalfZoneScrollingStrategy.ZoneDivider ) ); else children.Add( new VirtualZone( element.Children, childPerZone * i, childPerZone ) ); } Children = new CKReadOnlyListOnIList<IHighlightableElement>( children ); Skip = SkippingBehavior.None; }
/// <summary> /// Update a child reference with a new one /// </summary> /// <param name="oldChild"></param> /// <param name="newChild"></param> public void UpdateChild( IHighlightableElement oldChild, IHighlightableElement newChild ) { int idx = Children.IndexOf( oldChild ); List<IHighlightableElement> list = Children.ToList(); list[idx] = newChild; Children = new CKReadOnlyListOnIList<IHighlightableElement>( list ); }