コード例 #1
0
        public Demos UpdateDemo(Demos newData)
        {
            var entity = db.Demos.Attach(newData);

            entity.State = EntityState.Modified;
            return(newData);
        }
コード例 #2
0
ファイル: Skia.Forms.Demo.cs プロジェクト: rossmerr/SkiaSharp
        public App()
        {
            ListView listView;
            var      listPage = new ContentPage {
                Content = listView = new ListView(),
                Title   = "Skia Demo",
            };

            NavigationPage navPage;

            MainPage = navPage = new NavigationPage(listPage)
            {
                BarBackgroundColor = new Xamarin.Forms.Color(0x34 / 255.0, 0x98 / 255.0, 0xdb / 255.0),
                BarTextColor       = Xamarin.Forms.Color.White,
            };

            listView.ItemsSource = Demos.SamplesForPlatform(Demos.Platform.iOS | Demos.Platform.Android);

            listView.ItemSelected += (sender, e) => {
                if (e.SelectedItem == null)
                {
                    return;
                }
                listView.SelectedItem = null;

                navPage.PushAsync(new ContentPage {
                    Content = new SkiaView(SkiaSharp.Demos.MethodForSample(e.SelectedItem.ToString())),
                });
            };
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: jjhartmann/StereoKit
    static void CommonUpdate()
    {
        // If we can't see the world, we'll draw a floor!
        if (StereoKitApp.System.displayType == Display.Opaque)
        {
            Renderer.Add(floorMesh, floorTr, Color.White);
        }

        // Skip selection window if we're in test mode
        if (Demos.TestMode)
        {
            return;
        }

        // Make a window for demo selection
        UI.WindowBegin("Demos", ref demoSelectPose, new Vec2(50 * Units.cm2m, 0));
        for (int i = 0; i < Demos.Count; i++)
        {
            string name = Demos.GetName(i);

            // No Doc demos
            if (name.StartsWith("Doc"))
            {
                continue;
            }

            // Chop off the "Demo" part of any demo name that has it
            if (name.StartsWith("Demo"))
            {
                name = name.Substring("Demo".Length);
            }

            if (UI.Button(name))
            {
                Demos.SetActive(i);
            }
            UI.SameLine();
        }
        UI.WindowEnd();

        RulerWindow();
        /// :CodeSample: Log.Subscribe Log
        /// And in your Update loop, you can draw the window.
        LogWindow();
        /// And that's it!
        /// :End:

        // Take a screenshot on the first frame both hands are gripped
        bool valid =
            Input.Hand(Handed.Left).IsTracked&&
            Input.Hand(Handed.Right).IsTracked;
        BtnState right = Input.Hand(Handed.Right).grip;
        BtnState left  = Input.Hand(Handed.Left).grip;

        if (valid && left.IsActive() && right.IsActive() && (left.IsJustActive() || right.IsJustActive()))
        {
            Renderer.Screenshot(Input.Head.position, Input.Head.Forward, 1920 * 2, 1080 * 2, "Screenshot" + screenshotId + ".jpg");
            screenshotId += 1;
        }
    }
コード例 #4
0
    static void CommonUpdate()
    {
        Renderer.Add(floorMesh, floorTr, Color.White);

        // Skip selection window if we're in test mode
        if (Demos.TestMode)
        {
            return;
        }

        // Make a window for demo selection
        UI.WindowBegin("Demos", ref demoSelectPose, new Vec2(50 * Units.cm2m, 0));
        for (int i = 0; i < Demos.Count; i++)
        {
            // Chop off the "Demo" part of any demo name that has it
            string name = Demos.GetName(i);
            if (name.StartsWith("Demo"))
            {
                name = name.Substring("Demo".Length);
            }

            if (UI.ButtonRound(name, 4 * Units.cm2m))
            {
                Demos.SetActive(i);
            }
            UI.SameLine();
        }
        UI.WindowEnd();
    }
コード例 #5
0
    static void Main(string[] args)
    {
        Demos.TestMode = args.Length > 0 && args[0].ToLower() == "-test";

        StereoKitApp.settings.assetsFolder = Program.Root;
        if (!StereoKitApp.Initialize("StereoKit C#", Demos.TestMode ? Runtime.Flatscreen : Runtime.MixedReality, true))
        {
            Environment.Exit(1);
        }
        CommonInit();

        Demos.FindDemos();
        Demos.SetActive(args.Length > 0 ? args[0] : "Geo");
        Demos.Initialize();

        while (StereoKitApp.Step(() =>
        {
            Demos.Update();
            CommonUpdate();
        }))
        {
            ;
        }

        Demos.Shutdown();
        CommonShutdown();

        StereoKitApp.Shutdown();
    }
コード例 #6
0
ファイル: ProgramHej.cs プロジェクト: aspcodenet/Facit121
        public static void Main(string[] args)
        {
            var kenneln = new KennelSystemet();

            kenneln.Run();

            var l = new FunkDemos();

            l.Run();


            var demos111 = new Demos();

            demos111.Run();


            var demo20120517 = new Demos20210517();

            demo20120517.Run();



            var looparLabbar = new  LooparLabbar();

            looparLabbar.Lab7();
            looparLabbar.Lab6a();
            looparLabbar.Lab6b();



            var demo = new Demos();

            demo.Run();

            Console.WriteLine("321132312");


            var helloWorld = new HelloWorld();

            //HelloWorld.Run123();
            helloWorld.Run123();

            //var variabelLabbar = new VariabelLabbar();
            //variabelLabbar.Run();


            var ifLabbar = new IfLabbar();

            ifLabbar.Run();


            var funktionsLabbar = new FunktionsLabbar();

            string theMessage = funktionsLabbar.PrintMessage();

            //funktionsLabbar.Lab2();
            funktionsLabbar.Run();
        }
コード例 #7
0
ファイル: DemosParser.cs プロジェクト: AntonKrug/emul8-modded
 public IEnumerable <Tuple <string[], DemoDetail[]> > GetDemosGroupedByFolder()
 {
     return(Demos
            .GroupBy(
                x => new DirectoryPath(baseDirectory, Path.GetDirectoryName(x.Path)),
                y => y)
            .OrderBy(x => x.Key.SplitPath.Length)
            .Select(x => Tuple.Create(x.Key.SplitPath, x.ToArray())));
 }
コード例 #8
0
        public MainViewModel()
        {
            Demos = new[]
            {
                new Demo
                {
                    Name  = "Manual Values",
                    Files = new[] { "ManualValues.xaml" },
                    Type  = typeof(ManualValues)
                },
                new Demo
                {
                    Name  = "Manual Values: X and Y",
                    Files = new[] { "ManualValuesXAndY.xaml" },
                    Type  = typeof(ManualValuesXAndY)
                },
                new Demo
                {
                    Name  = "Manual Values: Colors",
                    Files = new[] { "ManualValuesColors.xaml" },
                    Type  = typeof(ManualValuesColors)
                },
                new Demo
                {
                    Name  = "Manual Values: Labels",
                    Files = new[] { "ManualValuesLabels.xaml" },
                    Type  = typeof(ManualValuesLabels)
                },
                new Demo
                {
                    Name  = "Binding Observable Collection",
                    Files = new[] { "BindingObservableCollection.xaml", "BindingObservableCollectionViewModel.cs" },
                    Type  = typeof(BindingObservableCollection)
                },
                new Demo
                {
                    Name  = "Binding Data Properties",
                    Files = new[] { "BindingDataProperties.xaml", "BindingDataPropertiesViewModel.cs" },
                    Type  = typeof(BindingDataProperties)
                },
                new Demo
                {
                    Name  = "Sample Values",
                    Files = new[] { "SampleValues.xaml" },
                    Type  = typeof(SampleValues)
                },
                new Demo
                {
                    Name  = "Sample Values Binding",
                    Files = new[] { "SampleValuesBinding.xaml" },
                    Type  = typeof(SampleValuesBinding)
                }
            };

            SelectedDemo = Demos.FirstOrDefault();
        }
コード例 #9
0
ファイル: Statistics.cs プロジェクト: K0bin/CsgoStatistics
 public void AddAll(Statistics statistics)
 {
     Demos.AddRange(statistics.Demos);
     Kills.AddRange(statistics.Kills);
     Rounds.AddRange(statistics.Rounds);
     foreach (var(key, value) in statistics.Movement)
     {
         Movement[key] = value;
     }
 }
コード例 #10
0
ファイル: MainForm.cs プロジェクト: lagdotcom/qroute
        public void ClearDemo()
        {
            foreach (ParsedDemo Demo in Demos)
            {
                Demo.Dispose();
            }
            Demos.Clear();
            Display.ClearDemos();
            GC.Collect();

            Display.Invalidate();
            ClockState(false);
        }
コード例 #11
0
        private void PopulateComboBox()
        {
            var demos = Assembly.GetExecutingAssembly().GetTypes().Where(type => type.BaseType == typeof(DemoBase))
                        .ToList();

            foreach (var demo in demos)
            {
                Demos.Add(Activator.CreateInstance(demo) as DemoBase);
            }

            AllDemos = new ListCollectionView(Demos);
            AllDemos.GroupDescriptions.Add(new PropertyGroupDescription(nameof(DemoBase.Category)));
        }
コード例 #12
0
ファイル: MainForm.cs プロジェクト: lagdotcom/qroute
        private void MergeDemo(string filename)
        {
            QDemo      dem  = QDemo.Load(filename);
            ParsedDemo demo = new ParsedDemo();

            if (Demos.Count == 0)
            {
                MinTime = 100;
                MaxTime = 0;
            }
            demo.Parse(dem);
            Demos.Add(demo);

            MinTime = Math.Min(MinTime, demo.Start);
            MaxTime = Math.Max(MaxTime, demo.End);
        }
コード例 #13
0
ファイル: MainForm.cs プロジェクト: lagdotcom/qroute
        private void AutoloadBsp()
        {
            var demo = Demos.First();

            if (demo == null || demo.Models.Count < 1)
            {
                return;
            }

            foreach (PackFile pak in LoadedPaks)
            {
                string bspfile = demo.Models[0];
                if (pak.Contains(bspfile))
                {
                    Bsp bsp = new Bsp(pak.GetFile(bspfile));
                    Display.Bsp = bsp;
                }
            }
        }
コード例 #14
0
ファイル: MainForm.cs プロジェクト: lagdotcom/qroute
        private void OverlayDemo(string filename)
        {
            QDemo      dem = QDemo.Load(filename);
            ParsedDemo demo;

            if (Demos.Count > 0)
            {
                demo = Demos[0];
            }
            else
            {
                demo = new ParsedDemo();
                Demos.Add(demo);
                MinTime = 100;
                MaxTime = 0;
            }
            demo.Parse(dem);

            MinTime = Math.Min(MinTime, demo.Start);
            MaxTime = Math.Max(MaxTime, demo.End);
        }
コード例 #15
0
        public async Task LoadDemosHeader()
        {
            NotificationMessage = "Loading...";
            IsBusy          = true;
            HasNotification = true;

            try
            {
                List <string> folders = new List <string>();

                if (SelectedFolder != null)
                {
                    folders.Add(SelectedFolder);
                }
                else
                {
                    folders = Folders.ToList();
                }

                Demos.Clear();

                var demos = await _demosService.GetDemosHeader(folders);

                foreach (var demo in demos)
                {
                    Demos.Add(demo);
                }

                DataGridDemosCollection.Refresh();
            }
            catch (Exception e)
            {
                Logger.Instance.Log(e);
            }
            finally
            {
                IsBusy          = false;
                HasNotification = false;
            }
        }
コード例 #16
0
        public void LoadDemoData(StorageFile dataFile)
        {
            var document = new XmlDocument();

            document.Load(dataFile.LocalPath);

            var node = document.SelectSingleNode(@"./Age");

            if (node == null)
            {
                return;
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "Age":
                    Demos.Add(ListDataItem.FromXml(childNode));
                    break;
                }
            }
        }
