mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Add project files.
This commit is contained in:
@@ -0,0 +1,228 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.Clip
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Drawing;
|
||||
using Microsoft.Iris.Layout;
|
||||
using Microsoft.Iris.Markup;
|
||||
using Microsoft.Iris.Render;
|
||||
using Microsoft.Iris.RenderAPI.Drawing;
|
||||
using Microsoft.Iris.UI;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class Clip : ViewItem
|
||||
{
|
||||
private bool _showNear;
|
||||
private bool _showFar;
|
||||
private float _nearOffset;
|
||||
private float _farOffset;
|
||||
private float _nearPercent;
|
||||
private float _farPercent;
|
||||
private EdgeFade _edgefade;
|
||||
|
||||
public Clip()
|
||||
{
|
||||
_showNear = true;
|
||||
_showFar = true;
|
||||
_farPercent = 1f;
|
||||
ClipMouse = true;
|
||||
_edgefade = new EdgeFade();
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
_edgefade.Dispose();
|
||||
_edgefade = null;
|
||||
base.OnDispose();
|
||||
}
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
get => _edgefade.Orientation;
|
||||
set
|
||||
{
|
||||
if (Orientation == value)
|
||||
return;
|
||||
_edgefade.Orientation = value;
|
||||
OnOrientationChanged();
|
||||
FireNotification(NotificationID.Orientation);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnOrientationChanged()
|
||||
{
|
||||
}
|
||||
|
||||
public float FadeSize
|
||||
{
|
||||
get => _edgefade.FadeSize;
|
||||
set
|
||||
{
|
||||
if (FadeSize == (double)value)
|
||||
return;
|
||||
_edgefade.FadeSize = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.FadeSize);
|
||||
}
|
||||
}
|
||||
|
||||
public float NearOffset
|
||||
{
|
||||
get => _nearOffset;
|
||||
set
|
||||
{
|
||||
if (_nearOffset == (double)value)
|
||||
return;
|
||||
_nearOffset = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.NearOffset);
|
||||
}
|
||||
}
|
||||
|
||||
public float FarOffset
|
||||
{
|
||||
get => _farOffset;
|
||||
set
|
||||
{
|
||||
if (_farOffset == (double)value)
|
||||
return;
|
||||
_farOffset = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.FarOffset);
|
||||
}
|
||||
}
|
||||
|
||||
public float NearPercent
|
||||
{
|
||||
get => _nearPercent;
|
||||
set
|
||||
{
|
||||
if (_nearPercent == (double)value)
|
||||
return;
|
||||
_nearPercent = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.NearPercent);
|
||||
}
|
||||
}
|
||||
|
||||
public float FarPercent
|
||||
{
|
||||
get => _farPercent;
|
||||
set
|
||||
{
|
||||
if (_farPercent == (double)value)
|
||||
return;
|
||||
_farPercent = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.FarPercent);
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowNear
|
||||
{
|
||||
get => _showNear;
|
||||
set
|
||||
{
|
||||
if (_showNear == value)
|
||||
return;
|
||||
_showNear = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.ShowNear);
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowFar
|
||||
{
|
||||
get => _showFar;
|
||||
set
|
||||
{
|
||||
if (_showFar == value)
|
||||
return;
|
||||
_showFar = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.ShowFar);
|
||||
}
|
||||
}
|
||||
|
||||
public Color ColorMask
|
||||
{
|
||||
get => _edgefade.ColorMask;
|
||||
set
|
||||
{
|
||||
if (!(_edgefade.ColorMask != value))
|
||||
return;
|
||||
_edgefade.ColorMask = value;
|
||||
FireNotification(NotificationID.ColorMask);
|
||||
}
|
||||
}
|
||||
|
||||
public float FadeAmount
|
||||
{
|
||||
get => _edgefade.FadeAmount;
|
||||
set
|
||||
{
|
||||
if (_edgefade.FadeAmount == (double)value)
|
||||
return;
|
||||
_edgefade.FadeAmount = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.FadeAmount);
|
||||
UpdateEdgeFade();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPaint(bool visible)
|
||||
{
|
||||
base.OnPaint(visible);
|
||||
UpdateEdgeFade();
|
||||
}
|
||||
|
||||
protected void UpdateEdgeFade()
|
||||
{
|
||||
IVisualContainer visualContainer = VisualContainer;
|
||||
if (visualContainer == null)
|
||||
return;
|
||||
float num = Orientation == Orientation.Horizontal ? VisualSize.X : VisualSize.Y;
|
||||
_edgefade.MinOffset = num * NearPercent + NearOffset;
|
||||
_edgefade.MaxOffset = num * (FarPercent - 1f) + FarOffset;
|
||||
_edgefade.ApplyGradients(visualContainer, UISession.RenderSession, _showNear, _showFar);
|
||||
}
|
||||
|
||||
public override void ClipAreaOfInterest(ref AreaOfInterest interest, Size usedSize)
|
||||
{
|
||||
if (interest.Id != AreaOfInterestID.Focus && interest.Id != AreaOfInterestID.FocusOverride)
|
||||
return;
|
||||
Rectangle displayRectangle = interest.DisplayRectangle;
|
||||
int fadeSize = (int)FadeSize;
|
||||
if (Orientation == Orientation.Horizontal)
|
||||
{
|
||||
int right = displayRectangle.Right;
|
||||
if (ShowNear)
|
||||
{
|
||||
displayRectangle.X = Math.Max(displayRectangle.X, fadeSize);
|
||||
displayRectangle.Width = right - displayRectangle.X;
|
||||
}
|
||||
if (ShowFar)
|
||||
displayRectangle.Width = Math.Min(right, usedSize.Width - fadeSize) - displayRectangle.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
int bottom = displayRectangle.Bottom;
|
||||
if (ShowNear)
|
||||
{
|
||||
displayRectangle.Y = Math.Max(displayRectangle.Y, fadeSize);
|
||||
displayRectangle.Height = bottom - displayRectangle.Y;
|
||||
}
|
||||
if (ShowFar)
|
||||
displayRectangle.Height = Math.Min(bottom, usedSize.Height - fadeSize) - displayRectangle.Y;
|
||||
}
|
||||
if (displayRectangle.Width > 0 && displayRectangle.Height > 0)
|
||||
interest.DisplayRectangle = displayRectangle;
|
||||
else
|
||||
interest.DisplayRectangle = Rectangle.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.ContentViewItem
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Animations;
|
||||
using Microsoft.Iris.Render;
|
||||
using Microsoft.Iris.Session;
|
||||
using Microsoft.Iris.UI;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal abstract class ContentViewItem : ViewItem
|
||||
{
|
||||
protected ISprite _contents;
|
||||
|
||||
protected override ISprite ContentVisual => _contents != null ? _contents : base.ContentVisual;
|
||||
|
||||
protected abstract bool HasContent();
|
||||
|
||||
protected override void DisposeAllContent()
|
||||
{
|
||||
base.DisposeAllContent();
|
||||
DisposeContent(true);
|
||||
}
|
||||
|
||||
protected virtual void DisposeContent(bool removeFromTree)
|
||||
{
|
||||
if (_contents == null)
|
||||
return;
|
||||
if (removeFromTree)
|
||||
_contents.Remove();
|
||||
_contents.UnregisterUsage(this);
|
||||
_contents = null;
|
||||
}
|
||||
|
||||
protected virtual void CreateContent()
|
||||
{
|
||||
ISprite contentVisual = ContentVisual;
|
||||
_contents = UISession.Default.RenderSession.CreateSprite(this, this);
|
||||
if (contentVisual != null)
|
||||
VisualContainer.AddChild(_contents, contentVisual, VisualOrder.Before);
|
||||
else
|
||||
VisualContainer.AddChild(_contents, null, VisualOrder.Last);
|
||||
}
|
||||
|
||||
public override void OrphanVisuals(OrphanedVisualCollection orphans)
|
||||
{
|
||||
base.OrphanVisuals(orphans);
|
||||
DisposeContent(false);
|
||||
}
|
||||
|
||||
protected override void OnPaint(bool visible)
|
||||
{
|
||||
base.OnPaint(visible);
|
||||
bool flag = visible && HasContent();
|
||||
if (flag && _contents == null)
|
||||
{
|
||||
CreateContent();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flag || _contents == null)
|
||||
return;
|
||||
DisposeContent(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.CountLayoutInput
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Layout;
|
||||
using Microsoft.Iris.Library;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class CountLayoutInput : ILayoutInput
|
||||
{
|
||||
private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot();
|
||||
private int _count;
|
||||
|
||||
public CountLayoutInput(int count) => _count = count;
|
||||
|
||||
public int Count
|
||||
{
|
||||
get => _count;
|
||||
set => _count = value;
|
||||
}
|
||||
|
||||
DataCookie ILayoutInput.Data => Data;
|
||||
|
||||
public static DataCookie Data => s_dataProperty;
|
||||
|
||||
public override string ToString() => InvariantString.Format("{0}(Count={1})", GetType().Name, _count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.Graphic
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Drawing;
|
||||
using Microsoft.Iris.Layout;
|
||||
using Microsoft.Iris.Layouts;
|
||||
using Microsoft.Iris.Library;
|
||||
using Microsoft.Iris.Markup;
|
||||
using Microsoft.Iris.Render;
|
||||
using Microsoft.Iris.RenderAPI.Drawing;
|
||||
using Microsoft.Iris.UI;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class Graphic : ContentViewItem
|
||||
{
|
||||
private const string s_effectElementName = "BaseImage";
|
||||
private const string s_effectPropertyName = "BaseImage.Image";
|
||||
private static readonly DataCookie s_pendingLoadCompleteHandlerProperty = DataCookie.ReserveSlot();
|
||||
private static readonly DataCookie s_acquiringImageProperty = DataCookie.ReserveSlot();
|
||||
private static readonly DataCookie s_errorImageProperty = DataCookie.ReserveSlot();
|
||||
private static string s_AcquiringDefaultImageUri = "res://UIX!AcquiringImage.png";
|
||||
private static string s_ErrorDefaultImageUri = "res://UIX!ErrorImage.png";
|
||||
private static UIImage s_AcquiringDefaultImage;
|
||||
private static UIImage s_ErrorDefaultImage;
|
||||
private static object s_NullImage = new object();
|
||||
private UIImage _contentImage;
|
||||
private UIImage _preloadImage;
|
||||
private StripAlignment _horizontalAlignment;
|
||||
private StripAlignment _verticalAlignment;
|
||||
private StretchingPolicy _stretchMode;
|
||||
|
||||
public Graphic()
|
||||
{
|
||||
_horizontalAlignment = StripAlignment.Near;
|
||||
_verticalAlignment = StripAlignment.Near;
|
||||
_stretchMode = StretchingPolicy.Fill;
|
||||
SizingPolicy = SizingPolicy.SizeToContent;
|
||||
}
|
||||
|
||||
public static void EnsureFallbackImages()
|
||||
{
|
||||
if (s_AcquiringDefaultImage != null)
|
||||
return;
|
||||
s_AcquiringDefaultImage = new UriImage(s_AcquiringDefaultImageUri, new Inset(3, 3, 53, 53), Size.Zero, false);
|
||||
s_AcquiringDefaultImage.Load();
|
||||
s_ErrorDefaultImage = new UriImage(s_ErrorDefaultImageUri, new Inset(3, 3, 53, 53), Size.Zero, false);
|
||||
s_ErrorDefaultImage.Load();
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
ReleaseInUseImage(_contentImage, null);
|
||||
ReleaseInUseImage(_preloadImage, null);
|
||||
ReleaseInUseImage(AcquiringImage, s_AcquiringDefaultImage);
|
||||
ReleaseInUseImage(ErrorImage, s_ErrorDefaultImage);
|
||||
_preloadImage = null;
|
||||
_contentImage = null;
|
||||
AsyncLoadCompleteHandler = null;
|
||||
base.OnDispose();
|
||||
}
|
||||
|
||||
protected override void OnEffectChanged()
|
||||
{
|
||||
if (_contents == null)
|
||||
return;
|
||||
_contents.Effect = null;
|
||||
}
|
||||
|
||||
public UIImage Content
|
||||
{
|
||||
get => _contentImage;
|
||||
set
|
||||
{
|
||||
if (_contentImage == value)
|
||||
return;
|
||||
if (_contentImage != null)
|
||||
{
|
||||
RemoveAsyncLoadCompleteHandler(_contentImage);
|
||||
_contentImage.RemoveUser(this);
|
||||
}
|
||||
_contentImage = value;
|
||||
if (_contentImage != null)
|
||||
{
|
||||
_contentImage.AddUser(this);
|
||||
_contentImage.Load();
|
||||
if (_contentImage.Status == ImageStatus.Loading || _contentImage.Status == ImageStatus.PendingLoad)
|
||||
AttachAsyncLoadCompleteHandler(_contentImage);
|
||||
}
|
||||
FireNotification(NotificationID.Content);
|
||||
NotifyContentChange();
|
||||
}
|
||||
}
|
||||
|
||||
public UIImage AcquiringImage
|
||||
{
|
||||
get => GetStatusImage(s_acquiringImageProperty, s_AcquiringDefaultImage);
|
||||
set => SetStatusImage(value, NotificationID.AcquiringImage, s_acquiringImageProperty, s_AcquiringDefaultImage);
|
||||
}
|
||||
|
||||
public UIImage ErrorImage
|
||||
{
|
||||
get => GetStatusImage(s_errorImageProperty, s_ErrorDefaultImage);
|
||||
set => SetStatusImage(value, NotificationID.ErrorImage, s_errorImageProperty, s_ErrorDefaultImage);
|
||||
}
|
||||
|
||||
public UIImage PreloadContent
|
||||
{
|
||||
get => _preloadImage;
|
||||
set
|
||||
{
|
||||
if (_preloadImage != null)
|
||||
_preloadImage.RemoveUser(this);
|
||||
_preloadImage = value;
|
||||
if (_preloadImage == null)
|
||||
return;
|
||||
_preloadImage.AddUser(this);
|
||||
_preloadImage.Load();
|
||||
}
|
||||
}
|
||||
|
||||
private UIImage GetStatusImage(DataCookie cookie, UIImage defaultImage)
|
||||
{
|
||||
object data = GetData(cookie);
|
||||
return data != null ? (data != s_NullImage ? (UIImage)data : null) : defaultImage;
|
||||
}
|
||||
|
||||
private void SetStatusImage(
|
||||
UIImage value,
|
||||
string name,
|
||||
DataCookie cookie,
|
||||
UIImage defaultImage)
|
||||
{
|
||||
UIImage statusImage = GetStatusImage(cookie, defaultImage);
|
||||
if (value == statusImage)
|
||||
return;
|
||||
object obj;
|
||||
if (value != null)
|
||||
{
|
||||
obj = value;
|
||||
value.Load();
|
||||
if (value.Status == ImageStatus.Loading || value.Status == ImageStatus.PendingLoad)
|
||||
AttachAsyncLoadCompleteHandler(value);
|
||||
value.AddUser(this);
|
||||
}
|
||||
else
|
||||
obj = s_NullImage;
|
||||
ReleaseInUseImage(statusImage, defaultImage);
|
||||
SetData(cookie, obj);
|
||||
MarkPaintInvalid();
|
||||
FireNotification(name);
|
||||
}
|
||||
|
||||
private void OnAsyncLoadComplete(object image, ImageStatus status)
|
||||
{
|
||||
RemoveAsyncLoadCompleteHandler((UIImage)image);
|
||||
NotifyContentChange();
|
||||
}
|
||||
|
||||
private void AttachAsyncLoadCompleteHandler(UIImage image)
|
||||
{
|
||||
ContentLoadCompleteHandler loadCompleteHandler = AsyncLoadCompleteHandler;
|
||||
if (loadCompleteHandler == null)
|
||||
{
|
||||
loadCompleteHandler = new ContentLoadCompleteHandler(OnAsyncLoadComplete);
|
||||
AsyncLoadCompleteHandler = loadCompleteHandler;
|
||||
}
|
||||
image.LoadComplete += loadCompleteHandler;
|
||||
}
|
||||
|
||||
private void RemoveAsyncLoadCompleteHandler(UIImage image)
|
||||
{
|
||||
if (image == null)
|
||||
return;
|
||||
image.LoadComplete -= AsyncLoadCompleteHandler;
|
||||
}
|
||||
|
||||
private void ReleaseInUseImage(UIImage image, UIImage defaultImage)
|
||||
{
|
||||
if (image != null && image != defaultImage && (image.Status == ImageStatus.Loading || image.Status == ImageStatus.PendingLoad))
|
||||
RemoveAsyncLoadCompleteHandler(image);
|
||||
if (image == null || image == defaultImage)
|
||||
return;
|
||||
image.RemoveUser(this);
|
||||
}
|
||||
|
||||
private void NotifyContentChange()
|
||||
{
|
||||
ForceContentChange();
|
||||
if (Layout is ImageLayout layout && UpdateSourceOnLayout(layout))
|
||||
MarkLayoutInvalid();
|
||||
MarkPaintInvalid();
|
||||
}
|
||||
|
||||
protected override void OnMinimumSizeChanged()
|
||||
{
|
||||
if (!(Layout is ImageLayout layout))
|
||||
return;
|
||||
layout.MinimumSize = MinimumSize;
|
||||
}
|
||||
|
||||
public SizingPolicy SizingPolicy
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(Layout is ImageLayout layout))
|
||||
return SizingPolicy.SizeToChildren;
|
||||
return layout.Fill ? SizingPolicy.SizeToConstraint : SizingPolicy.SizeToContent;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == SizingPolicy)
|
||||
return;
|
||||
if (value == SizingPolicy.SizeToChildren)
|
||||
{
|
||||
Layout = DefaultLayout.Instance;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageLayout imageLayout = new ImageLayout();
|
||||
UpdateSourceOnLayout(imageLayout);
|
||||
UpdateMaintainAspectRatioOnLayout(imageLayout);
|
||||
imageLayout.MinimumSize = MinimumSize;
|
||||
imageLayout.Fill = value == SizingPolicy.SizeToConstraint;
|
||||
Layout = imageLayout;
|
||||
}
|
||||
FireNotification(NotificationID.SizingPolicy);
|
||||
}
|
||||
}
|
||||
|
||||
public StretchingPolicy StretchingPolicy
|
||||
{
|
||||
get => _stretchMode;
|
||||
set
|
||||
{
|
||||
if (_stretchMode == value)
|
||||
return;
|
||||
_stretchMode = value;
|
||||
if (UpdateMaintainAspectRatioOnLayout(Layout as ImageLayout))
|
||||
MarkLayoutInvalid();
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.StretchingPolicy);
|
||||
}
|
||||
}
|
||||
|
||||
private bool UpdateMaintainAspectRatioOnLayout(ImageLayout imageLayout)
|
||||
{
|
||||
bool flag1 = false;
|
||||
if (imageLayout != null)
|
||||
{
|
||||
bool flag2 = _stretchMode == StretchingPolicy.Uniform;
|
||||
if (imageLayout.MaintainAspectRatio != flag2)
|
||||
{
|
||||
imageLayout.MaintainAspectRatio = flag2;
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
return flag1;
|
||||
}
|
||||
|
||||
private bool UpdateSourceOnLayout(ImageLayout layout)
|
||||
{
|
||||
bool flag = false;
|
||||
Size size = Size.Zero;
|
||||
if (_contentImage != null)
|
||||
{
|
||||
UIImage activeImage = GetActiveImage();
|
||||
if (activeImage != null)
|
||||
size = activeImage.Size;
|
||||
}
|
||||
if (layout.SourceSize != size)
|
||||
{
|
||||
layout.SourceSize = size;
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public StripAlignment HorizontalAlignment
|
||||
{
|
||||
get => _horizontalAlignment;
|
||||
set
|
||||
{
|
||||
if (_horizontalAlignment == value)
|
||||
return;
|
||||
_horizontalAlignment = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.HorizontalAlignment);
|
||||
}
|
||||
}
|
||||
|
||||
public StripAlignment VerticalAlignment
|
||||
{
|
||||
get => _verticalAlignment;
|
||||
set
|
||||
{
|
||||
if (_verticalAlignment == value)
|
||||
return;
|
||||
_verticalAlignment = value;
|
||||
MarkPaintInvalid();
|
||||
FireNotification(NotificationID.VerticalAlignment);
|
||||
}
|
||||
}
|
||||
|
||||
private ContentLoadCompleteHandler AsyncLoadCompleteHandler
|
||||
{
|
||||
get => (ContentLoadCompleteHandler)GetData(s_pendingLoadCompleteHandlerProperty);
|
||||
set => SetData(s_pendingLoadCompleteHandlerProperty, value);
|
||||
}
|
||||
|
||||
public void CommitPreload() => Content = PreloadContent;
|
||||
|
||||
protected override bool HasContent() => _contentImage != null;
|
||||
|
||||
protected override void OnPaint(bool visible)
|
||||
{
|
||||
base.OnPaint(visible);
|
||||
if (_contents == null)
|
||||
return;
|
||||
if (_contents.Effect == null)
|
||||
{
|
||||
_contents.Effect = EffectClass.CreateImageRenderEffectWithFallback(Effect, this, null);
|
||||
_contents.Effect.UnregisterUsage(this);
|
||||
}
|
||||
UpdateEffectContents();
|
||||
UpdateCoordinateMaps();
|
||||
}
|
||||
|
||||
private void UpdateEffectContents() => EffectClass.SetDefaultEffectProperty(Effect, _contents.Effect, GetActiveImage()?.RenderImage);
|
||||
|
||||
internal void UpdateCoordinateMaps()
|
||||
{
|
||||
UIImage activeImage = GetActiveImage();
|
||||
if (activeImage == null)
|
||||
return;
|
||||
if (_stretchMode == StretchingPolicy.Fill && activeImage.NineGrid != Inset.Zero)
|
||||
{
|
||||
_contents.RelativeSize = true;
|
||||
_contents.Size = Vector2.UnitVector;
|
||||
_contents.SetNineGrid(activeImage.NineGrid.Left, activeImage.NineGrid.Top, activeImage.NineGrid.Right, activeImage.NineGrid.Bottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 visualSize = VisualSize;
|
||||
Size layoutSize = new Size((int)visualSize.X, (int)visualSize.Y);
|
||||
Size size = activeImage.Size;
|
||||
RectangleF source;
|
||||
RectangleF destination;
|
||||
CalculatePaintRectangles(size, layoutSize, out source, out destination);
|
||||
switch (size.IsEmpty ? 1 : (int)_stretchMode)
|
||||
{
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
RectangleF rectangleF = new RectangleF(Point.Zero, size);
|
||||
CoordMap coordMap = null;
|
||||
if (source != rectangleF)
|
||||
{
|
||||
float flValue1 = source.Left / size.Width;
|
||||
float flValue2 = source.Right / size.Width;
|
||||
float flValue3 = source.Top / size.Height;
|
||||
float flValue4 = source.Bottom / size.Height;
|
||||
coordMap = new CoordMap();
|
||||
coordMap.AddValue(0.0f, flValue1, Orientation.Horizontal);
|
||||
coordMap.AddValue(0.0f, flValue3, Orientation.Vertical);
|
||||
coordMap.AddValue(1f, flValue2, Orientation.Horizontal);
|
||||
coordMap.AddValue(1f, flValue4, Orientation.Vertical);
|
||||
}
|
||||
_contents.RelativeSize = false;
|
||||
_contents.Position = new Vector3(destination.Left, destination.Top, 0.0f);
|
||||
_contents.Size = new Vector2(destination.Width, destination.Height);
|
||||
_contents.SetCoordMap(0, coordMap);
|
||||
break;
|
||||
case 1:
|
||||
_contents.RelativeSize = true;
|
||||
_contents.Size = Vector2.UnitVector;
|
||||
_contents.SetCoordMap(0, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private UIImage GetActiveImage() => _contentImage.Status != ImageStatus.Complete ? (_contentImage.Status == ImageStatus.Loading || _contentImage.Status == ImageStatus.PendingLoad ? AcquiringImage : ErrorImage) : _contentImage;
|
||||
|
||||
private void CalculatePaintRectangles(
|
||||
Size originalSourceSize,
|
||||
Size layoutSize,
|
||||
out RectangleF source,
|
||||
out RectangleF destination)
|
||||
{
|
||||
if (_stretchMode == StretchingPolicy.Fill)
|
||||
{
|
||||
source = RectangleF.Zero;
|
||||
destination = RectangleF.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
Size size1 = originalSourceSize;
|
||||
Size size2 = layoutSize;
|
||||
if (size1.IsZero || size2.IsZero)
|
||||
{
|
||||
source = RectangleF.Zero;
|
||||
destination = RectangleF.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (_stretchMode)
|
||||
{
|
||||
case StretchingPolicy.None:
|
||||
size1 = Size.Min(size1, size2);
|
||||
size2 = size1;
|
||||
break;
|
||||
case StretchingPolicy.Uniform:
|
||||
size2 = Size.LargestFit(size1, size2);
|
||||
break;
|
||||
case StretchingPolicy.UniformToFill:
|
||||
size1 = Size.LargestFit(size2, size1);
|
||||
break;
|
||||
}
|
||||
float dimensionOffset1 = CalculateDimensionOffset(size1.Width, originalSourceSize.Width, _horizontalAlignment);
|
||||
float dimensionOffset2 = CalculateDimensionOffset(size2.Width, layoutSize.Width, _horizontalAlignment);
|
||||
float dimensionOffset3 = CalculateDimensionOffset(size1.Height, originalSourceSize.Height, _verticalAlignment);
|
||||
float dimensionOffset4 = CalculateDimensionOffset(size2.Height, layoutSize.Height, _verticalAlignment);
|
||||
source = new RectangleF(dimensionOffset1, dimensionOffset3, size1.Width, size1.Height);
|
||||
destination = new RectangleF(dimensionOffset2, dimensionOffset4, size2.Width, size2.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float CalculateDimensionOffset(
|
||||
float actualSize,
|
||||
float availableSize,
|
||||
StripAlignment alignment)
|
||||
{
|
||||
float num = availableSize - actualSize;
|
||||
switch (alignment)
|
||||
{
|
||||
case StripAlignment.Near:
|
||||
return 0.0f;
|
||||
case StripAlignment.Center:
|
||||
return num / 2f;
|
||||
case StripAlignment.Far:
|
||||
return num;
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.HostRequestPacket
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Markup;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class HostRequestPacket
|
||||
{
|
||||
public Host Host;
|
||||
public string Source;
|
||||
public UIClassTypeSchema Type;
|
||||
public Vector<UIPropertyRecord> Properties;
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Host = null;
|
||||
Source = null;
|
||||
Type = null;
|
||||
Properties = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.HostStatus
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal enum HostStatus
|
||||
{
|
||||
Normal,
|
||||
LoadingSource,
|
||||
FailureLoadingSource,
|
||||
FailureRunningScript,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.HwndHost
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Drawing;
|
||||
using Microsoft.Iris.Library;
|
||||
using Microsoft.Iris.Markup;
|
||||
using Microsoft.Iris.OS;
|
||||
using Microsoft.Iris.Render;
|
||||
using Microsoft.Iris.Session;
|
||||
using Microsoft.Iris.UI;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class HwndHost : ContentViewItem
|
||||
{
|
||||
private IHwndHostWindow _window;
|
||||
private Color _backgroundColor;
|
||||
private long _childWindowHwnd;
|
||||
private IntPtr _childHwndIntPtr;
|
||||
|
||||
public HwndHost()
|
||||
{
|
||||
((ITrackableUIElementEvents)this).UIChange += new EventHandler(OnUIChange);
|
||||
IRenderWindow renderWindow = UISession.Default.GetRenderWindow();
|
||||
_window = renderWindow.CreateHwndHostWindow();
|
||||
_window.OnHandleChanged += new EventHandler(OnHandleChanged);
|
||||
renderWindow.ForwardMessageEvent += new ForwardMessageHandler(OnForwardMessage);
|
||||
_backgroundColor = Color.White;
|
||||
_window.BackgroundColor = new ColorF(byte.MaxValue, byte.MaxValue, byte.MaxValue);
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
IRenderWindow renderWindow = UISession.Default.GetRenderWindow();
|
||||
if (renderWindow != null)
|
||||
renderWindow.ForwardMessageEvent -= new ForwardMessageHandler(OnForwardMessage);
|
||||
if (_window != null)
|
||||
{
|
||||
_window.OnHandleChanged -= new EventHandler(OnHandleChanged);
|
||||
_window.Dispose();
|
||||
_window = null;
|
||||
}
|
||||
((ITrackableUIElementEvents)this).UIChange -= new EventHandler(OnUIChange);
|
||||
base.OnDispose();
|
||||
}
|
||||
|
||||
public long Handle => _window.Hwnd.ToInt64();
|
||||
|
||||
public long ChildHandle
|
||||
{
|
||||
get => _childWindowHwnd;
|
||||
set
|
||||
{
|
||||
if (value == _childWindowHwnd)
|
||||
return;
|
||||
_childWindowHwnd = value;
|
||||
_childHwndIntPtr = (IntPtr)ChildHandle;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color Background
|
||||
{
|
||||
get => _backgroundColor;
|
||||
set
|
||||
{
|
||||
if (!(_backgroundColor != value))
|
||||
return;
|
||||
if (value.A != byte.MaxValue)
|
||||
{
|
||||
ErrorManager.ReportError("HwndHost.Background must be a solid color");
|
||||
}
|
||||
else
|
||||
{
|
||||
_backgroundColor = value;
|
||||
_window.BackgroundColor = value.RenderConvert();
|
||||
FireNotification(NotificationID.Background);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool HasContent() => true;
|
||||
|
||||
private void OnHandleChanged(object sender, EventArgs args) => FireNotification(NotificationID.Handle);
|
||||
|
||||
private unsafe void OnForwardMessage(uint message, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
if (!(_childHwndIntPtr != IntPtr.Zero))
|
||||
return;
|
||||
Win32Api.MSG msg;
|
||||
msg.message = message;
|
||||
msg.wParam = wParam;
|
||||
msg.lParam = lParam;
|
||||
Win32Api.MSG* msgPtr = &msg;
|
||||
Win32Api.SendMessage(_childHwndIntPtr, 895U, IntPtr.Zero, (IntPtr)msgPtr);
|
||||
}
|
||||
|
||||
private void OnUIChange(object sender, EventArgs args)
|
||||
{
|
||||
if (_window == null || !IsZoned || !HasVisual)
|
||||
return;
|
||||
Vector3 parentOffsetPxlVector;
|
||||
Vector3 scaleVector;
|
||||
GetAccumulatedOffsetAndScale(this, null, out parentOffsetPxlVector, out scaleVector);
|
||||
Vector2 visualSize = VisualSize;
|
||||
_window.ClientPosition = new Point((int)Math.Round(parentOffsetPxlVector.X), (int)Math.Round(parentOffsetPxlVector.Y));
|
||||
_window.WindowSize = new Size(Math2.RoundUp(scaleVector.X * visualSize.X), Math2.RoundUp(scaleVector.Y * visualSize.Y));
|
||||
_window.Visible = FullyVisible;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.ICustomRepeatedItem
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal interface ICustomRepeatedItem
|
||||
{
|
||||
string UIName { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.ImageLayout
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Layout;
|
||||
using Microsoft.Iris.Layouts;
|
||||
using Microsoft.Iris.Render;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class ImageLayout : ILayout
|
||||
{
|
||||
private Size _sourceExtent;
|
||||
private Size _minimumSize;
|
||||
private bool _maintainAspectRatio;
|
||||
private bool _fill;
|
||||
|
||||
public Size SourceSize
|
||||
{
|
||||
get => _sourceExtent;
|
||||
set => _sourceExtent = value;
|
||||
}
|
||||
|
||||
public Size MinimumSize
|
||||
{
|
||||
get => _minimumSize;
|
||||
set => _minimumSize = value;
|
||||
}
|
||||
|
||||
public bool MaintainAspectRatio
|
||||
{
|
||||
get => _maintainAspectRatio;
|
||||
set => _maintainAspectRatio = value;
|
||||
}
|
||||
|
||||
public bool Fill
|
||||
{
|
||||
get => _fill;
|
||||
set => _fill = value;
|
||||
}
|
||||
|
||||
public ItemAlignment DefaultChildAlignment => ItemAlignment.Default;
|
||||
|
||||
Size ILayout.Measure(ILayoutNode layoutNode, Size constraint)
|
||||
{
|
||||
Size size = Size.Zero;
|
||||
if (_fill)
|
||||
size = constraint;
|
||||
else if (_sourceExtent != Size.Zero)
|
||||
size = Size.Min(Size.Max(_minimumSize, _sourceExtent), constraint);
|
||||
if (_maintainAspectRatio && _sourceExtent != Size.Zero && size != _sourceExtent)
|
||||
{
|
||||
Size sz1 = SmallestFillingFit(_sourceExtent, size);
|
||||
if (sz1.Height > constraint.Height || sz1.Width > constraint.Width)
|
||||
sz1 = Size.LargestFit(_sourceExtent, constraint);
|
||||
size = Size.Min(sz1, constraint);
|
||||
}
|
||||
DefaultLayout.Measure(layoutNode, size);
|
||||
return size;
|
||||
}
|
||||
|
||||
public static Size SmallestFillingFit(Size source, Size bounds)
|
||||
{
|
||||
float num = source.Width / (float)source.Height;
|
||||
Size size = new Size(bounds.Width, (int)Math.Ceiling(bounds.Width / (double)num));
|
||||
if (size.Height < bounds.Height)
|
||||
size = new Size((int)Math.Ceiling(bounds.Height * (double)num), bounds.Height);
|
||||
return size;
|
||||
}
|
||||
|
||||
void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) => DefaultLayout.Arrange(layoutNode, slot);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.Index
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Library;
|
||||
using Microsoft.Iris.Markup;
|
||||
using Microsoft.Iris.UI;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class Index : NotifyObjectBase
|
||||
{
|
||||
private int _virtualIndex;
|
||||
private int _dataIndex;
|
||||
private Repeater _repeater;
|
||||
|
||||
public Index(int virtualIndex, int dataIndex, Repeater repeater)
|
||||
{
|
||||
_virtualIndex = virtualIndex;
|
||||
_dataIndex = dataIndex;
|
||||
_repeater = repeater;
|
||||
}
|
||||
|
||||
public int Value => _virtualIndex;
|
||||
|
||||
public int SourceValue => _dataIndex;
|
||||
|
||||
public void SetValue(int virtualIndex, int dataIndex)
|
||||
{
|
||||
if (_virtualIndex != virtualIndex)
|
||||
{
|
||||
_virtualIndex = virtualIndex;
|
||||
FireNotification(NotificationID.Value);
|
||||
}
|
||||
if (_dataIndex == dataIndex)
|
||||
return;
|
||||
_dataIndex = dataIndex;
|
||||
FireNotification(NotificationID.SourceValue);
|
||||
}
|
||||
|
||||
public Index GetContainerIndex()
|
||||
{
|
||||
ViewItem viewItem = _repeater;
|
||||
while (!(viewItem.Parent is Repeater))
|
||||
{
|
||||
viewItem = viewItem.Parent;
|
||||
if (viewItem == null)
|
||||
return null;
|
||||
}
|
||||
return ((IndexLayoutInput)viewItem.GetLayoutInput(IndexLayoutInput.Data)).Index;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.IndexLayoutInput
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Layout;
|
||||
using Microsoft.Iris.Library;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class IndexLayoutInput : ILayoutInput
|
||||
{
|
||||
private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot();
|
||||
private Index _index;
|
||||
private IndexType _type;
|
||||
|
||||
public IndexLayoutInput(Index index, IndexType type)
|
||||
{
|
||||
_index = index;
|
||||
_type = type;
|
||||
}
|
||||
|
||||
public Index Index => _index;
|
||||
|
||||
public IndexType Type => _type;
|
||||
|
||||
DataCookie ILayoutInput.Data => Data;
|
||||
|
||||
public static DataCookie Data => s_dataProperty;
|
||||
|
||||
public override string ToString() => InvariantString.Format("{0}(Index={1}, Type={2})", GetType().Name, Index, _type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.IndexType
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal enum IndexType
|
||||
{
|
||||
Content,
|
||||
Divider,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.LineAlignment
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal enum LineAlignment
|
||||
{
|
||||
Near,
|
||||
Center,
|
||||
Far,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.PaintInvalidEventHandler
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal delegate void PaintInvalidEventHandler();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.Panel
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.UI;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class Panel : ViewItem
|
||||
{
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.RepeaterContentSelector
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class RepeaterContentSelector
|
||||
{
|
||||
private Repeater _ownerRepeater;
|
||||
private IList _selectorsList;
|
||||
|
||||
public RepeaterContentSelector(Repeater ownerRepeater)
|
||||
{
|
||||
_ownerRepeater = ownerRepeater;
|
||||
_selectorsList = new ArrayList();
|
||||
}
|
||||
|
||||
public IList Selectors => _selectorsList;
|
||||
|
||||
public Repeater.ContentTypeHandler ContentTypeHandler => new Repeater.ContentTypeHandler(GetContentTypeForRepeatedItem);
|
||||
|
||||
public void GetContentTypeForRepeatedItem(object itemObject, ref string contentName)
|
||||
{
|
||||
if (itemObject == null)
|
||||
return;
|
||||
foreach (TypeSelector selectors in _selectorsList)
|
||||
{
|
||||
if (selectors.IsMatch(itemObject, _ownerRepeater))
|
||||
{
|
||||
contentName = selectors.ContentName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.RepeaterListContentsChangedArgs
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Data;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class RepeaterListContentsChangedArgs
|
||||
{
|
||||
private UIListContentsChangedArgs _changedArgs;
|
||||
private Repeater _target;
|
||||
private int _generation;
|
||||
|
||||
public RepeaterListContentsChangedArgs(
|
||||
UIListContentsChangedArgs args,
|
||||
Repeater target,
|
||||
int generation)
|
||||
{
|
||||
_changedArgs = args;
|
||||
_target = target;
|
||||
_generation = generation;
|
||||
}
|
||||
|
||||
public UIListContentsChangedArgs ChangedArgs => _changedArgs;
|
||||
|
||||
public Repeater Target => _target;
|
||||
|
||||
public int Generation => _generation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.ViewItems.RootViewItem
|
||||
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||
|
||||
using Microsoft.Iris.Navigation;
|
||||
using Microsoft.Iris.Render;
|
||||
using Microsoft.Iris.Session;
|
||||
using Microsoft.Iris.UI;
|
||||
|
||||
namespace Microsoft.Iris.ViewItems
|
||||
{
|
||||
internal class RootViewItem : Host
|
||||
{
|
||||
private bool _rootVisibleFlag;
|
||||
|
||||
public RootViewItem(UIZone zone, UIClass rootUI, Form form)
|
||||
{
|
||||
DeclareOwner(rootUI);
|
||||
PropagateZone(zone);
|
||||
IVisualContainer rootVisual = form.RootVisual;
|
||||
rootVisual.MouseOptions = MouseOptions.Traversable;
|
||||
VisualContainer = rootVisual;
|
||||
}
|
||||
|
||||
internal void ApplyRootLayoutOutput(bool parentFullyVisibleFlag, out bool visibilityChangeFlag)
|
||||
{
|
||||
Rectangle layoutBounds = LayoutBounds;
|
||||
VisualPosition = new Vector3(layoutBounds.Left, layoutBounds.Top, 0.0f);
|
||||
VisualSize = new Vector2(layoutBounds.Width, layoutBounds.Height);
|
||||
VisualScale = LayoutScale;
|
||||
if (LayoutVisible)
|
||||
parentFullyVisibleFlag = false;
|
||||
visibilityChangeFlag = _rootVisibleFlag != parentFullyVisibleFlag;
|
||||
if (!visibilityChangeFlag)
|
||||
return;
|
||||
_rootVisibleFlag = parentFullyVisibleFlag;
|
||||
}
|
||||
|
||||
protected override NavigationPolicies ForcedNavigationFlags => NavigationPolicies.RememberFocus | NavigationPolicies.WrapTabOrder;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user