コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            var currentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            var libVlcDirectory  = new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));

            Coordinator = new Coordinator(libVlcDirectory);

            Queue.DataContext            = Coordinator.Playlist;
            History.DataContext          = Coordinator.Playlist;
            PlaybackControls.DataContext = Coordinator.StreamPlayer;

            CurrentPlayingControl.DataContext = Coordinator.Playlist.CurrentPlaying;
            SettingsControl.DataContext       = this;
            SettingsControl.BackButton.Click += SettingsButton_Click;

            CenterControl.Navigate(CurrentPlayingControl);

            if (Autoplay)
            {
                Coordinator.StartAudioStream();
            }

            Window_SizeChanged(null, null);
        }
コード例 #2
0
 private void SettingsButton_Click(object sender, RoutedEventArgs e)
 {
     if (CenterControl.Content.GetType() == typeof(SettingsControl))
     {
         CenterControl.Navigate(CurrentPlayingControl);
     }
     else
     {
         CenterControl.Navigate(SettingsControl);
     }
 }
コード例 #3
0
        public ExamplesHolder(Base parent) :
            base(parent)
        {
            Dock = Pos.Fill;


            Base mainLeftContainer = new Base(this);

            Base leftContainer = new Base(mainLeftContainer);

            leftContainer.Dock   = Pos.Fill;
            leftContainer.Margin = new Margin(1);

            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(leftContainer);
            label.Margin    = new Margin(7, 4, 5, 3);
            label.Text      = "AltGUI Examples";
            label.TextColor = Color.LimeGreen * 1.4;
            //label.Alignment = Pos.Center;
            label.AutoSizeToContents = true;
            label.Dock = Pos.Top;


            Base examplesContainer = new Base(leftContainer);

            examplesContainer.Dock = Pos.Fill;

            m_ExamplesList        = new CollapsibleList(examplesContainer);
            m_ExamplesList.Dock   = Pos.Fill;
            m_ExamplesList.Margin = new Margin(0, 6, 0, 3);
            m_ExamplesList.ShouldDrawBackground = false;


            m_StatusBar = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this);
            m_StatusBar.ShouldDrawBackground = false;
#if !DEBUG
            m_StatusBar.Hide();
