-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
113 additions
and
105 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/Compatibility/Core/src/iOS/Resources/StringResources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Maui.Controls | ||
{ | ||
public abstract partial class Layout<T> | ||
{ | ||
int ICollection<IView>.Count => _children.Count; | ||
bool ICollection<IView>.IsReadOnly => ((ICollection<IView>) _children).IsReadOnly; | ||
public IView this[int index] { get => _children[index]; set => _children[index] = (T)value; } | ||
|
||
public void Add(IView child) | ||
{ | ||
if (child is T view) | ||
{ | ||
_children.Add(view); | ||
} | ||
} | ||
|
||
public bool Remove(IView child) | ||
{ | ||
if (child is T view) | ||
{ | ||
_children.Remove(view); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
int IList<IView>.IndexOf(IView child) | ||
{ | ||
return _children.IndexOf(child); | ||
} | ||
|
||
void IList<IView>.Insert(int index, IView child) | ||
{ | ||
if (child is T view) | ||
{ | ||
_children.Insert(index, view); | ||
} | ||
} | ||
|
||
void IList<IView>.RemoveAt(int index) | ||
{ | ||
_children.RemoveAt(index); | ||
} | ||
|
||
void ICollection<IView>.Clear() | ||
{ | ||
_children.Clear(); | ||
} | ||
|
||
bool ICollection<IView>.Contains(IView child) | ||
{ | ||
return _children.Contains(child); | ||
} | ||
|
||
void ICollection<IView>.CopyTo(IView[] array, int arrayIndex) | ||
{ | ||
_children.CopyTo(array, arrayIndex); | ||
} | ||
|
||
IEnumerator<IView> IEnumerable<IView>.GetEnumerator() | ||
{ | ||
return _children.GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return _children.GetEnumerator(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.