コード例 #17
0
        public void LoadCombinedData(StorageFile dataFile)
        {
            var document = new XmlDocument();

            document.Load(dataFile.LocalPath);

            var node = document.SelectSingleNode(@"/TargetCustomers");

            if (node == null)
            {
                return;
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "SlideHeader":
                    Headers.Add(ListDataItem.FromXml(childNode));
                    break;

                case "Demo":
                    Demos.Add(ListDataItem.FromXml(childNode));
                    break;

                case "HHI":
                    HHIs.Add(ListDataItem.FromXml(childNode));
                    break;

                case "Geography":
                    Geographies.Add(ListDataItem.FromXml(childNode));
                    break;
                }
            }

            CombinedList.AddRange(Demos);
            CombinedList.AddRange(HHIs);
            CombinedList.AddRange(Geographies);
        }
コード例 #18
0
        public App()
        {
            var items =
                Device.OS == TargetPlatform.iOS ? Demos.SamplesForPlatform(Demos.Platform.iOS) :
                Device.OS == TargetPlatform.Android ? Demos.SamplesForPlatform(Demos.Platform.Android) :
                Device.OS == TargetPlatform.Windows ? Demos.SamplesForPlatform(Demos.Platform.UWP) :
                Demos.SamplesForPlatform(Demos.Platform.All);

            var masterDetail = new MasterDetailPage
            {
                IsGestureEnabled = true,
                MasterBehavior   = MasterBehavior.Popover
            };
            var detailPage = new DetailsPage(items.First());
            var navPage    = new NavigationPage(detailPage)
            {
                BarBackgroundColor = XamarinBlue,
                BarTextColor       = Color.White,
            };
            var masterPage = new MasterPage(items, demo =>
            {
                masterDetail.IsPresented = false;
                detailPage.SetDemo(demo);
                navPage.Title = demo;
            });

            if (Device.OS == TargetPlatform.iOS)
            {
                masterPage.Icon = "hamburger.png";
            }

            masterDetail.Master = masterPage;
            masterDetail.Detail = navPage;

            MainPage = masterDetail;

            masterDetail.IsPresented = true;
        }
