async void SolutionExplorerTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            var item = e.NewValue as SolutionItem;

            if (item != null && !item.IsFolder)
            {
                try
                {
                    currentAsset            = null;
                    WorkingDirectory        = string.Empty;
                    LoadingStatus.Text      = "Loading...";
                    LoadingPanel.Visibility = Visibility.Visible;
                    scene = await previewer.Show(item.Path, this, (int)WindowsFormsHost.Width, (int)WindowsFormsHost.Height);

                    currentAsset = scene?.CurrentAsset;
                    if (currentAsset != null)
                    {
                        var xmlBasedAssets = new [] {
                            AssetsType.AnimationSet2D, AssetsType.Material,
                            AssetsType.Particle2D, AssetsType.Particle3D, AssetsType.Prefab,
                            AssetsType.RenderPath, AssetsType.Scene, AssetsType.UI
                        };

                        if (xmlBasedAssets.Contains(currentAsset.Type))
                        {
                            var raw = File.ReadAllText(currentAsset.FullPathToAsset);
                            RawEditor.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                            RawEditor.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
                            RawEditor.SyntaxHighlighting            = HighlightingManager.Instance.GetDefinition("XML");
                            RawEditor.Text       = raw;
                            RawEditor.IsReadOnly = false;
                        }
                        else
                        {
                            RawEditor.IsReadOnly = true;
                            RawEditor.Text       = "";
                        }
                        WorkingDirectory = currentAsset.RootDirectory;
                    }
                    LoadingPanel.Visibility = Visibility.Collapsed;
                }
                catch (OperationCanceledException)
                {
                }
                catch (InvalidOperationException exc)
                {
                    LoadingStatus.Text = exc.Message;
                }
                catch (NotSupportedException)
                {
                    LoadingStatus.Text = "Not supported.";
                }
            }
        }
 public SdfFontsPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
Пример #3
0
 protected AbstractPreviewer(UrhoScene urhoApp)
 {
     App = urhoApp;
 }
 public StaticModelPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
Пример #5
0
 public UIPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
 public Particle3DPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
Пример #7
0
 public PrefabPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
 public TexturePreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
 public MaterialPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
 public AnimatedModelPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
 public AnimationSet2DPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }
 public RenderPathPreviewer(UrhoScene urhoApp) : base(urhoApp)
 {
 }