#endif
            m_StatusBar.Dock = Pos.Bottom;


            m_ExamplesList.ShouldCacheToTexture = true;


            m_Center        = new CenterControl(this);
            m_Center.Dock   = Pos.Fill;
            m_Center.Margin = new Margin(1, 1, 1, 1);


            VerticalSplitter splitter = new VerticalSplitter(this);
            splitter.Dock = Pos.Fill;
            splitter.SetPanel(0, mainLeftContainer);
            splitter.SetPanel(1, m_Center);
            splitter.SetHValue(0.21f);


            Alt.GUI.Temporary.Gwen.Control.Button startButton = null;


            bool cat_ShouldCacheToTexture = false;
            {
                Color categoryColor = Color.Cyan * 1.2;
                Color color         = Color.WhiteSmoke;
                CollapsibleCategory cat;


                cat = AddCategory("HTML", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //color = Color.Red;
                    RegisterDemo("HTML/CSS2 Renderer", cat, typeof(Example_HtmlRenderer_Multi), color);

                    //color = Color.Red;
                    RegisterDemo("HTML/CSS2 Renderer (Bitmap)", cat, typeof(Example_HtmlRenderer_RenderToBitmap), color);
                }
                //cat.IsCollapsed = true;


#if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71 && !ANDROID && !__IOS__ || SILVERLIGHT
                cat = AddCategory("GIS", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  GMap.NET Intractive Demo
                    //color = Color.CadetBlue;
#if SILVERLIGHT || UNITY_WEBPLAYER
                    RegisterDemo("GMap.NET (Interactive)", cat, typeof(Example_GMap_NotAvailable), color);
#else
                    RegisterDemo("GMap.NET (Interactive)", cat, typeof(Example_GMap), color);
#endif

                    //  GMap.NET
                    //color = Color.CadetBlue;
#if SILVERLIGHT || UNITY_WEBPLAYER
                    RegisterDemo("GMap.NET (Big Map Maker)", cat, typeof(Example_GMap_BigMapMaker_NotAvailable), color);
#else
                    RegisterDemo("GMap.NET (Big Map Maker)", cat, typeof(Example_GMap_BigMapMaker), color);
#endif
                }
                //cat.IsCollapsed = true;
#endif


                cat = AddCategory("Plot (Interactive)", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  NPlot
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("NPlot", cat, typeof(Example_NPlot_Multi), color);

                    //  OxyPlot
                    //color = Color.OliveDrab;
                    RegisterDemo("OxyPlot", cat, typeof(Example_OxyPlot_Multi), color);

                    //  PieChart
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("Pie Chart", cat, typeof(Example_PieChart), color);

                    //  ZedGraph
                    //color = Color.OliveDrab;
                    RegisterDemo("ZedGraph", cat, typeof(Example_ZedGraph_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("AltNETType = FreeType.NET", categoryColor);//"Drawing"
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    color = Color.WhiteSmoke;
                    RegisterDemo("FreeType 2 Step 1", cat, typeof(Example_AltNETType_FreeType2_Step1), color);
                    RegisterDemo("FreeType 2 Step 2 Simple", cat, typeof(Example_AltNETType_FreeType2_Step2_Simple), color);
                    RegisterDemo("FreeType 2 Step 2 Advanced", cat, typeof(Example_AltNETType_FreeType2_Step2_Advanced), color);
                    RegisterDemo("Simple Font Cache Manager", cat, typeof(Example_AltNETType_SimpleFontCacheManager), color);
                    RegisterDemo("Outline Transformations", cat, typeof(Example_AltNETType_Outline_Transformations), color);
                    RegisterDemo("Font Atlas", cat, typeof(Example_AltNETType_FontAtlas), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Geometry (Interactive)", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Vector Text
                    color       = Color.WhiteSmoke;
                    startButton = RegisterDemo("Transformed Text (Single Path)", cat, typeof(Example_VectorText_TransformedCurve1), color);
                    RegisterDemo("Transformed Text (Double Path)", cat, typeof(Example_VectorText_TransformedCurve2), color);
                    //TEMP  RegisterDemo("Vector Text Transformations", cat, typeof(Example_VectorText_Transformations), color);

                    //  Boolean
                    RegisterDemo("Boolean (CombinedGeometry)", cat, typeof(Example_CombinedGeometry), color);

                    //  Simple SVG
                    RegisterDemo("Simple SVG", cat, typeof(Example_SimpleSVG), color);

                    //  Lens Effect
                    RegisterDemo("Lens Effect SVG", cat, typeof(Example_LensEffectSVG), color);

                    //  Bilinear / Perspective Transformations
                    RegisterDemo("Bilinear / Perspective", cat, typeof(Example_Bilinear_Perspective), color);

                    //  Polar Transform
                    RegisterDemo("Polar Transform", cat, typeof(Example_PolarTransform), color);

                    //  Sin Transform
                    RegisterDemo("Sin Transform", cat, typeof(Example_SinTransform), color);

                    //  Outline
                    RegisterDemo("Outline SVG", cat, typeof(Example_Outline_SVG), color);

                    //  BSpline
                    RegisterDemo("Interactive B-Spline", cat, typeof(Example_BSpline), color);

                    //  Contour
                    RegisterDemo("Contour Tool & Poly Orientation", cat, typeof(Example_Contour), color);

                    //  Text Outline
                    RegisterDemo("Text Outline", cat, typeof(Example_TextOutline), color);

                    //  Affine Transformer
                    RegisterDemo("Affine Transformer", cat, typeof(Example_AffineTransformer), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Graphics", categoryColor);//"Drawing"
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

//#if !ANDROID //&& !SILVERLIGHT && !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71
#if !UNITY_5
                    //  ExtBrush
                    color = Color.WhiteSmoke;
                    RegisterDemo("ExtBrush", cat, typeof(Example_ExtBrush), color);
#endif
//#endif

                    //  Clipper
                    color = Color.WhiteSmoke;
                    RegisterDemo("Clipper", cat, typeof(Example_Clipper), color);

                    //  SVG
                    color = Color.WhiteSmoke;
                    RegisterDemo("SVG", cat, typeof(Example_SVG), color);

                    //  Alpha Mask
                    color = Color.WhiteSmoke;
                    //TEMP  RegisterDemo("Alpha Mask", cat, typeof(Example_AlphaMask), color);

                    //  Brushes
                    color = Color.WhiteSmoke;
                    //RegisterDemo("Brushes", cat, typeof(Example_Brushes), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Doc", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  PdfSharp
                    //color = Color.Red;
                    RegisterDemo("PdfSharp", cat, typeof(Example_PdfSharp_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Scientific Computing", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  AForge
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("AForge.NET", cat, typeof(Example_AForge_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("GUI", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Gwen
                    color = Color.WhiteSmoke;// CadetBlue;
                    if (Alt.Sketch.Config.Font_NoAntiAliasMaxSize < 10)
                    {
                        color = Color.White;
                    }

                    RegisterDemo("Gwen Skinned", cat, typeof(Example_Gwen_UnitTest_Skin), color);
                    RegisterDemo("Gwen Simple", cat, typeof(Example_Gwen_UnitTest_Simple), color);

                    //  QuickFont
                    //color = Color.LightBlue;
                    RegisterDemo("QuickFont", cat, typeof(Example_QuickFont), color);
                    //	start long time background initialization
                    Example_QuickFont.Initialize();

                    //  Gif
                    color = Color.WhiteSmoke;
                    RegisterDemo("Animated Gif in PictureBox", cat, typeof(Example_GifInPictureBox), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Game Physics", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Phisics
                    color = Color.WhiteSmoke;
                    RegisterDemo("Box2D", cat, typeof(Example_Box2D), color);

                    //  Can't load type FarseerPhysics World (or some member of it) - needs researches
                                        #if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71
                    RegisterDemo("Farseer Physics", cat, typeof(Example_FarseerPhysics), color);
                                        #endif
                }
                //cat.IsCollapsed = true;


#if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71 && !ANDROID && !__IOS__
                cat = AddCategory("THIRD PARTY", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  SVG
                    color = Color.WhiteSmoke;
                    RegisterDemo("Awesomium Web Browser", cat, typeof(Example_Awesomium), color);
                }
                //cat.IsCollapsed = true;
#endif
            }


            PrintText("AltGUI Gwen Demo Started!");


            OnExampleSelect(startButton);
        }