コード例 #19
0
ファイル: Program.cs プロジェクト: jjhartmann/StereoKit
    /// :End:

    //////////////////////

    static void Main(string[] args)
    {
        Demos.TestMode = args.Length > 0 && args[0].ToLower() == "-test";
        Time.Scale     = Demos.TestMode ? 0 : 1;

        Log.Filter = LogLevel.Diagnostic;
        StereoKitApp.settings.assetsFolder = Program.Root;
        if (!StereoKitApp.Initialize("StereoKit C#", Demos.TestMode ? Runtime.Flatscreen : Runtime.MixedReality, true))
        {
            Environment.Exit(1);
        }

        if (Demos.TestMode)
        {
            Input.HandVisible(Handed.Max, false);
        }

        CommonInit();

        Demos.FindDemos();
        Demos.SetActive(args.Length > 0 ? args[0] : "Lines");
        Demos.Initialize();

        while (StereoKitApp.Step(() =>
        {
            Demos.Update();
            CommonUpdate();
        }))
        {
            ;
        }

        Demos.Shutdown();
        CommonShutdown();

        StereoKitApp.Shutdown();
    }
コード例 #20
0
 public Demos AddDemo(Demos newData)
 {
     db.Demos.Add(newData);
     return(newData);
 }
コード例 #21
0
 public void SetDemo(string demo)
 {
     Title   = demo;
     Content = new SkiaView(Demos.GetSample(demo));
 }
コード例 #22
0
        private void Load()
        {
            var document = new XmlDocument();

            document.Load(ResourceManager.Instance.DataTargetCustomersFile.LocalPath);

            var node = document.SelectSingleNode(@"/TargetCustomers");

            if (node == null)
            {
                return;
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "SlideHeader":
                    foreach (XmlAttribute attribute in childNode.Attributes)
                    {
                        switch (attribute.Name)
                        {
                        case "Value":
                            if (!string.IsNullOrEmpty(attribute.Value))
                            {
                                Headers.Add(attribute.Value);
                            }
                            break;
                        }
                    }
                    break;

                case "Demo":
                    foreach (XmlAttribute attribute in childNode.Attributes)
                    {
                        switch (attribute.Name)
                        {
                        case "Value":
                            if (!string.IsNullOrEmpty(attribute.Value))
                            {
                                Demos.Add(attribute.Value);
                            }
                            break;
                        }
                    }
                    break;

                case "HHI":
                    foreach (XmlAttribute attribute in childNode.Attributes)
                    {
                        switch (attribute.Name)
                        {
                        case "Value":
                            if (!string.IsNullOrEmpty(attribute.Value))
                            {
                                HHIs.Add(attribute.Value);
                            }
                            break;
                        }
                    }
                    break;

                case "Geography":
                    foreach (XmlAttribute attribute in childNode.Attributes)
                    {
                        switch (attribute.Name)
                        {
                        case "Value":
                            if (!string.IsNullOrEmpty(attribute.Value))
                            {
                                Geographies.Add(attribute.Value);
                            }
                            break;
                        }
                    }
                    break;
                }
            }
        }
コード例 #23
0
 public override bool HasUpdatedStatus()
 {
     return(base.HasUpdatedStatus() || Demos.Where(d => d.HasNewStatus() || d.HasUpdatedStatus()).Any());
 }